I explain the difference between RcvPacket() and Read().
WizFi210 send all data including user data, notification message and reply to command which user sent via serial interface.
RcvPacket() is a function to get data from WizFi210 and parse it.
If it got data for specific socket, then copy it to common data buffer and set the specified socket’s flag to inform what it has data.
And if it got reply for any command user sent right ahead, it handle the status of corresponding socket or WizFi210 itself.
And if it got notification message like “Disassociated from AP”, “Connected” or “Disconnected”, it handle the status of corresponding socket or WizFi210 itself.
In order to miss all processing, User should track data from wizFi210 and parse it without loss.
So user must call RcvPacket() infinitely.
loop() function is called infinitely. That is the reason why I placed RcvPacket() in loop() function.
Read() is to get data from data buffer which RcvPacket() filled.
If you see inside Read(), you can find how Read() operates.
Read() check whether its data ready flag is set or not. If so, It return the pointer of buffer which data is stored in.
[quote=“ssekim”]If the RcvPacket() is only used as an internal function, then why is it used externally in the WizFiWebClientTest.ino example also included with the library? It seems to me that both RcvPacket() and Read() are used together, but I’m am not sure what the point of RcvPacket() is. This is the section of code in the example that uses RcvPacket(). What exactly is RcvPacket() accomplishing in this code?
github.com/Wiznet/WizFiShield/b … ntTest.ino
memset(rcvdBuf, 0, 129);
retval = myClient.connect();
if(retval == 1)
myClient.write((byte *)"GET /search?q=WizFi210 HTTP/1.0\r\n\r\n");