|
@@ -44,7 +44,7 @@
|
|
|
#include "Config.h"
|
|
|
#include "./ModuleEvComm/Module_EvComm.h"
|
|
|
#include "./CSU/main.h"
|
|
|
-
|
|
|
+#include "common.h"
|
|
|
//------------------------------------------------------------------------------
|
|
|
#define CMD_KEY_WAIT (1)
|
|
|
#define CMD_KEY_DONT_WAIT (0)
|
|
@@ -61,7 +61,12 @@
|
|
|
#define TTY_PATH "/dev/tty"
|
|
|
#define STTY_US "stty raw -echo -F "
|
|
|
#define STTY_DEF "stty -raw echo -F "
|
|
|
-
|
|
|
+#define OPTION_CNT 4
|
|
|
+#define STR_OPTION '-'
|
|
|
+#define OPTION_REFLASH 0x00000001
|
|
|
+#define OPTION_LOOP 0x00000002
|
|
|
+#define OPTION_OUTPUT_FILE 0x00000004
|
|
|
+#define OPTION_TIME 0x00000008
|
|
|
//------------------------------------------------------------------------------
|
|
|
uint8_t _curAutoRunCount = 0;
|
|
|
uint8_t _usingAutoRun = 0;
|
|
@@ -80,7 +85,6 @@ static struct GBTData *ShmGBTData = NULL;
|
|
|
static struct FanModuleData *ShmFanModuleData = NULL;
|
|
|
static struct RelayModuleData *ShmRelayModuleData = NULL;
|
|
|
static struct LedModuleData *ShmLedModuleData = NULL;
|
|
|
-static struct PsuData *ShmPsuData = NULL;
|
|
|
static struct OCPP16Data *ShmOCPP16Data = NULL;
|
|
|
static SelectGunInfo *ShmSelectGunInfo = NULL;
|
|
|
static DcCommonInfo *ShmDcCommonData = NULL;
|
|
@@ -188,60 +192,188 @@ unsigned long GetTimeoutValue(struct timeval _sour_time)
|
|
|
return (_end_time.tv_sec - _sour_time.tv_sec);
|
|
|
}
|
|
|
|
|
|
-void RunStatusProc(char *v1, char *v2)
|
|
|
+// return command length
|
|
|
+int ParsingCmd(char *inputString, char *outputString)
|
|
|
{
|
|
|
- printf("OrderCharging = %d \n", pSysInfo->OrderCharging);
|
|
|
- printf("WaitForPlugit = %d \n", pSysInfo->WaitForPlugit);
|
|
|
- if (strcmp(v1, "ac") == 0) {
|
|
|
- pAcChargingInfo = (struct ChargingInfoData *)GetAcChargingInfoData(0);
|
|
|
- //if (!FindAcChargingInfoData(0, &ac_chargingInfo[0])) {
|
|
|
- // printf("FindChargingInfoData (AC) false \n");
|
|
|
- //}
|
|
|
- printf("AC Status = %d \n", pAcChargingInfo->ConnectorPlugIn);
|
|
|
- return;
|
|
|
+ bool valid = false, done = false;
|
|
|
+ int len = 0, start = 0;
|
|
|
+
|
|
|
+ for(int i = 0; i < strlen(inputString); i++)
|
|
|
+ {
|
|
|
+ if(!valid)
|
|
|
+ {
|
|
|
+ if(inputString[i] != ' ' && inputString[i] != '\0' && inputString[i] != '\r' && inputString[i] != '\n')
|
|
|
+ {
|
|
|
+ valid = true;
|
|
|
+ start = i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(inputString[i] == ' ' || inputString[i] == '\0' || inputString[i] == '\r' || inputString[i] == '\n' || len >= 128)
|
|
|
+ {
|
|
|
+ done = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ len = (valid && !done) ? len + 1 : len;
|
|
|
}
|
|
|
|
|
|
- int _index = atoi(v1);
|
|
|
+ if(valid)
|
|
|
+ {
|
|
|
+ memcpy(outputString, &inputString[start], len);
|
|
|
+ outputString[len] = '\0';
|
|
|
+ }
|
|
|
|
|
|
- if (_index <= 1) {
|
|
|
- //if (!FindChargingInfoData(_index, &_chargingData[0])) {
|
|
|
- // printf ("FindChargingInfoData error\n");
|
|
|
- // return;
|
|
|
- //}
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_index);
|
|
|
+ return len;
|
|
|
+}
|
|
|
+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");
|
|
|
+}
|
|
|
|
|
|
- if (strcmp(v2, "-1") == 0 || strcmp(v2, "") == 0) {
|
|
|
- // get
|
|
|
- printf ("index = %x, status = %x (%d) Reservation is :%s\n",
|
|
|
- _index,
|
|
|
- pDcChargingInfo->SystemStatus,
|
|
|
- pDcChargingInfo->IsAvailable,
|
|
|
- ShmDcCommonData->pGunInfo[_index].ReservationStatus ? "trigger" : "expired");
|
|
|
- if (ShmDcCommonData->pGunInfo[_index].ReservationStatus)
|
|
|
- printf("Reservation idTag:%s\n", ShmDcCommonData->pGunInfo[_index].ReservationID);
|
|
|
-
|
|
|
- printf("SystemTimeoutFlag = %d, PageIndex = %d\n",
|
|
|
- pSysInfo->SystemTimeoutFlag, pSysInfo->PageIndex);
|
|
|
- } else {
|
|
|
- // set
|
|
|
- pDcChargingInfo->SystemStatus = atoi(v2);
|
|
|
+int GetCommandSring(char *outputCmdString)
|
|
|
+{
|
|
|
+ int len = 0, cnt = 0;
|
|
|
+ int cmdLen = 0, totalLen = 0;
|
|
|
+ char word[128];
|
|
|
+
|
|
|
+ memset(word, 0x00, sizeof(word));
|
|
|
+ get_char(word);
|
|
|
+
|
|
|
+ len = strlen(word);
|
|
|
+ if(len == 0)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ int start = 0;
|
|
|
+ while(start < len - 1)
|
|
|
+ {
|
|
|
+ if(word[start] != ' ' && word[start] != '\0')
|
|
|
+ {
|
|
|
+ cmdLen = ParsingCmd(&word[start], &outputCmdString[totalLen]);
|
|
|
+
|
|
|
+ char newCmd[128];
|
|
|
+ memset(newCmd, 0x00, 128);
|
|
|
+ memcpy(newCmd, &outputCmdString[totalLen], cmdLen);
|
|
|
+
|
|
|
+ cnt = cmdLen > 0 ? cnt + 1 : cnt;
|
|
|
+ totalLen += cmdLen + 1;
|
|
|
+ start += cmdLen;
|
|
|
}
|
|
|
- } else {
|
|
|
- //if (!FindAcChargingInfoData(0, &ac_chargingInfo[0])) {
|
|
|
- // printf("FindChargingInfoData (AC) false \n");
|
|
|
- //}
|
|
|
- pAcChargingInfo = (struct ChargingInfoData *)GetAcChargingInfoData(0);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ start++;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- if (strcmp(v2, "-1") == 0 || strcmp(v2, "") == 0) {
|
|
|
- // get
|
|
|
- printf ("AC Type, status = %x (%d)\n",
|
|
|
- pAcChargingInfo->SystemStatus,
|
|
|
- pAcChargingInfo->IsAvailable);
|
|
|
- } else {
|
|
|
- // set
|
|
|
- pAcChargingInfo->SystemStatus = atoi(v2);
|
|
|
+ return cnt;
|
|
|
+}
|
|
|
+
|
|
|
+bool IsLoopStopCmd(void)
|
|
|
+{
|
|
|
+ bool stop = false;
|
|
|
+ int cnt = 0;
|
|
|
+ char cmd[256];
|
|
|
+ char totalCmd[256];
|
|
|
+
|
|
|
+ memset(cmd, 0x00, 256);
|
|
|
+ memset(totalCmd, 0x00, 256);
|
|
|
+
|
|
|
+ cnt = GetCommandSring(totalCmd);
|
|
|
+ if(cnt > 0)
|
|
|
+ {
|
|
|
+ strcpy(&cmd[0], totalCmd);
|
|
|
+
|
|
|
+ if(strcmp(&cmd[0], "c") == 0)
|
|
|
+ {
|
|
|
+ stop = true;
|
|
|
}
|
|
|
}
|
|
|
+ return stop;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+char* GetStartMethodName(int method)
|
|
|
+{
|
|
|
+ if (method == _CHARGING_START_RFID) {
|
|
|
+ return "RFID";
|
|
|
+ } else if (method == _CHARGING_START_AUTOSTART) {
|
|
|
+ return "AuthoStartCharging";
|
|
|
+ } else if (method == _CHARGING_START_REMOTESTART) {
|
|
|
+ return "RemoteStart";
|
|
|
+ } else if (method == _CHARGING_START_EVCCID){
|
|
|
+ return "EVCCID";
|
|
|
+ } else {
|
|
|
+ return "None";
|
|
|
+ }
|
|
|
+}
|
|
|
+void GunEnableInfo(uint8_t index)
|
|
|
+{
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(index);
|
|
|
+ char _time[30];
|
|
|
+ sprintf(_time,"%02d:%02d:%02d",(pDcChargingInfo->PresentChargedDuration/3600),(pDcChargingInfo->PresentChargedDuration%3600)/60,pDcChargingInfo->PresentChargedDuration%60);
|
|
|
+ printf("\n");
|
|
|
+ printf("%s Gun Status = %s \t%s\n\tStartMethod:%s\tDuration:[%s] Temp:[%d:%d]\n",index ? "Right":"Left",GetStatusName(pDcChargingInfo->SystemStatus),pDcChargingInfo->ConnectorPlugIn ? "PlugIn" : "Unplug",GetStartMethodName(pDcChargingInfo->StartMethod),_time,ShmDcCommonData->ConnectorTemp[index][0],ShmDcCommonData->ConnectorTemp[index][1]);
|
|
|
+ printf("\tEV Status:%d\tSoc:%d\n\tTargetVoltage:\t%05.2f V\t\tTargetCurrent:\t%05.2f A\n",ShmDcCommonData->pGunInfo[index].EVStatus,pDcChargingInfo->EvBatterySoc,pDcChargingInfo->EvBatterytargetVoltage,pDcChargingInfo->EvBatterytargetCurrent);
|
|
|
+ printf("\tPresentVoltage:\t%05.2f V\t\tPresentCurrent:\t%05.2f A\n\tPresentPower:\t%05.2f kW\t\tPresentEngergy:\t%05.2f kWh\n", pDcChargingInfo->PresentChargingVoltage,pDcChargingInfo->PresentChargingCurrent,pDcChargingInfo->PresentChargingPower,pDcChargingInfo->PresentChargedEnergy);
|
|
|
+}
|
|
|
+
|
|
|
+void RunStatusProc()
|
|
|
+{
|
|
|
+
|
|
|
+ bool keepRun = true;
|
|
|
+ int time = 0;
|
|
|
+ int dispenserLine = 0;
|
|
|
+ struct timespec _Loop_time;
|
|
|
+
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Dispenser Info\r\n");
|
|
|
+ do
|
|
|
+ {
|
|
|
+ time = GetClockTimeoutValue(_Loop_time) / 1000;
|
|
|
+
|
|
|
+ if(time >= 1000)
|
|
|
+ {
|
|
|
+
|
|
|
+ ConsoleReflash(1, 2);
|
|
|
+ ConsoleReflash(pSysConfig->TotalConnectorCount, 7);
|
|
|
+ dispenserLine = dispenserLine > 0 ? (dispenserLine + 1) : dispenserLine;
|
|
|
+ ConsoleReflash(1, dispenserLine);
|
|
|
+ dispenserLine = 0;
|
|
|
+ printf("Dispenser Total Connector: %d chiller Temp[%03d:%03d:%03d:%03d]\r\n",pSysConfig->TotalConnectorCount,
|
|
|
+ ShmDcCommonData->SystemTemp[0],ShmDcCommonData->SystemTemp[1],
|
|
|
+ ShmDcCommonData->SystemTemp[2],ShmDcCommonData->SystemTemp[3]);
|
|
|
+ for(int i = 0; i < pSysConfig->TotalConnectorCount; i++)
|
|
|
+ {
|
|
|
+ GunEnableInfo(i);
|
|
|
+ }
|
|
|
+
|
|
|
+ GetClockTime(&_Loop_time);
|
|
|
+ }
|
|
|
+ if(keepRun)
|
|
|
+ {
|
|
|
+ if (readCmdKey(CMD_KEY_DONT_WAIT) == NO) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (strcmp(newString[0], "c") == 0) {
|
|
|
+ printf("Stop show status\n");
|
|
|
+ keepRun = FALSE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }while(keepRun);
|
|
|
+ printf("\r\n");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void RunCardProc(char *v1, char *v2)
|
|
@@ -327,21 +459,6 @@ void RunSelfProc()
|
|
|
|
|
|
void GetFwVerProc(void)
|
|
|
{
|
|
|
- int _index = 0;
|
|
|
- int isContinue = 1;
|
|
|
- char *usageMsg = "Usage:\n"
|
|
|
- " model\n"
|
|
|
- " 407\n"
|
|
|
- " conn index, ex: conn 0 | 1\n"
|
|
|
- " relay\n"
|
|
|
- " fan\n"
|
|
|
- " dc\n"
|
|
|
- " led\n"
|
|
|
- " ac\n"
|
|
|
- " exit | c | C\n"
|
|
|
- " help | ? | h\n";
|
|
|
-
|
|
|
-
|
|
|
printf("ModelName = %s\r\n", pSysConfig->ModelName);
|
|
|
printf("DC Main Version = %s \n", pSysInfo->CsuRootFsFwRev);
|
|
|
printf("DC Main Debug Version = %s \n", ShmDcCommonData->DebugVersion);
|
|
@@ -351,57 +468,18 @@ void GetFwVerProc(void)
|
|
|
printf("Relay Board Version = %s \n", pSysInfo->RelayModuleFwRev);
|
|
|
printf("FAN Version = %s \n", pSysInfo->FanModuleFwRev);
|
|
|
printf("LED Version = %s \n", pSysInfo->LedModuleFwRev);
|
|
|
- printf("LCM FW Version = V.%03d \n", ShmDcCommonData->LcmFwVersion);
|
|
|
- printf("Dispenser Network Information checked: IP = % s Netmask = % s, Gateway = % s \n",
|
|
|
+ if (CheckDispenserGeneration() == _DISPENSER_GENERATION_3_5) {
|
|
|
+ printf("LCM HW Version = %s \n", ShmDcCommonData->pLcmInfo.verHW);
|
|
|
+ printf("LCM OS Version = %s \n", ShmDcCommonData->pLcmInfo.verFW_OS);
|
|
|
+ printf("LCM APK Version = %s \n", ShmDcCommonData->pLcmInfo.verFW_APK);
|
|
|
+ printf("LCM UI Version = %s \n", ShmDcCommonData->pLcmInfo.verFW_UI);
|
|
|
+ } else {
|
|
|
+ printf("LCM FW Version = V.%03d \n", ShmDcCommonData->LcmFwVersion);
|
|
|
+ }
|
|
|
+ printf("Dispenser Network Information checked: IP = %s Netmask = %s, Gateway = %s \n",
|
|
|
pSysConfig->Eth0Interface.EthIpAddress,
|
|
|
pSysConfig->Eth0Interface.EthSubmaskAddress,
|
|
|
pSysConfig->Eth0Interface.EthGatewayAddress);
|
|
|
- /*
|
|
|
- while (isContinue) {
|
|
|
- if (readCmdKey(CMD_KEY_WAIT) == NO) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- if (strcmp(newString[0], "407") == 0) {
|
|
|
- printf("407 FW Version = %s\n", ShmPrimaryMcuData->version);
|
|
|
- } else if (strcmp(newString[0], "model") == 0) {
|
|
|
- printf("ModelName = %s\r\n", pSysConfig->ModelName);
|
|
|
- } else if (strcmp(newString[0], "conn") == 0) {
|
|
|
- if (strcmp(newString[1], "-1") == 0 ||
|
|
|
- strcmp(newString[1], "") == 0 ||
|
|
|
- atoi(newString[1]) >= pSysConfig->TotalConnectorCount
|
|
|
- ) {
|
|
|
- printf("index over flow\r\n");
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- _index = atoi(newString[1]);
|
|
|
-
|
|
|
- if (_index == 0) {
|
|
|
- printf("Gun 0 FW Version = %s \n", pSysInfo->Connector1FwRev);
|
|
|
- } else if (_index == 1) {
|
|
|
- printf("Gun 1 FW Version = %s \n", pSysInfo->Connector2FwRev);
|
|
|
- }
|
|
|
- } else if (strcmp(newString[0], "relay") == 0) {
|
|
|
- printf("RB Version = %s \n", pSysInfo->RelayModuleFwRev);
|
|
|
- } else if (strcmp(newString[0], "fan") == 0) {
|
|
|
- printf("FAN Version = %s \n", pSysInfo->FanModuleFwRev);
|
|
|
- } else if (strcmp(newString[0], "dc") == 0) {
|
|
|
- printf("DC Main Version = %s \n", pSysInfo->CsuRootFsFwRev);
|
|
|
- } else if (strcmp(newString[0], "led") == 0) {
|
|
|
- printf("LED Version = %s \n", pSysInfo->LedModuleFwRev);
|
|
|
- } else if (strcmp(newString[0], "ac") == 0) {
|
|
|
- pAcChargingInfo = (struct ChargingInfoData *)GetAcChargingInfoData(0);
|
|
|
-
|
|
|
- printf("AC Version = %s \n", pAcChargingInfo->version);
|
|
|
- } else if (exitCmd() == YES) {
|
|
|
- return;
|
|
|
- } else if (helpCmd() == YES) {
|
|
|
- printf ("%s\n", usageMsg);
|
|
|
- }
|
|
|
-
|
|
|
- }//while
|
|
|
- */
|
|
|
}
|
|
|
|
|
|
void CreateOneError(char *v1)
|
|
@@ -420,18 +498,87 @@ void GetAuthorizeFlag(char *v1)
|
|
|
pSysInfo->AuthorizeFlag = atoi(v1);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
void GetRelayStatus(char *v1)
|
|
|
{
|
|
|
- int _index = atoi(v1);
|
|
|
- //if (!FindChargingInfoData(_index, &_chargingData[0])) {
|
|
|
- // printf("FindChargingInfoData error\n");
|
|
|
- // return;
|
|
|
- //}
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_index);
|
|
|
+ uint8_t _GunIndex = 0;
|
|
|
+ _GunIndex = atoi((char *)newString[1]);
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_GunIndex);
|
|
|
+ if (_GunIndex >= pSysConfig->TotalConnectorCount)
|
|
|
+ _GunIndex = 0;
|
|
|
+ printf("Gun%d RelayK1K2Status = %d \n", _GunIndex,pDcChargingInfo->RelayK1K2Status);
|
|
|
+ //printf("Gun%d RelayKPK2Status = %d \n", _GunIndex,pDcChargingInfo->RelayKPK2Status);
|
|
|
+}
|
|
|
+void SetRelayStatus()
|
|
|
+{
|
|
|
+ uint8_t _GunIndex = 0;
|
|
|
+ int isContinue = 1;
|
|
|
+ uint32_t sleepTime = 500000;
|
|
|
+ uint8_t status = 0;
|
|
|
+ char *usageMsg = "Usage:\n"
|
|
|
+ " set <index> <status>, ex: set 0 1\n"
|
|
|
+ " exit | c | C\n"
|
|
|
+ " help | ? | h\n"
|
|
|
+ "\r\n";
|
|
|
+
|
|
|
+ ShmDcCommonData->pTest.relayflag = YES;
|
|
|
+ printf ("%s\n", usageMsg);
|
|
|
+
|
|
|
+ while (isContinue) {
|
|
|
+ if (readCmdKey(CMD_KEY_WAIT) == NO) {
|
|
|
+ sleep(sleepTime);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (helpCmd() == YES) {
|
|
|
+ printf ("%s\n", usageMsg);
|
|
|
+ continue;
|
|
|
+ } else if (exitCmd() == YES) {
|
|
|
+ ShmDcCommonData->pTest.relayflag = NO;
|
|
|
+ ShmDcCommonData->pGunInfo[0].RelayTest = NO;
|
|
|
+ ShmDcCommonData->pGunInfo[1].RelayTest = NO;
|
|
|
+ sleep(1);
|
|
|
+ return;
|
|
|
+ } else if (strcmp(newString[0], "get") == 0) {
|
|
|
+ GetRelayStatus((char*)newString[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((strcmp(newString[0], "set") != 0) &&
|
|
|
+ (strcmp(newString[1], "-1") == 0 ||
|
|
|
+ strcmp(newString[1], "") == 0)
|
|
|
+ ) {
|
|
|
+ printf("argc 1 is error parameter\r\n");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (strcmp(newString[0], "set") == 0) {
|
|
|
+ if (atoi(newString[2]) > 1 ||
|
|
|
+ atoi(newString[2]) == -1 ) {
|
|
|
+ printf("set value overflow\r\n");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (atoi(newString[2]) < 0 ) {
|
|
|
+ printf("set value underflow\r\n");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ _GunIndex = atoi((char *)newString[1]);
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_GunIndex);
|
|
|
+ if (_GunIndex >= pSysConfig->TotalConnectorCount) {
|
|
|
+ printf("gun index over total connector\r\n");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (strcmp(newString[0], "set") == 0) {//修改relay狀態
|
|
|
+ status = atoi((char *)newString[2]);
|
|
|
+ status ? (ShmDcCommonData->pGunInfo[_GunIndex].RelayTest = YES) : (ShmDcCommonData->pGunInfo[_GunIndex].RelayTest = NO);
|
|
|
+ printf("gun%d relay set %s\n",_GunIndex,ShmDcCommonData->pGunInfo[_GunIndex].RelayTest ? "ON" : "OFF");
|
|
|
+ }
|
|
|
+
|
|
|
+ usleep(sleepTime);
|
|
|
+ }//while
|
|
|
|
|
|
- printf("RelayK1K2Status = %d \n", pDcChargingInfo->RelayK1K2Status);
|
|
|
- printf("RelayKPK2Status = %d \n", pDcChargingInfo->RelayKPK2Status);
|
|
|
}
|
|
|
|
|
|
void FwUpdateFlagProc()
|
|
@@ -439,13 +586,6 @@ void FwUpdateFlagProc()
|
|
|
pSysInfo->FirmwareUpdate = 0x01;
|
|
|
}
|
|
|
|
|
|
-void CheckAcStatus(char *v1)
|
|
|
-{
|
|
|
- if (strcmp(v1, "-1") == 0 || strcmp(v1, "") == 0) {
|
|
|
- printf("AC Status = %d \n", pSysInfo->AcContactorStatus);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
void SetCableChkStatus(char *v1, char *v2)
|
|
|
{
|
|
|
int _index = atoi(v1);
|
|
@@ -502,18 +642,13 @@ void GetSystemInfo()
|
|
|
pSysConfig->ShowInformation = YES;
|
|
|
}
|
|
|
|
|
|
-void ChangeGunNum()
|
|
|
+void ChangeGunstate(char *v1,char *v2)
|
|
|
{
|
|
|
- if (pSysInfo->CurGunSelected + 1 < pSysConfig->TotalConnectorCount) {
|
|
|
- pSysInfo->CurGunSelected += 1;
|
|
|
- pSysInfo->CurGunSelectedByAc = NO_DEFINE;
|
|
|
- } else if (pSysConfig->AcConnectorCount > 0 &&
|
|
|
- pSysInfo->CurGunSelectedByAc == NO_DEFINE) {
|
|
|
- pSysInfo->CurGunSelectedByAc = DEFAULT_AC_INDEX;
|
|
|
- } else {
|
|
|
- pSysInfo->CurGunSelected = 0;
|
|
|
- pSysInfo->CurGunSelectedByAc = NO_DEFINE;
|
|
|
- }
|
|
|
+ int _index = atoi((char*)v1);
|
|
|
+ int status = atoi((char*)v2);
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_index);
|
|
|
+ pDcChargingInfo->SystemStatus = status;
|
|
|
+ printf("Change Gun%d status into %s",_index,GetStatusName(status));
|
|
|
}
|
|
|
|
|
|
void GetGunSelectedNum(char *v1)
|
|
@@ -541,12 +676,16 @@ void GetGunSelectedNum(char *v1)
|
|
|
void SetFanSpeed(char *v1)
|
|
|
{
|
|
|
int speed = atoi(v1);
|
|
|
- if(ShmDcCommonData->debugflag == YES) {
|
|
|
+ if(speed > 0 ) {
|
|
|
+ ShmDcCommonData->pTest.fanflag = YES;
|
|
|
ShmFanModuleData->TestFanSpeed = speed;
|
|
|
printf("Set Fan speed: %d \n",ShmFanModuleData->TestFanSpeed);
|
|
|
}
|
|
|
- else
|
|
|
- printf("Please open debug mode\n");
|
|
|
+ else {
|
|
|
+ ShmFanModuleData->TestFanSpeed = 0;
|
|
|
+ ShmDcCommonData->pTest.fanflag = NO;
|
|
|
+ printf("Close Fan set\n");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void GetFanSpeed()
|
|
@@ -573,15 +712,6 @@ void SetGFDMode(char *v1)
|
|
|
pSysConfig->AlwaysGfdFlag = mode;
|
|
|
}
|
|
|
|
|
|
-void GetPsuTemp()
|
|
|
-{
|
|
|
- for (uint8_t index = 0; index < ShmPsuData->GroupCount; index++) {
|
|
|
- for (uint8_t count = 0; count < ShmPsuData->PsuGroup[index].GroupPresentPsuQuantity; count++) {
|
|
|
- printf("PSU Temp = %d \n", ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
void GetAcInputVol()
|
|
|
{
|
|
|
printf("L1N_L12 = %f, L2N_L23 = %f, L3N_L31 = %f \n",
|
|
@@ -590,91 +720,6 @@ void GetAcInputVol()
|
|
|
pSysInfo->InputVoltageT);
|
|
|
}
|
|
|
|
|
|
-void GetPsuInformation(char *v1, char *v2, char *v3)
|
|
|
-{
|
|
|
- printf("**********************AC Contact needed*************************\n");
|
|
|
- if (strcmp(v1, "count") == 0) {
|
|
|
- for (int i = 0; i < 4; i++) {
|
|
|
- printf("Group Index = %d, Module Count = %d \n",
|
|
|
- i,
|
|
|
- ShmPsuData->PsuGroup[i].GroupPresentPsuQuantity);
|
|
|
- }
|
|
|
- } else if (strcmp(v1, "ver") == 0) {
|
|
|
- for (int i = 0; i < ShmPsuData->SystemPresentPsuQuantity; i++) {
|
|
|
- printf("Psu Index = %d, PriVersion = %s, SecVersion = %s \n",
|
|
|
- i, ShmPsuData->PsuVersion[i].FwPrimaryVersion,
|
|
|
- ShmPsuData->PsuVersion[i].FwSecondVersion);
|
|
|
- }
|
|
|
-
|
|
|
- for (int i = 0; i < ShmPsuData->GroupCount; i++) {
|
|
|
- for (int j = 0; j < ShmPsuData->PsuGroup[i].GroupPresentPsuQuantity; j++) {
|
|
|
- printf("Group Index = %d, Psu Index = %d, Version = %s \n",
|
|
|
- i,
|
|
|
- j,
|
|
|
- ShmPsuData->PsuGroup[i].PsuModule[j].FwVersion);
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (strcmp(v1, "cap") == 0) {
|
|
|
- for (int i = 0; i < ShmPsuData->GroupCount; i++) {
|
|
|
- printf("Group Index = %d, MaxCur = %d, Power = %d \n",
|
|
|
- i,
|
|
|
- ShmPsuData->PsuGroup[i].GroupAvailableCurrent,
|
|
|
- ShmPsuData->PsuGroup[i].GroupAvailablePower);
|
|
|
- }
|
|
|
- } else if (strcmp(v1, "input") == 0) {
|
|
|
- for (int i = 0; i < ShmPsuData->GroupCount; i++) {
|
|
|
- for (uint8_t count = 0; count < ShmPsuData->PsuGroup[i].GroupPresentPsuQuantity; count++) {
|
|
|
- printf("gp = %d, Index = %d, volR = %d, volS = %d, volT = %d \n",
|
|
|
- i,
|
|
|
- count,
|
|
|
- ShmPsuData->PsuGroup[i].PsuModule[count].InputVoltageL1,
|
|
|
- ShmPsuData->PsuGroup[i].PsuModule[count].InputVoltageL2,
|
|
|
- ShmPsuData->PsuGroup[i].PsuModule[count].InputVoltageL3);
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (strcmp(v1, "output") == 0) {
|
|
|
- for (int i = 0; i < ShmPsuData->GroupCount; i++) {
|
|
|
- printf("Group Index = %d, OutputV = %d, OutputC = %d \n",
|
|
|
- i,
|
|
|
- ShmPsuData->PsuGroup[i].GroupPresentOutputVoltage,
|
|
|
- ShmPsuData->PsuGroup[i].GroupPresentOutputCurrent);
|
|
|
- }
|
|
|
-
|
|
|
- for (int i = 0; i < pSysConfig->TotalConnectorCount; i++) {
|
|
|
- //if (!FindChargingInfoData(i, &_chargingData[0])) {
|
|
|
- // printf ("FindChargingInfoData error\n");
|
|
|
- // continue;
|
|
|
- //}
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(i);
|
|
|
-
|
|
|
- printf("Form RB : Group Index = %d, OutputV = %f \n",
|
|
|
- i,
|
|
|
- pDcChargingInfo->FireChargingVoltage);
|
|
|
- }
|
|
|
- } else if (strcmp(v1, "test") == 0) {
|
|
|
- int mode = atoi(v2);
|
|
|
-
|
|
|
- if (mode >= _TEST_MODE && mode <= _TEST_MODE) {
|
|
|
- ShmPsuData->Work_Step = mode;
|
|
|
- }
|
|
|
- } else if (strcmp(v1, "out") == 0) {
|
|
|
- float vol = atof(v2);
|
|
|
- float cur = atof(v3);
|
|
|
-
|
|
|
- if (ShmPsuData->Work_Step >= _TEST_MODE && ShmPsuData->Work_Step <= _TEST_MODE) {
|
|
|
- //if (!FindChargingInfoData(0, &_chargingData[0])) {
|
|
|
- // printf ("FindChargingInfoData error\n");
|
|
|
- // return;
|
|
|
- //}
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(0);
|
|
|
-
|
|
|
- pDcChargingInfo->EvBatterytargetVoltage = vol;
|
|
|
- pDcChargingInfo->EvBatterytargetCurrent = cur;
|
|
|
- }
|
|
|
- }
|
|
|
- printf("*************************************************\n");
|
|
|
-}
|
|
|
-
|
|
|
void GetConnectorCapInfo(char *v1)
|
|
|
{
|
|
|
int _GunIndex = atoi(v1);
|
|
@@ -833,12 +878,14 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
|
|
|
}
|
|
|
//kill ev task
|
|
|
ShmDcCommonData->debugflag = YES;
|
|
|
+ ShmDcCommonData->pTest.chillerflag = NO;
|
|
|
+
|
|
|
system("killall Module_EvComm");
|
|
|
|
|
|
pSysInfo->CurGunSelected = _GunIndex;
|
|
|
|
|
|
while (isContinue) {
|
|
|
-
|
|
|
+ memset(&ShmDcCommonData->pTest,0,sizeof(ShmDcCommonData->pTest));
|
|
|
curGun = pSysInfo->CurGunSelected;
|
|
|
pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(curGun);
|
|
|
if (!pDcChargingInfo->IsAvailable) {
|
|
@@ -852,19 +899,22 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
|
|
|
PreviousSystemStatus[curGun] = pDcChargingInfo->SystemStatus;
|
|
|
ShmDcCommonData->LcmPage = _PAGE_SELECT_PAY;
|
|
|
sleep(3);
|
|
|
-#if defined DD360Audi || SelectGunAction == 1
|
|
|
- setConfirmSelGun(curGun);
|
|
|
-#endif //defined DD360Audi
|
|
|
+ //if (CheckDispenserGeneration() == _DISPENSER_GENERATION_3_5) {
|
|
|
+ setConfirmSelGun(curGun);
|
|
|
+ //}
|
|
|
+
|
|
|
strcpy((char *)pSysConfig->UserId, "AutoStartCharging");
|
|
|
pDcChargingInfo->ConnectorPlugIn = 1;
|
|
|
printf ("[UnconditionalCharge - S_IDLE]\n");
|
|
|
pDcChargingInfo->Type = 9;
|
|
|
+ pDcChargingInfo->StartMethod = _CHARGING_START_AUTOSTART;
|
|
|
sleep(1);
|
|
|
|
|
|
}
|
|
|
if (ShmOCPP16Data->SpMsg.bits.AuthorizeConf == 1) {
|
|
|
pSysInfo->StartToChargingFlag = 0x01;
|
|
|
pDcChargingInfo->SystemStatus = S_PREPARNING;
|
|
|
+ strcpy((char *)pSysConfig->UserId, "");
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -880,10 +930,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
|
|
|
}
|
|
|
//main 會在此階段判斷以下資料跳到下一個 state
|
|
|
//用來得知 AC 是否有搭上 (搭上模組的資訊才會出來) 因為每次 AC_Contactor
|
|
|
- //ShmPsuData->SystemPresentPsuQuantity;
|
|
|
- //ShmPsuData->PsuGroup[gun_index].GroupPresentPsuQuantity;
|
|
|
- //ShmPsuData->PsuGroup[gun_index].GroupAvailablePower;
|
|
|
- //_chargingData[gun_index]->AvailableChargingPower;
|
|
|
|
|
|
//等待 AC Relay 搭上且找到模組 (main 在此 statue 其它 task 會去做完)
|
|
|
//sleep(10);
|
|
@@ -953,15 +999,15 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
|
|
|
|
|
|
//****** 注意~此行為是防止 K1K2 先開導到無法升壓 ( Relay Board 在此 state 還未搭上 K1K2 )
|
|
|
//確定模組己升壓完成
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == 0x01 ||
|
|
|
- pDcChargingInfo->GroundFaultStatus == 0x03) {
|
|
|
+ if (pDcChargingInfo->GroundFaultStatus == GFD_PASS ||
|
|
|
+ pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
printf ("First Ground Fault State (%d)\n",
|
|
|
pDcChargingInfo->GroundFaultStatus);
|
|
|
printf ("Wait K1K2 = %f \n", pDcChargingInfo->PresentChargingVoltage);
|
|
|
sleep(5);
|
|
|
//EV done
|
|
|
pDcChargingInfo->SystemStatus = S_CHARGING;
|
|
|
- } else if (pDcChargingInfo->GroundFaultStatus > 0x02) {
|
|
|
+ } else if (pDcChargingInfo->GroundFaultStatus > GFD_FAIL) {
|
|
|
printf ("First Ground Fault check Fail (%d)\n",
|
|
|
pDcChargingInfo->GroundFaultStatus);
|
|
|
pDcChargingInfo->SystemStatus = S_TERMINATING;
|
|
@@ -976,6 +1022,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
|
|
|
//充電電壓電流
|
|
|
pDcChargingInfo->EvBatterytargetVoltage = _Voltage;
|
|
|
pDcChargingInfo->EvBatterytargetCurrent = _Current;
|
|
|
+ pDcChargingInfo->EvBatteryMaxVoltage = _Voltage * 10;
|
|
|
} else {
|
|
|
_curAutoRunCount = 0;
|
|
|
gettimeofday(&_autoTime, NULL);
|
|
@@ -1070,7 +1117,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
|
|
|
((float)((pDcChargingInfo->PresentChargingVoltage) *
|
|
|
(pDcChargingInfo->PresentChargingCurrent)) / 1000);
|
|
|
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == 0x02) {
|
|
|
+ if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
printf ("Charging Ground Fault check Fail (%d)\n",
|
|
|
pDcChargingInfo->GroundFaultStatus);
|
|
|
pDcChargingInfo->SystemStatus = S_TERMINATING;
|
|
@@ -1229,7 +1276,6 @@ int printTimeMsg(const char *fmt, ...)
|
|
|
va_list args;
|
|
|
struct timeb SeqEndTime;
|
|
|
struct tm *tm;
|
|
|
- struct SysConfigData *pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
|
|
|
|
|
|
va_start(args, fmt);
|
|
|
rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
|
|
@@ -1323,7 +1369,6 @@ static void resdGunAndChillerTemp(void)
|
|
|
}
|
|
|
static void writeOTPTemp(void)
|
|
|
{
|
|
|
- uint8_t _GunIndex = 0;
|
|
|
int isContinue = 1;
|
|
|
uint32_t sleepTime = 500000;
|
|
|
char *usageMsg = "Usage:\n"
|
|
@@ -1373,14 +1418,15 @@ static void writeOTPTemp(void)
|
|
|
|
|
|
void writeChillerStatus(char *v1)
|
|
|
{
|
|
|
- if (ShmDcCommonData->debugflag == YES) {
|
|
|
ShmDcCommonData->chillerCtrl = atoi(newString[1]);
|
|
|
- if (ShmDcCommonData->chillerCtrl)
|
|
|
+ if (ShmDcCommonData->chillerCtrl) {
|
|
|
+ ShmDcCommonData->pTest.chillerflag = YES;
|
|
|
printf("Chiller set on\n");
|
|
|
- else
|
|
|
+ } else {
|
|
|
+ ShmDcCommonData->pTest.chillerflag = NO;
|
|
|
printf("Chiller set off\n");
|
|
|
- } else
|
|
|
- printf("Please open Debug mode\n");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void showNetworkPage(char* v1)
|
|
@@ -1538,16 +1584,8 @@ static void writeGunAndChillerTemp(void)
|
|
|
|
|
|
void setledcolor(int on_off)
|
|
|
{
|
|
|
- if (on_off)
|
|
|
- ShmDcCommonData->pTest.ledflag = TRUE;
|
|
|
- else {
|
|
|
- ShmDcCommonData->pTest.ledflag = FALSE;
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
int isContinue = 1;
|
|
|
uint32_t sleepTime = 500000;
|
|
|
- uint32_t color_value;
|
|
|
char* usageMsg = "Usage:\n"
|
|
|
" r 0~100\n"
|
|
|
" g 0~100\n"
|
|
@@ -1555,7 +1593,8 @@ void setledcolor(int on_off)
|
|
|
" exit | c | C\n"
|
|
|
" help | ? | h\n"
|
|
|
"\r\n";
|
|
|
-
|
|
|
+ printf("%s\n", usageMsg);
|
|
|
+ ShmDcCommonData->pTest.ledflag = TRUE;
|
|
|
while (isContinue) {
|
|
|
if (readCmdKey(CMD_KEY_WAIT) == NO) {
|
|
|
sleep(sleepTime);
|
|
@@ -1627,13 +1666,12 @@ void setlcmtest(char* v1)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- uint8_t _GunIndex = 0;
|
|
|
int isContinue = 1;
|
|
|
uint32_t sleepTime = 500000;
|
|
|
char *usageMsg = "Usage:\n"
|
|
|
"\n ===== main menu =================================="
|
|
|
"\n 1: publish_profile_sample."
|
|
|
- "\n 2: publish_upgrade_sample."
|
|
|
+ "\n 2: upgrade_lcm_sdcard."
|
|
|
"\n 3: publish_restart_sample."
|
|
|
"\n 4: publish_power_saving_sample."
|
|
|
"\n 5: publish_back_dimming_sample."
|
|
@@ -1647,6 +1685,7 @@ void setlcmtest(char* v1)
|
|
|
"\n 13: publish_trigger_report_status."
|
|
|
"\n 14: publish_qr_code_image."
|
|
|
"\n 15: publish_power_saving_wake"
|
|
|
+ "\n 15: upgrade_lcm_apk"
|
|
|
"\n =================================================="
|
|
|
"\n Please input item to test: \n"
|
|
|
" exit | c | C\n"
|
|
@@ -1701,7 +1740,6 @@ void ShowPowerConsumption(char* v1)
|
|
|
}
|
|
|
int main(void)
|
|
|
{
|
|
|
- uint8_t _GunIndex = 0;
|
|
|
int isContinue = 1;
|
|
|
char *usageMsg = "Usage:\n"
|
|
|
" state <index> : get gun state\n"
|
|
@@ -1712,11 +1750,11 @@ int main(void)
|
|
|
" self : self test state (x)\n"
|
|
|
" ver| v | -v : version of board (407 or relay or other)\n"
|
|
|
" update : update firmware\n"
|
|
|
- " ac : get ac relay state (x) \n"
|
|
|
" cable <index> <state> : set ground fault state\n"
|
|
|
" pow <index> <power> : set power value\n"
|
|
|
" model : get system information\n"
|
|
|
- " temp : get PSU temperature\n"
|
|
|
+ " relay : get relay information\n"
|
|
|
+ " setrelay : set relay on/off\n"
|
|
|
" fan <speed> : set fan board speed\n"
|
|
|
" strchg <auto> : auto test charging\n"
|
|
|
" strchg <index> <voltage <current> : select gun test charging\n"
|
|
@@ -1753,17 +1791,10 @@ int main(void)
|
|
|
ShmFanModuleData = (struct FanModuleData *)GetShmFanModuleData();
|
|
|
ShmRelayModuleData = (struct RelayModuleData *)GetShmRelayModuleData();
|
|
|
ShmLedModuleData = (struct LedModuleData *)GetShmLedModuleData();
|
|
|
- ShmPsuData = (struct PsuData *)GetShmPsuData();
|
|
|
ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
|
|
|
ShmSelectGunInfo = (SelectGunInfo *)GetShmSelectGunInfo();
|
|
|
ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
|
|
|
|
|
|
-// for (_GunIndex = 0; _GunIndex < pSysConfig->TotalConnectorCount; _GunIndex++) {
|
|
|
-// pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_GunIndex);
|
|
|
-
|
|
|
-// pDcChargingInfo->SystemStatus = S_IDLE;
|
|
|
-// }
|
|
|
-
|
|
|
while (isContinue) {
|
|
|
|
|
|
if (readCmdKey(CMD_KEY_WAIT) == NO) {
|
|
@@ -1771,13 +1802,8 @@ int main(void)
|
|
|
}
|
|
|
|
|
|
if (strcmp(newString[0], "state") == 0) {
|
|
|
- if (strcmp(newString[1], "-1") == 0 ||
|
|
|
- strcmp(newString[1], "") == 0) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
// 槍狀態
|
|
|
- RunStatusProc(newString[1], newString[2]);
|
|
|
+ RunStatusProc();
|
|
|
} else if (strcmp(newString[0], "card") == 0) {
|
|
|
// 刷卡狀態
|
|
|
RunCardProc(newString[1], newString[2]);
|
|
@@ -1812,9 +1838,6 @@ int main(void)
|
|
|
} else if (strcmp(newString[0], "update") == 0) {
|
|
|
// 更新
|
|
|
FwUpdateFlagProc(newString[1]);
|
|
|
- } else if (strcmp(newString[0], "ac") == 0) {
|
|
|
- // AC contactor 狀態
|
|
|
- CheckAcStatus(newString[1]);
|
|
|
} else if (strcmp(newString[0], "cable") == 0) {
|
|
|
if (strcmp(newString[1], "-1") == 0 || strcmp(newString[1], "") == 0) {
|
|
|
continue;
|
|
@@ -1836,7 +1859,7 @@ int main(void)
|
|
|
GetGunSelectedNum(newString[1]);
|
|
|
} else if (strcmp(newString[0], "change") == 0) {
|
|
|
// 模擬按鈕改變選槍
|
|
|
- ChangeGunNum();
|
|
|
+ ChangeGunstate(newString[1],newString[2]);
|
|
|
} else if (strcmp(newString[0], "fan") == 0) {
|
|
|
// 設定風扇速度
|
|
|
SetFanSpeed(newString[1]);
|
|
@@ -1849,21 +1872,9 @@ int main(void)
|
|
|
} else if (strcmp(newString[0], "gfd") == 0) {
|
|
|
// 設定盲沖使用 GFD 功能
|
|
|
SetGFDMode(newString[1]);
|
|
|
- } else if (strcmp(newString[0], "temp") == 0) {
|
|
|
- // 取得 PSU 溫度
|
|
|
- GetPsuTemp();
|
|
|
} else if (strcmp(newString[0], "acin") == 0) {
|
|
|
// 取得三向輸入電壓
|
|
|
GetAcInputVol();
|
|
|
- } else if (strcmp(newString[0], "psu") == 0) {
|
|
|
- //如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
|
|
|
- if (strcmp(newString[1], "-1") == 0 ||
|
|
|
- strcmp(newString[1], "") == 0) {
|
|
|
- printf ("PSU : Param fail..Please retry again......\n");
|
|
|
- continue;
|
|
|
- }
|
|
|
- // 取得 PSU 資訊
|
|
|
- GetPsuInformation(newString[1], newString[2], newString[3]);
|
|
|
} else if (strcmp(newString[0], "cap") == 0) {
|
|
|
GetConnectorCapInfo(newString[1]);
|
|
|
} else if (strcmp(newString[0], "error") == 0) {
|
|
@@ -1872,6 +1883,8 @@ int main(void)
|
|
|
GetAuthorizeFlag(newString[1]);
|
|
|
} else if (strcmp(newString[0], "relay") == 0) {
|
|
|
GetRelayStatus(newString[1]);
|
|
|
+ } else if (strcmp(newString[0], "setrelay") == 0) {
|
|
|
+ SetRelayStatus(newString[1],newString[2]);
|
|
|
} else if (strcmp(newString[0], "ccid") == 0) {
|
|
|
if (strcmp(newString[1], "-1") == 0 || strcmp(newString[1], "") == 0 ||
|
|
|
strcmp(newString[2], "-1") == 0 || strcmp(newString[2], "") == 0) {
|
|
@@ -1911,7 +1924,7 @@ int main(void)
|
|
|
} else if (strcmp(newString[0], "powerconsumption") == 0) { // Power Consumption
|
|
|
ShowPowerConsumption(newString[1]);
|
|
|
} else if (strcmp(newString[0], "led") == 0) { // LED
|
|
|
- setledcolor(newString[1]);
|
|
|
+ setledcolor(atoi(newString[1]));
|
|
|
} else if (strcmp(newString[0], "l") == 0) {
|
|
|
ShmPrimaryMcuData->InputDet.bits.Button1 = BTN_PRESS;
|
|
|
sleep(1);
|
|
@@ -1921,9 +1934,9 @@ int main(void)
|
|
|
sleep(1);
|
|
|
ShmPrimaryMcuData->InputDet.bits.Button2 = BTN_RELEASE;
|
|
|
} else if (strcmp(newString[0], "c") == 0) {
|
|
|
- ShmPrimaryMcuData->InputDet.bits.Button2 = BTN_PRESS;
|
|
|
+ ShmPrimaryMcuData->InputDet.bits.Key3 = BTN_PRESS;
|
|
|
sleep(1);
|
|
|
- ShmPrimaryMcuData->InputDet.bits.Button2 = BTN_RELEASE;
|
|
|
+ ShmPrimaryMcuData->InputDet.bits.Key3 = BTN_RELEASE;
|
|
|
} else if (strcmp(newString[0], "DcMeter") == 0) {
|
|
|
|
|
|
} else if (strcmp(newString[0], "lcmtest") == 0) {
|