Loading...
Searching...
No Matches
on_off_switch.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 HAW Hamburg
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
82
83#ifdef __cplusplus
84extern "C" {
85#endif
86
87#include "liblwm2m.h"
88
97#ifndef CONFIG_LWM2M_ON_OFF_SWITCH_INSTANCES_MAX
98#define CONFIG_LWM2M_ON_OFF_SWITCH_INSTANCES_MAX (3U)
99#endif
100
104#ifndef CONFIG_LWM2M_ON_OFF_SWITCH_APP_TYPE_MAX_SIZE
105#define CONFIG_LWM2M_ON_OFF_SWITCH_APP_TYPE_MAX_SIZE (16U)
106#endif
108
112#define LWM2M_ON_OFF_SWITCH_OBJECT_ID 3342
113
121#define LWM2M_ON_OFF_SWITCH_DIGITAL_INPUT_STATE_ID 5500
125#define LWM2M_ON_OFF_SWITCH_DIGITAL_INPUT_COUNTER_ID 5501
129#define LWM2M_ON_OFF_SWITCH_ON_TIME_ID 5852
133#define LWM2M_ON_OFF_SWITCH_OFF_TIME_ID 5854
137#define LWM2M_ON_OFF_SWITCH_APP_TYPE_ID 5750
139
147
156
170 int32_t instance_id);
171
181int lwm2m_object_on_off_switch_update_status(uint16_t instance_id, bool status);
182
195int lwm2m_object_on_off_switch_update_app_type(uint16_t instance_id, const char *app_type,
196 size_t len);
197
198#ifdef __cplusplus
199}
200#endif
201
int lwm2m_object_on_off_switch_update_app_type(uint16_t instance_id, const char *app_type, size_t len)
Update the application type of a on/off switch instance.
struct lwm2m_obj_on_off_switch_args lwm2m_obj_on_off_switch_args_t
Arguments for the creation of an on/off switch object instance.
lwm2m_object_t * lwm2m_object_on_off_switch_init(lwm2m_client_data_t *client_data)
Initialize the on/off switch object.
int lwm2m_object_on_off_switch_instance_create(const lwm2m_obj_on_off_switch_args_t *args, int32_t instance_id)
Create a new on/off switch instance and add it to the object list.
int lwm2m_object_on_off_switch_update_status(uint16_t instance_id, bool status)
Update the status of a on/off switch instance.
LwM2M client descriptor.
Arguments for the creation of an on/off switch object instance.
const char * app_type
Array of chars with the app type.
size_t app_type_len
Length of app_type.