Adding client services stm32wb1
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:
- Service p2pServer (0xFE40 - 128 bits) based on the HR_p2p_sensor example:
- Characteristic 1 (0xF41 - 128 bits) / length = 2 / Read-Write
- Characteristic 2 (0xF42 - 128 bits) / length = 2 / Notify
- Service sandbox (0xFF60 - 128 bits):
- Characteristic 1 (0xFF61 - 128 bits) / length = 10 / Notify
- Service battery (0x180F - 16 bits):
- Characteristic 1 (0x2A19 - 16 bits) / length = 5 / Indicate
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
