define_ccs.h 119 KB

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