# Hardware antenna

**Detailed Description**

This section contains APIs related to antenna management to set or get the active antenna’s configuration.

- *group* Telematics\_platform\_hardware\_antenna

    - Typedefs

- using GetActiveAntCb = std::function&lt;void(int antIndex, [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) error)&gt;

    - This function is called with the response to the getActiveAntenna API.

The callback can be invoked from multiple threads, so the client needs to ensure that the implementation is thread-safe.

- Param antIndex:

    - **[in]** Active physical antenna switch path index.

- Param error:

    - **[in]** Return code indicating whether the operation succeeded or not [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-10/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d).

- class IAntennaListener : public [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[IServiceStatusListener](https://docs.qualcomm.com/doc/80-PF458-10/topic/class_a00049.html#_CPPv4N5telux6common22IServiceStatusListenerE)

    - Listen class to get antenna configuration related notifications. The client needs to implement these methods as briefly as possible and avoid blocking calls. Class methods can be invoked from multiple threads, so the client needs to ensure that the implementation is thread-safe.

Public Functions

- inline virtual void onActiveAntennaChange(int antIndex)

    - This function is called whenever any active cellular antenna is changed.

On platforms with access control enabled, the caller needs to have TELUX\_PLATFORM\_ANTENNA\_MGMT permission to receive this notification.

- Parameters:

    - **antIndex** – **[in]** Indicates which antenna is now active.

- inline virtual ~IAntennaListener()

    - [IAntennaListener](https://docs.qualcomm.com/doc/80-PF458-10/topic/hardware_antenna.html#a00568) destructor.

- class IAntennaManager

    - [IAntennaManager](https://docs.qualcomm.com/doc/80-PF458-10/topic/hardware_antenna.html#a00569) provides an interface to set and get the active antenna’s configuration.

Public Functions

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6common13ServiceStatusE) getServiceStatus() = 0

    - Indicates whether the object is in a usable state.

- Returns:

    - [telux::common::ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-10/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#a00023_1ga7063b4a1071b6581022e30b730684e4d) indicating the current status of the antenna configuration service.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6common6StatusE) registerListener(std::weak\_ptr&lt;[IAntennaListener](https://docs.qualcomm.com/doc/80-PF458-10/topic/class_a00568.html#_CPPv4N5telux8platform8hardware16IAntennaListenerE)&gt; listener) = 0

    - Registers the listener for antenna manager indications.

- Parameters:

    - **listener** – **[in]** Pointer to the implemented listener.

- Returns:

    - Status of the registration request.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6common6StatusE) deregisterListener(std::weak\_ptr&lt;[IAntennaListener](https://docs.qualcomm.com/doc/80-PF458-10/topic/class_a00568.html#_CPPv4N5telux8platform8hardware16IAntennaListenerE)&gt; listener) = 0

    - Deregisters the previously registered listener.

- Parameters:

    - **listener** – **[in]** Pointer to the registered listener that needs to be removed.

- Returns:

    - Status of the deregistration request.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6common6StatusE) setActiveAntenna(int antIndex, [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-10/topic/typedef_a00236_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Switches the cellular antenna configuration between antennas when an antenna is damaged. This API is to be invoked when the client detects that the currently active antenna is broken and determines that a switch to another antenna is required to maintain cellular services. The index of the antenna is based on the order in which the antenna appears in the radio frequency control (RFC). Across reboots or SSR, this configuration will not be persistent and it will reset back to the initial antenna. Clients are required to call this API again to switch to the desired antenna.

On platforms with access control enabled, the caller needs to have TELUX\_PLATFORM\_ANTENNA\_MGMT permission to successfully invoke this API.

- Parameters:

    - - **antIndex** – **[in]** Physical antenna switch path index to be set, this index starts with 0.
- **callback** – **[in]** Optional callback pointer to get the response of the setActiveAntenna request.

- Returns:

    - Status of the setActiveAntenna request; either success or the suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-10/topic/common.html#_CPPv4N5telux6common6StatusE) getActiveAntenna([GetActiveAntCb](https://docs.qualcomm.com/doc/80-PF458-10/topic/typedef_a00030_1ga5aa53868eb309e8c0290eb4efe973e18.html#_CPPv4N5telux8platform8hardware14GetActiveAntCbE) callback) = 0

    - Gets the current active cellular antenna configuration index of the device. Valid only when the device is camped on network.

On platforms with access control enabled, the caller needs to have TELUX\_PLATFORM\_ANTENNA\_MGMT permission to successfully invoke this API.

- Parameters:

    - **callback** – **[in]** Callback function to get the getActiveAntenna response.

- Returns:

    - Status of the getActiveAntenna request; either success or the suitable error code.

- inline virtual ~IAntennaManager()

    - [IAntennaManager](https://docs.qualcomm.com/doc/80-PF458-10/topic/hardware_antenna.html#a00569) destructor.

Last Published: Mar 31, 2026

[Previous Topic
telux::platform::IDeviceInfoManager](https://docs.qualcomm.com/bundle/publicresource/80-PF458-10/topics/device_info.md) [Next Topic
Time](https://docs.qualcomm.com/bundle/publicresource/80-PF458-10/topics/time.md)