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: Using the TI 15.4 Stack to send data from Collector to Sensor

Part Number: CC1352R

Hi.

My aim is to send User defined data or message from Collector to the Sensor.

To do that i have identified (from the forum itself) that we can use the already defined  SendMsg() on the Collector side. I wrote a function on the footsteps of the generateBroadcastCmd()  on the Collector side. And in that function i called the SendMsg() instead of  sendBroadcastMsg(). . 

Is it possible to do in the above mentioned way? or do I have to write my own function to call SendMsg() ? If yes, then on what lines should I write that?

And regarding the Sensor side, what changes will i have to make to receive that same data? Do I have to write a function on the same lines as ProcessSensorData() (which is on the Collector side) on the Sensor side?

Thanks.

  • Probably a better function that you should look at to send data to a sensor is the function "Collector_sendToggleLedRequest"

    on the sensor side you will receive this data in "dataIndCB"
  • Hi Hector_r ,

    Thanks for responding. I tried the method you suggested, but I'm still stuck,

    I identified that the data is being acquired in the "pDataInd->p buffer".(Please correct me if i am wrong).

    The problem with this method is that in "dataIndCB" the switch case contains "cmdId", which takes the "Smsgs_cmdIds_ ...." as the case.I wrote the print command in the case "Smsgs_cmdIds_toggleLedReq:", but it didnt work. So to debug i wrote print command in all the case statements and I found out that it doesn't go into the case "Smsgs_cmdIds_toggleLedReq:", whereas it prints the print statements i wrote in all the other cases.
    So I thought the problem might be with the Collector side itself. So i checked and the "Collector_sendToggleLedRequest" function and found that it is called in the csf.c file. I even tried pressing the left key as the "Collector_sendToggleLedRequest" function was called inside that "if ". But it didn't work.
    Kindly help me in knowing where did I go wrong.[quote user="Hector_r"]Probably a better function that you should look at to send data to a sensor is the function "Collector_sendToggleLedRequest"

    on the sensor side you will receive this data in "dataIndCB"

    Thank you.
  • Hello,
    Can anyone please help me to the aforementioned question?
  • Have you done any extra modifications to the default examples? I have tested this and I see no issue when I press the left button in the collector I see the message received in the sensor side. One thing to note is that you will not receive the data mediately because by default the sensor is configured as a sleepy device so you will have to wait for the sensor to send a poll message to the collector to ask if there are any packets that need to be delivered. i believe the default polling interval is set to 6 seconds. So worst case scenario you will have to wait 6 seconds for the sensor to receive the message
  • Hello Hector_r,
    Apart from the modifications you mentioned, I just enabled the FH mode in both Collector as well as Sensor. But that won't be a problem, right?
  • Hey Hector_r,
    I tried it again and it worked. On the button click on Collector device, the data is shown on the Sensor side. I might be making some mistake in my First attempt. Sorry to bother you for that.
    Now when i connected 2 sensors and 1 Collector. The Collector sends the data to the Sensor node which is connected first. So my question is "How can we manipulate the Collector to send the data to the Sensor node which we want to?"
  • Yes, you are correct the code in the collector will send this LED toggle message only to the first device that joined the network. In order to send it to a different device you will have to change the value of the short address that you want to send this message to. Every sensor that joins the network gets a short address assigned to them and by default it is just a counter. For example the first device that joins the network receives the address 0x0001, the second device that joins the network receives the address 0x0002 and so on. so if you wanted to send the message to the second device then you could do something like the code below

    ApiMac_sAddr_t targetDevice;
    
    targetDevice.addrMode = ApiMac_addrType_short;
    targetDevice.addr.shortAddr = 0x0002;
    
    Collector_sendToggleLedRequest(&targetDevice);

  • It's working now.
    Really appreciate your help Hector_r.
    Thanks.