|
@@ -2515,10 +2515,10 @@ void ShowCabinetInfo(char *inputCmd, unsigned int opt)
|
|
|
void SetTestControl(char *v1, char *v2)
|
|
|
{
|
|
|
int testItem = 0;
|
|
|
- int testItemLen = 4;
|
|
|
+ int testItemLen = 5;
|
|
|
int enable = 0;
|
|
|
- char strTest[32][32] = {"tbl", "tfsb", "chgsm", "fcre"};
|
|
|
- char strItem[32][32] = {"Balance", "Fast Standby Time", "Charging Simulation", "FCharging Release Extend"};
|
|
|
+ char strTest[32][32] = {"tbl", "tfsb", "chgsm", "fcre", "ubill"};
|
|
|
+ char strItem[32][32] = {"Balance", "Fast Standby Time", "Charging Simulation", "FCharging Release Extend", "Undisposed Bill"};
|
|
|
|
|
|
enable = atoi(v2);
|
|
|
|
|
@@ -3249,30 +3249,50 @@ void EraseWhiteCard(char *v1)
|
|
|
printf("\r\n\r\n");
|
|
|
}
|
|
|
|
|
|
+// MaxChargingProfile: %s
|
|
|
+// Offline MaxPower: %s
|
|
|
+// Max Total Power: XXXX kW, Total Current: XXXX A, MaxSoc: XXX %
|
|
|
+// Total Energy: XXXX kWh, Duration: XXXX Minute(s)
|
|
|
void ShowMaxLimit(void)
|
|
|
{
|
|
|
- printf(" Charger Max ChargingProfile Power: %d kW\r\n", ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower == -1 ?
|
|
|
- (int)ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower : (int)ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower / 1000);
|
|
|
- printf(" Max Total Current: %d A, Max Total Power: %d kW, Total Energy: %d kW, Total Duration %d\r\n",
|
|
|
- ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent, ShmSysConfigAndInfo->SysConfig.MaxChargingPower,
|
|
|
+ char tempString[64];
|
|
|
+
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(tempString, 0x00, sizeof(tempString));
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower == -1)
|
|
|
+ {
|
|
|
+ sprintf(tempString, " %s", "Unlimited");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sprintf(tempString, " %4d kW", (int)ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower / 1000);
|
|
|
+ }
|
|
|
+ printf(" MaxChargingProfile: %s\r\n", tempString);
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(tempString, 0x00, sizeof(tempString));
|
|
|
+ if(ShmChargerInfo->OutputLimit.Offline_MaxChargingPower <= 0)
|
|
|
+ {
|
|
|
+ sprintf(tempString, " %s", "Unlimited");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sprintf(tempString, " %4d kW", ShmChargerInfo->OutputLimit.Offline_MaxChargingPower / 1000);
|
|
|
+ }
|
|
|
+ printf(" Offline MaxPower: %s\r\n", tempString);
|
|
|
+ //************************************************************************************************
|
|
|
+ printf(" Max Total Power: %4d kW, Total Current: %4d A, MaxSoc: %3d %%\r\n",
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingPower,
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent,
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingSoc);
|
|
|
+ //************************************************************************************************
|
|
|
+ printf(" Total Energy: %4d kWh, Duration: %4d Minute(s)\r\n",
|
|
|
ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy, ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
|
|
|
}
|
|
|
|
|
|
void ShowGunLimit(int gun_index)
|
|
|
{
|
|
|
- int limitPower = -1;
|
|
|
char *str_gun_type[] = {STR_GUN_TYPE_CHADEMO, STR_GUN_TYPE_CCS, STR_GUN_TYPE_GBT};
|
|
|
|
|
|
- unsigned char inUsingCnt = 0;
|
|
|
-
|
|
|
- for(int i = 0; i < GENERAL_GUN_QUANTITY; i++)
|
|
|
- {
|
|
|
- if(ShmChargerInfo->PsuGrouping.GroupCollection[i].Role == _GROLE_MASTER)
|
|
|
- {
|
|
|
- inUsingCnt += ShmChargerInfo->PsuGrouping.GroupCollection[gun_index].GunPsuQuantity;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// Gun Enable Type Psu Phy_Vol Phy_Cur Config_Ocpp_MaxOcpp_Pow Config_Ocpp_MaxOcpp_Cur
|
|
|
// 1 0 CHAdeMO 00 0000 V 0000 A 0000 / 0000 / 0000 kW 0000 / 0000 A
|
|
|
// Gun 1 Enable, Type: CCS, Psu Cnt: 00, Max Physical Vol: 0000 V, Cur: 0000 A, Max Config Pow: 0000 kW, Cur: 0000 A
|
|
@@ -3286,22 +3306,10 @@ void ShowGunLimit(int gun_index)
|
|
|
(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].RemoteMaxPhysicalVoltage / 10),
|
|
|
(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].RemoteMaxPhysicalCurrent / 10));
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower != -1)
|
|
|
- {
|
|
|
- limitPower = (int)ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower;
|
|
|
- if(inUsingCnt > 0)
|
|
|
- {
|
|
|
- limitPower = (limitPower * ShmChargerInfo->PsuGrouping.GroupCollection[gun_index].GunPsuQuantity) / inUsingCnt;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- limitPower = -1;
|
|
|
- }
|
|
|
printf(" %4d / %4d / %4d kW",
|
|
|
(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].MaxTotalChargingPower / 10),
|
|
|
_chargingData[gun_index]->ChargingProfilePower == -1 ? (int)_chargingData[gun_index]->ChargingProfilePower : ((int)_chargingData[gun_index]->ChargingProfilePower / 1000),
|
|
|
- limitPower == -1 ? limitPower : (limitPower / 1000));
|
|
|
+ ShmChargerInfo->OutputLimit.GunMaxProfilePower[gun_index] == 0 ? (int)ShmSysConfigAndInfo->SysInfo.MaxChargingProfilePower : (ShmChargerInfo->OutputLimit.GunMaxProfilePower[gun_index] / 1000));
|
|
|
|
|
|
printf(" %4d / %4d A",
|
|
|
((int)ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].MaxTotalChargingCurrent / 10),
|
|
@@ -3331,7 +3339,7 @@ void ShowChargerLimit(char *inputCmd, unsigned int opt)
|
|
|
{
|
|
|
if(reflash)
|
|
|
{
|
|
|
- ConsoleReflash(1, 4);
|
|
|
+ ConsoleReflash(1, 6);
|
|
|
ConsoleReflash(CONNECTOR_QUANTITY, 1);
|
|
|
}
|
|
|
|
|
@@ -3483,32 +3491,154 @@ void ShowWebChargingInfo(void)
|
|
|
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(" *Max Charging Soc : %4d %%\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingSoc);
|
|
|
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)
|
|
|
+// *DHCP Client [Enable]
|
|
|
+// - MAC Add [%s]
|
|
|
+// - IP Add [%s]
|
|
|
+// - Submask [%s]
|
|
|
+// - Gateway [%s]
|
|
|
+void ShowEthernetInfo(void)
|
|
|
+{
|
|
|
+ printf(" *DHCP Client [%s]\r\n", ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient == 0 ? "Enable" : "Disable");
|
|
|
+ printf(" - MAC Add [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress : "NULL");
|
|
|
+ printf(" - IP Add [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress : "NULL");
|
|
|
+ printf(" - SubMask [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress : "NULL");
|
|
|
+ printf(" - Gateway [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress : "NULL");
|
|
|
+}
|
|
|
+
|
|
|
+// *WiFi Mode [Station]
|
|
|
+// - SSID [%s]
|
|
|
+// - PWD [%s]
|
|
|
+// - TargetMac [%s]
|
|
|
+// - RSSI [%s]
|
|
|
+// - DHCP [%s]
|
|
|
+// - MAC Add [%s]
|
|
|
+// - IP Add [%s]
|
|
|
+// - Submask [%s]
|
|
|
+// - Gateway [%s]
|
|
|
+// - ConnStatus [Connected]
|
|
|
+void ShowWiFiInfo(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]);
|
|
|
+ printf(" *WiFi Mode [%s]\r\n", str_wifi_mode[ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- printf(" *WiFi Mode [%d]\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
|
|
|
+ printf(" *WiFi Mode [%d]\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
|
|
|
+ }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == _SYS_WIFI_MODE_STATION)
|
|
|
+ {
|
|
|
+ printf(" - SSID [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid : "NULL");
|
|
|
+ printf(" - PWD [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword : "NULL");
|
|
|
+ printf(" - TargetMac [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac : "NULL");
|
|
|
+ printf(" - RSSI [%d dBm]\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
|
|
|
+ printf(" - DHCP [%s]\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient == 0 ? "Enable" : "Disable");
|
|
|
+ printf(" - MAC Add [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress : "NULL");
|
|
|
+ printf(" - IP Add [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress : "NULL");
|
|
|
+ printf(" - SubMask [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress : "NULL");
|
|
|
+ printf(" - Gateway [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress : "NULL");
|
|
|
+ printf(" - ConnStatus [%s]\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn == YES ? "Connected" : "Disconnected");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// *3G/4G Mode [%s]
|
|
|
+// - APN [%s]
|
|
|
+// - NetworkType[%s]
|
|
|
+// - RSSI [%d dBm]
|
|
|
+// - ChapPapId [%s]
|
|
|
+// - ChapPapPwd [%s]
|
|
|
+// - Modem IMEI [%s]
|
|
|
+// - SIM IMSI [%s]
|
|
|
+// - SIM ICCID [%s]
|
|
|
+// - SIM Status [%s]
|
|
|
+// - Modem Mode [%s]
|
|
|
+// - IP Add [%s]
|
|
|
+// - ConnStatus [%s]
|
|
|
+void Show3G4GInfo(void)
|
|
|
+{
|
|
|
+ char *strNetworkType[] = {"Auto", "CDMA", "WCDMA", "LTE", "TD-SCDMA", "UMTS", "CDMA", "HDR", "CDMA/HDR"};
|
|
|
+ char *strSimStatus[] = {"No SIM Card", "Valid SIM Card", "Invalid SIM Card"};
|
|
|
+ char *strModemMode[] = {"No Services", "CDMA", "GSM/GPRS", "WCDMA", "GSM/WCDMA", "TD_SCDMA", "HSPA", "LTE", "Mode 8", "Unknown"};
|
|
|
+
|
|
|
+ printf(" *3G/4G Mode [%s]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled == YES ? "Enable" : "Disable");
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled == YES)
|
|
|
+ {
|
|
|
+ printf(" - APN [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn : "NULL");
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType <= 8)
|
|
|
+ {
|
|
|
+ printf(" - NetworkType[%s]\r\n", strNetworkType[ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" - NetworkType[%d]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType);
|
|
|
+ }
|
|
|
+ printf(" - RSSI [%d dBm]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
|
|
|
+ printf(" - ChapPapId [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId : "NULL");
|
|
|
+ printf(" - ChapPapPwd [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd : "NULL");
|
|
|
+ printf(" - Modem IMEI [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei : "NULL");
|
|
|
+ printf(" - SIM IMSI [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi : "NULL");
|
|
|
+ printf(" - SIM ICCID [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid : "NULL");
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus <= 2)
|
|
|
+ {
|
|
|
+ printf(" - SIM Status [%s]\r\n", strSimStatus[ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" - SIM Status [%d]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus);
|
|
|
+ }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode <= 9)
|
|
|
+ {
|
|
|
+ printf(" - Modem Mode [%s]\r\n", strModemMode[ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf(" - Modem Mode [%d]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode);
|
|
|
+ }
|
|
|
+ printf(" - IP Add [%s]\r\n", strlen((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress) > 0 ? (char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress : "NULL");
|
|
|
+ printf(" - ConnStatus [%s]\r\n", ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn == YES ? "Connected" : "Disconnected");
|
|
|
}
|
|
|
- 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 ShowWebNetworkInfo(void)
|
|
|
+{
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [Network]\r\n");
|
|
|
+ printf(" *NetworkStatus[%s]\r\n", ShmSysConfigAndInfo->SysInfo.InternetConn > 0 ? "Connected" : "Disconnected");
|
|
|
+ ShowEthernetInfo();
|
|
|
+ ShowWiFiInfo();
|
|
|
+ Show3G4GInfo();
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWebEthernetOnly(void)
|
|
|
+{
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [Network]\r\n");
|
|
|
+ printf(" *NetworkStatus[%s]\r\n", ShmSysConfigAndInfo->SysInfo.InternetConn > 0 ? "Connected" : "Disconnected");
|
|
|
+ ShowEthernetInfo();
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWebWiFiOnly(void)
|
|
|
+{
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [Network]\r\n");
|
|
|
+ printf(" *NetworkStatus[%s]\r\n", ShmSysConfigAndInfo->SysInfo.InternetConn > 0 ? "Connected" : "Disconnected");
|
|
|
+ ShowWiFiInfo();
|
|
|
+}
|
|
|
+
|
|
|
+void ShowWeb3G4GOnly(void)
|
|
|
+{
|
|
|
+ printf("\r\n");
|
|
|
+ printf("Web [Network]\r\n");
|
|
|
+ printf(" *NetworkStatus[%s]\r\n", ShmSysConfigAndInfo->SysInfo.InternetConn > 0 ? "Connected" : "Disconnected");
|
|
|
+ Show3G4GInfo();
|
|
|
}
|
|
|
|
|
|
void ShowWebBackendInfo(void)
|
|
@@ -3594,9 +3724,11 @@ void ShowWebInfo(char *inputCmd, unsigned int opt)
|
|
|
|
|
|
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};
|
|
|
+ int itemLen = 8;
|
|
|
+ char strItem[32][32] = {"system", "charging", "network", "backend", "all", "eth", "wifi", "4g"};
|
|
|
+ void *actionList[32] = {
|
|
|
+ &ShowWebSystemInfo, &ShowWebChargingInfo, &ShowWebNetworkInfo, &ShowWebBackendInfo,
|
|
|
+ &ShowWebAllInfo, &ShowWebEthernetOnly, &ShowWebWiFiOnly, &ShowWeb3G4GOnly};
|
|
|
void (*ItemAction)();
|
|
|
|
|
|
for(showItem = 0; showItem < itemLen; showItem++)
|
|
@@ -3632,6 +3764,13 @@ void ShowWebInfo(char *inputCmd, unsigned int opt)
|
|
|
// Start: [0000-00-00 00:00:00] PSU: XXXX V, XXXX A, Limit: XXXX A, XXXX kW, Local: XXXXXXX.XXX kWh
|
|
|
// Gun: XXXX V, XXXX A, Remote: XXXXXXX.XXX kWh, Meter: XXXXXXX.XXX kWh
|
|
|
// Stop: [0000-00-00 00:00:00] Gun: XXXX V, XXXX A, Remote: XXXXXXX.XXX kWh, Meter: XXXXXXX.XXX kWh
|
|
|
+
|
|
|
+// Gun 1 ( CCS ) Soc: XXX %, Energy: XXXXXXX.XXX kWh, IdTag: [XXXXXXXXXX]
|
|
|
+// (XX) (X) Target: XXXX V, XXXX A, Cap: XXXX A, XXXX kW, TxId: [XXXXXXXXXX]
|
|
|
+// Start: [0000-00-00 00:00:00] PSU: XXXX V, XXXX A, Limit: XXXX A, XXXX kW, Ratio: X.XX %
|
|
|
+// Stop: [0000-00-00 00:00:00] Gun: XXXX V, XXXX A, Power: XXXX.X kW, FireV: XXXX.X V
|
|
|
+// Remote: XXXXXXX.XXX kWh, Local: XXXXXXX.XXX kWh, Meter: XXXXXXX.XXX kWh
|
|
|
+
|
|
|
void ShowGunInfo(int gun)
|
|
|
{
|
|
|
char *str_gun_type[] = {"CHAdeMO", " CCS ", " GBT "};
|
|
@@ -3683,12 +3822,12 @@ void ShowGunInfo(int gun)
|
|
|
{
|
|
|
printf(" ");
|
|
|
}
|
|
|
- printf("PSU: %4d V, %4d A, Limit: %4d A, %4d kW, Local: %11.3f kWh\r\n",
|
|
|
+ printf("PSU: %4d V, %4d A, Limit: %4d A, %4d kW, Ratio: %4.2f %%\r\n",
|
|
|
(int)(_chargingData[gun]->PresentChargingVoltage),
|
|
|
(int)(_chargingData[gun]->PresentChargingCurrent),
|
|
|
(int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].CapabilityCurrent / 10),
|
|
|
(int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].CapabilityPower / 10),
|
|
|
- ShmChargerInfo->MeterValue[gun].LocalConsumption);
|
|
|
+ ShmPsuGrouping->GroupCollection[gun].MaxOutputRatio);
|
|
|
//************************************************************************************************
|
|
|
if(strlen(ShmChargerInfo->Timestamp[gun].StopCharging) > 0)
|
|
|
{
|
|
@@ -3698,10 +3837,16 @@ void ShowGunInfo(int gun)
|
|
|
{
|
|
|
printf(" ");
|
|
|
}
|
|
|
- printf("Gun: %4d V, %4d A, Remote: %11.3f kWh, Meter: %11.3f kWh\r\n",
|
|
|
+ printf("Gun: %4d V, %4d A, Power: %6.1f kW, FireV: %6.1f V\r\n",
|
|
|
(int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].RemoteChargingVoltage / 10),
|
|
|
(int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].RemoteChargingCurrent / 10),
|
|
|
- ShmChargerInfo->MeterValue[gun].GunConsumption, _chargingData[gun]->PowerConsumption);
|
|
|
+ _chargingData[gun]->PresentChargingPower,
|
|
|
+ (_chargingData[gun]->FireChargingVoltage / 10));
|
|
|
+ //************************************************************************************************
|
|
|
+ printf(" Remote: %11.3f kWh, Local: %11.3f kWh, Meter: %11.3f kWh\r\n",
|
|
|
+ ShmChargerInfo->MeterValue[gun].GunConsumption,
|
|
|
+ ShmChargerInfo->MeterValue[gun].LocalConsumption,
|
|
|
+ _chargingData[gun]->PowerConsumption);
|
|
|
}
|
|
|
|
|
|
void ShowInfo(char *inputCmd, unsigned int opt)
|
|
@@ -3723,7 +3868,7 @@ void ShowInfo(char *inputCmd, unsigned int opt)
|
|
|
{
|
|
|
if(reflash)
|
|
|
{
|
|
|
- ConsoleReflash(CONNECTOR_QUANTITY, 5);
|
|
|
+ ConsoleReflash(CONNECTOR_QUANTITY, 6);
|
|
|
}
|
|
|
|
|
|
for(int i = 0; i < GENERAL_GUN_QUANTITY; i++)
|
|
@@ -4395,6 +4540,96 @@ bool SetLEDIntensity(char *intensity)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+bool SetMaxChargingEnergy(char *energy)
|
|
|
+{
|
|
|
+ int _energy = 0;
|
|
|
+
|
|
|
+ _energy = atoi(energy);
|
|
|
+
|
|
|
+ if(_energy < 0)
|
|
|
+ {
|
|
|
+ printf("MaxChargingEnergy: [%s] is Illegal\r\n", energy);
|
|
|
+ printf(" [value] > 0\r\n");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = _energy;
|
|
|
+ printf("Set MaxChargingEnergy: [%d] OK\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetMaxChargingPower(char *power)
|
|
|
+{
|
|
|
+ int _power = 0;
|
|
|
+
|
|
|
+ _power = atoi(power);
|
|
|
+
|
|
|
+ if(_power < 0)
|
|
|
+ {
|
|
|
+ printf("MaxChargingEnergy: [%s] is Illegal\r\n", power);
|
|
|
+ printf(" [value] > 0\r\n");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingPower = _power;
|
|
|
+ printf("Set MaxChargingPower: [%d] OK\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetMaxChargingCurrent(char *current)
|
|
|
+{
|
|
|
+ int _current = 0;
|
|
|
+
|
|
|
+ _current = atoi(current);
|
|
|
+
|
|
|
+ if(_current < 0)
|
|
|
+ {
|
|
|
+ printf("MaxChargingEnergy: [%s] is Illegal\r\n", current);
|
|
|
+ printf(" [value] > 0\r\n");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = _current;
|
|
|
+ printf("Set MaxChargingCurrent: [%d] OK\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetMaxChargingDuration(char *duration)
|
|
|
+{
|
|
|
+ int _duration = 0;
|
|
|
+
|
|
|
+ _duration = atoi(duration);
|
|
|
+
|
|
|
+ if(_duration < 0)
|
|
|
+ {
|
|
|
+ printf("MaxChargingDuration: [%s] is Illegal\r\n", duration);
|
|
|
+ printf(" [value] > 0\r\n");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = _duration;
|
|
|
+ printf("Set MaxChargingDuration: [%d] OK\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetMaxChargingSoc(char *soc)
|
|
|
+{
|
|
|
+ int _soc = 0;
|
|
|
+
|
|
|
+ _soc = atoi(soc);
|
|
|
+
|
|
|
+ if(_soc < 0 || _soc > 100)
|
|
|
+ {
|
|
|
+ printf("MaxChargingSoc: [%s] is Illegal\r\n", soc);
|
|
|
+ printf(" [value] 0 ~ 100\r\n");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingSoc = _soc;
|
|
|
+ printf("Set MaxChargingSoc: [%d] OK\r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingSoc);
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
bool SetStopChargingByButton(char *btn)
|
|
|
{
|
|
|
bool enable = false;
|
|
@@ -4559,15 +4794,17 @@ void FlashSetCmd(char *inputCmd, unsigned int opt)
|
|
|
bool find = false;
|
|
|
int actIndex = 0;
|
|
|
|
|
|
- int maxLen = 15;
|
|
|
+ int maxLen = 20;
|
|
|
char strWriteItem[32][32] = {
|
|
|
"model", "sn", "sysid", "auth", "evccid", "qrmode", "qrcode", "led",
|
|
|
- "stopbtn", "policy", "backend", "boxid", "vendor", "receipt", "maintain"};
|
|
|
+ "energy", "power", "current", "time", "soc", "stopbtn", "policy", "backend",
|
|
|
+ "boxid", "vendor", "receipt", "maintain"};
|
|
|
bool (*writeFlashList[32])(char *) = {
|
|
|
&SetModelName, &SetSerialNumber, &SetSystemID, &SetAuthorisationMode,
|
|
|
&SetAuthrizeByEVCCID, &SetQRCodeMadeMode, &SetQRCodeContent, &SetLEDIntensity,
|
|
|
- &SetStopChargingByButton, &SetOfflinePolicy, &SetOcppServerURL, &SetChargeBoxId,
|
|
|
- &SetChargePointVendor, &SetOcppReceiptrURL, &SetMaintainServerURL};
|
|
|
+ &SetMaxChargingEnergy, &SetMaxChargingPower, &SetMaxChargingCurrent, &SetMaxChargingDuration,
|
|
|
+ &SetMaxChargingSoc, &SetStopChargingByButton, &SetOfflinePolicy, &SetOcppServerURL,
|
|
|
+ &SetChargeBoxId, &SetChargePointVendor, &SetOcppReceiptrURL, &SetMaintainServerURL};
|
|
|
|
|
|
bool (*WriteFlashAct)(char *);
|
|
|
|
|
@@ -5038,6 +5275,146 @@ void RelayCmd(char *inputCmd, unsigned int opt)
|
|
|
printf("Input cmd fail ------ relay [abnormal | write | read | autotest] [...]\r\n\r\n");
|
|
|
}
|
|
|
|
|
|
+// Sys CurrentRate: [XX.XX]
|
|
|
+// TimeOfDayPrice: [00-01: XX.XX] [01-02: XX.XX] [02-03: XX.XX] [03-04: XX.XX] [04-05: XX.XX] [05-06: XX.XX]
|
|
|
+// : [06-07: XX.XX] [07-08: XX.XX] [08-09: XX.XX] [09-10: XX.XX] [10-11: XX.XX] [11-12: XX.XX]
|
|
|
+// : [12-13: XX.XX] [13-14: XX.XX] [14-15: XX.XX] [15-16: XX.XX] [16-17: XX.XX] [17-18: XX.XX]
|
|
|
+// : [18-19: XX.XX] [19-20: XX.XX] [20-21: XX.XX] [21-22: XX.XX] [22-23: XX.XX] [23-24: XX.XX]
|
|
|
+int ShowSysPriceInfo(void)
|
|
|
+{
|
|
|
+ int showLine = 1;
|
|
|
+ char priceString[1024];
|
|
|
+
|
|
|
+ //************************************************************************************************
|
|
|
+ printf(" Sys CurrentRate: [%5.2f]\r\n", ShmChargerInfo->PriceAndReceiptInfo.CurrentRate);
|
|
|
+
|
|
|
+ if(ShmChargerInfo->Control.CustomerCode == _CUSTOMER_CODE_TCC)
|
|
|
+ {
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(priceString, 0x00, sizeof(priceString));
|
|
|
+ for(int i = 0; i < 6; i++)
|
|
|
+ {
|
|
|
+ char strTemp[64];
|
|
|
+ sprintf(strTemp, " [%02d-%02d: %5.2f]", i, i + 1, ShmChargerInfo->PriceAndReceiptInfo.TimeOfDayPricing[i]);
|
|
|
+ strcat(priceString, strTemp);
|
|
|
+ }
|
|
|
+ printf(" TimeOfDayPrice:%s\r\n", priceString);
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(priceString, 0x00, sizeof(priceString));
|
|
|
+ for(int i = 6; i < 12; i++)
|
|
|
+ {
|
|
|
+ char strTemp[64];
|
|
|
+ sprintf(strTemp, " [%02d-%02d: %5.2f]", i, i + 1, ShmChargerInfo->PriceAndReceiptInfo.TimeOfDayPricing[i]);
|
|
|
+ strcat(priceString, strTemp);
|
|
|
+ }
|
|
|
+ printf(" :%s\r\n", priceString);
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(priceString, 0x00, sizeof(priceString));
|
|
|
+ for(int i = 12; i < 18; i++)
|
|
|
+ {
|
|
|
+ char strTemp[64];
|
|
|
+ sprintf(strTemp, " [%02d-%02d: %5.2f]", i, i + 1, ShmChargerInfo->PriceAndReceiptInfo.TimeOfDayPricing[i]);
|
|
|
+ strcat(priceString, strTemp);
|
|
|
+ }
|
|
|
+ printf(" :%s\r\n", priceString);
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(priceString, 0x00, sizeof(priceString));
|
|
|
+ for(int i = 18; i < 24; i++)
|
|
|
+ {
|
|
|
+ char strTemp[64];
|
|
|
+ sprintf(strTemp, " [%02d-%02d: %5.2f]", i, i + 1, ShmChargerInfo->PriceAndReceiptInfo.TimeOfDayPricing[i]);
|
|
|
+ strcat(priceString, strTemp);
|
|
|
+ }
|
|
|
+ printf(" :%s\r\n", priceString);
|
|
|
+ showLine += 4;
|
|
|
+ }
|
|
|
+ return showLine;
|
|
|
+}
|
|
|
+
|
|
|
+// Gun X UserPrice: [%s]
|
|
|
+// Receipt: [%s]
|
|
|
+int ShowGunPriceInfo(int gun)
|
|
|
+{
|
|
|
+ int showLine = 2;
|
|
|
+ char priceString[1024];
|
|
|
+
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(priceString, 0x00, sizeof(priceString));
|
|
|
+ if(strlen(&ShmChargerInfo->PriceAndReceiptInfo.UserPriceString[gun][0]) > 0)
|
|
|
+ {
|
|
|
+ strcpy(priceString, &ShmChargerInfo->PriceAndReceiptInfo.UserPriceString[gun][0]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy(priceString, "NULL");
|
|
|
+ }
|
|
|
+ printf(" Gun %d UserPrice: [%s]\r\n", gun + 1, priceString);
|
|
|
+
|
|
|
+ //************************************************************************************************
|
|
|
+ memset(priceString, 0x00, sizeof(priceString));
|
|
|
+ if(strlen(&ShmChargerInfo->PriceAndReceiptInfo.ReceiptUrl[gun][0]) > 0)
|
|
|
+ {
|
|
|
+ strcpy(priceString, &ShmChargerInfo->PriceAndReceiptInfo.ReceiptUrl[gun][0]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy(priceString, "NULL");
|
|
|
+ }
|
|
|
+ printf(" Receipt: [%s]\r\n", priceString);
|
|
|
+
|
|
|
+ return showLine;
|
|
|
+}
|
|
|
+
|
|
|
+void ShowPrice(char *inputCmd, unsigned int opt)
|
|
|
+{
|
|
|
+ int totalLine = 0;
|
|
|
+ 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(1, totalLine);
|
|
|
+ }
|
|
|
+
|
|
|
+ totalLine = 0;
|
|
|
+ printf("\r\n");
|
|
|
+ totalLine += ShowSysPriceInfo() + 1;
|
|
|
+ printf("\r\n");
|
|
|
+ totalLine += 1;
|
|
|
+
|
|
|
+ for(int i = 0; i < GENERAL_GUN_QUANTITY; i++)
|
|
|
+ {
|
|
|
+ totalLine += ShowGunPriceInfo(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][MAX_SUB_CMD_LENGTH];
|
|
@@ -5467,6 +5844,10 @@ int main(void)
|
|
|
else if(strcmp(mainCmd, "relay") == 0)
|
|
|
{
|
|
|
RelayCmd(subCmd, option);
|
|
|
+ }
|
|
|
+ else if(strcmp(mainCmd, "price") == 0)
|
|
|
+ {
|
|
|
+ ShowPrice(subCmd, option);
|
|
|
}
|
|
|
else
|
|
|
{
|