1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021 |
- #ifndef MessageHandler_H
- #define MessageHandler_H
- //===================================
- // Define SQLite file constant
- //===================================
- #define OCPP_LOCAL_DB_FILE "/Storage/OCPP/charger.db"
- //===================================
- // Define CP State constant
- //===================================
- #define CP_STATE_UNKNOWN 0
- #define CP_STATE_A 1
- #define CP_STATE_B 2
- #define CP_STATE_C 3
- #define CP_STATE_D 4
- #define CP_STATE_E 5
- #define CP_STATE_F 6
- //==========================================
- // Init all Enumeration & Mapping String
- //==========================================
- #define MACROSTR(k) #k
- /* Common Data Type */
- /*APNAuthenticationEnumType */
- typedef enum {
- APNAuthenticationEnumType_CHAP,
- APNAuthenticationEnumType_NONE,
- APNAuthenticationEnumType_PAP,
- APNAuthenticationEnumType_AUTO
- } APNAuthenticationEnumType;
- /* AttributeEnumType */
- typedef enum {
- AttributeEnumType_Actual,
- AttributeEnumType_Target,
- AttributeEnumType_MinSet,
- AttributeEnumType_MaxSet
- } AttributeEnumType;
- /* AuthorizationStatusEnumType */
- typedef enum {
- AuthorizationStatusEnumType_Accepted,
- AuthorizationStatusEnumType_Blocked,
- AuthorizationStatusEnumType_ConcurrentTx,
- AuthorizationStatusEnumType_Expired,
- AuthorizationStatusEnumType_Invalid,
- AuthorizationStatusEnumType_NoCredit,
- AuthorizationStatusEnumType_NotAllowedTypeEVSE,
- AuthorizationStatusEnumType_NotAtThisLocation,
- AuthorizationStatusEnumType_NotAtThisTime,
- AuthorizationStatusEnumType_Unknown
- } AuthorizationStatusEnumType;
- /* AuthorizeCertificateStatusEnumType */
- typedef enum {
- AuthorizeCertificateStatusEnumType_Accepted,
- AuthorizeCertificateStatusEnumType_SignatureError,
- AuthorizeCertificateStatusEnumType_CertificateExpired,
- AuthorizeCertificateStatusEnumType_CertificateRevoked
- } AuthorizeCertificateStatusEnumType;
- /* BootReasonEnumType */
- typedef enum {
- BootReasonEnumType_ApplicationReset,
- BootReasonEnumType_FirmwareUpdate,
- BootReasonEnumType_LocalReset,
- BootReasonEnumType_PowerUp,
- BootReasonEnumType_RemoteReset,
- BootReasonEnumType_ScheduledReset,
- BootReasonEnumType_Triggered,
- BootReasonEnumType_Unknown,
- BootReasonEnumType_Watchdog
- } BootReasonEnumType;
- /* CancelReservationStatusEnumType */
- typedef enum {
- CancelReservationStatusEnumType_Accepted,
- CancelReservationStatusEnumType_Rejected
- } CancelReservationStatusEnumType;
- /* CertificateActionEnumType */
- typedef enum {
- CertificateActionEnumType_Install,
- CertificateActionEnumType_Update
- } CertificateActionEnumType;
- /* CertificateSignedStatusEnumType */
- typedef enum {
- CertificateSignedStatusEnumType_Accepted,
- CertificateSignedStatusEnumType_Rejected
- } CertificateSignedStatusEnumType;
- /* CertificateSignedStatusEnumType */
- typedef enum {
- CertificateSignedStatusEnumType_ChargingStationCertificate,
- CertificateSignedStatusEnumType_V2GCertificate
- } CertificateSigningUseEnumType;
- /* ChangeAvailabilityStatusEnumType */
- typedef enum {
- ChangeAvailabilityStatusEnumType_Accepted,
- ChangeAvailabilityStatusEnumType_Rejected,
- ChangeAvailabilityStatusEnumType_Scheduled
- } ChangeAvailabilityStatusEnumType;
- /* ChargingLimitSourceEnumType */
- typedef enum {
- ChargingLimitSourceEnumType_EMS,
- ChargingLimitSourceEnumType_Other,
- ChargingLimitSourceEnumType_SO,
- ChargingLimitSourceEnumType_CSO
- } ChargingLimitSourceEnumType;
- /* ChargingProfileKindEnumType */
- typedef enum {
- ChargingProfileKindEnumType_Absolute,
- ChargingProfileKindEnumType_Recurring,
- ChargingProfileKindEnumType_Relative
- } ChargingProfileKindEnumType;
- /* ChargingProfilePurposeEnumType */
- typedef enum {
- ChargingProfilePurposeEnumType_ChargingStationExternalConstraints,
- ChargingProfilePurposeEnumType_ChargingStationMaxProfile,
- ChargingProfilePurposeEnumType_TxDefaultProfile,
- ChargingProfilePurposeEnumType_TxProfile
- } ChargingProfilePurposeEnumType;
- /* ChargingProfileStatusEnumType */
- typedef enum {
- ChargingProfileStatusEnumType_Accepted,
- ChargingProfileStatusEnumType_Rejected
- } ChargingProfileStatusEnumType;
- /* ChargingRateUnitEnumType */
- typedef enum {
- ChargingRateUnitEnumType_W,
- ChargingRateUnitEnumType_A
- } ChargingRateUnitEnumType;
- /* ChargingStateEnumType */
- typedef enum {
- ChargingStateEnumType_Charging,
- ChargingStateEnumType_EVConnected,
- ChargingStateEnumType_SuspendedEV,
- ChargingStateEnumType_SuspendedEVSE,
- ChargingStateEnumType_Idle
- }ChargingStateEnumType;
- /* ClearCacheStatusEnumType */
- typedef enum {
- ClearCacheStatusEnumType_Accepted,
- ClearCacheStatusEnumType_Rejected
- } ClearCacheStatusEnumType;
- /* ClearChargingProfileStatusEnumType */
- typedef enum {
- ClearChargingProfileStatusEnumType_Accepted,
- ClearChargingProfileStatusEnumType_Unknown
- } ClearChargingProfileStatusEnumType;
- /* ClearMessageStatusEnumType */
- typedef enum {
- ClearMessageStatusEnumType_Accepted,
- ClearMessageStatusEnumType_Unknown
- } ClearMessageStatusEnumType;
- /* ClearMonitoringStatusEnumType */
- typedef enum {
- ClearMonitoringStatusEnumType_Accepted,
- ClearMonitoringStatusEnumType_Rejected,
- ClearMonitoringStatusEnumType_NotFound
- } ClearMonitoringStatusEnumType;
- /* ComponentCriterionEnumType */
- typedef enum {
- ComponentCriterionEnumType_Active,
- ComponentCriterionEnumType_Available,
- ComponentCriterionEnumType_Enabled,
- ComponentCriterionEnumType_Problem
- } ComponentCriterionEnumType;
- /* ConnectorEnumType */
- typedef enum {
- ConnectorEnumType_cCCS1,
- ConnectorEnumType_cCCS2,
- ConnectorEnumType_cG105,
- ConnectorEnumType_cTesla,
- ConnectorEnumType_cType1,
- ConnectorEnumType_cType2,
- ConnectorEnumType_s309_1P_16A,
- ConnectorEnumType_s309_1P_32A,
- ConnectorEnumType_s309_3P_16A,
- ConnectorEnumType_s309_3P_32A,
- ConnectorEnumType_sBS1361,
- ConnectorEnumType_sCEE_7_7,
- ConnectorEnumType_sType2,
- ConnectorEnumType_sType3,
- ConnectorEnumType_Other1PhMax16A,
- ConnectorEnumType_Other1PhOver16A,
- ConnectorEnumType_Other3Ph,
- ConnectorEnumType_Pan,
- ConnectorEnumType_wInductive,
- ConnectorEnumType_wResonant,
- ConnectorEnumType_Undetermined,
- ConnectorEnumType_Unknown
- } ConnectorEnumType;
- /* ConnectorStatusEnumType */
- typedef enum {
- ConnectorStatusEnumType_Available,
- ConnectorStatusEnumType_Occupied,
- ConnectorStatusEnumType_Reserved,
- ConnectorStatusEnumType_Unavailable,
- ConnectorStatusEnumType_Faulted
- } ConnectorStatusEnumType;
- /* CostKindEnumType */
- typedef enum {
- CostKindEnumType_CarbonDioxideEmission,
- CostKindEnumType_RelativePricePercentage,
- CostKindEnumType_RenewableGenerationPercentage
- } CostKindEnumType;
- /* CustomerInformationStatusEnumType */
- typedef enum {
- CustomerInformationStatusEnumType_Accepted,
- CustomerInformationStatusEnumType_Rejected,
- CustomerInformationStatusEnumType_Invalid
- } CustomerInformationStatusEnumType;
- /* DataEnumType */
- typedef enum {
- DataEnumType_string,
- DataEnumType_decimal,
- DataEnumType_integer,
- DataEnumType_dateTime,
- DataEnumType_boolean,
- DataEnumType_OptionList,
- DataEnumType_SequenceList,
- DataEnumType_MemberList
- } DataEnumType;
- /* DataTransferStatusEnumType */
- typedef enum {
- DataTransferStatusEnumType_Accepted,
- DataTransferStatusEnumType_Rejected,
- DataTransferStatusEnumType_UnknownMessageId,
- DataTransferStatusEnumType_UnknownVendorId
- } DataTransferStatusEnumType;
- /* DeleteCertificateStatusEnumType */
- typedef enum {
- DeleteCertificateStatusEnumType_Accepted,
- DeleteCertificateStatusEnumType_Failed,
- DeleteCertificateStatusEnumType_NotFound
- } DeleteCertificateStatusEnumType;
- /* DisplayMessageStatusEnumType */
- typedef enum {
- DisplayMessageStatusEnumType_Accepted,
- DisplayMessageStatusEnumType_NotSupportedMessageFormat,
- DisplayMessageStatusEnumType_Rejected,
- DisplayMessageStatusEnumType_NotSupportedPriority,
- DisplayMessageStatusEnumType_NotSupportedState,
- DisplayMessageStatusEnumType_UnknownTransaction
- } DisplayMessageStatusEnumType;
- /* EnergyTransferModeEnumType */
- typedef enum {
- EnergyTransferModeEnumType_DC,
- EnergyTransferModeEnumType_AC_single_phase,
- EnergyTransferModeEnumType_AC_two_phase,
- EnergyTransferModeEnumType_AC_three_phase
- } EnergyTransferModeEnumType;
- /* EventNotificationEnumType */
- typedef enum {
- EventNotificationEnumType_HardWiredNotification,
- EventNotificationEnumType_HardWiredMonitor,
- EventNotificationEnumType_PreconfiguredMonitor,
- EventNotificationEnumType_CustomMonitor
- } EventNotificationEnumType;
- /* EventTriggerEnumType */
- typedef enum {
- EventTriggerEnumType_Alerting,
- EventTriggerEnumType_Delta,
- EventTriggerEnumType_Periodic
- } EventTriggerEnumType;
- /* FirmwareStatusEnumType */
- typedef enum {
- FirmwareStatusEnumType_Downloaded,
- FirmwareStatusEnumType_DownloadFailed,
- FirmwareStatusEnumType_Downloading,
- FirmwareStatusEnumType_DownloadScheduled,
- FirmwareStatusEnumType_DownloadPaused,
- FirmwareStatusEnumType_Idle,
- FirmwareStatusEnumType_InstallationFailed,
- FirmwareStatusEnumType_Installing,
- FirmwareStatusEnumType_Installed,
- FirmwareStatusEnumType_InstallRebooting,
- FirmwareStatusEnumType_InstallScheduled,
- FirmwareStatusEnumType_InstallVerificationFailed,
- FirmwareStatusEnumType_InvalidSignature,
- FirmwareStatusEnumType_SignatureVerified
- } FirmwareStatusEnumType;
- /* GenericDeviceModelStatusEnumType */
- typedef enum {
- GenericDeviceModelStatusEnumType_Accepted,
- GenericDeviceModelStatusEnumType_Rejected,
- GenericDeviceModelStatusEnumType_NotSupported,
- GenericDeviceModelStatusEnumType_EmptyResultSet
- } GenericDeviceModelStatusEnumType;
- /* GenericStatusEnumType */
- typedef enum {
- GenericStatusEnumType_Accepted,
- GenericStatusEnumType_Rejected
- } GenericStatusEnumType;
- /* GetCertificateIdUseEnumType */
- typedef enum {
- GetCertificateIdUseEnumType_V2GRootCertificate,
- GetCertificateIdUseEnumType_MORootCertificate,
- GetCertificateIdUseEnumType_CSMSRootCertificate,
- GetCertificateIdUseEnumType_V2GCertificateChain,
- GetCertificateIdUseEnumType_ManufacturerRootCertificate
- } GetCertificateIdUseEnumType;
- /* GetCertificateStatusEnumType */
- typedef enum {
- GetCertificateStatusEnumType_Accepted,
- GetCertificateStatusEnumType_Failed
- } GetCertificateStatusEnumType;
- /* GetChargingProfileStatusEnumType */
- typedef enum {
- GetChargingProfileStatusEnumType_Accepted,
- GetChargingProfileStatusEnumType_NoProfiles
- } GetChargingProfileStatusEnumType;
- /* GetDisplayMessagesStatusEnumType */
- typedef enum {
- GetDisplayMessagesStatusEnumType_Accepted,
- GetDisplayMessagesStatusEnumType_Unknown
- } GetDisplayMessagesStatusEnumType;
- /* GetInstalledCertificateStatusEnumType */
- typedef enum {
- GetInstalledCertificateStatusEnumType_Accepted,
- GetInstalledCertificateStatusEnumType_NotFound
- } GetInstalledCertificateStatusEnumType;
- /* GetVariableStatusEnumType */
- typedef enum {
- GetVariableStatusEnumType_Accepted,
- GetVariableStatusEnumType_Rejected,
- GetVariableStatusEnumType_UnknownComponent,
- GetVariableStatusEnumType_UnknownVariable,
- GetVariableStatusEnumType_NotSupportedAttributeType
- } GetVariableStatusEnumType;
- /* HashAlgorithmEnumType */
- typedef enum {
- HashAlgorithmEnumType_SHA256,
- HashAlgorithmEnumType_SHA384,
- HashAlgorithmEnumType_SHA512
- } HashAlgorithmEnumType;
- /* IdTokenEnumType */
- typedef enum {
- IdTokenEnumType_Central,
- IdTokenEnumType_eMAID,
- IdTokenEnumType_ISO14443,
- IdTokenEnumType_KeyCode,
- IdTokenEnumType_Local,
- IdTokenEnumType_NoAuthorization,
- IdTokenEnumType_ISO15693
- } IdTokenEnumType;
- /* InstallCertificateUseEnumType */
- typedef enum {
- InstallCertificateUseEnumType_V2GRootCertificate,
- InstallCertificateUseEnumType_MORootCertificate,
- InstallCertificateUseEnumType_CSMSRootCertificate,
- InstallCertificateUseEnumType_ManufacturerRootCertificate
- } InstallCertificateUseEnumType;
- /* InstallCertificateStatusEnumType */
- typedef enum {
- InstallCertificateStatusEnumType_Accepted,
- InstallCertificateStatusEnumType_Failed,
- InstallCertificateStatusEnumType_Rejected
- } InstallCertificateStatusEnumType;
- /* Iso15118EVCertificateStatusEnumType */
- typedef enum {
- Iso15118EVCertificateStatusEnumType_Accepted,
- Iso15118EVCertificateStatusEnumType_Failed
- } Iso15118EVCertificateStatusEnumType;
- /* LocationEnumType */
- typedef enum {
- LocationEnumType_Body,
- LocationEnumType_Cable,
- LocationEnumType_EV,
- LocationEnumType_Inlet,
- LocationEnumType_Outlet
- } LocationEnumType;
- /* LogEnumType */
- typedef enum {
- LogEnumType_DiagnosticsLog,
- LogEnumType_SecurityLog
- } LogEnumType;
- /* LogStatusEnumType */
- typedef enum {
- LogStatusEnumType_Accepted,
- LogStatusEnumType_Rejected,
- LogStatusEnumType_AcceptedCanceled
- } LogStatusEnumType;
- /* MeasurandEnumType */
- typedef enum {
- MeasurandEnumType_Current_Export,
- MeasurandEnumType_Current_Import,
- MeasurandEnumType_Current_Offered,
- MeasurandEnumType_Energy_Active_Export_Register,
- MeasurandEnumType_Energy_Active_Import_Register,
- MeasurandEnumType_Energy_Reactive_Export_Register,
- MeasurandEnumType_Energy_Reactive_Import_Register,
- MeasurandEnumType_Energy_Active_Export_Interval,
- MeasurandEnumType_Energy_Active_Import_Interval,
- MeasurandEnumType_Energy_Active_Net,
- MeasurandEnumType_Energy_Reactive_Export_Interval,
- MeasurandEnumType_Energy_Reactive_Import_Interval,
- MeasurandEnumType_Energy_Reactive_Net,
- MeasurandEnumType_Energy_Apparent_Net,
- MeasurandEnumType_Energy_Apparent_Import,
- MeasurandEnumType_Energy_Apparent_Export,
- MeasurandEnumType_Frequency,
- MeasurandEnumType_Power_Active_Export ,
- MeasurandEnumType_Power_Active_Import,
- MeasurandEnumType_Power_Factor,
- MeasurandEnumType_Power_Offered,
- MeasurandEnumType_Power_Reactive_Export,
- MeasurandEnumType_Power_Reactive_Import,
- MeasurandEnumType_SoC,
- MeasurandEnumType_Voltage
- } MeasurandEnumType;
- /* MessageFormatEnumType */
- typedef enum {
- MessageFormatEnumType_ASCII,
- MessageFormatEnumType_HTML,
- MessageFormatEnumType_URI,
- MessageFormatEnumType_UTF8
- } MessageFormatEnumType;
- /* MessagePriorityEnumType */
- typedef enum {
- MessagePriorityEnumType_AlwaysFront,
- MessagePriorityEnumType_InFront,
- MessagePriorityEnumType_NormalCycle
- } MessagePriorityEnumType;
- /* MessageStateEnumType */
- typedef enum {
- MessageStateEnumType_Charging,
- MessageStateEnumType_Faulted,
- MessageStateEnumType_Idle,
- MessageStateEnumType_Unavailable
- } MessageStateEnumType;
- /* MessageTriggerEnumType */
- typedef enum {
- MessageTriggerEnumType_BootNotification,
- MessageTriggerEnumType_LogStatusNotification,
- MessageTriggerEnumType_FirmwareStatusNotification,
- MessageTriggerEnumType_Heartbeat,
- MessageTriggerEnumType_MeterValues,
- MessageTriggerEnumType_SignChargingStationCertificate,
- MessageTriggerEnumType_SignV2GCertificate,
- MessageTriggerEnumType_StatusNotification,
- MessageTriggerEnumType_TransactionEvent,
- MessageTriggerEnumType_SignCombinedCertificate,
- MessageTriggerEnumType_PublishFirmwareStatusNotification
- } MessageTriggerEnumType;
- /* MonitorEnumType */
- typedef enum {
- MonitorEnumType_UpperThreshold,
- MonitorEnumType_LowerThreshold,
- MonitorEnumType_Delta,
- MonitorEnumType_Periodic,
- MonitorEnumType_PeriodicClockAligned
- } MonitorEnumType;
- /* MonitoringBaseEnumType */
- typedef enum {
- MonitoringBaseEnumType_All,
- MonitoringBaseEnumType_FactoryDefault,
- MonitoringBaseEnumType_HardWiredOnly
- } MonitoringBaseEnumType;
- /* MonitoringCriterionEnumType */
- typedef enum {
- MonitoringCriterionEnumType_ThresholdMonitoring,
- MonitoringCriterionEnumType_DeltaMonitoring,
- MonitoringCriterionEnumType_PeriodicMonitoring
- } MonitoringCriterionEnumType;
- /* MutabilityEnumType */
- typedef enum {
- MutabilityEnumType_ReadOnly,
- MutabilityEnumType_WriteOnly,
- MutabilityEnumType_ReadWrite
- } MutabilityEnumType;
- /* NotifyEVChargingNeedsStatusEnumType */
- typedef enum {
- NotifyEVChargingNeedsStatusEnumType_Accepted,
- NotifyEVChargingNeedsStatusEnumType_Rejected,
- NotifyEVChargingNeedsStatusEnumType_Processing
- } NotifyEVChargingNeedsStatusEnumType;
- /* OCPPInterfaceEnumType */
- typedef enum {
- OCPPInterfaceEnumType_Wired0,
- OCPPInterfaceEnumType_Wired1,
- OCPPInterfaceEnumType_Wired2,
- OCPPInterfaceEnumType_Wired3,
- OCPPInterfaceEnumType_Wireless0,
- OCPPInterfaceEnumType_Wireless1,
- OCPPInterfaceEnumType_Wireless2,
- OCPPInterfaceEnumType_Wireless3
- } OCPPInterfaceEnumType;
- /* OCPPTransportEnumType */
- typedef enum {
- OCPPTransportEnumType_JSON,
- OCPPTransportEnumType_SOAP
- } OCPPTransportEnumType;
- /* OCPPVersionEnumType */
- typedef enum {
- OCPPVersionEnumType_OCPP12,
- OCPPVersionEnumType_OCPP15,
- OCPPVersionEnumType_OCPP16,
- OCPPVersionEnumType_OCPP20
- } OCPPVersionEnumType;
- /* OperationalStatusEnumType */
- typedef enum {
- OperationalStatusEnumType_Inoperative,
- OperationalStatusEnumType_Operative
- } OperationalStatusEnumType;
- /* PhaseEnumType */
- typedef enum {
- PhaseEnumType_L1,
- PhaseEnumType_L2,
- PhaseEnumType_L3,
- PhaseEnumType_N,
- PhaseEnumType_L1_N,
- PhaseEnumType_L2_N,
- PhaseEnumType_L3_N,
- PhaseEnumType_L1_L2,
- PhaseEnumType_L2_L3,
- PhaseEnumType_L3_L1
- } PhaseEnumType;
- /* PublishFirmwareStatusEnumType */
- typedef enum {
- PublishFirmwareStatusEnumType_Downloaded,
- PublishFirmwareStatusEnumType_DownloadFailed,
- PublishFirmwareStatusEnumType_Downloading,
- PublishFirmwareStatusEnumType_DownloadScheduled,
- PublishFirmwareStatusEnumType_DownloadPaused,
- PublishFirmwareStatusEnumType_PublishFailed,
- PublishFirmwareStatusEnumType_Published,
- PublishFirmwareStatusEnumType_InvalidChecksum,
- PublishFirmwareStatusEnumType_ChecksumVerified
- } PublishFirmwareStatusEnumType;
- /* ReadingContextEnumType */
- typedef enum {
- ReadingContextEnumType_Interruption_Begin,
- ReadingContextEnumType_Interruption_End,
- ReadingContextEnumType_Other,
- ReadingContextEnumType_Sample_Clock,
- ReadingContextEnumType_Sample_Periodic,
- ReadingContextEnumType_Transaction_Begin,
- ReadingContextEnumType_Transaction_End,
- ReadingContextEnumType_Trigger
- } ReadingContextEnumType;
- /* ReasonEnumType */
- typedef enum {
- ReasonEnumType_DeAuthorized,
- ReasonEnumType_EmergencyStop,
- ReasonEnumType_EnergyLimitReached,
- ReasonEnumType_EVDisconnected,
- ReasonEnumType_GroundFault,
- ReasonEnumType_ImmediateReset,
- ReasonEnumType_Local,
- ReasonEnumType_LocalOutOfCredit,
- ReasonEnumType_MasterPass,
- ReasonEnumType_Other,
- ReasonEnumType_OvercurrentFault,
- ReasonEnumType_PowerLoss,
- ReasonEnumType_PowerQuality,
- ReasonEnumType_Reboot,
- ReasonEnumType_Remote,
- ReasonEnumType_SOCLimitReached,
- ReasonEnumType_StoppedByEV,
- ReasonEnumType_TimeLimitReached,
- ReasonEnumType_Timeout
- } ReasonEnumType;
- /* RecurrencyKindEnumType */
- typedef enum {
- RecurrencyKindEnumType_Daily,
- RecurrencyKindEnumType_Weekly
- } RecurrencyKindEnumType;
- /* RegistrationStatusEnumType */
- typedef enum {
- RegistrationStatusEnumType_Accepted,
- RegistrationStatusEnumType_Pending,
- RegistrationStatusEnumType_Rejected
- } RegistrationStatusEnumType;
- /* ReportBaseEnumType */
- typedef enum {
- ReportBaseEnumType_ConfigurationInventory,
- ReportBaseEnumType_FullInventory,
- ReportBaseEnumType_SummaryInventory
- } ReportBaseEnumType;
- /* RequestStartStopStatusEnumType */
- typedef enum {
- RequestStartStopStatusEnumType_Accepted,
- RequestStartStopStatusEnumType_Rejected
- } RequestStartStopStatusEnumType;
- /* ReservationUpdateStatusEnumType */
- typedef enum {
- ReservationUpdateStatusEnumType_Expired,
- ReservationUpdateStatusEnumType_Removed
- } ReservationUpdateStatusEnumType;
- /* ReserveNowStatusEnumType */
- typedef enum {
- ReserveNowStatusEnumType_Accepted,
- ReserveNowStatusEnumType_Faulted,
- ReserveNowStatusEnumType_Occupied,
- ReserveNowStatusEnumType_Rejected,
- ReserveNowStatusEnumType_Unavailable
- } ReserveNowStatusEnumType;
- /* ResetEnumType */
- typedef enum {
- ResetEnumType_Immediate,
- ResetEnumType_OnIdle
- } ResetEnumType;
- /* ResetStatusEnumType */
- typedef enum {
- ResetStatusEnumType_Accepted,
- ResetStatusEnumType_Rejected,
- ResetStatusEnumType_Scheduled
- } ResetStatusEnumType;
- /* SetMonitoringStatusEnumType */
- typedef enum {
- SetMonitoringStatusEnumType_Accepted,
- SetMonitoringStatusEnumType_UnknownComponent,
- SetMonitoringStatusEnumType_UnknownVariable,
- SetMonitoringStatusEnumType_UnsupportedMonitorType,
- SetMonitoringStatusEnumType_Rejected,
- SetMonitoringStatusEnumType_OutOfRange,
- SetMonitoringStatusEnumType_Duplicate
- } SetMonitoringStatusEnumType;
- /* SetNetworkProfileStatusEnumType */
- typedef enum {
- SetNetworkProfileStatusEnumType_Accepted,
- SetNetworkProfileStatusEnumType_Rejected,
- SetNetworkProfileStatusEnumType_Failed
- } SetNetworkProfileStatusEnumType;
- /* SetVariableStatusEnumType */
- typedef enum {
- SetVariableStatusEnumType_Accepted,
- SetVariableStatusEnumType_Rejected,
- SetVariableStatusEnumType_InvalidValue,
- SetVariableStatusEnumType_UnknownComponent,
- SetVariableStatusEnumType_UnknownVariable,
- SetVariableStatusEnumType_NotSupportedAttributeType,
- SetVariableStatusEnumType_OutOfRange,
- SetVariableStatusEnumType_RebootRequired
- } SetVariableStatusEnumType;
- /* TransactionEventEnumType */
- typedef enum {
- TransactionEventEnumType_Ended,
- TransactionEventEnumType_Started,
- TransactionEventEnumType_Updated
- } TransactionEventEnumType;
- /* TriggerMessageStatusEnumType */
- typedef enum {
- TriggerMessageStatusEnumType_Accepted,
- TriggerMessageStatusEnumType_Rejected,
- TriggerMessageStatusEnumType_NotImplemented
- } TriggerMessageStatusEnumType;
- /* TriggerReasonEnumType */
- typedef enum {
- TriggerReasonEnumType_Authorized,
- TriggerReasonEnumType_CablePluggedIn,
- TriggerReasonEnumType_ChargingRateChanged,
- TriggerReasonEnumType_ChargingStateChanged,
- TriggerReasonEnumType_Deauthorized,
- TriggerReasonEnumType_EnergyLimitReached,
- TriggerReasonEnumType_EVCommunicationLost,
- TriggerReasonEnumType_EVConnectTimeout,
- TriggerReasonEnumType_MeterValueClock,
- TriggerReasonEnumType_MeterValuePeriodic,
- TriggerReasonEnumType_TimeLimitReached,
- TriggerReasonEnumType_Trigger,
- TriggerReasonEnumType_UnlockCommand,
- TriggerReasonEnumType_StopAuthorized,
- TriggerReasonEnumType_EVDeparted,
- TriggerReasonEnumType_EVDetected,
- TriggerReasonEnumType_RemoteStop,
- TriggerReasonEnumType_RemoteStart,
- TriggerReasonEnumType_AbnormalCondition,
- TriggerReasonEnumType_SignedDataReceived,
- TriggerReasonEnumType_ResetCommand
- } TriggerReasonEnumType;
- /* UnlockStatusEnumType */
- typedef enum {
- UnlockStatusEnumType_Unlocked,
- UnlockStatusEnumType_UnlockFailed,
- UnlockStatusEnumType_OngoingAuthorizedTransaction,
- UnlockStatusEnumType_UnknownConnector
- } UnlockStatusEnumType;
- /* UnpublishFirmwareStatusEnumType */
- typedef enum {
- Unpublished_DownloadOngoing,
- Unpublished_NoFirmware,
- Unpublished_Unpublished
- } UnpublishFirmwareStatusEnumType;
- /* UpdateEnumType */
- typedef enum {
- UpdateEnumType_Differential,
- UpdateEnumType_Full
- } UpdateEnumType;
- /* UpdateFirmwareStatusEnumType */
- typedef enum {
- UpdateFirmwareStatusEnumType_Accepted,
- UpdateFirmwareStatusEnumType_Rejected,
- UpdateFirmwareStatusEnumType_AcceptedCanceled,
- UpdateFirmwareStatusEnumType_InvalidCertificate,
- UpdateFirmwareStatusEnumType_RevokedCertificate
- } UpdateFirmwareStatusEnumType;
- /* UpdateStatusEnumType */
- typedef enum {
- UpdateStatusEnumType_Accepted,
- UpdateStatusEnumType_Failed,
- UpdateStatusEnumType_VersionMismatch
- } UpdateStatusEnumType;
- /* UploadLogStatusEnumType */
- typedef enum {
- UploadLogStatusEnumType_BadMessage,
- UploadLogStatusEnumType_Idle,
- UploadLogStatusEnumType_NotSupportedOperation,
- UploadLogStatusEnumType_PermissionDenied,
- UploadLogStatusEnumType_Uploaded,
- UploadLogStatusEnumType_UploadFailure,
- UploadLogStatusEnumType_Uploading
- } UploadLogStatusEnumType;
- /* VPNEnumType */
- typedef enum {
- VPNEnumType_IKEv2,
- VPNEnumType_IPSec,
- VPNEnumType_L2TP,
- VPNEnumType_PPTP
- } VPNEnumType;
- struct StructPeriod
- {
- int StartPeriod;
- float Limit;//0.1;
- int NumberPhases;
- };
- struct StructProfile
- {
- int Duration;
- int TotalPeriod;
- struct StructPeriod Period[10];
- };
- //===============================================
- // Common routine
- //===============================================
- int initialConfigurationTable(void);
- void StoreConfigurationTable(void);
- void GetStartTransactionIdTag(int gun_index);
- //==========================================
- // send request routine
- //==========================================
- int sendAuthorizeRequest(int gun_index);
- int sendBootNotificationRequest(void);
- int sendClearedChargingLimitRequest(int gun_index);
- int sendDataTransferRequest(int gun_index);
- int sendFirmwareStatusNotificationRequest(char *status);
- int sendGet15118EVCertificateRequest();
- int sendGetCertificateStatusRequest();
- int sendHeartbeatRequest();
- int sendLogStatusNotificationRequest(char *status);
- int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType);
- int sendNotifyChargingLimitRequest(int gun_index);
- int sendNotifyCustomerInformationRequest();
- int sendNotifyDisplayMessagesRequest();
- int sendNotifyEVChargingNeedsRequest(int gun_index);
- int sendNotifyEVChargingScheduleRequest(int gun_index);
- int sendNotifyEventRequest();
- int sendNotifyMonitoringReportRequest();
- int sendNotifyReportRequest();
- int sendPublishFirmwareStatusNotificationRequest();
- int sendReportChargingProfilesRequest(int gun_index);
- int sendReservationStatusUpdateRequest(int gun_index);
- int sendSecurityEventNotificationRequest();
- int sendSignCertificateRequest();
- int sendStatusNotificationRequest(int gun_index);
- int sendTransactionEventRequest(int gun_index);
- //==========================================
- // send confirm routine
- //==========================================
- int sendCancelReservationConfirmation(char *uuid, unsigned char gun_index);
- int sendCertificateSignedConfirmation(char *uuid);
- int sendChangeAvailabilityConfirmation(char *uuid, unsigned char gun_index);
- int sendClearCacheConfirmation(char *uuid);
- int sendClearChargingProfileConfirmation(char *uuid,char *payload);
- int sendClearDisplayMessageConfirmation(char *uuid);
- int sendClearVariableMonitoringConfirmation(char *uuid, unsigned char variableQuantity);
- int sendCostUpdatedConfirmation(char *uuid);
- int sendCustomerInformationConfirmation(char *uuid);
- int sendDataTransferConfirmation(char *uuid, unsigned char gun_index);
- int sendDeleteCertificateConfirmation(char *uuid);
- int sendGetBaseReportConfirmation(char *uuid);
- int sendGetChargingProfilesConfirmation(char *uuid, unsigned char gun_index);
- int sendGetCompositeScheduleConfirmation(char *uuid,char *payload, int connectorIdInt,int nPeriod);
- int sendGetDisplayMessagesConfirmation(char *uuid);
- int sendGetInstalledCertificateIdsConfirmation(char *uuid, unsigned char certQuantity);
- int sendGetLocalListVersionConfirmation(char *uuid);
- int sendGetLogConfirmation(char *uuid);
- int sendGetMonitoringReportConfirmation(char *uuid);
- int sendGetReportConfirmation(char *uuid);
- int sendGetTransactionStatusConfirmation(char *uuid, unsigned char gun_index);
- int sendGetVariablesConfirmation(char *uuid, unsigned char variableQuantity);
- int sendInstallCertificateConfirmation(char *uuid);
- int sendPublishFirmwareConfirmation(char *uuid);
- int sendRemoteStartTransactionConfirmation(char *uuid, unsigned char gun_index);
- int sendRemoteStopTransactionConfirmation(char *uuid, unsigned char gun_index);
- int sendReserveNowConfirmation(char *uuid, unsigned char gun_index);
- int sendResetConfirmation(char *uuid);
- int sendSendLocalListConfirmation(char *uuid);
- int sendSetChargingProfileConfirmation(char *uuid, unsigned char gun_index);
- int sendSetDisplayMessagesConfirmation(char *uuid);
- int sendSetMonitoringBaseConfirmation(char *uuid);
- int sendSetMonitoringLevelConfirmation(char *uuid);
- int sendSetNetworkProfileConfirmation(char *uuid);
- int sendSetVariableMonitoringConfirmation(char *uuid, unsigned char variableQuantity);
- int sendSetVariableConfirmation(char *uuid, unsigned char variableQuantity);
- int sendTriggerMessageConfirmation(char *uuid);
- int sendUnlockConnectorConfirmation(char *uuid, unsigned char gun_index);
- int sendUnpublishFirmwareConfirmation(char *uuid);
- int sendUpdateFirmwareConfirmation(char *uuid);
- int sendUnknownConfirmation(char *uuid);
- //==========================================
- // send CallError routine
- //==========================================
- void SendCallError(char *uniqueId, char *action, char *errorCode, char *errorDescription);
- //==========================================
- // Handle server request routine Start
- //==========================================
- int handleCancelReservationRequest(char *uuid, char *payload);
- int handleCertificateSignedRequest(char *uuid, char *payload);
- int handleChangeAvailabilityRequest(char *uuid, char *payload);
- int handleClearCacheRequest(char *uuid, char *payload);
- int handleClearChargingProfileRequest(char *uuid, char *payload);
- int handleClearDisplayMessageRequest(char *uuid, char *payload);
- int handleClearVariableMonitoringRequest(char *uuid, char *payload);
- int handleCostUpdatedRequest(char *uuid, char *payload);
- int handleCustomerInformationRequest(char *uuid, char *payload);
- int handleDataTransferRequest(char *uuid, char *payload);
- int handleDeleteCertificateRequest(char *uuid, char *payload);
- int handleGetBaseReportRequest(char *uuid, char *payload);
- int handleGetChargingProfilesRequest(char *uuid, char *payload);
- int handleGetCompositeScheduleRequest(char *uuid, char *payload);
- int handleGetDisplayMessagesRequest(char *uuid, char *payload);
- int handleGetInstalledCertificateIdsRequest(char *uuid, char *payload);
- int handleGetLocalListVersionRequest(char *uuid, char *payload);
- int handleGetLogRequest(char *uuid, char *payload);
- int handleGetMonitoringReportRequest(char *uuid, char *payload);
- int handleGetReportRequest(char *uuid, char *payload);
- int handleGetTransactionStatusRequest(char *uuid, char *payload);
- int handleGetVariablesRequest(char *uuid, char *payload);
- int handleInstallCertificateRequest(char *uuid, char *payload);
- int handlePublishFirmwareRequest(char *uuid, char *payload);
- int handleRequestStartTransactionRequest(char *uuid, char *payload);
- int handleRequestStopTransactionRequest(char *uuid, char *payload);
- int handleReserveNowRequest(char *uuid, char *payload);
- int handleResetRequest(char *uuid, char *payload);
- int handleSendLocalListRequest(char *uuid, char *payload);
- int handleSetChargingProfileRequest(char *uuid, char *payload);
- int handleSetDisplayMessageRequest(char *uuid, char *payload);
- int handleSetMonitoringBaseRequest(char *uuid, char *payload);
- int handleSetMonitoringLevelRequest(char *uuid, char *payload);
- int handleSetNetworkProfileRequest(char *uuid, char *payload);
- int handleSetVariableMonitoringRequest(char *uuid, char *payload);
- int handleSetVariablesRequest(char *uuid, char *payload);
- int handleTriggerMessageRequest(char *uuid, char *payload);
- int handleUnlockConnectorRequest(char *uuid, char *payload);
- int handleUnpublishFirmwareRequest(char *uuid, char *payload);
- int handleUpdateFirmwareRequest(char *uuid, char *payload);
- int handleUnknownRequest(char *uuid, char *payload);
- void handleAuthorizeResponse(char *payload, int gun_index);
- void handleBootNotificationResponse(char *payload, int gun_index);
- void handleClearedChargingLimitResponse(char *payload, int gun_index);
- void handleDataTransferResponse(char *payload, int gun_index);
- void handleFirmwareStatusNotificationResponse(char *payload, int gun_index);
- void handleGet15118EVCertificateResponse(char *payload, int gun_index);
- void handleGetCertificateStatusResponse(char *payload, int gun_index);
- void handleHeartbeatResponse(char *payload, int gun_index);
- void handleLogStatusNotificationResponse(char *payload, int gun_index);
- void handleMeterValuesResponse(char *payload, int gun_index);
- void handleNotifyChargingLimitResponse(char *payload, int gun_index);
- void handleNotifyCustomerInformationResponse(char *payload, int gun_index);
- void handleNotifyDisplayMessagesResponse(char *payload, int gun_index);
- void handleNotifyEVChargingNeedsResponse(char *payload, int gun_index);
- void handleNotifyEVChargingScheduleResponse(char *payload, int gun_index);
- void handleNotifyEventResponse(char *payload, int gun_index);
- void handleNotifyMonitoringReportResponse(char *payload, int gun_index);
- void handleNotifyReportResponse(char *payload, int gun_index);
- void handlePublishFirmwareStatusNotificationResponse(char *payload, int gun_index);
- void handleReportChargingProfilesResponse(char *payload, int gun_index);
- void handleReservationStatusUpdateResponse(char *payload, int gun_index);
- void handleSecurityEventNotificationResponse(char *payload, int gun_index);
- void handleSignCertificateResponse(char *payload, int gun_index);
- void handleStatusNotificationResponse(char *payload, int gun_index);
- void handleTransactionEvenResponse(char *payload, int gun_index);
- //==========================================
- // Handle Error routine
- //==========================================
- void handleError(char *id, char *errorCode, char *errorDescription,char *payload);
- //===============================================
- // Common routine
- //===============================================
- void getKeyValue(char *keyReq);
- int setKeyValue(char *key, char *value);
- int updateSetting(char *key, char *value);
- int httpDownLoadFile(char *location, char *path, char *filename,char *url);
- int ftpDownLoadFile(char *location, char *user, char *password, int port, char *path, char *filename,char *url);
- void *UpdateFirmwareProcess(void* data);
- void* GetDiagnosticsProcess(void* data);
- int httpUploadFile(char *location, char *path, char *filename,char *url);
- int ftpUploadFile(char *location, char *user, char *password, int port, char *path, char *fnamePlusPath,char *filename);
- int get_file_contents(const char* filename, char** outbuffer);
- void LWS_Send(char * str);
- void LWS_SendNow(char * str);
- extern int queue_operation(int type, char *frontUUID, char *frontData);
- int GetOcppServerURL();
- int GetOcppPath();
- int GetOcppPort();
- int GetTransactionId(int gunindex, unsigned char idTag[], uint8_t isStopTransaction);
- void SetTransactionIdZero(int transactionId);
- void GetChargingProfileRequest(int gunindex);
- void FillStartTransaction(int ConnectorId, unsigned char IdTag[], int MeterStart,int ReservationId,unsigned char Timestamp[]);
- void splitstring(char *src,const char *separator,char **dest,int *num);
- int GetWebSocketPingInterval(void);
- int GetInternetConn(void);
- int GetBackendConnectionTimeout(void);
- int isConnectorInitMode(int gun_index);
- void refreshProcDogTimer();
- int GetServerSign(void);
- void SetServerSign(int value);
- int GetBootNotificationInterval(void);
- void InitialSystemValue(void);
- void checkTempStopTransaction(int gun_index);
- void storeTempStopTransaction(int gun_index);
- #endif
|