Macros | Functions | Variables
LWM2MObjectMagnetometer.c File Reference

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

#include "XdkCommonInfo.h"
#include "LWM2MObjects.h"
#include "LWM2MUtil.h"
#include "LWM2M.h"
#include <math.h>
#include <Serval_Exceptions.h>
+ Include dependency graph for LWM2MObjectMagnetometer.c:

Macros

#define BCDS_MODULE_ID   XDK_COMMON_ID_LWM2MOBJECTMAGNETOMETER
 
#define FLUSH_RESOURCES
 
#define M_PI   3.14159265358979323846
 
#define MAGNETOMETER_RESOURCES_INDEX(res)   LWM2M_RESOURCES_INDEX(LWM2MObjectMagnetometerResources, res)
 

Functions

static float CalculateDirection (float xValue, float yValue)
 
void LWM2MObjectMagnetometer_Disable (void)
 Disable LWM2M object instance to stop providing sensor data. Sets unit to "" and all other values to 0. Function is thread safe, it schedules a job for serval. Execution may therefore be deferred. More...
 
void LWM2MObjectMagnetometer_Enable (float minRangeValue, float maxRangeValue)
 Enable LWM2M object instance to start providing sensor data. Function is thread safe, it schedules a job for serval. Execution may therefore be deferred. More...
 
void LWM2MObjectMagnetometer_Init (void)
 Initialize LWM2M object instance. Must be called before any other function call. More...
 
void LWM2MObjectMagnetometer_SetValues (float xValue, float yValue, float zValue)
 Set values for x-, y-, and z-axis. More...
 
static void LWM2MObjectMagnetometerInternalDisable (void)
 
static void LWM2MObjectMagnetometerInternalEnable (float minRangeValue, float maxRangeValue)
 
static void LWM2MObjectMagnetometerInternalSetValues (float xValue, float yValue, float zValue)
 

Variables

static Lwm2m_Call_T AsyncCall_Disabler = { .call = LWM2MObjectMagnetometerInternalDisable }
 
static Lwm2m_Pair_Resource_Update_T AsyncCall_Enabler = { .set_pair = LWM2MObjectMagnetometerInternalEnable, .mutex = LWM2M_MUTEX_INIT_VALUE }
 
static
Lwm2m_Tripple_Resource_Update_T 
AsyncCall_Updater = { .set_tripple = LWM2MObjectMagnetometerInternalSetValues, .mutex = LWM2M_MUTEX_INIT_VALUE }
 
LWM2MObjectMagnetometer_Resource_T LWM2MObjectMagnetometerResources
 LWM2M resource data for instance 0. More...
 
static Lwm2m_URI_Path_T MagnetometerUriPath = { LWM2MOBJECTS_IX_MAGNETOMETER_0, LWM2MOBJECTS_IX_MAGNETOMETER_0, -1 }
 
static volatile bool Started = false
 

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_COMMON_ID_LWM2MOBJECTMAGNETOMETER
#define FLUSH_RESOURCES
Value:
retcode_t Lwm2mReporting_multipleResourcesChanged(Lwm2m_URI_Path_T *objectInstanceUripath, uint8_t count,...)
Notify the stack that a resource has changed. This will cause the stack to notify any pending observe...
static Lwm2m_URI_Path_T MagnetometerUriPath
Definition: LWM2MObjectMagnetometer.c:86
#define MAGNETOMETER_RESOURCES_INDEX(res)
Definition: LWM2MObjectMagnetometer.c:70
#define M_PI   3.14159265358979323846
#define MAGNETOMETER_RESOURCES_INDEX (   res)    LWM2M_RESOURCES_INDEX(LWM2MObjectMagnetometerResources, res)

Function Documentation

static float CalculateDirection ( float  xValue,
float  yValue 
)
static

+ Here is the caller graph for this function:

void LWM2MObjectMagnetometer_Disable ( void  )

Refer interface header for description

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void LWM2MObjectMagnetometer_Enable ( float  minRangeValue,
float  maxRangeValue 
)

Refer interface header for description

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void LWM2MObjectMagnetometer_Init ( void  )

Refer interface header for description

void LWM2MObjectMagnetometer_SetValues ( float  xValue,
float  yValue,
float  zValue 
)

Refer interface header for description

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void LWM2MObjectMagnetometerInternalDisable ( void  )
static
static void LWM2MObjectMagnetometerInternalEnable ( float  minRangeValue,
float  maxRangeValue 
)
static

+ Here is the call graph for this function:

static void LWM2MObjectMagnetometerInternalSetValues ( float  xValue,
float  yValue,
float  zValue 
)
static

+ Here is the call graph for this function:

Variable Documentation

Lwm2m_Call_T AsyncCall_Disabler = { .call = LWM2MObjectMagnetometerInternalDisable }
static
LWM2MObjectMagnetometer_Resource_T LWM2MObjectMagnetometerResources
Initial value:
=
{
{ 5603, LWM2M_FLOAT(0.0F) | LWM2M_READ_ONLY },
{ 5604, LWM2M_FLOAT(0.0F) | LWM2M_READ_ONLY },
{ 5701, LWM2M_STRING_RO("") },
{ 5702, LWM2M_FLOAT(0.0F) | LWM2M_READ_ONLY },
{ 5703, LWM2M_FLOAT(0.0F) | LWM2M_READ_ONLY },
{ 5704, LWM2M_FLOAT(0.0F) | LWM2M_READ_ONLY },
{ 5705, LWM2M_FLOAT(0.0F) | LWM2M_READ_ONLY },
}
#define LWM2M_READ_ONLY
Definition: Serval_Lwm2m.h:218
#define LWM2M_FLOAT(floating)
Definition: Serval_Lwm2m.h:99
#define LWM2M_STRING_RO(string)
Definition: Serval_Lwm2m.h:95
volatile bool Started = false
static

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