define_ccs.h 119 KB

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