Эх сурвалжийг харах

[Add][Modularization][Module_OcppBackend / WWW]

2022.09.05 / Folus Wen

Actions:
1. Webpage add security profile-3 option item.
2. Module_OcppBackend add 15118 message and logic with DataTransafer.

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
Folus Wen 2 жил өмнө
parent
commit
5787d10f9f

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 576 - 77
EVSE/Modularization/ocppfiles/MessageHandler.c


+ 1 - 0
EVSE/Modularization/ocppfiles/MessageHandler.h

@@ -418,6 +418,7 @@ enum GetConfigurationKey {
 	GetConfiguration_MaxChargingProfilesInstalled,
 	GetConfiguration_ConfigurationVersion,
 	GetConfiguration_CharingProfileRefreshInterval,
+	GetConfiguration_CpoName,
 	GetConfiguration_OcppSoftwareVersion,
 	_GetConfiguration_CNT
 };

+ 15 - 1
EVSE/Modularization/ocppfiles/Module_OcppBackend.h

@@ -49,6 +49,20 @@
 #include    "SystemLogMessage.h"
 #include    "MessageHandler.h"
 
+#define		ROOTCA_CS				"/Storage/OCPP/rootCaCs.pem"						// for verify connect wss
+#define		ROOTCA_MFG				"/Storage/OCPP/rootCaMfg.pem"						// for verify signedUpdateFirmware
+#define		ROOTCA_V2G				"/Storage/OCPP/rootCaV2g.pem"						// for 15118
+#define		ROOTCA_MO				"/Storage/OCPP/rootCaMo.pem"						// for 15118
+
+#define		CERTIFICATE_CP			"/Storage/OCPP/certCP.pem"							// for security profile 3
+#define		CERTIFICATE_V2G			"/Storage/OCPP/certV2G.pem"							// for 15118
+
+#define		PRIVATE_KEY_CP			"/Storage/OCPP/certCP.key"							// for security profile 3
+#define		PRIVATE_KEY_V2G			"/Storage/OCPP/certV2G.key"							// for 15118
+
+#define		CSR_CP					"/Storage/OCPP/certCP.csr"							// for get CERTIFICATE_CP
+#define		CSR_V2G					"/Storage/OCPP/certV2G.csr"							// for get CERTIFICATE_V2G
+
 #define is_error(ptr) 				((unsigned long)ptr > (unsigned long)-4000L)
 #define PASS						1
 #define FAIL						-1
@@ -129,8 +143,8 @@ extern int GetOcppConnStatus(void);
 extern void SetOcppConnStatus(uint8_t status);
 extern int GetHeartBeatWithNOResponse(void);
 extern void SetHeartBeatWithNOResponse(void);
-extern uint8_t GetOcppSecurityProfile();
 extern void MergeCertificates();
+extern uint8_t GetOcppSecurityProfile();
 extern void GetOcppChargerBoxId(uint8_t *data);
 extern void GetOcppSecurityPassword(uint8_t *data);
 extern void SetOcppVersion(uint8_t *version);

+ 280 - 257
EVSE/Projects/define.h

@@ -345,6 +345,7 @@ enum CoreProfile {
      OffLineMaxChargingPower,
      ConfigurationVersion,
 	 CharingProfileRefreshInterval,
+	 CpoName,
 	 OcppSoftwareVersion,
 	 _CoreProfile_CNT
 };
@@ -4422,9 +4423,9 @@ struct StructDataTransfer
 {
 	unsigned char VendorId[256];
 	unsigned char MessageId[52];
-	unsigned char Data[512];
+	unsigned char Data[10240];
 	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[512];
+	unsigned char ResponseData[10240];
 };
 struct StructDiagnosticsStatusNotification
 {
@@ -4733,261 +4734,6 @@ struct StructSessionTarget
     unsigned short      targetDuration;     // Unit: Minutes    0 is unlimit
 };
 
