Hello,
I am trying to transmit a "Hello\n" message from FRDM-KW41Z MCU to NXP IOT Toolbox (wireless uart).
But i am not able to receive any message.
I am using demo example - "BLE-wireless uart" ,
wireless uart example program is working fine but i want to transmit data from MCU to NXP IOT Toolbox(wireless uart ) application. Without typing any message into the terminal or Serial terminal i should be able to recieve message on NXP iot toolbox application.
This is what i have made changes to function.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void BleApp_FlushUartStream(void *pParam)
{
char *pMsg = "hello\n";
uint16_t bytesRead = 0;
if (mPeerInformation.appState != mAppRunning_c)
{
return;
}
/* Allocate buffer for GATT Write */
*pMsg = MEM_BufferAlloc(mAppUartBufferSize);
if (*pMsg == NULL)
{
return;
}
/* Collect the data from the serial manager buffer */
if ( Serial_Read( gAppSerMgrIf, *pMsg, mAppUartBufferSize, &bytesRead) == gSerial_Success_c )
{
if (bytesRead != 0)
{
/* Send data over the air */
BleApp_SendUartStream(mPeerInformation.deviceId, *pMsg, bytesRead);
}
}
/* Free Buffer */
MEM_BufferFree(*pMsg);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
please suggest if any changes to be made to any other functions of the program.
Hi Pooja,
As you can see, the Wireless Uart example is waiting for a UART message, the serial manager provides a new incoming buffer, also please look at the BleApp_SendUartStream that sends data over the air.
It will depend on your application if you want a software timer or create an event.
Regard,
Mario
Hello Mario,
Is it not possible to receive a data from FRDMKW41Z board to ble wireless uart app?
I just need "hello" message from MCU board without typing/sending it via terminal.
Hi Pooja,
Is it not possible to receive data from the FRDMKW41Z board to ble wireless uart app?
Yes, it is possible. You need to create an event or timer, that triggers the BleApp_SendUartStream with your message "Hello World".
Regards,
Mario