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

GENERIC_ONOFF_SET_MAXLEN in nrf mesh message length in mesh sdk3.0.0

currently i set the GENERIC_ONOFF_SET_MAXLEN to 10 and from server i can see the message is received, not one package, but 6-8 packages from client,

my question is what is the max value of GENERIC_ONOFF_SET_MAXLEN,what should i do to send the message by one package.

Parents
  • Due to the Easter break, we have been short on staff & therefore the response time is longer than usual. Sorry for any inconvenience caused. In Bluetooth Mesh, of the 31 bytes that are sent per packet, you have 11 bytes of payload package. This is most likely the reason that the message has been split up into multiple packets.

    Since you are sending a generic on off set message, you will have this format:

    typedef struct __attribute((packed))
    {
        uint8_t on_off;                                         /**< State to set */
        uint8_t tid;                                            /**< Transaction number for application */
        uint8_t transition_time;                                /**< Encoded transition time value */
        uint8_t delay;                                          /**< Encoded message execution delay in 5 millisecond steps */
    } generic_onoff_set_msg_pkt_t;

    As you can see, you require 3 bytes (one byte each for tid, transition_time & delay). That leaves you 8 bytes for the on_off message. Assuming the GENERIC_ON_OFF_SET_MAXLEN is given in bytes, you could try setting this value to 8. If that does not work, I would try different values of GENERIC_ONOFF_SET_MAXLEN until you find one that works for you.

  • Thank you, i have tried, i can only send 9 bytes of GENERIC_ON_OFF_SET_MAXLEN, and 10 bytes would be spitted up to multiple packets. any reason for this?

  • This is most likely due to the opcode header bytes, as I described in my last comment. I have heard some people mention 8 bytes for the on_off message, while others mention 9 bytes of effective message payload length. Maybe the payload length has changed slightly between different mesh sdk releases.

Reply Children
No Data
Related