2025-01-15 03:35 AM
Hi,
I am currently getting familiar with the STM32WB15 microcontrollers using two WB1M-WPAN1 boards.
On the server/peripheral side, everything works correctly (the declaration of services and characteristics in the .ioc file is very convenient), and I based my implementation on the HR_p2p_sensor example.
I have the following services and characteristics:
On the client/central side, my goal is to interact with the server's services, but I am struggling to find the proper way to add the services/characteristics I want to read.
Based on the explanations in AN5289, I modified P2P_SERVICE_UUID and P2P_NOTIFY_CHAR_UUID with the UUIDs I need in the SVCCTL_EvtAckStatus_t Event_Handler(void *Event) function in p2p_client_app.c (case ACI_ATT_READ_BY_GROUP_TYPE_RESP_VSEVT_CODE and ACI_ATT_READ_BY_TYPE_RESP_VSEVT_CODE).
(I also needed to modify the expected attribute size in the case ACI_GATT_NOTIFICATION_VSEVT_CODE with
pr->Attribute_Value_Length == (/*2*/ 10)).
This works for 1 service, but I don't think it is the proper way to add several services. Could you please guide me on how to do this correctly?
I also have a question about handling 16-bit UUIDs. Currently, there is a UUID_128BIT_FORMAT define that allows handling one or the other format, but I need to be able to read both.
Thank you for your help, and feel free to ask if you need any additional information.
Best regards,
Morgan
2025-01-27 02:57 AM
Up
2025-02-03 01:02 AM
Hello @STTwo-32 ,
Sorry for the lack of clarity.
I want to connect 2 stm32wb1x boards : The first one is a server with the services and characteristics shown in my first post (this part works fine). The second board is a client based on the p2p_client example.
I'm struggling with the client software. I'm confused about what should be added to the p2p_client example to interact with the other board's custom services / characteristics. Should I create a custom_app.c/.h ? Should I directly add my custom services alongside the p2p_services in the Event_Handler(void *Event) function in the p2p_client_app.c ?
I hope this clarifies my main request.
Thank you for your help.
2025-02-03 02:01 AM
Hello @MorganLR
For that, I suggest you have a look at the AN5289 specially part 7.5 and 8.4.4. They should be the best guide for your development.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-02-03 02:46 AM
Thank you for your answer.
I'll take a deeper look at the application note; I probably missed some key information.
The server implementation was much easier thanks to the server profile configuration in the .ioc file. A similar feature for the client profile, where we could directly add our services and characteristics to generate a template, would be really useful.
Additionally, it would be great if we could select a custom template instead of the custom P2P client in the "BLE Applications and Services" tab, just as it is possible for the server profile.
Finally, it would be very helpful to have the same service configuration tools for the router profile as those available for the server profile.
Best regards,
Morgan