Hi,
I am testing the BLE Provisioning example which works fine.
1.How do I extend the Protobuf set config message to include additional custom fields?
2.What tooling is needed to extend the Protobuf messages?
BR,
Garage Gadget
Extending Unified Provisioning (BLE) Protobuf messages
-
- Posts: 7
- Joined: Thu Dec 27, 2018 4:43 pm
-
- Posts: 19
- Joined: Fri Aug 31, 2018 5:37 am
Re: Extending Unified Provisioning (BLE) Protobuf messages
Hi,
For device side implementation, check https://github.com/espressif/esp-idf/tr ... tom_config which demonstrates creating a component custom_provisioning that adds additional fields (see https://github.com/espressif/esp-idf/bl ... /README.md).
https://github.com/espressif/esp-idf/bl ... nfig.proto has the definition of the custom fields. And this https://github.com/espressif/esp-idf/bl ... m_config.c implements the corresponding protocomm endpoint handler. In https://github.com/espressif/esp-idf/bl ... lers.c#L28 you would find a new provisioning handler corresponding to the endpoint handler. Now the endpoint handler (along with provisioning handler passed as private data) is to be registered with protocomm as shown here https://github.com/espressif/esp-idf/bl ... prov.c#L89.
There is also an example for client side implementation here https://github.com/espressif/esp-idf-pr ... rsions/avs. Though this is for a different message structure, not corresponding to the IDF example stated above. The custom Protobuf file is : https://github.com/espressif/esp-idf-pr ... nfig.proto which is used for generating the java file to be used by the android app.
While protoc-c (Protobuf C compiler) is required for generating C files, for which the source code can be found here https://github.com/protobuf-c/protobuf-c.
The message structure is defined by Protobuf .proto files which are compiled to generate corresponding C files which are to be included by user code. You can add additional fields by writing your own Protobuf file and write the corresponding protocomm handlers for that.1.How do I extend the Protobuf set config message to include additional custom fields?
For device side implementation, check https://github.com/espressif/esp-idf/tr ... tom_config which demonstrates creating a component custom_provisioning that adds additional fields (see https://github.com/espressif/esp-idf/bl ... /README.md).
https://github.com/espressif/esp-idf/bl ... nfig.proto has the definition of the custom fields. And this https://github.com/espressif/esp-idf/bl ... m_config.c implements the corresponding protocomm endpoint handler. In https://github.com/espressif/esp-idf/bl ... lers.c#L28 you would find a new provisioning handler corresponding to the endpoint handler. Now the endpoint handler (along with provisioning handler passed as private data) is to be registered with protocomm as shown here https://github.com/espressif/esp-idf/bl ... prov.c#L89.
There is also an example for client side implementation here https://github.com/espressif/esp-idf-pr ... rsions/avs. Though this is for a different message structure, not corresponding to the IDF example stated above. The custom Protobuf file is : https://github.com/espressif/esp-idf-pr ... nfig.proto which is used for generating the java file to be used by the android app.
protoc (Protobuf compiler) is required for generating java files, for which the release binaries can be found here https://github.com/protocolbuffers/protobuf/releases2.What tooling is needed to extend the Protobuf messages?
While protoc-c (Protobuf C compiler) is required for generating C files, for which the source code can be found here https://github.com/protobuf-c/protobuf-c.
-
- Posts: 7
- Joined: Thu Dec 27, 2018 4:43 pm
Re: Extending Unified Provisioning (BLE) Protobuf messages
Hi,
Thank you for the great feedback.
BR,
GarageGadget
Thank you for the great feedback.
BR,
GarageGadget
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 116 guests