添加更改服务器IP的指令

清理指令增加辨识度,常用指令注释用中文,其它用英文
This commit is contained in:
CSSC-WORK\murmur 2024-01-05 08:36:41 +08:00
parent 005d3b689e
commit d27ad95916
8 changed files with 77 additions and 16 deletions

View File

@ -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);

View File

@ -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)
{
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

View File

@ -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

View File

@ -312,6 +312,6 @@ void decrypt_file_test(int argc, char **argv)
#include <finsh.h>
/* 导出到自动初始化 */
MSH_CMD_EXPORT(aes_string_test, 使AES-256crypt string using AES-256.);
MSH_CMD_EXPORT(crypt_file_test, 使AES-256crypt file using AES-256.);
MSH_CMD_EXPORT(decrypt_file_test, 使AES-256decrypt 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.);

View File

@ -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无校验)

View File

@ -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);

View File

@ -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)
/**

View File

@ -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. */