RDK Documentation (Open Sourced RDK Components)
Device Settings - Host APIs

Description

The host module is the central module of the Device Settings module. Each devices establishes one and only one host instance that represents the entire host device.

Functions

static Hostdevice::Host::getInstance (void)
 This API is used to get a reference to the single instance of the Host object. More...
 
void device::Host::addPowerModeListener (PowerModeChangeListener *l)
 This API is used to register listeners for Power Mode change event. The listener object is created by application and should be released by the application once the listener is removed. Listeners will be notified with the new mode via the listener's powerModeChanged() callback. More...
 
void device::Host::removePowerModeChangeListener (PowerModeChangeListener *l)
 This API is used to remove a listener from Power Mode change listener list. More...
 
void device::Host::addDisplayConnectionListener (DisplayConnectionChangeListener *l)
 This API is used to register listeners for Display connection change event. The listener will be notified if Display device is connected/disconnected from the video output port. The notification only carries the state change of the connection. It does not carry any other system state change that may have been triggered by the connection. The application is responsible to query the various parts of system to detect any such change. For example, when a TV device is replaced, the application shall query the video output port again upon the connection for the new resolution supported by the TV. The listener object is created by application and should be released by the application once the listener is removed. More...
 
void device::Host::removeDisplayConnectionListener (DisplayConnectionChangeListener *l)
 This API is used to remove listeners from the Display connection change event list. More...
 
void device::Host::notifyPowerChange (const int mode)
 This function is used to get the current power state. More...
 
void device::Host::notifyDisplayConnectionChange (int portHandle, bool newConnectionStatus)
 
bool device::Host::setPowerMode (int mode)
 This API is used to change the power mode of the device. This function will set the power mode to active or standby and turn off all the ouput ports. The accepted modes are defined as constants in host module: Host::kPowerOn, Host::kPowerOff, Host::kPowerStandby. Upon the return of this API, the power mode listeners will be notified of the new power mode. This function is currently not supported. More...
 
int device::Host::getPowerMode ()
 This API is used to get the current power mode of the device. This function is currently not supported. More...
 
List< VideoOutputPortdevice::Host::getVideoOutputPorts ()
 This API is used to get the list of the video output ports supported on the device. A complete list of ports that are physically present on the platform will be returned, regardless the state of each port. If no Video Output Port is available on the device, an empty List will be returned. More...
 
List< AudioOutputPortdevice::Host::getAudioOutputPorts ()
 This API is used to get the list of the audio output ports supported on the device. A complete list of ports that are physically present on the platform will be returned, regardless the state of each port. If no Audio Output Port is available on the device, an empty List will be returned. More...
 
List< VideoDevicedevice::Host::getVideoDevices ()
 This API is used to get the list of the video devices (i.e. Decoders) supported on the device. If no Video Device is available on the device, an empty List will be returned. More...
 
VideoOutputPortdevice::Host::getVideoOutputPort (const std::string &name)
 This API is used to get the reference to the video output port by its name. The name of the port must match one of those returned by Host::getVideoOutputPorts. Application shall not develop code that depends on the actual naming conventions of the video output port. Such code as Host::getVideoOutputPort("HDMI0") is discouraged as the name of the left-most HDMI output port may not necessarily be "HDMI0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports. More...
 
VideoOutputPortdevice::Host::getVideoOutputPort (int id)
 This API is used to get a reference to the video output port by its id. The name of the port must match one of those returned by Host::getVideoOutputPorts. Application shall not develop code that depends on the actual naming conventions of the video output port. Such code as Host::getVideoOutputPort("HDMI0") is discouraged as the name of the left-most HDMI output port may not necessarily be "HDMI0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports. More...
 
AudioOutputPortdevice::Host::getAudioOutputPort (const std::string &name)
 This API is used to get the reference to the audio output port by its name. The name of the port must match one of those returned by Host::getAudioOutputPorts. Application shall not develop code that depends on the actual naming conventions of the Audio output port. Such code as Host::getAudioOutputPort("SPDIF0") is discouraged as the name of the left-most SPDIF output port may not necessarily be "SPDIF0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports. More...
 
AudioOutputPortdevice::Host::getAudioOutputPort (int id)
 This API is used to get a reference to the Audio output port by its id. The name of the port must match one of those returned by Host::getAudioOutputPorts. Application shall not develop code that depends on the actual naming conventions of the Audio output port. Such code as Host::getAudioOutputPort("SPDIF0") is discouraged as the name of the left-most SPDIF output port may not necessarily be "SPDIF0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports. More...
 
