net: lwm2m: Fix pause and resume on non-closed sockets
Pause and resume functionality was written into assumption that sockets are closed before resuming. With use new options CONFIG_LWM2M_RD_CLIENT_STOP_POLLING_AT_IDLE or CONFIG_LWM2M_RD_CLIENT_LISTEN_AT_IDLE this is not always true. Fix the state machine, so that on those cases, sockets are not closed and resume is always similar like from the QUEUE mode. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
This commit is contained in:
parent
55451c6d6e
commit
dc7fbc5d2e
5 changed files with 63 additions and 57 deletions
|
@ -30,3 +30,4 @@ add_compile_definitions(CONFIG_LWM2M_QUEUE_MODE_UPTIME=10)
|
|||
add_compile_definitions(CONFIG_LWM2M_LOG_LEVEL=4)
|
||||
add_compile_definitions(CONFIG_LWM2M_QUEUE_MODE_ENABLED=1)
|
||||
add_compile_definitions(CONFIG_LWM2M_TLS_SESSION_CACHING=1)
|
||||
add_compile_definitions(CONFIG_LWM2M_RD_CLIENT_LISTEN_AT_IDLE=1)
|
||||
|
|
|
@ -66,6 +66,7 @@ int lwm2m_get_bool_fake_default(const struct lwm2m_obj_path *path, bool *value)
|
|||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_socket_start, struct lwm2m_ctx *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_socket_close, struct lwm2m_ctx *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_close_socket, struct lwm2m_ctx *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_socket_suspend, struct lwm2m_ctx *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_security_inst_id_to_index, uint16_t);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_engine_connection_resume, struct lwm2m_ctx *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_push_queued_buffers, struct lwm2m_ctx *);
|
||||
|
|
|
@ -51,6 +51,7 @@ int lwm2m_get_bool_fake_default(const struct lwm2m_obj_path *path, bool *value);
|
|||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_socket_start, struct lwm2m_ctx *);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_socket_close, struct lwm2m_ctx *);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_close_socket, struct lwm2m_ctx *);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_socket_suspend, struct lwm2m_ctx *);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_security_inst_id_to_index, uint16_t);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_engine_connection_resume, struct lwm2m_ctx *);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_push_queued_buffers, struct lwm2m_ctx *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue