BLE GATT characteristic read/write example code

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

BLE GATT characteristic read/write example code

3,126 Views
haideriftikharm
Contributor II

Hello,

Is there any simple BLE GATT characteristic read/write example code available for FRDM KW36? Thankyou.

Regards,

Haider Iftikhar

Labels (1)
0 Kudos
5 Replies

2,293 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Haider, I hope you're doing well!

 

You could check some of the BLE examples provided with the KW36 SDK, but specifically, "hrs" (Heart Rate Sensor) and "w_uart" (Wireless UART) could be very useful, as they have different types of services and characteristics that you could use as reference.

 

In the Heart Rate Sensor example, you could check the services for Battery and for Heart Rate, as those provide writable and readable characteristics.

 

The path for the examples is:

<…\SDK_2.2.1_FRDM-KW36\boards\frdmkw36\wireless_examples\bluetooth>

 

Also, these two community documents might be useful to you:

 

How to create a Custom Profile - Client

How to create a Custom Profile - Server

 

Could you please check those and see if they're useful to you?

 

Best regards,

Sebastian

2,293 Views
haideriftikharm
Contributor II

Hello Sebastian,

I went through the HRS example but I am a bit confused and lost in which file the services/characteristics are witten and in which file it is coded to read/write the characteristic. 

Also is there any BLE API available for NXP that i can look into. Thankyou.

Regards,

Haider Iftikhar

0 Kudos

2,293 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Haider,

 

The KW36Z's SDK has a document called "Bluetooth Low Energy Host Stack API Reference Manual" that may be useful to get an idea of the structure of BLE applications, as well as the different functions and data structures of the API.

 

The document can be found in the following path:

<…\SDK_2.2.1_FRDM-KW36\docs\wireless\Bluetooth\Bluetooth Low Energy Host Stack API Reference Manual.pdf>

 

 

Also, the BLE API is included in the SDK archive if you selected the BLE stack middleware component when building the SDK in our builder.

 pastedImage_1.png

 

You can also check the Bluetooth Developer's Guide, in the following SDK Path:

 

<…\SDK_2.2.1_FRDM-KW36\docs\wireless\Bluetooth\Bluetooth Low Energy Application Developer's Guide.pdf>

 

We also have some tutorials in our website that may be useful to get started with BLE development on the KW41Z and KW36Z families of MCUs.

 

Please let me know if you have any further questions.

 

Best regards,

Sebastian

2,293 Views
haideriftikharm
Contributor II

Hello Sebastian,

I went through the SDK.

When I debug a progrom to my board, I get a following error:

15: Target error from Test Thread Liveness: Et:39: Unknown thread ID selected
15: Target error from Test Thread Liveness: Et:39: Unknown thread ID selected
Debugging context: frdmkw36_wireless_examples_bluetooth_temp_sens_freertos LinkServer Debug

can you please tell me how to get rid of this, thankyou.

Regards

Haider Iftikhar

0 Kudos

2,293 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Haider,

 

The temperature sensor example enters Low Power Mode during execution of the program, and the device cannot be debugged if it enter this mode. To disable this mode during you'll need to change the following macro in the app_preinclude.h header file to a 0:

 

#define cPWR_UsePowerDownMode           0

 

For more specific information about configuration and functionality of the Wireless Demo applications, there's a document named Bluetooth Low Energy Demo Applications User's Guide.pdf.

 

It can be found in the following path:

 

SDK_2.2.1_FRDM-KW36\docs\wireless\Bluetooth\

 

Could you please try that?

 

Please let me know if you have any more issues regarding this.

 

Best regards,

Sebastian

0 Kudos