I've been working through the guide here and have completed it successfully:
processors.wiki.ti.com/index.php/Adding_New_Sensor_Support_To_Sub1GHz_Sensor_To_Cloud_Linux_Gateway#Adding_New_Sensor_Support_To_Sub1GHz_Sensor_to_Cloud_Linux_Gateway
Now my question is I want to send an array from the sensor to the collector and display it on the gateway. I can send and receive an array using the following code, but I'm not sure how to receive it in the JavaScript appclient.js code
The sensor msg looks like this:
typedef struct _Smsgs_arrayTest_t
{
char arrayTest[SMSGS_ARRAY_TEST];
} Smsgs_arrayTest_t;
And in collector.c I get the array with:
if(sensorData.frameControl & Smsgs_dataFields_arrayTest)
{
strncpy ((char *)sensorData.arrayTest.arrayTest, (char *)pBuf, SMSGS_ARRAY_TEST);
pBuf += SMSGS_ARRAY_TEST;
}
And put it into the buffer in appsrv.c with:
if(pDataMsg->frameControl & Smsgs_dataFields_arrayTest)
{
len += SMSGS_ARRAY_TEST;
strncpy ((char *)pBuff, (char *)pDataMsg->arrayTest.arrayTest, SMSGS_ARRAY_TEST);
pBuff += SMSGS_ARRAY_TEST;
}
I guess I could add it into the buffer at step 3 differently, but is there a way to unpack an array from the buffer in appclient.js?