le_antenna API Reference

Files

file  le_antenna_common.h
 
file  le_antenna_interface.h
 

Typedefs

typedef struct le_antenna_Obj * le_antenna_ObjRef_t
 
typedef struct le_antenna_StatusEventHandler * le_antenna_StatusEventHandlerRef_t
 
typedef void(* le_antenna_StatusHandlerFunc_t) (le_antenna_ObjRef_t antennaRef, le_antenna_Status_t status, void *contextPtr)
 
typedef void(* le_antenna_DisconnectHandler_t) (void *)
 

Enumerations

enum  le_antenna_Type_t { LE_ANTENNA_PRIMARY_CELLULAR = 0, LE_ANTENNA_DIVERSITY_CELLULAR = 1, LE_ANTENNA_GNSS = 2, LE_ANTENNA_MAX = 3 }
 
enum  le_antenna_Status_t {
  LE_ANTENNA_SHORT_CIRCUIT = 0, LE_ANTENNA_CLOSE_CIRCUIT = 1, LE_ANTENNA_OPEN_CIRCUIT = 2, LE_ANTENNA_OVER_CURRENT = 3,
  LE_ANTENNA_INACTIVE = 4, LE_ANTENNA_LAST_STATUS = 5
}
 

Functions

void le_antenna_ConnectService (void)
 
le_result_t le_antenna_TryConnectService (void)
 
