Loading...
Searching...
No Matches

Base IPSO sensor functionality to implement similar IPSO objects. More...

Detailed Description

Base IPSO sensor functionality to implement similar IPSO objects.

Warning
This feature is experimental!
This module is not a complete object, but provides common functionalities shared among different IPSO sensor objects. It should not be used directly, from the application, but rather be used as a dependency for other objects.

To use this module add USEMODULE += wakaama_objects_ipso_sensor_base to the dependencies of your own object module.

Resources

Given that IPSO sensors share a common set of resources, these are implemented by this module.

Name ID Mandatory Type Range Units Implemented
Sensor Value 5700 Yes Float - See 5701 Yes
Min. Measured Value 5601 No Float - See 5701 Yes
Max. Measured Value 5602 No Float - See 5701 Yes
Min. Range Value 5603 No Float - See 5701 Yes
Max. Range Value 5604 No Float - See 5701 Yes
Reset Min. and Max. Measured Values 5605 No - - - Yes
Sensor Units 5701 No String - - Yes

Modules

 LwM2M IPSO Sensor base object compile configurations
 

Files

file  ipso_sensor_base.h
 

Data Structures

struct  lwm2m_obj_ipso_sensor_base_args
 Arguments for the creation of an object based on the IPSO Sensor Base object instance. More...
 
struct  lwm2m_obj_ipso_sensor_base_inst
 LwM2M IPSO sensor base instance. More...
 
struct  lwm2m_obj_ipso_sensor_base
 LwM2M IPSO sensor base object. More...
 

Typedefs

typedef int lwm2m_obj_ipso_base_sensor_read_cb_t(void *read_cb_arg, int16_t *value)
 Callback for reading the sensor value.
 
typedef struct lwm2m_obj_ipso_sensor_base_args lwm2m_obj_ipso_base_sensor_args_t
 Arguments for the creation of an object based on the IPSO Sensor Base object instance.
 
typedef struct lwm2m_obj_ipso_sensor_base_inst lwm2m_obj_ipso_sensor_base_inst_t
 LwM2M IPSO sensor base instance.
 
typedef struct lwm2m_obj_ipso_sensor_base lwm2m_obj_ipso_sensor_base_t
 LwM2M IPSO sensor base object.
 

Functions

int32_t lwm2m_object_ipso_sensor_base_instance_create (lwm2m_obj_ipso_sensor_base_t *object, const lwm2m_obj_ipso_base_sensor_args_t *args)
 Create a new object instance based on the IPSO Sensor Base and add it to the object list.
 
int lwm2m_object_ipso_sensor_base_init_derived (lwm2m_client_data_t *client_data, lwm2m_obj_ipso_sensor_base_t *object, uint16_t object_id, lwm2m_obj_ipso_sensor_base_inst_t *instances, size_t instance_count)
 Initialize the a LwM2M object derived from the IPSO Sensor Base object.
 
void lwm2m_object_ipso_sensor_base_update_value (const lwm2m_client_data_t *client_data, const lwm2m_obj_ipso_sensor_base_t *object, uint16_t instance_id, int16_t value)
 Update the value of the illuminance sensor and trigger a notification to the observing servers, if any.
 

IPSO sensor base object resource's IDs (shared among many IPSO sensor objects)

#define LWM2M_IPSO_BASE_SENSOR_VALUE_ID   5700
 Sensor value resource ID.
 
#define LWM2M_IPSO_BASE_SENSOR_MIN_MEASURED_VALUE_ID   5601
 Min.
 
#define LWM2M_IPSO_BASE_SENSOR_MAX_MEASURED_VALUE_ID   5602
 Max.
 
#define LWM2M_IPSO_BASE_SENSOR_MIN_RANGE_VALUE_ID   5603
 Min.
 
#define LWM2M_IPSO_BASE_SENSOR_MAX_RANGE_VALUE_ID   5604
 Max.
 
#define LWM2M_IPSO_BASE_SENSOR_RESET_MIN_MAX_MEASURED_VALUES_ID   5605
 Reset min.
 
#define LWM2M_IPSO_BASE_SENSOR_UNITS_ID   5701
 Sensor units resource ID.
 

Macro Definition Documentation

◆ LWM2M_IPSO_BASE_SENSOR_MAX_MEASURED_VALUE_ID

