cancel
Showing results for 
Search instead for 
Did you mean: 

Where is the Downlink receiving and processing function?

HNguy.25
Associate III

Hello everyone,

Currently, I am working with the example LoRaWAN_End_Node on Nucleo-WL55JC1. I am trying to achieve downlink control. Downlink messages are sent from Chirpstack NS.

Right now, I don't know where the function of receiving and processing downlink packets is, in the LoRaWAN_End_Node. I suspect that it is the function OnRxData in lora_app.c but when I tested, it was not what I wanted.

Can anyone help me on finding where that function is and how to implement new code?

P/s: My next goal is to send a hex (01) from Chirpstack NS to the board so that an LED is turned on.

Thank you in advanced, Huy Nguyen.

1 ACCEPTED SOLUTION

Accepted Solutions
Louis AUDOLY
ST Employee

Hello @Community member​ ,

You were right, you can process the data sent to your device in this function regarding the port on which data is sent.

Then you can process the buffer, a parameter of the structure "LmHandlerAppData_s"

 0693W00000UnatVQAR.png 

In the End_Node example, depending of the port used to send data, we process the payload to change the class of the device or blink a LED.

You can already use this example for your use case

Hope my answer helped you!

When your question is answered, please close this topic by choosing Select as Best.

View solution in original post

3 REPLIES 3
Louis AUDOLY
ST Employee

Hello @Community member​ ,

You were right, you can process the data sent to your device in this function regarding the port on which data is sent.

Then you can process the buffer, a parameter of the structure "LmHandlerAppData_s"

 0693W00000UnatVQAR.png 

In the End_Node example, depending of the port used to send data, we process the payload to change the class of the device or blink a LED.

You can already use this example for your use case

Hope my answer helped you!

When your question is answered, please close this topic by choosing Select as Best.

HNguy.25
Associate III

ah so indeed the reception and the processing of downlink packets is in OnRxData in lora_app.c. I also later used another way to test the function and it was as you said.

Thank you for your answer, Huy Nguyen.

@Louis AUDOLY​  ah so indeed the reception and the processing of downlink packets is in OnRxData in lora_app.c. I also later used another way to test the function and it was as you said.

Thank you for your answer, Huy Nguyen.