SleepMode device::Host::getPreferredSleepMode ()
 This API is used to gets the Preferred sleep Mode and implements the low power mode for RDK platform. dsGetPreferredSleepMode(&mode) function returns preferred sleep mode which is persisted. More...
 
int device::Host::setPreferredSleepMode (const SleepMode)
 This API is used to set the Preferred sleep Mode and implements the low power mode for RDK platform. More...
 
List< SleepModedevice::Host::getAvailableSleepModes ()
 This function is used to get the available sleep modes. More...
 
float device::Host::getCPUTemperature ()
 This API gets CPU temperature. More...
 
uint32_t device::Host::getVersion (void)
 Get DS HAL API Version. More...
 
void device::Host::setVersion (uint32_t versionNumber)
 
void device::Host::getHostEDID (std::vector< uint8_t > &edid) const
 This function is used to get the EDID information of the host device. More...
 
std::string device::Host::getSocIDFromSDK ()
 This API to get the SOC ID. dsGetSocIDFromSDK() function returns the SOC ID in string format. More...
 
void device::Host::getCurrentAudioFormat (dsAudioFormat_t &audioFormat)
 
void device::Host::getSinkDeviceAtmosCapability (dsATMOSCapability_t &atmosCapability)
 
void device::Host::setAudioAtmosOutputMode (bool enable)
 
void device::Host::setAssociatedAudioMixing (const bool mixing)
 This API is used to enable/disable Associated Audio Mixing. More...
 
void device::Host::getAssociatedAudioMixing (bool *mixing)
 This API is used to get status of Associated Audio Mixing. More...
 
void device::Host::setFaderControl (const int mixerbalance)
 This API is used to set the mixerbalance betweeen main and associated audio. More...
 
void device::Host::getFaderControl (int *mixerBalance)
 This API is used to get the mixerbalance betweeen main and associated audio. More...
 
void device::Host::setPrimaryLanguage (const std::string pLang)
 This API is used to set Primary language. More...
 
void device::Host::getPrimaryLanguage (std::string &pLang)
 This API is used to get the current Primary language. More...
 
void device::Host::setSecondaryLanguage (const std::string sLang)
 This API is used to set Secondary language. More...
 
void device::Host::getSecondaryLanguage (std::string &sLang)
 This API is used to get the current AC4 Secondary language. More...
 
bool device::Host::isHDMIOutPortPresent ()
 
std::string device::Host::getDefaultVideoPortName ()
 
std::string device::Host::getDefaultAudioPortName ()
 

Function Documentation

◆ getInstance()

Host & device::Host::getInstance ( void  )
static

This API is used to get a reference to the single instance of the Host object.

Returns
reference to Host singleton instance

Definition at line 88 of file host.cpp.

◆ addPowerModeListener()

void device::Host::addPowerModeListener ( PowerModeChangeListener l)

This API is used to register listeners for Power Mode change event. The listener object is created by application and should be released by the application once the listener is removed. Listeners will be notified with the new mode via the listener's powerModeChanged() callback.

Parameters
[in]PowerModeChangeListenerPointer to Power Mode change listener
Returns
None

Definition at line 116 of file host.cpp.

◆ removePowerModeChangeListener()

void device::Host::removePowerModeChangeListener ( PowerModeChangeListener l)

This API is used to remove a listener from Power Mode change listener list.

Parameters
[in]

Definition at line 142 of file host.cpp.

◆ addDisplayConnectionListener()

void device::Host::addDisplayConnectionListener ( DisplayConnectionChangeListener l)

This API is used to register listeners for Display connection change event. The listener will be notified if Display device is connected/disconnected from the video output port. The notification only carries the state change of the connection. It does not carry any other system state change that may have been triggered by the connection. The application is responsible to query the various parts of system to detect any such change. For example, when a TV device is replaced, the application shall query the video output port again upon the connection for the new resolution supported by the TV. The listener object is created by application and should be released by the application once the listener is removed.

Parameters
[in]DisplayConnectionChangeListenerPointer to Display connection change listener
Returns
None

Definition at line 174 of file host.cpp.

◆ removeDisplayConnectionListener()

void device::Host::removeDisplayConnectionListener ( DisplayConnectionChangeListener l)

This API is used to remove listeners from the Display connection change event list.

Parameters
[in]DisplayConnectionChangeListenerThe listener to remove
Returns
None

Definition at line 200 of file host.cpp.

◆ notifyPowerChange()

void device::Host::notifyPowerChange ( const int  mode)

This function is used to get the current power state.

