Shop OBEX P1 Docs P2 Docs Learn Events
W5500 and Unicast UDP — Parallax Forums

W5500 and Unicast UDP

I have read everywhere I can find, and I am still at a lost. I am trying to figure out how to set _Sn_MR / _MULTIM so that I can receive UDP packets in unicast. My project, using the P8X32A-D40, works fine with multicast, but I would rather unicast. Any help would be greatly appreciated. Thanks.

The code to open the socket: ( wiz. SocketOpen(skt,$82,0,5568, @destIP[0]))

Comments

  • UDP is a connectionless protocol.

    You would open a connection to yourself on the port you want to use. Then build a packet and send it to the destination address and port. You can't just open a connection to the other IP.

    It would be the same as multicast except you don't use the multicast address.

    Mike

  • Looking at the driver your send data packet should contain the IP address in the first 3 bytes and the port number in the next 2 bytes followed by 2 bytes with the length of the packet followed by the data.

    txUDP(skt, packet)

    Mike
  • Thank you so much I will try this.

    Joey
Sign In or Register to comment.