AnsweredAssumed Answered

how to read value sent by device in wireless uart demo (ble)?

Question asked by marco mangraviti on May 16, 2019
Latest reply on Jul 4, 2019 by Estephania Martinez

Hello,

i use a board with wireless uart demo with kw41z mcu.

It works fine with nxp iot toolbox app so i can reach BleApp_GattServerCallback() function and execute my code.

Ex:

 

  1. static void BleApp_GattServerCallback (  
  2.                                        deviceId_t deviceId,  
  3.                                        gattServerEvent_t* pServerEvent)  
  4. {  
  5.     switch (pServerEvent->eventType)  
  6.     {  
  7.         case gEvtAttributeWrittenWithoutResponse_c:  
  8.         {  
  9.             if (pServerEvent->eventData.attributeWrittenEvent.handle == value_uart_stream)  
  10.             {  
  11.                 //custom code (e.g. Led toggle function )  
  12.                 BleApp_ReceivedUartStream(pServerEvent->eventData.attributeWrittenEvent.aValue,  
  13.                             pServerEvent->eventData.attributeWrittenEvent.cValueLength);  
  14.                 //custom code  
  15.             }  
  16.             break;  
  17.         }  
  18.     default:  
  19.         break;  
  20.     }  
  21. }  

into BleApp_ReceivedUartStream() function there is an echo service that send data OTA through BleApp_SendUartStream() function. The data sent with these function can be read by iot Toolbox app. It works fine.

 

Now i'm try tro create a UWP app in c# for work as iotToolBox.

I can find the ble device, connect to it and write the wireless_uart_characteristic.

I verify that my app can execute my custom code (eg. Led toggle) and i'm sure that it work correctly and i'm sure that device sent data by OTA.

unfortunately, i'm not able to read the data send by kw41z device.

With debugger i see that characteristic inside BleApp_SendUartStream() function has a uuid128 different from wireless uart characteristic uuid.

however i not found these uuid with my app and if i read the written characteristic, the value is the same that my app wrote.

 

i need help.

 

Best regards

 

Marco

Outcomes