Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 7 months ago.
Get List of Client with ARP (Address Resolution Protocol) using W5500
Hi all,
I have tested TCP communication with this library and it works ok.
Now, I want to be able to get list of client (their IP address and MAC) in the network, while my mbed device is also a client. After browsing for some times, I think the ARP (Address Resolution Protocol) is what we needed. Or do you have other suggestion?
Please provide me with example of sending ARP packets with this library to get info of client connected to the network.
I have tried to compile the official mbed EthernetInterface library (as it has ARP part in it), but as it doesn't support STM32F1 (which I use). So, I think it is a dead end.
Thanks for your time and willingness to answer my question
Cheers
Question relating to:
1 Answer
9 years, 7 months ago.
To Tigor,
W5500 send ARP packets in internal as below cases, - TCP Connect command: ARP request is send before SYN packet in TCP. - UDP Send command: ARP request is send before sending of UDP data.
W5500 is generated ARP Time-out When W5500 couldn't receive the ARP respone.
So, you should be check Sn_IR_TIMEOUT after TCP Connect and UPD send command.
if (getSn_IR(sn) & Sn_IR_TIMEOUT) { setSn_IR(sn, Sn_IR_TIMEOUT); return SOCKERR_TIMEOUT; }
If W5500 was established in TCP mode, you can know the destination MAC address by reading of the Socket destination Hardware address register (Sn_DHAR).
Thanks