KW45 How does BLE client write data to BLE Server?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

KW45 How does BLE client write data to BLE Server?

ソリューションへジャンプ
1,429件の閲覧回数
trent
Contributor II

I want to modify the SDK examples:temperature sensor and collector so that collector can write Characteristic Value,The sensor can print out the values written by the collector through UART.

As shown in the picture, press the button of the sensor first, and the sensor sends the Notification. The collector triggers **GattNotificationCallback**, prints out the value "value_temperature", and then uses the API: GattClient_WriteCharacteristicValue Changes the value of value_temperature.The sensor triggers **GattServerCallback** to print the value of value_temperature.But collector can print value_temperature, sensor UART does not print, looking forward to your suggestions and guidance!

我希望修改例程: temperature sensor 和 collector,可以使 collector 可以写

Characteristic Value,sensor 可以将 collector 写入的值通过 UART 出来,

如图片展示 先按下 sensor 的按键,sensor 发送 **Notification**,collector 触发**GattNotificationCallback**,打印出 “value_temperature”的值,之后使用GattClient_WriteCharacteristicValue 修改 “value_temperature”的值,sensor 端触发 **GattServerCallback** 打印出“value_temperature”的值。但是 collector可以打印出value_temperature, sensor 的UART没有打印,期待你的建议和指导

 

trent_0-1730872914910.png

trent_1-1730873219851.png

trent_2-1730873601202.png

 

 

ラベル(1)
0 件の賞賛
返信
1 解決策
1,353件の閲覧回数
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello,

 

With Wireless UART, even if the device is in central mode, the BleApp_ReceivedUartStream is called when receiving something from the peripheral.

 

Regards,

Ricardo

元の投稿で解決策を見る

3 返答(返信)
1,398件の閲覧回数
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello,

 

Hope you are doing well. Is there any special consideration why the collector would need to write a characteristic to the sensor?

 

If you want to receive on a serial terminal something "received" from Bluetooth, maybe you can take the Wireless UART example as a base for your application.

 

This example already enables UART and bidirectional BLE communication.

 

Best Regards,

Ricardo

0 件の賞賛
返信
1,393件の閲覧回数
trent
Contributor II

thanks for your reply

I think "temperature sensor and collector" is more appropriate,Of course I also can take the Wireless UART example as a base for your application.But I have a question about the Wireless UART example,From my understanding of W_UART, BLE printing data to serial terminal requires the use of BleApp_ReceivedUartStream, which is only used in BleApp_GattServerCallback.Can Central also use BleApp_GattServerCallback?If not, how does Central transfer data to UART.

我认为使用“ temperature sensor and collector ”更合适,当然我也可以用 Wireless UART example 作为应用程序的基础。但是对于Wireless UART example 我有疑问,向 UART输出数据需要使用到 BleApp_ReceivedUartStream 但它只在 BleApp_GattServerCallback 中被应用,BLE做为 Central 也能使用BleApp_GattServerCallback ?如果不能,Central是如何向UART传输数据的

trent_0-1730945742857.png

 

0 件の賞賛
返信
1,354件の閲覧回数
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello,

 

With Wireless UART, even if the device is in central mode, the BleApp_ReceivedUartStream is called when receiving something from the peripheral.

 

Regards,

Ricardo