|
@@ -15,12 +15,12 @@
|
|
|
|
|
|
#include <unistd.h>
|
|
|
#include <stdarg.h>
|
|
|
-#include <stdio.h> /*標準輸入輸出定義*/
|
|
|
-#include <stdlib.h> /*標準函數庫定義*/
|
|
|
-#include <unistd.h> /*Unix 標準函數定義*/
|
|
|
-#include <fcntl.h> /*檔控制定義*/
|
|
|
-#include <termios.h> /*PPSIX 終端控制定義*/
|
|
|
-#include <errno.h> /*錯誤號定義*/
|
|
|
+#include <stdio.h>
|
|
|
+#include <stdlib.h>
|
|
|
+#include <unistd.h>
|
|
|
+#include <fcntl.h>
|
|
|
+#include <termios.h>
|
|
|
+#include <errno.h>
|
|
|
#include <errno.h>
|
|
|
#include <string.h>
|
|
|
#include <time.h>
|
|
@@ -264,23 +264,25 @@ int main(int argc, char *argv[])
|
|
|
{
|
|
|
memcpy((char*)SysConfig.ModelName, ShmSysConfigAndInfo->SysConfig.ModelName, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.ModelName));
|
|
|
memcpy((char*)SysConfig.SerialNumber, ShmSysConfigAndInfo->SysConfig.SerialNumber, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber));
|
|
|
+ memcpy((char*)SysConfig.CsuBootLoadFwRev, ShmSysConfigAndInfo->SysConfig.CsuBootLoadFwRev, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.CsuBootLoadFwRev));
|
|
|
|
|
|
DEBUG_INFO("InitShareMemory OK.\n");
|
|
|
}
|
|
|
|
|
|
sprintf((char*)SysConfig.SystemId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
|
|
|
sprintf((char*)SysConfig.SystemDateTime, "%d-%d-%d %d:%d:%d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
|
|
|
- SysConfig.AuthorisationMode = 0; // 0: enable, 1: disable
|
|
|
- SysConfig.DefaultLanguage = 0; // 0:English 1:Big5 2: GB 3: JN 4: Français 5: Italiano 6: Español 7: Deutsch 8: Nederland 9: Norsk 10: Suomalainen 11: Svenska 12: Pусский 13: ไทย
|
|
|
- SysConfig.RfidCardNumEndian = 0; // 0: Little endian 1: Big endian
|
|
|
+ SysConfig.AuthorisationMode = 0; // 0: enable, 1: disable
|
|
|
+ SysConfig.DefaultLanguage = 0; // 0: English 1: Big5 2: GB 3: JN 4: Français 5: Italiano 6: Español 7: Deutsch 8: Nederland 9: Norsk 10: Suomalainen 11: Svenska 12: Pусский 13: ไทย
|
|
|
+ SysConfig.RfidCardNumEndian = 0; // 0: Little endian 1: Big endian
|
|
|
+ SysConfig.BillingData.isBilling = 0; // 0: not for business 1: for business
|
|
|
|
|
|
// Charging configuration
|
|
|
- SysConfig.MaxChargingEnergy = 0; // 0: No limit Other: 1~65536 KWH
|
|
|
- SysConfig.MaxChargingPower = 0; // 0: No limit Other: 1~65536 KW
|
|
|
- SysConfig.MaxChargingCurrent = 0; // 0: Rating value Other: 1~Rating A
|
|
|
- SysConfig.MaxChargingDuration = 0; // 0: No limit Other: 1~65536 Minute
|
|
|
- SysConfig.PhaseLossPolicy = 0; // 0: Charging 1: Stop charging
|
|
|
- SysConfig.AcPhaseCount = 1; // 1: One phase 3: Three phase
|
|
|
+ SysConfig.MaxChargingEnergy = 0; // 0: No limit Other: 1~65536 KWH
|
|
|
+ SysConfig.MaxChargingPower = 0; // 0: No limit Other: 1~65536 KW
|
|
|
+ SysConfig.MaxChargingCurrent = 0; // 0: Rating value Other: 1~Rating A
|
|
|
+ SysConfig.MaxChargingDuration = 0; // 0: No limit Other: 1~65536 Minute
|
|
|
+ SysConfig.PhaseLossPolicy = 0; // 0: Charging 1: Stop charging
|
|
|
+ SysConfig.AcPhaseCount = 1; // 1: One phase 3: Three phase
|
|
|
|
|
|
// Network configuration
|
|
|
strcpy((char*)SysConfig.FtpServer, "");
|
|
@@ -294,26 +296,37 @@ int main(int argc, char *argv[])
|
|
|
strcpy((char*)SysConfig.Eth1Interface.EthSubmaskAddress, "255.255.255.0");
|
|
|
strcpy((char*)SysConfig.Eth1Interface.EthGatewayAddress, "192.168.0.254");
|
|
|
|
|
|
- SysConfig.AthInterface.WifiMode = 2; // 0: Disable 1: Infrastructure client 2: Infrastructure server 3: Ad-Hoc
|
|
|
- SysConfig.AthInterface.WifiRssi = 0; // Wifi rssi value
|
|
|
- SysConfig.AthInterface.WifiDhcpServer = 0; // 0: Enable 1: Disable
|
|
|
- SysConfig.AthInterface.WifiDhcpClient = 0; // 0: Enable 1: Disable
|
|
|
-
|
|
|
- strcpy((char*)SysConfig.TelecomInterface.TelcomApn, "");
|
|
|
- SysConfig.TelecomInterface.TelcomEnabled = 1; //0: disable, 1: enable
|
|
|
- SysConfig.TelecomInterface.TelcomSimStatus = 0; // SIM card status
|
|
|
- SysConfig.TelecomInterface.TelcomModemMode = 0; //0: No services 1: CDMA 2: GSM/GPRS 3: WCDMA 4: GSM/WCDMA 5: TD_SCDMA 6: Unknown
|
|
|
+ // Wifi configuration
|
|
|
+ SysConfig.AthInterface.WifiMode = 2; // 0: Disable 1: Infrastructure client 2: Infrastructure server 3: Ad-Hoc
|
|
|
+ SysConfig.AthInterface.WifiRssi = 0; // Wifi rssi value
|
|
|
+ strcpy((char *) SysConfig.AthInterface.WifiSsid, ""); // default: Null
|
|
|
+ strcpy((char *) SysConfig.AthInterface.WifiPassword, ""); // default: Null
|
|
|
+ SysConfig.AthInterface.WifiDhcpServer = 0; // 0: Enable 1: Disable
|
|
|
+ SysConfig.AthInterface.WifiDhcpClient = 0; // 0: Enable 1: Disable
|
|
|
+ SysConfig.AthInterface.WifiBroadcastSsid = 1; // 0: hidden 1: broadcast
|
|
|
+
|
|
|
+ // Telecom configuration
|
|
|
+ strcpy((char*)SysConfig.TelecomInterface.TelcomApn, ""); // default: Null
|
|
|
+ SysConfig.TelecomInterface.TelcomEnabled = 1; // 0: disable, 1: enable
|
|
|
+ SysConfig.TelecomInterface.TelcomRssi = 0; // default: 0
|
|
|
+ SysConfig.TelecomInterface.TelcomSimStatus = 0; // SIM card status
|
|
|
+ SysConfig.TelecomInterface.TelcomModemMode = 0; // 0: No services 1: CDMA 2: GSM/GPRS 3: WCDMA 4: GSM/WCDMA 5: TD_SCDMA 6: Unknown
|
|
|
+ strcpy((char *) SysConfig.TelecomInterface.TelcomChapPapId, ""); // default: Null
|
|
|
+ strcpy((char *) SysConfig.TelecomInterface.TelcomChapPapPwd, ""); // default: Null
|
|
|
+ strcpy((char *) SysConfig.TelecomInterface.TelcomModemImei, ""); // default: Null
|
|
|
+ strcpy((char *) SysConfig.TelecomInterface.TelcomSimImsi, ""); // default: Null
|
|
|
+ strcpy((char *) SysConfig.TelecomInterface.TelcomSimIccid, ""); // default: Null
|
|
|
|
|
|
// Backend configuration
|
|
|
strcpy((char*)SysConfig.OcppServerURL, "");
|
|
|
sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
|
|
|
- strcpy((char *)SysConfig.chargePointVendor, ""); // default: Null
|
|
|
+ strcpy((char *)SysConfig.chargePointVendor, ""); // default: Null
|
|
|
strcpy((char*)SysConfig.MaintainServerURL, "");
|
|
|
- SysConfig.BackendConnTimeout=300; // 300 seconds
|
|
|
- SysConfig.OfflinePolicy = 2; // 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
|
|
|
- SysConfig.OfflineMaxChargeEnergy = 0; // 0: Same as MaxChargeEnergy Other: 1~65535KWH
|
|
|
- SysConfig.OfflineMaxChargeDuration = 0; // 0: Same as MaxChargeDuration Other: 1~65535 minutes
|
|
|
- //SysConfig.isReqFirstUpgrade = 1; // 0: Skip first upgrade, 1: Process first upgrade
|
|
|
+ SysConfig.BackendConnTimeout=300; // 300 seconds
|
|
|
+ SysConfig.OfflinePolicy = 2; // 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
|
|
|
+ SysConfig.OfflineMaxChargeEnergy = 0; // 0: Same as MaxChargeEnergy Other: 1~65535KWH
|
|
|
+ SysConfig.OfflineMaxChargeDuration = 0; // 0: Same as MaxChargeDuration Other: 1~65535 minutes
|
|
|
+ //SysConfig.isReqFirstUpgrade = 1; // 0: Skip first upgrade, 1: Process first upgrade
|
|
|
|
|
|
// Customization configuration item
|
|
|
if(SysConfig.ModelName[12] == 'P')
|
|
@@ -321,16 +334,16 @@ int main(int argc, char *argv[])
|
|
|
// Phihong standard configuration
|
|
|
strcpy((char*)SysConfig.OcppServerURL, "");
|
|
|
sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
|
|
|
- strcpy((char *)SysConfig.chargePointVendor, ""); // default: Null
|
|
|
+ strcpy((char *)SysConfig.chargePointVendor, ""); // default: Null
|
|
|
strcpy((char*)SysConfig.MaintainServerURL, "wss://ocpp.phihong.com.tw:2013/");
|
|
|
}
|
|
|
else if(SysConfig.ModelName[12] == 'A')
|
|
|
{
|
|
|
// ChargeLab customization configuration
|
|
|
- SysConfig.AuthorisationMode = 0; // 0: enable, 1: disable
|
|
|
- SysConfig.RfidCardNumEndian = 1; // 0: Little endian 1: Big endian
|
|
|
+ SysConfig.AuthorisationMode = 0; // 0: enable, 1: disable
|
|
|
+ SysConfig.RfidCardNumEndian = 1; // 0: Little endian 1: Big endian
|
|
|
|
|
|
- SysConfig.AthInterface.WifiMode = 1; // 0: Disable 1: Infrastructure client 2: Infrastructure server 3: Ad-Hoc
|
|
|
+ SysConfig.AthInterface.WifiMode = 1; // 0: Disable 1: Infrastructure client 2: Infrastructure server 3: Ad-Hoc
|
|
|
strcpy((char*)SysConfig.AthInterface.WifiSsid, "ChargeLab-EVC");
|
|
|
strcpy((char*)SysConfig.AthInterface.WifiPassword, "evc-pwd-default-21");
|
|
|
|
|
@@ -339,15 +352,15 @@ int main(int argc, char *argv[])
|
|
|
strcpy((char*)SysConfig.OcppServerURL, "wss://ocpp.io");
|
|
|
sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
|
|
|
strcpy((char*)SysConfig.chargePointVendor, "ChargeLab");
|
|
|
- SysConfig.OfflinePolicy = 0; // 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
|
|
|
+ SysConfig.OfflinePolicy = 0; // 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
|
|
|
}
|
|
|
else if(SysConfig.ModelName[12] == 'T')
|
|
|
{
|
|
|
// ChargeLab customization configuration
|
|
|
- SysConfig.AuthorisationMode = 0; // 0: enable, 1: disable
|
|
|
- SysConfig.RfidCardNumEndian = 1; // 0: Little endian 1: Big endian
|
|
|
+ SysConfig.AuthorisationMode = 0; // 0: enable, 1: disable
|
|
|
+ SysConfig.RfidCardNumEndian = 1; // 0: Little endian 1: Big endian
|
|
|
|
|
|
- SysConfig.AthInterface.WifiMode = 1; // 0: Disable 1: Infrastructure client 2: Infrastructure server 3: Ad-Hoc
|
|
|
+ SysConfig.AthInterface.WifiMode = 1; // 0: Disable 1: Infrastructure client 2: Infrastructure server 3: Ad-Hoc
|
|
|
strcpy((char*)SysConfig.AthInterface.WifiSsid, "ChargeLab-EVC");
|
|
|
strcpy((char*)SysConfig.AthInterface.WifiPassword, "evc-pwd-default-21");
|
|
|
|
|
@@ -356,7 +369,7 @@ int main(int argc, char *argv[])
|
|
|
strcpy((char*)SysConfig.OcppServerURL, "wss://ocpp.io");
|
|
|
sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
|
|
|
strcpy((char*)SysConfig.chargePointVendor, "ChargeLab");
|
|
|
- SysConfig.OfflinePolicy = 0; // 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
|
|
|
+ SysConfig.OfflinePolicy = 0; // 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
|
|
|
}
|
|
|
else
|
|
|
{
|