PXP-Reporter - adding a Service-UUID

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
dsandbue
Offline
Last seen:1年9个月前
加入:2017-02-15 14:09
PXP-Reporter - adding a Service-UUID

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:
dsandbue
Offline
Last seen:1年9个月前
加入:2017-02-15 14:09
Problem solved - thanks

Problem solved - thanks anyway. :-)

MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi dsandbue,

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

dsandbue
Offline
Last seen:1年9个月前
加入:2017-02-15 14:09
Thank you very much!

Thank you very much!