le_bootReason API Reference

Files

file  le_bootReason_interface.h
 
file  le_bootReason_common.h
 
file  le_bootReason_interface.h
 

Macros

#define LE_BOOTREASON_MAX_GPIO_ADC_COUNT   100
 
#define LE_BOOTREASON_MAX_GPIO_NAME_BYTES   10
 
#define LE_BOOTREASON_MAX_ADC_NAME_BYTES   10
 
#define LE_BOOTREASON_MAX_GPIO_STATUS_BLOCK_BYTES   41
 
#define LE_BOOTREASON_MAX_ADC_STATUS_BLOCK_BYTES   72
 
#define LE_BOOTREASON_MAX_ADC_INTERVAL_BYTES   24
 
#define LE_BOOTREASON_MAX_TIMER_STATUS_BLOCK_BYTES   37
 
#define LE_BOOTREASON_MAX_SHUTDOWN_STRATEGY_BLOCK_BYTES   40
 

Typedefs

typedef void(* le_bootReason_DisconnectHandler_t) (void *)
 

Functions

void le_bootReason_ConnectService (void)
 
le_result_t le_bootReason_TryConnectService (void)
 
LE_FULL_API void le_bootReason_SetServerDisconnectHandler (le_bootReason_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_bootReason_DisconnectService (void)
 
bool le_bootReason_WasTimer (void)
 
bool le_bootReason_WasGpio (uint32_t gpioNum)
 
bool le_bootReason_WasAdc (uint32_t adcNum)
 
le_result_t le_bootReason_GetGpioCount (uint8_t *gpioArrayPtr, size_t *gpioArraySizePtr)
 
le_result_t le_bootReason_GetGpioInfo (char *buf, size_t bufSize, const char *LE_NONNULL gpio)
 
le_result_t le_bootReason_GetAdcCount (uint8_t *adcArrayPtr, size_t *adcArraySizePtr)
 
le_result_t le_bootReason_GetAdcInfo (char *buf, size_t bufSize, const char *LE_NONNULL adc)
 
le_result_t le_bootReason_GetAdcInterval (char *buf, size_t bufSize)
 
le_result_t le_bootReason_GetTimerInfo (char *buf, size_t bufSize)
 
le_result_t le_bootReason_GetShutdownStrategy (char *buf, size_t bufSize)
 

Detailed Description

Typedef Documentation

◆ le_bootReason_DisconnectHandler_t

typedef void(* le_bootReason_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Function Documentation

◆ le_bootReason_ConnectService()

void le_bootReason_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_bootReason_DisconnectService()

void le_bootReason_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_bootReason_GetAdcCount()

le_result_t le_bootReason_GetAdcCount ( uint8_t *  adcArrayPtr,
size_t *  adcArraySizePtr 
)

Get the number of ADCs that are specified in the system.

Returns
LE_OK if we successfully get all the ADCs and place them in the array. LE_FAULT otherwise.
Parameters
[out]adcArrayPtr
[in,out]adcArraySizePtr

◆ le_bootReason_GetAdcInfo()

le_result_t le_bootReason_GetAdcInfo ( char *  buf,
size_t  bufSize,
const char *LE_NONNULL  adc 
)

Get the information for a specific ADC and place all the information into the buffer.

Returns
LE_OK if we successfully get all the information. LE_FAULT otherwise.
Parameters
[out]buf
[in]bufSize
[in]adc

◆ le_bootReason_GetAdcInterval()

le_result_t le_bootReason_GetAdcInterval ( char *  buf,
size_t  bufSize 
)

Get the information about ADC interval and place all the information into the buffer.

Returns
LE_OK if we successfully get all the information. LE_FAULT otherwise.
Parameters
[out]buf
[in]bufSize

◆ le_bootReason_GetGpioCount()

le_result_t le_bootReason_GetGpioCount ( uint8_t *  gpioArrayPtr,
size_t *  gpioArraySizePtr 
)

Get the number of GPIOs that are specified in the system.

Returns
LE_OK if we successfully get all the GPIOs and place them in the array. LE_FAULT otherwise.
Parameters
[out]gpioArrayPtr
[in,out]gpioArraySizePtr

◆ le_bootReason_GetGpioInfo()

le_result_t le_bootReason_GetGpioInfo ( char *  buf,
size_t  bufSize,
const char *LE_NONNULL  gpio 
)

Get the information for a specific GPIO and place all the information into the buffer.

Returns
LE_OK if we successfully get all the information. LE_FAULT otherwise.
Parameters
[out]buf
[in]bufSize
[in]gpio

◆ le_bootReason_GetShutdownStrategy()

le_result_t le_bootReason_GetShutdownStrategy ( char *  buf,
size_t  bufSize 
)

Get the information about shutdown strategy and place all the information into the buffer.

Returns
LE_OK if we successfully get all the information. LE_FAULT otherwise.
Parameters
[out]buf
[in]bufSize

◆ le_bootReason_GetTimerInfo()

le_result_t le_bootReason_GetTimerInfo ( char *  buf,
size_t  bufSize 
)

Get the information about timer and place all the information into the buffer.

Returns
LE_OK if we successfully get all the information. LE_FAULT otherwise.
Parameters
[out]buf
[in]bufSize

◆ le_bootReason_SetServerDisconnectHandler()

LE_FULL_API void le_bootReason_SetServerDisconnectHandler ( le_bootReason_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_bootReason_TryConnectService()

le_result_t le_bootReason_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_bootReason_WasAdc()

bool le_bootReason_WasAdc ( uint32_t  adcNum)

Checks whether boot reason was due to the specified ADC having a reading above or below the configured limits.

Returns
true if boot reason was due to the given ADC or false otherwise.
Note
The process exits if an invalid ADC number is passed. Check corresponding device documents for valid list of ADC numbers.
Parameters
[in]adcNumADC number

◆ le_bootReason_WasGpio()

bool le_bootReason_WasGpio ( uint32_t  gpioNum)

Checks whether boot-reason was specific gpio change. GPIO number is specified in parameter.

Returns
  • TRUE if boot-reason was specified gpio change.
  • FALSE otherwise.
Note
The process exits if invalid gpio number is passed. Check corresponding device documents for valid list of gpio.
Parameters
[in]gpioNumGPIO number.

◆ le_bootReason_WasTimer()

bool le_bootReason_WasTimer ( void  )

Checks whether boot-reason was timer expiry.

Returns
  • TRUE if boot-reason was timer expiry.
  • FALSE otherwise.