Unable to use 16-bit UUID in KW45 Wireless UART Example

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

Unable to use 16-bit UUID in KW45 Wireless UART Example

499 Views
Abhi1112
Contributor I

Hello NXP Team,

I am working on KW45B41Z-EVK using the Wireless UART FreeRTOS example.

I noticed that macros like PRIMARY_SERVICE_UUID16 are not available,
and the example uses only 128-bit UUIDs.

I want to implement a custom 16-bit UUID service (e.g., 0xFFF0), but I am unsure
how to correctly define it using the existing GATT database macros.

Could you please clarify:
1. How to properly define 16-bit UUID using UUID16 macro?
2. Whether PRIMARY_SERVICE macro supports 16-bit UUID directly?
3. Any recommended approach for custom services in KW45 BLE stack?

Thank you.

0 Kudos
Reply
1 Reply

446 Views
sofiaurueta
NXP Employee
NXP Employee

Hello,
Hope you are doing well.

 

The UUID is a 128-bit value. To reduce the overhead associated with storing and transmitting 128‑bit UUIDs, the Bluetooth SIG has pre‑allocated a range of UUIDs for frequently used, registered purposes. These pre‑allocated UUIDs have 16‑bit aliases, commonly referred to as 16‑bit UUIDs. Although they are represented as 16‑bit values, each actually represents a 128-bit UUID value.

A list of Bluetooth SIG‑defined 16‑bit UUIDs can be found on the Assigned Numbers documentation of the Bluetooth Technology website. If you need a custom service intended for broader or official use, it is also possible to request and purchase an official 16‑bit UUID as a Bluetooth SIG member.

 

When defining a GATT database, the GATT_DB API provides several macros for declaring services. For 16‑bit UUIDs, the following macro is used: PRIMARY_SERVICE(name, uuid16). Both the UUID16 and PRIMARY_SERVICE macros support the Bluetooth SIG‑defined 2‑byte UUIDs. These 16‑bit UUID constants for GATT declarations are provided in the ble_sig_defines.h header file.

For more information on GATT services see Creating GATT database — MCUXpresso SDK Documentation

 

If you are looking is to implement a custom service using the wireless_uart SDK example, the recommended approach is to first define a 128‑bit UUID. In that case, you should use the UUID128 and PRIMARY_SERVICE_UUID128 macros instead. This example implementation might be helpful: KW38 Custom Profile.

 

Best regards,
Ana Sofia.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2345612%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUnable%20to%20use%2016-bit%20UUID%20in%20KW45%20Wireless%20UART%20Example%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2345612%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20NXP%20Team%2C%3C%2FP%3E%3CP%3EI%20am%20working%20on%20KW45B41Z-EVK%20using%20the%20Wireless%20UART%20FreeRTOS%20example.%3C%2FP%3E%3CP%3EI%20noticed%20that%20macros%20like%20PRIMARY_SERVICE_UUID16%20are%20not%20available%2C%3CBR%20%2F%3Eand%20the%20example%20uses%20only%20128-bit%20UUIDs.%3C%2FP%3E%3CP%3EI%20want%20to%20implement%20a%20custom%2016-bit%20UUID%20service%20(e.g.%2C%200xFFF0)%2C%20but%20I%20am%20unsure%3CBR%20%2F%3Ehow%20to%20correctly%20define%20it%20using%20the%20existing%20GATT%20database%20macros.%3C%2FP%3E%3CP%3ECould%20you%20please%20clarify%3A%3CBR%20%2F%3E1.%20How%20to%20properly%20define%2016-bit%20UUID%20using%20UUID16%20macro%3F%3CBR%20%2F%3E2.%20Whether%20PRIMARY_SERVICE%20macro%20supports%2016-bit%20UUID%20directly%3F%3CBR%20%2F%3E3.%20Any%20recommended%20approach%20for%20custom%20services%20in%20KW45%20BLE%20stack%3F%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2346550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Unable%20to%20use%2016-bit%20UUID%20in%20KW45%20Wireless%20UART%20Example%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2346550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%20lang%3D%22es-419%22%3EHello%2C%3CBR%20%2F%3EHope%20you%20are%20doing%20well.%3C%2FP%3E%0A%3CP%20lang%3D%22es-419%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20UUID%20is%20a%20128-bit%20value.%20To%20reduce%20the%20overhead%20associated%20with%20storing%20and%20transmitting%20128%E2%80%91bit%20UUIDs%2C%20the%20Bluetooth%20SIG%20has%20pre%E2%80%91allocated%20a%20range%20of%20UUIDs%20for%20frequently%20used%2C%20registered%20purposes.%20These%20pre%E2%80%91allocated%20UUIDs%20have%2016%E2%80%91bit%20aliases%2C%20commonly%20referred%20to%20as%2016%E2%80%91bit%20UUIDs.%20Although%20they%20are%20represented%20as%2016%E2%80%91bit%20values%2C%20each%20actually%20represents%20a%20128-bit%20UUID%20value.%3C%2FP%3E%0A%3CP%3EA%20list%20of%20Bluetooth%20SIG%E2%80%91defined%2016%E2%80%91bit%20UUIDs%20can%20be%20found%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.bluetooth.com%2Fspecifications%2Fassigned-numbers%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EAssigned%20Numbers%3C%2FA%3E%20documentation%20of%20the%20Bluetooth%20Technology%20website.%20If%20you%20need%20a%20custom%20service%20intended%20for%20broader%20or%20official%20use%2C%20it%20is%20also%20possible%20to%20request%20and%20purchase%20an%20official%2016%E2%80%91bit%20UUID%20as%20a%20Bluetooth%20SIG%20member.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EWhen%20defining%20a%20GATT%20database%2C%20the%20GATT_DB%20API%20provides%20several%20macros%20for%20declaring%20services.%20For%2016%E2%80%91bit%20UUIDs%2C%20the%20following%20macro%20is%20used%3A%20PRIMARY_SERVICE(name%2C%20uuid16).%20Both%20the%20UUID16%20and%20PRIMARY_SERVICE%20macros%20support%20the%20Bluetooth%20SIG%E2%80%91defined%202%E2%80%91byte%20UUIDs.%20These%2016%E2%80%91bit%20UUID%20constants%20for%20GATT%20declarations%20are%20provided%20in%20the%20ble_sig_defines.h%20header%20file.%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20on%20GATT%20services%20see%20%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fmiddleware%2Fwireless%2Fbluetooth%2Fdoc%2FBluetooth%2520Low%2520Energy%2520Application%2520Developers%2520Guide%2Ftopics%2Fcreating_gatt_database.html%23creating-gatt-database%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ECreating%20GATT%20database%20%E2%80%94%20MCUXpresso%20SDK%20Documentation%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIf%20you%20are%20looking%20is%20to%20implement%20a%20custom%20service%20using%20the%20wireless_uart%20SDK%20example%2C%20the%20recommended%20approach%20is%20to%20first%20define%20a%20128%E2%80%91bit%20UUID.%20In%20that%20case%2C%20you%20should%20use%20the%20UUID128%20and%20PRIMARY_SERVICE_UUID128%20macros%20instead.%20This%20example%20implementation%20might%20be%20helpful%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FWireless-Connectivity-Knowledge%2FKW38-Custom-Profile%2Fta-p%2F1269874%22%20target%3D%22_blank%22%3EKW38%20Custom%20Profile.%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EAna%20Sofia.%3C%2FP%3E%3C%2FLINGO-BODY%3E