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

mesh SDK add SIG model

I added a SIG general onoff model by modifying nordic mesh SDK example project 'example/light_switch', just modified model ID as below:

client:

#define SIMPLE_ON_OFF_CLIENT_MODEL_ID (0x1001)

server:

#define SIMPLE_ON_OFF_SERVER_MODEL_ID (0x1000)

other:

#define ACCESS_COMPANY_ID_NORDIC (0xFFFF)//as ACCESS_COMPANY_ID_NONE for SIG model

Then the provision can not success, why?

Parents
  • Hello Ricky,

    If you only modified the model ID and also the company ID, the server will crash when running "simple_on_off_server_init()".

    Since in the "simple_on_off_server_init()", the API "access_model_add()" is called. Inside the "access_model_add()", the opcode format will also be checked.

    Since you try to use the "generic on/off mode", the opcode length should be two bytes.

    The detail can be found in Mesh specification v1.0, 3.7.3.1, page 93

    image description

    So I would like to suggest you modified the opcode in simple_on_off_common.h like:

    SIMPLE_ON_OFF_OPCODE_SET = 0x8202,            /**< Generic OnOff Set. */
    SIMPLE_ON_OFF_OPCODE_GET = 0x8201,            /**< Generic OnOff Get. */
    SIMPLE_ON_OFF_OPCODE_SET_UNRELIABLE = 0x8203, /**< Generic OnOff Set Unreliable. */
    SIMPLE_ON_OFF_OPCODE_STATUS = 0x8204          /**< Generic OnOff Status. */
    

    And the server and client should work correctly.

    Best regards,

    Rick

  • Hi ,

    I'm working with ble mesh sdk 2.2.0 and I need to add more SIG models other than the three included by nordic.

    The problem is that I cannot find, on the bluetooth sig docs, the list of opcodes like the on-off example you listed above.

    Can you please help?

Reply Children
Related