WIZnet Developer Forum

[W5500] e No Delayed ACK 설정 문의

socket api에서 Sn_MR 설정시 5bit No Delayed Ack 설정을 하고 읽어보면 0x21이 아니라 0x 33이 읽힙니다 맞는 동작인가요? 아래 소스 입니다.

int8_t socket(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag)
{
uint8_t temp_mr;
switch(protocol)
{
case Sn_MR_TCP:
{
uint32_t taddr;
getSIPR((uint8_t*)&taddr);
if(taddr == 0) return SOCKERR_SOCKINIT;
}
break;
case Sn_MR_UDP:
case Sn_MR_MACRAW:
case Sn_MR_IPRAW:
break;
default:
return SOCKERR_SOCKMODE;
}
if((flag & 0x04) != 0) return SOCKERR_SOCKFLAG;

if(flag != 0) {
	switch(protocol)
	{
		case Sn_MR_TCP:
			if((flag & (SF_TCP_NODELAY|SF_IO_NONBLOCK))==0) return SOCKERR_SOCKFLAG;
			break;
		case Sn_MR_UDP:
			if(flag & SF_IGMP_VER2) {
				if((flag & SF_MULTI_ENABLE)==0) return SOCKERR_SOCKFLAG;
			}
			if(flag & SF_UNI_BLOCK) {
				if((flag & SF_MULTI_ENABLE) == 0) return SOCKERR_SOCKFLAG;
			}
			break;
		default:
			break;
	}
}
close(sn);
//setSn_MR(sn, (protocol | (flag & 0xF0)));

setSn_MR(sn, 0x21);  //  no Delayed ack 
temp_mr = getSn_MR(sn);

setSn_PORT(sn, port);
setSn_CR(sn, Sn_CR_OPEN);
while(getSn_CR(sn));
//A20150401 : For release the previous sock_io_mode
sock_io_mode &= ~(1 <<sn);
sock_io_mode |= ((flag & SF_IO_NONBLOCK) << sn);
sock_is_sending &= ~(1<<sn);
sock_remained_size[sn] = 0;
//M20150601 : repalce 0 with PACK_COMPLETED
//sock_pack_info[sn] = 0;
sock_pack_info[sn] = PACK_COMPLETED;

while(getSn_SR(sn) == SOCK_CLOSED);

return (int8_t)sn;

}
감사합니다.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.