This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1352R: Sending a payload from controller to sensor (follow-up)

Part Number: CC1352R

Hi,

using the TI 15.4 stack, I'm trying to get a simple payload from the collector (in this case, Linux with CoP) to a sensor.

So far, I have modified the  appC_sendToggleLedMsgToAppServer function to add extra data (changed length, and added some data to the buffer : 

<Buffer 05 00 0a 0d 06 01 00 55 55>, note the extra 55 55). 

Looking in the sensor function dataIndCB (sensor.c in the sensor project), in the Smsgs_cmdIds_toggleLedReq case, I don't actually see the extra 55 55 in pDataInd.

I've tried going down the stack, but can't see where the data from the radio would be inserted (or not, as in this case!). 

There are lots of examples on extending sensor messages to the controller, but couldn't find anything for controller -> sensor.

To sum it up, I need some pointers on how to modify the sensor code for the led toggle example in order to read the extra payload data.

TIA

 

  • hello mh,

    Did you make sure to change the msg len in smgs.h of the sensor and collector side?

    Regards,

    AB

  • Hi AB,

    actually haven't. Not able to experiment right now, but is that constant used some other place than here? I am breaking before line 917 to look at the data. And on the Linux appClient.js side, I am changing the length of the message according to the extra data. Sorry if these questions are basic, I'm still not comfortable with the architecture on either side of the 15.4 stack.

  • Hello mh,

    Do not apologize, thats what we are here for. :D

    The best way to modify a message is to first start with the actual data structure of the message in the smgs.h since space is allocated using these structures and definitions before sending out the message or receiving the mesagges.

    Make those changes and it should work.

    Regards,

    AB

  • Hi AB,

    so exploring a little further, on the Linux collector side, it is important to make changes to smsgs.h as you pointed out, but also to the call to 

    Csf_sendToggleLedRequest() in appsrv.c, the the Csf_sendToggleLedRequest() function itself in csf_linux.c/.h and finally, to collector.c/.h to 

    Collector_sendToggleLedRequest() to take into account the new message format.

    Thanks again for your help!