#define LWM2M_IPSO_BASE_SENSOR_MAX_MEASURED_VALUE_ID   5602

Max.

measured value resource ID.

Definition at line 82 of file ipso_sensor_base.h.

◆ LWM2M_IPSO_BASE_SENSOR_MAX_RANGE_VALUE_ID

#define LWM2M_IPSO_BASE_SENSOR_MAX_RANGE_VALUE_ID   5604

Max.

range value resource ID.

Definition at line 90 of file ipso_sensor_base.h.

◆ LWM2M_IPSO_BASE_SENSOR_MIN_MEASURED_VALUE_ID

#define LWM2M_IPSO_BASE_SENSOR_MIN_MEASURED_VALUE_ID   5601

Min.

measured value resource ID.

Definition at line 78 of file ipso_sensor_base.h.

◆ LWM2M_IPSO_BASE_SENSOR_MIN_RANGE_VALUE_ID

#define LWM2M_IPSO_BASE_SENSOR_MIN_RANGE_VALUE_ID   5603

Min.

range value resource ID.

Definition at line 86 of file ipso_sensor_base.h.

◆ LWM2M_IPSO_BASE_SENSOR_RESET_MIN_MAX_MEASURED_VALUES_ID

#define LWM2M_IPSO_BASE_SENSOR_RESET_MIN_MAX_MEASURED_VALUES_ID   5605

Reset min.

and max. measured values resource ID.

Definition at line 94 of file ipso_sensor_base.h.

◆ LWM2M_IPSO_BASE_SENSOR_UNITS_ID

#define LWM2M_IPSO_BASE_SENSOR_UNITS_ID   5701

Sensor units resource ID.

Definition at line 98 of file ipso_sensor_base.h.

◆ LWM2M_IPSO_BASE_SENSOR_VALUE_ID

#define LWM2M_IPSO_BASE_SENSOR_VALUE_ID   5700

Sensor value resource ID.

Definition at line 74 of file ipso_sensor_base.h.

Typedef Documentation

◆ lwm2m_obj_ipso_base_sensor_read_cb_t

typedef int lwm2m_obj_ipso_base_sensor_read_cb_t(void *read_cb_arg, int16_t *value)

Callback for reading the sensor value.

Parameters
[in]read_cb_argData passed for the read callback when the instance was created.
[out]valuePointer to the variable where the value will be stored.
Returns
0 on success
<0 otherwise

Definition at line 110 of file ipso_sensor_base.h.

Function Documentation

◆ lwm2m_object_ipso_sensor_base_init_derived()

int lwm2m_object_ipso_sensor_base_init_derived ( lwm2m_client_data_t client_data,
lwm2m_obj_ipso_sensor_base_t object,
uint16_t  object_id,
lwm2m_obj_ipso_sensor_base_inst_t instances,
size_t  instance_count 
)

Initialize the a LwM2M object derived from the IPSO Sensor Base object.

Parameters
[in,out]client_dataPointer to the LwM2M client.
[in,out]objectPointer to the LwM2M IPSO object.
[in]object_idObject ID.
[in]instancesList of allocated instances.
[in]instance_countNumber of allocated instances.
Return values
0on success
<0otherwise

◆ lwm2m_object_ipso_sensor_base_instance_create()

int32_t lwm2m_object_ipso_sensor_base_instance_create ( lwm2m_obj_ipso_sensor_base_t object,
const lwm2m_obj_ipso_base_sensor_args_t args 
)

Create a new object instance based on the IPSO Sensor Base and add it to the object list.

Parameters
[in,out]objectPointer to the LwM2M IPSO object.
[in]argsInitialize structure with the parameter for the instance. May not be NULL.
Return values
instanceID (>0) on success
<0otherwise

◆ lwm2m_object_ipso_sensor_base_update_value()

void lwm2m_object_ipso_sensor_base_update_value ( const lwm2m_client_data_t client_data,
const lwm2m_obj_ipso_sensor_base_t object,
uint16_t  instance_id,
int16_t  value 
)

Update the value of the illuminance sensor and trigger a notification to the observing servers, if any.

Parameters
[in]client_dataPointer to the LwM2M client.
[in]objectPointer to the LwM2M IPSO object.
[in]instance_idID of the instance to update.
[in]valueNew value for the sensor.