Hello,
I am trying to use a CC2538 to transmit data from a MEMs Sensor to a CC2538EM which sends the data via the USB in the SmartRf06 Board to a PC. I have been trying to modify the GenericApp found in Z-stack Mesh 1.0.0, to send my data instead of the example's "Hello World", but I am having two issues. First, I modified the send message function to send sensor data as such:
static void GenericApp_SendTheMessage( void )
{
InitGyro(); //initalize gryo for use
int8_t data = DataAcq(); //getting data from sensor
//request to send data
if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,
GENERICAPP_CLUSTERID,
(byte) data +1,
(byte *)&data,
&GenericApp_TransID,
AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
{
// Successfully requested to be sent.
}
else
{
// Error occurred in request to send.
}
}
But all I get is jibberish on the receiving end. Does the data have to be characters like the original "Hello World"? Or is there maybe a better way to do this? I tried looking in the Temperature Sensor example in Z-stack Home, but I couldn't find where the sent any data.
Secondly, when I use the unedited code, I cannot get the data to properly show up on my terminal. Instead of "Hello World Rcvd: x" is usually comes through as "Helo Wo HHello Worldo Rcvd:x". I tried messing around with the parity, stop, etc. in the terminal but nothing would solve it. I have tried using the HalUARTWrite() function and the UARTprintf() function from the CC2538 firmware in the GenericApp_MessageMSGCB function but neither have worked so far. Again maybe there is a better way to do this?