LE_FULL_API void le_antenna_SetServerDisconnectHandler (le_antenna_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_antenna_DisconnectService (void)
 
le_antenna_ObjRef_t le_antenna_Request (le_antenna_Type_t antennaType)
 
le_result_t le_antenna_GetType (le_antenna_ObjRef_t antennaRef, le_antenna_Type_t *antennaTypePtr)
 
le_result_t le_antenna_SetShortLimit (le_antenna_ObjRef_t antennaRef, uint32_t shortLimit)
 
le_result_t le_antenna_GetShortLimit (le_antenna_ObjRef_t antennaRef, uint32_t *shortLimitPtr)
 
le_result_t le_antenna_SetOpenLimit (le_antenna_ObjRef_t antennaRef, uint32_t openLimit)
 
le_result_t le_antenna_GetOpenLimit (le_antenna_ObjRef_t antennaRef, uint32_t *openLimitPtr)
 
le_antenna_StatusEventHandlerRef_t le_antenna_AddStatusEventHandler (le_antenna_ObjRef_t antennaRef, le_antenna_StatusHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_antenna_RemoveStatusEventHandler (le_antenna_StatusEventHandlerRef_t handlerRef)
 
le_result_t le_antenna_GetStatus (le_antenna_ObjRef_t antennaRef, le_antenna_Status_t *statusPtr)
 
le_result_t le_antenna_SetExternalAdc (le_antenna_ObjRef_t antennaRef, int8_t adcId)
 
le_result_t le_antenna_GetExternalAdc (le_antenna_ObjRef_t antennaRef, int8_t *adcIdPtr)
 

Detailed Description

Typedef Documentation

◆ le_antenna_DisconnectHandler_t

typedef void(* le_antenna_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

◆ le_antenna_ObjRef_t

typedef struct le_antenna_Obj* le_antenna_ObjRef_t

Reference type for an antenna diagnostic.

◆ le_antenna_StatusEventHandlerRef_t

typedef struct le_antenna_StatusEventHandler* le_antenna_StatusEventHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'le_antenna_StatusEvent'

◆ le_antenna_StatusHandlerFunc_t

typedef void(* le_antenna_StatusHandlerFunc_t) (le_antenna_ObjRef_t antennaRef, le_antenna_Status_t status, void *contextPtr)

Handler for antenna status.

Enumeration Type Documentation

◆ le_antenna_Status_t

Antenna status

Enumerator
LE_ANTENNA_SHORT_CIRCUIT 

antenna in short circuit: unknown state.

LE_ANTENNA_CLOSE_CIRCUIT 

antenna in closed circuit: presence of antenna.

LE_ANTENNA_OPEN_CIRCUIT 

antenna in open circuit: there is no antenna.

LE_ANTENNA_OVER_CURRENT 

antenna in short circuit and current HW protection circuitry has tripped. Only applicable for GNSS antenna.

LE_ANTENNA_INACTIVE 

Antenna diagnosis feature is inactive.

LE_ANTENNA_LAST_STATUS 

last status value.

◆ le_antenna_Type_t

Antenna type.

Enumerator
LE_ANTENNA_PRIMARY_CELLULAR 

Cellular antenna type.

LE_ANTENNA_DIVERSITY_CELLULAR 

Diversity antenna type.

LE_ANTENNA_GNSS 

GNSS positioning antenna type.

Function Documentation

◆ le_antenna_AddStatusEventHandler()

le_antenna_StatusEventHandlerRef_t le_antenna_AddStatusEventHandler ( le_antenna_ObjRef_t  antennaRef,
le_antenna_StatusHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'le_antenna_StatusEvent'

This event provides information on antenna status for the given antennaRef.

Parameters
[in]antennaRefantenna reference
[in]handlerPtr
[in]contextPtr

◆ le_antenna_ConnectService()

void le_antenna_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

◆ le_antenna_DisconnectService()

void le_antenna_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client Specific Functions.

This function is created automatically.

◆ le_antenna_GetExternalAdc()

le_result_t le_antenna_GetExternalAdc ( le_antenna_ObjRef_t  antennaRef,
int8_t *  adcIdPtr 
)

Get the external ADC used to monitor the requested antenna.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_UNSUPPORTED request not supported
  • LE_FAULT on other failure
Note
If the returned ADC index is "-1", it means no external ADC are used to monitor the requested antenna.
Parameters
[in]antennaRefantenna reference
[out]adcIdPtrADC index used to monitor the requested antenna

◆ le_antenna_GetOpenLimit()

le_result_t le_antenna_GetOpenLimit ( le_antenna_ObjRef_t  antennaRef,
uint32_t *  openLimitPtr 
)

Get the ADC value used to detect an open circuit.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_FAULT on other failure
Parameters
[in]antennaRefantenna reference
[out]openLimitPtrADC value used to detect an open circuit

◆ le_antenna_GetShortLimit()

le_result_t le_antenna_GetShortLimit ( le_antenna_ObjRef_t  antennaRef,
uint32_t *  shortLimitPtr 
)

Get the ADC value used to detect a short circuit.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_FAULT on other failure
Parameters
[in]antennaRefantenna reference
[out]shortLimitPtrADC value used to detect a short circuit

◆ le_antenna_GetStatus()

le_result_t le_antenna_GetStatus ( le_antenna_ObjRef_t  antennaRef,
le_antenna_Status_t statusPtr 
)

Get the antenna status.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_UNSUPPORTED if the antenna detection is not supported
  • LE_FAULT on other failure
Parameters
[in]antennaRefantenna reference
[out]statusPtrantenna status

◆ le_antenna_GetType()

le_result_t le_antenna_GetType ( le_antenna_ObjRef_t  antennaRef,
le_antenna_Type_t antennaTypePtr 
)

Get the antenna type.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_BAD_PARAMETER if an invalid reference provided.
Parameters
[in]antennaRefantenna reference
[out]antennaTypePtrallocated antenna type

◆ le_antenna_RemoveStatusEventHandler()

void le_antenna_RemoveStatusEventHandler ( le_antenna_StatusEventHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_antenna_StatusEvent'

Parameters
[in]handlerRef

◆ le_antenna_Request()

le_antenna_ObjRef_t le_antenna_Request ( le_antenna_Type_t  antennaType)

Reference type for an antenna diagnostic. Antenna type. Antenna status Handler for antenna status. Reference type used by Add/Remove functions for EVENT 'le_antenna_StatusEvent' Requested the antenna monitoring.

Returns
  • Reference to the antenna object.
  • NULL on failure.
Parameters
[in]antennaTypeantenna to be monitored

◆ le_antenna_SetExternalAdc()

le_result_t le_antenna_SetExternalAdc ( le_antenna_ObjRef_t  antennaRef,
int8_t  adcId 
)

Set the external ADC used to monitor the requested antenna.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_UNSUPPORTED request not supported
  • LE_FAULT on other failure
Note
The same external ADC may not be selected for both antennas at the same time.
Parameters
[in]antennaRefantenna reference
[in]adcIdADC index used to monitor the requested antenna

◆ le_antenna_SetOpenLimit()

le_result_t le_antenna_SetOpenLimit ( le_antenna_ObjRef_t  antennaRef,
uint32_t  openLimit 
)

Set the ADC value used to detect an open circuit.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_FAULT on other failure
Parameters
[in]antennaRefantenna reference
[in]openLimitADC value used to detect an open circuit

◆ le_antenna_SetServerDisconnectHandler()

LE_FULL_API void le_antenna_SetServerDisconnectHandler ( le_antenna_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ le_antenna_SetShortLimit()

le_result_t le_antenna_SetShortLimit ( le_antenna_ObjRef_t  antennaRef,
uint32_t  shortLimit 
)

Set the ADC value used to detect a short circuit.

Returns
  • LE_OK on success
  • LE_NOT_FOUND if the antenna reference is unknown
  • LE_FAULT on other failure
Parameters
[in]antennaRefantenna reference
[in]shortLimitADC value used to detect a short circuit

◆ le_antenna_TryConnectService()

le_result_t le_antenna_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.