In an example of Generic OnOff Server _msg_len has value "2 + 3". According to the Bluetooth mesh documentation, Generic OnOff Server publishes (3.3.1.2.3 Sending a Generic OnOff Status message, Mesh Model v1.0.1) Generic OnOff Status message (3.2.1.4 Generic OnOff Status, Mesh Model v1.0.1), which has the minimum length - 1 byte, and the maximum length - 3 bytes. So, in the example of Generic OnOff Server, "2 + 3" matches the maximum possible length of the Generic OnOff Status message, which is enough to publish both mandatory and optional fields of Generic OnOff Status message. Everything seems fine, but if to look at another example, Generic OnOff Client, _msg_len has value "2 + 1". According to the Bluetooth mesh documentation, Generic OnOff Client publishes (3.4.1.2.2 Sending Generic OnOff Set / Generic OnOff Set Unacknowledged messages, Mesh Model v1.0.1) Generic OnOff Set message (3.2.1.2 Generic OnOff Set, Mesh Model v1.0.1), which has the minimum length - 2 bytes, and the maximum length - 4 bytes, but not 1, as it's defined in the example. So, tell me, please, is it a mistake or I understand something wrongly? I would like to understand clearly which length _msg_len arg in ESP_BLE_MESH_MODEL_PUB_DEFINE macro really defines.
And I have another related question. ESP-IDF contains a series of macros which serve to define Bluetooth mesh models:
- and so on.
Thank you in advance for any explanation.