-//===================================
-// YES custom protocol
-//===================================
-struct StructChargerInfo
-{
-    unsigned char station_name[64];
-};
-
-struct StructWeatherInfo
-{
-    int   weatherId;
-    float temperature;
-};
-
-struct StructCreditDeductResult
-{
-    int txId;
-    unsigned char creditNo[64];
-    unsigned char vemData[80];
-    unsigned char ROC[20];
-    unsigned char RRN[20];
-    unsigned char storeId[20];
-    unsigned char approvalNo[20];
-    double        amount;
-    unsigned char deductResult:1;
-    unsigned char isDonateInvoice:1;
-};
-
-struct StructReaderStatus
-{
-    int readerStatus;
-    unsigned char creditNo[64];
-    unsigned char ReportReaderStatusReq:1;
-};
-
-struct StructTcciCustomData
-{
-    struct StructChargerInfo ChargerInfo;
-    struct StructWeatherInfo WeatherInfo;
-    struct StructCreditDeductResult DeductInfo;
-    struct StructReaderStatus ReaderStatus[CONNECTOR_QUANTITY];
-    unsigned char TriggerReaderReq[3];
-    unsigned char SerialNo[CONNECTOR_QUANTITY][37];
-    unsigned char VEMData[CONNECTOR_QUANTITY][65];
-
-    unsigned char ReportCreditDeductReq:1;
-    unsigned char ChargerInfoReq:1;
-    unsigned char ChargerInfoConf:1;
-    unsigned char WeatherInfoReq:1;
-    unsigned char WeatherInfoConf:1;
-    unsigned char :3;                  // bit 5-7 , reserved
-};
-
-struct OCMFData
-{
-    unsigned char SendOcmfDataReq:1;   // bit 0 , Flag to ask OCPP sending OCMF message to backend.
-    unsigned char :7;                  // bit 1-7 , reserved
-    unsigned char DataString[2048];    // Data got from meter.
-    unsigned char PublicKey[256];      // PublicKey with header got from meter.
-};
-
-struct OCPP16Data
-{
-    unsigned char                           OcppServerURL[512];     //http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
-    unsigned char                           ChargeBoxId[128];
-    unsigned char                           OcppConnStatus;         //0: disconnected, 1: connected
-    unsigned int                            Timeout_Secs;
-    unsigned short                          Ping_Pong_Interval;
-    long int                                procDogTime;            // Process watch dog refresh timer
-    union
-    {
-        //Operations Initiated by Charge Point
-        unsigned char CpMsgValue[CONNECTOR_QUANTITY];
-        struct
-        {
-            //CpMsgValue[0]
-            unsigned char DataTransferReq:1;        //bit 0,
-            unsigned char DataTransferConf:1;       //bit 1,
-            unsigned char StartTransactionReq:1;    //bit 2,
-            unsigned char StartTransactionConf:1;   //bit 3,
-            unsigned char StopTransactionReq:1;     //bit 4,
-            unsigned char StopTransactionConf:1;    //bit 5,
-            unsigned char :2;                       //bit 6,7 , reserved
-        } bits[CONNECTOR_QUANTITY];
-    }CpMsg;
-
-    union
-    {
-        //Operations Initiated by Sequence Point
-        unsigned char SpMsgValue[2];
-        struct
-        {
-            //SpMsgValue[0]
-            unsigned char BootNotificationReq :1;                   //bit 0,
-            unsigned char BootNotificationConf :1;                  //bit 1,
-            unsigned char AuthorizeReq :1;                          //bit 2,
-            unsigned char AuthorizeConf :1;                         //bit 3,
-            unsigned char DiagnosticsStatusNotificationReq :1;      //bit 4,
-            unsigned char DiagnosticsStatusNotificationConf :1;     //bit 5,
-            unsigned char FirmwareStatusNotificationReq :1;         //bit 6,
-            unsigned char FirmwareStatusNotificationConf :1;        //bit 7,
-            //SpMsgValue[1]
-            unsigned char LogStatusNotificationReq :1;              //bit 0,
-            unsigned char LogStatusNotificationConf :1;             //bit 1,
-            unsigned char SecurityEventNotificationReq :1;          //bit 2,
-            unsigned char SecurityEventNotificationConf :1;         //bit 3,
-            unsigned char SignCertificateReq :1;                    //bit 4,
-            unsigned char SignCertificateConf :1;                   //bit 5,
-            unsigned char SignedFirmwareStatusNotificationReq :1;   //bit 6,
-            unsigned char SignedFirmwareStatusNotificationConf :1;  //bit 7,
-        } bits;
-    } SpMsg;
-
-    union
-    {
-        //Operations Initiated by Central System
-        unsigned char CsMsgValue[3 * (CONNECTOR_QUANTITY)];
-        struct
-        {
-            //CsMsgValue[0]
-            unsigned char CancelReservationReq :1;      //bit 0,
-            unsigned char CancelReservationConf :1;     //bit 1,
-            unsigned char ChangeAvailabilityReq :1;     //bit 2,
-            unsigned char ChangeAvailabilityConf :1;    //bit 3,
-            unsigned char ReserveNowReq :1;             //bit 4,
-            unsigned char ReserveNowConf :1;            //bit 5,
-            unsigned char SetChargingProfileReq :1;     //bit 6,
-            unsigned char SetChargingProfileConf :1;    //bit 7,
-            //CsMsgValue[1]
-            unsigned char TriggerMessageReq :1;         //bit 0,
-            unsigned char TriggerMessageConf :1;        //bit 1,
-            unsigned char UnlockConnectorReq :1;        //bit 2,
-            unsigned char UnlockConnectorConf :1;       //bit 3,
-            unsigned char RemoteStartTransactionReq :1; //bit 4,
-            unsigned char RemoteStartTransactionConf :1;//bit 5,
-            unsigned char RemoteStopTransactionReq :1;  //bit 6,
-            unsigned char RemoteStopTransactionConf :1; //bit 7,
-            //CsMsgValue[2]
-            unsigned char ClearChargingProfileReq :1;   //bit 0,
-            unsigned char ClearChargingProfileConf :1;  //bit 1,
-            unsigned char DataTransferReq :1;           //bit 2,
-            unsigned char DataTransferConf :1;          //bit 3,
-            unsigned char GetCompositeScheduleReq :1;   //bit 4,
-            unsigned char GetCompositeScheduleConf :1;  //bit 5,
-            unsigned char :2;                           //bit 6,7
-        } bits[CONNECTOR_QUANTITY];
-    }CsMsg;
-
-    union
-    {
-        //Operations Initiated by Main System
-        unsigned char MsMsgValue[4];
-        struct
-        {
-            //CsMsgValue[0]
-            unsigned char ChangeConfigurationReq :1;                //bit 0,
-            unsigned char ChangeConfigurationConf :1;               //bit 1,
-            unsigned char ClearCacheReq :1;                         //bit 2,
-            unsigned char ClearCacheConf :1;                        //bit 3,
-            unsigned char GetConfigurationReq :1;                   //bit 4,
-            unsigned char GetConfigurationConf :1;                  //bit 5,
-            unsigned char UpdateFirmwareReq :1;                     //bit 6,
-            unsigned char UpdateFirmwareConf :1;                    //bit 7,
-            //CsMsgValue[1]
-            unsigned char GetDiagnosticsReq :1;                     //bit 0,
-            unsigned char GetDiagnosticsConf :1;                    //bit 1,
-            unsigned char GetLocalListVersionReq :1;                //bit 2,
-            unsigned char GetLocalListVersionConf :1;               //bit 3,
-            unsigned char ResetReq :1;                              //bit 4,
-            unsigned char ResetConf :1;                             //bit 5,
-            unsigned char SendLocalListReq :1;                      //bit 6,
-            unsigned char SendLocalListConf :1;                     //bit 7,
-            //CsMsgValue[2]
-            unsigned char CertificateSignedReq :1;                  //bit 0
-            unsigned char CertificateSignedConf :1;                 //bit 1
-            unsigned char DeleteCertificateReq :1;                  //bit 2
-            unsigned char DeleteCertificateConf :1;                 //bit 3
-            unsigned char ExtendedTriggerMessageReq :1;             //bit 4
-            unsigned char ExtendedTriggerMessageConf :1;            //bit 5
-            unsigned char GetInstalledCertificateIdsReq :1;         //bit 6
-            unsigned char GetInstalledCertificateIdsConf :1;        //bit 7
-            //CsMsgValue[3]
-            unsigned char GetLogReq :1;                             //bit 0
-            unsigned char GetLogConf :1;                            //bit 1
-            unsigned char InstallCertificateReq :1;                 //bit 2
-            unsigned char InstallCertificateConf :1;                //bit 3
-            unsigned char SignedUpdateFirmwareReq :1;               //bit 4
-            unsigned char SignedUpdateFirmwareConf :1;              //bit 5
-            unsigned char isRemoteStartWaitReq :1;                  //bit 6
-            unsigned char :1;                                       //bit 7
-        } bits;
-    } MsMsg;
-
-    union
-    {
-        //Operations triggered by CSU
-        unsigned char CSUMsgValue[CONNECTOR_QUANTITY];
-        struct
-        {
-            //CSUMsgValue[0]
-            unsigned char ChargingProfileReq:1;     //bit 0,
-            unsigned char ChargingProfileConf:1;    //bit 0,
-            unsigned char :6;                       //bit 1,2,3,4,5,6,7 , reserved
-        } bits[CONNECTOR_QUANTITY];
-    }CSUMsg;
-
-    struct StructBootNotification                   BootNotification;
-    struct StructHeartbeat                          Heartbeat;
-    struct StructAuthorize                          Authorize;
-    struct StructStartTransaction                   StartTransaction[CONNECTOR_QUANTITY];
-    struct StructStopTransaction                    StopTransaction[CONNECTOR_QUANTITY];
-    struct StructStatusNotification                 StatusNotification[CONNECTOR_QUANTITY];
-    struct StructCancelReservation                  CancelReservation[CONNECTOR_QUANTITY];
-    struct StructChangeAvailability                 ChangeAvailability[CONNECTOR_QUANTITY];
-    struct StructChangeConfiguration                ChangeConfiguration;
-    struct StructClearCache                         ClearCache;
-    struct StructClearChargingProfile               ClearChargingProfile[CONNECTOR_QUANTITY];
-    struct StructDataTransfer                       DataTransfer[CONNECTOR_QUANTITY];
-    struct StructDiagnosticsStatusNotification      DiagnosticsStatusNotification;
-    struct StructFirmwareStatusNotification         FirmwareStatusNotification;
-    struct StructGetCompositeSchedule               GetCompositeSchedule[CONNECTOR_QUANTITY];
-    struct StructGetConfiguration                   GetConfiguration;
-    struct StructGetDiagnostics                     GetDiagnostics;
-    struct StructGetLocalListVersion                GetLocalListVersion;
-    struct StructMeterValues                        MeterValues[CONNECTOR_QUANTITY];
-    struct StructRemoteStartTransaction             RemoteStartTransaction[CONNECTOR_QUANTITY];
-    struct StructRemoteStopTransaction              RemoteStopTransaction[CONNECTOR_QUANTITY];
-    struct StructReserveNow                         ReserveNow[CONNECTOR_QUANTITY];
-    struct StructReset                              Reset;
-    struct StructSendLocalList                      SendLocalList;
-    struct StructSetChargingProfile                 SetChargingProfile[CONNECTOR_QUANTITY];
-    struct StructTriggerMessage                     TriggerMessage[CONNECTOR_QUANTITY];
-    struct StructUnlockConnector                    UnlockConnector[CONNECTOR_QUANTITY];
-    struct StructUpdateFirmware                     UpdateFirmware;
-    struct OCPP16ConfigurationTable                 ConfigurationTable;
-    struct StructChargingProfile                    SmartChargingProfile[CONNECTOR_QUANTITY];
-    struct StructChargingProfile                    MaxChargingProfile;
-    struct StructCost                               Cost;
-    struct StructCertificateSigned                  CertificateSigned;
-    struct StructDeleteCertificate                  DeleteCertificate;
-    struct StructExtendedTrigger                    ExtendedTriggerMessage;
-    struct StructGetInstalledCertificateIds         GetInstalledCertificateIds;
-    struct StructGetLog                             GetLog;
-    struct StructInstallCertificate                 InstallCertificate;
-    struct StructSignedUpdateFirmware               SignedUpdateFirmware;
-    struct StructLogStatusNotification              LogStatusNotification;
-    struct StructSecurityEventNotification          SecurityEventNotification;
-    struct StructSignCertificate                    SignCertificate;
-    struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
-    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
-    struct StructTcciCustomData                     TcciCustomData;
-    struct OCMFData                                 OcmfData[CONNECTOR_QUANTITY];
-};
-
-
 /**************************************************************************************/
 /************************* OCPP 2.0 Share memory **************************************/
 /**************************************************************************************/
