Hello,
我想添加my own Service-UUID to the PXP-Reporter demo. I have chosen an arbitrary Name (0xFE43).
When I put the UUID in the adv_data, I can see it in the Advertising Data via LightBlue, but unfortunately the Service doesnt appear under the available Services.
However, when I delete one of the example-Serivces (like LinkLoss) from the adv_data, the Service still gets Displayed as an available Service.
I've also added the Service in the pxp_reporter-task via ble_service_add() (analog to the LinkLoss-Service), but it seems to me that I Need to sign up the Service in some header-file or likewise.
Help would be greatly appreciated. :-)
Thanks in advance,
Philipp
Device:
Problem solved - thanks anyway. :-)
Hi dsandbue,
Glad you solved your issue, just for any future questions.
Just by adding the advertising string doesn't mean that the SDK will automatically produce a service, if you would like to add an extra custom service you will have to implement that in the project, the ble_peripheral_task has an example on how to create a custom service (in the ble_peripheral_task you can check the my_service_init() function which creates and initializes a custom service). But in general all the services even the SIG profile services use the same API in order to be created, so you can take as an example any of the services created in the examples (just check in the _init functions in the ble_peripheral_task() function). Regarding the fact that you remove the Link Loss service and it still appears on your phone, i suppose that this is because the services are cached on your phone, if you switch of the BLE on your phone and switch it back on, this will force the phone to perform a new discovery and the actual services will appear on your phone. In order to add a service you need to initialize it (provide the service and the characteristics, values and also the corresponding handlers), after the service is initialized then you need to invoke the ble_service_add() in order for the BLE manager to notify your task about interaction with the corresponding service.
Thanks MT_dialog
Thank you very much!