W5200 RJ45 cable detection
oodes
Posts: 131
Is there any way to detect if a Ethernet cable is plugged into the RJ45 connector in software on the W5200? I want to find out if after i have already established a connection if the cable has been removed so as to flag up an error. After I established the socket and connect and send data, if I remove the cable and I call the method
sock.connectedor
sock.getStatusit returns the same value as when the cable is connected
Comments
Where can I find this?
I should use :
PRI ReadByte(PSTATUS) spi.Read(register, 1, @workSpace) return workSpace[0] & $FF
???
PUB GetPSTATUS 'Method in Socket object return wiz.GetPSTATUS
pst.bin(Sock.GetPSTATUS,8) 'Method call in Top Object
With the Ethernet cable connected or disconnected , all I ever get is '00000000' outputted on the PST
From the Image attached I should be getting a '1' at bit 5 when cable connected right?
I just tried it and sure enough bit 5 is set when the cable is connected to my router and not set if there is no connection. There must be connectivity (of some kind) with the router because just having a unconnected cable inserted in the connector results in a 0 bit.
I hope this helps.
I ended up closing the connection and re-opening as a cable check which is a bit cumbersome. I'm away on holidays but ill give it a go when I get back and let you know if it works.
Appreciate the help MJ
Des
Cheers MJ ,