Parameters
[in]modePower mode of the decoder.
Returns
None.

Definition at line 224 of file host.cpp.

◆ setPowerMode()

bool device::Host::setPowerMode ( int  mode)

This API is used to change the power mode of the device. This function will set the power mode to active or standby and turn off all the ouput ports. The accepted modes are defined as constants in host module: Host::kPowerOn, Host::kPowerOff, Host::kPowerStandby. Upon the return of this API, the power mode listeners will be notified of the new power mode. This function is currently not supported.

Parameters
[in]modeNew Power Mode.
Returns
None

Definition at line 256 of file host.cpp.

◆ getPowerMode()

int device::Host::getPowerMode ( )

This API is used to get the current power mode of the device. This function is currently not supported.

Returns
Current power mode

Definition at line 269 of file host.cpp.

◆ getVideoOutputPorts()

List< VideoOutputPort > device::Host::getVideoOutputPorts ( )

This API is used to get the list of the video output ports supported on the device. A complete list of ports that are physically present on the platform will be returned, regardless the state of each port. If no Video Output Port is available on the device, an empty List will be returned.

Parameters
None
Returns
A list of videooutputport instances

Definition at line 285 of file host.cpp.

◆ getAudioOutputPorts()

List< AudioOutputPort > device::Host::getAudioOutputPorts ( )

This API is used to get the list of the audio output ports supported on the device. A complete list of ports that are physically present on the platform will be returned, regardless the state of each port. If no Audio Output Port is available on the device, an empty List will be returned.

Returns
A list of audiooutputport instances

Definition at line 309 of file host.cpp.

◆ getVideoDevices()

List< VideoDevice > device::Host::getVideoDevices ( )

This API is used to get the list of the video devices (i.e. Decoders) supported on the device. If no Video Device is available on the device, an empty List will be returned.

Returns
A list of videodevice instances

Definition at line 331 of file host.cpp.

◆ getVideoOutputPort() [1/2]

VideoOutputPort & device::Host::getVideoOutputPort ( const std::string &  name)

This API is used to get the reference to the video output port by its name. The name of the port must match one of those returned by Host::getVideoOutputPorts. Application shall not develop code that depends on the actual naming conventions of the video output port. Such code as Host::getVideoOutputPort("HDMI0") is discouraged as the name of the left-most HDMI output port may not necessarily be "HDMI0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports.

Parameters
[in]nameName of the port
Returns
Reference to its object

Definition at line 350 of file host.cpp.

◆ getVideoOutputPort() [2/2]

VideoOutputPort & device::Host::getVideoOutputPort ( int  id)

This API is used to get a reference to the video output port by its id. The name of the port must match one of those returned by Host::getVideoOutputPorts. Application shall not develop code that depends on the actual naming conventions of the video output port. Such code as Host::getVideoOutputPort("HDMI0") is discouraged as the name of the left-most HDMI output port may not necessarily be "HDMI0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports.

Parameters
[in]idport id
Returns
Reference to its object

Definition at line 369 of file host.cpp.

◆ getAudioOutputPort() [1/2]

AudioOutputPort & device::Host::getAudioOutputPort ( const std::string &  name)

This API is used to get the reference to the audio output port by its name. The name of the port must match one of those returned by Host::getAudioOutputPorts. Application shall not develop code that depends on the actual naming conventions of the Audio output port. Such code as Host::getAudioOutputPort("SPDIF0") is discouraged as the name of the left-most SPDIF output port may not necessarily be "SPDIF0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports.

Parameters
[in]nameName of the port
Returns
Reference to its object

Definition at line 388 of file host.cpp.

◆ getAudioOutputPort() [2/2]

AudioOutputPort & device::Host::getAudioOutputPort ( int  id)

This API is used to get a reference to the Audio output port by its id. The name of the port must match one of those returned by Host::getAudioOutputPorts. Application shall not develop code that depends on the actual naming conventions of the Audio output port. Such code as Host::getAudioOutputPort("SPDIF0") is discouraged as the name of the left-most SPDIF output port may not necessarily be "SPDIF0" from all implementations. IllegalArgumentException will be thrown if the "name" does not match any of the ports.

Parameters
[in]idport id
Returns
Reference to its object

Definition at line 407 of file host.cpp.

◆ getPreferredSleepMode()

SleepMode device::Host::getPreferredSleepMode ( )

This API is used to gets the Preferred sleep Mode and implements the low power mode for RDK platform. dsGetPreferredSleepMode(&mode) function returns preferred sleep mode which is persisted.

