le_antenna_interface.h File Reference

#include "legato.h"

Go to the source code of this file.

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)
 

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)
 
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 addHandlerRef)
 
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

Legato Antenna Monitoring include file.

Typedef Documentation

typedef struct le_antenna_Obj* le_antenna_ObjRef_t

Reference type for an antenna diagnostic.

typedef struct le_antenna_StatusEventHandler* le_antenna_StatusEventHandlerRef_t

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

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

Handler for antenna status.

Parameters
antennaRefantenna reference
statusantenna status
contextPtr

Enumeration Type Documentation

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.

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_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
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.

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_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_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_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_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_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
Parameters
[in]antennaRefantenna reference
[out]antennaTypePtrallocated antenna type
void le_antenna_RemoveStatusEventHandler ( le_antenna_StatusEventHandlerRef_t  addHandlerRef)

Remove handler function for EVENT 'le_antenna_StatusEvent'

Parameters
[in]addHandlerRef
le_antenna_ObjRef_t le_antenna_Request ( le_antenna_Type_t  antennaType)

Requested the antenna monitoring.

Returns
  • Reference to the antenna object.
  • NULL on failure.
Parameters
[in]antennaTypeantenna to be monitored
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_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_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_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.