Hi, teams.
I am analyzing MESH SDK codes, and build my own MESH application on SDK base.
There are very strange implementations in several models.
For example, in Generic Level Server Model, STATUS message is sent to client by the following code.
return MS_access_publish(&model->model_handle, MS_ACCESS_GENERIC_LEVEL_STATUS_OPCODE, (UCHAR *)&status, sizeof(MS_GENERIC_LEVEL_STATUS_STRUCT) - 1, MS_TRUE);
1. Why sending total structure size minus one bytes should be sent?
2. According to MESH specification, STATUS message should be 3 or 5 byte long.
But in SDK, there is no optional field handling, and even MS_GENERIC_LEVEL_STATUS_STRUCT is not packed!!!
我发现类似的公司des all around models in SDK.
All this codes means SDK is buggy or immature, or some strange magic in MESH binary libraries?
Device:
Hi firebird,
Thanks for sharing the feedback. I am checking on this with our internal team if we carry documentation that will help you get through these issues. Will let you know as soon as I hear back from the team.
Best regards,
LC_Dialog
I've carefully reviewed SDK codes again to debug myself, and I realized the "length minus one" is the trick for excludingoptional_fields_presentfield.
So, still lack of handling optional field, but it may work.
Sorry for my misunderstanding, but still I am strongly suspicious about message structures are not packed.
Do mesh devices function as spec-compliant? inter-operable?
Hi firebird,
The implementation does not support optional field handling thats why the "minus one bytes" is present. We understand this is not the cleanest way of handling it.
Dialog implementation is spec compliant and has passed Bluetooth SIG qualification for all the supported profiles in Mesh v1.0 spec (declaration ID: D047269 QDID: 114914)
In case you see any bugs or iteropability issues please feel free to report them and we will do everything we can to fix them ASAP.
Best regards,
LC_Dialog