|
@@ -42,12 +42,21 @@
|
|
|
#include "Common.h"
|
|
|
|
|
|
typedef unsigned char byte;
|
|
|
-#define NO_DEFINE 255
|
|
|
-#define DEFAULT_AC_INDEX 2
|
|
|
+#define NO_DEFINE 255
|
|
|
|
|
|
-#define TTY_PATH "/dev/tty"
|
|
|
-#define STTY_US "stty raw -echo -F "
|
|
|
-#define STTY_DEF "stty -raw echo -F "
|
|
|
+#define OPTION_CNT 3
|
|
|
+#define STR_OPTION '-'
|
|
|
+#define OPTION_REFLASH 0x00000001
|
|
|
+#define OPTION_LOOP 0x00000002
|
|
|
+#define OPTION_TIME 0x00000004
|
|
|
+
|
|
|
+#define STR_OPT_REFLASH 'f'
|
|
|
+#define STR_OPT_LOOP 'l'
|
|
|
+#define STR_OPT_TIME 't'
|
|
|
+
|
|
|
+#define TTY_PATH "/dev/tty"
|
|
|
+#define STTY_US "stty raw -echo -F "
|
|
|
+#define STTY_DEF "stty -raw echo -F "
|
|
|
|
|
|
struct SysConfigAndInfo *ShmSysConfigAndInfo;
|
|
|
struct StatusCodeData *ShmStatusCodeData;
|
|
@@ -269,6 +278,21 @@ int InitShareMemory()
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+void Get_Ocpp_TransactionId(int gun_index, char *transactionId)
|
|
|
+{
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ {
|
|
|
+ sprintf(transactionId, "%d", ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ {
|
|
|
+ strcpy(transactionId, (char *)&ShmOCPP20Data->TransactionEvent [gun_index].transactionInfo.transactionId[0]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ sprintf(transactionId, "%d", 0);
|
|
|
+}
|
|
|
+
|
|
|
static void get_char(char *word)
|
|
|
{
|
|
|
fd_set rfds;
|
|
@@ -286,7 +310,7 @@ static void get_char(char *word)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// return string length
|
|
|
+// return command length
|
|
|
int ParsingCmd(char *inputString, char *outputString)
|
|
|
{
|
|
|
bool valid = false, done = false;
|
|
@@ -304,7 +328,7 @@ int ParsingCmd(char *inputString, char *outputString)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(inputString[i] == ' ' || inputString[i] == '\0' || inputString[i] == '\r' || inputString[i] == '\n' || len >= 10)
|
|
|
+ if(inputString[i] == ' ' || inputString[i] == '\0' || inputString[i] == '\r' || inputString[i] == '\n' || len >= 32)
|
|
|
{
|
|
|
done = true;
|
|
|
break;
|
|
@@ -323,6 +347,97 @@ int ParsingCmd(char *inputString, char *outputString)
|
|
|
return len;
|
|
|
}
|
|
|
|
|
|
+bool IsOption(char *strCmd, unsigned int *opt)
|
|
|
+{
|
|
|
+ int len = 0;
|
|
|
+ char str_opt[OPTION_CNT] = {STR_OPT_REFLASH, STR_OPT_LOOP, STR_OPT_TIME};
|
|
|
+ unsigned int opt_value[OPTION_CNT] = {OPTION_REFLASH, OPTION_LOOP, OPTION_TIME};
|
|
|
+
|
|
|
+ len = strlen(strCmd);
|
|
|
+
|
|
|
+ if(len == 2)
|
|
|
+ {
|
|
|
+ if(strCmd[0] == STR_OPTION)
|
|
|
+ {
|
|
|
+ for(int i = 0; i < OPTION_CNT; i++)
|
|
|
+ {
|
|
|
+ if(strCmd[1] == str_opt[i])
|
|
|
+ {
|
|
|
+ *opt |= opt_value[i];
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+// inputCmdString: console input string
|
|
|
+// outputCmdString: input string parsed
|
|
|
+// return command quantity
|
|
|
+int InputStringNormalize(char *inputCmdString, char *outputCmdString, unsigned int *opt)
|
|
|
+{
|
|
|
+ int len = 0, cnt = 0, start = 0;
|
|
|
+ int cmdLen = 0, totalLen = 0;
|
|
|
+
|
|
|
+ len = strlen(inputCmdString);
|
|
|
+ *opt = 0;
|
|
|
+
|
|
|
+ if(len > 0)
|
|
|
+ {
|
|
|
+ while(start < len - 1)
|
|
|
+ {
|
|
|
+ if(inputCmdString[start] != ' ' && inputCmdString[start] != '\0')
|
|
|
+ {
|
|
|
+ cmdLen = ParsingCmd(&inputCmdString[start], &outputCmdString[totalLen]);
|
|
|
+
|
|
|
+ if(cmdLen > 0)
|
|
|
+ {
|
|
|
+ //printf("Find %d Cmd: %s\r\n", cnt + 1, &outputCmdString[totalLen]);
|
|
|
+
|
|
|
+ if(!IsOption(&outputCmdString[totalLen], opt))
|
|
|
+ {
|
|
|
+ outputCmdString[totalLen + cmdLen] = ' ';
|
|
|
+ cnt++;
|
|
|
+ totalLen += cmdLen + 1;
|
|
|
+ }
|
|
|
+ start += cmdLen;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ start++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ outputCmdString[totalLen - 1] = '\0';
|
|
|
+ }
|
|
|
+ return cnt;
|
|
|
+}
|
|
|
+
|
|
|
+int MainAndSubCommandParsing(char *normalCmd, char *mainCmd, char *subCmd)
|
|
|
+{
|
|
|
+ int len = 0, totalLen = 0;
|
|
|
+
|
|
|
+ strcpy(mainCmd, "");
|
|
|
+ strcpy(subCmd, "");
|
|
|
+
|
|
|
+ totalLen = strlen(normalCmd);
|
|
|
+
|
|
|
+ if(totalLen > 0)
|
|
|
+ {
|
|
|
+ len = ParsingCmd(normalCmd, mainCmd);
|
|
|
+ //printf("Find MainCmd: %s\r\n", mainCmd);
|
|
|
+
|
|
|
+ if(len > 0 && totalLen > len)
|
|
|
+ {
|
|
|
+ strcpy(subCmd, &normalCmd[len + 1]);
|
|
|
+ //printf("Find SubCmd: %s\r\n", subCmd);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int GetCommandSring(char *outputCmdString)
|
|
|
{
|
|
|
int len = 0, cnt = 0;
|
|
@@ -385,6 +500,19 @@ bool IsLoopStopCmd(void)
|
|
|
return stop;
|
|
|
}
|
|
|
|
|
|
+void ConsoleReflash(int groupCnt, int lineCnt)
|
|
|
+{
|
|
|
+ for(int i = 0; i < groupCnt; i++)
|
|
|
+ {
|
|
|
+ for(int i = 0; i < lineCnt; i++)
|
|
|
+ {
|
|
|
+ printf("\033[1A");
|
|
|
+ printf("\033[K");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ printf("\r");
|
|
|
+}
|
|
|
+
|
|
|
void RunStatusProc(char *v1, char *v2)
|
|
|
{
|
|
|
printf("OrderCharging = %d \n", ShmSysConfigAndInfo->SysInfo.OrderCharging);
|
|
@@ -746,52 +874,6 @@ void GetSystemInfo()
|
|
|
printf("\r\n\r\n");
|
|
|
}
|
|
|
|
|
|
-void ChangeGunNum()
|
|
|
-{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.CurGunSelected + 1 < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount)
|
|
|
- {
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelected += 1;
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = NO_DEFINE;
|
|
|
- }
|
|
|
- else if (ShmSysConfigAndInfo->SysConfig.AcConnectorCount > 0 &&
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == NO_DEFINE)
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = DEFAULT_AC_INDEX;
|
|
|
- else
|
|
|
- {
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelected = 0;
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = NO_DEFINE;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void GetGunSelectedNum(char *v1)
|
|
|
-{
|
|
|
- if (strcmp(v1, "-1") == 0 || strcmp(v1, "") == 0)
|
|
|
- {
|
|
|
- if (AC_QUANTITY > 0 &&
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc != NO_DEFINE)
|
|
|
- {
|
|
|
- printf("connector select changed = AC \n");
|
|
|
- }
|
|
|
- else
|
|
|
- printf("connector selected = %d \n", ShmSysConfigAndInfo->SysInfo.CurGunSelected);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- int _index = atoi(v1);
|
|
|
- if (_index <= 1)
|
|
|
- {
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelected = _index;
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = NO_DEFINE;
|
|
|
- printf("connector select changed = %d \n", _index);
|
|
|
- }
|
|
|
- else if (AC_QUANTITY > 0)
|
|
|
- {
|
|
|
- ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = DEFAULT_AC_INDEX;
|
|
|
- printf("connector select changed = AC \n");
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
void SetFanSpeed(char *v1)
|
|
|
{
|
|
|
int speed = atoi(v1);
|
|
@@ -825,25 +907,32 @@ void SetGFDMode(char *v1)
|
|
|
// PSU 0 PSU 1 PSU 2 ...
|
|
|
// Gun Temp Chiller DD/PFC/Amb DD/PFC/Amb DD/PFC/Amb DD/PFC/Amb
|
|
|
// 1 XXX XXX XXX/XXX/XXX XXX/XXX/XXX XXX/XXX/XXX XXX/XXX/XXX
|
|
|
-void GetTemperature(char *v1)
|
|
|
+void GetTemperature(char *inputCmd, unsigned int opt)
|
|
|
{
|
|
|
- bool loop = false;
|
|
|
+ bool keepRun = false;
|
|
|
+ bool reflash = false;
|
|
|
int time = 0;
|
|
|
struct timespec _Loop_time;
|
|
|
char strGunTemp[16], strChillerTemp[16];
|
|
|
|
|
|
- if(strcmp(v1, "c") == 0)
|
|
|
+ if((opt & OPTION_REFLASH) || (opt & OPTION_LOOP) > 0)
|
|
|
{
|
|
|
- loop = true;
|
|
|
+ keepRun = true;
|
|
|
}
|
|
|
|
|
|
+ printf("\r\n");
|
|
|
+ printf(" PSU 0 PSU 1 PSU 2 .....\r\n");
|
|
|
+ printf(" Gun Temp Chiller DD/PFC/Amb DD/PFC/Amb DD/PFC/Amb DD/PFC/Amb\r\n");
|
|
|
+
|
|
|
do
|
|
|
{
|
|
|
time = GetTimeoutValue(_Loop_time) / mSEC_VAL;
|
|
|
if(time >= 1000)
|
|
|
{
|
|
|
- printf(" PSU 0 PSU 1 PSU 2 .....\r\n");
|
|
|
- printf(" Gun Temp Chiller DD/PFC/Amb DD/PFC/Amb DD/PFC/Amb DD/PFC/Amb\r\n");
|
|
|
+ if(reflash)
|
|
|
+ {
|
|
|
+ ConsoleReflash(CONNECTOR_QUANTITY, 1);
|
|
|
+ }
|
|
|
|
|
|
for(int i = 0; i < CONNECTOR_QUANTITY; i++)
|
|
|
{
|
|
@@ -869,34 +958,44 @@ void GetTemperature(char *v1)
|
|
|
}
|
|
|
printf("\r\n");
|
|
|
}
|
|
|
- printf("\r\n");
|
|
|
GetClockTime(&_Loop_time);
|
|
|
+
|
|
|
+ if((opt & OPTION_REFLASH) > 0)
|
|
|
+ {
|
|
|
+ reflash = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if(loop)
|
|
|
+ if(keepRun)
|
|
|
{
|
|
|
- loop = IsLoopStopCmd() ? false : true;
|
|
|
+ keepRun = IsLoopStopCmd() ? false : true;
|
|
|
usleep(10000);
|
|
|
}
|
|
|
- }while(loop);
|
|
|
+ }while(keepRun);
|
|
|
}
|
|
|
|
|
|
-void GetInputVol(char *v1)
|
|
|
+void GetInputVol(char *inputCmd, unsigned int opt)
|
|
|
{
|
|
|
- bool loop = false;
|
|
|
+ bool keepRun = false;
|
|
|
+ bool reflash = false;
|
|
|
int time = 0;
|
|
|
struct timespec _Loop_time;
|
|
|
|
|
|
- if(strcmp(v1, "c") == 0)
|
|
|
+ if((opt & OPTION_REFLASH) || (opt & OPTION_LOOP) > 0)
|
|
|
{
|
|
|
- loop = true;
|
|
|
+ keepRun = true;
|
|
|
}
|
|
|
|
|
|
+ printf("\r\n");
|
|
|
do
|
|
|
{
|
|
|
time = GetTimeoutValue(_Loop_time) / mSEC_VAL;
|
|
|
if(time >= 1000)
|
|
|
{
|
|
|
+ if(reflash)
|
|
|
+ {
|
|
|
+ ConsoleReflash(1, 1);
|
|
|
+ }
|
|
|
printf("L1N_L12 = %4.1f V, L2N_L23 = %4.1f V, L3N_L31 = %4.1f V, DC Input: %4.1f V\r\n",
|
|
|
ShmSysConfigAndInfo->SysInfo.InputVoltageR,
|
|
|
ShmSysConfigAndInfo->SysInfo.InputVoltageS,
|
|
@@ -904,14 +1003,19 @@ void GetInputVol(char *v1)
|
|
|
ShmSysConfigAndInfo->SysInfo.InputVoltageDc);
|
|
|
|
|
|
GetClockTime(&_Loop_time);
|
|
|
+
|
|
|
+ if((opt & OPTION_REFLASH) > 0)
|
|
|
+ {
|
|
|
+ reflash = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if(loop)
|
|
|
+ if(keepRun)
|
|
|
{
|
|
|
- loop = IsLoopStopCmd() ? false : true;
|
|
|
+ keepRun = IsLoopStopCmd() ? false : true;
|
|
|
usleep(10000);
|
|
|
}
|
|
|
- }while(loop);
|
|
|
+ }while(keepRun);
|
|
|
printf("\r\n");
|
|
|
}
|
|
|
|
|
@@ -2181,14 +2285,16 @@ void RunSimplePsuGrouping(char *v1, char *v2)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
void ShowCabinetInfo(void)
|
|
|
{
|
|
|
int ipAddress = 0;
|
|
|
|
|
|
- printf("\r\nPower Cabinet Charging Mode = %d, ReAssignedFlag = %d, Psu Work Step = %d",
|
|
|
- ShmSysConfigAndInfo->SysInfo.MainChargingMode, ShmSysConfigAndInfo->SysInfo.ReAssignedFlag, ShmPsuData->Work_Step);
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Psu Work Step = %d, PsuComm: %d\r\n", ShmPsuData->Work_Step, ShmChargerInfo->Control.CommInfo.PsuComm.CommCnt);
|
|
|
+ printf("Psu RxCnt: %d\r\n", ShmChargerInfo->Control.CommInfo.PsuComm.RxCnt);
|
|
|
|
|
|
- printf("\r\n Dispenser: %d / %d, Connector: %d / %d",
|
|
|
+ printf(" Dispenser: %d / %d, Connector: %d / %d\r\n",
|
|
|
ShmSysConfigAndInfo->SysInfo.DispenserInfo.PresentDispenserQuantity,
|
|
|
ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity,
|
|
|
ShmSysConfigAndInfo->SysInfo.DispenserInfo.PresentConnectorQuantity,
|
|
@@ -2198,7 +2304,7 @@ void ShowCabinetInfo(void)
|
|
|
{
|
|
|
ipAddress = ShmSysConfigAndInfo->SysInfo.DispenserInfo.ConnectionInfo[i].IpAddress;
|
|
|
|
|
|
- printf("\r\n Dispenser Connection[%d] Status: %d, DispenserIndex: %d, IP: %d.%d.%d.%d", i,
|
|
|
+ printf(" Dispenser Connection[%d] Status: %d, DispenserIndex: %d, IP: %d.%d.%d.%d\r\n", i,
|
|
|
ShmSysConfigAndInfo->SysInfo.DispenserInfo.ConnectionInfo[i].Status,
|
|
|
ShmSysConfigAndInfo->SysInfo.DispenserInfo.ConnectionInfo[i].DispenserIndex,
|
|
|
((ipAddress >> 0) & 0xFF), ((ipAddress >> 8) & 0xFF), ((ipAddress >> 16) & 0xFF), ((ipAddress >> 24) & 0xFF));
|
|
@@ -2206,13 +2312,13 @@ void ShowCabinetInfo(void)
|
|
|
printf("\r\n");
|
|
|
for(int i = 0; i < GENERAL_GUN_QUANTITY; i++)
|
|
|
{
|
|
|
- printf("\r\n Connector[%d] Index: %2X, Status = %2d , %s", i, _chargingData[i]->Index, _chargingData[i]->SystemStatus,
|
|
|
+ printf(" Connector[%d] Index: %2X, Status = %2d , %s\r\n", i, _chargingData[i]->Index, _chargingData[i]->SystemStatus,
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].Enable ? "Enable" : "Disable");
|
|
|
}
|
|
|
|
|
|
for(int i = 0; i < ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity; i++)
|
|
|
{
|
|
|
- printf("\r\n Dispenser[%d] Status: %d", i, ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LocalStatus);
|
|
|
+ printf(" Dispenser[%d] Status: %d", i, ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LocalStatus);
|
|
|
if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LocalStatus != _DS_None &&
|
|
|
ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LocalStatus != _DS_Timeout)
|
|
|
{
|
|
@@ -2225,20 +2331,20 @@ void ShowCabinetInfo(void)
|
|
|
ipAddress = ShmSysConfigAndInfo->SysInfo.DispenserInfo.ConnectionInfo[j].IpAddress;
|
|
|
}
|
|
|
}
|
|
|
- printf(", ModelName: %s, IP: %d.%d.%d.%d", ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ModelName,
|
|
|
+ printf(", ModelName: %s, IP: %d.%d.%d.%d\r\n", ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ModelName,
|
|
|
((ipAddress >> 0) & 0xFF), ((ipAddress >> 8) & 0xFF), ((ipAddress >> 16) & 0xFF), ((ipAddress >> 24) & 0xFF));
|
|
|
for(int j = 0; j < ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ConnectorQuantity; j++)
|
|
|
{
|
|
|
unsigned char gun = ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ConnectorID[j];
|
|
|
- printf("\r\n - Connector[%d] Gun %d, %s", j, gun, _chargingData[gun - 1]->ConnectorPlugIn ? "Plugged" : "Unplugged");
|
|
|
+ printf(" - Connector[%d] Gun %d, %s\r\n", j, gun, _chargingData[gun - 1]->ConnectorPlugIn ? "Plugged" : "Unplugged");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- printf(", No Information");
|
|
|
+ printf(", No Information\r\n");
|
|
|
}
|
|
|
}
|
|
|
- printf("\r\n\r\n");
|
|
|
+ printf("\r\n");
|
|
|
}
|
|
|
|
|
|
void SetTestControl(char *v1, char *v2)
|
|
@@ -3111,8 +3217,290 @@ void SetGunCommand(char *v1, char *v2, char *v3)
|
|
|
printf("\r\n");
|
|
|
}
|
|
|
|
|
|
+void ShowWebSystemInfo(void)
|
|
|
+{
|
|
|
+ char *str_led_intensity[] = {STR_DARKEST, STR_MEDIUM, STR_BRIGHTEST};
|
|
|
+ char *str_qr_code_made[] = {STR_QR_DEFAULT, STR_QR_CUSTOMIZED, STR_QR_CHARGEBOXID};
|
|
|
+ char *str_rfid_endian[] = {STR_LITTLE_ENDIAN, STR_BIG_ENDIAN};
|
|
|
+
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [System]\r\n");
|
|
|
+ printf(" *System ID: %s\r\n", ShmSysConfigAndInfo->SysConfig.SystemId);
|
|
|
+ printf(" *AuthorisationMode[%7s]\r\n",
|
|
|
+ ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_ENABLE ? "Enable" : "Disable");
|
|
|
+ printf(" - APP [%7s]\r\n", ShmSysConfigAndInfo->SysConfig.isAPP > 0 ? "Enable" : "Disable");
|
|
|
+ printf(" - QRCode [%7s]\r\n", ShmSysConfigAndInfo->SysConfig.isQRCode > 0 ? "Enable" : "Disable");
|
|
|
+ printf(" - RFID [%7s]\r\n", ShmSysConfigAndInfo->SysConfig.isRFID > 0 ? "Enable" : "Disable");
|
|
|
+ printf(" - EVCCID [%7s]\r\n", ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID > 0 ? "Enable" : "Disable");
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian <= RFID_ENDIAN_BIG)
|
|
|
+ {
|
|
|
+ printf(" *RfidCardNumEndian [%s]\r\n", str_rfid_endian[ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" *RfidCardNumEndian: %d\r\n", ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode <= _QR_MODE_Customized)
|
|
|
+ {
|
|
|
+ printf(" *QR Code Made [%s]\r\n", str_qr_code_made[ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" *QR Code Made: %d\r\n", ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
|
|
|
+ }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode == _QR_MODE_Customized)
|
|
|
+ {
|
|
|
+ printf(" - QR Code Content: %s\r\n", ShmSysConfigAndInfo->SysConfig.QRCodeContent);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ShmChargerInfo->AuthInfo.QRCodeMode <= _QR_MODE_ChargeBoxId)
|
|
|
+ {
|
|
|
+ printf(" *QR Code Mode [%s]\r\n", str_qr_code_made[ShmChargerInfo->AuthInfo.QRCodeMode]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" *QR Code Mode: %d\r\n", ShmChargerInfo->AuthInfo.QRCodeMode);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity <= _LED_INTENSITY_BRIGHTEST)
|
|
|
+ {
|
|
|
+ printf(" *LED Intensity[%s]\r\n", str_led_intensity[ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" *LED Intensity[%d]\r\n", ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWebChargingInfo(void)
|
|
|
+{
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [Charging]\r\n");
|
|
|
+ printf(" *Max Charging Energy : %4d kWh\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
|
|
|
+ printf(" *Max Charging Power : %4d kW\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
|
|
|
+ printf(" *Max Charging Current : %4d A\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
|
|
|
+ printf(" *Max Charging Duration: %4d Minutes\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
|
|
|
+ printf(" *StopCharging By Button[%7s]\r\n", ShmSysConfigAndInfo->SysConfig.StopChargingByButton > 0 ? "Enable" : "Disable");
|
|
|
+ printf(" *Billing[%7s]\r\n", ShmSysConfigAndInfo->SysConfig.BillingData.isBilling > 0 ? "Enable" : "Disable");
|
|
|
+ printf(" - Currency[%2d]\r\n", ShmSysConfigAndInfo->SysConfig.BillingData.Currency);
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWebNetworkInfo(void)
|
|
|
+{
|
|
|
+ char *str_wifi_mode[] = {"Disable", "Station", "AP Mode"};
|
|
|
+
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [Network]\r\n");
|
|
|
+ printf(" *NetworkStatus[%s]\r\n", ShmSysConfigAndInfo->SysInfo.InternetConn > 0 ? "Connected" : "Disconnected");
|
|
|
+ printf(" *DHCP Client[%7s]\r\n", ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient == 0 ? "Enable" : "Disable");
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode <= _SYS_WIFI_MODE_AP)
|
|
|
+ {
|
|
|
+ printf(" *WiFi Mode [%7s]\r\n", str_wifi_mode[ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" *WiFi Mode [%d]\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
|
|
|
+ }
|
|
|
+ printf(" - ConnStatus[%s]\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn == YES ? "Connected" : "Disconnected");
|
|
|
+ printf(" *3G/4G Mode [%7s]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled == YES ? "Enable" : "Disable");
|
|
|
+ printf(" - ConnStatus[%s]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn == YES ? "Connected" : "Disconnected");
|
|
|
+ printf(" - APN : %s\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
|
|
|
+ printf(" - RSSI: %d dBm\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWebBackendInfo(void)
|
|
|
+{
|
|
|
+ char *str_offline_policy[] = {"Local List", "Phihong RFID", "Free Charging", "No Charging"};
|
|
|
+ char *str_security_profile[] = {
|
|
|
+ "None security",
|
|
|
+ "Unsecured Transport with Basic Atuentication",
|
|
|
+ "TLS with Basic Authentication",
|
|
|
+ "TLS with Client Side Certificates"
|
|
|
+ };
|
|
|
+
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [Backend]\r\n");
|
|
|
+ printf(" *Common\r\n");
|
|
|
+ printf(" - Backend Timeout : %d s\r\n", ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.OfflinePolicy <= _OFFLINE_POLICY_NO_CHARGING)
|
|
|
+ {
|
|
|
+ printf(" - Offline Policy : %s\r\n", str_offline_policy[ShmSysConfigAndInfo->SysConfig.OfflinePolicy]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" - Offline Policy : %d\r\n", ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
|
|
|
+ }
|
|
|
+ printf(" - OfflineMaxEnergy : %4d kWh\r\n", ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
|
|
|
+ printf(" - OfflineMaxDuration: %4d Minutes\r\n", ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
|
|
|
+ printf(" *OCPP\r\n");
|
|
|
+ printf(" - OcppStatus[%s]\r\n", ShmSysConfigAndInfo->SysInfo.OcppConnStatus == YES ? "Connected" : "Disconnected");
|
|
|
+ printf(" - OcppURL : %s\r\n", ShmSysConfigAndInfo->SysConfig.OcppServerURL);
|
|
|
+ printf(" - ChargeBoxId: %s\r\n", ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
|
|
|
+ printf(" - Vendor : %s\r\n", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile <= 3)
|
|
|
+ {
|
|
|
+ printf(" - Security : %s\r\n", str_security_profile[ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" - Security : %d\r\n", ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile);
|
|
|
+ }
|
|
|
+ printf(" - MaintainStatus[%s]\r\n", ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus == YES ? "Connected" : "Disconnected");
|
|
|
+ printf(" - MaintainURL : %s\r\n", ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile <= 3)
|
|
|
+ {
|
|
|
+ printf(" - MaintainSecurity: %s\r\n", str_security_profile[ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" - MaintainSecurity: %d\r\n", ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile);
|
|
|
+ }
|
|
|
+ printf(" *TTIA[%7s]\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA == YES ? "Enable" : "Disable");
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA == YES)
|
|
|
+ {
|
|
|
+ printf(" - ServerAddress: %s\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr);
|
|
|
+ printf(" - ServerPort : %d\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port);
|
|
|
+ printf(" - BusVenderId : %d\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.busVenderId);
|
|
|
+ printf(" - Provider : %s\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.EquipmentProvider);
|
|
|
+ printf(" - CompanyNo : %d\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.TransportationCompanyNo);
|
|
|
+ printf(" - ChargeBoxId : %d\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId);
|
|
|
+ printf(" - EVSEStation : %s\r\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWebAllInfo(void)
|
|
|
+{
|
|
|
+ ShowWebSystemInfo();
|
|
|
+ ShowWebChargingInfo();
|
|
|
+ ShowWebNetworkInfo();
|
|
|
+ ShowWebBackendInfo();
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWebInfo(char *v1)
|
|
|
+{
|
|
|
+ bool find = false;
|
|
|
+ int showItem = 0;
|
|
|
+ int itemLen = 5;
|
|
|
+ char strItem[32][32] = {"system", "charging", "network", "backend", "all"};
|
|
|
+ void *actionList[32] = {&ShowWebSystemInfo, &ShowWebChargingInfo, &ShowWebNetworkInfo, &ShowWebBackendInfo, &ShowWebAllInfo};
|
|
|
+ void (*ItemAction)();
|
|
|
+
|
|
|
+ for(showItem = 0; showItem < itemLen; showItem++)
|
|
|
+ {
|
|
|
+ if(strcmp((char *)&strItem[showItem][0], v1) == 0)
|
|
|
+ {
|
|
|
+ find = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(find)
|
|
|
+ {
|
|
|
+ ItemAction = actionList[showItem];
|
|
|
+ ItemAction();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf("\r\n");
|
|
|
+ printf ("Input cmd fail ------ web [cmd]\r\n");
|
|
|
+ for(int i = 0; i < itemLen; i++)
|
|
|
+ {
|
|
|
+ printf(" [cmd] %s\r\n", (char *)&strItem[i][0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ printf("\r\n");
|
|
|
+}
|
|
|
+
|
|
|
+// Gun 1 ( CCS ) Soc: XXX %, Energy: XXXXX.X kWh, IdTag [XXXXXXXXXXXXXXXX] Transaction [0]
|
|
|
+// Gun 1 ( CCS ) IdTag: XXXXXXXXXXXXXXXX, Soc: XXX %, Energy: XXXX.X kWh
|
|
|
+// (XX) (X) Target: XXXX V, XXXX A, Cap: XXXX A, XXXX kW
|
|
|
+// Output: XXXX V, XXXX A, Limit: XXXX A, XXXX kW
|
|
|
+void ShowGunInfo(int gun)
|
|
|
+{
|
|
|
+ char *str_gun_type[] = {"CHAdeMO", " CCS ", " GBT "};
|
|
|
+ char acceptId[128];
|
|
|
+ Get_Ocpp_TransactionId(gun, acceptId);
|
|
|
+ printf(" Gun %d (%s) Soc: %3d %s, Energy: %7.1f kWh, IdTag [%16s] Transaction [%s]\r\n",
|
|
|
+ gun + 1,
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].Enable ? str_gun_type[_chargingData[gun]->Type] : "Disable",
|
|
|
+ _chargingData[gun]->EvBatterySoc, "%",
|
|
|
+ _chargingData[gun]->PresentChargedEnergy,
|
|
|
+ _chargingData[gun]->StartUserId,
|
|
|
+ acceptId);
|
|
|
+ //printf(" Gun %d (%s) IdTag [%16s] Soc: %3d %s, Energy: %4.1f kWh\r\n",
|
|
|
+ // i + 1,
|
|
|
+ // ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].Enable ? str_gun_type[_chargingData[i]->Type] : "Disable",
|
|
|
+ // _chargingData[i]->StartUserId,
|
|
|
+ // _chargingData[i]->EvBatterySoc, "%",
|
|
|
+ // _chargingData[i]->PresentChargedEnergy);
|
|
|
+ printf(" (%2d) (%s) Target: %4d V, %4d A, Cap: %4d A, %4d kW\r\n",
|
|
|
+ _chargingData[gun]->SystemStatus,
|
|
|
+ _chargingData[gun]->ConnectorPlugIn ? "O" : "X",
|
|
|
+ (int)_chargingData[gun]->EvBatterytargetVoltage,
|
|
|
+ (int)_chargingData[gun]->EvBatterytargetCurrent,
|
|
|
+ (int)(_chargingData[gun]->AvailableChargingCurrent / 10),
|
|
|
+ (int)(_chargingData[gun]->AvailableChargingPower / 10));
|
|
|
+ printf(" Output: %4d V, %4d A, Limit: %4d A, %4d kW\r\n",
|
|
|
+ (int)(_chargingData[gun]->PresentChargingVoltage),
|
|
|
+ (int)(_chargingData[gun]->PresentChargingCurrent),
|
|
|
+ (int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].CapabilityCurrent / 10),
|
|
|
+ (int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].CapabilityPower / 10));
|
|
|
+}
|
|
|
+
|
|
|
+void ShowInfo(char *inputCmd, unsigned int opt)
|
|
|
+{
|
|
|
+ bool keepRun = false;
|
|
|
+ bool reflash = false;
|
|
|
+ int time = 0;
|
|
|
+ struct timespec _Loop_time;
|
|
|
+
|
|
|
+ if((opt & OPTION_REFLASH) || (opt & OPTION_LOOP) > 0)
|
|
|
+ {
|
|
|
+ keepRun = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ do
|
|
|
+ {
|
|
|
+ time = GetTimeoutValue(_Loop_time) / mSEC_VAL;
|
|
|
+ if(time >= 1000)
|
|
|
+ {
|
|
|
+ if(reflash)
|
|
|
+ {
|
|
|
+ ConsoleReflash(CONNECTOR_QUANTITY, 4);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(int i = 0; i < GENERAL_GUN_QUANTITY; i++)
|
|
|
+ {
|
|
|
+ printf("\r\n");
|
|
|
+ ShowGunInfo(i);
|
|
|
+ }
|
|
|
+ GetClockTime(&_Loop_time);
|
|
|
+
|
|
|
+ if((opt & OPTION_REFLASH) > 0)
|
|
|
+ {
|
|
|
+ reflash = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(keepRun)
|
|
|
+ {
|
|
|
+ keepRun = IsLoopStopCmd() ? false : true;
|
|
|
+ usleep(10000);
|
|
|
+ }
|
|
|
+ }while(keepRun);
|
|
|
+ printf("\r\n");
|
|
|
+}
|
|
|
+
|
|
|
int main(void)
|
|
|
{
|
|
|
+ char newString[32][32];
|
|
|
+ char inputString[128], normalCmd[128], mainCmd[128], subCmd[128], multiCmd[128];
|
|
|
+ int cmdCnt = 0, parseCnt = 0;
|
|
|
+ unsigned int option = 0;
|
|
|
+
|
|
|
if(InitShareMemory() == FAIL)
|
|
|
{
|
|
|
printf ("InitShareMemory = FAIL \n");
|
|
@@ -3132,46 +3520,63 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- memset(&ShmChargerInfo->PsuGrouping.GroupCollection[0], 0x00, sizeof(PsuGroupCollectionData));
|
|
|
- memset(&ShmChargerInfo->PsuGrouping.GroupCollection[1], 0x00, sizeof(PsuGroupCollectionData));
|
|
|
- memset(&ShmChargerInfo->PsuGrouping.GroupCollection[2], 0x00, sizeof(PsuGroupCollectionData));
|
|
|
- memset(&ShmChargerInfo->PsuGrouping.GroupCollection[3], 0x00, sizeof(PsuGroupCollectionData));
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[0].Index = 0;
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[1].Index = 1;
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[2].Index = 2;
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[3].Index = 3;
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[0].Location = 0;
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[1].Location = 3;
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[2].Location = 1;
|
|
|
- ShmChargerInfo->PsuGrouping.GroupCollection[3].Location = 2;
|
|
|
- */
|
|
|
+ // clean command
|
|
|
+ memset(mainCmd, 0x00, sizeof(mainCmd));
|
|
|
+ memset(subCmd, 0x00, sizeof(subCmd));
|
|
|
+ for(int i = 0; i < 32; i++)
|
|
|
+ {
|
|
|
+ memset(&newString[i], 0x00, 32);
|
|
|
+ }
|
|
|
|
|
|
for(;;)
|
|
|
{
|
|
|
- char word[128];
|
|
|
- char newString[7][32];
|
|
|
- int i,j,ctr;
|
|
|
+ memset(inputString, 0x00, sizeof(inputString));
|
|
|
+ memset(normalCmd, 0x00, sizeof(normalCmd));
|
|
|
+
|
|
|
+ get_char(inputString);
|
|
|
+ cmdCnt = InputStringNormalize(inputString, normalCmd, &option);
|
|
|
+ if(cmdCnt > 0)
|
|
|
+ {
|
|
|
+ // clean command
|
|
|
+ memset(mainCmd, 0x00, sizeof(mainCmd));
|
|
|
+ memset(subCmd, 0x00, sizeof(subCmd));
|
|
|
+ for(int i = 0; i < 32; i++)
|
|
|
+ {
|
|
|
+ memset(&newString[i], 0x00, 32);
|
|
|
+ }
|
|
|
|
|
|
- fgets(word, sizeof(word), stdin);
|
|
|
+ //printf("CmdCnt: %d\r\n", cmdCnt);
|
|
|
+ //printf("Input: %s", inputString);
|
|
|
+ //printf("Normalize: %s\r\n", normalCmd);
|
|
|
+ //printf("option: %08X\r\n", option);
|
|
|
|
|
|
- j=0; ctr=0;
|
|
|
- strcpy(newString[1], "-1");
|
|
|
- strcpy(newString[2], "-1");
|
|
|
- for (i = 0; i <= (strlen(word)); i++)
|
|
|
- {
|
|
|
- if (word[i] == ' ' || word[i] == '\0' || word[i] == 10)
|
|
|
- {
|
|
|
- newString[ctr][j] = '\0';
|
|
|
- ctr++;
|
|
|
- j = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- newString[ctr][j] = word[i];
|
|
|
- j++;
|
|
|
- }
|
|
|
- }
|
|
|
+ MainAndSubCommandParsing(normalCmd, mainCmd, subCmd);
|
|
|
+ //printf("MainCmd: %s\r\n", mainCmd);
|
|
|
+ //printf("SubCmd: %s\r\n", subCmd);
|
|
|
+
|
|
|
+ parseCnt = 0;
|
|
|
+ strcpy(multiCmd, normalCmd);
|
|
|
+ do
|
|
|
+ {
|
|
|
+ MainAndSubCommandParsing(multiCmd, &newString[parseCnt][0], &newString[parseCnt + 1][0]);
|
|
|
+ strcpy(multiCmd, &newString[parseCnt + 1][0]);
|
|
|
+ //printf("MultiCmd Parse %d\r\n", parseCnt + 1);
|
|
|
+ //printf("MainCmd: %s\r\n", &newString[parseCnt][0]);
|
|
|
+ //printf("SubCmd: %s\r\n", &newString[parseCnt + 1][0]);
|
|
|
+ parseCnt++;
|
|
|
+ }while(parseCnt < cmdCnt - 1);
|
|
|
+
|
|
|
+ //printf("\r\n");
|
|
|
+ //for(int i = 0; i < cmdCnt; i++)
|
|
|
+ //{
|
|
|
+ // printf("MultiCmd %d: [%s]\r\n", i + 1, &newString[i][0]);
|
|
|
+ //}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ usleep(100000);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
if(strcmp(newString[0], "state") == 0)
|
|
|
{
|
|
@@ -3248,16 +3653,6 @@ int main(void)
|
|
|
{
|
|
|
GetSystemInfo();
|
|
|
}
|
|
|
- else if(strcmp(newString[0], "select") == 0)
|
|
|
- {
|
|
|
- // 取得 / 設定 當前選的槍號
|
|
|
- GetGunSelectedNum(newString[1]);
|
|
|
- }
|
|
|
- else if(strcmp(newString[0], "change") == 0)
|
|
|
- {
|
|
|
- // 模擬按鈕改變選槍
|
|
|
- ChangeGunNum();
|
|
|
- }
|
|
|
else if(strcmp(newString[0], "fan") == 0)
|
|
|
{
|
|
|
// 設定風扇速度
|
|
@@ -3278,15 +3673,15 @@ int main(void)
|
|
|
// 設定盲沖使用 GFD 功能
|
|
|
SetGFDMode(newString[1]);
|
|
|
}
|
|
|
- else if(strcmp(newString[0], "temp") == 0)
|
|
|
+ else if(strcmp(mainCmd, "temp") == 0)
|
|
|
{
|
|
|
// 取得溫度
|
|
|
- GetTemperature(newString[1]);
|
|
|
+ GetTemperature(subCmd, option);
|
|
|
}
|
|
|
- else if(strcmp(newString[0], "acin") == 0)
|
|
|
+ else if(strcmp(mainCmd, "acin") == 0)
|
|
|
{
|
|
|
// 取得三向輸入電壓
|
|
|
- GetInputVol(newString[1]);
|
|
|
+ GetInputVol(subCmd, option);
|
|
|
}
|
|
|
else if(strcmp(newString[0], "psu") == 0)
|
|
|
{
|
|
@@ -3497,9 +3892,19 @@ int main(void)
|
|
|
continue;
|
|
|
}
|
|
|
SetGunCommand(newString[1], newString[2], newString[3]);
|
|
|
+ }
|
|
|
+ else if(strcmp(newString[0], "web") == 0)
|
|
|
+ {
|
|
|
+ ShowWebInfo(newString[1]);
|
|
|
+ }
|
|
|
+ else if(strcmp(mainCmd, "info") == 0)
|
|
|
+ {
|
|
|
+ ShowInfo(subCmd, option);
|
|
|
}
|
|
|
else
|
|
|
+ {
|
|
|
printf ("%s\n", msg);
|
|
|
+ }
|
|
|
usleep(100000);
|
|
|
}
|
|
|
|