|
@@ -809,8 +809,10 @@ uint8_t parseIP(uint8_t *ip)
|
|
|
{
|
|
|
uint8_t result = FAIL;
|
|
|
const int8_t flag_dot[1] = {'.'};
|
|
|
+ int8_t buf[16];
|
|
|
+ memcpy(buf, ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress, ARRAY_SIZE(buf));
|
|
|
|
|
|
- if(split2int((char*)ip , (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress, (char*)flag_dot, 10)==4)
|
|
|
+ if(split2int((char*)ip , (char*)buf, (char*)flag_dot, 10)==4)
|
|
|
result = PASS;
|
|
|
|
|
|
return result;
|
|
@@ -820,8 +822,10 @@ uint8_t parseMAC(uint8_t *mac)
|
|
|
{
|
|
|
uint8_t result = FAIL;
|
|
|
const int8_t flag_colon[1] = {':'};
|
|
|
+ int8_t buf[18];
|
|
|
+ memcpy(buf, ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress, ARRAY_SIZE(buf));
|
|
|
|
|
|
- if(split2int((char*)mac , (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress, (char*)flag_colon, 16)==6)
|
|
|
+ if(split2int((char*)mac , (char*)buf, (char*)flag_colon, 16)==6)
|
|
|
result = PASS;
|
|
|
|
|
|
return result;
|
|
@@ -862,9 +866,6 @@ int udpSocketServerStart(void)
|
|
|
{
|
|
|
DEBUG_INFO("Revieve from: %s:%d\r\n", inet_ntoa(peeraddr.sin_addr), htons(peeraddr.sin_port));
|
|
|
|
|
|
- for(uint8_t idx=0;idx<read_size;idx++)
|
|
|
- DEBUG_INFO("RX[%d]: %02X\r\n", idx, inputBuffer[idx]);
|
|
|
-
|
|
|
if(read_size>=6)
|
|
|
{
|
|
|
validResult = PASS;
|
|
@@ -879,7 +880,6 @@ int udpSocketServerStart(void)
|
|
|
|
|
|
if(validResult)
|
|
|
{
|
|
|
- DEBUG_INFO("Valid pass.");
|
|
|
memset(outBuffer, 0x00, ARRAY_SIZE(outBuffer));
|
|
|
tx_size = 41;
|
|
|
|
|
@@ -931,9 +931,6 @@ int udpSocketServerStart(void)
|
|
|
}
|
|
|
outBuffer[40] = chksum;
|
|
|
|
|
|
- for(uint8_t idx=0;idx<tx_size;idx++)
|
|
|
- DEBUG_INFO("TX[%d]: %02X\r\n", idx, outBuffer[idx]);
|
|
|
-
|
|
|
sendto(sockFd, outBuffer, tx_size, 0, (struct sockaddr *)&peeraddr, peerlen);
|
|
|
}
|
|
|
}
|