| | |
| | | { "rtc_set", Shell_RTCSet }, |
| | | { "rtc_set_alarm", Shell_RTCAlarm }, |
| | | { "rtc_get", Shell_RTCGet }, |
| | | |
| | | |
| | | { "sleep", Shell_Sleep }, |
| | | { "info", Shell_Info }, |
| | | |
| | |
| | | |
| | | { "debug_on", Shell_DebugOn }, |
| | | { "debug_off", Shell_DebugOff }, |
| | | |
| | | |
| | | { "close_wireless", Shell_CloseWireless }, |
| | | { "open_wireless", Shell_OpenWireless }, |
| | | { "4g_poweron", Shell_PowerOn }, |
| | | { "4g_poweroff", Shell_PowerOff }, |
| | | { "update", Shell_Update }, |
| | | |
| | | |
| | | { "tcp_create", Shell_TCPCreate }, |
| | | { "tcp_connect", Shell_TCPConnect }, |
| | | { "tcp_send", Shell_TCPSend }, |
| | |
| | | { "server_info", Shell_SetServerInfo }, |
| | | { "set_rtcm", Shell_SetRTCMTCPInfo }, |
| | | { "set_qxwz", Shell_SetQXWZ }, |
| | | { "set_rtcmmode", Shell_SetRTCMMode }, |
| | | { "set_rtcmmode", Shell_SetRTCMMode }, |
| | | { "set_uwbenable", Shell_SetUWBEnable }, |
| | | { "set_ntrip", Shell_SetNtrip }, |
| | | // { "set_charge_work_mode", Shell_Charge_work_mode }, |
| | | |
| | | |
| | | { "ota", Shell_OTA }, |
| | | { "log_upload", Shell_LogUpload }, |
| | | |
| | |
| | | { "log", Shell_Log }, |
| | | { "log_clean", Shell_LogClean }, |
| | | { "log_print", Shell_LogPrint }, |
| | | |
| | | |
| | | { "set_gpsuwbpara", Set_Gpsuwbpara }, |
| | | |
| | | |
| | | |
| | | { "set_gpsuwbpara", Set_Gpsuwbpara }, |
| | | |
| | | // //新增4G指令 |
| | | // { "set_gps", Shell_Set_gps }, |
| | | // { "set_uwb", Shell_Set_uwb }, |
| | |
| | | |
| | | //static HIDO_INT32 Shell_Set_gps(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | //{ |
| | | // |
| | | // |
| | | // |
| | | // |
| | | |
| | | //} |
| | | |
| | |
| | | // if(_i32Argc < 2) |
| | | // { |
| | | // HIDO_ShellPrintf("ERROR\r\n"); |
| | | // |
| | | // |
| | | // return HIDO_ERR; |
| | | // } |
| | | // |
| | | // |
| | | // g_com_map[URT_BQ] = atoi(_ppcArgv[1]); |
| | | // save_com_map_to_flash(); |
| | | // HIDO_ShellPrintf("OK\r\n"); |
| | |
| | | static HIDO_INT32 Shell_SetUWBEnable(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | HIDO_UINT8 au8IP[2]; |
| | | |
| | | |
| | | if(_i32Argc < 2) |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | |
| | | |
| | | return HIDO_ERR; |
| | | } |
| | | |
| | | |
| | | /* IP=192.168.1.1 */ |
| | | HIDO_UtilIPStringToByteArrary(_ppcArgv[1], au8IP); |
| | | /* IP变化 */ |
| | | |
| | | |
| | | if( g_com_map[UWBENABLE_INDEX] != HIDO_UtilStrToInt(_ppcArgv[1])) |
| | | { |
| | | g_com_map[UWBENABLE_INDEX] = HIDO_UtilStrToInt(_ppcArgv[1]); |
| | |
| | | static HIDO_INT32 Shell_SetRTCMMode(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | HIDO_UINT8 au8IP[2]; |
| | | |
| | | |
| | | if(_i32Argc < 2) |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | |
| | | |
| | | return HIDO_ERR; |
| | | } |
| | | |
| | | |
| | | /* IP=192.168.1.1 */ |
| | | HIDO_UtilIPStringToByteArrary(_ppcArgv[1], au8IP); |
| | | /* IP变化 */ |
| | | |
| | | |
| | | if( g_com_map[RTCMMODE_INDEX] != HIDO_UtilStrToInt(_ppcArgv[1])) |
| | | { |
| | | g_com_map[RTCMMODE_INDEX] = HIDO_UtilStrToInt(_ppcArgv[1]); |
| | | } |
| | | |
| | | save_com_map_to_flash(); |
| | | |
| | | |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | return HIDO_OK; |
| | |
| | | static HIDO_INT32 Shell_Test(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | //EC20Driver_Reset(); |
| | | |
| | | |
| | | // TTS_Play("测试", 4); |
| | | |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | |
| | | static HIDO_INT32 Shell_Sleep(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | //Power_Sleep(); |
| | | { |
| | | //Power_Sleep(); |
| | | return HIDO_OK; |
| | | } |
| | | |
| | |
| | | HIDO_ShellPrintf("IMEI: %s\r\n", Module_GetIMEI()); |
| | | HIDO_ShellPrintf("CCID: %s\r\n", Module_GetCCID()); |
| | | HIDO_ShellPrintf("IMSI: %s\r\n", Module_GetIMSI()); |
| | | |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | |
| | |
| | | |
| | | static HIDO_INT32 Shell_OpenWireless(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | Module_PowerOn(MODULE_GSM); |
| | | Module_PowerOn(MODULE_GSM); |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | |
| | | return HIDO_OK; |
| | |
| | | |
| | | static HIDO_INT32 Shell_PowerOn(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | Module_PowerOn(MODULE_MAIN); |
| | | Module_PowerOn(MODULE_MAIN); |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | |
| | | return HIDO_OK; |
| | |
| | | |
| | | static HIDO_INT32 Shell_PowerOff(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | Module_PowerOff(MODULE_MAIN); |
| | | Module_PowerOff(MODULE_MAIN); |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | |
| | | return HIDO_OK; |
| | |
| | | { |
| | | // uint16_t tmp = 0xAAAA,result; |
| | | // HIDO_ShellPrintf("update OK\r\n"); |
| | | // SPIFlash_Erase(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP,2, SPI_FLASH_SECTOR_ERASE_MODE_4K); |
| | | // SPIFlash_Write(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP, (HIDO_UINT8*)&tmp, sizeof(tmp)); |
| | | // SPIFlash_Erase(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP,2, SPI_FLASH_SECTOR_ERASE_MODE_4K); |
| | | // SPIFlash_Write(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP, (HIDO_UINT8*)&tmp, sizeof(tmp)); |
| | | // g_com_map[CNT_RESTART] = 1; |
| | | // return HIDO_OK; |
| | | } |
| | | |
| | | static HIDO_INT32 Shell_ATCmd(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | if(_i32Argc != 2) |
| | | { |
| | | if(_i32Argc != 2) |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | } |
| | | |
| | | Module_RunATCmd(_ppcArgv[1]); |
| | | Module_RunATCmd(_ppcArgv[1]); |
| | | |
| | | return HIDO_OK; |
| | | return HIDO_OK; |
| | | } |
| | | |
| | | static HIDO_VOID Shell_SocketEventProc(HIDO_INT32 _i32SockID, E_SocketEvent _eEvent, HIDO_VOID *_pData) |
| | |
| | | static HIDO_INT32 Shell_TCPCreate(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | HIDO_INT32 i32NewSockID = 0; |
| | | |
| | | |
| | | if(Socket_Create(&i32NewSockID, SOCKET_TYPE_TCP, Shell_SocketEventProc, HIDO_NULL) == HIDO_OK) |
| | | { |
| | | HIDO_ShellPrintf("SockID:%u\r\n", i32NewSockID); |
| | |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | } |
| | | |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | |
| | |
| | | { |
| | | HIDO_ShellPrintf("Arg ERROR\r\n"); |
| | | } |
| | | |
| | | |
| | | HIDO_INT32 i32SockID = atoi(_ppcArgv[1]); |
| | | HIDO_CHAR *pcRemoteAddr = _ppcArgv[2]; |
| | | HIDO_UINT16 u16RemotePort = atoi(_ppcArgv[3]); |
| | | |
| | | |
| | | if(Socket_Connect(i32SockID, pcRemoteAddr, u16RemotePort) == HIDO_OK) |
| | | { |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | } |
| | | |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | |
| | |
| | | |
| | | HIDO_INT32 i32SockID = atoi(_ppcArgv[1]); |
| | | HIDO_CHAR *pcData = _ppcArgv[2]; |
| | | |
| | | |
| | | if(Socket_Send(i32SockID, (HIDO_UINT8 *)pcData, strlen(pcData)) == HIDO_OK) |
| | | { |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | } |
| | | |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | |
| | |
| | | { |
| | | HIDO_ShellPrintf("Arg ERROR\r\n"); |
| | | } |
| | | |
| | | |
| | | HIDO_INT32 i32SockID = atoi(_ppcArgv[1]); |
| | | |
| | | |
| | | if(Socket_Close(i32SockID) == HIDO_OK) |
| | | { |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | } |
| | | |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | |
| | | static HIDO_INT32 Shell_DEVID(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | uint32_t temp2,hex; |
| | | uint32_t temp2,hex; |
| | | temp2 = atoi(_ppcArgv[1]); |
| | | |
| | | hex = (temp2/1000)*4096+((temp2/100)%10)*256+((temp2/10)%10)*16 +((temp2)%10); |
| | |
| | | dev_id = g_com_map[DEV_ID]; |
| | | save_com_map_to_flash(); |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | |
| | | |
| | | return HIDO_OK; |
| | | } |
| | | |
| | | static HIDO_INT32 Shell_SetServerInfo(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | HIDO_UINT8 au8IP[4]; |
| | | |
| | | |
| | | if(_i32Argc < 3) |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | |
| | | |
| | | return HIDO_ERR; |
| | | } |
| | | |
| | | |
| | | /* IP=192.168.1.1 */ |
| | | HIDO_UtilIPStringToByteArrary(_ppcArgv[1], au8IP); |
| | | /* IP变化 */ |
| | |
| | | static HIDO_INT32 Shell_SetQXWZ(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | HIDO_UINT8 au8IP[4]; |
| | | |
| | | |
| | | if(_i32Argc < 5) |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | |
| | | |
| | | return HIDO_ERR; |
| | | } |
| | | |
| | | |
| | | snprintf((char *)&g_com_map[QXWZ_APPKEY_INDEX], 32, "%s", _ppcArgv[1]); |
| | | |
| | | snprintf((char *)&g_com_map[QXWZ_APPKEY_INDEX], 32, "%s", _ppcArgv[1]); |
| | | snprintf((char *)&g_com_map[QXWZ_APPSECRET_INDEX], 32, "%s", _ppcArgv[2]); |
| | | snprintf((char *)&g_com_map[QXWZ_DEVTYPE_INDEX], 32, "%s", _ppcArgv[3]); |
| | | snprintf((char *)&g_com_map[QXWZ_DEVID_INDEX], 32, "%s", _ppcArgv[4]); |
| | | |
| | | save_com_map_to_flash(); |
| | | |
| | | |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | return HIDO_OK; |
| | |
| | | static HIDO_INT32 Shell_SetNtrip(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | HIDO_UINT8 au8IP[4]; |
| | | |
| | | |
| | | if(_i32Argc < 6) |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | |
| | | |
| | | return HIDO_ERR; |
| | | } |
| | | |
| | | |
| | | |
| | | snprintf((char *)&g_com_map[NTRIP_HOST_INDEX], 32, "%s", _ppcArgv[1]); |
| | | g_com_map[NTRIP_PORT_INDEX] = HIDO_UtilStrToInt(_ppcArgv[2]); |
| | | snprintf((char *)&g_com_map[NTRIP_USERNANME_INDEX], 32, "%s", _ppcArgv[3]); |
| | | snprintf((char *)&g_com_map[NTRIP_PASSWORD_INDEX], 32, "%s", _ppcArgv[4]); |
| | | snprintf((char *)&g_com_map[NTRIP_SOURCENAME_INDEX], 32, "%s", _ppcArgv[5]); |
| | | |
| | | |
| | | save_com_map_to_flash(); |
| | | |
| | | |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | return HIDO_OK; |
| | |
| | | static HIDO_INT32 Shell_SetRTCMTCPInfo(HIDO_INT32 _i32Argc, HIDO_CHAR **_ppcArgv) |
| | | { |
| | | HIDO_UINT8 au8IP[4]; |
| | | |
| | | |
| | | if(_i32Argc < 3) |
| | | { |
| | | HIDO_ShellPrintf("ERROR\r\n"); |
| | | |
| | | |
| | | return HIDO_ERR; |
| | | } |
| | | |
| | | |
| | | /* IP=192.168.1.1 */ |
| | | HIDO_UtilIPStringToByteArrary(_ppcArgv[1], au8IP); |
| | | /* IP变化 */ |
| | |
| | | } |
| | | |
| | | save_com_map_to_flash(); |
| | | |
| | | |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | return HIDO_OK; |
| | |
| | | { |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | DBG_SetMode(DBG_MODE_GPS); |
| | | }else if(i32Mode == 2) |
| | | } else if(i32Mode == 2) |
| | | { |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | DBG_SetMode(DBG_MODE_CFG); |
| | |
| | | HIDO_INT32 datarate2 = atoi(_ppcArgv[2]); |
| | | if(datarate1<=20&&datarate1>0&&datarate2<=50&&datarate1>0) |
| | | { |
| | | g_com_map[GPS_HZ] = datarate1; |
| | | g_com_map[COM_INTERVAL] = 1000/datarate2; |
| | | |
| | | save_com_map_to_flash(); |
| | | |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | }else{ |
| | | g_com_map[GPS_HZ] = datarate1; |
| | | g_com_map[COM_INTERVAL] = 1000/datarate2; |
| | | |
| | | save_com_map_to_flash(); |
| | | |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | } else { |
| | | HIDO_ShellPrintf("Arg ERROR\r\n"); |
| | | } |
| | | return HIDO_OK; |
| | |
| | | // HIDO_ShellPrintf("usage: ota url\r\n"); |
| | | // return HIDO_ERR; |
| | | // } |
| | | // |
| | | // |
| | | // /* 重启进入OTA模式升级 */ |
| | | // uint16_t tmp = 0xCCCC; |
| | | // |
| | | // |
| | | // HIDO_Debug("goto ota application\r\n"); |
| | | // SPIFlash_Erase(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP, 2, SPI_FLASH_SECTOR_ERASE_MODE_4K); |
| | | // SPIFlash_Write(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP, (HIDO_UINT8*)&tmp, sizeof(tmp)); |
| | | // SPIFlash_Erase(SPI_FLASH_ID_0, APP_CONFIG_IAP_PARAM_MAP, 256, SPI_FLASH_SECTOR_ERASE_MODE_4K); |
| | | // SPIFlash_Write(SPI_FLASH_ID_0, APP_CONFIG_IAP_PARAM_MAP, (HIDO_UINT8*)_ppcArgv[1], strlen(_ppcArgv[1]) + 1); |
| | | // SPIFlash_Erase(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP, 2, SPI_FLASH_SECTOR_ERASE_MODE_4K); |
| | | // SPIFlash_Write(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP, (HIDO_UINT8*)&tmp, sizeof(tmp)); |
| | | // SPIFlash_Erase(SPI_FLASH_ID_0, APP_CONFIG_IAP_PARAM_MAP, 256, SPI_FLASH_SECTOR_ERASE_MODE_4K); |
| | | // SPIFlash_Write(SPI_FLASH_ID_0, APP_CONFIG_IAP_PARAM_MAP, (HIDO_UINT8*)_ppcArgv[1], strlen(_ppcArgv[1]) + 1); |
| | | |
| | | // delay_ms(10); |
| | | //// Reboot(0); |
| | |
| | | gpsbaudrate= atoi(_ppcArgv[5]); |
| | | g_com_map[GPSBAUDRATE1_INDEX] = gpsbaudrate>>16; |
| | | g_com_map[GPSBAUDRATE2_INDEX] = gpsbaudrate; |
| | | |
| | | |
| | | |
| | | |
| | | if((g_com_map[GPSENBLE]||g_com_map[GPSENBLE]==0) |
| | | &&(g_com_map[UWBENBLE]||g_com_map[UWBENBLE]==0) |
| | | &&(g_com_map[GPSFrequency]<65535&&g_com_map[GPSFrequency]>0) |
| | | &&(g_com_map[UWBFrequency]==1||g_com_map[UWBFrequency]==3||g_com_map[UWBFrequency]==5||g_com_map[UWBFrequency]==10) |
| | | &&(gpsbaudrate==9600||gpsbaudrate==115200) |
| | | ) |
| | | &&(g_com_map[UWBENBLE]||g_com_map[UWBENBLE]==0) |
| | | &&(g_com_map[GPSFrequency]<65535&&g_com_map[GPSFrequency]>0) |
| | | &&(g_com_map[UWBFrequency]==1||g_com_map[UWBFrequency]==3||g_com_map[UWBFrequency]==5||g_com_map[UWBFrequency]==10) |
| | | &&(gpsbaudrate==9600||gpsbaudrate==115200) |
| | | ) |
| | | { |
| | | save_com_map_to_flash(); |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | save_com_map_to_flash(); |
| | | HIDO_ShellPrintf("OK\r\n"); |
| | | g_com_map[CNT_RESTART] = 1; |
| | | } |
| | | else |
| | | { |
| | | HIDO_ShellPrintf("Arg ERROR\r\n"); |
| | | HIDO_ShellPrintf("Arg ERROR\r\n"); |
| | | } |
| | | return HIDO_OK; |
| | | } |