le_clkSync API Reference

Data Structures

struct  le_clkSync_ClockTime_t
 

Files

file  le_clkSync_common.h
 
file  le_clkSync_interface.h
 

Macros

#define LE_CLKSYNC_IPV6_ADDR_LENGTH_MAX   128
 
#define LE_CLKSYNC_SOURCE_CONFIG_LENGTH_MAX   128
 
#define LE_CLKSYNC_SOURCE_PRIORITY_MAX   9
 
#define LE_CLKSYNC_SOURCE_PRIORITY_MIN   0
 
#define LE_CLKSYNC_CONFIG_TREE_ROOT_SOURCE   "clockTime:/source"
 
#define LE_CLKSYNC_CONFIG_NODE_SOURCE   "source"
 
#define LE_CLKSYNC_CONFIG_NODE_SOURCE_PRIORITY   "priority"
 
#define LE_CLKSYNC_CONFIG_NODE_SOURCE_CONFIG   "config"
 
#define LE_CLKSYNC_CONFIG_NODE_SOURCE_LAST_STATUS   "lastStatus"
 
#define LE_CLKSYNC_CONFIG_NODE_SOURCE_AVC_TIMESTAMP   "timeStamp"
 

Typedefs

typedef void(* le_clkSync_UpdateSystemTimeHandlerFunc_t) (le_result_t status, void *contextPtr)
 
typedef void(* le_clkSync_DisconnectHandler_t) (void *)
 

Enumerations

enum  le_clkSync_ClockSource_t { LE_CLKSYNC_CLOCK_SOURCE_TP = 0, LE_CLKSYNC_CLOCK_SOURCE_NTP = 1, LE_CLKSYNC_CLOCK_SOURCE_GPS = 2, LE_CLKSYNC_CLOCK_SOURCE_MAX = 3 }
 
enum  le_clkSync_UpdateSystemStatus_t {
  LE_CLKSYNC_UPDATE_SYSTEM_STATUS_SUCCESS = 0, LE_CLKSYNC_UPDATE_SYSTEM_STATUS_NOT_TRIED = 1, LE_CLKSYNC_UPDATE_SYSTEM_STATUS_IN_PROGRESS = 2, LE_CLKSYNC_UPDATE_SYSTEM_STATUS_GENERAL_ERROR = 3,
  LE_CLKSYNC_UPDATE_SYSTEM_STATUS_NOT_CONFIGURED = 4, LE_CLKSYNC_UPDATE_SYSTEM_STATUS_UNSUPPORTED = 5, LE_CLKSYNC_UPDATE_SYSTEM_STATUS_UNAVAILABLE = 6, LE_CLKSYNC_UPDATE_SYSTEM_STATUS_GET_ERROR = 7,
  LE_CLKSYNC_UPDATE_SYSTEM_STATUS_UPDATE_ERROR = 8, LE_CLKSYNC_UPDATE_SYSTEM_STATUS_MAX = 9
}
 

Functions

void le_clkSync_ConnectService (void)
 
le_result_t le_clkSync_TryConnectService (void)
 
