W5500 Client TCP: sending status flag
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
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: W5500 Client TCP: sending status flag
by bangbh ·
You can check it via Sn_IR register. There is a SEND_OK register that is set when SEND command is completed.
But if you are using iolibrary, the send() function waits for the same signal so that you don’t need to check other flags.
Thanks.
RE: RE: W5500 Client TCP: sending status flag
by Dan1 ·
I know the SEND_OK flag but the sock_is_sending flag is checked at the begining of send() and it high due to previos send(). So it check the SEND_OK which already released in previos send()…So i got BUSSY at second send()…
I think that I can manage…
Thanks
Dan
RE: W5500 Client TCP: sending status flag
by Krzysztof ·
Hi, I have same problem. And I wander how sned() should work. New interrupt clear socket interrupt register with new flags. Hence " sock_is_sending" flag will be always set on because SENDOK never appear again.
Any idea?
Thanks
Krzysztof
RE: W5500 Client TCP: sending status flag
by cellkey ·
…Hi, I was surprised by your question so long time since my post was sent
I have working very nice since than/ see code of my SEND() proc:
int32_t send(uint8_t sn, uint8_t * buf, uint16_t len)
{
uint8_t tmp=0, SendOK=FALSE;;
uint16_t freesize=0;
// printf(“\r\nSending proc …\r\n\0” );
CHECK_SOCKNUM();
CHECK_SOCKMODE(Sn_MR_TCP);
CHECK_SOCKDATA();
tmp = getSn_SR(sn);
if(tmp != SOCK_ESTABLISHED && tmp != SOCK_CLOSE_WAIT)
return SOCKERR_SOCKSTATUS;
if( sock_is_sending & (1<<sn) )
{
}
// freesize = getSn_TxMAX(sn);
// if (len > freesize) len = freesize; // check size not to exceed MAX size.
while(1)
{
freesize = getSn_TX_FSR(sn);
tmp = getSn_SR(sn);
if ((tmp != SOCK_ESTABLISHED) && (tmp != SOCK_CLOSE_WAIT))
{
close(sn);
return SOCKERR_SOCKSTATUS;
}
if( (sock_io_mode & (1<<sn)) && (len > freesize) ) return SOCK_BUSY;
if(len <= freesize) break;
}
// printf(“\r\nSending proc: wiz_send_data …\r\n\0”,len );
wiz_send_data(sn, buf, len);
setSn_CR(sn,Sn_CR_SEND);
/* wait to process the command… */
while(getSn_CR(sn));
while(1)
{
tmp = getSn_IR(sn);
if(tmp & Sn_IR_SENDOK)
{
// setSn_IR(sn, Sn_IR_SENDOK); ???
SendOK = TRUE;
TxMsg(“SEND OK…\r\n\0”);
}
sock_is_sending |= (1 << sn);
// return (int32_t)len;
return (int32_t)SendOK;
}
Good luck
Dan