How to transmit continous data from FRDM-KW41ZMCU to ble device (NXP IOT toolbox is app)?

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

How to transmit continous data from FRDM-KW41ZMCU to ble device (NXP IOT toolbox is app)?

781 Views
pooja_vernekar
Contributor I

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.

0 Kudos
Reply
3 Replies

683 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply

683 Views
pooja_vernekar
Contributor I

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.

0 Kudos
Reply

683 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply