Dear community I am using the FRDM KW41Z and the example heart-rate-sensor for developing my own communication with an android application. I used the tutorials for setting server and clients using the BLE stack. However, I got stuck at a problem.
I would like to access to the UUID128 of my two characteristics to store received values in the data base. I understood the tutorials to getting the handles of the characteristics and then store the values into the database. And for getting the handles I need to send the UUID from the characteristics when using following function:
uuidBikeCharacteristicWrite->uuid128 = uuid_characteristic_bike_write;
result |= GattDb_FindCharValueHandleInService(serviceHandle, gBleUuidType128_c, uuidBikeCharacteristicWrite, &characteristicWritehandle);
I get an error when I compile the code. And the tutorials use macros for getting their UUID.
bleUuid_t uuid = Uuid16(gBleSig_Humidity_d);
I have not found a similar macro or function for getting the uuid128 like that. How can I solve this issue? and are there any examples provided?
I had exact same issue today and solved it. For the future reference, just add a line:
would solve the issue.
I followed "Creating a custom profile using NXP BLE stack – Server " and run into this issue. The article doesn't cover this detail.
But it is actually explained in the document BLEADG, section 7.1.1
So in file gatt_uuid128.h, we do:
UUID128(uuid_xxx_xxx, 0xAA, 0xBB, 0xCC, ... 0xFF)
Then in the C sources where we need to refer to this uuid128, include "gatt_db_handles.h", which expands the macro UUID128().
After that we can use symbol "uuid_xxx_xxx" with GATT functions.
Hope it helps.
Have you checked this post6s ?
Creating a custom profile using NXP BLE stack – Server
Yes, it works now. Thank you!
If you have more questions, please let us know