LE_FULL_API void le_clkSync_SetServerDisconnectHandler (le_clkSync_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_clkSync_DisconnectService (void)
 
le_result_t le_clkSync_GetCurrentTime (le_clkSync_ClockTime_t *timePtr, le_clkSync_ClockSource_t *sourcePtr)
 
le_clkSync_UpdateSystemStatus_t le_clkSync_GetUpdateSystemStatus (le_clkSync_ClockSource_t source)
 
void le_clkSync_UpdateSystemTime (le_clkSync_UpdateSystemTimeHandlerFunc_t handlerPtr, void *contextPtr)
 

Detailed Description

Macro Definition Documentation

◆ LE_CLKSYNC_CONFIG_TREE_ROOT_SOURCE

#define LE_CLKSYNC_CONFIG_TREE_ROOT_SOURCE   "clockTime:/source"

Config tree root directory and node paths for clock time configurations

◆ LE_CLKSYNC_IPV6_ADDR_LENGTH_MAX

#define LE_CLKSYNC_IPV6_ADDR_LENGTH_MAX   128

Max length of a clock source as an address or name. This is taken as the max length required for the max width of an IPv6 address, i.e. 128

◆ LE_CLKSYNC_SOURCE_PRIORITY_MAX

#define LE_CLKSYNC_SOURCE_PRIORITY_MAX   9

Clock source's priority max and min values

Typedef Documentation

◆ le_clkSync_DisconnectHandler_t

typedef void(* le_clkSync_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

◆ le_clkSync_UpdateSystemTimeHandlerFunc_t

typedef void(* le_clkSync_UpdateSystemTimeHandlerFunc_t) (le_result_t status, void *contextPtr)

Handler for the receiving the status of the execution of a system time update

Enumeration Type Documentation

◆ le_clkSync_ClockSource_t

Clock source type. Note that these defined values are the same as defined in Sierra Wireless' proprietary LWM2M object 33405's instance ID

Enumerator
LE_CLKSYNC_CLOCK_SOURCE_TP 

Time Protocol server provided clock.

LE_CLKSYNC_CLOCK_SOURCE_NTP 

Network Time Protocol server provided clock.

LE_CLKSYNC_CLOCK_SOURCE_GPS 

GPS provided clock.

LE_CLKSYNC_CLOCK_SOURCE_MAX 

Max value in range.

◆ le_clkSync_UpdateSystemStatus_t

Clock source's update status. Note that these defined values are the same as defined in Sierra Wireless' proprietary LWM2M object 33405's resource 3

Enumerator
LE_CLKSYNC_UPDATE_SYSTEM_STATUS_SUCCESS 

Successful.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_NOT_TRIED 

Not tried.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_IN_PROGRESS 

In progress & not finished.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_GENERAL_ERROR 

General error.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_NOT_CONFIGURED 

Not configured.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_UNSUPPORTED 

Unsupported source type.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_UNAVAILABLE 

Unavailable source.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_GET_ERROR 

Failed to get clock time.

LE_CLKSYNC_UPDATE_SYSTEM_STATUS_UPDATE_ERROR 

Failed to update system time.

Function Documentation

◆ le_clkSync_ConnectService()

void le_clkSync_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_clkSync_DisconnectService()

void le_clkSync_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_clkSync_GetCurrentTime()

le_result_t le_clkSync_GetCurrentTime ( le_clkSync_ClockTime_t timePtr,
le_clkSync_ClockSource_t sourcePtr 
)

Clock source type. Note that these defined values are the same as defined in Sierra Wireless' proprietary LWM2M object 33405's instance ID Clock source's update status. Note that these defined values are the same as defined in Sierra Wireless' proprietary LWM2M object 33405's resource 3 Data structure for clock time Handler for the receiving the status of the execution of a system time update Retrieve the current clock time from the clock source(s) configured and return it back to the caller without updating it into the system clock

Returns
  • LE_OK Function successful
  • LE_BAD_PARAMETER A parameter is incorrect
  • LE_FAULT Function failed
  • LE_UNSUPPORTED Function not supported by the target
Parameters
[out]timePtrClock time retrieved from configured source
[out]sourcePtrClock source from which the current time is acquired

◆ le_clkSync_GetUpdateSystemStatus()

le_clkSync_UpdateSystemStatus_t le_clkSync_GetUpdateSystemStatus ( le_clkSync_ClockSource_t  source)

Retrieve the status of the execution of a system time update using the given source

Returns
  • le_clkSync_UpdateSystemStatus_t
Parameters
[in]sourceClock source used to get the current time

◆ le_clkSync_SetServerDisconnectHandler()

LE_FULL_API void le_clkSync_SetServerDisconnectHandler ( le_clkSync_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_clkSync_TryConnectService()

le_result_t le_clkSync_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.

◆ le_clkSync_UpdateSystemTime()

void le_clkSync_UpdateSystemTime ( le_clkSync_UpdateSystemTimeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Execute a system clock time update that will be completed asynchronously & return the resulting status back via its callback UpdateSystemTimeHandler

Parameters
[in]handlerPtrRequester's handler for receiving results
[in]contextPtr