I have a vendor model bt_mesh_model_op defined as follows
const struct bt_mesh_model_op _admin_model_ops[] = {
What are the guidelines for creating vendor specific opcodes?
Thanks
I have a vendor model bt_mesh_model_op defined as follows
const struct bt_mesh_model_op _admin_model_ops[] = {
Hello again, and sorry about the wait!
The usage of vender specific opcodes is documented in section 3.7.3.1 in the Mesh Profile Spec.

For an example on how this can be implemented, you could also have a look at the chat example in NCS.
Regards,
Elfving
Hello again, and sorry about the wait!
The usage of vender specific opcodes is documented in section 3.7.3.1 in the Mesh Profile Spec.

For an example on how this can be implemented, you could also have a look at the chat example in NCS.
Regards,
Elfving
In chat_cli.h there are definitions of vendor opcodes :
AndyM said:"For example, when the manufacturer-specific opcode is equal to 0x23 and the company identifier is equal to 0x0136 [6], then the 3-octet opcode is equal to 0xE3 0x36 0x01." If I read this correctly the 3rd octet of the opcode is 0x01 which seems arbitrary.
The first octet needs to start with 0b11 as it is a 3-octet opcode. Afterwards comes the manufacturer-specific opcode of 0x100011. 0b11 and 0b100011 is 0x23. When it comes to the final octets, it uses an endianness where "All multiple-octet numeric values in this layer shall be “little endian” (defined in section 3.7.1.). So the opcode of 0x0136 is split into the last two octets as 0x36 and 0x01.
AndyM said:What is "manufacturer specific opcode" ? That term appears in the spec only in this paragraph
Yeah "manufacturer" might sound confusing, but it is referring to you as the creator or developer making your own opcodes. Here is list of the opcodes we've created for these models. I believe you would have to use some that are not yet reserved, have you tried 0x10?
Regards,
Elfving
Anything higher than 0x03 works. I was just curious why. It's odd because 0x04 that I use is on your list as well.
I'll try 0x10 so it does not conflict with your opcodes
Question
0x04 is listed as "Simple OnOff Status"
What's the size of the message for this opcode? If it's 8 bytes - that would explain why I don't get "invalid message size" when I use it .
Thank you
AndyM said:What's the size of the message for this opcode? If it's 8 bytes - that would explain why I don't get "invalid message size" when I use it .
The contents and length of the messages can be found here.
I should mention that if you are simply testing, or not using this to make your own products it doesn't matter what company ID you use. However, using the Nordic ID for this isn't good (We might for instance decide to add another opcode which might conflict with yours). There is a special value for such purposes which is 0xFFFF (for more info see here). If you want to sell products however you would of course need to qualify the products and get your own company ID.
Btw, could you give me the exact wording of the error message you were getting?
Regards,
Elfving
I've moved on since, using company ID and opcodes 0xa and higher seems to work just fine
From memory the message was "invalid message size for opcode....."
Thank you for your help