mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-13 05:28:14 +08:00
这样是没问题的
This commit is contained in:
@@ -26,7 +26,7 @@ void UserSend(int udp_flag, char *s)
|
|||||||
UserMqttSend(s);
|
UserMqttSend(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserFunctionCmdReceived(int udp_flag, char* pusrdata)
|
void UserFunctionCmdReceived2(int udp_flag, char* pusrdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned char i;
|
unsigned char i;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "micokit_ext.h"
|
#include "micokit_ext.h"
|
||||||
|
|
||||||
void UserSend(int udp_flag, char *s);
|
void UserSend(int udp_flag, char *s);
|
||||||
void UserFunctionCmdReceived(int udp_flag, char* pusrdata);
|
void UserFunctionCmdReceived2(int udp_flag, char* pusrdata);
|
||||||
unsigned char StrToHex(char a, char b);
|
unsigned char StrToHex(char a, char b);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ void UserMqttTimerFunc(void *arg)
|
|||||||
case 15:
|
case 15:
|
||||||
if (buf1 == NULL) break;
|
if (buf1 == NULL) break;
|
||||||
sprintf(buf1, "{\"mac\":\"%s\",\"version\":null,\"socket_0\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_1\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_2\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_3\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_4\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_5\":{\"on\":null,\"setting\":{\"name\":null}}}", str_mac);
|
sprintf(buf1, "{\"mac\":\"%s\",\"version\":null,\"socket_0\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_1\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_2\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_3\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_4\":{\"on\":null,\"setting\":{\"name\":null}},\"socket_5\":{\"on\":null,\"setting\":{\"name\":null}}}", str_mac);
|
||||||
UserFunctionCmdReceived(0, buf1);
|
//UserFunctionCmdReceived(0, buf1);
|
||||||
free(buf1);
|
free(buf1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void UdpThread(void *arg)
|
|||||||
strcpy(ip_address, inet_ntoa(addr.sin_addr));
|
strcpy(ip_address, inet_ntoa(addr.sin_addr));
|
||||||
if(len<1024) buf[len]=0;
|
if(len<1024) buf[len]=0;
|
||||||
os_log("udp recv from %s:%d, len:%d ", ip_address,addr.sin_port, len);
|
os_log("udp recv from %s:%d, len:%d ", ip_address,addr.sin_port, len);
|
||||||
UserFunctionCmdReceived(1,buf);
|
//UserFunctionCmdReceived(1,buf); //<2F><><EFBFBD><EFBFBD>?
|
||||||
// sendto(udp_fd, buf, len, 0, (struct sockaddr *) &addr, sizeof(struct sockaddr_in));
|
// sendto(udp_fd, buf, len, 0, (struct sockaddr *) &addr, sizeof(struct sockaddr_in));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ static void WifiGetIpCallback(IPStatusTypedef *pnet, void * arg)
|
|||||||
|
|
||||||
os_log("got IP:%s", pnet->ip);
|
os_log("got IP:%s", pnet->ip);
|
||||||
wifi_status = WIFI_STATE_CONNECTED;
|
wifi_status = WIFI_STATE_CONNECTED;
|
||||||
UserFunctionCmdReceived(1,"{\"cmd\":\"device report\"}");
|
//UserFunctionCmdReceived(1,"{\"cmd\":\"device report\"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
//wifi连接状态改变回调
|
//wifi连接状态改变回调
|
||||||
|
|||||||
Reference in New Issue
Block a user