Loading...
Searching...
No Matches
ipso_sensor_base.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46#include "mutex.h"
47#include "liblwm2m.h"
48#include "lwm2m_client.h"
49
58#ifndef CONFIG_LWM2M_IPSO_SENSOR_BASE_UNITS_MAX_SIZE
59#define CONFIG_LWM2M_IPSO_SENSOR_BASE_UNITS_MAX_SIZE (4U)
60#endif
62
70#define LWM2M_IPSO_BASE_SENSOR_VALUE_ID 5700
74#define LWM2M_IPSO_BASE_SENSOR_MIN_MEASURED_VALUE_ID 5601
78#define LWM2M_IPSO_BASE_SENSOR_MAX_MEASURED_VALUE_ID 5602
82#define LWM2M_IPSO_BASE_SENSOR_MIN_RANGE_VALUE_ID 5603
86#define LWM2M_IPSO_BASE_SENSOR_MAX_RANGE_VALUE_ID 5604
90#define LWM2M_IPSO_BASE_SENSOR_RESET_MIN_MAX_MEASURED_VALUES_ID 5605
94#define LWM2M_IPSO_BASE_SENSOR_UNITS_ID 5701
96
106typedef int lwm2m_obj_ipso_base_sensor_read_cb_t(void *read_cb_arg, int16_t *value);
107
122
137
147
161
176 uint16_t object_id,
178 size_t instance_count);
179
190 const lwm2m_obj_ipso_sensor_base_t *object,
191 uint16_t instance_id, int16_t value);
192
193#ifdef __cplusplus
194}
195#endif
196
#define CONFIG_LWM2M_IPSO_SENSOR_BASE_UNITS_MAX_SIZE
Maximum size for the units resource string.
struct lwm2m_obj_ipso_sensor_base lwm2m_obj_ipso_sensor_base_t
LwM2M 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,...
struct lwm2m_obj_ipso_sensor_base_inst lwm2m_obj_ipso_sensor_base_inst_t
LwM2M IPSO sensor base instance.
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.
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.
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.
int lwm2m_obj_ipso_base_sensor_read_cb_t(void *read_cb_arg, int16_t *value)
Callback for reading the sensor value.
Definitions and public API for a LwM2M client using Wakaama.
Mutex for thread synchronization.
LwM2M client descriptor.
Arguments for the creation of an object based on the IPSO Sensor Base object instance.
int32_t instance_id
ID for the new instance.
char * units
Null-terminated string of the "Sensor Units" resource.
lwm2m_obj_ipso_base_sensor_read_cb_t * read_cb
Callback to read the sensor value.
int16_t max_range_value
Maximum value that can be measured by the sensor.
size_t units_len
Length of units.
int16_t min_range_value
Minimum value that can be measured by the sensor.
void * read_cb_arg
Data to pass to the read callback.
LwM2M IPSO sensor base instance.
int16_t min_sensor_value
minimum sensor value
lwm2m_obj_ipso_base_sensor_read_cb_t * read_cb
Callback to read the sensor value.
int16_t min_range_value
minimum range value
char units[CONFIG_LWM2M_IPSO_SENSOR_BASE_UNITS_MAX_SIZE]
units
void * read_cb_arg
Data to pass to the read callback.
int16_t max_sensor_value
maximum sensor value
int16_t max_range_value
maximum range value
LwM2M IPSO sensor base object.
lwm2m_obj_ipso_sensor_base_inst_t * free_instances
List of instances.
lwm2m_object_t object
LwM2M object base.
mutex_t mutex
Mutex for the object.
Mutex structure.
Definition mutex.h:36