2024-08-30 03:48 PM
I've looked through many examples (in particular p2p client ) but I can't find any that sends payload that's made of array
```
uint8_t pPayload[] = {0xFF, 0x01, 0x00, 0x05, 0xAA};
uint8_t payloadLength = sizeof(pPayload);
ret = aci_gatt_write_without_resp(aP2PClientContext[index].connHandle,
aP2PClientContext[index].P2PWriteToServerCharHdle,
payloadLength,
pPayload);
```
That's the payload that worked fine when I programmed on ESP32 NimBLE but on STM32 I can't seem to make it work.
Side note: Service and Characteristics use 128bit UUID and seem to be discovered correctly
2024-08-31 01:41 AM
Hello @roman_tl and welcome to the ST Community :smiling_face_with_smiling_eyes:.
I suggest you to follow the sending procedure on the Cable replacement example. It should be really helpful.
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.
2024-09-03 02:54 PM
I've set up a virtual peripheral in LightBlue BLE debugger just to see the messages and it turns out that code given in p2p_client example can't work with 128-bit UUIDs.
After all corresponding flags to use 128-bit were set services and characteristics are discovered correctly, however, sending messages doesn't work - it returns success status but I don't see anything in debugger.
On the other hand switching to 16-bit UUIDs didn't cause any issues, the same code mentioned above works just fine.
Now I have to figure out how to fix this because 3-rd party hardware I'm trying to write to with uses 128-bit
2024-09-04 02:21 PM
So the bug is in this piece:
/* store the characteristic handle not the attribute handle */
#if (UUID_128BIT_FORMAT==1)
handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx-14]);
#else
handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx-2]);
#endif
For some reason `idx` resets to value less than 14 and that causes handle to be made from arbitrary memory location. I'll debug later why this bug occurs
2024-10-14 08:22 AM
I don't there is such a bug. Could you please specify why you think so.
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.