Access to BLE UUID128 from custom profile in server

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Access to BLE UUID128 from custom profile in server

1,765 Views
robertnäger
Contributor II

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?

Best regards

Robert

0 Kudos
4 Replies

1,272 Views
Xiang_Li
NXP Employee
NXP Employee

I had exact same issue today and solved it. For the future reference, just add a line:

#include "gatt_db_handles.h"

would solve the issue.

More details:

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.

1,272 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Have you checked this post6s ? 

Creating a custom profile using NXP BLE stack – Server  

https://community.nxp.com/docs/DOC-328287 

Best regards, 

Estephania 

1,272 Views
robertnäger
Contributor II

Yes, it works now. Thank you!

0 Kudos

1,272 Views
estephania_mart
NXP TechSupport
NXP TechSupport

If you have more questions, please let us know 

Best Regards, 

Estephania 

0 Kudos