[From QnA]RcvPacket() Function in Github Arduino Library
Wireless
No replies yet. Be the first to reply.
Join the discussion.
Wireless
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: [From QnA]RcvPacket() Function in Github Arduino Library
by ssekim ·
RcvPacket() function is used to realize as internal function.
Read() function is used to read the information of buffer.
Therefore you are only using read function.
Thanks,
RE: [From QnA]RcvPacket() Function in Github Arduino Library
by 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?
Thanks
github.com/Wiznet/WizFiShield/b … ntTest.ino
[code]void loop()
{
uint8_t retval;
byte rcvdBuf[129];
memset(rcvdBuf, 0, 129);
if(Wifi_setup)
{
myWizFi.RcvPacket();
}
}
[/code]
RE: [From QnA]RcvPacket() Function in Github Arduino Library
by ssekim ·
read function just is reading stored data in buffer.
and RcvPacket function is storing received data to buffer.
thanks,
RE: [From QnA]RcvPacket() Function in Github Arduino Library
by jameskim ·
Hi,
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.
Thanks.
javakys.
[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?
Thanks
github.com/Wiznet/WizFiShield/b … ntTest.ino
[code]void loop()
{
uint8_t retval;
byte rcvdBuf[129];
memset(rcvdBuf, 0, 129);
if(Wifi_setup)
{
myWizFi.RcvPacket();
}
}
[/code][/quote]