This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 lwm2m registeration, how to add option(others)?

SDK: NCS 1.4.0

board: nRF9160-DK

sample: lwm2m_client

registration CoAP packet

options => {
    "if_match_list": null,
    "uri_host": null,
    "etag_list": null,
    "if_none_match": false,
    "uri_port": null,
    "location_path_list": null,
    "uri_path_list": [
        "rd"
    ],
    "content_format": 40,
    "max_age": null,
    "uri_query_list": [
        "lwm2m=1.0",
        "",
        "lt=86400"
    ],
    "accept": -1,
    "location_query_list": null,
    "proxy_uri": null,
    "proxy_scheme": null,
    "block1": null,
    "block2": null,
    "size1": null,
    "size2": null,
    "observe": null,
    "others": null,  <--- Here

In option enum, there is no "others". Where can I get this information?

enum coap_option_num {
 COAP_OPTION_IF_MATCH = 1,
 COAP_OPTION_URI_HOST = 3,
 COAP_OPTION_ETAG = 4,
 COAP_OPTION_IF_NONE_MATCH = 5,
 COAP_OPTION_OBSERVE = 6,
 COAP_OPTION_URI_PORT = 7,
 COAP_OPTION_LOCATION_PATH = 8,
 COAP_OPTION_URI_PATH = 11,
 COAP_OPTION_CONTENT_FORMAT = 12,
 COAP_OPTION_MAX_AGE = 14,
 COAP_OPTION_URI_QUERY = 15,
 COAP_OPTION_ACCEPT = 17,
 COAP_OPTION_LOCATION_QUERY = 20,
 COAP_OPTION_BLOCK2 = 23,
 COAP_OPTION_BLOCK1 = 27,
 COAP_OPTION_SIZE2 = 28,
 COAP_OPTION_PROXY_URI = 35,
 COAP_OPTION_PROXY_SCHEME = 39,
 COAP_OPTION_SIZE1 = 60,
 };

Parents
  • Hello!

    The comment above coap_option_num states that:

    /**
     * @brief Set of CoAP packet options we are aware of.
     *
     * Users may add options other than these to their packets, provided
     * they know how to format them correctly. The only restriction is
     * that all options must be added to a packet in numeric order.
     *
     * Refer to RFC 7252, section 12.2 for more information.
     */

    As others isn't one of the standard options it must be addressed by the user. Though, I'm not sure what numeric value "others" has. Where does the info about the "registration packet" come from? Note that the CoAP implementation is made by Zephyr, so I suggest reaching out through their channels as well.

    Best regards,
    Carl Richard

Reply
  • Hello!

    The comment above coap_option_num states that:

    /**
     * @brief Set of CoAP packet options we are aware of.
     *
     * Users may add options other than these to their packets, provided
     * they know how to format them correctly. The only restriction is
     * that all options must be added to a packet in numeric order.
     *
     * Refer to RFC 7252, section 12.2 for more information.
     */

    As others isn't one of the standard options it must be addressed by the user. Though, I'm not sure what numeric value "others" has. Where does the info about the "registration packet" come from? Note that the CoAP implementation is made by Zephyr, so I suggest reaching out through their channels as well.

    Best regards,
    Carl Richard

Children
Related