This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Thread network UDP example

Dear Nordic,

Is there any working example of starting comunication over the UDP protocol in thread network?

 

Parents
  • Hi,

    Technically all the CoAP and MQTT-SN examples communicate over UDP, but they also includes higher layer application protocols. If you want to communicate purely over UDP packets, there is unfortunately no examples showing this. The CLI example is capable of sending UDP packets, maybe this is suitable for your needs?

    See the CLI UDP reference on GitHub.

    If you want a pure UDP example, this should be quite simple to implement. You can reference the code used in the CLI UDP module, and the OpenThread UDP API reference.

    Best regards,
    Jørgen

  • I have another issue.

    What I have to pass to function "otUdpOpen" in aContext variable using C language?? I passed NULL but I get hard fault.

    Below doc to this function

    otUdpOpen ( otInstance *  aInstance,
    otUdpSocket aSocket,
    otUdpReceive  aCallback,
    void *  aContext 
    )

    Open a UDP/IPv6 socket.

    Parameters
    [in] aInstance A pointer to an OpenThread instance.
    [in] aSocket A pointer to a UDP socket structure.
    [in] aCallback A pointer to the application callback function.
    [in] aContext A pointer to application-specific context.
  • Hi Jorgen,

    I am Sunil,

    I am looking for the caop UDP example and found this ticket i am able to receive the text which i send from cli using this command

    "udp send fdde:ad00:beef:0:2e44:8255:71b7:94ea 1234 hi"

    and i  receive

    <info> app: 2 bytes from
    <info> app: addr: FDDE:AD00:BEEF
    <info> app: addr: 0000:AE59:F903
    <info> app: addr: E6A1:2955
    <info> app: port: 49154
    <info> app:  68 69                  |hi 

    and my question is

    1. How to send the text message from program using udp

    2. the udp_receive_handle doesn't capture the button action . how to read the message transfer to server when pressing the button 2

Reply
  • Hi Jorgen,

    I am Sunil,

    I am looking for the caop UDP example and found this ticket i am able to receive the text which i send from cli using this command

    "udp send fdde:ad00:beef:0:2e44:8255:71b7:94ea 1234 hi"

    and i  receive

    <info> app: 2 bytes from
    <info> app: addr: FDDE:AD00:BEEF
    <info> app: addr: 0000:AE59:F903
    <info> app: addr: E6A1:2955
    <info> app: port: 49154
    <info> app:  68 69                  |hi 

    and my question is

    1. How to send the text message from program using udp

    2. the udp_receive_handle doesn't capture the button action . how to read the message transfer to server when pressing the button 2

Children
No Data
Related