#include "legato.h"
Go to the source code of this file.
Macros | |
#define | LE_TEMP_SENSOR_NAME_MAX_LEN 100 |
#define | LE_TEMP_SENSOR_NAME_MAX_BYTES 101 |
#define | LE_TEMP_THRESHOLD_NAME_MAX_LEN 100 |
#define | LE_TEMP_THRESHOLD_NAME_MAX_BYTES 101 |
Typedefs | |
typedef struct le_temp_Sensor * | le_temp_SensorRef_t |
typedef struct le_temp_ThresholdEventHandler * | le_temp_ThresholdEventHandlerRef_t |
typedef void(* | le_temp_ThresholdEventHandlerFunc_t) (le_temp_SensorRef_t sensor, const char *threshold, void *contextPtr) |
Functions | |
void | le_temp_ConnectService (void) |
le_result_t | le_temp_TryConnectService (void) |
void | le_temp_DisconnectService (void) |
le_temp_SensorRef_t | le_temp_Request (const char *sensorName) |
le_result_t | le_temp_GetSensorName (le_temp_SensorRef_t sensor, char *sensorName, size_t sensorNameNumElements) |
le_temp_ThresholdEventHandlerRef_t | le_temp_AddThresholdEventHandler (le_temp_ThresholdEventHandlerFunc_t handlerPtr, void *contextPtr) |
void | le_temp_RemoveThresholdEventHandler (le_temp_ThresholdEventHandlerRef_t addHandlerRef) |
le_result_t | le_temp_GetTemperature (le_temp_SensorRef_t sensor, int32_t *temperaturePtr) |
le_result_t | le_temp_SetThreshold (le_temp_SensorRef_t sensor, const char *threshold, int32_t temperature) |
le_result_t | le_temp_GetThreshold (le_temp_SensorRef_t sensor, const char *threshold, int32_t *temperaturePtr) |
le_result_t | le_temp_StartMonitoring (void) |
Detailed Description
Legato Temperature Monitoring include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
Macro Definition Documentation
#define LE_TEMP_SENSOR_NAME_MAX_BYTES 101 |
Maximum sensor's name string length. One extra byte is added for the null character.
#define LE_TEMP_SENSOR_NAME_MAX_LEN 100 |
Maximum sensor's name string length.
#define LE_TEMP_THRESHOLD_NAME_MAX_BYTES 101 |
Maximum threshold's name string length. One extra byte is added for the null character.
#define LE_TEMP_THRESHOLD_NAME_MAX_LEN 100 |
Maximum threshold's name string length.
Typedef Documentation
typedef struct le_temp_Sensor* le_temp_SensorRef_t |
Reference type for a temperature sensor.
typedef void(* le_temp_ThresholdEventHandlerFunc_t) (le_temp_SensorRef_t sensor, const char *threshold, void *contextPtr) |
Handler for Temperature event.
- Parameters
-
sensor Temperature sensor reference. threshold Name of the raised threshold. contextPtr
typedef struct le_temp_ThresholdEventHandler* le_temp_ThresholdEventHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_temp_ThresholdEvent'
Function Documentation
le_temp_ThresholdEventHandlerRef_t le_temp_AddThresholdEventHandler | ( | le_temp_ThresholdEventHandlerFunc_t | handlerPtr, |
void * | contextPtr | ||
) |
Add handler function for EVENT 'le_temp_ThresholdEvent'
This event provides information on the threshold reached.
- Parameters
-
[in] handlerPtr [in] contextPtr
void le_temp_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_temp_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_temp_GetSensorName | ( | le_temp_SensorRef_t | sensor, |
char * | sensorName, | ||
size_t | sensorNameNumElements | ||
) |
Retrieve the temperature sensor's name from its reference.
- Returns
- LE_OK The function succeeded.
- LE_OVERFLOW The name length exceed the maximum length.
- LE_FAULT The function failed.
- Parameters
-
[in] sensor Temperature sensor reference. [out] sensorName Name of the temperature sensor. [in] sensorNameNumElements
le_result_t le_temp_GetTemperature | ( | le_temp_SensorRef_t | sensor, |
int32_t * | temperaturePtr | ||
) |
Get the temperature in degree Celsius.
- Returns
- LE_OK The function succeeded.
- LE_FAULT The function failed to get the temperature.
- Parameters
-
[in] sensor Temperature sensor reference. [out] temperaturePtr Temperature in degree Celsius.
le_result_t le_temp_GetThreshold | ( | le_temp_SensorRef_t | sensor, |
const char * | threshold, | ||
int32_t * | temperaturePtr | ||
) |
Get the temperature threshold in degree Celsius.
- Returns
- LE_OK The function succeeded.
- LE_FAULT The function failed.
- Parameters
-
[in] sensor Temperature sensor reference. [in] threshold Name of the threshold. [out] temperaturePtr Temperature threshold in degree Celsius.
void le_temp_RemoveThresholdEventHandler | ( | le_temp_ThresholdEventHandlerRef_t | addHandlerRef | ) |
Remove handler function for EVENT 'le_temp_ThresholdEvent'
- Parameters
-
[in] addHandlerRef
le_temp_SensorRef_t le_temp_Request | ( | const char * | sensorName | ) |
Request a temperature sensor reference.
- Returns
- Reference to the temperature sensor.
- NULL when the requested sensor is not supported.
- Parameters
-
[in] sensorName Name of the temperature sensor.
le_result_t le_temp_SetThreshold | ( | le_temp_SensorRef_t | sensor, |
const char * | threshold, | ||
int32_t | temperature | ||
) |
Set the temperature threshold in degree Celsius. This function does not start the temperature monitoring, call le_temp_StartMonitoring() to start it.
- Returns
- LE_OK The function succeeded.
- LE_FAULT The function failed.
- Parameters
-
[in] sensor Temperature sensor reference. [in] threshold Name of the threshold. [in] temperature Temperature threshold in degree Celsius.
le_result_t le_temp_StartMonitoring | ( | void | ) |
Start the temperature monitoring with the temperature thresholds configured by le_temp_SetThreshold() function.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER There is a mismatch with the configured threshold values.
- LE_FAULT The function failed to apply the thresholds.
le_result_t le_temp_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.