Parameters
None
Returns
A list of sleepmode instances

Definition at line 422 of file host.cpp.

◆ setPreferredSleepMode()

int device::Host::setPreferredSleepMode ( const SleepMode  mode)

This API is used to set the Preferred sleep Mode and implements the low power mode for RDK platform.

Parameters
[in]modesleep mode that is expected to be persisted
Returns
ID value of the sleepmode instance

Definition at line 444 of file host.cpp.

◆ getAvailableSleepModes()

List< SleepMode > device::Host::getAvailableSleepModes ( )

This function is used to get the available sleep modes.

Returns
A list of sleepmode instance

Definition at line 456 of file host.cpp.

◆ getCPUTemperature()

float device::Host::getCPUTemperature ( )

This API gets CPU temperature.

Returns
CPU temperature in default float value
Return values
temperatureIndicates CPU temerature in centigrade.

Definition at line 470 of file host.cpp.

◆ getVersion()

uint32_t device::Host::getVersion ( void  )

Get DS HAL API Version.

Returns
Returns 4 byte Versionnumber
Return values
In4 byte VersionNumber, Two Most significant Bytes are Major number and Two Least Significant Bytes are minor number.

Definition at line 485 of file host.cpp.

◆ getHostEDID()

void device::Host::getHostEDID ( std::vector< uint8_t > &  edid) const

This function is used to get the EDID information of the host device.

Parameters
[out]edidEDID info of the device.
Returns
None.

Definition at line 511 of file host.cpp.

◆ getSocIDFromSDK()

std::string device::Host::getSocIDFromSDK ( )

This API to get the SOC ID. dsGetSocIDFromSDK() function returns the SOC ID in string format.

Parameters
None
Returns
Device ID

Definition at line 544 of file host.cpp.

◆ getCurrentAudioFormat()

void device::Host::getCurrentAudioFormat ( dsAudioFormat_t audioFormat)

Host::getCurrentAudioFormat(dsAudioFormat_t &audioFormat)

Parameters
[in/out]Audio format of currently playing content
Returns
None

Definition at line 559 of file host.cpp.

◆ getSinkDeviceAtmosCapability()

void device::Host::getSinkDeviceAtmosCapability ( dsATMOSCapability_t &  atmosCapability)

Host::getSinkDeviceAtmosCapability(dsATMOSCapability_t & atmosCapability)

Parameters
[in/out]Sink device ATMOS capability
Returns
None

Definition at line 585 of file host.cpp.

◆ setAssociatedAudioMixing()

void device::Host::setAssociatedAudioMixing ( const bool  mixing)

This API is used to enable/disable Associated Audio Mixing.

If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.

Parameters
[in]mixingenable/disable Associated Audio Mixing.
Returns
None

Definition at line 626 of file host.cpp.

◆ getAssociatedAudioMixing()

void device::Host::getAssociatedAudioMixing ( bool *  mixing)

This API is used to get status of Associated Audio Mixing.

Returns
Current status of Associated Audio Mixing

Definition at line 644 of file host.cpp.

◆ setFaderControl()

void device::Host::setFaderControl ( const int  mixerBalance)

This API is used to set the mixerbalance betweeen main and associated audio.

If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.

Parameters
[in]Newmixerbalance betweeen main and associated audio.
Returns
None

Definition at line 676 of file host.cpp.

◆ getFaderControl()

void device::Host::getFaderControl ( int *  mixerBalance)

This API is used to get the mixerbalance betweeen main and associated audio.

Returns
Current mixerbalance betweeen main and associated audio

Definition at line 692 of file host.cpp.

◆ setPrimaryLanguage()

void device::Host::setPrimaryLanguage ( const std::string  pLang)

This API is used to set Primary language.

If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.

Parameters
[string]Primary language to be set
Returns
None

Definition at line 725 of file host.cpp.

◆ getPrimaryLanguage()

void device::Host::getPrimaryLanguage ( std::string &  pLang)

This API is used to get the current Primary language.

If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.

Returns
[string] Primary language

Definition at line 746 of file host.cpp.

◆ setSecondaryLanguage()

void device::Host::setSecondaryLanguage ( const std::string  sLang)

This API is used to set Secondary language.

If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.

Parameters
[string]Secondary language to be set
Returns
None

Definition at line 772 of file host.cpp.

◆ getSecondaryLanguage()

void device::Host::getSecondaryLanguage ( std::string &  sLang)

This API is used to get the current AC4 Secondary language.

If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.

Returns
[string] AC4 Secondary language

Definition at line 793 of file host.cpp.