samples: lwm2m: add IPSO temperature object to LWM2M client
This commit adds IPSO temperature support to the LwM2M client sample. NOTE: A dummy value of 25C is set during initialization and does not change. Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
parent
aef5ee4582
commit
29c7c70a86
|
@ -34,6 +34,8 @@ CONFIG_NET_APP_SETTINGS=y
|
|||
|
||||
CONFIG_LWM2M=y
|
||||
CONFIG_LWM2M_RD_CLIENT_INSTANCE_COUNT=2
|
||||
CONFIG_LWM2M_IPSO_SUPPORT=y
|
||||
CONFIG_LWM2M_IPSO_TEMP_SENSOR=y
|
||||
|
||||
CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::1"
|
||||
CONFIG_NET_APP_PEER_IPV6_ADDR="2001:db8::2"
|
||||
|
|
|
@ -34,6 +34,8 @@ CONFIG_NET_APP_SETTINGS=y
|
|||
|
||||
CONFIG_LWM2M=y
|
||||
CONFIG_LWM2M_RD_CLIENT_INSTANCE_COUNT=2
|
||||
CONFIG_LWM2M_IPSO_SUPPORT=y
|
||||
CONFIG_LWM2M_IPSO_TEMP_SENSOR=y
|
||||
|
||||
CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::1"
|
||||
CONFIG_NET_APP_PEER_IPV6_ADDR="2001:db8::2"
|
||||
|
|
|
@ -129,6 +129,8 @@ static int set_endpoint_name(char *ep_name, sa_family_t family)
|
|||
|
||||
static int lwm2m_setup(void)
|
||||
{
|
||||
struct float32_value float_value;
|
||||
|
||||
/* setup SECURITY object */
|
||||
/* setup SERVER object */
|
||||
|
||||
|
@ -172,6 +174,14 @@ static int lwm2m_setup(void)
|
|||
lwm2m_firmware_set_write_cb(firmware_block_received_cb);
|
||||
lwm2m_engine_register_exec_callback("5/0/2", firmware_update_cb);
|
||||
|
||||
/* setup TEMP SENSOR object */
|
||||
|
||||
lwm2m_engine_create_obj_inst("3303/0");
|
||||
/* dummy temp data in C*/
|
||||
float_value.val1 = 25;
|
||||
float_value.val2 = 0;
|
||||
lwm2m_engine_set_float32("3303/0/5700", &float_value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue