define.h 116 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511
  1. /*===========================================================================
  2. Combined Charging System (CCS): SECC
  3. define.h
  4. initiated by Vern, Joseph
  5. (since 2019/07/19)
  6. =============================================================================*/
  7. #ifndef DEFINE_H_
  8. #define DEFINE_H_
  9. #include "version.h"
  10. #include <stdlib.h>
  11. #include <stdio.h>
  12. #include <time.h>
  13. #include <sys/timeb.h>
  14. //#include "CsuCommAC.h"
  15. /**************************************************************************************/
  16. /*********************************NAND Flash mapping *****************************/
  17. /**************************************************************************************/
  18. /*
  19. sector size 512 KiB
  20. Page size 4096 b
  21. OOB size 224 b
  22. Erase size 524288 b
  23. -------------------------------------------------------------------------------------------------------------------------------
  24. Segment Physical address Size
  25. -------------------------------------------------------------------------------------------------------------------------------
  26. MLO 0x00000000-0x0007FFFF 512 KB
  27. Primary u-boot 0x00080000-0x0017FFFF 1 MB
  28. Environment 0x00180000-0x001FFFFF 512 KB
  29. Secondary u-boot 0x00200000-0x002FFFFF 1 MB
  30. Primary dtb 0x00300000-0x0037FFFF 512 KB
  31. Secondary dtb 0x00380000-0x003FFFFF 512 KB
  32. Primary kernel 0x00400000-0x00DFFFFF 10 MB
  33. Secondary Kernel 0x00E00000-0x017FFFFF 10 MB
  34. Primary root file system 0x01800000-0x029FFFFF 24 MB
  35. Secondary root file system 0x03000000-0x047FFFFF 24 MB
  36. Primary user configuration 0x04800000-0x004DFFFF 6 MB
  37. Secondary user configuration 0x04E00000-0x0053FFFF 6 MB
  38. Factory default configuration 0x05400000-0x0059FFFF 6 MB
  39. Storage 0x05A00000-0x7FFFFFFF 1958 MB
  40. */
  41. #define ENABLE 1
  42. #define DISABLE 0
  43. #define PASS 1
  44. #define FAIL 0
  45. #define DIN70122_ISO15118_VERIFICATION
  46. /**************************************************************************************/
  47. /*********************************System Limitation**********************************/
  48. /**************************************************************************************/
  49. #ifdef AWCCS
  50. #undef CONNECTOR_TEMP_DETECTION
  51. #define CCS_ENERGY_TRANSFER_MODE MODE_AC_SINGLE_PHASE_CORE
  52. #else
  53. #define CCS_ENERGY_TRANSFER_MODE MODE_DC_EXTENDED
  54. #endif
  55. //#define SUPPORT_ISO15118_PnC
  56. //#define SUPPORT_ISO15118_VAS
  57. //#define SUPPORT_TLS_CONNECTION
  58. #define SUPPORT_DIN70122_ISO15118_4 0
  59. #define MIN_SUPPORTED_CURRENT 3
  60. #define CONNECTOR_TEMP_DETECTION //REMA
  61. #ifdef SUPPORT_ISO15118_VAS
  62. #define SUPPORT_TLS_CONNECTION
  63. #endif
  64. #ifdef SUPPORT_ISO15118_PnC
  65. #define SUPPORT_TLS_CONNECTION
  66. #endif
  67. #define SIZE_OF_LOG_BUFFER 256 //Bytes
  68. #define PARAMETER_NORMAL_MODE ENABLE //DISABLE: using sudo parameters
  69. //ENABLE: using CAN commands
  70. //For Test or Burn-in Purpose
  71. #define MANUAL_SET_EV_TARGET_FUNCTION DISABLE
  72. #define SUDO_EV_TARGET_VOLTAGE 500 //unit: 1V
  73. #define SUDO_EV_TARGET_CURRENT 60 //unit: 1A
  74. //Configuration for CCS EVSE Process
  75. #define CABLECHECK_TARGET_VOLTAGE 500 //unit 1V, default: 500V
  76. #define CABLECHECK_TARGET_CURRENT 2 //unit: 1A, default: 2A
  77. #define PRECHARGE_TARGET_CURRENT 2 //unit: 1A, default: 2A
  78. //EVSE ID
  79. #define CCS_AC_EVSEID "PHIHONG_CCS_AC_001" //max: DIN = 32, ISO1/ISO2 = 37 bytes
  80. #define CCS_DC_EVSEID "PHIHONG_CCS_DC_001" //max: DIN = 32, ISO1/ISO2 = 37 bytes
  81. #define CCS_AC_METER_ID "ABCDE-0123456789-0123456789" //max = 32 bytes
  82. #define CCS_AC_SIG_METER_READING "SIG_METER_READING_ABCDE-0123456789" //max = 64 bytes
  83. /*CCS Protocol ID*/
  84. #define V2GT_MSG_PROTOCOL_DIN70121 0
  85. #define V2GT_MSG_PROTOCOL_ISO15118_2014 1 //i.e. ISO15118-2 (ISO 1)
  86. #define V2GT_MSG_PROTOCOL_ISO15118_2018 2 //i.e. ISO15118-20 (ISO 2)
  87. #define V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY 255 //for auto detect highest priority protocol
  88. #define V2GT_MSG_PROTOCOL_PREFERENCE V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY// V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY // V2GT_MSG_PROTOCOL_ISO15118_2014//V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY
  89. //#define CCS_ENERGY_TRANSFER_MODE MODE_DC_EXTENDED
  90. //DC: MODE_DC_EXTENDED (default)
  91. //AC: MODE_AC_SINGLE_PHASE_CORE, MODE_AC_THREE_PHASE_CORE
  92. #define SET_NO_PWM_IF_NOT_GET_PERMISSION 0
  93. #define SET_5_PWM_ONCE_RX_CM_SLAC_PARM_REQ 1
  94. #define SET_5_PWM_ONCE_GET_PERMISSION_IN_AUTHORIZATIONRES 2
  95. #define FIRMWARE_VERSION_COMPILE_SETTING_RELEASE_MODE ENABLE //default: ENABLE: release; DISABLE: debug
  96. #define NEW_SLAC_ARCHITECTURE_SWITCH ENABLE //defualt: ENABLE
  97. #define CAN_RAMDOM_MATCHING_ID_MECHANISM ENABLE //defualt: ENABLE
  98. #define CAN_RX_TIMEOUT_MECHANISM DISABLE //defualt: ENABLE
  99. #define SLAC_FIRST_RESPONSE_METHOD SET_5_PWM_ONCE_RX_CM_SLAC_PARM_REQ
  100. #define TCPDUMP_PACKETS_SNIFFER_SWITCH DISABLE //default: DISABLE
  101. #define CANDUMP_PACKETS_SNIFFER_SWITCH DISABLE //default: DISABLE
  102. #define DYNAMIC_ETH0_IP_MECHANISM ENABLE //default: DISABLE
  103. #define CP_PROTECTION_MECHANISM ENABLE //default: ENABLE
  104. #define PP_PROTECTION_MECHANISM DISABLE //default: DISABLE
  105. #define SUDO_PSD_PARAMETER_MECHANISM ENABLE //default: ENABLE
  106. #define TESLA_SLOW_INCREASE_CURRENT_FUNCTION DISABLE
  107. #define V2G_SECC_TIMEOUT_PROTECTION ENABLE
  108. #define PATCH_FOR_BMW_I3_BUG_EVSEMAXIMUMVOLTAGELIMIT_599V ENABLE //default: ENABLE; CE/UL: DISABLE
  109. //CSU CAN Message EV Stop Type
  110. #define EV_NORMAL_STOP 1
  111. #define EV_EMERGENCY_STOP 2
  112. //CSU CAN Message GFD Isolation Status Type
  113. #define GFD_Invalid 0 //ongoing
  114. #define GFD_Valid 1
  115. #define GFD_Warning 2
  116. #define GFD_Fault 3
  117. #define GFD_No_IMD 4 //for ISO 15118
  118. //Default Ethernet Port Base for eth0
  119. #define ETH0_PORT_BASE 20
  120. //Energy Transfer Mode
  121. #define MODE_AC_SINGLE_PHASE_CORE 0
  122. #define MODE_AC_THREE_PHASE_CORE 1
  123. #define MODE_DC_CORE 2
  124. #define MODE_DC_EXTENDED 3
  125. #define MODE_DC_COMBO_CORE 4
  126. #define MODE_DC_UNIQUE 5
  127. /*
  128. 0xAaBbCcDd
  129. Aa: main version
  130. Bb: minor version
  131. Cc:
  132. 0x01: UL
  133. 0x02: CE
  134. 0x03: JP
  135. 0x04: GB
  136. Dd:
  137. 0x01: CCS protocol
  138. 0x02: CHAdeMO protocol
  139. 0x03: GB Protocol
  140. */
  141. /*Download Image Type*/
  142. #define IMAGE_TYPE_KERNEL_CONFIGURATION_DTB 1
  143. #define IMAGE_TYPE_BOOTLOADER_UBOOT 2
  144. #define IMAGE_TYPE_OS_KERNEL_ZIMAGE 3
  145. #define IMAGE_TYPE_ROOT_FILESYSTEM_RAMDISK 4
  146. #define IMAGE_TYPE_ROOT_APP_ZIP 5
  147. #define IMAGE_TYPE_BOOTLOADER_MLO_SPL 6
  148. #define IMAGE_TYPE_USER_CONFIGURATION 7
  149. //--- [CAUTION] To increase type ID, please modify this condition.
  150. //(Check_DwnldImgParameter())
  151. /*relevant to Quantity */
  152. #define CHAdeMO_QUANTITY 1
  153. #define CCS_QUANTITY 1
  154. #define GB_QUANTITY 1
  155. /*SystemLog message*/
  156. #define SystemLogMessage //for engineer to do analysis
  157. #define CSUCOMMDC_TASK_FLAG (ShmInternalComm->InternalCommUnion.bits)
  158. //#define CSUCOMMAC_SHM (ShmInternalCommAC->gun_info[0].acCcsInfo)
  159. #define EVCOMM_SYS_INFO (ShmSysConfigAndInfo->SysInfo.CcsChargingData[0])
  160. #define SLAC_INFO (ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].evcc_slac_data)
  161. #define CCS_HANDSHAKE_PROTOCOLS (ccs_handshake.supportedAppProtocolReq.AppProtocol)
  162. #define GPIO_SYS_DIR "/sys/class/gpio"
  163. #define GPIO_2_23_AM_IO_1 87
  164. // Debug Message
  165. #define DEBUG_CCS_EVEM_MESSAGE_SHOW ENABLE
  166. #if DEBUG_CCS_EVEM_MESSAGE_SHOW == ENABLE
  167. #define DEBUG_MAIN_PRINTF printf
  168. #define DEBUG_EVCOMM_PRINTF printf
  169. #else
  170. #define DEBUG_MAIN_PRINTF(...)
  171. #define DEBUG_EVCOMM_PRINTF(...)
  172. #endif
  173. //Precharge Relay Status
  174. #define EVSE_STATUS_NOT_READY_FOR_PRECHARGE 0 //un-initialized
  175. #define EVSE_STATUS_READY_FOR_PRECHARGE 2 //DC+ Relay: OFF, Precharge Relay: ON
  176. #define EVSE_STATUS_READY_FOR_ENERGY_TRANSFER 3 //DC+ Relay: ON, Precharge Relay: OFF
  177. /**************************************************************************************/
  178. /**************************share memory key information***************************/
  179. /**************************************************************************************/
  180. #define ShmSysConfigAndInfoKey 3001 //0xBB9
  181. #define ShmCcsCommKey 3004 //0xBBC
  182. #define ShmStatusCodeKey 3005 //0xBBD
  183. #define ShmInternalCommKey 3009 //0xBC1
  184. #define ShmInternalCommACKey 3007 //0x7D1
  185. /**************************************************************************************/
  186. /****structure SysConfigData => shall store the data to NAND flash****************/
  187. /****structure SysInfoData => shall NOT store the data to NAND flash***************/
  188. /****according to System Configuration and Information Table.xlsx Rev.0.2 *******/
  189. /**************************************************************************************/
  190. struct EthConfigData
  191. {
  192. unsigned char EthDhcpClient; //0: enable,1: disable
  193. unsigned char EthMacAddress[18]; //default: Null
  194. unsigned char EthIpAddress[16]; //Eth0 default:192.168.0.10 ,Eth1 default:192.168.1.10
  195. unsigned char EthSubmaskAddress[16]; //Eth0 default:255.255.255.0 ,Eth1 default:255.255.255.0
  196. unsigned char EthGatewayAddress[16]; //Eth0 default:192.168.0.254 ,Eth1 default:192.168.1.254
  197. };
  198. struct WifiConfigData
  199. {
  200. unsigned char WifiMode; //0: disable, 1: Infrastructure client, 2: Infrastructure server, 3: Ad-Hoc
  201. unsigned char WifiSsid[256]; //default: Null
  202. unsigned char WifiPassword[256]; //default: Null
  203. int WifiRssi; //dbm
  204. unsigned char WifiDhcpServer; //0: enable, 1: disable
  205. unsigned char WifiDhcpClient; //0: enable, 1: disable
  206. unsigned char WifiMacAddress[18]; //default: Null
  207. unsigned char WifiIpAddress[16]; //default:192.168.2.10
  208. unsigned char WifiSubmaskAddress[16]; //default:255.255.255.0
  209. unsigned char WifiGatewayAddress[16]; //default:192.168.2.254
  210. };
  211. struct TeleConfigData
  212. {
  213. unsigned char TelcomApn[256]; //default: Null
  214. int TelcomRssi; //dbm
  215. unsigned char TelcomChapPapId[256]; //default: Null
  216. unsigned char TelcomChapPapPwd[256]; //default: Null
  217. unsigned char TelcomModemImei[16]; //default: Null
  218. unsigned char TelcomSimImsi[16]; //default: Null
  219. unsigned char TelcomSimStatus; //0: no SIM card is found, 1: valid SIM card, 2: invalid SIM card
  220. unsigned char TelcomModemMode; //0: No services, 1: CDMA, 2: GSM/GPRS, 3: WCDMA, 4: GSM/WCDMA, 5: TD_SCDMA mode, 6: Unknow
  221. unsigned char TelcomIpAddress[16]; //default: Null
  222. };
  223. struct SysConfigData
  224. {
  225. /**************System***************/
  226. unsigned char ModelName[64]; //charger model name
  227. unsigned char SerialNumber[64]; //charger system serial number
  228. unsigned char SystemId[128]; //charger system ID
  229. unsigned char SystemDateTime[32]; //charger system date and time
  230. unsigned char AuthorisationMode; //0: Phihong RFID tag, 1: OCPP backend, 2: Phihong backend, 3: free mode
  231. unsigned char DefaultLanguage; //
  232. unsigned char RfidCardNumEndian; //0: little endian, 1: big endian
  233. unsigned short AcPlugInTimes; //0~65535
  234. unsigned short GbPlugInTimes; //0~65535
  235. unsigned short Ccs1PlugInTime; //0~65535
  236. unsigned short Ccs2PlugInTimes; //0~65535
  237. unsigned short ChademoPlugInTimes; //0~65535
  238. /**************Charging***************/
  239. unsigned short MaxChargingEnergy; //0: no limit, 1 ~ 65535 kWh
  240. unsigned short MaxChargingPower; //0: rating value, 1 ~ RATING_POWER kW"
  241. unsigned short MaxChargingCurrent; //0: rating value, 1 ~ RATING_CURRENT amp"
  242. unsigned short MaxChargingDuration; //0: no limit, 1 ~ 65535 minutes
  243. unsigned char PhaseLossPolicy; //0: charging, 1: stop charging
  244. unsigned char LocalWhiteCard[10][32]; //Max. card quantity is 10
  245. unsigned char UserId[32]; //the user use this ID to trigger charging event, it can be RFID card number, OCPP IdTag, etc.
  246. /**************Network***************/
  247. unsigned char FtpServer[32]; //the ftp server for Phihong server to do data transimission
  248. struct EthConfigData Eth0Interface;
  249. struct EthConfigData Eth1Interface;
  250. struct WifiConfigData AthInterface;
  251. struct TeleConfigData TelecomInterface;
  252. /**************Backend***************/
  253. unsigned int BackendConnTimeout; //default : 300s
  254. unsigned char OfflinePolicy; //0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
  255. unsigned short OfflineMaxChargeEnergy; //0: same as MaxChargingEnergy, 1 ~ 65535 kWh
  256. unsigned short OfflineMaxChargeDuration; //0: same as MaxChargeDuration, 1 ~ 65535 minutes
  257. 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"
  258. unsigned char ChargeBoxId[128];
  259. unsigned int Checksum; //4 bytes checksum
  260. };
  261. #define SLAC_EVSE_MAC_LENGTH 6
  262. #define SLAC_EVMAC_LENGTH 6
  263. #define SLAC_RUNID_LENGTH 8
  264. #define SLAC_AAG_LENGTH 64 //ISO 15118 defines it as 0x3A, i.e. 58
  265. struct EVCC_SLAC_DATA_ARRAY_TYPE {
  266. unsigned char EvMac[SLAC_EVMAC_LENGTH];
  267. unsigned char RunID[SLAC_RUNID_LENGTH];
  268. unsigned short AAG[SLAC_AAG_LENGTH];
  269. unsigned char StartAttenCharCnt;
  270. unsigned char StartAttenCharErr;
  271. unsigned char MnbcSoundNum;
  272. unsigned char MnbcSoundCnt;
  273. unsigned char AttenProfileCnt;
  274. unsigned char AagGroupsNum;
  275. unsigned char AttenCharRspCnt;
  276. unsigned char ValidateReqCnt;
  277. unsigned char MatchReqNum;
  278. float AAG_quality_ori;
  279. float AAG_quality_refined;
  280. };
  281. #define EVCC_SLAC_DATA_ARRAY_TYPE_ARRAY_SIZE 20
  282. struct EVCC_SLAC_DATA_TYPE {
  283. unsigned char arrayLen;
  284. struct EVCC_SLAC_DATA_ARRAY_TYPE array[EVCC_SLAC_DATA_ARRAY_TYPE_ARRAY_SIZE];
  285. };
  286. struct ChargingInfoData {
  287. float MaximumChargingVoltage; //0~6553.5 volt, unit = 1V
  288. float AvailableChargingCurrent; //0~6553.5 amp, unit =1A
  289. float AvailableChargingPower; //0~6553.5 kW, unit = 1KW
  290. float PresentChargingVoltage; //0~6553.5 volt, unit = 1V
  291. float PresentChargingCurrent; //0~6553.5 amp, unit = 1A
  292. float PresentChargingPower; //0~6553.5 kW, unit = 1KW
  293. float PresentChargedEnergy; //0~6553.5 kWh, unit = 1KWH
  294. int PresentChargedDuration; // second, unit = 1s
  295. int RemainChargingDuration; // second, unit = 1s
  296. float EvBatteryMaxVoltage; // 0~6553.5 volt, unit = 1V
  297. float EvBatteryMaxCurrent; //1V
  298. float EvBatteryMaxPower; //1KW
  299. float EvBatterytargetVoltage; // 0~6553.5 volt, unit = 1V
  300. float EvBatterytargetCurrent; //1A
  301. int EvBatterySoc; // 0~100%, unit = 1%
  302. float EvBatteryCapacity; //1KWH
  303. float EvBatteryEngergyRequest; //1KWH
  304. unsigned char ConnectorPlugIn; //0: unplug, 1: Plug-in
  305. unsigned char ConnectorLocked; //0: unlocked, 1:locked.
  306. float CpVoltage; //
  307. unsigned char CpState; //1:state A, 2:State B1, 3:State B2, 4:State C, 5:State D, 6:State E, 7:State F, 8: Pilot error
  308. unsigned char CpDuty; //0~100%
  309. float PpVoltage;
  310. unsigned char EVSEPrechargeStatus; //00:not ready, 01:ready for precharge, 02: ready for engergy trnasfer (> 2A)
  311. unsigned char IsolationStatus; //0:ongoing, 1:valid, 2:warning/fault
  312. unsigned char DC_EVSEStatus;
  313. unsigned char SwitchCpStateE_status;
  314. unsigned char QCA7K_SetKeyDone;
  315. unsigned char CpState_err;
  316. unsigned char CpState_err_logged;
  317. unsigned char CableCheckPreCountDownDone;
  318. unsigned char End_Process_inused;
  319. struct timeb V2G_SECC_CableCheck_Timer_Start;
  320. struct timeb V2G_SECC_CableCheck_Timer_End;
  321. struct timeb V2G_SECC_Precharge_Timer_Start;
  322. struct timeb V2G_SECC_Precharge_Timer_End;
  323. struct timeb V2G_SECC_CurrentDemand_Timer_Start;
  324. struct timeb V2G_SECC_CurrentDemand_Timer_End;
  325. struct timeb V2G_SECC_ChargingStatus_Timer_Start;
  326. struct timeb V2G_SECC_ChargingStatus_Timer_End;
  327. struct timeb V2G_SECC_WeldingDetection_Timer_Start;
  328. struct timeb V2G_SECC_WeldingDetection_Timer_End;
  329. struct timeb V2G_SECC_Sequence_Timer_Start;
  330. struct timeb V2G_SECC_Sequence_Timer_End;
  331. struct timeb V2G_SECC_Msg_Timer_Start;
  332. struct timeb V2G_SECC_Msg_Timer_End;
  333. unsigned short SDP_TCP_Server_Port_active;
  334. unsigned char SessionID[8];
  335. unsigned char V2G_Rx_Msg;
  336. unsigned char SequenceError;
  337. unsigned char SupportedAppProtocol_result; //appHandresponseCodeType: 0,1,2
  338. char CM_ATTEN_CHAR_IND_retry;
  339. struct EVCC_SLAC_DATA_TYPE evcc_slac_data;
  340. unsigned char State_Change_Ignored_Notice;
  341. unsigned char EVCCID[8];
  342. unsigned char EVCCID_length;
  343. float AC_EVSENominalVoltage; //unit: 1V
  344. //previous state
  345. float MaximumChargingVoltage_pre; //0~6553.5 volt, unit = 1V
  346. float AvailableChargingCurrent_pre; //0~6553.5 amp, unit =1A
  347. float AvailableChargingPower_pre; //0~6553.5 kW, unit = 1KW
  348. float PresentChargingVoltage_pre; //0~6553.5 volt, unit = 1V
  349. float PresentChargingCurrent_pre; //0~6553.5 amp, unit = 1A
  350. float PresentChargingPower_pre; //0~6553.5 kW, unit = 1KW
  351. float PresentChargedEnergy_pre; //0~6553.5 kWh, unit = 1KWH
  352. int PresentChargedDuration_pre; // second, unit = 1s
  353. int RemainChargingDuration_pre; // second, unit = 1s
  354. float EvBatteryMaxVoltage_pre; // 0~6553.5 volt, unit = 1V
  355. float EvBatteryMaxCurrent_pre; //1A
  356. float EvBatteryMaxPower_pre; //1KW
  357. float EvBatterytargetVoltage_pre; // 0~6553.5 volt, unit = 1V
  358. float EvBatterytargetCurrent_pre; //1A
  359. int EvBatterySoc_pre; // 0~100%, unit = 1%
  360. float EvBatteryCapacity_pre; //1KWH
  361. float EvBatteryEngergyRequest_pre; //1KWH
  362. unsigned char ConnectorPlugIn_pre; //0: unplug, 1: Plug-in
  363. unsigned char ConnectorPlugIn_new; //0: unplug, 1: Plug-in
  364. unsigned char ConnectorLocked_pre; //0: unlocked, 1:locked.
  365. float CpVoltage_pre; //
  366. unsigned char CpState_pre; //1:state A, 2:State B1, 3:State B2, 4:State C, 5:State D, 6:State E, 7:State F, 8: Pilot error
  367. unsigned char CpDuty_pre; //0~100%
  368. float PpVoltage_pre;
  369. unsigned char EVSEPrechargeStatus_pre; //
  370. unsigned char IsolationStatus_pre; //0:ongoing, 1:valid, 2:warning/fault
  371. unsigned char DC_EVSEStatus_pre;
  372. unsigned char SwitchCpStateE_status_pre;
  373. unsigned char V2G_Rx_Msg_pre;
  374. float AC_EVSENominalVoltage_pre; //unit: 1V
  375. };
  376. struct SysInfoData
  377. {
  378. /**************System***************/
  379. unsigned char SystemStatus; //0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
  380. unsigned char FactoryConfiguration; //0: normal, 1: trigger, charger will return the configuration to factory default if trigger
  381. float InputVoltageR; //0~655.35 volt
  382. float InputVoltageS; //0~655.35 volt
  383. float InputVoltageT; //0~655.35 volt
  384. unsigned int SystemFanRotaSpeed; //0 ~ 65535 RPM
  385. unsigned int PsuFanRotaSpeed; //0 ~ 65535 RPM
  386. unsigned char AuxPower5V; //0 ~ 255 volt
  387. unsigned char AuxPower12V; //0 ~ 255 volt
  388. unsigned char AuxPower24V; //0 ~ 255 volt
  389. unsigned char AuxPower48V; //0 ~ 255 volt
  390. unsigned char CsuHwRev[32]; //CSU board hardware version
  391. unsigned char CsuBootLoadFwRev[32]; //CSU board bootloader firmware version
  392. unsigned char CsuKernelFwRev[32]; //CSU board OS kernel firmware version
  393. unsigned char CsuRootFsFwRev[32]; //CSU board root file system firmware version
  394. unsigned char CsuPrimFwRev[32]; //CSU board root file system firmware version
  395. unsigned char LcmHwRev[32]; //LCM module hardware version
  396. unsigned char LcmFwRev[32]; //LCM module firmware version
  397. unsigned char PsuHwRev[32]; //PSU hardware version
  398. unsigned char PsuPrimFwRev[32]; //PSU primary firmware version
  399. unsigned char PsuSecFwRev[32]; //PSU secondary firmware version
  400. unsigned char AuxPwrHwRev[32]; //Aux. power module hardware version
  401. unsigned char AuxPwrFwRev[32]; //Aux. power module firmware version
  402. unsigned char FanModuleHwRev[32]; //Fan module hardware version
  403. unsigned char FanModuleFwRev[32]; //Fan module firmware version
  404. unsigned char RelayModuleHwRev[32]; //Relay control module hardware version
  405. unsigned char RelayModuleFwRev[32]; //Relay control module firmware version
  406. unsigned char TelcomModemFwRev[32]; //the 3G/4G modem firmware version
  407. int SystemAmbientTemp; // -40 ~ 215 degree C
  408. int SystemCriticalTemp; // -40 ~ 215 degree C
  409. int CcsConnectorTemp; // -40 ~ 215 degree C
  410. int PsuAmbientTemp; // -40 ~ 215 degree C
  411. /**************Charging***************/
  412. struct ChargingInfoData ChademoChargingData[CHAdeMO_QUANTITY];
  413. struct ChargingInfoData CcsChargingData[CCS_QUANTITY];
  414. struct ChargingInfoData GbChargingData[GB_QUANTITY];
  415. /**************Network***************/
  416. unsigned char InternetConn; //0: disconnected, 1: connected
  417. /**************Backend***************/
  418. unsigned char OcppConnStatus; //0: disconnected, 1: connected
  419. };
  420. struct SysConfigAndInfo
  421. {
  422. struct SysConfigData SysConfig;
  423. struct SysInfoData SysInfo;
  424. };
  425. struct FaultCodeData
  426. {
  427. unsigned char PreviousFaultVal[4];
  428. union
  429. {
  430. unsigned char FaultVal[4];
  431. struct
  432. {
  433. //FaultVal[0]
  434. unsigned char ChademoOutputFuseBlew : 1; //bit 0
  435. unsigned char CcsOutputFuseBlew : 1; //bit 1
  436. unsigned char GbOutputFuseBlew : 1; //bit 2
  437. unsigned char RcdSelfTestFail : 1; //bit 3
  438. unsigned char AcInputContactor1Welding : 1; //bit 4
  439. unsigned char AcInputContactor1DrivingFault : 1; //bit 5
  440. unsigned char AcInputContactor2Welding : 1; //bit 6
  441. unsigned char AcInputContactor2DrivingFault : 1; //bit 7
  442. //FaultVal[1]
  443. unsigned char AcOutputRelayWelding : 1; //bit 0
  444. unsigned char AcOutputRelayDrivingFault : 1; //bit 1
  445. unsigned char ChademoOutputRelayWelding : 1; //bit 2
  446. unsigned char ChademoOutputRelayDrivingFault : 1; //bit 3
  447. unsigned char CcsOutputRelayWelding : 1; //bit 4
  448. unsigned char CcsOutputRelayDrivingFault : 1; //bit 5
  449. unsigned char GbOutputRelayWelding : 1; //bit 6
  450. unsigned char GbOutputRelayDrivingFault : 1; //bit 7
  451. //FaultVal[2]
  452. unsigned char AcConnectorTempSensorBroken : 1; //bit 0
  453. unsigned char ChademoConnectorTempSensorBroken : 1; //bit 1
  454. unsigned char CcsConnectorTempSensorBroken : 1; //bit 2
  455. unsigned char GbConnectorTempSensorBroken : 1; //bit 3
  456. unsigned char WiFiModuleBroken : 1; //bit 4
  457. unsigned char Telecom4GModuleBroken : 1; //bit 5
  458. unsigned char AuxPowerModuleBroken : 1; //bit 6
  459. unsigned char RelayControlModuleBroken : 1; //bit 7
  460. //FaultVal[3]
  461. unsigned char ChademoConnectorLockFail : 1; //bit 0
  462. unsigned char GbConnectorLockFail : 1; //bit 1
  463. unsigned char AcConnectorLockFail : 1; //bit 2
  464. unsigned char ChademoModuleBroken : 1; //bit 3
  465. unsigned char CcsModuleBroken : 1; //bit 4
  466. unsigned char GbModuleBroken : 1; //bit 5
  467. unsigned char PsuModuleBroken : 1; //bit 6
  468. unsigned char : 1; //bit 7 reserved
  469. } bits;
  470. } FaultEvents;
  471. };
  472. struct AlarmCodeData
  473. {
  474. unsigned char PreviousAlarmVal[8];
  475. union
  476. {
  477. unsigned char AlarmVal[8];
  478. struct
  479. {
  480. //AlarmVal[0]
  481. unsigned char SystemL1InputOVP : 1; //bit 0
  482. unsigned char SystemL2InputOVP : 1; //bit 1
  483. unsigned char SystemL3InputOVP : 1; //bit 2
  484. unsigned char SystemL1InputUVP : 1; //bit 3
  485. unsigned char SystemL2InputUVP : 1; //bit 4
  486. unsigned char SystemL3InputUVP : 1; //bit 5
  487. unsigned char PsuL1InputOVP : 1; //bit 6
  488. unsigned char PsuL2InputOVP : 1; //bit 7
  489. //AlarmVal[1]
  490. unsigned char PsuL3InputOVP : 1; //bit 0
  491. unsigned char PsuL1InputUVP : 1; //bit 1
  492. unsigned char PsuL2InputUVP : 1; //bit 2
  493. unsigned char PsuL3InputUVP : 1; //bit 3
  494. unsigned char SystemL1InputDrop : 1; //bit 4
  495. unsigned char SystemL2InputDrop : 1; //bit 5
  496. unsigned char SystemL3InputDrop : 1; //bit 6
  497. unsigned char SystemAcOutputOVP : 1; //bit 7
  498. //AlarmVal[2]
  499. unsigned char SystemAcOutputOCP : 1; //bit 0
  500. unsigned char SystemChademoOutputOVP : 1; //bit 1
  501. unsigned char SystemChademoOutputOCP : 1; //bit 2
  502. unsigned char SystemCcsOutputOVP : 1; //bit 3
  503. unsigned char SystemCcsOutputOCP : 1; //bit 4
  504. unsigned char SystemGbOutputOVP : 1; //bit 5
  505. unsigned char SystemGbOutputOCP : 1; //bit 6
  506. unsigned char SystemAmbientOTP : 1; //bit 7
  507. //AlarmVal[3]
  508. unsigned char SystemCriticalPointOTP : 1; //bit 0
  509. unsigned char PsuAmbientOTP : 1; //bit 1
  510. unsigned char PsuCriticalPointOTP : 1; //bit 2
  511. unsigned char AuxPowerModuleOTP : 1; //bit 3
  512. unsigned char RelayBoardOTP : 1; //bit 4
  513. unsigned char ChademoConnectorOTP : 1; //bit 5
  514. unsigned char CcsConnectorOTP : 1; //bit 6
  515. unsigned char GbConnectorOTP : 1; //bit 7
  516. //AlarmVal[4]
  517. unsigned char AcConnectorOTP : 1; //bit 0
  518. unsigned char RcdTrip : 1; //bit 1
  519. unsigned char ChademoGfdTrip : 1; //bit 2
  520. unsigned char CcsGfdTrip : 1; //bit 3
  521. unsigned char GbGfdTrip : 1; //bit 4
  522. unsigned char SpdTrip : 1; //bit 5
  523. unsigned char MainPowerBreakerTrip : 1; //bit 6
  524. unsigned char AuxPowerBreakerTrip : 1; //bit 7
  525. //AlarmVal[5]
  526. unsigned char PsuCommunicationFail : 1; //bit 0
  527. unsigned char WiFiModuleCommFail : 1; //bit 1
  528. unsigned char Telecom4GModuleCommFail : 1; //bit 2
  529. unsigned char RfidModuleCommFail : 1; //bit 3
  530. unsigned char BluetoothModuleCommFail : 1; //bit 4
  531. unsigned char LcmModuleCommFail : 1; //bit 5
  532. unsigned char AuxPowerModuleCommFail : 1; //bit 6
  533. unsigned char RelayBoardCommFail : 1; //bit 7
  534. //AlarmVal[6]
  535. unsigned char CcsModuleCommFail : 1; //bit 0
  536. unsigned char ChademoModuleCommFail : 1; //bit 1
  537. unsigned char GbModuleCommFail : 1; //bit 2
  538. unsigned char EmergencyStopTrip : 1; //bit 3
  539. unsigned char DoorOpen : 1; //bit 4
  540. unsigned char SystemFanDecay : 1; //bit 5
  541. unsigned char FailToCreateShareMemory : 1; //bit 6
  542. unsigned char CsuInitFailed : 1; //bit 7
  543. //AlarmVal[7]
  544. unsigned char : 8; //reserved
  545. } bits;
  546. } AlarmEvents;
  547. };
  548. struct InfoCodeData
  549. {
  550. unsigned char PreviousInfoVal[8];
  551. union
  552. {
  553. unsigned char InfoVal[8];
  554. struct
  555. {
  556. //InfoVal[0]
  557. unsigned char NormalStopChargingByUser : 1; //bit 0
  558. unsigned char ChargingTimesUp : 1; //bit 1
  559. unsigned char ReplaceSystemAirFilter : 1; //bit 2
  560. unsigned char ReachChademoMaxPluggingTimes : 1; //bit 3
  561. unsigned char ReachCcsMaxPluggingTimes : 1; //bit 4
  562. unsigned char ReachGbMaxPluggingTimes : 1; //bit 5
  563. unsigned char ReachAcMaxPluggingTimes : 1; //bit 6
  564. unsigned char CsuFimrwareUpdateFail : 1; //bit 7
  565. //InfoVal[1]
  566. unsigned char ChademoModuleFimrwareUpdateFail : 1; //bit 0
  567. unsigned char CcsModuleFimrwareUpdateFail : 1; //bit 1
  568. unsigned char GbModuleFimrwareUpdateFail : 1; //bit 2
  569. unsigned char AuxPowerModuleFimrwareUpdateFail : 1; //bit 3
  570. unsigned char RelayBoardFimrwareUpdateFail : 1; //bit 4
  571. unsigned char LcmModuleFimrwareUpdateFail : 1; //bit 5
  572. unsigned char BluetoothModuleFimrwareUpdateFail : 1; //bit 6
  573. unsigned char WiFiModuleFimrwareUpdateFail : 1; //bit 7
  574. //InfoVal[2]
  575. unsigned char Telocom4GModuleFimrwareUpdateFail : 1; //bit 0
  576. unsigned char PsuFimrwareUpdateFail : 1; //bit 1
  577. unsigned char RfidModuleFimrwareUpdateFail : 1; //bit 2
  578. unsigned char ConfiguredByUsbFlashDrive : 1; //bit 3
  579. unsigned char ConfiguredByBackend : 1; //bit 4
  580. unsigned char ConfiguredByWebpage : 1; //bit 5
  581. unsigned char InternetDisconnectViaEthernet : 1; //bit 6
  582. unsigned char InternetDisconnectViaWiFi : 1; //bit 7
  583. //InfoVal[3]
  584. unsigned char InternetDisconnectVia4Gi : 1; //bit 0
  585. unsigned char ApDisconnectViaWiFi : 1; //bit 1
  586. unsigned char ApnDisconnectVia4Gi : 1; //bit 2
  587. unsigned char : 5; //bit 3~7 reserved
  588. //InfoVal[4]
  589. unsigned char ChademoSeccCommFail : 1; //bit 0
  590. unsigned char CcsSeccCommFail : 1; //bit 1
  591. unsigned char GbSeccCommFail : 1; //bit 2
  592. unsigned char PilotFault : 1; //bit 3
  593. unsigned char ChademoBatteryMalfun : 1; //bit 4
  594. unsigned char ChademoNoPermission : 1; //bit 5
  595. unsigned char ChademoBatteryIncompatibility : 1; //bit 6
  596. unsigned char ChademoBatteryOVP : 1; //bit 7
  597. //InfoVal[5]
  598. unsigned char ChademoBatteryUVP : 1; //bit 0
  599. unsigned char ChademoBatteryOTP : 1; //bit 1
  600. unsigned char ChademoBatteryCurrentDiff : 1; //bit 2
  601. unsigned char ChademoBatteryVoltageDiff : 1; //bit 3
  602. unsigned char ChademoShiftPosition : 1; //bit 4
  603. unsigned char ChademoBatteryOtherFault : 1; //bit 5
  604. unsigned char ChademoChargingSystemError : 1; //bit 6
  605. unsigned char ChademoEvNormalStop : 1; //bit 7
  606. //InfoVal[6]
  607. unsigned char : 8; //bit 0~7 reserved
  608. //InfoVal[7]
  609. unsigned char BackendDisconnectedViaEthernet : 1; //bit 0
  610. unsigned char BackendDisconnectViaWiFi : 1; //bit 1
  611. unsigned char BackendDisconnectVia4G : 1; //bit 2
  612. unsigned char BackendRemoteStart : 1; //bit 3
  613. unsigned char BackendRemoteStop : 1; //bit 4
  614. unsigned char BackendRemoteReset : 1; //bit 5
  615. unsigned char : 2; //bit 6~7 reserved
  616. } bits;
  617. } InfoEvents;
  618. };
  619. struct StatusCodeData {
  620. unsigned char PresentStatusCode[10][6];
  621. struct FaultCodeData FaultCode;
  622. struct AlarmCodeData AlarmCode;
  623. struct InfoCodeData InfoCode;
  624. };
  625. /************************************************************************************/
  626. /**************************CCS protocol Share memory***************************/
  627. /**************************DIN70121: 201412***************************************/
  628. /**************************ISO15118_2014: 2014************************************/
  629. /**************************ISO15118_2018: 2018************************************/
  630. /************************************************************************************/
  631. typedef enum boolean { FALSE, TRUE } BOOL;
  632. enum ResponseCodeType_DIN70121 {
  633. OK_DIN70121 = 0,
  634. OK_NewSessionEstablished_DIN70121 = 1,
  635. OK_OldSessionJoined_DIN70121 = 2,
  636. OK_CertificateExpiresSoon_DIN70121 = 3,
  637. FAILED_DIN70121 = 4,
  638. FAILED_SequenceError_DIN70121 = 5,
  639. FAILED_ServiceIDInvalid_DIN70121 = 6,
  640. FAILED_UnknownSession_DIN70121 = 7,
  641. FAILED_ServiceSelectionInvalid_DIN70121 = 8,
  642. FAILED_PaymentSelectionInvalid_DIN70121 = 9,
  643. FAILED_CertificateExpired_DIN70121 = 10,
  644. FAILED_SignatureError_DIN70121 = 11,
  645. FAILED_NoCertificateAvailable_DIN70121 = 12,
  646. FAILED_CertChainError_DIN70121 = 13,
  647. FAILED_ChallengeInvalid_DIN70121 = 14,
  648. FAILED_ContractCanceled_DIN70121 = 15,
  649. FAILED_WrongChargeParameter_DIN70121 = 16,
  650. FAILED_PowerDeliveryNotApplied_DIN70121 = 17,
  651. FAILED_TariffSelectionInvalid_DIN70121 = 18,
  652. FAILED_ChargingProfileInvalid_DIN70121 = 19,
  653. FAILED_EVSEPresentVoltageToLow_DIN70121 = 20,
  654. FAILED_MeteringSignatureNotValid_DIN70121 = 21,
  655. FAILED_WrongEnergyTransferType_DIN70121 = 22
  656. };
  657. enum ResponseCodeType_ISO15118_2014 {
  658. OK_ISO15118_2014 = 0,
  659. OK_NewSessionEstablished_ISO15118_2014 = 1,
  660. OK_OldSessionJoined_ISO15118_2014 = 2,
  661. OK_CertificateExpiresSoon_ISO15118_2014 = 3,
  662. FAILED_ISO15118_2014 = 4,
  663. FAILED_SequenceError_ISO15118_2014 = 5,
  664. FAILED_ServiceIDInvalid_ISO15118_2014 = 6,
  665. FAILED_UnknownSession_ISO15118_2014 = 7,
  666. FAILED_ServiceSelectionInvalid_ISO15118_2014 = 8,
  667. FAILED_PaymentSelectionInvalid_ISO15118_2014 = 9,
  668. FAILED_CertificateExpired_ISO15118_2014 = 10,
  669. FAILED_SignatureError_ISO15118_2014 = 11,
  670. FAILED_NoCertificateAvailable_ISO15118_2014 = 12,
  671. FAILED_CertChainError_ISO15118_2014 = 13,
  672. FAILED_ChallengeInvalid_ISO15118_2014 = 14,
  673. FAILED_ContractCanceled_ISO15118_2014 = 15,
  674. FAILED_WrongChargeParameter_ISO15118_2014 = 16,
  675. FAILED_PowerDeliveryNotApplied_ISO15118_2014 = 17,
  676. FAILED_TariffSelectionInvalid_ISO15118_2014 = 18,
  677. FAILED_ChargingProfileInvalid_ISO15118_2014 = 19,
  678. FAILED_MeteringSignatureNotValid_ISO15118_2014 = 20,
  679. FAILED_NoChargeServiceSelected_ISO15118_2014 = 21,
  680. FAILED_WrongEnergyTransferMode_ISO15118_2014 = 22,
  681. FAILED_ContactorError_ISO15118_2014 = 23,
  682. FAILED_CertificateNotAllowedAtThisEVSE_ISO15118_2014 = 24,
  683. FAILED_CertificateRevoked_ISO15118_2014 = 25
  684. };
  685. enum ResponseCodeType_ISO15118_2018 {
  686. OK_ISO15118_2018 = 0,
  687. OK_NewSessionEstablished_ISO15118_2018 = 1,
  688. OK_OldSessionJoined_ISO15118_2018 = 2,
  689. OK_CertificateExpiresSoon_ISO15118_2018 = 3,
  690. OK_IsolationValid_ISO15118_2018 = 4,
  691. OK_IsolationWarning_ISO15118_2018 = 5,
  692. WARNING_CertificateExpired_ISO15118_2018 = 6,
  693. WARNING_NoCertificateAvailable_ISO15118_2018 = 7,
  694. WARNING_CertValidationError_ISO15118_2018 = 8,
  695. WARNING_CertVerificationError_ISO15118_2018 = 9,
  696. WARNING_ContractCanceled_ISO15118_2018 = 10,
  697. FAILED_ISO15118_2018 = 11,
  698. FAILED_SequenceError_ISO15118_2018 = 12,
  699. FAILED_ServiceIDInvalid_ISO15118_2018 = 13,
  700. FAILED_UnknownSession_ISO15118_2018 = 14,
  701. FAILED_ServiceSelectionInvalid_ISO15118_2018 = 15,
  702. FAILED_SignatureError_ISO15118_2018 = 16,
  703. FAILED_IdentificationSelectionInvalid_ISO15118_2018 = 17,
  704. FAILED_ChallengeInvalid_ISO15118_2018 = 18,
  705. FAILED_WrongChargeParameter_ISO15118_2018 = 19,
  706. FAILED_IsolationFault_ISO15118_2018 = 20,
  707. FAILED_PowerDeliveryNotApplied_ISO15118_2018 = 21,
  708. FAILED_TariffSelectionInvalid_ISO15118_2018 = 22,
  709. FAILED_ChargingProfileInvalid_ISO15118_2018 = 23,
  710. FAILED_MeteringSignatureNotValid_ISO15118_2018 = 24,
  711. FAILED_NoChargeServiceSelected_ISO15118_2018 = 25,
  712. FAILED_WrongEnergyTransferMode_ISO15118_2018 = 26,
  713. FAILED_ContactorError_ISO15118_2018 = 27,
  714. FAILED_CertificateRevoked_ISO15118_2018 = 28,
  715. FAILED_CertificateNotYetValid_ISO15118_2018 = 29
  716. };
  717. enum EVSENotificationType { None = 0, StopCharging = 1, ReNegotiation = 2};
  718. enum ServiceCategoryType { EVCharging = 0, Internet = 1, ContractCertificate = 2, OtherCustom = 3};
  719. enum PaymentOptionType { Contract = 0, ExternalPayment = 1};
  720. /*enum EVSESupportedEnergyTransferType { AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
  721. DC_combo_core = 4, DC_dual = 5, AC_core1p_DC_extended = 6, AC_single_DC_core = 7,
  722. AC_single_phase_three_phase_core_DC_extended = 8, AC_core3p_DC_extended = 9};*/
  723. enum EnergyTransferModeType {
  724. AC_single_phase_core = 0,
  725. AC_three_phase_core = 1,
  726. DC_core = 2,
  727. DC_extended = 3,
  728. DC_combo_core = 4,
  729. DC_unique = 5
  730. };
  731. //enum identificationOptionType { Contract = 0, ExternalIdentification = 1};
  732. enum unitSymbolType_DIN70121 {
  733. H_DIN70121 = 0,
  734. M_DIN70121 = 1,
  735. S_DIN70121 = 2,
  736. A_DIN70121 = 3,
  737. AH_DIN70121 = 4,
  738. V_DIN70121 = 5,
  739. VA_DIN70121 = 6,
  740. W_DIN70121 = 7,
  741. WS_DIN70121 = 8,
  742. WH_DIN70121 = 9};
  743. enum unitSymbolType_ISO15118_2014 {
  744. h_ISO15118_2014 = 0,
  745. m_ISO15118_2014 = 1,
  746. s_ISO15118_2014 = 2,
  747. A_ISO15118_2014 = 3,
  748. V_ISO15118_2014 = 4,
  749. W_ISO15118_2014 = 5,
  750. Wh_ISO15118_2014 = 6
  751. };
  752. enum ProcessingType { Finished = 0, Ongoing = 1, Ongoing_WaitingForCustomerInteraction = 2};
  753. enum EVSEProcessingType_DIN70121 { Finished_DIN70121 = 0, Ongoing_DIN70121 = 1};
  754. enum EVSEProcessingType_ISO15118_2014 { Finished_ISO15118_2014 = 0, Ongoing_ISO15118_2014 = 1, Ongoing_WaitingForCustomerInteraction_ISO15118_2014=2 };
  755. enum DC_EVErrorCodeType {
  756. NO_ERROR = 0,
  757. FAILED_RESSTemperatureInhibit = 1,
  758. FAILED_EVShiftPosition = 2,
  759. FAILED_ChargerConnectorLockFault = 3,
  760. FAILED_EVRESSMalfunction = 4,
  761. FAILED_ChargingCurrentdifferential = 5,
  762. FAILED_ChargingVoltageOutOfRange = 6,
  763. Reserved_A = 7,
  764. Reserved_B = 8,
  765. Reserved_C = 9,
  766. FAILED_ChargingSystemIncompatibility = 10,
  767. NoData = 11
  768. };
  769. enum IsolationLevelType_DIN70121 {
  770. Invalid_DIN70121 = 0,
  771. Valid_DIN70121 = 1,
  772. Warning_DIN70121 = 2,
  773. Fault_DIN70121 = 3
  774. };
  775. enum IsolationLevelType_ISO15118_2014 {
  776. Invalid_ISO15118_2014 = 0,
  777. Valid_ISO15118_2014 = 1,
  778. Warning_ISO15118_2014 = 2,
  779. Fault_ISO15118_2014 = 3,
  780. No_IMD_ISO15118_2014 = 4
  781. };
  782. enum DC_EVSEStatusCodeType {
  783. EVSE_NotReady = 0,
  784. EVSE_Ready = 1,
  785. EVSE_Shutdown = 2,
  786. EVSE_UtilityInterruptEvent = 3,
  787. EVSE_IsolationMonitoringActive = 4,
  788. EVSE_EmergencyShutdown = 5,
  789. EVSE_Malfunction = 6,
  790. Reserved_8 = 7,
  791. Reserved_9 = 8
  792. };
  793. enum ScheduleOriginType { EV = 0, SA = 1};
  794. enum ChargeProgressType_ISO15118_2014 {start_ISO15118_2014 = 0, Stop_ISO15118_2014 = 1, Renegotiate_ISO15118_2014 = 2};
  795. enum ChargeProgressType_ISO15118_2018 {start_ISO15118_2018 = 0, Renegotiate_ISO15118_2018 = 1, Standby_ISO15118_2018 = 2, Stop_ISO15118_2018 = 3};
  796. enum evOperationType {Charge = 0, Discharge = 1, Standby = 2};
  797. enum mechanicalChargingDeviceStatusType {Home = 0, Moving = 1, EndPosition = 2};
  798. enum EV_CP_StatusType {A = 0, B = 1, C = 2, D = 3, E = 4, F = 5};
  799. enum EV_Error_Status_CodeType { No_EV_Error = 0, EV_FAILED_EmergencyEvent = 1, EV_FAILED_Breaker = 2, EV_FAILED_RESSTemperatureInhibit = 3,
  800. EV_FAILED_RESS = 4, EV_FAILED_ChargingCurrentDifferential = 5, EV_FAILED_ChargingVoltageOutOfRange = 6,
  801. Reserved_by_ISO_1 = 7, Reserved_by_ISO_2 = 8, Reserved_by_ISO_3 = 9, OEM1 = 10,
  802. OEM2 = 11, OEM3 = 12, OEM4 = 13};
  803. enum IsolationStatusType { Invalid = 0, Safe = 1, Warning = 2, Fault = 3};
  804. enum ChargingSessionType { Terminate = 0, Pause = 1};
  805. enum CostKindType { relativePricePercentage = 0, RenewableGenerationPercentage = 1, CarbonDioxideEmission = 2};
  806. enum MsgFlowStatus {
  807. IDLE = 0,
  808. CM_SLAC_PARM_REQ = 1,
  809. CM_SLAC_PARM_CONF = 2,
  810. CM_START_ATTEN_CHAR_IND = 3,
  811. CM_MNBC_SOUND_IND = 4,
  812. CM_ATTEN_CHAR_IND = 5,
  813. CM_ATTEN_CHAR_RSP = 6,
  814. CM_VALIDATE_REQ = 7,
  815. CM_VALIDATE_CNF = 8,
  816. CM_SLAC_MATCH_REQ = 9,
  817. CM_SLAC_MATCH_CNF = 10,
  818. CM_AMP_MAP_REQ = 11,
  819. CM_AMP_MAP_CNF = 12,
  820. CM_SET_KEY_REQ = 13,
  821. CM_SET_KEY_CNF = 14,
  822. SLACC_SDP_UDP_Connection = 15,
  823. SLACC_SDP_TCP_Connection = 16,
  824. SupportedAppProtocolRequest = 17,
  825. SupportedAppProtocolResponse = 18,
  826. SessionSetupRequest = 19,
  827. SessionSetupResponse = 20,
  828. ServiceDiscoveryRequest = 21,
  829. ServiceDiscoveryResponse = 22,
  830. ServiceDetailRequest = 23,
  831. ServiceDetailResponse = 24,
  832. ServiceAndPaymentSelectionRequest = 25,
  833. ServiceAndPaymentSelectionResponse = 26,
  834. PaymentDetailsRequest = 27,
  835. PaymentDetailsResponse = 28,
  836. AuthorizationRequest = 29,
  837. AuthorizationResponse = 30,
  838. CertificateUpdateRequest = 31,
  839. CertificateUpdateResponse = 32,
  840. CertificateInstallationRequest = 33,
  841. CertificateInstallationResponse = 34,
  842. ChargeParameterDiscoveryRequest = 35,
  843. ChargeParameterDiscoveryResponse = 36,
  844. CableCheckRequest = 37,
  845. CableCheckResponse = 38,
  846. PreChargeRequest = 39,
  847. PreChargeResponse = 40,
  848. PowerDeliveryRequestStart = 41,
  849. PowerDeliveryResponsetStart = 42,
  850. ChargingStatusRequest = 43,
  851. ChargingStatusResponse = 44,
  852. CurrentDemandRequest = 45,
  853. CurrentDemandResponse = 46,
  854. MeteringReceiptRequest = 47,
  855. MeteringReceiptResponse = 48,
  856. PowerDeliveryRequestStop = 49,
  857. PowerDeliveryResponseStop = 50,
  858. WeldingDetectionRequest = 51,
  859. WeldingDetectionResponse = 52,
  860. SessionStopRequest = 53,
  861. SessionStopResponse = 54,
  862. Performance_Timeout = 253,
  863. Sequence_Timeout = 254,
  864. Other_Fault = 255
  865. };
  866. struct PhysicalValueType_DIN70121 { //The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
  867. int Multiplier; //range: -3..+3
  868. enum unitSymbolType_DIN70121 Unit;
  869. short Value;
  870. };
  871. struct PhysicalValueType_ISO15118_2014 { //The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
  872. int Multiplier; //range: -3..+3
  873. enum unitSymbolType_ISO15118_2014 Unit;
  874. short Value;
  875. };
  876. struct PhysicalValueType_ISO15118_2018 //The final physical value is determined by: Value * 10 ^ Exponent [Unit]
  877. {
  878. int Exponent; //range: -3..+3
  879. short Value;
  880. };
  881. struct AppProtocolType {
  882. unsigned char ProtocolNamespace[100];
  883. unsigned int ProtocolNamespaceLen;
  884. unsigned int VersionNumberMajor;
  885. unsigned int VersionNumberMinor;
  886. unsigned char SchemaID;
  887. unsigned char Priority; //range 1..20
  888. };
  889. struct ACD_SSEnergyTransferModeType
  890. {
  891. unsigned char EVID[20];
  892. };
  893. struct EVSEStatusType
  894. {
  895. unsigned short NotificationMaxDelay; //in seconds
  896. enum EVSENotificationType EVSENotification;
  897. };
  898. struct ServiceIDListType
  899. {
  900. unsigned short ServiceID[10]; //refer to chapter 8.6.2.1 Table 192
  901. };
  902. struct PaymentOptionListType
  903. {
  904. enum PaymentOptionType PaymentOption[2];
  905. };
  906. struct ServiceTagType
  907. {
  908. unsigned short ServiceID;
  909. unsigned char ServiceName[32]; //Optional Element
  910. enum ServiceCategoryType ServiceCategory;
  911. unsigned char ServiceScope[32]; //Optional Element
  912. };
  913. struct ServiceType_DIN70121
  914. {
  915. struct ServiceTagType ServiceTag;
  916. BOOL FreeService;
  917. };
  918. struct ServiceType_ISO15118_2014
  919. {
  920. unsigned short ServiceID;
  921. unsigned char ServiceName[32]; //Optional
  922. enum ServiceCategoryType ServiceCategory;
  923. unsigned char ServiceScope[64]; //Optional
  924. BOOL FreeService;
  925. };
  926. /*struct ServiceType_ISO15118_2018
  927. {
  928. unsigned short ServiceID;
  929. BOOL FreeService;
  930. }; */
  931. struct SupportedEnergyTransferModeType
  932. {
  933. enum EnergyTransferModeType EnergyTransferMode[6];
  934. };
  935. struct ServiceChargeType
  936. {
  937. struct ServiceType_DIN70121 Services;
  938. //enum EVSESupportedEnergyTransferType EnergyTransferType;
  939. enum EnergyTransferModeType EnergyTransferType;
  940. };
  941. struct ChargeServiceType
  942. {
  943. struct ServiceType_ISO15118_2014 Services;
  944. struct SupportedEnergyTransferModeType SupportedEnergyTransferMode;
  945. };
  946. struct ServiceListType
  947. {
  948. struct ServiceType_ISO15118_2014 Service[8];
  949. };
  950. struct IdentificationOptionListType
  951. {
  952. enum PaymentOptionType IdentificationOption[2];
  953. };
  954. struct ParameterType
  955. {
  956. unsigned char Name[32];
  957. struct PhysicalValueType_ISO15118_2014 PhysicalValue_ISO15118_2014;
  958. struct PhysicalValueType_ISO15118_2018 PhysicalValue_ISO15118_2018;
  959. };
  960. struct ParameterSetType
  961. {
  962. short ParameterSetID;
  963. struct ParameterType Parameter[16];
  964. };
  965. struct ServiceParameterListType
  966. {
  967. struct ParameterSetType ParameterSet[255];
  968. };
  969. struct WPT_SDlEnergyTransferModeType
  970. {
  971. struct ServiceParameterListType ServiceParameterList;
  972. };
  973. struct SelectedServiceType
  974. {
  975. unsigned short ServiceID;
  976. short ParameterSetID;
  977. };
  978. struct SelectedServiceListType
  979. {
  980. struct SelectedServiceType SelectedService[16];
  981. unsigned int SelectedServiceLen;
  982. };
  983. struct CertificateChainType
  984. {
  985. unsigned char Id[32]; //Optional
  986. unsigned char Certificate[800]; //check size again
  987. unsigned char SubCertificates[4][800]; //Optional, check size again
  988. };
  989. struct PNC_AReqIdentificationModeType
  990. {
  991. unsigned char GenChallenge[16]; //DIN70121=> None, ISO15118_2014=>None, ISO15118_2018=>Optional
  992. unsigned char Id[32]; //DIN70121=> None, ISO15118_2014=>None, ISO15118_2018=>Optional
  993. };
  994. struct AC_EVChargeParameterType
  995. {
  996. unsigned int DepartureTime; //Optional
  997. struct PhysicalValueType_ISO15118_2014 EAmount;
  998. struct PhysicalValueType_ISO15118_2014 EVMaxVoltage;
  999. struct PhysicalValueType_ISO15118_2014 EVMaxCurrent;
  1000. struct PhysicalValueType_ISO15118_2014 EVMinCurrent;
  1001. };
  1002. struct DC_EVStatusType_DIN70121
  1003. {
  1004. BOOL EVReady;
  1005. BOOL EVCabinConditioning;
  1006. BOOL EVRESSConiditioning;
  1007. enum DC_EVErrorCodeType EVErrorCode;
  1008. unsigned char EVRESSSOC; /*0-100 percentage*/
  1009. };
  1010. struct DC_EVChargeParameterType_DIN70121
  1011. {
  1012. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1013. struct PhysicalValueType_DIN70121 EVMaximumCurrentLimit;
  1014. struct PhysicalValueType_DIN70121 EVMaximumPowerLimit; //Optional
  1015. struct PhysicalValueType_DIN70121 EVMaximumVoltageLimit;
  1016. struct PhysicalValueType_DIN70121 EVEnergyCapacity; //Optional
  1017. struct PhysicalValueType_DIN70121 EVEnergyRequest; //Optional
  1018. unsigned char FullSOC; /*0-100 percentage*/ //Optional
  1019. unsigned char BulkSOC; /*0-100 percentage*/ //Optional
  1020. };
  1021. struct DC_EVStatusType_ISO15118_2014
  1022. {
  1023. BOOL EVReady;
  1024. enum DC_EVErrorCodeType EVErrorCode;
  1025. unsigned char EVRESSSOC; /*0-100 percentage*/
  1026. };
  1027. struct DC_EVChargeParameterType_ISO15118_2014
  1028. {
  1029. unsigned int DepartureTime; //Optional
  1030. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1031. struct PhysicalValueType_ISO15118_2014 EVMaximumCurrentLimit;
  1032. struct PhysicalValueType_ISO15118_2014 EVMaximumPowerLimit; //Optional
  1033. struct PhysicalValueType_ISO15118_2014 EVMaximumVoltageLimit;
  1034. struct PhysicalValueType_ISO15118_2014 EVEnergyCapacity; //Optional
  1035. struct PhysicalValueType_ISO15118_2014 EVEnergyRequest; //Optional
  1036. unsigned char FullSOC; /*0-100 percentage*/ //Optional
  1037. unsigned char BulkSOC; /*0-100 percentage*/ //Optional
  1038. };
  1039. struct Dynamic_CPDReqControlModeType
  1040. {
  1041. unsigned int DepartureTime;
  1042. };
  1043. struct RelativeTimeIntervalType
  1044. {
  1045. unsigned int duration; //Optional
  1046. unsigned int start;
  1047. };
  1048. struct PMaxScheduleEntryType
  1049. {
  1050. struct RelativeTimeIntervalType RelativeTimeInterval;
  1051. unsigned short PMax;
  1052. };
  1053. struct PMaxScheduleType
  1054. {
  1055. unsigned short PMaxScheduleID; //no this itme in ISO15118_2014
  1056. struct PMaxScheduleEntryType PMaxScheduleEntry[1024];
  1057. };
  1058. struct CostType
  1059. {
  1060. unsigned int amount;
  1061. enum CostKindType costKind;
  1062. int amountMultiplier; //Optional , range: -3..+3
  1063. };
  1064. struct ConsumptionCostType
  1065. {
  1066. struct CostType Cost[3];
  1067. struct PhysicalValueType_ISO15118_2014 startValue;
  1068. };
  1069. struct SalesTariffEntryType
  1070. {
  1071. struct RelativeTimeIntervalType RelativeTimeInterval;
  1072. unsigned char EPriceLevel; //Optional
  1073. struct ConsumptionCostType ConsumptionCost[3]; //Optional
  1074. };
  1075. struct SalesTariffType
  1076. {
  1077. unsigned char Id[32]; //Optional
  1078. short SalesTariffID;
  1079. unsigned char SalesTariffDescription[32]; //Optional
  1080. unsigned char NumEPriceLevels; //Optional
  1081. struct SalesTariffEntryType SalesTariffEntry[1024];
  1082. };
  1083. struct SAScheduleTupleType
  1084. {
  1085. short SAScheduleTupleID;
  1086. struct PMaxScheduleType PMaxSchedule;
  1087. struct SalesTariffType SalesTariff; //Optional
  1088. };
  1089. struct ScheduleListType
  1090. {
  1091. enum ScheduleOriginType ScheduleOrigin;
  1092. struct SAScheduleTupleType ScheduleTuple[3];
  1093. };
  1094. struct Scheduled_CPDReqControlModeType
  1095. {
  1096. enum ProcessingType EVProcessing;
  1097. unsigned int DepartureTime; //Optional
  1098. unsigned short MaxSupportingPoints;
  1099. struct ScheduleListType ScheduleList; //Optional
  1100. };
  1101. struct AC_CPDReqEnergyTransferModeType
  1102. {
  1103. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1104. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1105. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1106. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1107. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1108. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1109. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1110. };
  1111. struct DC_CPDReqEnergyTransferModeType
  1112. {
  1113. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower; //Optional
  1114. struct PhysicalValueType_ISO15118_2018 EVMinimumChargePower; //Optional
  1115. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1116. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1117. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1118. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1119. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1120. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1121. unsigned char TargetSOC; //Optional
  1122. unsigned char BulkSOC; //Optional
  1123. };
  1124. struct BPT_AC_CPDReqEnergyTransferModeType
  1125. {
  1126. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1127. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargePower;
  1128. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargePower;
  1129. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1130. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargeCurrent;
  1131. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1132. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargeCurrent;
  1133. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1134. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1135. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1136. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1137. };
  1138. struct BPT_DC_CPDReqEnergyTransferModeType
  1139. {
  1140. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1141. struct PhysicalValueType_ISO15118_2018 EVMinimumChargePower;
  1142. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargePower;
  1143. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargePower;
  1144. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1145. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1146. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargeCurrent;
  1147. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargeCurrent;
  1148. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1149. struct PhysicalValueType_ISO15118_2018 EVMinimumVoltage;
  1150. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest;
  1151. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest;
  1152. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest;
  1153. unsigned char TargetSOC; //Optional
  1154. unsigned char BulkSOC; //Optional
  1155. };
  1156. struct WPT_CPDReqEnergyTransferModeType
  1157. {
  1158. struct PhysicalValueType_ISO15118_2018 EVMaximumPower; //Optional
  1159. struct PhysicalValueType_ISO15118_2018 EVMinimumPower; //Optional
  1160. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1161. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1162. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1163. };
  1164. struct ACD_CPDReqEnergyTransferModeType
  1165. {
  1166. //cannot be found in standard
  1167. };
  1168. struct SAScheduleListType
  1169. {
  1170. struct SAScheduleTupleType SAScheduleTuple[3];
  1171. };
  1172. struct DC_EVSEStatusType_DIN70121
  1173. {
  1174. enum IsolationLevelType_DIN70121 EVSEIsolationStatus; //Optional
  1175. enum DC_EVSEStatusCodeType EVSEStatusCode;
  1176. unsigned int NotificationMaxDelay;
  1177. enum EVSENotificationType EVSENotification;
  1178. };
  1179. struct DC_EVSEChargeParameterType_DIN70121
  1180. {
  1181. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1182. struct PhysicalValueType_DIN70121 EVSEMaximumCurrentLimit;
  1183. struct PhysicalValueType_DIN70121 EVSEMaximumPowerLimit; //Optional
  1184. struct PhysicalValueType_DIN70121 EVSEMaximumVoltageLimit;
  1185. struct PhysicalValueType_DIN70121 EVSEMinimumCurrentLimit;
  1186. struct PhysicalValueType_DIN70121 EVSEMinimumVoltageLimit;
  1187. struct PhysicalValueType_DIN70121 EVSECurrentRegulationTolerance; //Optional
  1188. struct PhysicalValueType_DIN70121 EVSEPeakCurrentRipple;
  1189. struct PhysicalValueType_DIN70121 EVSEEnergyToBeDelivered; //Optional
  1190. };
  1191. struct AC_EVSEStatusType_ISO15118_2014
  1192. {
  1193. BOOL RCD;
  1194. unsigned short NotificationMaxDelay;
  1195. enum EVSENotificationType EVSENotification; //need to be confirmed
  1196. };
  1197. struct AC_EVSEChargeParameterType_ISO15118_2014
  1198. {
  1199. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1200. struct PhysicalValueType_ISO15118_2014 EVSENominalVoltage;
  1201. struct PhysicalValueType_ISO15118_2014 EVSEMaxCurrent;
  1202. };
  1203. struct DC_EVSEStatusType_ISO15118_2014
  1204. {
  1205. unsigned short NotificationMaxDelay;
  1206. enum EVSENotificationType EVSENotification;
  1207. enum IsolationLevelType_ISO15118_2014 EVSEIsolationStatus; //Optional
  1208. enum DC_EVSEStatusCodeType DC_EVSEStatusCode;
  1209. };
  1210. struct DC_EVSEChargeParameterType_ISO15118_2014
  1211. {
  1212. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1213. struct PhysicalValueType_ISO15118_2014 EVSEMaximumCurrentLimit;
  1214. struct PhysicalValueType_ISO15118_2014 EVSEMaximumPowerLimit;
  1215. struct PhysicalValueType_ISO15118_2014 EVSEMaximumVoltageLimit;
  1216. struct PhysicalValueType_ISO15118_2014 EVSEMinimumCurrentLimit;
  1217. struct PhysicalValueType_ISO15118_2014 EVSEMinimumVoltageLimit;
  1218. struct PhysicalValueType_ISO15118_2014 EVSECurrentRegulationTolerance; //Optional
  1219. struct PhysicalValueType_ISO15118_2014 EVSEPeakCurrentRipple;
  1220. struct PhysicalValueType_ISO15118_2014 EVSEEnergyToBeDelivered; //Optional
  1221. };
  1222. struct Scheduled_CPDResControlModeType
  1223. {
  1224. struct ScheduleListType ScheduleList;
  1225. };
  1226. struct AC_CPDResEnergyTransferModeType
  1227. {
  1228. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent[3];
  1229. struct PhysicalValueType_ISO15118_2018 EVSENominalVoltage;
  1230. struct PhysicalValueType_ISO15118_2018 EVSENominalFrequency;
  1231. };
  1232. struct DC_CPDResEnergyTransferModeType
  1233. {
  1234. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower;
  1235. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent;
  1236. struct PhysicalValueType_ISO15118_2018 EVSEMinimumChargeCurrent;
  1237. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage;
  1238. struct PhysicalValueType_ISO15118_2018 EVSEMinimumVoltage;
  1239. };
  1240. struct BPT_AC_CPDResEnergyTransferModeType
  1241. {
  1242. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent[3];
  1243. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargeCurrent[3];
  1244. struct PhysicalValueType_ISO15118_2018 EVSENominalVoltage;
  1245. struct PhysicalValueType_ISO15118_2018 EVSENominalFrequency;
  1246. };
  1247. struct BPT_DC_CPDResEnergyTransferModeType
  1248. {
  1249. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower;
  1250. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargePower;
  1251. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent;
  1252. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargeCurrent;
  1253. struct PhysicalValueType_ISO15118_2018 EVSEMinimumChargeCurrent;
  1254. struct PhysicalValueType_ISO15118_2018 EVSEMinimumDischargeCurrent;
  1255. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage;
  1256. struct PhysicalValueType_ISO15118_2018 EVSEMinimumVoltage;
  1257. };
  1258. struct WPT_CPDResEnergyTransferModeType
  1259. {
  1260. struct PhysicalValueType_ISO15118_2018 EVSEMaximumPower;
  1261. struct PhysicalValueType_ISO15118_2018 EVSEMinimumPower;
  1262. };
  1263. struct ACD_CPDResEnergyTransferModeType
  1264. {
  1265. //not found in ISO15118_2018
  1266. };
  1267. struct ProfileEntryType_DIN70121
  1268. {
  1269. unsigned int ChargingProfileEntryStart;
  1270. short ChargingProfileEntryMaxPower;
  1271. };
  1272. struct ChargingProfileType_DIN70121
  1273. {
  1274. short SAScheduleTupleID;
  1275. struct ProfileEntryType_DIN70121 ProfileEntry[24];
  1276. };
  1277. struct DC_EVPowerDeliveryParameterType_DIN70121
  1278. {
  1279. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1280. BOOL BulkChargingComplete; //Optional
  1281. BOOL ChargingComplete;
  1282. };
  1283. struct ProfileEntryType_ISO15118_2014
  1284. {
  1285. unsigned int ChargingProfileEntryStart;
  1286. struct PhysicalValueType_ISO15118_2018 ChargingProfileEntryMaxPower;
  1287. unsigned char ChargingProfileEntryMaxNumberOfPhasesInUse; //Optional
  1288. };
  1289. struct ChargingProfileType_ISO15118_2014
  1290. {
  1291. struct ProfileEntryType_ISO15118_2014 ProfileEntry[24];
  1292. };
  1293. struct DC_EVPowerDeliveryParameterType_ISO15118_2014
  1294. {
  1295. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1296. BOOL BulkChargingComplete; //Optional
  1297. BOOL ChargingComplete;
  1298. };
  1299. struct TimeInterval
  1300. {
  1301. unsigned int start;
  1302. unsigned int duration; //Optional
  1303. };
  1304. struct PowerScheduleEntryType
  1305. {
  1306. struct TimeInterval TimeInterval;
  1307. struct PhysicalValueType_ISO15118_2018 Power[3];
  1308. };
  1309. struct EVPowerProfileType
  1310. {
  1311. struct PowerScheduleEntryType EVPowerProfileEntry[2048];
  1312. };
  1313. struct Scheduled_PDReqControlModeType
  1314. {
  1315. unsigned char ScheduleTupleID;
  1316. struct EVPowerProfileType EVPowerProfile;
  1317. };
  1318. struct BPT_Scheduled_PDReqControlModeType
  1319. {
  1320. unsigned char ScheduleTupleID;
  1321. struct EVPowerProfileType EVPowerProfile; //Optional
  1322. enum evOperationType EVOperation;
  1323. };
  1324. struct ListOfRootCertificateIDsType
  1325. {
  1326. unsigned char RootCertificateID[20][40];
  1327. };
  1328. struct ContractSignatureEncryptedPrivateKeyType
  1329. {
  1330. unsigned char Id[32];
  1331. };
  1332. struct DiffieHellmanPublickeyType
  1333. {
  1334. unsigned char Id[32];
  1335. };
  1336. struct ContractCertificateEncryptedPrivateKeyType
  1337. {
  1338. unsigned char Id[32];
  1339. };
  1340. struct EVTechnicalStatusType
  1341. {
  1342. BOOL EV_Status_ReadyToCharge;
  1343. BOOL EV_Status_ImmobilizationRequest; //Optional
  1344. BOOL EV_Status_Immobilized;
  1345. struct PhysicalValueType_ISO15118_2018 EV_Status_WLAN_Strength;
  1346. enum EV_CP_StatusType EV_CP_Status;
  1347. unsigned char EV_Status_RESSSOC; //0~100%
  1348. enum EV_Error_Status_CodeType EV_Error_Status_Code;
  1349. BOOL EVSE_Timeout;
  1350. };
  1351. struct MeterInfoType_ISO15118_2014
  1352. {
  1353. unsigned char MeterID[32];
  1354. unsigned long MeterReading; //Optional
  1355. unsigned char SigMeterReading[64]; //Optional
  1356. short MeterStatus; //Optional
  1357. long TMeter; //Optional
  1358. };
  1359. struct Scheduled_MRReqControlModeType
  1360. {
  1361. unsigned char ScheduleTupleID;
  1362. };
  1363. struct MeterInfoType_ISO15118_2018
  1364. {
  1365. unsigned char MeterID[32];
  1366. unsigned long MeterReadingWhCharged; //Optional
  1367. unsigned long MeterReadingWhDischarged; //Optional
  1368. unsigned long MeterReadingVARhLeading; //Optional
  1369. unsigned long MeterReadingVARhLagging; //Optional
  1370. unsigned char SignatureMeterReading[64]; //Optional
  1371. short MeterStatus; //Optional
  1372. short TimeStampMeter; //Optional
  1373. BOOL ReceiptRequired; //Optional
  1374. };
  1375. struct PnC_CLReqIdentificationModeType
  1376. {
  1377. BOOL MeteringReceiptRequested;
  1378. };
  1379. struct Dynamic_CSReqControlModeType
  1380. {
  1381. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest;
  1382. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest;
  1383. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest;
  1384. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1385. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1386. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1387. };
  1388. struct Scheduled_CSReqControlModeType
  1389. {
  1390. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1391. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1392. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1393. BOOL Standby;
  1394. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower; //Optional
  1395. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent; //Optional
  1396. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent; //Optional
  1397. };
  1398. struct DisplayParametersType
  1399. {
  1400. unsigned short CurrentRange;
  1401. unsigned char CurrentSOC; //0~100%
  1402. unsigned char MinimumSOC; //0~100%
  1403. struct PhysicalValueType_ISO15118_2018 RemainingTimeToMaximumSOC;
  1404. struct PhysicalValueType_ISO15118_2018 RemainingTimeToTargetSOC;
  1405. struct PhysicalValueType_ISO15118_2018 RemainingTimeToBulkSOC;
  1406. struct PhysicalValueType_ISO15118_2018 RemainingTimeToMinimumSOC;
  1407. BOOL ChargingComplete;
  1408. BOOL BulkChargingComplete;
  1409. BOOL InletHot;
  1410. };
  1411. struct PnC_CLResIdentificationModeType
  1412. {
  1413. struct MeterInfoType_ISO15118_2018 MeterInfo;
  1414. };
  1415. struct Dynamic_CSResControlModeType
  1416. {
  1417. struct PhysicalValueType_ISO15118_2018 EVSETargetActivePower;
  1418. };
  1419. struct Scheduled_CDResControlModeType
  1420. {
  1421. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower; //Optional
  1422. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent; //Optional
  1423. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage; //Optional
  1424. };
  1425. struct LFA_EVFinePositioningSetupParametersType
  1426. {
  1427. unsigned char NumberOfSensors;
  1428. //NOT complete yet, to be continue.....
  1429. };
  1430. /****SupportedAppProtocolRequest****/
  1431. struct SupportedAppProtocolRequest_DIN70121 {
  1432. struct AppProtocolType AppProtocol[20];
  1433. };
  1434. struct SupportedAppProtocolRequest_ISO15118_2014
  1435. {
  1436. struct AppProtocolType AppProtocol[20];
  1437. };
  1438. struct SupportedAppProtocolRequest_ISO15118_2018
  1439. {
  1440. struct AppProtocolType AppProtocol[20];
  1441. };
  1442. /****SupportedAppProtocolResponse****/
  1443. struct SupportedAppProtocolResponse_DIN70121
  1444. {
  1445. enum ResponseCodeType_DIN70121 ResponseCode;
  1446. unsigned char SchemaID; //Optional
  1447. };
  1448. struct SupportedAppProtocolResponse_ISO15118_2014
  1449. {
  1450. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1451. unsigned char SchemaID; //Optional
  1452. };
  1453. struct SupportedAppProtocolResponse_ISO15118_2018
  1454. {
  1455. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1456. unsigned char SchemaID; //Optional
  1457. };
  1458. /****SessionSetupRequest****/
  1459. struct SessionSetupRequest_DIN70121
  1460. {
  1461. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1462. };
  1463. struct SessionSetupRequest_ISO15118_2014
  1464. {
  1465. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1466. };
  1467. struct SessionSetupRequest_ISO15118_2018
  1468. {
  1469. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1470. struct ACD_SSEnergyTransferModeType ACD_SSEnergyTransferMode; //For ACD mandatory, optional for rest
  1471. };
  1472. /****SessionSetupResponse****/
  1473. struct SessionSetupResponse_DIN70121
  1474. {
  1475. enum ResponseCodeType_DIN70121 ResponseCode;
  1476. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1477. long EVSETimeStamp; //EPOCH format, Optional
  1478. };
  1479. struct SessionSetupResponse_ISO15118_2014
  1480. {
  1481. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1482. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1483. long EVSETimeStamp; //EPOCH format, Optional
  1484. };
  1485. struct SessionSetupResponse_ISO15118_2018
  1486. {
  1487. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1488. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1489. struct EVSEStatusType EVSEStatus; //Optional
  1490. };
  1491. /****ServiceDiscoveryRequest****/
  1492. struct ServiceDiscoveryRequest_DIN70121
  1493. {
  1494. unsigned char ServiceScope[32]; //Optional
  1495. unsigned int ServiceScopeLen;
  1496. enum ServiceCategoryType ServiceCategory; //Optional
  1497. };
  1498. struct ServiceDiscoveryRequest_ISO15118_2014
  1499. {
  1500. unsigned char ServiceScope[32]; //Optional
  1501. unsigned int ServiceScopeLen;
  1502. enum ServiceCategoryType ServiceCategory; //Optional
  1503. };
  1504. struct ServiceDiscoveryRequest_ISO15118_2018
  1505. {
  1506. struct ServiceIDListType SupportedServiceIDs; //Optional
  1507. };
  1508. /****ServiceDiscoveryResponse****/
  1509. struct ServiceDiscoveryResponse_DIN70121
  1510. {
  1511. enum ResponseCodeType_DIN70121 ResponseCode;
  1512. struct PaymentOptionListType PaymentOptions;
  1513. struct ServiceChargeType ChargeService_DIN70121;
  1514. };
  1515. struct ServiceDiscoveryResponse_ISO15118_2014
  1516. {
  1517. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1518. struct PaymentOptionListType PaymentOptions;
  1519. struct ChargeServiceType ChargeService;
  1520. struct ServiceListType ServiceList; //Optional
  1521. };
  1522. struct ServiceDiscoveryResponse_ISO15118_2018
  1523. {
  1524. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1525. struct EVSEStatusType EVSEStatus; //Optional
  1526. struct IdentificationOptionListType IdentificationOptionList;
  1527. struct ServiceListType EnergyTransferServiceList;
  1528. struct ServiceListType VASList; //Optional
  1529. };
  1530. /****ServiceDetailRequest****/
  1531. //Only in ISO15118_2014 and ISO15118_2018
  1532. struct ServiceDetailRequest_ISO15118_2014
  1533. {
  1534. unsigned short ServiceID;
  1535. };
  1536. struct ServiceDetailRequest_ISO15118_2018
  1537. {
  1538. unsigned short ServiceID;
  1539. struct WPT_SDlEnergyTransferModeType WPT_SDlEnergyTransferMode;
  1540. };
  1541. /****ServiceDetailResponse****/
  1542. struct ServiceDetailResponse_ISO15118_2014
  1543. {
  1544. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1545. unsigned short ServiceID;
  1546. struct ServiceParameterListType ServiceParameterList;
  1547. };
  1548. struct ServiceDetailResponse_ISO15118_2018
  1549. {
  1550. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1551. unsigned short ServiceID;
  1552. struct ServiceParameterListType ServiceParameterList;
  1553. struct EVSEStatusType EVSEStatus; //Optional
  1554. };
  1555. /****ServiceAndPaymentSelectionRequest / ServiceSelectionRequest****/
  1556. struct ServiceAndPaymentSelectionRequest_DIN70121
  1557. {
  1558. enum PaymentOptionType SelectedPaymentOption;
  1559. struct SelectedServiceListType SelectedServiceList;
  1560. };
  1561. struct ServiceAndPaymentSelectionRequest_ISO15118_2014
  1562. {
  1563. enum PaymentOptionType SelectedPaymentOption;
  1564. struct SelectedServiceListType SelectedServiceList;
  1565. };
  1566. struct ServiceSelectionRequest_ISO15118_2018
  1567. {
  1568. enum PaymentOptionType SelectedPaymentOption;
  1569. struct SelectedServiceType SelectedEnergyTransferService;
  1570. struct SelectedServiceListType SelectedVASList;
  1571. enum ProcessingType EVProcessing;
  1572. };
  1573. /****ServiceAndPaymentSelectionResponse / ServiceSelectionResponse****/
  1574. struct ServiceAndPaymentSelectionResponse_DIN70121
  1575. {
  1576. enum ResponseCodeType_DIN70121 ResponseCode;
  1577. };
  1578. struct ServiceAndPaymentSelectionResponse_ISO15118_2014
  1579. {
  1580. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1581. };
  1582. struct ServiceSelectionResponse_ISO15118_2018
  1583. {
  1584. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1585. struct EVSEStatusType EVSEStatus; //Optional
  1586. };
  1587. /****PaymentDetailsRequest / IdentificationDetailsRequest****/
  1588. struct PaymentDetailsRequest_ISO15118_2014
  1589. {
  1590. unsigned char eMAID[16];
  1591. struct CertificateChainType ContractSignatureCertChain;
  1592. };
  1593. struct IdentificationDetailsRequest_ISO15118_2018
  1594. {
  1595. struct CertificateChainType ContractSignatureCertChain;
  1596. };
  1597. /****PaymentDetailsResponse / IdentificationDetailsResponse ****/
  1598. struct PaymentDetailsResponse_ISO15118_2014
  1599. {
  1600. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1601. unsigned char GenChallenge[16];
  1602. long EVSETimeStamp;
  1603. };
  1604. struct IdentificationDetailsResponse_ISO15118_2018
  1605. {
  1606. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1607. struct EVSEStatusType EVSEStatus; //Optional
  1608. unsigned char GenChallenge[16];
  1609. enum ProcessingType EVSEProcessing;
  1610. };
  1611. /****ContractAuthenticationRequest / AuthorizationRequest****/
  1612. struct ContractAuthenticationRequest_DIN70121
  1613. {
  1614. //None
  1615. };
  1616. struct AuthorizationRequest_ISO15118_2014
  1617. {
  1618. unsigned char GenChallenge[16]; //Optional
  1619. unsigned char Id[32]; //Optional
  1620. };
  1621. struct AuthorizationRequest_ISO15118_2018
  1622. {
  1623. struct PNC_AReqIdentificationModeType PNC_AReqIdentificationMode; //Optional
  1624. };
  1625. /****ContractAuthenticationResponse / AuthorizationResponse****/
  1626. struct ContractAuthenticationResponse_DIN70121
  1627. {
  1628. enum ResponseCodeType_DIN70121 ResponseCode;
  1629. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  1630. };
  1631. struct AuthorizationResponse_ISO15118_2014
  1632. {
  1633. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1634. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  1635. };
  1636. struct AuthorizationResponse_ISO15118_2018
  1637. {
  1638. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1639. enum ProcessingType EVSEProcessing;
  1640. struct EVSEStatusType EVSEStatus; //Optional
  1641. };
  1642. /****ChargeParameterDiscoveryRequest****/
  1643. struct ChargeParameterDiscoveryRequest_DIN70121
  1644. {
  1645. enum EnergyTransferModeType EVRequestedEnergyTransferType;
  1646. struct DC_EVChargeParameterType_DIN70121 DC_EVChargeParameter;
  1647. };
  1648. struct ChargeParameterDiscoveryRequest_ISO15118_2014
  1649. {
  1650. unsigned short MaxEntriesSAScheduleTuple; //Optional
  1651. enum EnergyTransferModeType RequestedEnergyTransferMode;
  1652. struct AC_EVChargeParameterType AC_EVChargeParameter;
  1653. struct DC_EVChargeParameterType_ISO15118_2014 DC_EVChargeParameter;
  1654. };
  1655. struct ChargeParameterDiscoveryRequest_ISO15118_2018
  1656. {
  1657. struct Dynamic_CPDReqControlModeType Dynamic_CPDReqControlMode;
  1658. struct Scheduled_CPDReqControlModeType Scheduled_CPDReqControlMode;
  1659. struct AC_CPDReqEnergyTransferModeType AC_CPDReqEnergyTransferMode;
  1660. struct DC_CPDReqEnergyTransferModeType DC_CPDReqEnergyTransferMode;
  1661. struct BPT_AC_CPDReqEnergyTransferModeType BPT_AC_CPDReqEnergyTransferMode;
  1662. struct BPT_DC_CPDReqEnergyTransferModeType BPT_DC_CPDReqEnergyTransferMode;
  1663. struct WPT_CPDReqEnergyTransferModeType WPT_CPDReqEnergyTransferMode;
  1664. struct ACD_CPDReqEnergyTransferModeType ACD_CPDReqEnergyTransferMode;
  1665. };
  1666. /****ChargeParameterDiscoveryResponse****/
  1667. struct ChargeParameterDiscoveryResponse_DIN70121
  1668. {
  1669. enum ResponseCodeType_DIN70121 ResponseCode;
  1670. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  1671. struct SAScheduleListType SAScheduleList;
  1672. struct DC_EVSEChargeParameterType_DIN70121 DC_EVSEChargeParameter;
  1673. };
  1674. struct ChargeParameterDiscoveryResponse_ISO15118_2014
  1675. {
  1676. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  1677. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1678. struct SAScheduleListType SAScheduleList;
  1679. struct AC_EVSEChargeParameterType_ISO15118_2014 AC_EVSEChargeParameter;
  1680. struct DC_EVSEChargeParameterType_ISO15118_2014 DC_EVSEChargeParameter;
  1681. };
  1682. struct ChargeParameterDiscoveryResponse_ISO15118_2018
  1683. {
  1684. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1685. struct EVSEStatusType EVSEStatus; //Optional
  1686. enum ProcessingType EVSEProcessing;
  1687. struct Scheduled_CPDResControlModeType Scheduled_CPDResControlMode; //Optional
  1688. struct AC_CPDResEnergyTransferModeType AC_CPDResEnergyTransferMode;
  1689. struct DC_CPDResEnergyTransferModeType DC_CPDResEnergyTransferMode;
  1690. struct BPT_AC_CPDResEnergyTransferModeType BPT_AC_CPDResEnergyTransferMode;
  1691. struct BPT_DC_CPDResEnergyTransferModeType BPT_DC_CPDResEnergyTransferMode;
  1692. struct WPT_CPDResEnergyTransferModeType WPT_CPDResEnergyTransferMode;
  1693. struct ACD_CPDResEnergyTransferModeType ACD_CPDResEnergyTransferMode;
  1694. };
  1695. /****PowerDeliveryRequest****/
  1696. struct PowerDeliveryRequest_DIN70121
  1697. {
  1698. BOOL ReadyToChargeState;
  1699. struct ChargingProfileType_DIN70121 ChargingProfile;
  1700. struct DC_EVPowerDeliveryParameterType_DIN70121 DC_EVPowerDeliveryParameter;
  1701. };
  1702. struct PowerDeliveryRequest_ISO15118_2014
  1703. {
  1704. enum ChargeProgressType_ISO15118_2014 ChargeProgress;
  1705. short SAScheduleTupleID;
  1706. struct ChargingProfileType_ISO15118_2014 ChargingProfile;
  1707. struct DC_EVPowerDeliveryParameterType_ISO15118_2014 DC_EVPowerDeliveryParameter;
  1708. };
  1709. struct PowerDeliveryRequest_ISO15118_2018
  1710. {
  1711. enum ChargeProgressType_ISO15118_2018 ChargeProgress;
  1712. struct Scheduled_PDReqControlModeType Scheduled_PDReqControlMode;
  1713. struct BPT_Scheduled_PDReqControlModeType BPT_Scheduled_PDReqControlMode;
  1714. };
  1715. /****PowerDeliveryResponse****/
  1716. struct PowerDeliveryResponse_DIN70121
  1717. {
  1718. enum ResponseCodeType_DIN70121 ResponseCode;
  1719. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1720. };
  1721. struct PowerDeliveryResponse_ISO15118_2014
  1722. {
  1723. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1724. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1725. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1726. };
  1727. struct PowerDeliveryResponse_ISO15118_2018
  1728. {
  1729. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1730. struct EVSEStatusType EVSEStatus; //Optional
  1731. };
  1732. /****CertificateUpdateRequest****/
  1733. struct CertificateUpdateRequest_ISO15118_2014
  1734. {
  1735. unsigned char Id[32];
  1736. struct CertificateChainType ContractSignatureCertChain;
  1737. unsigned char eMAID[16];
  1738. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  1739. };
  1740. /****CertificateUpdateResponse****/
  1741. struct CertificateUpdateResponse_ISO15118_2014
  1742. {
  1743. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1744. struct CertificateChainType SAProvisioningCertificateChain;
  1745. struct CertificateChainType ContractSignatureCertChain;
  1746. struct ContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey;
  1747. struct DiffieHellmanPublickeyType DHpublickey;
  1748. unsigned char eMAID[16];
  1749. short RetryCounter; //Optional
  1750. };
  1751. /****CertificateInstallationRequest****/
  1752. struct CertificateInstallationRequest_ISO15118_2014
  1753. {
  1754. unsigned char Id[32];
  1755. unsigned char OEMProvisioningCert[800];
  1756. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  1757. };
  1758. struct CertificateInstallationRequest_ISO15118_2018
  1759. {
  1760. unsigned char Id[32];
  1761. struct CertificateChainType OEMProvisioningCertChain;
  1762. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  1763. unsigned short MaxSupportedCerts;
  1764. };
  1765. /****CertificateInstallationResponse****/
  1766. struct CertificateInstallationResponse_ISO15118_2014
  1767. {
  1768. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1769. struct CertificateChainType SAProvisioningCertificateChain;
  1770. struct CertificateChainType ContractSignatureCertChain;
  1771. struct ContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey;
  1772. struct DiffieHellmanPublickeyType DHpublickey;
  1773. unsigned char eMAID[16];
  1774. };
  1775. struct CertificateInstallationResponse_ISO15118_2018
  1776. {
  1777. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1778. struct EVSEStatusType EVSEStatus; //Optional
  1779. struct CertificateChainType SAProvisioningCertificateChain;
  1780. struct CertificateChainType ContractCertificateChain;
  1781. struct ContractCertificateEncryptedPrivateKeyType ContractEncryptedPrivateKey;
  1782. struct DiffieHellmanPublickeyType DHpublickey;
  1783. enum ProcessingType EVSEProcessing;
  1784. unsigned short RemainingContractCertificateChains;
  1785. };
  1786. /****SystemStatusRequest****/
  1787. struct SystemStatusRequest_ISO15118_2018
  1788. {
  1789. enum mechanicalChargingDeviceStatusType EVMechanicalChargingDeviceStatus;
  1790. struct EVTechnicalStatusType EVTechnicalStatus;
  1791. unsigned char EV_OEMStatus[800]; //Optional
  1792. };
  1793. /****SystemStatusResponse****/
  1794. struct SystemStatusResponse_ISO15118_2018
  1795. {
  1796. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1797. enum mechanicalChargingDeviceStatusType EVSEMechanicalChargingDeviceStatus;
  1798. BOOL EVSE_ReadyToCharge;
  1799. enum IsolationStatusType EVSE_IsolationStatus;
  1800. BOOL EVSE_Disabled;
  1801. BOOL EVSE_UtilityInterruptEvent;
  1802. BOOL EVSE_EmergencyShutdown;
  1803. BOOL EVSE_Malfunction;
  1804. BOOL EV_InChargePosition;
  1805. BOOL EV_AssociationStatus;
  1806. };
  1807. /****SessionStopRequest****/
  1808. struct SessionStopRequest_DIN70121
  1809. {
  1810. //No member in standard
  1811. };
  1812. struct SessionStopRequest_ISO15118_2014
  1813. {
  1814. enum ChargingSessionType ChargingSession;
  1815. };
  1816. struct SessionStopRequest_ISO15118_2018
  1817. {
  1818. enum ChargingSessionType ChargingSession;
  1819. };
  1820. /****SessionStopResponse****/
  1821. struct SessionStopResponse_DIN70121
  1822. {
  1823. enum ResponseCodeType_DIN70121 ResponseCode;
  1824. };
  1825. struct SessionStopResponse_ISO15118_2014
  1826. {
  1827. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1828. };
  1829. struct SessionStopResponse_ISO15118_2018
  1830. {
  1831. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1832. struct EVSEStatusType EVSEStatus; //Optional
  1833. };
  1834. /****MeteringReceiptRequest****/
  1835. struct MeteringReceiptRequest_ISO15118_2014
  1836. {
  1837. unsigned char Id[32]; //Optional
  1838. unsigned char SessionID[8];
  1839. short SAScheduleTupleID; //Optional
  1840. struct MeterInfoType_ISO15118_2014 MeterInfo;
  1841. };
  1842. struct MeteringReceiptRequest_ISO15118_2018
  1843. {
  1844. unsigned char Id[32]; //Optional
  1845. unsigned char SessionID[8];
  1846. struct Scheduled_MRReqControlModeType Schedule_MRReqControlMode;
  1847. struct MeterInfoType_ISO15118_2018 MeterInfo;
  1848. };
  1849. /****MeteringReceiptResponse****/
  1850. struct MeteringReceiptResponse_ISO15118_2014
  1851. {
  1852. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1853. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1854. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1855. };
  1856. struct MeteringReceiptResponse_ISO15118_2018
  1857. {
  1858. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1859. struct EVSEStatusType EVSEStatus; //Optional
  1860. };
  1861. /****ChargingStatusRequest (AC Only)****/
  1862. struct ChargingStatusRequest_ISO15118_2014
  1863. {
  1864. //No member in standard
  1865. };
  1866. struct ChargingStatusRequest_ISO15118_2018
  1867. {
  1868. struct PnC_CLReqIdentificationModeType PnC_CLReqIdentificationMode;
  1869. struct Dynamic_CSReqControlModeType Dynamic_CSReqControlMode;
  1870. struct Scheduled_CSReqControlModeType Scheduled_CSReqControlMode;
  1871. struct DisplayParametersType DisplayParameters;
  1872. };
  1873. /****ChargingStatusResponse (AC Only)****/
  1874. struct ChargingStatusResponse_ISO15118_2014
  1875. {
  1876. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1877. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1878. short SAScheduleTupleID;
  1879. struct PhysicalValueType_ISO15118_2014 EVSEMaxCurrent; //Optional
  1880. struct MeterInfoType_ISO15118_2014 MeterInfo; //Optional
  1881. BOOL ReceiptRequired; //Optional
  1882. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1883. };
  1884. struct ChargingStatusResponse_ISO15118_2018
  1885. {
  1886. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1887. struct EVSEStatusType EVSEStatus; //Optional
  1888. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1889. struct PhysicalValueType_ISO15118_2018 EVSETargetFrequency; //Optional
  1890. struct PnC_CLResIdentificationModeType PnC_CLResIdentificationMode;
  1891. struct Dynamic_CSResControlModeType Dynamic_CSResControlMode;
  1892. struct Scheduled_CSReqControlModeType Scheduled_CSReqControlMode;
  1893. };
  1894. /****CableCheckRequest (DC Only)****/
  1895. struct CableCheckRequest_DIN70121
  1896. {
  1897. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1898. };
  1899. struct CableCheckRequest_ISO15118_2014
  1900. {
  1901. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1902. };
  1903. struct CableCheckRequest_ISO15118_2018
  1904. {
  1905. //No member in standard
  1906. };
  1907. /****CableCheckResponse (DC Only)****/
  1908. struct CableCheckResponse_DIN70121
  1909. {
  1910. unsigned int cnt; //self added
  1911. enum ResponseCodeType_DIN70121 ResponseCode;
  1912. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1913. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  1914. };
  1915. struct CableCheckResponse_ISO15118_2014
  1916. {
  1917. unsigned int cnt; //self added
  1918. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1919. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1920. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  1921. };
  1922. struct CableCheckResponse_ISO15118_2018
  1923. {
  1924. unsigned int cnt; //self added
  1925. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1926. struct EVSEStatusType EVSEStatus; //Optional
  1927. enum ProcessingType EVSEProcessing;
  1928. };
  1929. /****PreChargeRequest (DC Only)****/
  1930. struct PreChargeRequest_DIN70121
  1931. {
  1932. unsigned int cnt; //self added
  1933. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1934. struct PhysicalValueType_DIN70121 EVTargetVoltage;
  1935. struct PhysicalValueType_DIN70121 EVTargetCurrent;
  1936. };
  1937. struct PreChargeRequest_ISO15118_2014
  1938. {
  1939. unsigned int cnt; //self added
  1940. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1941. struct PhysicalValueType_ISO15118_2014 EVTargetVoltage;
  1942. struct PhysicalValueType_ISO15118_2014 EVTargetCurrent;
  1943. };
  1944. struct PreChargeRequest_ISO15118_2018
  1945. {
  1946. unsigned int cnt; //self added
  1947. struct PhysicalValueType_ISO15118_2018 EVTargetVoltage;
  1948. struct PhysicalValueType_ISO15118_2018 EVTargetCurrent;
  1949. };
  1950. /****PreChargeResponse (DC Only)****/
  1951. struct PreChargeResponse_DIN70121
  1952. {
  1953. enum ResponseCodeType_DIN70121 ResponseCode;
  1954. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1955. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  1956. };
  1957. struct PreChargeResponse_ISO15118_2014
  1958. {
  1959. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1960. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1961. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  1962. };
  1963. struct PreChargeResponse_ISO15118_2018
  1964. {
  1965. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1966. struct EVSEStatusType EVSEStatus; //Optional
  1967. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  1968. };
  1969. /****CurrentDemandRequest (DC Only)****/
  1970. struct CurrentDemandRequest_DIN70121
  1971. {
  1972. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1973. struct PhysicalValueType_DIN70121 EVTargetCurrent;
  1974. struct PhysicalValueType_DIN70121 EVMaximumVoltageLimit; //Optional
  1975. struct PhysicalValueType_DIN70121 EVMaximumCurrentLimit; //Optional
  1976. struct PhysicalValueType_DIN70121 EVMaximumPowerLimit; //Optional
  1977. BOOL BulkChargingComplete; //Optional
  1978. BOOL ChargingComplete;
  1979. struct PhysicalValueType_DIN70121 RemainingTimeToFullSoC; //Optional
  1980. struct PhysicalValueType_DIN70121 RemainingTimeToBulkSoC; //Optional
  1981. struct PhysicalValueType_DIN70121 EVTargetVoltage;
  1982. };
  1983. struct CurrentDemandRequest_ISO15118_2014
  1984. {
  1985. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1986. struct PhysicalValueType_ISO15118_2014 EVTargetCurrent;
  1987. struct PhysicalValueType_ISO15118_2014 EVMaximumVoltageLimit; //Optional
  1988. struct PhysicalValueType_ISO15118_2014 EVMaximumCurrentLimit; //Optional
  1989. struct PhysicalValueType_ISO15118_2014 EVMaximumPowerLimit; //Optional
  1990. BOOL BulkChargingComplete; //Optional
  1991. BOOL ChargingComplete;
  1992. struct PhysicalValueType_ISO15118_2014 RemainingTimeToFullSoC; //Optional
  1993. struct PhysicalValueType_ISO15118_2014 RemainingTimeToBulkSoC; //Optional
  1994. struct PhysicalValueType_ISO15118_2014 EVTargetVoltage;
  1995. };
  1996. struct CurrentDemandRequest_ISO15118_2018
  1997. {
  1998. struct DisplayParametersType DisplayParameters; //Optional
  1999. struct PnC_CLReqIdentificationModeType PnC_CLReqIdentificationMode;
  2000. struct Dynamic_CSReqControlModeType Dynamic_CDReqControlMode;
  2001. struct Scheduled_CSReqControlModeType Scheduled_CDReqControlMode;
  2002. };
  2003. /****CurrentDemandResponse (DC Only)****/
  2004. struct CurrentDemandResponse_DIN70121
  2005. {
  2006. enum ResponseCodeType_DIN70121 ResponseCode;
  2007. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2008. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  2009. struct PhysicalValueType_DIN70121 EVSEPresentCurrent;
  2010. BOOL EVSECurrentLimitAchieved;
  2011. BOOL EVSEVoltageLimitAchieved;
  2012. BOOL EVSEPowerLimitAchieved;
  2013. struct PhysicalValueType_DIN70121 EVSEMaximumVoltageLimit; //Optional
  2014. struct PhysicalValueType_DIN70121 EVSEMaximumCurrentLimit; //Optional
  2015. struct PhysicalValueType_DIN70121 EVSEMaximumPowerLimit; //Optional
  2016. };
  2017. struct CurrentDemandResponse_ISO15118_2014
  2018. {
  2019. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2020. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2021. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  2022. struct PhysicalValueType_ISO15118_2014 EVSEPresentCurrent;
  2023. BOOL EVSECurrentLimitAchieved;
  2024. BOOL EVSEVoltageLimitAchieved;
  2025. BOOL EVSEPowerLimitAchieved;
  2026. struct PhysicalValueType_ISO15118_2014 EVSEMaximumVoltageLimit; //Optional
  2027. struct PhysicalValueType_ISO15118_2014 EVSEMaximumCurrentLimit; //Optional
  2028. struct PhysicalValueType_ISO15118_2014 EVSEMaximumPowerLimit; //Optional
  2029. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2030. short SAScheduleTupleID;
  2031. struct MeterInfoType_ISO15118_2014 MeterInfo; //Optional
  2032. BOOL ReceiptRequired; //Optional
  2033. };
  2034. struct CurrentDemandResponse_ISO15118_2018
  2035. {
  2036. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2037. struct EVSEStatusType EVSEStatus; //Optional
  2038. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  2039. struct PhysicalValueType_ISO15118_2018 EVSEPresentCurrent;
  2040. BOOL EVSECurrentLimitAchieved;
  2041. BOOL EVSEVoltageLimitAchieved;
  2042. BOOL EVSEPowerLimitAchieved;
  2043. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeVoltage; //Optional
  2044. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent; //Optional
  2045. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower; //Optional
  2046. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2047. struct PnC_CLResIdentificationModeType PnC_CLResIdentificationMode;
  2048. struct Scheduled_CDResControlModeType Scheduled_CDResControlMode;
  2049. };
  2050. /****WeldingDetectionRequest (DC Only)*****/
  2051. struct WeldingDetectionRequest_DIN70121
  2052. {
  2053. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  2054. };
  2055. struct WeldingDetectionRequest_ISO15118_2014
  2056. {
  2057. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  2058. };
  2059. struct WeldingDetectionRequest_ISO15118_2018
  2060. {
  2061. //No member in Standard
  2062. };
  2063. /****WeldingDetectionResponse (DC Only)****/
  2064. struct WeldingDetectionResponse_DIN70121
  2065. {
  2066. enum ResponseCodeType_DIN70121 ResponseCode;
  2067. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2068. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  2069. };
  2070. struct WeldingDetectionResponse_ISO15118_2014
  2071. {
  2072. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2073. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2074. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  2075. };
  2076. struct WeldingDetectionResponse_ISO15118_2018
  2077. {
  2078. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2079. struct EVSEStatusType EVSEStatus; //Optional
  2080. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  2081. };
  2082. /****FinePositioningSetupRequest (WPT Only)****/
  2083. struct FinePositioningSetupRequest_ISO15118_2018
  2084. {
  2085. struct LFA_EVFinePositioningSetupParametersType LFA_EVFinePositioningSetupParameters; //Optional
  2086. };
  2087. /****FinePositioningSetupResponse (WPT Only)****/
  2088. struct FinePositioningSetupResponse_ISO15118_2018
  2089. {
  2090. //NOT complete yet, to be continue.....
  2091. };
  2092. struct V2GMessageType_DIN70121 {
  2093. enum MsgFlowStatus PresentMsgFlowStatus;
  2094. enum MsgFlowStatus PresentMsgFlowStatus_pre;
  2095. /* 0: IDLE(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2096. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2097. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2098. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2099. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2100. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2101. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2102. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2103. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2104. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2105. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2106. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2107. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2108. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2109. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2110. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2111. 52: SessionStopRequest, 53: SessionStopResponse
  2112. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2113. */
  2114. struct SupportedAppProtocolRequest_DIN70121 SupportedAppProtocolRequest;
  2115. struct SupportedAppProtocolResponse_DIN70121 SupportedAppProtocolResponse;
  2116. struct SessionSetupRequest_DIN70121 SessionSetupRequest;
  2117. struct SessionSetupResponse_DIN70121 SessionSetupResponse;
  2118. struct ServiceDiscoveryRequest_DIN70121 ServiceDiscoveryRequest;
  2119. struct ServiceDiscoveryResponse_DIN70121 ServiceDiscoveryResponse;
  2120. struct ServiceAndPaymentSelectionRequest_DIN70121 ServiceAndPaymentSelectionRequest;
  2121. struct ServiceAndPaymentSelectionResponse_DIN70121 ServiceAndPaymentSelectionResponse;
  2122. struct ContractAuthenticationRequest_DIN70121 ContractAuthenticationRequest;
  2123. struct ContractAuthenticationResponse_DIN70121 ContractAuthenticationResponse;
  2124. struct ChargeParameterDiscoveryRequest_DIN70121 ChargeParameterDiscoveryRequest;
  2125. struct ChargeParameterDiscoveryResponse_DIN70121 ChargeParameterDiscoveryResponse;
  2126. struct CableCheckRequest_DIN70121 CableCheckRequest;
  2127. struct CableCheckResponse_DIN70121 CableCheckResponse;
  2128. struct PreChargeRequest_DIN70121 PreChargeRequest;
  2129. struct PreChargeResponse_DIN70121 PreChargeResponse;
  2130. struct PowerDeliveryRequest_DIN70121 PowerDeliveryRequest;
  2131. struct PowerDeliveryResponse_DIN70121 PowerDeliveryResponse;
  2132. struct CurrentDemandRequest_DIN70121 CurrentDemandRequest;
  2133. struct CurrentDemandResponse_DIN70121 CurrentDemandResponse;
  2134. struct WeldingDetectionRequest_DIN70121 WeldingDetectionRequest;
  2135. struct WeldingDetectionResponse_DIN70121 WeldingDetectionResponse;
  2136. struct SessionStopRequest_DIN70121 SessionStopRequest;
  2137. struct SessionStopResponse_DIN70121 SessionStopResponse;
  2138. };
  2139. struct V2GMessageType_ISO15118_2014 {
  2140. enum MsgFlowStatus PresentMsgFlowStatus;
  2141. enum MsgFlowStatus PresentMsgFlowStatus_pre;
  2142. /* 0: IDLE(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2143. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2144. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2145. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2146. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2147. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2148. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2149. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2150. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2151. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2152. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2153. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2154. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2155. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2156. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2157. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2158. 52: SessionStopRequest, 53: SessionStopResponse
  2159. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2160. */
  2161. struct SupportedAppProtocolRequest_ISO15118_2014 SupportedAppProtocolRequest;
  2162. struct SupportedAppProtocolResponse_ISO15118_2014 SupportedAppProtocolResponse;
  2163. struct SessionSetupRequest_ISO15118_2014 SessionSetupRequest;
  2164. struct SessionSetupResponse_ISO15118_2014 SessionSetupResponse;
  2165. struct ServiceDiscoveryRequest_ISO15118_2014 ServiceDiscoveryRequest;
  2166. struct ServiceDiscoveryResponse_ISO15118_2014 ServiceDiscoveryResponse;
  2167. struct ServiceDetailRequest_ISO15118_2014 ServiceDetailRequest;
  2168. struct ServiceDetailResponse_ISO15118_2014 ServiceDetailResponse;
  2169. struct ServiceAndPaymentSelectionRequest_ISO15118_2014 ServiceAndPaymentSelectionRequest;
  2170. struct ServiceAndPaymentSelectionResponse_ISO15118_2014 ServiceAndPaymentSelectionResponse;
  2171. struct PaymentDetailsRequest_ISO15118_2014 PaymentDetailsRequest;
  2172. struct PaymentDetailsResponse_ISO15118_2014 PaymentDetailsResponse;
  2173. struct AuthorizationRequest_ISO15118_2014 AuthorizationRequest;
  2174. struct AuthorizationResponse_ISO15118_2014 AuthorizationResponse;
  2175. struct CertificateUpdateRequest_ISO15118_2014 CertificateUpdateRequest;
  2176. struct CertificateUpdateResponse_ISO15118_2014 CertificateUpdateResponse;
  2177. struct CertificateInstallationRequest_ISO15118_2014 CertificateInstallationRequest;
  2178. struct CertificateInstallationResponse_ISO15118_2014 CertificateInstallationResponse;
  2179. struct ChargeParameterDiscoveryRequest_ISO15118_2014 ChargeParameterDiscoveryRequest;
  2180. struct ChargeParameterDiscoveryResponse_ISO15118_2014 ChargeParameterDiscoveryResponse;
  2181. struct CableCheckRequest_ISO15118_2014 CableCheckRequest;
  2182. struct CableCheckResponse_ISO15118_2014 CableCheckResponse;
  2183. struct PreChargeRequest_ISO15118_2014 PreChargeRequest;
  2184. struct PreChargeResponse_ISO15118_2014 PreChargeResponse;
  2185. struct PowerDeliveryRequest_ISO15118_2014 PowerDeliveryRequest;
  2186. struct PowerDeliveryResponse_ISO15118_2014 PowerDeliveryResponse;
  2187. struct ChargingStatusRequest_ISO15118_2014 ChargingStatusRequest;
  2188. struct ChargingStatusResponse_ISO15118_2014 ChargingStatusResponse;
  2189. struct CurrentDemandRequest_ISO15118_2014 CurrentDemandRequest;
  2190. struct CurrentDemandResponse_ISO15118_2014 CurrentDemandResponse;
  2191. struct MeteringReceiptRequest_ISO15118_2014 MeteringReceiptRequest;
  2192. struct MeteringReceiptResponse_ISO15118_2014 MeteringReceiptResponse;
  2193. struct WeldingDetectionRequest_ISO15118_2014 WeldingDetectionRequest;
  2194. struct WeldingDetectionResponse_ISO15118_2014 WeldingDetectionResponse;
  2195. struct SessionStopRequest_ISO15118_2014 SessionStopRequest;
  2196. struct SessionStopResponse_ISO15118_2014 SessionStopResponse;
  2197. };
  2198. struct V2GMessageType_ISO15118_2018 {
  2199. enum MsgFlowStatus PresentMsgFlowStatus;
  2200. enum MsgFlowStatus PresentMsgFlowStatus_pre;
  2201. /* 0: IDLE(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2202. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2203. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2204. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2205. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2206. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2207. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2208. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2209. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2210. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2211. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2212. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2213. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2214. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2215. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2216. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2217. 52: SessionStopRequest, 53: SessionStopResponse
  2218. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2219. */
  2220. struct SupportedAppProtocolRequest_ISO15118_2018 SupportedAppProtocolRequest;
  2221. struct SupportedAppProtocolResponse_ISO15118_2018 SupportedAppProtocolResponse;
  2222. struct SessionSetupRequest_ISO15118_2018 SessionSetupRequest;
  2223. struct SessionSetupResponse_ISO15118_2018 SessionSetupResponse;
  2224. struct ServiceDiscoveryRequest_ISO15118_2018 ServiceDiscoveryRequest;
  2225. struct ServiceDiscoveryResponse_ISO15118_2018 ServiceDiscoveryResponse;
  2226. struct ServiceDetailRequest_ISO15118_2018 ServiceDetailRequest;
  2227. struct ServiceDetailResponse_ISO15118_2018 ServiceDetailResponse;
  2228. struct ServiceSelectionRequest_ISO15118_2018 ServiceSelectionRequest;
  2229. struct ServiceSelectionResponse_ISO15118_2018 ServiceSelectionResponse;
  2230. struct IdentificationDetailsRequest_ISO15118_2018 IdentificationDetailsRequest;
  2231. struct IdentificationDetailsResponse_ISO15118_2018 IdentificationDetailsResponse;
  2232. struct AuthorizationRequest_ISO15118_2018 AuthorizationRequest;
  2233. struct AuthorizationResponse_ISO15118_2018 AuthorizationResponse;
  2234. struct CertificateInstallationRequest_ISO15118_2018 CertificateInstallationRequest;
  2235. struct CertificateInstallationResponse_ISO15118_2018 CertificateInstallationResponse;
  2236. struct ChargeParameterDiscoveryRequest_ISO15118_2018 ChargeParameterDiscoveryRequest;
  2237. struct ChargeParameterDiscoveryResponse_ISO15118_2018 ChargeParameterDiscoveryResponse;
  2238. struct CableCheckRequest_ISO15118_2018 CableCheckRequest;
  2239. struct CableCheckResponse_ISO15118_2018 CableCheckResponse;
  2240. struct PreChargeRequest_ISO15118_2018 PreChargeRequest;
  2241. struct PreChargeResponse_ISO15118_2018 PreChargeResponse;
  2242. struct PowerDeliveryRequest_ISO15118_2018 PowerDeliveryRequest;
  2243. struct PowerDeliveryResponse_ISO15118_2018 PowerDeliveryResponse;
  2244. struct ChargingStatusRequest_ISO15118_2018 ChargingStatusRequest;
  2245. struct ChargingStatusResponse_ISO15118_2018 ChargingStatusResponse;
  2246. struct CurrentDemandRequest_ISO15118_2018 CurrentDemandRequest;
  2247. struct CurrentDemandResponse_ISO15118_2018 CurrentDemandResponse;
  2248. struct MeteringReceiptRequest_ISO15118_2018 MeteringReceiptRequest;
  2249. struct MeteringReceiptResponse_ISO15118_2018 MeteringReceiptResponse;
  2250. struct WeldingDetectionRequest_ISO15118_2018 WeldingDetectionRequest;
  2251. struct WeldingDetectionResponse_ISO15118_2018 WeldingDetectionResponse;
  2252. struct SessionStopRequest_ISO15118_2018 SessionStopRequest;
  2253. struct SessionStopResponse_ISO15118_2018 SessionStopResponse;
  2254. };
  2255. struct CcsData {
  2256. unsigned char CommProtocol;
  2257. //0: V2GT_MSG_PROTOCOL_DIN70121
  2258. //1: V2GT_MSG_PROTOCOL_ISO15118_2014
  2259. //2: V2GT_MSG_PROTOCOL_ISO15118_2018
  2260. unsigned char EnergyTransferMode;
  2261. struct V2GMessageType_DIN70121 V2GMessage_DIN70121;
  2262. struct V2GMessageType_ISO15118_2014 V2GMessage_ISO15118_2014;
  2263. struct V2GMessageType_ISO15118_2018 V2GMessage_ISO15118_2018;
  2264. };
  2265. struct InternalComm {
  2266. unsigned char ChargingPermission;
  2267. unsigned char SlaveAddress;
  2268. unsigned char IsolationStatus; //0:ongoing, 1:valid, 2:warning/fault
  2269. unsigned char CCSConnectorType; //0:CCS1, 1:CCS2
  2270. unsigned char MaximumAllowedChargingTime; //0x00: unlimited
  2271. //(0x01: 1 minutes ~ 0xFF: 255 minutes, resolution: 1 minute)
  2272. unsigned int RTC; //4 bytes
  2273. unsigned char EVSEPrechargeStatus;
  2274. int MaximumChargingVoltage; //0~6553.5 volt, resolution: 0.1V
  2275. int AvailableChargingCurrent; //0~6553.5 amp, resolution: 0.1V
  2276. int AvailableChargingPower; //0~6553.5 kW, resolution: 0.1KW
  2277. int PresentChargingVoltage; //0~6553.5 volt, resolution: 0.1V
  2278. int PresentChargingCurrent; //0~6553.5 amp, resolution: 0.1A
  2279. int PresentChargingPower; //0~6553.5 KW, resolution: 0.1KW
  2280. struct timeb CAN_Rx_Timer_Start;
  2281. struct timeb CAN_Rx_Timer_End;
  2282. int FD_CAN_Socket;
  2283. struct timeb Start_Time;
  2284. struct timeb End_Time;
  2285. unsigned char ChargingPermission_new;
  2286. BOOL AC_RcdStatus; //0:no error, 1:error
  2287. unsigned char AC_EVSEID[40];
  2288. unsigned char AC_MeterID[32];
  2289. unsigned char AC_EVSEModelName[32];
  2290. unsigned char AC_BatteryChargeType;
  2291. unsigned char AC_CpPresentPWMDuty;
  2292. unsigned char AC_CpPresentState;
  2293. unsigned short AC_ChargingRemainTime;
  2294. unsigned int AC_CSUAlarmStatusCode;
  2295. unsigned int AC_CcsHeartBeat;
  2296. float AC_GridVoltage[3];
  2297. float AC_MeterReadingValue;
  2298. float AC_CpPositiveVoltage;
  2299. float AC_CpNegativeVoltage;
  2300. float AC_EVSEMaxCurrent;
  2301. float AC_EVSEMinCurrent;
  2302. float AC_EVSEPresentCurrent[3];
  2303. BOOL AC_OutputRelayStatus;
  2304. float AC_AvailableChargingPower; //1KW
  2305. unsigned char AC_EVSENotification; //0:none, 1:StopCharging, 2:RenNgotiation
  2306. unsigned char ChargingPermission_pre;
  2307. unsigned char SlaveAddress_pre;
  2308. unsigned char IsolationStatus_pre; //0:ongoing, 1:valid, 2:warning/fault
  2309. unsigned char CCSConnectorType_pre; //0:CCS1, 1:CCS2
  2310. unsigned char MaximumAllowedChargingTime_pre; //0x00: unlimited
  2311. //(0x01: 1 minutes ~ 0xFF: 255 minutes, resolution: 1 minute)
  2312. unsigned int RTC_pre; //4 bytes
  2313. unsigned char EVSEPrechargeStatus_pre;
  2314. int MaximumChargingVoltage_pre; //0~6553.5 volt, resolution: 0.1V
  2315. int AvailableChargingCurrent_pre; //0~6553.5 amp, resolution: 0.1V
  2316. int AvailableChargingPower_pre; //0~6553.5 kW, resolution: 0.1KW
  2317. int PresentChargingVoltage_pre; //0~6553.5 volt, resolution: 0.1V
  2318. int PresentChargingCurrent_pre; //0~6553.5 amp, resolution: 0.1A
  2319. int PresentChargingPower_pre; //0~6553.5 KW, resolution: 0.1KW
  2320. BOOL AC_RcdStatus_pre; //0:no error, 1:error
  2321. unsigned char AC_EVSEID_pre[40];
  2322. unsigned char AC_MeterID_pre[32];
  2323. unsigned char AC_EVSEModelName_pre[32];
  2324. unsigned char AC_BatteryChargeType_pre;
  2325. unsigned char AC_CpPresentPWMDuty_pre;
  2326. unsigned char AC_CpPresentState_pre;
  2327. unsigned short AC_ChargingRemainTime_pre;
  2328. unsigned int AC_CSUAlarmStatusCode_pre;
  2329. unsigned int AC_CcsHeartBeat_pre;
  2330. float AC_GridVoltage_pre[3];
  2331. float AC_MeterReadingValue_pre;
  2332. float AC_CpPositiveVoltage_pre;
  2333. float AC_CpNegativeVoltage_pre;
  2334. float AC_EVSEMaxCurrent_pre;
  2335. float AC_EVSEMinCurrent_pre;
  2336. float AC_EVSEPresentCurrent_pre[3];
  2337. BOOL AC_OutputRelayStatus_pre;
  2338. float AC_AvailableChargingPower_pre; //1KW
  2339. unsigned char AC_EVSENotification_pre; //0:none, 1:StopCharging, 2:RenNgotiation
  2340. struct DownloadImageInfoStructure {
  2341. FILE *file;
  2342. unsigned char active;
  2343. unsigned char type;
  2344. char filename[128];
  2345. unsigned long image_rx_cnt;
  2346. unsigned long image_size;
  2347. unsigned long total_can_packets;
  2348. unsigned long image_size_received; //unit: byte
  2349. unsigned char block_quantity;
  2350. unsigned char block_sequence_number;
  2351. unsigned char block_size_KByte; //unit: KBytes
  2352. unsigned char block_checksum;
  2353. unsigned char final_canmsg_size; //unit: byte
  2354. unsigned char downlaod_percentage;
  2355. unsigned char downlaod_percentage_pre;
  2356. } DownloadImageInfo;
  2357. struct EVSEStopChargingReqType {
  2358. unsigned char type;
  2359. unsigned char alarmcode[6];
  2360. } EVSEStopChargingReq;
  2361. union
  2362. {
  2363. unsigned char InternalCommVal;
  2364. struct
  2365. {
  2366. //FaultVal[0]
  2367. unsigned int matched: 1; //CAN_CMD_ADDRESS_REQUEST 0x00000100
  2368. unsigned int Got_AssignedAddress: 1; //CAN_CMD_ADDRESS_ASSIGN 0x00000200
  2369. unsigned int Send_EVBoardStatus: 1; //CAN_CMD_EV_BOARD_STATUS 0x00000300
  2370. unsigned int Got_FWVersionReq: 1; //CAN_CMD_GET_FW_VERSION 0x00000400
  2371. unsigned int Got_HWVersionReq: 1; //CAN_CMD_GET_HW_VERSION 0x00000500
  2372. unsigned int Got_ChargingPermission: 1; //CAN_CMD_CHARGING_PERMISSION 0x00000600
  2373. unsigned int Got_EVSEOutputStatus: 1; //CAN_CMD_EVSE_OUTPUT_STATUS_ANNOUNCEMENT 0x00000700
  2374. unsigned int Got_EnergyCapacity: 1; //CAN_CMD_EVSE_CAPACITY_ANNOUNCEMENT 0x00000800
  2375. unsigned int Got_EVTargetReq: 1; //CAN_CMD_GET_EV_TARGET_INFO 0x00000900
  2376. unsigned int Got_EVBatteryInfoReq: 1; //CAN_CMD_GET_EV_BATTERY_INFO 0x00000A00
  2377. unsigned int Send_EVStopReq: 1; //#define CAN_CMD_EV_STOP_EVENT 0x00000B00
  2378. unsigned int Got_EVSEStopReq: 1; //#define CAN_CMD_EVSE_STOP_EVENT 0x00000C00
  2379. unsigned int Got_MiscellaneousInfoReq: 1; //#define CAN_CMD_GET_MISC_INFO 0x00000D00
  2380. unsigned int Got_DownloadImageReq: 1; //#define CAN_CMD_DOWNLOAD_REQUEST 0x00000E00
  2381. unsigned int Got_BlockTransferStartReq: 1; //#define CAN_CMD_START_BLOCK_TRANSFER 0x00000F00
  2382. unsigned int Got_DataTransferReq: 1; //CAN_CMD_DATA_TRANSFER 0x00001000
  2383. unsigned int Got_DownloadFinishReq: 1; //CAN_CMD_DOWNLOAD_FINISH 0x00001100
  2384. unsigned int Got_IsolationStatus: 1; //CAN_CMD_ISOLATION_STATUS 0x00001200
  2385. unsigned int Got_CCSConnectorReq: 1; //CAN_CMD_CCS_CONNECTOR_INFO 0x00001300
  2386. unsigned int Got_RTC: 1; //CAN_CMD_RTC_INFO 0x00001400
  2387. unsigned int Got_EVSE_Precharge_Info: 1; //CAN_CMD_EVSE_PRECHARGE_INFO 0x00001500
  2388. unsigned int Got_EVCCID_Req: 1; //CAN_CMD_EVCCID_REQUEST 0x00001600
  2389. unsigned int EV_Stop_Type_Emergency: 1;
  2390. unsigned int FW_Update_Done: 1;
  2391. unsigned int FW_Update_Task_inused: 1;
  2392. unsigned int FW_Update_result: 1;
  2393. unsigned int FW_Update_Reboot_inused: 1;
  2394. unsigned int CAN_Rx_Timeout: 1;
  2395. unsigned int Reboot_Process_inused: 1;
  2396. unsigned int reserved: 3;
  2397. } bits;
  2398. } InternalCommUnion;
  2399. };
  2400. #endif // DEFINE_H_