添加更改服务器IP的指令
清理指令增加辨识度,常用指令注释用中文,其它用英文
This commit is contained in:
parent
005d3b689e
commit
d27ad95916
@ -297,7 +297,7 @@ int isInWindowZone()
|
||||
|
||||
|
||||
|
||||
MSH_CMD_EXPORT(clearAlarm,清空闹钟);
|
||||
MSH_CMD_EXPORT(clearAlarm,clear all alarms);
|
||||
MSH_CMD_EXPORT(stopAlarm,stop);
|
||||
MSH_CMD_EXPORT(startAlarm,start);
|
||||
MSH_CMD_EXPORT(isInWindowZone,isInWindow);
|
||||
|
@ -304,7 +304,7 @@ static void clear_sta(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
MSH_CMD_EXPORT_ALIAS(clear_sta,clsSta, 重置系统统计数据)
|
||||
MSH_CMD_EXPORT_ALIAS(clear_sta,clsSta, reset sta info)
|
||||
|
||||
volatile size_t nislock=0;
|
||||
static void nsetLock()
|
||||
@ -459,7 +459,10 @@ static void gf()
|
||||
|
||||
static void add(int argc, char **argv)
|
||||
{
|
||||
postFileInfo(argv[1],atoi(argv[2]));
|
||||
if (argc == 3) {
|
||||
postFileInfo(argv[1],atoi(argv[2]));
|
||||
}
|
||||
|
||||
// gf();
|
||||
// clearFileToSend(argv[1]);
|
||||
// gf();
|
||||
@ -508,8 +511,8 @@ char tmp[60];
|
||||
|
||||
|
||||
MSH_CMD_EXPORT(gf, 查看待发送文件列表)
|
||||
MSH_CMD_EXPORT_ALIAS(add, cf,查看待发送文件列表)
|
||||
MSH_CMD_EXPORT(sta, 查询系统统计数据)
|
||||
MSH_CMD_EXPORT(cfg, config params. 配置系统参数,支持参数)
|
||||
MSH_CMD_EXPORT_ALIAS(add, cf,add file to list)
|
||||
MSH_CMD_EXPORT(sta, check sta info)
|
||||
MSH_CMD_EXPORT(cfg, 配置系统参数,支持参数)
|
||||
//set_if()
|
||||
#endif
|
||||
|
@ -835,8 +835,8 @@ MSH_CMD_EXPORT(fileIsReady,fileIsReady);
|
||||
//MSH_CMD_EXPORT(chkAndSendFile, chkAndSendFile);
|
||||
//MSH_CMD_EXPORT(getAndSendFile, getAndSendFile);
|
||||
MSH_CMD_EXPORT(initTT,初始化TT);
|
||||
MSH_CMD_EXPORT(deInitTT,去初始化TT);
|
||||
MSH_CMD_EXPORT(d_remain,剩余超时时间);
|
||||
MSH_CMD_EXPORT(deInitTT,去初始化TT,勿在初始化过程中使用);
|
||||
MSH_CMD_EXPORT(d_remain,time remain);
|
||||
MSH_CMD_EXPORT(resetTM,resetTM);
|
||||
MSH_CMD_EXPORT(d_upSendFile,d_upSendFile);
|
||||
#endif
|
||||
|
@ -312,6 +312,6 @@ void decrypt_file_test(int argc, char **argv)
|
||||
|
||||
#include <finsh.h>
|
||||
/* 导出到自动初始化 */
|
||||
MSH_CMD_EXPORT(aes_string_test, 使用AES-256加密字符串。crypt string using AES-256.);
|
||||
MSH_CMD_EXPORT(crypt_file_test, 使用AES-256加密文件。crypt file using AES-256.);
|
||||
MSH_CMD_EXPORT(decrypt_file_test, 使用AES-256解密文件。decrypt file using AES-256.);
|
||||
MSH_CMD_EXPORT(aes_string_test, crypt string using AES-256.);
|
||||
MSH_CMD_EXPORT(crypt_file_test, crypt file using AES-256.);
|
||||
MSH_CMD_EXPORT(decrypt_file_test, decrypt file using AES-256.);
|
||||
|
@ -23,6 +23,8 @@
|
||||
#define TT_RW TT_IP "/action/webGetTdState"//入网
|
||||
#define TT_JH TT_IP "/action/webGetPSState"//激活
|
||||
#define TT_DW TT_IP "/action/webGetBDGPS"//定位
|
||||
#define TT_WEB_GET TT_IP "/action/webGetSocketAddr"//服务器地址
|
||||
#define TT_WEB_SET TT_IP "/action/webSetSocketAddr"//服务器地址
|
||||
//http://192.168.0.232:4005/action/webGetSIMState webGetBDGPS
|
||||
#define MAX_LEN 15
|
||||
|
||||
@ -517,3 +519,59 @@ size_t getSignals(uint8_t *dout, uint8_t len){
|
||||
memcpy(dout,signalInfo,len);
|
||||
return len;
|
||||
}
|
||||
|
||||
void dwebser(int argc, char **argv)
|
||||
{
|
||||
static unsigned char *buffer = RT_NULL;
|
||||
size_t length = 0;
|
||||
char arg[100]="";
|
||||
|
||||
|
||||
if (argc == 1) {//查询
|
||||
strcpy(arg,TT_WEB_GET);
|
||||
}
|
||||
else if (argc == 3) {//设置
|
||||
if (strcmp(argv[2],"cssc") == 0) {//最后一个参数为密码,避免意外修改
|
||||
// ?tdsocketip=47.108.213.132&tdsocketport=7222
|
||||
strcpy(arg,TT_WEB_SET);
|
||||
strcat(arg,"?tdsocketip=");
|
||||
strcat(arg,argv[1]);
|
||||
strcat(arg,"&tdsocketport=7222");
|
||||
}
|
||||
else {
|
||||
LOG_W("wrong password.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (argc == 2) {//须密码
|
||||
LOG_W("need password.");
|
||||
return;
|
||||
}
|
||||
|
||||
static char *url = RT_NULL;
|
||||
url = web_strdup(arg);
|
||||
// LOG_I("%s",url);
|
||||
if (url == RT_NULL)
|
||||
{
|
||||
LOG_E("no memory for create getTT url buffer.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isTCPok() || webclient_request(url, RT_NULL, RT_NULL, 0, (void **) &buffer, &length) <= 0)
|
||||
{
|
||||
LOG_E("TT server or webclient is not ready.");
|
||||
if (buffer)
|
||||
{
|
||||
web_free(buffer);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// if (buffer && length && buffer[length-1] == 0x7d) //0x7d='}',首次返回的数据不完整,此处直接丢掉避免报错
|
||||
{
|
||||
LOG_I("%s", buffer);
|
||||
web_free(buffer);
|
||||
}
|
||||
|
||||
}
|
||||
MSH_CMD_EXPORT(dwebser,'pwebser [IP] [password]'。无参数表示查询服务器信息,带参表示设置。IP无校验。)
|
||||
|
@ -79,14 +79,14 @@ int main(void)
|
||||
|
||||
|
||||
extern int rt_hw_stm32_eth_init(void);
|
||||
MSH_CMD_EXPORT(rt_hw_stm32_eth_init, 初始化网络。);
|
||||
//MSH_CMD_EXPORT(rt_hw_stm32_eth_init, 初始化网络。);
|
||||
|
||||
void show_version(void)
|
||||
{
|
||||
char str[30];
|
||||
uint8_t t[10];
|
||||
size_t len=time2Byte(t);
|
||||
rt_kprintf("SW Version: %s, build-%s\n","2.8d",bytes2str(t, 3, 10, "", str));
|
||||
rt_kprintf("SW Version: %s, build-%s\n","2.9d",bytes2str(t, 3, 10, "", str));
|
||||
}
|
||||
|
||||
MSH_CMD_EXPORT(show_version,显示版本号);
|
||||
@ -100,4 +100,4 @@ static void clock_information(void)
|
||||
LOG_D("PCLK2_Frequency = %d", HAL_RCC_GetPCLK2Freq());
|
||||
|
||||
}
|
||||
MSH_CMD_EXPORT(clock_information,始终信息);
|
||||
MSH_CMD_EXPORT(clock_information,sys clock info);
|
||||
|
@ -166,7 +166,7 @@ void tm2str(int argc, char **argv)
|
||||
date2Str(s);
|
||||
LOG_I("result is %s",s);
|
||||
}
|
||||
MSH_CMD_EXPORT(tm2str,时间转换为字符串)
|
||||
MSH_CMD_EXPORT(tm2str,time2str)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -701,7 +701,7 @@ void rt_hw_stm32_eth_deinit()
|
||||
HAL_ETH_DeInit(&EthHandle);
|
||||
__HAL_RCC_ETH_CLK_DISABLE() ;
|
||||
}
|
||||
MSH_CMD_EXPORT(rt_hw_stm32_eth_deinit, 去初始化网络。);
|
||||
//MSH_CMD_EXPORT(rt_hw_stm32_eth_deinit, 去初始化网络。);
|
||||
void setLinkUp()
|
||||
{
|
||||
/* send link up. */
|
||||
|
Loading…
Reference in New Issue
Block a user