Macros | Functions | Variables
LWM2MObjectSensorDevice.c File Reference

This file provides the implementation of LWM2MObjectSensorDevice module. More...

#include "XdkCommonInfo.h"
#include "LWM2MSensorDeviceAccelerometer.h"
#include "LWM2MSensorDeviceEnvironment.h"
#include "LWM2MSensorDeviceGyroscope.h"
#include "LWM2MSensorDeviceMagnetometer.h"
#include "LWM2MSensorDeviceIlluminance.h"
#include "LWM2MObjectSensorDevice.h"
#include "LWM2MObjects.h"
#include "LWM2MUtil.h"
#include "timers.h"
#include "BCDS_Basics.h"
#include "BCDS_CmdProcessor.h"
#include "XDK_SensorHandle.h"
#include <Serval_Exceptions.h>
#include <Serval_Clock.h>
#include <Serval_Lwm2m.h>
+ Include dependency graph for LWM2MObjectSensorDevice.c:

Macros

#define BCDS_MODULE_ID   XDK_COMMON_ID_LWM2MOBJECTSENSORDEVICE
 
#define DEFAULT_SENSORS_MODE   AVG
 
#define DEFAULT_SENSORS_TRANSPORT_INTERVAL   UINT32_C(15000)
 
#define MAC_LENGTH   UINT8_C(18)
 
#define MAX_MODE_LENGTH   UINT8_C(8)
 
#define SENSORDEVICE_RESOURCES_INDEX(res)   LWM2M_RESOURCES_INDEX(LWM2MObjectSensorDeviceResources, res)
 
#define SENSORS_READ_INTERVAL   UINT32_C(100)
 

Functions

static retcode_t Interval (Lwm2mSerializer_T *serializer_ptr, Lwm2mParser_T *parser_ptr)
 
static LWM2M_MUTEX_INSTANCE (Mutex)
 
Retcode_T LWM2MObjectSensorDevice_Disable (void)
 Disable LWM2M object instance to stop providing sensor device controls. Stops the sensors timer to frequently read and process values. More...
 
void LWM2MObjectSensorDevice_Enable (void)
 Enable LWM2M object instance to start providing sensor device controls. Starts sensors timer to frequently read and process values. More...
 
void LWM2MObjectSensorDevice_Init (const char *mac)
 Initialize LWM2M object instance. Must be called before any other function call. More...
 
static retcode_t PreprocessingMode (Lwm2mSerializer_T *serializer_ptr, Lwm2mParser_T *parser_ptr)
 
static void SensorTimer (xTimerHandle xTimer)
 
void SensorTimerHandler (void *param1, uint32_t data)
 Handler to update the timer objects. More...
 

Variables

static ProcessingMode_T LastMode = DEFAULT_SENSORS_MODE
 
static int32_t LastTransportInterval = DEFAULT_SENSORS_TRANSPORT_INTERVAL
 
static uint64_t LastTransportTime = 0
 
LWM2MObjectSensorDevice_Resource_T LWM2MObjectSensorDeviceResources
 LWM2M resource data for instance 0. More...
 
static ProcessingMode_T Mode = DEFAULT_SENSORS_MODE
 
static volatile bool Started = false
 
static xTimerHandle TimerHandle = NULL
 
static int32_t TransportInterval = DEFAULT_SENSORS_TRANSPORT_INTERVAL
 

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_COMMON_ID_LWM2MOBJECTSENSORDEVICE
#define DEFAULT_SENSORS_MODE   AVG
#define DEFAULT_SENSORS_TRANSPORT_INTERVAL   UINT32_C(15000)
#define MAC_LENGTH   UINT8_C(18)
#define MAX_MODE_LENGTH   UINT8_C(8)
#define SENSORDEVICE_RESOURCES_INDEX (   res)    LWM2M_RESOURCES_INDEX(LWM2MObjectSensorDeviceResources, res)
#define SENSORS_READ_INTERVAL   UINT32_C(100)

Function Documentation

static retcode_t Interval ( Lwm2mSerializer_T serializer_ptr,
Lwm2mParser_T parser_ptr 
)
static

+ Here is the call graph for this function:

static LWM2M_MUTEX_INSTANCE ( Mutex  )
static
Retcode_T LWM2MObjectSensorDevice_Disable ( void  )

Refer interface header for description

+ Here is the caller graph for this function:

void LWM2MObjectSensorDevice_Enable ( void  )

Refer interface header for description

void LWM2MObjectSensorDevice_Init ( const char *  mac)

Refer interface header for description

+ Here is the call graph for this function:

static retcode_t PreprocessingMode ( Lwm2mSerializer_T serializer_ptr,
Lwm2mParser_T parser_ptr 
)
static

+ Here is the call graph for this function:

static void SensorTimer ( xTimerHandle  xTimer)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SensorTimerHandler ( void *  param1,
uint32_t  data 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

last time for sending sensor values in ms

int32_t LastTransportInterval = DEFAULT_SENSORS_TRANSPORT_INTERVAL
static

time of last sending information

uint64_t LastTransportTime = 0
static
LWM2MObjectSensorDevice_Resource_T LWM2MObjectSensorDeviceResources
Initial value:
=
{
{ 1, LWM2M_BOOL(true) },
{ 2, LWM2M_BOOL(true) },
{ 3, LWM2M_BOOL(true) },
{ 4, LWM2M_BOOL(true) },
{ 5, LWM2M_BOOL(true) },
{ 6, LWM2M_BOOL(true) },
{ 7, LWM2M_BOOL(true) },
{ 9, LWM2M_STRING_RO("") },
}
static retcode_t Interval(Lwm2mSerializer_T *serializer_ptr, Lwm2mParser_T *parser_ptr)
Definition: LWM2MObjectSensorDevice.c:208
#define LWM2M_DYNAMIC(dyn)
Definition: Serval_Lwm2m.h:105
static retcode_t PreprocessingMode(Lwm2mSerializer_T *serializer_ptr, Lwm2mParser_T *parser_ptr)
Definition: LWM2MObjectSensorDevice.c:240
#define LWM2M_STRING_RO(string)
Definition: Serval_Lwm2m.h:95
#define LWM2M_BOOL(boolean)
Definition: Serval_Lwm2m.h:101

time for sending sensor values in ms

volatile bool Started = false
static
xTimerHandle TimerHandle = NULL
static

Timer handle for periodically reading sensor values

int32_t TransportInterval = DEFAULT_SENSORS_TRANSPORT_INTERVAL
static

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:01 by doxygen 1.8.8