Skip to content

Commit

Permalink
samples: lwm2m_client: Add support for queue mode
Browse files Browse the repository at this point in the history
Add support for the queue mode in the lwm2m_client sample.

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos authored and jukkar committed Mar 10, 2020
1 parent d2e7a7d commit 2e80185
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions samples/net/lwm2m_client/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ samples/net/lwm2m_client directory:
- :file:`overlay-bt.conf`
This overlay config can be added to enable Bluetooth networking support.

- :file:`overlay-queue.conf`
This overlay config can be added to enable LWM2M Queue Mode support.

Build the lwm2m-client sample application like this:

.. zephyr-app-commands::
Expand Down Expand Up @@ -135,6 +138,25 @@ commands (requires Bluetooth for networking):
:goals: build
:compact:

Queue Mode Support
==================

To build the lwm2m-client sample with LWM2M Queue Mode support do the following:

.. zephyr-app-commands::
:zephyr-app: samples/net/lwm2m_client
:host-os: unix
:board: <board to use>
:conf: "prj.conf overlay-queue.conf"
:goals: build
:compact:

With Queue Mode enabled, the LWM2M client will register with "UDP with Queue
Mode" binding. The LWM2M engine will notify the application with
``LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF`` event when the RX window
is closed so it can e. g. turn the radio off. The next RX window will be open
with consecutive ``LWM2M_RD_CLIENT_EVENT_REG_UPDATE_COMPLETE`` event.

WNC-M14A2A LTE-M Modem Support
==============================

Expand Down
2 changes: 2 additions & 0 deletions samples/net/lwm2m_client/overlay-queue.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_LWM2M_QUEUE_MODE_ENABLED=y
CONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME=180
6 changes: 6 additions & 0 deletions samples/net/lwm2m_client/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ tests:
extra_args: OVERLAY_CONFIG=overlay-bt.conf
platform_whitelist: nrf52_pca10040 nrf52840_pca10056 disco_l475_iot1
tags: net lwm2m
sample.net.lwm2m_client.queue_mode:
harness: net
depends_on: netif
extra_args: OVERLAY_CONFIG=overlay-queue.conf
platform_whitelist: qemu_x86
tags: net lwm2m
sample.net.lwm2m_client.wnc_m14a2a:
harness: net
extra_args: SHIELD=wnc_m14a2a
Expand Down
3 changes: 3 additions & 0 deletions samples/net/lwm2m_client/src/lwm2m-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ static void rd_client_event(struct lwm2m_ctx *client,
LOG_DBG("Disconnected");
break;

case LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF:
LOG_DBG("Queue mode RX window closed");
break;
}
}

Expand Down

0 comments on commit 2e80185

Please sign in to comment.