@@ -6106,6 +5852,283 @@ struct NetworkConnectionProfile_20
     struct NetworkConnectionProfileType connectionData;
 };
 
+//===================================
+// YES custom protocol
+//===================================
+struct StructChargerInfo
+{
+    unsigned char station_name[64];
+};
+
+struct StructWeatherInfo
+{
+    int   weatherId;
+    float temperature;
+};
+
+struct StructCreditDeductResult
+{
+    int txId;
+    unsigned char creditNo[64];
+    unsigned char vemData[80];
+    unsigned char ROC[20];
+    unsigned char RRN[20];
+    unsigned char storeId[20];
+    unsigned char approvalNo[20];
+    double        amount;
+    unsigned char deductResult:1;
+    unsigned char isDonateInvoice:1;
+};
+
+struct StructReaderStatus
+{
+    int readerStatus;
+    unsigned char creditNo[64];
+    unsigned char ReportReaderStatusReq:1;
+};
+
+struct StructTcciCustomData
+{
+    struct StructChargerInfo ChargerInfo;
+    struct StructWeatherInfo WeatherInfo;
+    struct StructCreditDeductResult DeductInfo;
+    struct StructReaderStatus ReaderStatus[CONNECTOR_QUANTITY];
+    unsigned char TriggerReaderReq[3];
+    unsigned char SerialNo[CONNECTOR_QUANTITY][37];
+    unsigned char VEMData[CONNECTOR_QUANTITY][65];
+
+    unsigned char ReportCreditDeductReq:1;
+    unsigned char ChargerInfoReq:1;
+    unsigned char ChargerInfoConf:1;
+    unsigned char WeatherInfoReq:1;
+    unsigned char WeatherInfoConf:1;
+    unsigned char :3;                  // bit 5-7 , reserved
+};
+
+struct OCMFData
+{
+    unsigned char SendOcmfDataReq:1;   // bit 0 , Flag to ask OCPP sending OCMF message to backend.
+    unsigned char :7;                  // bit 1-7 , reserved
+    unsigned char DataString[2048];    // Data got from meter.
+    unsigned char PublicKey[256];      // PublicKey with header got from meter.
+};
+
+struct OCPP16_V2g_Extend
+{
+	struct Authorize_20						Authorize;
+	struct CertificateSigned_20				CertificateSigned;
+	struct DeleteCertificate_20				DeleteCertificate;
+	struct Get15118EVCertificate_20			Get15118EVCertificate;
+	struct GetCertificateStatus_20			GetCertificateStatus;
+	struct GetInstalledCertificateIds_20	GetInstalledCertificateIds;
+	struct InstallCertificate_20			InstallCertificate;
+	struct SignCertificate_20				SignCertificate;
+
+
+	unsigned char							AuthorizeReq:1;
+	unsigned char							AuthorizeConf:1;
+	unsigned char							Get15118EVCertificateReq:1;
+	unsigned char 							Get15118EVCertificateConf:1;
+	unsigned char							GetCertificateStatusReq:1;
+	unsigned char 							GetCertificateStatusConf:1;
+	unsigned char							SignCertificateReq:1;
+	unsigned char							SignCertificateConf:1;
+};
+
+struct OCPP16Data
+{
+    unsigned char                           OcppServerURL[512];     //http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char                           ChargeBoxId[128];
+    unsigned char                           OcppConnStatus;         //0: disconnected, 1: connected
+    unsigned int                            Timeout_Secs;
+    unsigned short                          Ping_Pong_Interval;
+    long int                                procDogTime;            // Process watch dog refresh timer
+    union
+    {
+        //Operations Initiated by Charge Point
+        unsigned char CpMsgValue[CONNECTOR_QUANTITY];
+        struct
+        {
+            //CpMsgValue[0]
+            unsigned char DataTransferReq:1;        //bit 0,
+            unsigned char DataTransferConf:1;       //bit 1,
+            unsigned char StartTransactionReq:1;    //bit 2,
+            unsigned char StartTransactionConf:1;   //bit 3,
+            unsigned char StopTransactionReq:1;     //bit 4,
+            unsigned char StopTransactionConf:1;    //bit 5,
+            unsigned char :2;                       //bit 6,7 , reserved
+        } bits[CONNECTOR_QUANTITY];
+    }CpMsg;
+
+    union
+    {
+        //Operations Initiated by Sequence Point
+        unsigned char SpMsgValue[2];
+        struct
+        {
+            //SpMsgValue[0]
+            unsigned char BootNotificationReq :1;                   //bit 0,
+            unsigned char BootNotificationConf :1;                  //bit 1,
+            unsigned char AuthorizeReq :1;                          //bit 2,
+            unsigned char AuthorizeConf :1;                         //bit 3,
+            unsigned char DiagnosticsStatusNotificationReq :1;      //bit 4,
+            unsigned char DiagnosticsStatusNotificationConf :1;     //bit 5,
+            unsigned char FirmwareStatusNotificationReq :1;         //bit 6,
+            unsigned char FirmwareStatusNotificationConf :1;        //bit 7,
+            //SpMsgValue[1]
+            unsigned char LogStatusNotificationReq :1;              //bit 0,
+            unsigned char LogStatusNotificationConf :1;             //bit 1,
+            unsigned char SecurityEventNotificationReq :1;          //bit 2,
+            unsigned char SecurityEventNotificationConf :1;         //bit 3,
+            unsigned char SignCertificateReq :1;                    //bit 4,
+            unsigned char SignCertificateConf :1;                   //bit 5,
+            unsigned char SignedFirmwareStatusNotificationReq :1;   //bit 6,
+            unsigned char SignedFirmwareStatusNotificationConf :1;  //bit 7,
+        } bits;
+    } SpMsg;
+
+    union
+    {
+        //Operations Initiated by Central System
+        unsigned char CsMsgValue[3 * (CONNECTOR_QUANTITY)];
+        struct
+        {
+            //CsMsgValue[0]
+            unsigned char CancelReservationReq :1;      //bit 0,
+            unsigned char CancelReservationConf :1;     //bit 1,
+            unsigned char ChangeAvailabilityReq :1;     //bit 2,
+            unsigned char ChangeAvailabilityConf :1;    //bit 3,
+            unsigned char ReserveNowReq :1;             //bit 4,
+            unsigned char ReserveNowConf :1;            //bit 5,
+            unsigned char SetChargingProfileReq :1;     //bit 6,
+            unsigned char SetChargingProfileConf :1;    //bit 7,
+            //CsMsgValue[1]
+            unsigned char TriggerMessageReq :1;         //bit 0,
+            unsigned char TriggerMessageConf :1;        //bit 1,
+            unsigned char UnlockConnectorReq :1;        //bit 2,
+            unsigned char UnlockConnectorConf :1;       //bit 3,
+            unsigned char RemoteStartTransactionReq :1; //bit 4,
+            unsigned char RemoteStartTransactionConf :1;//bit 5,
+            unsigned char RemoteStopTransactionReq :1;  //bit 6,
+            unsigned char RemoteStopTransactionConf :1; //bit 7,
+            //CsMsgValue[2]
+            unsigned char ClearChargingProfileReq :1;   //bit 0,
+            unsigned char ClearChargingProfileConf :1;  //bit 1,
+            unsigned char DataTransferReq :1;           //bit 2,
+            unsigned char DataTransferConf :1;          //bit 3,
+            unsigned char GetCompositeScheduleReq :1;   //bit 4,
+            unsigned char GetCompositeScheduleConf :1;  //bit 5,
+            unsigned char :2;                           //bit 6,7
+        } bits[CONNECTOR_QUANTITY];
+    }CsMsg;
+
+    union
+    {
+        //Operations Initiated by Main System
+        unsigned char MsMsgValue[4];
+        struct
+        {
+            //CsMsgValue[0]
+            unsigned char ChangeConfigurationReq :1;                //bit 0,
+            unsigned char ChangeConfigurationConf :1;               //bit 1,
+            unsigned char ClearCacheReq :1;                         //bit 2,
+            unsigned char ClearCacheConf :1;                        //bit 3,
+            unsigned char GetConfigurationReq :1;                   //bit 4,
+            unsigned char GetConfigurationConf :1;                  //bit 5,
+            unsigned char UpdateFirmwareReq :1;                     //bit 6,
+            unsigned char UpdateFirmwareConf :1;                    //bit 7,
+            //CsMsgValue[1]
+            unsigned char GetDiagnosticsReq :1;                     //bit 0,
+            unsigned char GetDiagnosticsConf :1;                    //bit 1,
+            unsigned char GetLocalListVersionReq :1;                //bit 2,
+            unsigned char GetLocalListVersionConf :1;               //bit 3,
+            unsigned char ResetReq :1;                              //bit 4,
+            unsigned char ResetConf :1;                             //bit 5,
+            unsigned char SendLocalListReq :1;                      //bit 6,
+            unsigned char SendLocalListConf :1;                     //bit 7,
+            //CsMsgValue[2]
+            unsigned char CertificateSignedReq :1;                  //bit 0
+            unsigned char CertificateSignedConf :1;                 //bit 1
+            unsigned char DeleteCertificateReq :1;                  //bit 2
+            unsigned char DeleteCertificateConf :1;                 //bit 3
+            unsigned char ExtendedTriggerMessageReq :1;             //bit 4
+            unsigned char ExtendedTriggerMessageConf :1;            //bit 5
+            unsigned char GetInstalledCertificateIdsReq :1;         //bit 6
+            unsigned char GetInstalledCertificateIdsConf :1;        //bit 7
+            //CsMsgValue[3]
+            unsigned char GetLogReq :1;                             //bit 0
+            unsigned char GetLogConf :1;                            //bit 1
+            unsigned char InstallCertificateReq :1;                 //bit 2
+            unsigned char InstallCertificateConf :1;                //bit 3
+            unsigned char SignedUpdateFirmwareReq :1;               //bit 4
+            unsigned char SignedUpdateFirmwareConf :1;              //bit 5
+            unsigned char isRemoteStartWaitReq :1;                  //bit 6
+            unsigned char :1;                                       //bit 7
+        } bits;
+    } MsMsg;
+
+    union
+    {
+        //Operations triggered by CSU
+        unsigned char CSUMsgValue[CONNECTOR_QUANTITY];
+        struct
+        {
+            //CSUMsgValue[0]
+            unsigned char ChargingProfileReq:1;     //bit 0,
+            unsigned char ChargingProfileConf:1;    //bit 0,
+            unsigned char :6;                       //bit 1,2,3,4,5,6,7 , reserved
+        } bits[CONNECTOR_QUANTITY];
+    }CSUMsg;
+
+    struct StructBootNotification                   BootNotification;
+    struct StructHeartbeat                          Heartbeat;
+    struct StructAuthorize                          Authorize;
+    struct StructStartTransaction                   StartTransaction[CONNECTOR_QUANTITY];
+    struct StructStopTransaction                    StopTransaction[CONNECTOR_QUANTITY];
+    struct StructStatusNotification                 StatusNotification[CONNECTOR_QUANTITY];
+    struct StructCancelReservation                  CancelReservation[CONNECTOR_QUANTITY];
+    struct StructChangeAvailability                 ChangeAvailability[CONNECTOR_QUANTITY];
+    struct StructChangeConfiguration                ChangeConfiguration;
+    struct StructClearCache                         ClearCache;
+    struct StructClearChargingProfile               ClearChargingProfile[CONNECTOR_QUANTITY];
+    struct StructDataTransfer                       DataTransfer[CONNECTOR_QUANTITY];
+    struct StructDiagnosticsStatusNotification      DiagnosticsStatusNotification;
+    struct StructFirmwareStatusNotification         FirmwareStatusNotification;
+    struct StructGetCompositeSchedule               GetCompositeSchedule[CONNECTOR_QUANTITY];
+    struct StructGetConfiguration                   GetConfiguration;
+    struct StructGetDiagnostics                     GetDiagnostics;
+    struct StructGetLocalListVersion                GetLocalListVersion;
+    struct StructMeterValues                        MeterValues[CONNECTOR_QUANTITY];
+    struct StructRemoteStartTransaction             RemoteStartTransaction[CONNECTOR_QUANTITY];
+    struct StructRemoteStopTransaction              RemoteStopTransaction[CONNECTOR_QUANTITY];
+    struct StructReserveNow                         ReserveNow[CONNECTOR_QUANTITY];
+    struct StructReset                              Reset;
+    struct StructSendLocalList                      SendLocalList;
+    struct StructSetChargingProfile                 SetChargingProfile[CONNECTOR_QUANTITY];
+    struct StructTriggerMessage                     TriggerMessage[CONNECTOR_QUANTITY];
+    struct StructUnlockConnector                    UnlockConnector[CONNECTOR_QUANTITY];
+    struct StructUpdateFirmware                     UpdateFirmware;
+    struct OCPP16ConfigurationTable                 ConfigurationTable;
+    struct StructChargingProfile                    SmartChargingProfile[CONNECTOR_QUANTITY];
+    struct StructChargingProfile                    MaxChargingProfile;
+    struct StructCost                               Cost;
+    struct StructCertificateSigned                  CertificateSigned;
+    struct StructDeleteCertificate                  DeleteCertificate;
+    struct StructExtendedTrigger                    ExtendedTriggerMessage;
+    struct StructGetInstalledCertificateIds         GetInstalledCertificateIds;
+    struct StructGetLog                             GetLog;
+    struct StructInstallCertificate                 InstallCertificate;
+    struct StructSignedUpdateFirmware               SignedUpdateFirmware;
+    struct StructLogStatusNotification              LogStatusNotification;
+    struct StructSecurityEventNotification          SecurityEventNotification;
+    struct StructSignCertificate                    SignCertificate;
+    struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
+    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
+    struct StructTcciCustomData                     TcciCustomData;
+    struct OCMFData                                 OcmfData[CONNECTOR_QUANTITY];
+    struct OCPP16_V2g_Extend						v2g_extend;
+};
+
 struct OCPP20Data
 {
 	unsigned char 							OcppServerURL[512];		//http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"

BIN
EVSE/rootfs/var/www/lang.db


+ 4 - 2
EVSE/rootfs/var/www/set_backend.php

@@ -251,6 +251,7 @@ CORE STYLES ABOVE - NO TOUCHY
 												<option value="0" <?php echo $obj->{'OcppSecurityProfile'}=="0"?"selected":""?>><?php echo $lang->showWord("none_security"); ?></option>
 												<option value="1" <?php echo $obj->{'OcppSecurityProfile'}=="1"?"selected":""?>><?php echo $lang->showWord("unsecured_transport_with_basic_atuentication"); ?></option>
 												<option value="2" <?php echo $obj->{'OcppSecurityProfile'}=="2"?"selected":""?>><?php echo $lang->showWord("tls_with_basic_authentication"); ?></option>
+												<option value="3" <?php echo $obj->{'OcppSecurityProfile'}=="3"?"selected":""?>><?php echo $lang->showWord("tls_with_client_side_certificates"); ?></option>
 											</select>
 										</div>
 										<div id="OcppSecurityPasswordDiv" class="form-group" style="display:<?php echo $am101;?>">
@@ -297,6 +298,7 @@ CORE STYLES ABOVE - NO TOUCHY
 												<option value="0" <?php echo $obj->{'MaintainServerSecurityProfile'}=="0"?"selected":""?>><?php echo $lang->showWord("none_security"); ?></option>
 												<option value="1" <?php echo $obj->{'MaintainServerSecurityProfile'}=="1"?"selected":""?>><?php echo $lang->showWord("unsecured_transport_with_basic_atuentication"); ?></option>
 												<option value="2" <?php echo $obj->{'MaintainServerSecurityProfile'}=="2"?"selected":""?>><?php echo $lang->showWord("tls_with_basic_authentication"); ?></option>
+												<option value="3" <?php echo $obj->{'MaintainServerSecurityProfile'}=="3"?"selected":""?>><?php echo $lang->showWord("tls_with_client_side_certificates"); ?></option>
 											</select>
 										</div>
 										<div id="MaintainServerSecurityPasswordDiv" class="form-group" style="display:<?php echo $am101;?>">
@@ -526,7 +528,7 @@ CORE STYLES ABOVE - NO TOUCHY
 		return true;
 	}
 	function OcppSecurityProfile_changed(){
-		if(document.getElementById("OcppSecurityProfile").value == "1" || document.getElementById("OcppSecurityProfile").value == "2"){
+		if(document.getElementById("OcppSecurityProfile").value == "1" || document.getElementById("OcppSecurityProfile").value == "2" || document.getElementById("OcppSecurityProfile").value == "3"){
 			document.getElementById("OcppSecurityPasswordDiv").style.display="block";
 		}
 		else{
@@ -534,7 +536,7 @@ CORE STYLES ABOVE - NO TOUCHY
 		}
 	}
 	function MaintainServerSecurityProfile_changed(){
-		if(document.getElementById("MaintainServerSecurityProfile").value == "1" || document.getElementById("MaintainServerSecurityProfile").value == "2"){
+		if(document.getElementById("MaintainServerSecurityProfile").value == "1" || document.getElementById("MaintainServerSecurityProfile").value == "2" || document.getElementById("MaintainServerSecurityProfile").value == "3"){
 			document.getElementById("MaintainServerSecurityPasswordDiv").style.display="block";
 		}
 		else{

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно