feat(debug): 完善EthNet和LTENet调试命令
This commit is contained in:
+238
-22
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#define DBG_RX_LEN_MAX 128
|
#define DBG_RX_LEN_MAX 128
|
||||||
//#define DBG_LOG(...) rt_kprintf(__VA_ARGS__)
|
//#define DBG_LOG(...) rt_kprintf(__VA_ARGS__)
|
||||||
#define DEBUG_CMD_CNT 30
|
#define DEBUG_CMD_CNT 31
|
||||||
#define DEBUG_BUFF_SIZE_MAX 512
|
#define DEBUG_BUFF_SIZE_MAX 512
|
||||||
|
|
||||||
#define DEBUG_BUFSIZE 200
|
#define DEBUG_BUFSIZE 200
|
||||||
@@ -184,10 +184,11 @@ void DebugAnalyze(GateWayPara GateWay, uint8_t *rData, uint16_t rLen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < DEBUG_CMD_CNT; i++) {
|
for(int i = 0; i < DEBUG_CMD_CNT; i++) {
|
||||||
if(strcmp(argv[0], DebugFun[i].DBGCmd) == 0)
|
if(strcmp(argv[0], DebugFun[i].DBGCmd) == 0) {
|
||||||
DebugFun[i].DBGExec(argc, argv);
|
DebugFun[i].DBGExec(argc, argv);
|
||||||
|
break; // 添加break避免继续匹配
|
||||||
|
}
|
||||||
}
|
}
|
||||||
memset(rData, 0x00, rLen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************************
|
/*****************************************************************************************
|
||||||
@@ -1195,13 +1196,13 @@ void DebugCmdSelDebugChannel(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************************
|
/*****************************************************************************************
|
||||||
* 函数名称: DebugCmdSetSvr
|
* 函数名称: DebugCmdSetLTENet
|
||||||
* 功能描述: 设置服务器地址、端口
|
* 功能描述: 设置Cat1/4G服务器的地址和端口
|
||||||
* 参 数: argc, 输入参数数量
|
* 参 数: argc, 输入参数数量
|
||||||
argv, 输入参数
|
argv, 输入参数
|
||||||
* 返 回 值: 无
|
* 返 回 值: 无
|
||||||
*****************************************************************************************/
|
*****************************************************************************************/
|
||||||
static void DebugCmdSetSvr(int argc, char *argv[])
|
static void DebugCmdSetLTENet(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
DBG_LOG("\r\n");
|
DBG_LOG("\r\n");
|
||||||
int IP[4];
|
int IP[4];
|
||||||
@@ -1211,11 +1212,11 @@ static void DebugCmdSetSvr(int argc, char *argv[])
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(strcmp(argv[1], "?") == 0) {
|
if(strcmp(argv[1], "?") == 0) {
|
||||||
DBG_LOG("Debug Cmd: svr arg1 arg2 arg3\r\n");
|
DBG_LOG("Debug Cmd: ltenet arg1 arg2 arg3\r\n");
|
||||||
DBG_LOG(" brief --> Set the server IP address and port for 4G communication.\r\n");
|
DBG_LOG(" brief --> Set the server IP address and port for Cat1/4G communication.\r\n");
|
||||||
DBG_LOG(" arg1 --> password\r\n");
|
DBG_LOG(" arg1 --> password\r\n");
|
||||||
DBG_LOG(" arg2 --> (xx.xx.xx.xx) ip\r\n");
|
DBG_LOG(" arg2 --> (xx.xx.xx.xx) server ip\r\n");
|
||||||
DBG_LOG(" arg3 --> port\r\n\r\n");
|
DBG_LOG(" arg3 --> server port\r\n\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1235,14 +1236,14 @@ static void DebugCmdSetSvr(int argc, char *argv[])
|
|||||||
if(port > 0xffff)
|
if(port > 0xffff)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GateWay->ConfigPara.SvrAddr[0] = IP[0];
|
GateWay->ConfigPara.LTENet.DestAddr[0] = IP[0];
|
||||||
GateWay->ConfigPara.SvrAddr[1] = IP[1];
|
GateWay->ConfigPara.LTENet.DestAddr[1] = IP[1];
|
||||||
GateWay->ConfigPara.SvrAddr[2] = IP[2];
|
GateWay->ConfigPara.LTENet.DestAddr[2] = IP[2];
|
||||||
GateWay->ConfigPara.SvrAddr[3] = IP[3];
|
GateWay->ConfigPara.LTENet.DestAddr[3] = IP[3];
|
||||||
GateWay->ConfigPara.SvrPort = port;
|
GateWay->ConfigPara.LTENet.DestPort = port;
|
||||||
|
|
||||||
WritePara((uint8_t *)&GateWay->ConfigPara, sizeof(GWConfigPara_t));
|
WritePara((uint8_t *)&GateWay->ConfigPara, sizeof(GWConfigPara_t));
|
||||||
DBG_LOG("Set server ip and port completed.\r\n");
|
DBG_LOG("Set LTENet server ip and port completed.\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************************
|
/*****************************************************************************************
|
||||||
@@ -1287,6 +1288,192 @@ static void DebugCmdSetMac(int argc, char *argv[])
|
|||||||
DBG_LOG("Set gateway mac Address completed.\r\n");
|
DBG_LOG("Set gateway mac Address completed.\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************************
|
||||||
|
* 函数名称: DebugCmdEthNet
|
||||||
|
* 功能描述: EthNet以太网模块参数配置
|
||||||
|
* 参 数: argc, 输入参数数量
|
||||||
|
argv, 输入参数
|
||||||
|
* 返 回 值: 无
|
||||||
|
*****************************************************************************************/
|
||||||
|
static void DebugCmdEthNet(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
DBG_LOG("\r\n");
|
||||||
|
int IP[4];
|
||||||
|
|
||||||
|
if(argc < 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "?") == 0) {
|
||||||
|
DBG_LOG("Debug Cmd: eth arg1 arg2\r\n");
|
||||||
|
DBG_LOG(" brief --> Configure EthNet Ethernet module parameters.\r\n");
|
||||||
|
DBG_LOG(" arg1 --> subcommand\r\n");
|
||||||
|
DBG_LOG(" arg2 --> parameter value\r\n\r\n");
|
||||||
|
DBG_LOG(" Subcommands:\r\n");
|
||||||
|
DBG_LOG(" mode dhcp/static - Set IP mode (DHCP or Static)\r\n");
|
||||||
|
DBG_LOG(" ip x.x.x.x - Set local IP address\r\n");
|
||||||
|
DBG_LOG(" port xxxx - Set local port\r\n");
|
||||||
|
DBG_LOG(" wmode tcp/udp - Set work mode (TCP client/UDP)\r\n");
|
||||||
|
DBG_LOG(" mask x.x.x.x - Set subnet mask\r\n");
|
||||||
|
DBG_LOG(" gw x.x.x.x - Set gateway\r\n");
|
||||||
|
DBG_LOG(" dip x.x.x.x - Set destination IP\r\n");
|
||||||
|
DBG_LOG(" dport xxxx - Set destination port\r\n");
|
||||||
|
DBG_LOG(" save - Save parameters to Flash\r\n");
|
||||||
|
DBG_LOG(" apply - Apply and restart ETH module\r\n\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "save") == 0) {
|
||||||
|
WritePara((uint8_t *)&GateWay->ConfigPara, sizeof(GWConfigPara_t));
|
||||||
|
DBG_LOG("EthNet parameters saved to Flash.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "apply") == 0) {
|
||||||
|
WritePara((uint8_t *)&GateWay->ConfigPara, sizeof(GWConfigPara_t));
|
||||||
|
/* 判断当前通讯状态,ETH和CAT1是互斥的 */
|
||||||
|
if(GateWay->ConfigPara.Comm == CATONE_COMM) {
|
||||||
|
DBG_LOG("EthCmd Error: Currently using CAT1 communication.\r\n");
|
||||||
|
DBG_LOG("Please switch to ETH mode first using 'comm eth' command.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ETHReset();
|
||||||
|
ETHResetEx();
|
||||||
|
DBG_LOG("EthNet parameters saved and ETH module restarting...\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(argc < 3) {
|
||||||
|
DBG_LOG("EthCmd: Missing parameter value.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "mode") == 0) {
|
||||||
|
if(strcmp(argv[2], "dhcp") == 0) {
|
||||||
|
GateWay->ConfigPara.EthNet.IpMode = ETH_IP_DHCP;
|
||||||
|
DBG_LOG("IpMode set to DHCP.\r\n");
|
||||||
|
}
|
||||||
|
else if(strcmp(argv[2], "static") == 0) {
|
||||||
|
GateWay->ConfigPara.EthNet.IpMode = ETH_IP_STATIC;
|
||||||
|
DBG_LOG("IpMode set to STATIC.\r\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
DBG_LOG("EthCmd: Invalid mode, use dhcp or static.\r\n");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "ip") == 0) {
|
||||||
|
int ret = sscanf(argv[2], "%d.%d.%d.%d", &IP[0], &IP[1], &IP[2], &IP[3]);
|
||||||
|
if(ret != 4) {
|
||||||
|
DBG_LOG("EthCmd: Invalid IP format, use x.x.x.x\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(IP[0] > 255 || IP[1] > 255 || IP[2] > 255 || IP[3] > 255) {
|
||||||
|
DBG_LOG("EthCmd: IP address out of range.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GateWay->ConfigPara.EthNet.IpAddr[0] = IP[0];
|
||||||
|
GateWay->ConfigPara.EthNet.IpAddr[1] = IP[1];
|
||||||
|
GateWay->ConfigPara.EthNet.IpAddr[2] = IP[2];
|
||||||
|
GateWay->ConfigPara.EthNet.IpAddr[3] = IP[3];
|
||||||
|
DBG_LOG("Local IP set to %d.%d.%d.%d\r\n", IP[0], IP[1], IP[2], IP[3]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "port") == 0) {
|
||||||
|
int port = atoi(argv[2]);
|
||||||
|
if(port <= 0 || port > 65535) {
|
||||||
|
DBG_LOG("EthCmd: Port out of range (1-65535).\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GateWay->ConfigPara.EthNet.IpPort = port;
|
||||||
|
DBG_LOG("Local Port set to %d\r\n", port);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "wmode") == 0) {
|
||||||
|
if(strcmp(argv[2], "tcp") == 0) {
|
||||||
|
GateWay->ConfigPara.EthNet.WorkMode = ETH_MODE_TCP_CLIENT;
|
||||||
|
DBG_LOG("WorkMode set to TCP_CLIENT.\r\n");
|
||||||
|
}
|
||||||
|
else if(strcmp(argv[2], "udp") == 0) {
|
||||||
|
GateWay->ConfigPara.EthNet.WorkMode = ETH_MODE_UDP;
|
||||||
|
DBG_LOG("WorkMode set to UDP.\r\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
DBG_LOG("EthCmd: Invalid work mode, use tcp or udp.\r\n");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "mask") == 0) {
|
||||||
|
int ret = sscanf(argv[2], "%d.%d.%d.%d", &IP[0], &IP[1], &IP[2], &IP[3]);
|
||||||
|
if(ret != 4) {
|
||||||
|
DBG_LOG("EthCmd: Invalid mask format, use x.x.x.x\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(IP[0] > 255 || IP[1] > 255 || IP[2] > 255 || IP[3] > 255) {
|
||||||
|
DBG_LOG("EthCmd: Subnet mask out of range.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GateWay->ConfigPara.EthNet.SubnetMask[0] = IP[0];
|
||||||
|
GateWay->ConfigPara.EthNet.SubnetMask[1] = IP[1];
|
||||||
|
GateWay->ConfigPara.EthNet.SubnetMask[2] = IP[2];
|
||||||
|
GateWay->ConfigPara.EthNet.SubnetMask[3] = IP[3];
|
||||||
|
DBG_LOG("SubnetMask set to %d.%d.%d.%d\r\n", IP[0], IP[1], IP[2], IP[3]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "gw") == 0) {
|
||||||
|
int ret = sscanf(argv[2], "%d.%d.%d.%d", &IP[0], &IP[1], &IP[2], &IP[3]);
|
||||||
|
if(ret != 4) {
|
||||||
|
DBG_LOG("EthCmd: Invalid gateway format, use x.x.x.x\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(IP[0] > 255 || IP[1] > 255 || IP[2] > 255 || IP[3] > 255) {
|
||||||
|
DBG_LOG("EthCmd: Gateway out of range.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GateWay->ConfigPara.EthNet.Gateway[0] = IP[0];
|
||||||
|
GateWay->ConfigPara.EthNet.Gateway[1] = IP[1];
|
||||||
|
GateWay->ConfigPara.EthNet.Gateway[2] = IP[2];
|
||||||
|
GateWay->ConfigPara.EthNet.Gateway[3] = IP[3];
|
||||||
|
DBG_LOG("Gateway set to %d.%d.%d.%d\r\n", IP[0], IP[1], IP[2], IP[3]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "dip") == 0) {
|
||||||
|
int ret = sscanf(argv[2], "%d.%d.%d.%d", &IP[0], &IP[1], &IP[2], &IP[3]);
|
||||||
|
if(ret != 4) {
|
||||||
|
DBG_LOG("EthCmd: Invalid destination IP format, use x.x.x.x\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(IP[0] > 255 || IP[1] > 255 || IP[2] > 255 || IP[3] > 255) {
|
||||||
|
DBG_LOG("EthCmd: Destination IP out of range.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GateWay->ConfigPara.EthNet.DestIp[0] = IP[0];
|
||||||
|
GateWay->ConfigPara.EthNet.DestIp[1] = IP[1];
|
||||||
|
GateWay->ConfigPara.EthNet.DestIp[2] = IP[2];
|
||||||
|
GateWay->ConfigPara.EthNet.DestIp[3] = IP[3];
|
||||||
|
DBG_LOG("DestIP set to %d.%d.%d.%d\r\n", IP[0], IP[1], IP[2], IP[3]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(argv[1], "dport") == 0) {
|
||||||
|
int port = atoi(argv[2]);
|
||||||
|
if(port <= 0 || port > 65535) {
|
||||||
|
DBG_LOG("EthCmd: DestPort out of range (1-65535).\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GateWay->ConfigPara.EthNet.DestPort = port;
|
||||||
|
DBG_LOG("DestPort set to %d\r\n", port);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DBG_LOG("EthCmd: Unknown subcommand '%s'\r\n", argv[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************************
|
/*****************************************************************************************
|
||||||
* 函数名称: DebugCmdGetPara
|
* 函数名称: DebugCmdGetPara
|
||||||
@@ -1320,10 +1507,34 @@ static void DebugCmdGetPara(int argc, char *argv[])
|
|||||||
DBG_LOG("CommUnitReadInterval: %d\r\n", GateWay->ConfigPara.CommUnitReadInterval);
|
DBG_LOG("CommUnitReadInterval: %d\r\n", GateWay->ConfigPara.CommUnitReadInterval);
|
||||||
DBG_LOG("Svr MAC: %02X-%02X-%02X-%02X-%02X-%02X\r\n",
|
DBG_LOG("Svr MAC: %02X-%02X-%02X-%02X-%02X-%02X\r\n",
|
||||||
GateWay->SvrMac[0], GateWay->SvrMac[1], GateWay->SvrMac[2], GateWay->SvrMac[3], GateWay->SvrMac[4], GateWay->SvrMac[5]);
|
GateWay->SvrMac[0], GateWay->SvrMac[1], GateWay->SvrMac[2], GateWay->SvrMac[3], GateWay->SvrMac[4], GateWay->SvrMac[5]);
|
||||||
DBG_LOG("Svr IP: %d.%d.%d.%d\r\n",
|
|
||||||
GateWay->ConfigPara.SvrAddr[0], GateWay->ConfigPara.SvrAddr[1], GateWay->ConfigPara.SvrAddr[2], GateWay->ConfigPara.SvrAddr[3]);
|
|
||||||
DBG_LOG("Svr Port: %d\r\n", GateWay->ConfigPara.SvrPort);
|
|
||||||
DBG_LOG("Register Status: %d\r\n", GateWay->SvrRegFlag);
|
DBG_LOG("Register Status: %d\r\n", GateWay->SvrRegFlag);
|
||||||
|
|
||||||
|
/* LTENet (Cat1/4G) Parameters */
|
||||||
|
DBG_LOG("=== LTENet (Cat1/4G) Parameters ===\r\n");
|
||||||
|
DBG_LOG("DestAddr: %d.%d.%d.%d\r\n",
|
||||||
|
GateWay->ConfigPara.LTENet.DestAddr[0], GateWay->ConfigPara.LTENet.DestAddr[1], GateWay->ConfigPara.LTENet.DestAddr[2], GateWay->ConfigPara.LTENet.DestAddr[3]);
|
||||||
|
DBG_LOG("DestPort: %d\r\n", GateWay->ConfigPara.LTENet.DestPort);
|
||||||
|
DBG_LOG("LocalAddr: %d.%d.%d.%d (Reserved)\r\n",
|
||||||
|
GateWay->ConfigPara.LTENet.LocalAddr[0], GateWay->ConfigPara.LTENet.LocalAddr[1], GateWay->ConfigPara.LTENet.LocalAddr[2], GateWay->ConfigPara.LTENet.LocalAddr[3]);
|
||||||
|
DBG_LOG("LocalPort: %d (Reserved)\r\n", GateWay->ConfigPara.LTENet.LocalPort);
|
||||||
|
|
||||||
|
/* EthNet (Ethernet) Parameters */
|
||||||
|
DBG_LOG("=== EthNet (Ethernet) Parameters ===\r\n");
|
||||||
|
DBG_LOG("IpMode: %s\r\n", (GateWay->ConfigPara.EthNet.IpMode == ETH_IP_DHCP) ? "DHCP" : "STATIC");
|
||||||
|
DBG_LOG("LocalIP: %d.%d.%d.%d\r\n",
|
||||||
|
GateWay->ConfigPara.EthNet.IpAddr[0], GateWay->ConfigPara.EthNet.IpAddr[1], GateWay->ConfigPara.EthNet.IpAddr[2], GateWay->ConfigPara.EthNet.IpAddr[3]);
|
||||||
|
DBG_LOG("LocalPort: %d\r\n", GateWay->ConfigPara.EthNet.IpPort);
|
||||||
|
DBG_LOG("WorkMode: %s\r\n",
|
||||||
|
(GateWay->ConfigPara.EthNet.WorkMode == ETH_MODE_TCP_CLIENT) ? "TCP_CLIENT" :
|
||||||
|
(GateWay->ConfigPara.EthNet.WorkMode == ETH_MODE_TCP_SERVER) ? "TCP_SERVER" : "UDP");
|
||||||
|
DBG_LOG("SubnetMask: %d.%d.%d.%d\r\n",
|
||||||
|
GateWay->ConfigPara.EthNet.SubnetMask[0], GateWay->ConfigPara.EthNet.SubnetMask[1], GateWay->ConfigPara.EthNet.SubnetMask[2], GateWay->ConfigPara.EthNet.SubnetMask[3]);
|
||||||
|
DBG_LOG("Gateway: %d.%d.%d.%d\r\n",
|
||||||
|
GateWay->ConfigPara.EthNet.Gateway[0], GateWay->ConfigPara.EthNet.Gateway[1], GateWay->ConfigPara.EthNet.Gateway[2], GateWay->ConfigPara.EthNet.Gateway[3]);
|
||||||
|
DBG_LOG("DestIP: %d.%d.%d.%d\r\n",
|
||||||
|
GateWay->ConfigPara.EthNet.DestIp[0], GateWay->ConfigPara.EthNet.DestIp[1], GateWay->ConfigPara.EthNet.DestIp[2], GateWay->ConfigPara.EthNet.DestIp[3]);
|
||||||
|
DBG_LOG("DestPort: %d\r\n", GateWay->ConfigPara.EthNet.DestPort);
|
||||||
|
|
||||||
DBG_LOG("RS485Ch1 Mac: %02X-%02X-%02X-%02X-%02X-%02X\r\n",
|
DBG_LOG("RS485Ch1 Mac: %02X-%02X-%02X-%02X-%02X-%02X\r\n",
|
||||||
GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][0],GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][1],
|
GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][0],GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][1],
|
||||||
GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][2],GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][3],
|
GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][2],GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0][3],
|
||||||
@@ -1890,8 +2101,8 @@ void DebugCmdHelp(int argc, char *argv[])
|
|||||||
memcpy(Data, "dch ?\r\n", len);
|
memcpy(Data, "dch ?\r\n", len);
|
||||||
DebugAnalyze(GateWay, Data, len);
|
DebugAnalyze(GateWay, Data, len);
|
||||||
|
|
||||||
len = strlen("svr ?\r\n");
|
len = strlen("ltenet ?\r\n");
|
||||||
memcpy(Data, "svr ?\r\n", len);
|
memcpy(Data, "ltenet ?\r\n", len);
|
||||||
DebugAnalyze(GateWay, Data, len);
|
DebugAnalyze(GateWay, Data, len);
|
||||||
|
|
||||||
len = strlen("mac ?\r\n");
|
len = strlen("mac ?\r\n");
|
||||||
@@ -1929,6 +2140,10 @@ void DebugCmdHelp(int argc, char *argv[])
|
|||||||
len = strlen("reg ?\r\n");
|
len = strlen("reg ?\r\n");
|
||||||
memcpy(Data, "reg ?\r\n", len);
|
memcpy(Data, "reg ?\r\n", len);
|
||||||
DebugAnalyze(GateWay, Data, len);
|
DebugAnalyze(GateWay, Data, len);
|
||||||
|
|
||||||
|
len = strlen("eth ?\r\n");
|
||||||
|
memcpy(Data, "eth ?\r\n", len);
|
||||||
|
DebugAnalyze(GateWay, Data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
const DBGFunType DebugFun[DEBUG_CMD_CNT] = {
|
const DBGFunType DebugFun[DEBUG_CMD_CNT] = {
|
||||||
@@ -1950,7 +2165,7 @@ const DBGFunType DebugFun[DEBUG_CMD_CNT] = {
|
|||||||
"time", DebugCmdTimeSync,
|
"time", DebugCmdTimeSync,
|
||||||
"qs", DebugCmdQuerySensor,
|
"qs", DebugCmdQuerySensor,
|
||||||
"dch", DebugCmdSelDebugChannel,
|
"dch", DebugCmdSelDebugChannel,
|
||||||
"svr", DebugCmdSetSvr,
|
"ltenet", DebugCmdSetLTENet,
|
||||||
"mac", DebugCmdSetMac,
|
"mac", DebugCmdSetMac,
|
||||||
"para", DebugCmdGetPara,
|
"para", DebugCmdGetPara,
|
||||||
"cali", DebugCmdCali,
|
"cali", DebugCmdCali,
|
||||||
@@ -1960,4 +2175,5 @@ const DBGFunType DebugFun[DEBUG_CMD_CNT] = {
|
|||||||
"reboot", DebugCmdReboot,
|
"reboot", DebugCmdReboot,
|
||||||
"up", DebugCmdUpload,
|
"up", DebugCmdUpload,
|
||||||
"reg", DebugCmdRegister,
|
"reg", DebugCmdRegister,
|
||||||
|
"eth", DebugCmdEthNet,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user