define.h 147 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432
  1. #ifndef DEFINE_H_
  2. #define DEFINE_H_
  3. /**************************************************************************************/
  4. /*********************************NAND Flash mapping *****************************/
  5. /**************************************************************************************/
  6. /*
  7. sector size 512 KiB
  8. Page size 4096 b
  9. OOB size 224 b
  10. Erase size 524288 b
  11. -------------------------------------------------------------------------------------------------------------------------------
  12. Segment Physical address Size
  13. -------------------------------------------------------------------------------------------------------------------------------
  14. MLO 0x00000000-0x0007FFFF 512 KB
  15. Primary u-boot 0x00080000-0x0017FFFF 1 MB
  16. Environment 0x00180000-0x001FFFFF 512 KB
  17. Secondary u-boot 0x00200000-0x002FFFFF 1 MB
  18. Primary dtb 0x00300000-0x0037FFFF 512 KB
  19. Secondary dtb 0x00380000-0x003FFFFF 512 KB
  20. Primary kernel 0x00400000-0x00DFFFFF 10 MB
  21. Secondary Kernel 0x00E00000-0x017FFFFF 10 MB
  22. Primary root file system 0x03000000-0x05FFFFFF 48 MB
  23. Secondary root file system 0x06000000-0x08FFFFFF 48 MB
  24. Primary user configuration 0x09000000-0x095FFFFF 6 MB
  25. Secondary user configuration 0x09600000-0x09BFFFFF 6 MB
  26. Factory default configuration 0x09C00000-0x0A1FFFFF 6 MB
  27. Storage 0x0A200000-0x7FFFFFFF 1886 MB
  28. */
  29. /**************************************************************************************/
  30. /*********************************System Limitation**********************************/
  31. /**************************************************************************************/
  32. /*Rating outout power and current*/
  33. #define RATED_POWER 25 //kW
  34. #define RATED_CURRENT 350 //Amp, it depend on the capacity of charging connector
  35. /*relevant to Quantity */
  36. #define MAX_PSU_QUANTITY 62
  37. #define CHAdeMO_QUANTITY 1
  38. #define CCS_QUANTITY 1
  39. #define GB_QUANTITY 0
  40. #define AC_QUANTITY 1
  41. #define PSU_QUANTITY 2
  42. #define ONE_CONNECTOR_USE 0
  43. /*SystemLog message*/
  44. #define SystemLogMessage //for engineer to do analysis
  45. /**************************************************************************************/
  46. /*****************************share memory key information*****************************/
  47. /**************************************************************************************/
  48. #define ShmSysConfigAndInfoKey 1001
  49. #define ShmPsuKey 1002
  50. #define ShmCHAdeMOCommKey 1003
  51. #define ShmCcsCommKey 1004
  52. #define ShmStatusCodeKey 1005
  53. #define ShmPrimaryMcuKey 1006
  54. #define ShmFanBdKey 1007
  55. #define ShmRelayBdKey 1008
  56. #define ShmOcppModuleKey 1009
  57. /**************************************************************************************/
  58. /****************** Share memory configuration value constant define ******************/
  59. /**************************************************************************************/
  60. enum SYSTEM_STATUS
  61. {
  62. SYS_MODE_BOOTING = 0,
  63. SYS_MODE_IDLE = 1,
  64. SYS_MODE_AUTHORIZING = 2,
  65. SYS_MODE_MODE_REASSIGN_CHECK = 3,
  66. SYS_MODE_REASSIGN = 4,
  67. SYS_MODE_PREPARING = 5,
  68. SYS_MODE_PREPARE_FOR_EV = 6,
  69. SYS_MODE_PREPARE_FOR_EVSE = 7,
  70. SYS_MODE_CHARGING = 8,
  71. SYS_MODE_TERMINATING = 9,
  72. SYS_MODE_COMPLETE = 10,
  73. SYS_MODE_ALARM = 11,
  74. SYS_MODE_FAULT = 12,
  75. SYS_MODE_RESERVATION = 13,
  76. SYS_MODE_BOOKING = 14,
  77. SYS_MODE_MAINTAIN = 15,
  78. SYS_MODE_DEBUG = 16,
  79. SYS_MODE_CCS_PRECHARGE_STEP0 = 17,
  80. SYS_MODE_CCS_PRECHARGE_STEP1 = 18,
  81. SYS_MODE_SINGLE_RUN = 19
  82. };
  83. enum AUTHORIZATION_MODE
  84. {
  85. AUTH_MODE_PH_RFID = 0,
  86. AUTH_MODE_BACKEND_OCPP = 1,
  87. AUTH_MODE_BACKEND_PH = 2,
  88. AUTH_MODE_FREE = 3
  89. };
  90. enum LCD_LANGUAGE
  91. {
  92. LCD_LANG_ENGLISH = 0,
  93. LCD_LANG_CHT = 1,
  94. LCD_LANG_CHS = 2,
  95. LCD_LANG_JAPANESE = 3,
  96. LCD_LANG_FRENCH = 4,
  97. LCD_LANG_ITALIAN = 5,
  98. LCD_LANG_SPANISH = 6,
  99. LCD_LANG_GERMAN = 7,
  100. LCD_LANG_DUTCH = 8,
  101. LCD_LANG_NORWEGIAN = 9,
  102. LCD_LANG_FINNISH = 10,
  103. LCD_LANG_SWEDISH = 11,
  104. LCD_LANG_SLOVENIAN = 12,
  105. LCD_LANG_THAI = 13,
  106. };
  107. enum RFID_ENDIAN
  108. {
  109. RFID_ENDIAN_LITTLE = 0,
  110. RFID_ENDIAN_BIG = 1
  111. };
  112. enum PHASE_LOSS_POLICY
  113. {
  114. LOSS_POLICY_CHARGING = 0,
  115. LOSS_POLICY_STOP = 1
  116. };
  117. enum CCS_AUTHPRIZATION_MODE
  118. {
  119. CCS_AUTH_MODE_EIM = 0,
  120. CCS_AUTH_MODE_MIXED = 1
  121. };
  122. enum OFF_LINE_POLICY
  123. {
  124. OFF_POLICY_LOCALLIST = 0,
  125. OFF_POLICY_PH_RFID = 1,
  126. OFF_POLICY_FREE = 2,
  127. OFF_POLICY_NOCHARGE = 3
  128. };
  129. /**************************************************************************************/
  130. /****structure SysConfigData => shall store the data to NAND flash****************/
  131. /****structure SysInfoData => shall NOT store the data to NAND flash***************/
  132. /****according to System Configuration and Information Table.xlsx Rev.0.2 *******/
  133. /**************************************************************************************/
  134. struct NoneUse
  135. {
  136. unsigned char unknown; // None use struct
  137. };
  138. struct EthConfigData
  139. {
  140. unsigned char EthDhcpClient; //0: enable,1: disable
  141. unsigned char EthMacAddress[18]; //default: Null
  142. unsigned char EthIpAddress[16]; //Eth0 default:192.168.0.10 ,Eth1 default:192.168.1.10
  143. unsigned char EthSubmaskAddress[16]; //Eth0 default:255.255.255.0 ,Eth1 default:255.255.255.0
  144. unsigned char EthGatewayAddress[16]; //Eth0 default:192.168.0.254 ,Eth1 default:192.168.1.254
  145. };
  146. struct WifiConfigData
  147. {
  148. unsigned char WifiMode; //0: disable, 1: Infrastructure client, 2: Infrastructure server, 3: Ad-Hoc
  149. unsigned char WifiSsid[256]; //default: Null
  150. unsigned char WifiPassword[256]; //default: Null
  151. int WifiRssi; //dbm
  152. unsigned char WifiDhcpServer; //0: enable, 1: disable
  153. unsigned char WifiDhcpClient; //0: enable, 1: disable
  154. unsigned char WifiMacAddress[18]; //default: Null
  155. unsigned char WifiIpAddress[16]; //default:192.168.2.10
  156. unsigned char WifiSubmaskAddress[16]; //default:255.255.255.0
  157. unsigned char WifiGatewayAddress[16]; //default:192.168.2.254
  158. unsigned char WifiNetworkConn; //0: disconnected, 1: connected
  159. };
  160. struct TeleConfigData
  161. {
  162. unsigned char TelcomModelName[64]; //default: Null
  163. unsigned char TelcomSoftwareVer[64]; //default: Null
  164. unsigned char TelcomApn[256]; //default: Null
  165. int TelcomRssi; //dbm
  166. unsigned char TelcomChapPapId[256]; //default: Null
  167. unsigned char TelcomChapPapPwd[256]; //default: Null
  168. unsigned char TelcomModemImei[16]; //default: Null
  169. unsigned char TelcomSimImsi[16]; //default: Null
  170. unsigned char TelcomSimIccid[20]; //default: Null
  171. unsigned char TelcomSimStatus; //0: no SIM card is found, 1: valid SIM card, 2: invalid SIM card
  172. unsigned char TelcomModemMode; //0: No services, 1: CDMA, 2: GSM/GPRS, 3: WCDMA, 4: GSM/WCDMA, 5: TD_SCDMA mode, 6: Unknow
  173. unsigned char TelcomIpAddress[16]; //default: Null
  174. unsigned char TelcomNetworkConn; //0: disconnected, 1: connected
  175. };
  176. struct BtConfigData
  177. {
  178. unsigned char LoginCentralID[64]; //default: Null
  179. unsigned char isLogin; //0: Central device non-login 1: Central device login
  180. unsigned char isRequestStart; //0: no action 1: request start charging
  181. unsigned char isRequestStop; //0: no action 1: request stop charging
  182. };
  183. struct SysConfigData
  184. {
  185. /**************System***************/
  186. unsigned char CsuBootLoadFwRev[32]; //CSU board bootloader firmware version
  187. unsigned char ModelName[64]; //charger model name
  188. unsigned char SerialNumber[64]; //charger system serial number
  189. unsigned char SystemId[128]; //charger system ID
  190. unsigned char SystemDateTime[32]; //charger system date and time
  191. unsigned char AcPhaseCount; //AC EVSE power phase quantity, 1: One phase 3: Three phase
  192. unsigned char AuthorisationMode; //0: Phihong RFID tag, 1: OCPP backend, 2: Phihong backend, 3: free mode
  193. unsigned char DefaultLanguage; //
  194. unsigned char RfidCardNumEndian; //0: little endian, 1: big endian
  195. unsigned short AcPlugInTimes; //0~65535
  196. unsigned short GbPlugInTimes; //0~65535
  197. unsigned short Ccs1PlugInTime; //0~65535
  198. unsigned short Ccs2PlugInTimes; //0~65535
  199. unsigned short ChademoPlugInTimes; //0~65535
  200. unsigned char PsuAcInputType; //0: 220, 1: 277
  201. /**************Charging***************/
  202. unsigned short MaxChargingEnergy; //0: no limit, 1 ~ 65535 kWh
  203. unsigned short MaxChargingPower; //0: rating value, 1 ~ RATING_POWER kW"
  204. unsigned short MaxChargingCurrent; //0: rating value, 1 ~ RATING_CURRENT amp"
  205. unsigned short MaxChargingDuration; //0: no limit, 1 ~ 65535 minutes
  206. unsigned char PhaseLossPolicy; //0: charging, 1: stop charging
  207. unsigned char LocalWhiteCard[10][32]; //Max. card quantity is 10
  208. unsigned char UserId[32]; //the user use this ID to trigger charging event, it can be RFID card number, OCPP IdTag, etc.
  209. /**************Network***************/
  210. unsigned char FtpServer[256]; //the ftp server for Phihong server to do data transimission
  211. struct EthConfigData Eth0Interface;
  212. struct EthConfigData Eth1Interface;
  213. struct WifiConfigData AthInterface;
  214. struct TeleConfigData TelecomInterface;
  215. struct BtConfigData Bluetooth;
  216. /**************Backend***************/
  217. unsigned int BackendConnTimeout; //default : 300s
  218. unsigned char OfflinePolicy; //0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
  219. unsigned short OfflineMaxChargeEnergy; //0: same as MaxChargingEnergy, 1 ~ 65535 kWh
  220. unsigned short OfflineMaxChargeDuration; //0: same as MaxChargeDuration, 1 ~ 65535 minutes
  221. unsigned char OcppServerURL[512]; //http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
  222. unsigned char ChargeBoxId[128];
  223. unsigned char chargePointVendor[20]; //the Vendor of the ChargePoint
  224. unsigned int Checksum; //4 bytes checksum
  225. };
  226. struct ChargingInfoData
  227. {
  228. unsigned char Index;
  229. unsigned char slotsIndex;
  230. unsigned char Type; // 0 : Chademo, 1 : CCS, 2: GB
  231. unsigned char type_index;
  232. unsigned char Evboard_id; // for EV board
  233. unsigned char StopChargeFlag; // for EV board
  234. unsigned char SystemStatus; //0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
  235. unsigned char PreviousSystemStatus; // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
  236. int ReservationId;
  237. unsigned char CardNumber[32];
  238. float MaximumChargingVoltage; //0~6553.5 volt
  239. float AvailableChargingCurrent; //0~6553.5 amp
  240. float AvailableChargingPower; //0~6553.5 kW
  241. float DeratingChargingCurrent; //0~6553.5 amp
  242. float DeratingChargingPower; //0~6553.5 kW
  243. float FuseChargingVoltage; //0~6553.5 volt
  244. float FireChargingVoltage; //0~6553.5 volt
  245. float PresentChargingVoltage; //0~6553.5 volt
  246. float PresentChargingCurrent; //0~6553.5 amp
  247. float PresentChargingPower; //0~6553.5 kW
  248. float PresentChargedEnergy; //0~6553.5 kWh
  249. int PresentChargedDuration; // second
  250. int RemainChargingDuration; // second
  251. float EvBatteryMaxVoltage; // 0~6553.5 volt
  252. float EvBatterytargetVoltage; // 0~6553.5 volt
  253. float EvBatterytargetCurrent; //102.3 0~200(A) (unit:1A)
  254. int EvBatterySoc; // 0~100%
  255. unsigned char ConnectorPlugIn; //0: unplug, 1: Plug-in
  256. unsigned char GunLocked; //0: unlocked 1: locked
  257. float PilotVoltage;
  258. unsigned char PilotState;//1:state A, 2:State B1, 3:State B2, 4:State C, 5:State D, 6:State E, 7:State F, 8: Pilot error
  259. unsigned char PilotDuty; // 0~100%
  260. unsigned char StartUserId[32]; // This ID is trigger start charging event user by RFID、back-end、BLE.
  261. unsigned char StartDateTime[32]; // Charging cycle start date time
  262. unsigned char StopDateTime[32]; // Charging cycle stop date time
  263. unsigned char StartMethod;
  264. // Connector Temp
  265. unsigned char ConnectorTemp; //0x00: -60¢XC ~ 0xFE: 194
  266. // Charging Status
  267. unsigned char GroundFaultStatus; // for GFD result => 0x00 : None, 0x01 : Can Start Charging, 0x02 : Stop Charging
  268. unsigned char PrechargeStatus; // for ccs precharge => 0x00 : None defined, 0x01 : Accepted
  269. float OutputEnergy; // output energy by per charging
  270. unsigned char RelayK1K2Status; // 0x00 : open, 0x01 : close
  271. unsigned char RelayKPK2Status; // 0x00 : open, 0x01 : close
  272. unsigned char TimeoutFlag; // 0 : none,
  273. struct timeval TimeoutTimer;
  274. unsigned char MaxChargeEnable;
  275. unsigned char IsReadyToCharging;
  276. unsigned char CcsAuthentication; // 0:EIM, 1:EIM & PnC mixed
  277. unsigned char AcCcsChargingMode; // 0:BC (PWM) only, 1:BC & PLC mixed
  278. };
  279. struct SysInfoData
  280. {
  281. /**************System***************/
  282. unsigned char BootingStatus; // 0 : booting, 1 : Initializing Complete.
  283. unsigned char FactoryConfiguration; //0: normal, 1: trigger, charger will return the configuration to factory default if trigger
  284. float InputVoltageR; //0~655.35 volt
  285. float InputVoltageS; //0~655.35 volt
  286. float InputVoltageT; //0~655.35 volt
  287. unsigned int SystemFanRotaSpeed; //0 ~ 65535 RPM
  288. unsigned int PsuFanRotaSpeed; //0 ~ 65535 RPM
  289. unsigned char AuxPower5V; //0 ~ 255 volt
  290. unsigned char AuxPower12V; //0 ~ 255 volt
  291. unsigned char AuxPower24V; //0 ~ 255 volt
  292. unsigned char AuxPower48V; //0 ~ 255 volt
  293. unsigned char CsuHwRev[32]; //CSU board hardware version
  294. unsigned char CsuBootLoadFwRev[32]; //CSU board bootloader firmware version
  295. unsigned char CsuKernelFwRev[32];//CSU board OS kernel firmware version
  296. unsigned char CsuRootFsFwRev[32];//CSU board root file system firmware version
  297. unsigned char CsuPrimFwRev[32]; //CSU board root file system firmware version
  298. unsigned char LcmHwRev[32]; //LCM module hardware version
  299. unsigned char LcmFwRev[32]; //LCM module firmware version
  300. unsigned char PsuHwRev[32]; //PSU hardware version
  301. unsigned char PsuPrimFwRev[32]; //PSU primary firmware version
  302. unsigned char PsuSecFwRev[32]; //PSU secondary firmware version
  303. unsigned char AuxPwrHwRev[32]; //Aux. power module hardware version
  304. unsigned char AuxPwrFwRev[32]; //Aux. power module firmware version
  305. unsigned char FanModuleHwRev[32]; //Fan module hardware version
  306. unsigned char FanModuleFwRev[32]; //Fan module firmware version
  307. unsigned char RelayModuleHwRev[32]; //Relay control module hardware version
  308. unsigned char RelayModuleFwRev[32]; //Relay control module firmware version
  309. unsigned char TelcomModemFwRev[32]; //the 3G/4G modem firmware version
  310. int SystemAmbientTemp; // -40 ~ 215 degree C
  311. int SystemCriticalTemp; // -40 ~ 215 degree C
  312. int CcsConnectorTemp; // -40 ~ 215 degree C
  313. int PsuAmbientTemp; // -40 ~ 215 degree C
  314. /**************Charging***************/
  315. struct ChargingInfoData ChademoChargingData[CHAdeMO_QUANTITY];
  316. struct ChargingInfoData CcsChargingData[CCS_QUANTITY];
  317. struct ChargingInfoData GbChargingData[GB_QUANTITY];
  318. struct ChargingInfoData AcChargingData[AC_QUANTITY];
  319. unsigned char CurGunSelected;
  320. /**************Network***************/
  321. unsigned char InternetConn; //0: disconnected, 1: connected
  322. /**************Backend***************/
  323. unsigned char OcppConnStatus; //0: disconnected, 1: connected
  324. char OrderCharging;
  325. /**************Alston***************/
  326. unsigned char WaitForPlugit; //0: none scan, 1: scanning
  327. unsigned char PageIndex; //0 : Initialize
  328. //1 : idle
  329. //4 : Authorizing
  330. //5 : Authorizing complete
  331. //6 : Authorizing fail
  332. //7 : Wait for Plug
  333. //8 : Pre-charge
  334. //9 : Charging
  335. unsigned char SelfTestSeq; //
  336. unsigned char ReAssignedFlag; // 0 : none, other : gun number.
  337. unsigned char BridgeRelayStatus;
  338. unsigned char FirmwareUpdate; // 0 : none, 1 : update.
  339. unsigned char AcContactorStatus; // 0: disconnected, 1: connected
  340. unsigned char SystemTimeoutFlag; // 0 : none, 1 : self test
  341. struct timeval SystemTimeoutTimer;
  342. unsigned char SystemPage;
  343. unsigned char ConnectorPage;
  344. };
  345. struct WARNING_CODE_INFO
  346. {
  347. unsigned char WarningCount;
  348. unsigned char PageIndex;
  349. unsigned char WarningCode[10][7];
  350. };
  351. struct STOP_CHARGING_ALARM_CODE
  352. {
  353. unsigned char Level;
  354. unsigned char StopCode[4][7];
  355. };
  356. struct SysConfigAndInfo
  357. {
  358. struct SysConfigData SysConfig;
  359. struct SysInfoData SysInfo;
  360. struct WARNING_CODE_INFO SysWarningInfo;
  361. struct STOP_CHARGING_ALARM_CODE SysStopChargingAlarmCode;
  362. };
  363. /**************************************************************************************/
  364. /**************************Alarm Share memory**************************************/
  365. /***************************************************************************************
  366. Status Code A B C D E F
  367. 0: Issue 1: From EVSE 1: Fault (unrecoverable) 001 ~ 999 serial number
  368. e.g., hardware broken, system latch
  369. 1: Recovered 2: From EV 2: Alarm (recoverable)
  370. e.g., OTP, OVP
  371. 3: From Backend 3: Information
  372. e.g., swipe card to stop charging
  373. according to XXX.Revxx
  374. ***************************************************************************************/
  375. /**************************************************************************************/
  376. char FaultStatusCode[32][6]=
  377. {
  378. "011001", //CHAdeMO output fuse blew
  379. "011002", //CCS output fuse blew
  380. "011003", //GB output fuse blew
  381. "011004", //RCD/CCID self-test fail
  382. "011005", //AC input contactor 1 welding
  383. "011006", //AC input contactor 1 driving fault
  384. "011007", //AC input contactor 2 welding
  385. "011008", //AC input contactor 2 driving fault
  386. "011009", //AC output relay welding
  387. "011010", //AC output relay driving fault
  388. "011011", //CHAdeMO output relay welding
  389. "011012", //CHAdeMO output relay driving fault
  390. "011013", //CCS output relay welding
  391. "011014", //CCS output relay driving fault
  392. "011015", //GB output relay welding
  393. "011016", //GB output relay driving fault
  394. "011017", //AC connector temperature sensor broken
  395. "011018", //CHAdeMO connector temperature sensor broken
  396. "011019", //CCS connector temperature sensor broken
  397. "011020", //GB connector temperature sensor broken
  398. "011021", //WiFi module broken
  399. "011022", //3G/4G module broken
  400. "011023", //Aux. power module broken
  401. "011024", //Relay control module /smart box broken
  402. "011025", //CHAdeMO connector lock fail
  403. "011026", //GB connector lock fail
  404. "011027", //AC connector lock fail
  405. "011028", //CHAdeMO module broken
  406. "011029", //CCS module broken
  407. "011030", //GBT module broken
  408. "011031", //PSU module broken
  409. "011032" //Reserved
  410. };
  411. struct FaultCodeData
  412. {
  413. unsigned char PreviousFaultVal[4];
  414. union
  415. {
  416. unsigned char FaultVal[4];
  417. struct
  418. {
  419. //FaultVal[0]
  420. unsigned char ChademoOutputFuseBlew:1; //bit 0
  421. unsigned char CcsOutputFuseBlew:1; //bit 1
  422. unsigned char GbOutputFuseBlew:1; //bit 2
  423. unsigned char RcdSelfTestFail:1; //bit 3
  424. unsigned char AcInputContactor1Welding:1; //bit 4
  425. unsigned char AcInputContactor1DrivingFault:1; //bit 5
  426. unsigned char AcInputContactor2Welding:1; //bit 6
  427. unsigned char AcInputContactor2DrivingFault:1; //bit 7
  428. //FaultVal[1]
  429. unsigned char AcOutputRelayWelding:1; //bit 0
  430. unsigned char AcOutputRelayDrivingFault:1; //bit 1
  431. unsigned char ChademoOutputRelayWelding:1; //bit 2
  432. unsigned char ChademoOutputRelayDrivingFault :1; //bit 3
  433. unsigned char CcsOutputRelayWelding:1; //bit 4
  434. unsigned char CcsOutputRelayDrivingFault:1; //bit 5
  435. unsigned char GbOutputRelayWelding:1; //bit 6
  436. unsigned char GbOutputRelayDrivingFault:1; //bit 7
  437. //FaultVal[2]
  438. unsigned char AcConnectorTempSensorBroken:1; //bit 0
  439. unsigned char ChademoConnectorTempSensorBroken:1; //bit 1
  440. unsigned char CcsConnectorTempSensorBroken:1; //bit 2
  441. unsigned char GbConnectorTempSensorBroken:1; //bit 3
  442. unsigned char WiFiModuleBroken:1; //bit 4
  443. unsigned char Telecom4GModuleBroken:1; //bit 5
  444. unsigned char AuxPowerModuleBroken:1; //bit 6
  445. unsigned char RelayControlModuleBroken :1; //bit 7
  446. //FaultVal[3]
  447. unsigned char ChademoConnectorLockFail:1; //bit 0
  448. unsigned char GbConnectorLockFail:1; //bit 1
  449. unsigned char AcConnectorLockFail:1; //bit 2
  450. unsigned char ChademoModuleBroken:1; //bit 3
  451. unsigned char CcsModuleBroken:1; //bit 4
  452. unsigned char GbModuleBroken:1; //bit 5
  453. unsigned char PsuModuleBroken:1; //bit 6
  454. unsigned char :1; //bit 7 reserved
  455. }bits;
  456. }FaultEvents;
  457. };
  458. char AlarmStatusCode[128][6]=
  459. {
  460. "012200", //System L1 input OVP
  461. "012201", //System L2 input OVP
  462. "012202", //System L3 input OVP
  463. "012203", //System L1 input UVP
  464. "012204", //System L2 input UVP
  465. "012205", //System L3 input UVP
  466. "012206", //PSU L1 input OVP
  467. "012207", //PSU L2 input OVP
  468. "012208", //PSU L3 input OVP
  469. "012209", //PSU L1 input UVP
  470. "012210", //PSU L2 input UVP
  471. "012211", //PSU L3 input UVP
  472. "012212", //System L1 input drop
  473. "012213", //System L2 input drop
  474. "012214", //System L3 input drop
  475. "012215", //System AC output OVP
  476. "012216", //System AC output OCP
  477. "012217", //System CHAdeMO output OVP
  478. "012218", //System CHAdeMO output OCP
  479. "012219", //System CCS output OVP
  480. "012220", //System CCS output OCP
  481. "012221", //System GB output OVP
  482. "012222", //System GB output OCP
  483. "012223", //System ambient/inlet OTP
  484. "012224", //System critical point OTP
  485. "012225", //PSU ambient/inlet OTP
  486. "012226", //PSU critical point OTP
  487. "012227", //Aux. power module OTP
  488. "012228", //Relay board/smart box OTP
  489. "012229", //CHAdeMO connector OTP
  490. "012230", //CCS connector OTP
  491. "012231", //GB connector OTP
  492. "012232", //AC connector OTP
  493. "012233", //RCD/CCID trip
  494. "012234", //CHAdeMO GFD trip
  495. "012235", //CCS GFD trip
  496. "012236", //GB GFD trip
  497. "012237", //SPD trip
  498. "012238", //Main power breaker trip
  499. "012239", //Aux. power breaker trip
  500. "012240", //PSU communication fail
  501. "012241", //WiFi module communication fail
  502. "012242", //3G/4G module communication fail
  503. "012243", //RFID module communication fail
  504. "012244", //Bluetooth module communication fail
  505. "012245", //LCM module communication fail
  506. "012246", //Aux. power module communication fail
  507. "012247", //Relay control boaed/smart box communication fail
  508. "012248", //CCS module communication fail
  509. "012249", //CHAdeMO module communication fail
  510. "012250", //GBT module communication fail
  511. "012251", //Emergency stop
  512. "012252", //Door open
  513. "012253", //System fan decay
  514. "012254", //Fail to create share memory
  515. "012255", //CSU initialization failed
  516. "012256", //AC Ground Fault
  517. "012257", //MCU self-test Fault
  518. "012258", //Relay self-test Fault
  519. "012259", //CHAdeMO groundfault detection timeout (GFD)
  520. "012260", //CCS groundfault detection timeout (GFD)
  521. "012261", //GB groundfault detection timeout (GFD)
  522. "012262", //Circuit Short
  523. "012263", //Reserved
  524. "012264", // PSU Output Short Circuit
  525. "012265", // PSU Discharge Abnormal
  526. "012266", // PSU Dc Side ShutDown
  527. "012267", // PSU Failure Alarm
  528. "012268", // PSU Protection Alarm
  529. "012269", // PSU FanFailure Alarm
  530. "012270", //Reserved
  531. "012271", //Reserved
  532. "012272", // PSU WalkIn State
  533. "012273", // PSU Power Limited State
  534. "012274", // PSU Id Repeat
  535. "012275", // PSU Severe Uneven Current
  536. "012276", // PSU Three Phase Input Inadequate
  537. "012277", // PSU Three Phase Onput Imbalance
  538. "012278", // PSU Ffc Side ShutDown
  539. "012279", //Reserved
  540. "012280", // Self test Failed due to communication of Relayboard failure
  541. "012281", // Self test Failed due to communication of Fanboard failure
  542. "012282", // Self test Failed due to communication of Primary failure
  543. "012283", // Self test Failed due to communication of Chademoboard failure
  544. "012284", // Self test Failed due to communication of CCSboard failure
  545. "012285", // Self test Failed due to AC Contact failure
  546. "012286", // Self test Failed due to communication of PSU failure
  547. "012287", //Reserved
  548. };
  549. struct AlarmCodeData
  550. {
  551. unsigned char PreviousAlarmVal[11];
  552. union
  553. {
  554. unsigned char AlarmVal[11];
  555. struct
  556. {
  557. //AlarmVal[0]
  558. unsigned char SystemL1InputOVP:1; //bit 0
  559. unsigned char SystemL2InputOVP:1; //bit 1
  560. unsigned char SystemL3InputOVP:1; //bit 2
  561. unsigned char SystemL1InputUVP:1; //bit 3
  562. unsigned char SystemL2InputUVP:1; //bit 4
  563. unsigned char SystemL3InputUVP:1; //bit 5
  564. unsigned char PsuL1InputOVP:1; //bit 6
  565. unsigned char PsuL2InputOVP:1; //bit 7
  566. //AlarmVal[1]
  567. unsigned char PsuL3InputOVP:1; //bit 0
  568. unsigned char PsuL1InputUVP:1; //bit 1
  569. unsigned char PsuL2InputUVP:1; //bit 2
  570. unsigned char PsuL3InputUVP :1; //bit 3
  571. unsigned char SystemL1InputDrop:1; //bit 4
  572. unsigned char SystemL2InputDrop:1; //bit 5
  573. unsigned char SystemL3InputDrop:1; //bit 6
  574. unsigned char SystemAcOutputOVP:1; //bit 7
  575. //AlarmVal[2]
  576. unsigned char SystemAcOutputOCP:1; //bit 0
  577. unsigned char SystemChademoOutputOVP:1; //bit 1
  578. unsigned char SystemChademoOutputOCP:1; //bit 2
  579. unsigned char SystemCcsOutputOVP:1; //bit 3
  580. unsigned char SystemCcsOutputOCP:1; //bit 4
  581. unsigned char SystemGbOutputOVP:1; //bit 5
  582. unsigned char SystemGbOutputOCP:1; //bit 6
  583. unsigned char SystemAmbientOTP :1; //bit 7
  584. //AlarmVal[3]
  585. unsigned char SystemCriticalPointOTP:1; //bit 0
  586. unsigned char PsuAmbientOTP:1; //bit 1
  587. unsigned char PsuCriticalPointOTP:1; //bit 2
  588. unsigned char AuxPowerModuleOTP:1; //bit 3
  589. unsigned char RelayBoardOTP:1; //bit 4
  590. unsigned char ChademoConnectorOTP:1; //bit 5
  591. unsigned char CcsConnectorOTP:1; //bit 6
  592. unsigned char GbConnectorOTP:1; //bit 7
  593. //AlarmVal[4]
  594. unsigned char AcConnectorOTP:1; //bit 0
  595. unsigned char RcdTrip:1; //bit 1
  596. unsigned char ChademoGfdTrip:1; //bit 2
  597. unsigned char CcsGfdTrip:1; //bit 3
  598. unsigned char GbGfdTrip:1; //bit 4
  599. unsigned char SpdTrip:1; //bit 5
  600. unsigned char MainPowerBreakerTrip:1; //bit 6
  601. unsigned char AuxPowerBreakerTrip:1; //bit 7
  602. //AlarmVal[5]
  603. unsigned char PsuCommunicationFail:1; //bit 0
  604. unsigned char WiFiModuleCommFail:1; //bit 1
  605. unsigned char Telecom4GModuleCommFail:1; //bit 2
  606. unsigned char RfidModuleCommFail:1; //bit 3
  607. unsigned char BluetoothModuleCommFail:1; //bit 4
  608. unsigned char LcmModuleCommFail:1; //bit 5
  609. unsigned char AuxPowerModuleCommFail:1; //bit 6
  610. unsigned char RelayBoardCommFail:1; //bit 7
  611. //AlarmVal[6]
  612. unsigned char CcsModuleCommFail:1; //bit 0
  613. unsigned char ChademoModuleCommFail:1; //bit 1
  614. unsigned char GbModuleCommFail:1; //bit 2
  615. unsigned char EmergencyStopTrip:1; //bit 3
  616. unsigned char DoorOpen:1; //bit 4
  617. unsigned char SystemFanDecay:1; //bit 5
  618. unsigned char FailToCreateShareMemory:1; //bit 6
  619. unsigned char CsuInitFailed:1; //bit 7
  620. //AlarmVal[7]
  621. unsigned char AcGroundfaultFail:1; //bit 0
  622. unsigned char McuSelftestFail:1; //bit 1
  623. unsigned char RelaySelftestFail:1; //bit 2
  624. unsigned char ChademoGroundfaultTimeout:1; //bit 3
  625. unsigned char CcsGroundfaultTimeout:1; //bit 4
  626. unsigned char GbGroundfaultTimeout:1; //bit 5
  627. unsigned char CircuitShort:1; //bit 6
  628. unsigned char :1; //bit 7
  629. //AlarmVal[8]
  630. unsigned char PsuOutputShortCircuit :1; //bit 0
  631. unsigned char PsuDischargeAbnormal :1; //bit 1
  632. unsigned char PsuDcSideShutDown :1; //bit 2
  633. unsigned char PsuFailureAlarm :1; //bit 3
  634. unsigned char PsuProtectionAlarm :1; //bit 4
  635. unsigned char PsuFanFailureAlarm :1; //bit 5
  636. unsigned char :1; //bit 6
  637. unsigned char :1; //bit 7
  638. //AlarmVal[9]
  639. unsigned char PsuWalkInState :1; //bit 0
  640. unsigned char PsuPowerLimitedState :1; //bit 1
  641. unsigned char PsuIdRepeat :1; //bit 2
  642. unsigned char PsuSevereUnevenCurrent :1; //bit 3
  643. unsigned char PsuThreePhaseInputInadequate :1; //bit 4
  644. unsigned char PsuThreePhaseOnputImbalance :1; //bit 5
  645. unsigned char PsuFfcSideShutDown :1; //bit 6
  646. unsigned char :1;
  647. //AlarmVal[10]
  648. unsigned char RelayboardStestFail :1; //bit 0
  649. unsigned char FanboardStestFail :1; //bit 1
  650. unsigned char PrimaryStestFail :1; //bit 2
  651. unsigned char ChademoboardStestFail :1; //bit 3
  652. unsigned char CCSboardStestFail :1; //bit 4
  653. unsigned char AcContactStestFail :1; //bit 5
  654. unsigned char PsuModuleStestFail :1; //bit 6
  655. unsigned char :1; //bit 7 //bit 7
  656. }bits;
  657. }AlarmEvents;
  658. };
  659. char InfoStatusCode[256][6]=
  660. {
  661. //Information comes from EVSE
  662. "013600", //Normal stop charging by user
  663. "013601", //Charging Time's up
  664. "013602", //Replace system air filter
  665. "013603", //Reach to CHAdeMO max. plugging times.
  666. "013604", //Reach to CCS max. plugging times.
  667. "013605", //Reach to GB max. plugging times.
  668. "013606", //Reach to AC max. plugging times.
  669. "013607", //CSU fimrware update fail
  670. "013608", //CHAdeMO Module fimrware update fail
  671. "013609", //CCS Module fimrware update fail
  672. "013610", //GB Module fimrware update fail
  673. "013611", //Aux. power module fimrware update fail
  674. "013612", //Relay control module fimrware update fail
  675. "013613", //LCM module fimrware update fail
  676. "013614", //Bluetooth module fimrware update fail
  677. "013615", //WiFi module fimrware update fail
  678. "013616", //3G/4G module fimrware update fail
  679. "013617", //SMR fimrware update fail
  680. "013618", //RFID module fimrware update fail
  681. "013619", //configured by USB flash drive
  682. "013620", //configured by backend
  683. "013621", //configured by webpage
  684. "013622", //disconnected from Internet through Ethernet
  685. "013623", //disconnected from Internet through WiFi
  686. "013624", //disconnected from Internet through 3G/4G
  687. "013625", //disconnected from AP through WiFi
  688. "013626", //disconnected from APN through 3G/4G
  689. "013627", //Reserved
  690. "013628", //Reserved
  691. "013629", //Reserved
  692. "013630", //Reserved
  693. "013631", //Reserved
  694. //Information comes from EV
  695. "023700", //CHAdeMO EV communication Fail
  696. "023701", //CCS EV communication Fail
  697. "023702", //GB EV communication Fail
  698. "023703", //AC: pilot fault
  699. "023704", //CHAdeMO: battery malfunction
  700. "023705", //CHAdeMO: no charging permission
  701. "023706", //CHAdeMO: battery incompatibility
  702. "023707", //CHAdeMO: battery OVP
  703. "023708", //CHAdeMO: battery UVP
  704. "023709", //CHAdeMO: battery OTP
  705. "023710", //CHAdeMO: battery current difference
  706. "023711", //CHAdeMO: battery voltage difference
  707. "023712", //CHAdeMO: shift position
  708. "023713", //CHAdeMO: battery other fault
  709. "023714", //CHAdeMO: charging system error
  710. "023715", //CHAdeMO: EV normal stop
  711. "023716", //CHAdeMO: connector temperature sensor broken
  712. "023717", //CHAdeMO: connector lock fail
  713. "023718", //CHAdeMO: D1 ON No Receive
  714. "023719", //CHAdeMO: BMS K to J Timeout
  715. "023720", //CHAdeMO: BMS Charge Allow Timeout
  716. "023721", //CHAdeMO: Wait GroundFault Timeout
  717. "023722", //CHAdeMO: BMS EV Relay Timeout
  718. "023723", //CHAdeMO: BMS Request Current Timeout
  719. "023724", //CHAdeMO: BMS K to J OFF Timeout
  720. "023725", //CHAdeMO: BMS EV Relay OFF Timeout
  721. "023726", //CHAdeMO: ADC More Than 10V
  722. "023727", //CHAdeMO: ADC More Than 20V
  723. "023728", //CHAdeMO: BMS Charge Before Stop
  724. "023729", //CHAdeMO: Charger Get Normal Stop
  725. "023730", //CHAdeMO: Charger Get Emergency Stop
  726. "023731", //CHAdeMO: Isolation Result Fail
  727. "023732", //CHAdeMO: Miss Link With MotherBoard
  728. "023733", //CHAdeMO: Output Voltage More Than Limit
  729. "023734", //CHAdeMO: Request Current More Than Limit
  730. "023735", //CHAdeMO: Re Cap BMS Eqr Current Exceed
  731. "023736", //CHAdeMO: Charge Remain Count Down
  732. "023737", //CCS:CCS_EVCC_EVErrorCode_FAILED_RESSTemperatureInhibit
  733. "023738", //CCS:CCS_EVCC_EVErrorCode_FAILED_EVShiftPosition
  734. "023739", //CCS:CCS_EVCC_EVErrorCode_FAILED_ChargerConnectorLockFault
  735. "023740", //CCS:CCS_EVCC_EVErrorCode_FAILED_EVRESSMalfunction
  736. "023741", //CCS:CCS_EVCC_EVErrorCode_FAILED_ChargingCurrentdifferential
  737. "023742", //CCS:CCS_EVCC_EVErrorCode_FAILED_ChargingVoltageOutOfRange
  738. "023743", //CCS:CCS_EVCC_EVErrorCode_FAILED_ChargingSystemIncompatibility
  739. "023744", //CCS:CCS_EVCC_EVErrorCode_FAILED_EmergencyEvent
  740. "023745", //CCS:CCS_EVCC_EVErrorCode_FAILED_Breaker
  741. "023746", //CCS:CCS_EVCC_EVErrorCode_FAILED_NoData
  742. "023747", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_DIN_A
  743. "023748", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_DIN_B
  744. "023749", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_DIN_C
  745. "023750", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_ISO_1
  746. "023751", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_ISO_2
  747. "023752", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_ISO_3
  748. "023753", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_OEM_1
  749. "023754", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_OEM_2
  750. "023755", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_OEM_3
  751. "023756", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_OEM_4
  752. "023757", //CCS:CCS_EVCC_EVErrorCode_FAILED_reserved_by_OEM_5
  753. "023758", //CCS:CCS_SECC_ResponseCode_FAILED_SequenceError
  754. "023759", //CCS:CCS_SECC_ResponseCode_FAILED_SignatureError
  755. "023760", //CCS:CCS_SECC_ResponseCode_FAILED_UnknownSession
  756. "023761", //CCS:CCS_SECC_ResponseCode_FAILED_ServiceIDInvalid
  757. "023762", //CCS:CCS_SECC_ResponseCode_FAILED_Payment SelectionInvalid
  758. "023763", //CCS:CCS_SECC_ResponseCode_FAILED_IdentificationSelectionInvalid
  759. "023764", //CCS:CCS_SECC_ResponseCode_FAILED_ServiceSelectionInvalid
  760. "023765", //CCS:CCS_SECC_ResponseCode_FAILED_CertificateExpired
  761. "023766", //CCS:CCS_SECC_ResponseCode_FAILED_CertificateNotYetValid
  762. "023767", //CCS:CCS_SECC_ResponseCode_FAILED_CertificateRevoked
  763. "023768", //CCS:CCS_SECC_ResponseCode_FAILED_NoCertificateAvailable
  764. "023769", //CCS:CCS_SECC_ResponseCode_FAILED_CertChainError
  765. "023770", //CCS:CCS_SECC_ResponseCode_FAILED_CertValidationError
  766. "023771", //CCS:CCS_SECC_ResponseCode_FAILED_CertVerificationError
  767. "023772", //CCS:CCS_SECC_ResponseCode_FAILED_ContractCanceled
  768. "023773", //CCS:CCS_SECC_ResponseCode_FAILED_ChallengeInvalid
  769. "023774", //CCS:CCS_SECC_ResponseCode_FAILED_WrongEnergyTransferMode
  770. "023775", //CCS:CCS_SECC_ResponseCode_FAILED_WrongChargeParameter
  771. "023776", //CCS:CCS_SECC_ResponseCode_FAILED_ChargingProfileInvalid
  772. "023777", //CCS:CCS_SECC_ResponseCode_FAILED_TariffSelectionInvalid
  773. "023778", //CCS:CCS_SECC_ResponseCode_FAILED_EVSEPresentVoltageToLow
  774. "023779", //CCS:CCS_SECC_ResponseCode_FAILED_PowerDeliveryNotApplied
  775. "023780", //CCS:CCS_SECC_ResponseCode_FAILED_MeteringSignatureNotValid
  776. "023781", //CCS:CCS_SECC_ResponseCode_FAILED_NoChargeServiceSelected
  777. "023782", //CCS:CCS_SECC_ResponseCode_FAILED_ContactorError
  778. "023783", //CCS:CCS_SECC_ResponseCode_FAILED_CertificateNotAllowedAtThisEVSE
  779. "023784", //CCS:CCS_SECC_ResponseCode_FAILED_GAChargeStop
  780. "023785", //CCS:CCS_SECC_ResponseCode_FAILED_AlignmentError
  781. "023786", //CCS:CCS_SECC_ResponseCode_FAILED_ACDError
  782. "023787", //CCS:CCS_SECC_ResponseCode_FAILED_AssociationError
  783. "023788", //CCS:CCS_SECC_ResponseCode_FAILED_EVSEChargeAbort
  784. "023789", //CCS:CCS_SECC_ResponseCode_FAILED_NoSupportedApp-Protocol-Protocol
  785. "023790", //CCS:CCS_SECC_ResponseCode_FAILED_ContractNotAccepted
  786. "023791", //CCS:CCS_SECC_ResponseCode_FAILED_MOUnknown
  787. "023792", //CCS:CCS_SECC_ResponseCode_FAILED_OEM_Prov_CertificateRevoke
  788. "023793", //CCS:CCS_SECC_ResponseCode_FAILED_OEM_SubCA1_CertificateRevoked
  789. "023794", //CCS:CCS_SECC_ResponseCode_FAILED_OEM_SubCA2_CertificateRevoked
  790. "023795", //CCS:CCS_SECC_ResponseCode_FAILED_OEM_RootCA_CertificateRevoked
  791. "023796", //CCS:CCS_SECC_ResponseCode_FAILED_MO_Prov_CertificateRevoked
  792. "023797", //CCS:CCS_SECC_ResponseCode_FAILED_MO_SubCA1_CertificateRevoked
  793. "023798", //CCS:CCS_SECC_ResponseCode_FAILED_MO_SubCA2_CertificateRevoked
  794. "023799", //CCS:CCS_SECC_ResponseCode_FAILED_MO_RootCA_CertificateRevoked
  795. "023800", //CCS:CCS_SECC_ResponseCode_FAILED_CPS_Prov_CertificateRevoked
  796. "023801", //CCS:CCS_SECC_ResponseCode_FAILED_CPS_SubCA1_CertificateRevoked
  797. "023802", //CCS:CCS_SECC_ResponseCode_FAILED_CPS_SubCA2_CertificateRevoked
  798. "023803", //CCS:CCS_SECC_ResponseCode_FAILED_CPS_RootCA_CertificateRevoked
  799. "023804", //CCS:CCS_SECC_ResponseCode_FAILED_reserved_1
  800. "023805", //CCS:CCS_SECC_ResponseCode_FAILED_reserved_2
  801. "023806", //CCS:CCS_SECC_ResponseCode_FAILED_reserved_3
  802. "023807", //CCS:CCS_SECC_ResponseCode_FAILED_reserved_4
  803. "023808", //CCS:CCS_SECC_ResponseCode_FAILED_reserved_5
  804. "023809", //CCS:CCS_SECC_TIMEOUT_SLAC_TT_EVSE_SLAC_init
  805. "023810", //CCS:CCS_SECC_TIMEOUT_SLAC_TP_match_response
  806. "023811", //CCS:CCS_SECC_TIMEOUT_SLAC_TT_match_sequence
  807. "023812", //CCS:CCS_SECC_TIMEOUT_SLAC_TT_EVSE_match_MNBC
  808. "023813", //CCS:CCS_SECC_TIMEOUT_SLAC_TP_EVSE_avg_atten_calc
  809. "023814", //CCS:CCS_SECC_TIMEOUT_SLAC_TT_match_response
  810. "023815", //CCS:CCS_SECC_TIMEOUT_SLAC_TP_EVSE_match_session
  811. "023816", //CCS:CCS_SECC_TIMEOUT_SLAC_TT_EVSE_assoc_session
  812. "023817", //CCS:CCS_SECC_TIMEOUT_SLAC_TT_EVSE_vald_toggle
  813. "023818", //CCS:CCS_SECC_TIMEOUT_SLAC_reserved_1
  814. "023819", //CCS:CCS_SECC_TIMEOUT_SLAC_reserved_2
  815. "023820", //CCS:CCS_SECC_TIMEOUT_SLAC_reserved_3
  816. "023821", //CCS:CCS_SECC_TIMEOUT_SLAC_reserved_4
  817. "023822", //CCS:CCS_SECC_TIMEOUT_SLAC_reserved_5
  818. "023823", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_UDP_TT_match_join
  819. "023824", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_TCP_TT_match_join
  820. "023825", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_TP_amp_map_exchange
  821. "023826", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_TP_link_ready_notification
  822. "023827", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_reserved_1
  823. "023828", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_reserved_2
  824. "023829", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_reserved_3
  825. "023830", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_reserved_4
  826. "023831", //CCS:CCS_SECC_TIMEOUT_SLACC_SDP_reserved_5
  827. "023832", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_SupportedAppProtocolRes
  828. "023833", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_SessionSetupRes
  829. "023834", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_ServiceDiscoveryRes
  830. "023835", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_ServicePaymentSelectionRes
  831. "023836", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_ContractAuthenticationRes
  832. "023837", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_ChargeParameterDiscoveryRes
  833. "023838", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_PowerDeliveryRes
  834. "023839", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_CableCheckRes
  835. "023840", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_PreChargeRes
  836. "023841", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_CurrentDemandRes
  837. "023842", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_WeldingDetectionRes
  838. "023843", //CCS:CCS_SECC_TIMEOUT_V2G_Msg_Performance_Time_SessionStopRes
  839. "023844", //CCS:CCS_SECC_TIMEOUT_V2G_Sequence_Time
  840. "023845", //CCS:CCS_SECC_TIMEOUT_V2G_ReadyToCharge_Performance_Time
  841. "023846", //CCS:CCS_SECC_TIMEOUT_V2G_CommunicationSetup_Performance_Time
  842. "023847", //CCS:CCS_SECC_TIMEOUT_V2G_CableCheck_Performance_Time
  843. "023848", //CCS:CCS_SECC_TIMEOUT_V2G_CPState_Detection_Time
  844. "023849", //CCS:CCS_SECC_TIMEOUT_V2G_CPOscillator_Retain_Time
  845. "023850", //CCS:CCS_SECC_TIMEOUT_V2G_reserved_1
  846. "023851", //CCS:CCS_SECC_TIMEOUT_V2G_reserved_2
  847. "023852", //CCS:CCS_SECC_TIMEOUT_V2G_reserved_3
  848. "023853", //CCS:CCS_SECC_TIMEOUT_V2G_reserved_4
  849. "023854", //CCS:CCS_SECC_TIMEOUT_V2G_reserved_5
  850. "023855", //CCS:CCS_CAN_TIMEOUT_TP_GET_EV_TARGET_INFO
  851. "023856", //CCS:CCS_CAN_TIMEOUT_TT_GET_EV_TARGET_INFO
  852. "023857", //CCS:CCS_CAN_TIMEOUT_TP_GET_EV_BATTERY_INFO
  853. "023858", //CCS:CCS_CAN_TIMEOUT_TT_GET_EV_BATTERY_INFO
  854. "023859", //CCS:CCS_CAN_TIMEOUT_TP_EV_STOP_EVENT
  855. "023860", //CCS:CCS_CAN_TIMEOUT_TT_EV_STOP_EVENT
  856. "023861", //CCS:CCS_CAN_TIMEOUT_TP_EVSE_STOP_EVENT
  857. "023862", //CCS:CCS_CAN_TIMEOUT_TT_EVSE_STOP_EVENT
  858. "023863", //CCS:CCS_CAN_TIMEOUT_TP_GET_MISC_INFO
  859. "023864", //CCS:CCS_CAN_TIMEOUT_TT_GET_MISC_INFO
  860. "023865", //CCS:CCS_CAN_TIMEOUT_TP_DOWNLOAD_REQUEST
  861. "023866", //CCS:CCS_CAN_TIMEOUT_TT_DOWNLOAD_REQUEST
  862. "023867", //CCS:CCS_CAN_TIMEOUT_TP_START_BLOCK_TRANSFER
  863. "023868", //CCS:CCS_CAN_TIMEOUT_TT_START_BLOCK_TRANSFER
  864. "023869", //CCS:CCS_CAN_TIMEOUT_TP_DATA_TRANSFER
  865. "023870", //CCS:CCS_CAN_TIMEOUT_TT_DATA_TRANSFER
  866. "023871", //CCS:CCS_CAN_TIMEOUT_TP_DOWNLOAD_FINISH
  867. "023872", //CCS:CCS_CAN_TIMEOUT_TT_DOWNLOAD_FINISH
  868. "023873", //CCS:CCS_CAN_TIMEOUT_TP_ISOLATION_STATUS
  869. "023874", //CCS:CCS_CAN_TIMEOUT_TT_ISOLATION_STATUS
  870. "023875", //CCS:CCS_CAN_TIMEOUT_TP_CONNECTOR_INFO
  871. "023876", //CCS:CCS_CAN_TIMEOUT_TT_CONNECTOR_INFO
  872. "023877", //CCS:CCS_CAN_TIMEOUT_TT_RTC_INFO
  873. "023878", //CCS:CCS_CAN_TIMEOUT_TP_RTC_INFO
  874. "023879", //CCS:CCS_CAN_TIMEOUT_TP_EVSE_PRECHARGE_INFO
  875. "023880", //CCS:CCS_CAN_TIMEOUT_TT_EVSE_PRECHARGE_INFO
  876. "023881", //CCS:CCS_CAN_TIMEOUT_MSG_Sequence
  877. "023882", //CCS:CCS_CAN_MSG_Unrecognized_CMD_ID
  878. "023883", //CCS:CCS_SECC_DIN_Msg_Decode_Error
  879. "023884", //CCS:CCS_SECC_DIN_Msg_Encode_Error
  880. "023885", //CCS:CCS_SECC_ISO1_Msg_Decode_Error
  881. "023886", //CCS:CCS_SECC_ISO1_Msg_Encode_Error
  882. "023887", //CCS:CCS_SECC_ISO2_Msg_Decode_Error
  883. "023888", //CCS:CCS_SECC_ISO2_Msg_Encode_Error
  884. //Information comes from Backend
  885. "033900", //disconnected from backend through Ethernet
  886. "033901", //disconnected from backend through WiFi
  887. "033902", //disconnected from backend through 3G/4G
  888. "033903", //Remote start charging by backend
  889. "033904", //Remote stop charging by backend
  890. "033905", //Remote reset by backend
  891. "033906", //Reserved
  892. "033907", //Reserved
  893. };
  894. struct InfoCodeData
  895. {
  896. unsigned char PreviousInfoVal[29];
  897. union
  898. {
  899. unsigned char InfoVal[29];
  900. struct
  901. {
  902. //InfoVal[0]
  903. unsigned char NormalStopChargingByUser:1; //bit 0
  904. unsigned char ChargingTimesUp:1; //bit 1
  905. unsigned char ReplaceSystemAirFilter:1; //bit 2
  906. unsigned char ReachChademoMaxPluggingTimes:1; //bit 3
  907. unsigned char ReachCcsMaxPluggingTimes:1; //bit 4
  908. unsigned char ReachGbMaxPluggingTimes:1; //bit 5
  909. unsigned char ReachAcMaxPluggingTimes:1; //bit 6
  910. unsigned char CsuFimrwareUpdateFail:1; //bit 7
  911. //InfoVal[1]
  912. unsigned char ChademoModuleFimrwareUpdateFail:1; //bit 0
  913. unsigned char CcsModuleFimrwareUpdateFail:1; //bit 1
  914. unsigned char GbModuleFimrwareUpdateFail:1; //bit 2
  915. unsigned char AuxPowerModuleFimrwareUpdateFail:1; //bit 3
  916. unsigned char RelayBoardFimrwareUpdateFail:1; //bit 4
  917. unsigned char LcmModuleFimrwareUpdateFail:1; //bit 5
  918. unsigned char BluetoothModuleFimrwareUpdateFail:1; //bit 6
  919. unsigned char WiFiModuleFimrwareUpdateFail:1; //bit 7
  920. //InfoVal[2]
  921. unsigned char Telocom4GModuleFimrwareUpdateFail:1; //bit 0
  922. unsigned char PsuFimrwareUpdateFail:1; //bit 1
  923. unsigned char RfidModuleFimrwareUpdateFail:1; //bit 2
  924. unsigned char ConfiguredByUsbFlashDrive:1; //bit 3
  925. unsigned char ConfiguredByBackend:1; //bit 4
  926. unsigned char ConfiguredByWebpage:1; //bit 5
  927. unsigned char InternetDisconnectViaEthernet:1; //bit 6
  928. unsigned char InternetDisconnectViaWiFi :1; //bit 7
  929. //InfoVal[3]
  930. unsigned char InternetDisconnectVia4Gi:1; //bit 0
  931. unsigned char ApDisconnectViaWiFi:1; //bit 1
  932. unsigned char ApnDisconnectVia4Gi:1; //bit 2
  933. unsigned char :5; //bit 3~7 reserved
  934. //InfoVal[4]
  935. unsigned char ChademoEvCommFail:1; //bit 0
  936. unsigned char CcsEvCommFail:1; //bit 1
  937. unsigned char GbEvCommFail:1; //bit 2
  938. unsigned char PilotFault:1; //bit 3
  939. unsigned char ChademoBatteryMalfun:1; //bit 4
  940. unsigned char ChademoNoPermission:1; //bit 5
  941. unsigned char ChademoBatteryIncompatibility:1; //bit 6
  942. unsigned char ChademoBatteryOVP:1; //bit 7
  943. //InfoVal[5]
  944. unsigned char ChademoBatteryUVP:1; //bit 0
  945. unsigned char ChademoBatteryOTP:1; //bit 1
  946. unsigned char ChademoBatteryCurrentDiff:1; //bit 2
  947. unsigned char ChademoBatteryVoltageDiff:1; //bit 3
  948. unsigned char ChademoShiftPosition:1; //bit 4
  949. unsigned char ChademoBatteryOtherFault:1; //bit 5
  950. unsigned char ChademoChargingSystemError:1; //bit 6
  951. unsigned char ChademoEvNormalStop:1; //bit 7
  952. //InfoVal[6]
  953. unsigned char ChademoTempSensorBroken:1; //bit 0
  954. unsigned char ChademoConnectorLockFail:1; //bit 1
  955. unsigned char ChademoD1OnNoReceive:1; //bit 2
  956. unsigned char ChademoBmsKtoJTimeout:1; //bit 3
  957. unsigned char ChademoBmsChargeAllowTimeout:1; //bit 4
  958. unsigned char ChademoWaitGfdTimeout:1; //bit 5
  959. unsigned char ChademoBmsEvRelayTimeout:1; //bit 6
  960. unsigned char ChademoBmsReqCurrentTimeout:1; //bit 7
  961. //InfoVal[7]
  962. unsigned char ChademoBmsKtoJOffTimeout :1; //bit 0
  963. unsigned char ChademoBmsEvRelayOffTimeout :1; //bit 1
  964. unsigned char ChademoAdcMoreThan10V :1; //bit 2
  965. unsigned char ChademoAdcMoreThan20V :1; //bit 3
  966. unsigned char ChademoBmsChargeBeforeStop :1; //bit 4
  967. unsigned char ChademoChargerGetNormalStop :1; //bit 5
  968. unsigned char ChademoChargerGetEmergencyStop :1; //bit 6
  969. unsigned char ChademoIsolationResultFail :1; //bit 7
  970. //InfoVal[8]
  971. unsigned char ChademoMissLinkWithMotherBoard :1; //bit 0
  972. unsigned char ChademoOutputVolMoreThanLimit :1; //bit 1
  973. unsigned char ChademoReqCurrentMoreThanLimit :1; //bit 2
  974. unsigned char ChademoReCapBmsEqrCurrentExceed :1; //bit 3
  975. unsigned char ChademoChargeRemainCountDown :1; //bit 4
  976. unsigned char CcsRESTemperatureInhibit:1; //bit 5
  977. unsigned char CcsEVShiftPosition:1; //bit 6
  978. unsigned char CcsChargerConnectorLockFault:1; //bit 7
  979. //InfoVal[9]
  980. unsigned char CcsEVRESSMalfunction:1; //bit 0
  981. unsigned char CcsChargingCurrentdifferential:1; //bit 1
  982. unsigned char CcsChargingVoltageOutOfRange:1; //bit 2
  983. unsigned char CcsChargingSystemIncompatibility:1; //bit 3
  984. unsigned char CcsEmergencyEvent:1; //bit 4
  985. unsigned char CcsBreaker:1; //bit 5
  986. unsigned char CcsNoData:1; //bit 6
  987. unsigned char Ccsreserved_by_DIN_A:1; //bit 7
  988. //InfoVal[10]
  989. unsigned char Ccsreserved_by_DIN_B:1; //bit 0
  990. unsigned char Ccsreserved_by_DIN_C:1; //bit 1
  991. unsigned char Ccsreserved_by_ISO_1:1; //bit 2
  992. unsigned char Ccsreserved_by_ISO_2:1; //bit 3
  993. unsigned char Ccsreserved_by_ISO_3:1; //bit 4
  994. unsigned char Ccsreserved_by_OEM_1:1; //bit 5
  995. unsigned char Ccsreserved_by_OEM_2:1; //bit 6
  996. unsigned char Ccsreserved_by_OEM_3:1; //bit 7
  997. //InfoVal[11]
  998. unsigned char Ccsreserved_by_OEM_4:1; //bit 0
  999. unsigned char Ccsreserved_by_OEM_5:1; //bit 1
  1000. unsigned char CcsSequenceError:1; //bit 2
  1001. unsigned char CcsSignatureError:1; //bit 3
  1002. unsigned char CcsUnknownSession:1; //bit 4
  1003. unsigned char CcsServiceIDInvalid:1; //bit 5
  1004. unsigned char CcsPaymentSelectionInvalid:1; //bit 6
  1005. unsigned char CcsIdentificationSelectionInvalid:1; //bit 7
  1006. //InfoVal[12]
  1007. unsigned char CcsServiceSelectionInvalid:1; //bit 0
  1008. unsigned char CcsCertificateExpired:1; //bit 1
  1009. unsigned char CcsCertificateNotYetValid:1; //bit 2
  1010. unsigned char CcsCertificateRevoked:1; //bit 3
  1011. unsigned char CcsNoCertificateAvailable:1; //bit 4
  1012. unsigned char CcsCertChainError:1; //bit 5
  1013. unsigned char CcsCertValidationError:1; //bit 6
  1014. unsigned char CcsCertVerificationError:1; //bit 7
  1015. //InfoVal[13]
  1016. unsigned char CcsContractCanceled:1; //bit 0
  1017. unsigned char CcsChallengeInvalid:1; //bit 1
  1018. unsigned char CcsWrongEnergyTransferMode:1; //bit 2
  1019. unsigned char CcsWrongChargeParameter:1; //bit 3
  1020. unsigned char CcsChargingProfileInvalid:1; //bit 4
  1021. unsigned char CcsTariffSelectionInvalid:1; //bit 5
  1022. unsigned char CcsEVSEPresentVoltageToLow:1; //bit 6
  1023. unsigned char CcsPowerDeliveryNotApplied:1; //bit 7
  1024. //InfoVal[14]
  1025. unsigned char CcsMeteringSignatureNotValid:1; //bit 0
  1026. unsigned char CcsNoChargeServiceSelected:1; //bit 1
  1027. unsigned char CcsContactorError:1; //bit 2
  1028. unsigned char CcsCertificateNotAllowedAtThisEVSE:1; //bit 3
  1029. unsigned char CcsGAChargeStop:1; //bit 4
  1030. unsigned char CcsAlignmentError:1; //bit 5
  1031. unsigned char CcsACDError:1; //bit 6
  1032. unsigned char CcsAssociationError:1; //bit 7
  1033. //InfoVal[15]
  1034. unsigned char CcsEVSEChargeAbort:1; //bit 0
  1035. unsigned char CcsNoSupportedAppProtocol:1; //bit 1
  1036. unsigned char CcsContractNotAccepted:1; //bit 2
  1037. unsigned char CcsMOUnknown:1; //bit 3
  1038. unsigned char CcsOEM_Prov_CertificateRevoke:1; //bit 4
  1039. unsigned char CcsOEM_SubCA1_CertificateRevoked:1; //bit 5
  1040. unsigned char CcsOEM_SubCA2_CertificateRevoked:1; //bit 6
  1041. unsigned char CcsOEM_RootCA_CertificateRevoked:1; //bit 7
  1042. //InfoVal[16]
  1043. unsigned char CcsMO_Prov_CertificateRevoked:1; //bit 0
  1044. unsigned char CcsMO_SubCA1_CertificateRevoked:1; //bit 1
  1045. unsigned char CcsMO_SubCA2_CertificateRevoked:1; //bit 2
  1046. unsigned char CcsMO_RootCA_CertificateRevoked:1; //bit 3
  1047. unsigned char CcsCPS_Prov_CertificateRevoked:1; //bit 4
  1048. unsigned char CcsCPS_SubCA1_CertificateRevoked:1; //bit 5
  1049. unsigned char CcsCPS_SubCA2_CertificateRevoked:1; //bit 6
  1050. unsigned char CcsCPS_RootCA_CertificateRevoked:1; //bit 7
  1051. //InfoVal[17]
  1052. unsigned char :5; //bit 0~4 reserved
  1053. unsigned char CcsTT_EVSE_SLAC_init:1; //bit 5
  1054. unsigned char CcsTP_match_response:1; //bit 6
  1055. unsigned char CcsTT_match_sequence:1; //bit 7
  1056. //InfoVal[18]
  1057. unsigned char CcsTT_EVSE_match_MNBC:1; //bit 0
  1058. unsigned char CcsTP_EVSE_avg_atten_calc:1; //bit 1
  1059. unsigned char CcsTT_match_response:1; //bit 2
  1060. unsigned char CcsTP_EVSE_match_session:1; //bit 3
  1061. unsigned char CcsTT_EVSE_assoc_session:1; //bit 4
  1062. unsigned char CcsTT_EVSE_vald_toggle:1; //bit 5
  1063. unsigned char :2; //bit 6~7 reserved
  1064. //InfoVal[19]
  1065. unsigned char :3; //bit 0~2 reserved
  1066. unsigned char CcsUDP_TT_match_join:1; //bit 3
  1067. unsigned char CcsTCP_TT_match_join:1; //bit 4
  1068. unsigned char CcsTP_amp_map_exchange:1; //bit 5
  1069. unsigned char CcsTP_link_ready_notification:1; //bit 6
  1070. unsigned char :1; //bit 7 resetved
  1071. //InfoVal[20]
  1072. unsigned char :4; //bit 0~3 reserved
  1073. unsigned char CcsSupportedAppProtocolRes:1; //bit 4
  1074. unsigned char CcsSessionSetupRes:1; //bit 5
  1075. unsigned char CcsServiceDiscoveryRes:1; //bit 6
  1076. unsigned char CcsServicePaymentSelectionRes:1; //bit 7
  1077. //InfoVal[21]
  1078. unsigned char CcsContractAuthenticationRes:1; //bit 0
  1079. unsigned char CcsChargeParameterDiscoveryRes:1; //bit 1
  1080. unsigned char CcsPowerDeliveryRes:1; //bit 2
  1081. unsigned char CcsCableCheckRes:1; //bit 3
  1082. unsigned char CcsPreChargeRes:1; //bit 4
  1083. unsigned char CcsCurrentDemandRes:1; //bit 5
  1084. unsigned char CcsWeldingDetectionRes:1; //bit 6
  1085. unsigned char CcsSessionStopRes:1; //bit 7
  1086. //InfoVal[22]
  1087. unsigned char CcsSequence_Time:1; //bit 0
  1088. unsigned char CcsReadyToCharge_Performance_Time:1; //bit 1
  1089. unsigned char CcsCommunicationSetup_Performance_Time:1; //bit 2
  1090. unsigned char CcsCableCheck_Performance_Time:1; //bit 3
  1091. unsigned char CcsCPState_Detection_Time:1; //bit 4
  1092. unsigned char CcsCPOscillator_Retain_Time:1; //bit 5
  1093. unsigned char :2; //bit 6~7 reserved
  1094. //InfoVal[23]
  1095. unsigned char :3; //bit 0~2 reserved
  1096. unsigned char CcsTP_GET_EV_TARGET_INFO:1; //bit 3
  1097. unsigned char CcsTT_GET_EV_TARGET_INFO:1; //bit 4
  1098. unsigned char CcsTP_GET_EV_BATTERY_INFO:1; //bit 5
  1099. unsigned char CcsTT_GET_EV_BATTERY_INFO:1; //bit 6
  1100. unsigned char CcsTP_EV_STOP_EVENT:1; //bit 7
  1101. //InfoVal[24]
  1102. unsigned char CcsTT_EV_STOP_EVENT:1; //bit 0
  1103. unsigned char CcsTP_EVSE_STOP_EVENT:1; //bit 1
  1104. unsigned char CcsTT_EVSE_STOP_EVENT:1; //bit 2
  1105. unsigned char CcsTP_GET_MISC_INFO:1; //bit 3
  1106. unsigned char CcsTT_GET_MISC_INFO:1; //bit 4
  1107. unsigned char CcsTP_DOWNLOAD_REQUEST:1; //bit 5
  1108. unsigned char CcsTT_DOWNLOAD_REQUEST:1; //bit 6
  1109. unsigned char CcsTP_START_BLOCK_TRANSFER:1; //bit 7
  1110. //InfoVal[25]
  1111. unsigned char CcsTT_START_BLOCK_TRANSFER:1; //bit 0
  1112. unsigned char CcsTP_DATA_TRANSFER:1; //bit 1
  1113. unsigned char CcsTT_DATA_TRANSFER:1; //bit 2
  1114. unsigned char CcsTP_DOWNLOAD_FINISH:1; //bit 3
  1115. unsigned char CcsTT_DOWNLOAD_FINISH:1; //bit 4
  1116. unsigned char CcsTP_ISOLATION_STATUS:1; //bit 5
  1117. unsigned char CcsTT_ISOLATION_STATUS:1; //bit 6
  1118. unsigned char CcsTP_CONNECTOR_INFO:1; //bit 7
  1119. //InfoVal[26]
  1120. unsigned char CcsTT_CONNECTOR_INFO:1; //bit 0
  1121. unsigned char CcsTT_RTC_INFO:1; //bit 1
  1122. unsigned char CcsTP_RTC_INFO:1; //bit 2
  1123. unsigned char CcsTP_EVSE_PRECHARGE_INFO:1; //bit 3
  1124. unsigned char CcsTT_EVSE_PRECHARGE_INFO:1; //bit 4
  1125. unsigned char CcsMSG_Sequence:1; //bit 5
  1126. unsigned char CcsCAN_MSG_Unrecognized_CMD_ID:1; //bit 6
  1127. unsigned char CcsDIN_Msg_Decode_Error:1; //bit 7
  1128. //InfoVal[27]
  1129. unsigned char CcsDIN_Msg_Encode_Error:1; //bit 0
  1130. unsigned char CcsISO1_Msg_Decode_Error:1; //bit 1
  1131. unsigned char CcsISO1_Msg_Encode_Error:1; //bit 2
  1132. unsigned char CcsISO2_Msg_Decode_Error:1; //bit 3
  1133. unsigned char CcsISO2_Msg_Encode_Error:1; //bit 4
  1134. unsigned char :3; //bit 5~7 reserved
  1135. //InfoVal[28]
  1136. unsigned char BackendDisconnectedViaEthernet:1; //bit 0
  1137. unsigned char BackendDisconnectViaWiFi:1; //bit 1
  1138. unsigned char BackendDisconnectVia4G:1; //bit 2
  1139. unsigned char BackendRemoteStart:1; //bit 3
  1140. unsigned char BackendRemoteStop:1; //bit 4
  1141. unsigned char BackendRemoteReset:1; //bit 5
  1142. unsigned char :2; //bit 6~7 reserved
  1143. }bits;
  1144. }InfoEvents;
  1145. };
  1146. struct StatusCodeData
  1147. {
  1148. struct FaultCodeData FaultCode;
  1149. struct AlarmCodeData AlarmCode;
  1150. struct InfoCodeData InfoCode;
  1151. };
  1152. /**************************************************************************************/
  1153. /**************************PSU Share memory***************************************/
  1154. /**************************************************************************************/
  1155. /*Following are the information for each PSU module*/
  1156. struct PsuModuleData
  1157. {
  1158. unsigned char AssignID;
  1159. unsigned char PhysicalID;
  1160. unsigned char GroupID;
  1161. unsigned char Address;
  1162. unsigned char FireWireIndex;
  1163. unsigned char FwVersion[16];
  1164. unsigned char SerialNumber[32];
  1165. unsigned char StateMachine; //0: Identification, 1:Operation, 2: Alarm, 3: Failure, s4:Upgrade
  1166. unsigned char OutputPowerSwitch; //0: D.D normal OFF, 1: D.D emergency OFF, 2: D.D ON
  1167. unsigned short FanSpeed_1; //RPM
  1168. unsigned short FanSpeed_2; //RPM
  1169. unsigned short FanSpeed_3; //RPM
  1170. unsigned short FanSpeed_4; //RPM
  1171. unsigned short InputVoltage_Type; //0x00 = Line to Line Vol, 0x01 = Line to Neutral Vol
  1172. unsigned short InputVoltageL1; //abcd=abc.d volt
  1173. unsigned short InputVoltageL2; //abcd=abc.d volt
  1174. unsigned short InputVoltageL3; //abcd=abc.d volt
  1175. unsigned short InputCurrentL1; //abcd=abc.d amp
  1176. unsigned short InputCurrentL2; //abcd=abc.d amp
  1177. unsigned short InputCurrentL3; //abcd=abc.d amp
  1178. unsigned short PresentOutputVoltage; //abcd=abc.d volt
  1179. unsigned short PresentOutputCurrent; //abcd=abc.d amp
  1180. unsigned short AvailableCurrent; //abcd=abc.d amp
  1181. unsigned int AvailablePower; //Watt
  1182. char CriticalTemp1; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1183. char CriticalTemp2; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1184. char CriticalTemp3; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1185. char ExletTemp; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1186. char InletTemp_1; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1187. char InletTemp_2; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1188. char InletTemp; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1189. char OutletTemp; //0x00: -60¢XC ~ 0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
  1190. unsigned int AlarmCode;
  1191. unsigned int FaultCode; //
  1192. };
  1193. /*Following are the information for each PSU Group*/
  1194. struct PsuGroupData
  1195. {
  1196. unsigned char GroupPresentPsuQuantity;
  1197. unsigned char GroupOutputPowerSwitch; //0: D.D normal OFF, 1: D.D emergency OFF, 2: D.D ON
  1198. unsigned short GroupTargetOutputVoltage; //abcd=abc.d volt
  1199. unsigned short GroupTargetOutputCurrent; //abcd=abc.d amp
  1200. unsigned short GroupAvailableCurrent; //abcd=abc.d amp
  1201. unsigned int GroupAvailablePower; //Watt
  1202. unsigned short GroupPresentOutputVoltage; //abcd=abc.d volt
  1203. unsigned short GroupPresentOutputCurrent; //abcd=abc.d Amps
  1204. struct PsuModuleData PsuModule[MAX_PSU_QUANTITY];
  1205. };
  1206. /*Following is the information for system all PSU*/
  1207. struct PsuData
  1208. {
  1209. unsigned char SystemPresentPsuQuantity;
  1210. struct PsuGroupData PsuGroup[4];
  1211. unsigned char GroupCount;
  1212. unsigned char Work_Step;
  1213. unsigned char NeedBackTest;
  1214. unsigned char ReqIdFeedbackFlag;
  1215. };
  1216. /************************************************************************************/
  1217. /**************************CHAdeMO protocol Share memory*********************/
  1218. /**************************************************************************************/
  1219. struct CHAdeMOEvData
  1220. {
  1221. unsigned char SupportDynamicControl; //110.0
  1222. // bit0=1:supported
  1223. unsigned char SupportHighCurrent; //110.0
  1224. // bit1=1:supported
  1225. unsigned char MiniChargeCurrent; //100.0 0~200(A) (unit:1A)
  1226. // 0x00: request for current equivalent to 1.5kW
  1227. // 0x01: no request
  1228. // 0x02: request of 1A and following are the same rule
  1229. unsigned short MaxiBatteryVoltage; //100.5,100.4 0~600(V) (unit:1V)
  1230. unsigned short MaxiChargingTime; //101.2,101.1 10(sec.)~255(min.) (Unit:sec)
  1231. // Set 0xFF to 101.1 (Unit: 10sec) in case 101.2 (Unit: 1min) is used
  1232. unsigned char EstimatChargingTime; //101.3 0~254(min.) (Unit:sec)
  1233. // Display Only
  1234. unsigned short TotalBatteryCapacity; //101.6,101.5 0.1~6553.5(kWh) (unit:0.1 kWh)
  1235. unsigned char ProtocolVersion; //102.0 0~255
  1236. // 0x02: CHAdeMO specification ver.1.2
  1237. unsigned short TargetBatteryVoltage; //102.2,102.1 0~600(V) (unit:1V)
  1238. unsigned short ChargingCurrentRequest; //102.3 0~200(A) (unit:1A)
  1239. //110.2,110.1 0~1023(A) (unit:1A)
  1240. unsigned char BatteryAlarm; //102.4 >0:alarm
  1241. // bit0=1:Battery overvoltage
  1242. // bit1=1:Battery undervoltage
  1243. // bit2=1:Battery current deviation error
  1244. // bit3=1:High battery temperature
  1245. // bit4=1:Battery voltage deviation error
  1246. unsigned char EvDetection; //102.5
  1247. // bit0=0:Vehicle charging disabled, (stop charging)
  1248. // bit0=1:Vehicle charging enabled,
  1249. // bit1=0:¡§Parking¡¨ position
  1250. // bit1=1:other position (stop charging)
  1251. // bit2=0:Charging system normal
  1252. // bit2=1:Charging system error (stop charging)
  1253. // bit3=0:EV contactor close or during welding detection
  1254. // bit3=1:EV contactor open or termination of welding detection (stop charging)
  1255. // bit4=0:No stop request before charging
  1256. // bit4=1:Normal stop request before charging (stop charging)
  1257. unsigned char SOC; //102.6 0~100(%) (unit:%)
  1258. // Display Only
  1259. unsigned char Communicating; // it is true if receive EV CAN message within every 1500ms
  1260. unsigned char PresentMsgFlowStatus; //
  1261. };
  1262. struct CHAdeMOEvseData
  1263. {
  1264. unsigned char SelfTest_Comp;
  1265. unsigned char version[16]; //Chademo firmware version
  1266. unsigned char SupportDynamicControl; //118.0
  1267. // bit0=1:supported
  1268. unsigned char SupportHighCurrent; //118.0
  1269. // bit1=1:supported
  1270. unsigned short AvailableOutputVoltage; //108.2,108.1 0~600(V) (unit:1V)
  1271. unsigned short AvailableOutputCurrent; //108.3 0~255(A) (unit:1A)
  1272. //118.2,118.1 0~1023(A) (unit:1A)
  1273. unsigned short ThresholdVoltage; //108.5,108.4 0~600(V) (unit:1V)
  1274. unsigned char ConnectorTemperatureP; //108.6 -40~215(degC) (unit:degC) //value 0=-40 [NISSAN customized]
  1275. unsigned char ConnectorTemperatureN; //108.7 -40~215(degC) (unit:degC) //value 0=-40 [NISSAN customized]
  1276. unsigned char ProtocolVersion; //109.0 0~255
  1277. // 0x00: CHAdeMO specification 0.9 and earlier
  1278. // 0x01: CHAdeMO specification 0.9 and 0.9.1
  1279. // 0x02: CHAdeMO specification 1.0.0, 1.0.1, 1.1 and 1.2
  1280. unsigned short PresentOutputVoltage; //109.2,109.1 0~600(V) (unit:1V)
  1281. unsigned short PresentOutputCurrent; //109.3 0~255(A) (unit:1A)
  1282. //118.4,118.3 0~1023(A) (unit:1A)
  1283. unsigned char EvseDetection; //109.5
  1284. // bit0=0:not charging state now
  1285. // bit0=1:charging state now
  1286. // bit1=0:EVSE normal
  1287. // bit1=1:EVSE error
  1288. // bit2=0:Not Energizing state
  1289. // bit2=1:Energizing state
  1290. // bit3=0:No Battery incompatibility
  1291. // bit3=1:Battery incompatibility
  1292. // bit4=0:No Charging system error
  1293. // bit4=1:Charging system error
  1294. // bit5=0:No Charging stop control
  1295. // bit5=1:Charging stop control
  1296. unsigned short RemainChargingTime; //109.7,109.6 10(sec.)~255(min.) (Unit:sec)
  1297. // Set 0xFF to 109.6 (Unit: 10sec) in case 109.7 (Unit: 1min) is used
  1298. unsigned char HighPowerCondition; //118.5
  1299. // bit0=0:Present charging current H¡¦118.3,H¡¦118.4¡¨ is less than or equal to rated current of a charging cable
  1300. // bit0=1:Present charging current H¡¦118.3,H¡¦118.4¡¨ is exceeds to rated current of a charging cable
  1301. // bit1=1:charging cable Cooling function Operating Installed
  1302. // bit2=1:charging cable Current limiting function
  1303. // bit3=1:charging connector Cooling function Operating
  1304. // bit4=1:charging connector Current limiting function Installed
  1305. // bit5=1:charging connector Over-temperature protection Installed
  1306. // bit6=1:Functional safety Applied
  1307. unsigned int MaxiGroupPower; // XXXXXXXX (Unit:Watt)depend on which group to be used
  1308. unsigned int MaxiGroupCurrent; // XXXXXXXX (unit:1A)depend on which group to be used
  1309. unsigned short ApplyOutputVoltage; // 0~600(V) (unit:1V)
  1310. unsigned short ElapseChargingTime; // (Unit:sec)
  1311. unsigned short ElapseEnergy; // (Unit:10xkWh)
  1312. unsigned char EvboardStatus; // 0 : init
  1313. };
  1314. struct CHAdeMOData
  1315. {
  1316. struct CHAdeMOEvData ev[CHAdeMO_QUANTITY];
  1317. struct CHAdeMOEvseData evse[CHAdeMO_QUANTITY];
  1318. };
  1319. /************************************************************************************/
  1320. /**************************CCS protocol Share memory***************************/
  1321. /**************************DIN70121: 201412***************************************/
  1322. /**************************ISO15118_2014: 2014************************************/
  1323. /**************************ISO15118_2018: 2018************************************/
  1324. /************************************************************************************/
  1325. typedef enum boolean { FALSE, TRUE } BOOL;
  1326. enum ResponseCodeType_DIN70121 { OK_DIN70121 = 0, OK_NewSessionEstablished_DIN70121 = 1, OK_OldSessionJoined_DIN70121 = 2, OK_CertificateExpiresSoon_DIN70121 = 3,
  1327. FAILED_DIN70121 = 4, FAILED_SequenceError_DIN70121 = 5, FAILED_ServiceIDInvalid_DIN70121 = 6, FAILED_UnknownSession_DIN70121 = 7,
  1328. FAILED_ServiceSelectionInvalid_DIN70121 = 8, FAILED_PaymentSelectionInvalid_DIN70121 = 9, FAILED_CertificateExpired_DIN70121 = 10,
  1329. FAILED_SignatureError_DIN70121 = 11, FAILED_NoCertificateAvailable_DIN70121 = 12, FAILED_CertChainError_DIN70121 = 13, FAILED_ChallengeInvalid_DIN70121 = 14,
  1330. FAILED_ContractCanceled_DIN70121 = 15, FAILED_WrongChargeParameter_DIN70121 = 16, FAILED_PowerDeliveryNotApplied_DIN70121 = 17,
  1331. FAILED_TariffSelectionInvalid_DIN70121 = 18, FAILED_ChargingProfileInvalid_DIN70121 = 19, FAILED_EVSEPresentVoltageToLow_DIN70121 = 20,
  1332. FAILED_MeteringSignatureNotValid_DIN70121 = 21, FAILED_WrongEnergyTransferType_DIN70121 = 22};
  1333. enum ResponseCodeType_ISO15118_2014 { OK_ISO15118_2014 = 0, OK_NewSessionEstablished_ISO15118_2014 = 1, OK_OldSessionJoined_ISO15118_2014 = 2, OK_CertificateExpiresSoon_ISO15118_2014 = 3,
  1334. FAILED_ISO15118_2014 = 4, FAILED_SequenceError_ISO15118_2014 = 5, FAILED_ServiceIDInvalid_ISO15118_2014 = 6, FAILED_UnknownSession_ISO15118_2014 = 7,
  1335. FAILED_ServiceSelectionInvalid_ISO15118_2014 = 8, FAILED_PaymentSelectionInvalid_ISO15118_2014 = 9, FAILED_CertificateExpired_ISO15118_2014 = 10,
  1336. FAILED_SignatureError_ISO15118_2014 = 11, FAILED_NoCertificateAvailable_ISO15118_2014 = 12, FAILED_CertChainError_ISO15118_2014 = 13, FAILED_ChallengeInvalid_ISO15118_2014 = 14,
  1337. FAILED_ContractCanceled_ISO15118_2014 = 15, FAILED_WrongChargeParameter_ISO15118_2014 = 16, FAILED_PowerDeliveryNotApplied_ISO15118_2014 = 17,
  1338. FAILED_TariffSelectionInvalid_ISO15118_2014 = 18, FAILED_ChargingProfileInvalid_ISO15118_2014 = 19, FAILED_MeteringSignatureNotValid_ISO15118_2014 = 20,
  1339. FAILED_NoChargeServiceSelected_ISO15118_2014 = 21, FAILED_WrongEnergyTransferMode_ISO15118_2014 = 22, FAILED_ContactorError_ISO15118_2014 = 23,
  1340. FAILED_CertificateNotAllowedAtThisEVSE_ISO15118_2014 = 24, FAILED_CertificateRevoked_ISO15118_2014 = 25 };
  1341. enum ResponseCodeType_ISO15118_2018 { OK_ISO15118_2018 = 0, OK_NewSessionEstablished_ISO15118_2018 = 1, OK_OldSessionJoined_ISO15118_2018 = 2, OK_CertificateExpiresSoon_ISO15118_2018 = 3,
  1342. OK_IsolationValid_ISO15118_2018 = 4, OK_IsolationWarning_ISO15118_2018 = 5, WARNING_CertificateExpired_ISO15118_2018 = 6, WARNING_NoCertificateAvailable_ISO15118_2018 = 7,
  1343. WARNING_CertValidationError_ISO15118_2018 = 8, WARNING_CertVerificationError_ISO15118_2018 = 9, WARNING_ContractCanceled_ISO15118_2018 = 10,
  1344. FAILED_ISO15118_2018 = 11, FAILED_SequenceError_ISO15118_2018 = 12, FAILED_ServiceIDInvalid_ISO15118_2018 = 13, FAILED_UnknownSession_ISO15118_2018 = 14,
  1345. FAILED_ServiceSelectionInvalid_ISO15118_2018 = 15, FAILED_SignatureError_ISO15118_2018 = 16, FAILED_IdentificationSelectionInvalid_ISO15118_2018 = 17,
  1346. FAILED_ChallengeInvalid_ISO15118_2018 = 18, FAILED_WrongChargeParameter_ISO15118_2018 = 19, FAILED_IsolationFault_ISO15118_2018 = 20,
  1347. FAILED_PowerDeliveryNotApplied_ISO15118_2018 = 21, FAILED_TariffSelectionInvalid_ISO15118_2018 = 22, FAILED_ChargingProfileInvalid_ISO15118_2018 = 23,
  1348. FAILED_MeteringSignatureNotValid_ISO15118_2018 = 24, FAILED_NoChargeServiceSelected_ISO15118_2018 = 25, FAILED_WrongEnergyTransferMode_ISO15118_2018 = 26,
  1349. FAILED_ContactorError_ISO15118_2018 = 27, FAILED_CertificateRevoked_ISO15118_2018 = 28, FAILED_CertificateNotYetValid_ISO15118_2018 = 29 };
  1350. enum EVSENotificationType { None = 0, StopCharging = 1, ReNegotiation = 2};
  1351. enum ServiceCategoryType { EVCharging = 0, Internet = 1, ContractCertificate = 2, OtherCustom = 3};
  1352. enum PaymentOptionType { Contract = 0, ExternalPayment = 1};
  1353. /*enum EVSESupportedEnergyTransferType { AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
  1354. DC_combo_core = 4, DC_dual = 5, AC_core1p_DC_extended = 6, AC_single_DC_core = 7,
  1355. AC_single_phase_three_phase_core_DC_extended = 8, AC_core3p_DC_extended = 9};*/
  1356. enum EnergyTransferModeType { AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
  1357. DC_combo_core = 4, DC_unique = 5};
  1358. //enum identificationOptionType { Contract = 0, ExternalIdentification = 1};
  1359. enum unitSymbolType_DIN70121 { h_DIN70121 = 0, m_DIN70121 = 1, s_DIN70121 = 2, A_DIN70121 = 3, Ah_DIN70121 = 4, V_DIN70121 = 5, VA_DIN70121 = 6, W_DIN70121 = 7, Ws_DIN70121 = 8, Wh_DIN70121 = 9};
  1360. enum unitSymbolType_ISO15118_2014 { h_ISO15118_2014 = 0, m_ISO15118_2014 = 1, s_ISO15118_2014 = 2, A_ISO15118_2014 = 3, V_ISO15118_2014 = 4, W_ISO15118_2014 = 5, Wh_ISO15118_2014 = 6};
  1361. enum ProcessingType { Finished = 0, Ongoing = 1, Ongoing_WaitingForCustomerInteraction = 2};
  1362. enum EVSEProcessingType_DIN70121 { Finished_DIN70121 = 0, Ongoing_DIN70121 = 1};
  1363. enum EVSEProcessingType_ISO15118_2014 { Finished_ISO15118_2014 = 0, Ongoing_ISO15118_2014 = 1, Ongoing_WaitingForCustomerInteraction_ISO15118_2014=2 };
  1364. enum DC_EVErrorCodeType { NO_ERROR = 0, FAILED_RESSTemperatureInhibit = 1, FAILED_EVShiftPosition = 2, FAILED_ChargerConnectorLockFault = 3,
  1365. FAILED_EVRESSMalfunction = 4, FAILED_ChargingCurrentdifferential = 5, FAILED_ChargingVoltageOutOfRange = 6,
  1366. Reserved_A = 7, Reserved_B = 8, Reserved_C = 9, FAILED_ChargingSystemIncompatibility = 10, NoData = 11};
  1367. enum IsolationLevelType_DIN70121 { Invalid_DIN70121 = 0, Valid_DIN70121 = 1, Warning_DIN70121 = 2, Fault_DIN70121 = 3};
  1368. enum IsolationLevelType_ISO15118_2014 { Invalid_ISO15118_2014 = 0, Valid_ISO15118_2014 = 1, Warning_ISO15118_2014 = 2, Fault_ISO15118_2014 = 3, No_IMD_ISO15118_2014 = 4};
  1369. enum DC_EVSEStatusCodeType { EVSE_NotReady = 0, EVSE_Ready = 1, EVSE_Shutdown = 2, EVSE_UtilityInterruptEvent = 3,
  1370. EVSE_IsolationMonitoringActive = 4, EVSE_EmergencyShutdown = 5, EVSE_Malfunction = 6,
  1371. Reserved_8 = 7, Reserved_9 = 8};
  1372. enum ScheduleOriginType { EV = 0, SA = 1};
  1373. enum ChargeProgressType_ISO15118_2014 {start_ISO15118_2014 = 0, Stop_ISO15118_2014 = 1, Renegotiate_ISO15118_2014 = 2};
  1374. enum ChargeProgressType_ISO15118_2018 {start_ISO15118_2018 = 0, Renegotiate_ISO15118_2018 = 1, Standby_ISO15118_2018 = 2, Stop_ISO15118_2018 = 3};
  1375. enum evOperationType {Charge = 0, Discharge = 1, Standby = 2};
  1376. enum mechanicalChargingDeviceStatusType {Home = 0, Moving = 1, EndPosition = 2};
  1377. enum EV_CP_StatusType {A = 0, B = 1, C = 2, D = 3, E = 4, F = 5};
  1378. enum EV_Error_Status_CodeType { No_EV_Error = 0, EV_FAILED_EmergencyEvent = 1, EV_FAILED_Breaker = 2, EV_FAILED_RESSTemperatureInhibit = 3,
  1379. EV_FAILED_RESS = 4, EV_FAILED_ChargingCurrentDifferential = 5, EV_FAILED_ChargingVoltageOutOfRange = 6,
  1380. Reserved_by_ISO_1 = 7, Reserved_by_ISO_2 = 8, Reserved_by_ISO_3 = 9, OEM1 = 10,
  1381. OEM2 = 11, OEM3 = 12, OEM4 = 13};
  1382. enum IsolationStatusType { Invalid = 0, Safe = 1, Warning = 2, Fault = 3};
  1383. enum ChargingSessionType { Terminate = 0, Pause = 1};
  1384. enum CostKindType { relativePricePercentage = 0, RenewableGenerationPercentage = 1, CarbonDioxideEmission = 2};
  1385. struct PhysicalValueType_DIN70121 //The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
  1386. {
  1387. int Multiplier; //range: -3..+3
  1388. enum unitSymbolType_DIN70121 Unit;
  1389. short Value;
  1390. };
  1391. struct PhysicalValueType_ISO15118_2014 //The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
  1392. {
  1393. int Multiplier; //range: -3..+3
  1394. enum unitSymbolType_ISO15118_2014 Unit;
  1395. short Value;
  1396. };
  1397. struct PhysicalValueType_ISO15118_2018 //The final physical value is determined by: Value * 10 ^ Exponent [Unit]
  1398. {
  1399. int Exponent; //range: -3..+3
  1400. short Value;
  1401. };
  1402. struct AppProtocolType
  1403. {
  1404. unsigned char ProtocolNamespace[100];
  1405. unsigned int VersionNumberMajor;
  1406. unsigned int VersionNumberMinor;
  1407. unsigned char SchemaID;
  1408. unsigned char Priority; //range 1..20
  1409. };
  1410. struct ACD_SSEnergyTransferModeType
  1411. {
  1412. unsigned char EVID[20];
  1413. };
  1414. struct EVSEStatusType
  1415. {
  1416. unsigned short NotificationMaxDelay; //in seconds
  1417. enum EVSENotificationType EVSENotification;
  1418. };
  1419. struct ServiceIDListType
  1420. {
  1421. unsigned short ServiceID[10]; //refer to chapter 8.6.2.1 Table 192
  1422. };
  1423. struct PaymentOptionListType
  1424. {
  1425. enum PaymentOptionType PaymentOption[2];
  1426. };
  1427. struct ServiceTagType
  1428. {
  1429. unsigned short ServiceID;
  1430. unsigned char ServiceName[32];//Optional Element
  1431. enum ServiceCategoryType ServiceCategory;
  1432. unsigned char ServiceScope[32];//Optional Element
  1433. };
  1434. struct ServiceType_DIN70121
  1435. {
  1436. struct ServiceTagType ServiceTag;
  1437. BOOL FreeService;
  1438. };
  1439. struct ServiceType_ISO15118_2014
  1440. {
  1441. unsigned short ServiceID;
  1442. unsigned char ServiceName[32]; //Optional
  1443. enum ServiceCategoryType ServiceCategory;
  1444. unsigned char ServiceScope[64]; //Optional
  1445. BOOL FreeService;
  1446. };
  1447. /*struct ServiceType_ISO15118_2018
  1448. {
  1449. unsigned short ServiceID;
  1450. BOOL FreeService;
  1451. }; */
  1452. struct SupportedEnergyTransferModeType
  1453. {
  1454. enum EnergyTransferModeType EnergyTransferMode[6];
  1455. };
  1456. struct ServiceChargeType
  1457. {
  1458. struct ServiceType_DIN70121 Services;
  1459. //enum EVSESupportedEnergyTransferType EnergyTransferType;
  1460. enum EnergyTransferModeType EnergyTransferType;
  1461. };
  1462. struct ChargeServiceType
  1463. {
  1464. struct ServiceType_ISO15118_2014 Services;
  1465. struct SupportedEnergyTransferModeType SupportedEnergyTransferMode;
  1466. };
  1467. struct ServiceListType
  1468. {
  1469. struct ServiceType_ISO15118_2014 Service[8];
  1470. };
  1471. struct IdentificationOptionListType
  1472. {
  1473. enum PaymentOptionType IdentificationOption[2];
  1474. };
  1475. struct ParameterType
  1476. {
  1477. unsigned char Name[32];
  1478. struct PhysicalValueType_ISO15118_2014 PhysicalValue_ISO15118_2014;
  1479. struct PhysicalValueType_ISO15118_2018 PhysicalValue_ISO15118_2018;
  1480. };
  1481. struct ParameterSetType
  1482. {
  1483. short ParameterSetID;
  1484. struct ParameterType Parameter[16];
  1485. };
  1486. struct ServiceParameterListType
  1487. {
  1488. struct ParameterSetType ParameterSet[255];
  1489. };
  1490. struct WPT_SDlEnergyTransferModeType
  1491. {
  1492. struct ServiceParameterListType ServiceParameterList;
  1493. };
  1494. struct SelectedServiceType
  1495. {
  1496. unsigned short ServiceID;
  1497. short ParameterSetID;
  1498. };
  1499. struct SelectedServiceListType
  1500. {
  1501. struct SelectedServiceType SelectedService[16];
  1502. };
  1503. struct CertificateChainType
  1504. {
  1505. unsigned char Id[32]; //Optional
  1506. unsigned char Certificate[800]; //check size again
  1507. unsigned char SubCertificates[4][800]; //Optional, check size again
  1508. };
  1509. struct PNC_AReqIdentificationModeType
  1510. {
  1511. unsigned char GenChallenge[16]; //DIN70121=> None, ISO15118_2014=>None, ISO15118_2018=>Optional
  1512. unsigned char Id[32]; //DIN70121=> None, ISO15118_2014=>None, ISO15118_2018=>Optional
  1513. };
  1514. struct AC_EVChargeParameterType
  1515. {
  1516. unsigned int DepartureTime; //Optional
  1517. struct PhysicalValueType_ISO15118_2014 EAmount;
  1518. struct PhysicalValueType_ISO15118_2014 EVMaxVoltage;
  1519. struct PhysicalValueType_ISO15118_2014 EVMaxCurrent;
  1520. struct PhysicalValueType_ISO15118_2014 EVMinCurrent;
  1521. };
  1522. struct DC_EVStatusType_DIN70121
  1523. {
  1524. BOOL EVReady;
  1525. BOOL EVCabinConditioning;
  1526. BOOL EVRESSConiditioning;
  1527. enum DC_EVErrorCodeType EVErrorCode;
  1528. unsigned char EVRESSSOC; /*0-100 percentage*/
  1529. };
  1530. struct DC_EVChargeParameterType_DIN70121
  1531. {
  1532. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1533. struct PhysicalValueType_DIN70121 EVMaximumCurrentLimit;
  1534. struct PhysicalValueType_DIN70121 EVMaximumPowerLimit; //Optional
  1535. struct PhysicalValueType_DIN70121 EVMaximumVoltageLimit;
  1536. struct PhysicalValueType_DIN70121 EVEnergyCapacity; //Optional
  1537. struct PhysicalValueType_DIN70121 EVEnergyRequest; //Optional
  1538. unsigned char FullSOC;/*0-100 percentage*/ //Optional
  1539. unsigned char BulkSOC;/*0-100 percentage*/ //Optional
  1540. };
  1541. struct DC_EVStatusType_ISO15118_2014
  1542. {
  1543. BOOL EVReady;
  1544. enum DC_EVErrorCodeType EVErrorCode;
  1545. unsigned char EVRESSSOC; /*0-100 percentage*/
  1546. };
  1547. struct DC_EVChargeParameterType_ISO15118_2014
  1548. {
  1549. unsigned int DepartureTime; //Optional
  1550. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1551. struct PhysicalValueType_ISO15118_2014 EVMaximumCurrentLimit;
  1552. struct PhysicalValueType_ISO15118_2014 EVMaximumPowerLimit; //Optional
  1553. struct PhysicalValueType_ISO15118_2014 EVMaximumVoltageLimit;
  1554. struct PhysicalValueType_ISO15118_2014 EVEnergyCapacity; //Optional
  1555. struct PhysicalValueType_ISO15118_2014 EVEnergyRequest; //Optional
  1556. unsigned char FullSOC;/*0-100 percentage*/ //Optional
  1557. unsigned char BulkSOC;/*0-100 percentage*/ //Optional
  1558. };
  1559. struct Dynamic_CPDReqControlModeType
  1560. {
  1561. unsigned int DepartureTime;
  1562. };
  1563. struct RelativeTimeIntervalType
  1564. {
  1565. unsigned int duration; //Optional
  1566. unsigned int start;
  1567. };
  1568. struct PMaxScheduleEntryType
  1569. {
  1570. struct RelativeTimeIntervalType RelativeTimeInterval;
  1571. unsigned short PMax;
  1572. };
  1573. struct PMaxScheduleType
  1574. {
  1575. unsigned short PMaxScheduleID; //no this itme in ISO15118_2014
  1576. struct PMaxScheduleEntryType PMaxScheduleEntry[1024];
  1577. };
  1578. struct CostType
  1579. {
  1580. unsigned int amount;
  1581. enum CostKindType costKind;
  1582. int amountMultiplier; //Optional , range: -3..+3
  1583. };
  1584. struct ConsumptionCostType
  1585. {
  1586. struct CostType Cost[3];
  1587. struct PhysicalValueType_ISO15118_2014 startValue;
  1588. };
  1589. struct SalesTariffEntryType
  1590. {
  1591. struct RelativeTimeIntervalType RelativeTimeInterval;
  1592. unsigned char EPriceLevel; //Optional
  1593. struct ConsumptionCostType ConsumptionCost[3]; //Optional
  1594. };
  1595. struct SalesTariffType
  1596. {
  1597. unsigned char Id[32]; //Optional
  1598. short SalesTariffID;
  1599. unsigned char SalesTariffDescription[32]; //Optional
  1600. unsigned char NumEPriceLevels; //Optional
  1601. struct SalesTariffEntryType SalesTariffEntry[1024];
  1602. };
  1603. struct SAScheduleTupleType
  1604. {
  1605. short SAScheduleTupleID;
  1606. struct PMaxScheduleType PMaxSchedule;
  1607. struct SalesTariffType SalesTariff; //Optional
  1608. };
  1609. struct ScheduleListType
  1610. {
  1611. enum ScheduleOriginType ScheduleOrigin;
  1612. struct SAScheduleTupleType ScheduleTuple[3];
  1613. };
  1614. struct Scheduled_CPDReqControlModeType
  1615. {
  1616. enum ProcessingType EVProcessing;
  1617. unsigned int DepartureTime; //Optional
  1618. unsigned short MaxSupportingPoints;
  1619. struct ScheduleListType ScheduleList; //Optional
  1620. };
  1621. struct AC_CPDReqEnergyTransferModeType
  1622. {
  1623. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1624. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1625. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1626. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1627. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1628. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1629. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1630. };
  1631. struct DC_CPDReqEnergyTransferModeType
  1632. {
  1633. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower; //Optional
  1634. struct PhysicalValueType_ISO15118_2018 EVMinimumChargePower; //Optional
  1635. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1636. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1637. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1638. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1639. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1640. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1641. unsigned char TargetSOC; //Optional
  1642. unsigned char BulkSOC; //Optional
  1643. };
  1644. struct BPT_AC_CPDReqEnergyTransferModeType
  1645. {
  1646. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1647. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargePower;
  1648. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargePower;
  1649. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1650. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargeCurrent;
  1651. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1652. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargeCurrent;
  1653. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1654. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1655. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1656. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1657. };
  1658. struct BPT_DC_CPDReqEnergyTransferModeType
  1659. {
  1660. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1661. struct PhysicalValueType_ISO15118_2018 EVMinimumChargePower;
  1662. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargePower;
  1663. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargePower;
  1664. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1665. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1666. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargeCurrent;
  1667. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargeCurrent;
  1668. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1669. struct PhysicalValueType_ISO15118_2018 EVMinimumVoltage;
  1670. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest;
  1671. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest;
  1672. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest;
  1673. unsigned char TargetSOC; //Optional
  1674. unsigned char BulkSOC; //Optional
  1675. };
  1676. struct WPT_CPDReqEnergyTransferModeType
  1677. {
  1678. struct PhysicalValueType_ISO15118_2018 EVMaximumPower; //Optional
  1679. struct PhysicalValueType_ISO15118_2018 EVMinimumPower; //Optional
  1680. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1681. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1682. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1683. };
  1684. struct ACD_CPDReqEnergyTransferModeType
  1685. {
  1686. //cannot be found in standard
  1687. };
  1688. struct SAScheduleListType
  1689. {
  1690. struct SAScheduleTupleType SAScheduleTuple[3];
  1691. };
  1692. struct DC_EVSEStatusType_DIN70121
  1693. {
  1694. enum IsolationLevelType_DIN70121 EVSEIsolationStatus; //Optional
  1695. enum DC_EVSEStatusCodeType EVSEStatusCode;
  1696. unsigned int NotificationMaxDelay;
  1697. enum EVSENotificationType EVSENotification;
  1698. };
  1699. struct DC_EVSEChargeParameterType_DIN70121
  1700. {
  1701. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1702. struct PhysicalValueType_DIN70121 EVSEMaximumCurrentLimit;
  1703. struct PhysicalValueType_DIN70121 EVSEMaximumPowerLimit; //Optional
  1704. struct PhysicalValueType_DIN70121 EVSEMaximumVoltageLimit;
  1705. struct PhysicalValueType_DIN70121 EVSEMinimumCurrentLimit;
  1706. struct PhysicalValueType_DIN70121 EVSEMinimumVoltageLimit;
  1707. struct PhysicalValueType_DIN70121 EVSECurrentRegulationTolerance; //Optional
  1708. struct PhysicalValueType_DIN70121 EVSEPeakCurrentRipple;
  1709. struct PhysicalValueType_DIN70121 EVSEEnergyToBeDelivered; //Optional
  1710. };
  1711. struct AC_EVSEStatusType
  1712. {
  1713. BOOL RCD;
  1714. unsigned short NotificationMaxDelay;
  1715. enum EVSENotificationType EVSENotification; //need to be confirmed
  1716. };
  1717. struct AC_EVSEChargeParameterType
  1718. {
  1719. struct AC_EVSEStatusType AC_EVSEStatus;
  1720. struct PhysicalValueType_ISO15118_2014 EVSENominalVoltage;
  1721. struct PhysicalValueType_ISO15118_2014 EVSEMaxCurrent;
  1722. };
  1723. struct DC_EVSEStatusType_ISO15118_2014
  1724. {
  1725. unsigned short NotificationMaxDelay;
  1726. enum EVSENotificationType EVSENotification;
  1727. enum IsolationLevelType_ISO15118_2014 EVSEIsolationStatus; //Optional
  1728. enum DC_EVSEStatusCodeType DC_EVSEStatusCode;
  1729. };
  1730. struct DC_EVSEChargeParameterType_ISO15118_2014
  1731. {
  1732. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1733. struct PhysicalValueType_ISO15118_2014 EVSEMaximumCurrentLimit;
  1734. struct PhysicalValueType_ISO15118_2014 EVSEMaximumPowerLimit;
  1735. struct PhysicalValueType_ISO15118_2014 EVSEMaximumVoltageLimit;
  1736. struct PhysicalValueType_ISO15118_2014 EVSEMinimumCurrentLimit;
  1737. struct PhysicalValueType_ISO15118_2014 EVSEMinimumVoltageLimit;
  1738. struct PhysicalValueType_ISO15118_2014 EVSECurrentRegulationTolerance; //Optional
  1739. struct PhysicalValueType_ISO15118_2014 EVSEPeakCurrentRipple;
  1740. struct PhysicalValueType_ISO15118_2014 EVSEEnergyToBeDelivered; //Optional
  1741. };
  1742. struct Scheduled_CPDResControlModeType
  1743. {
  1744. struct ScheduleListType ScheduleList;
  1745. };
  1746. struct AC_CPDResEnergyTransferModeType
  1747. {
  1748. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent[3];
  1749. struct PhysicalValueType_ISO15118_2018 EVSENominalVoltage;
  1750. struct PhysicalValueType_ISO15118_2018 EVSENominalFrequency;
  1751. };
  1752. struct DC_CPDResEnergyTransferModeType
  1753. {
  1754. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower;
  1755. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent;
  1756. struct PhysicalValueType_ISO15118_2018 EVSEMinimumChargeCurrent;
  1757. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage;
  1758. struct PhysicalValueType_ISO15118_2018 EVSEMinimumVoltage;
  1759. };
  1760. struct BPT_AC_CPDResEnergyTransferModeType
  1761. {
  1762. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent[3];
  1763. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargeCurrent[3];
  1764. struct PhysicalValueType_ISO15118_2018 EVSENominalVoltage;
  1765. struct PhysicalValueType_ISO15118_2018 EVSENominalFrequency;
  1766. };
  1767. struct BPT_DC_CPDResEnergyTransferModeType
  1768. {
  1769. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower;
  1770. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargePower;
  1771. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent;
  1772. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargeCurrent;
  1773. struct PhysicalValueType_ISO15118_2018 EVSEMinimumChargeCurrent;
  1774. struct PhysicalValueType_ISO15118_2018 EVSEMinimumDischargeCurrent;
  1775. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage;
  1776. struct PhysicalValueType_ISO15118_2018 EVSEMinimumVoltage;
  1777. };
  1778. struct WPT_CPDResEnergyTransferModeType
  1779. {
  1780. struct PhysicalValueType_ISO15118_2018 EVSEMaximumPower;
  1781. struct PhysicalValueType_ISO15118_2018 EVSEMinimumPower;
  1782. };
  1783. struct ACD_CPDResEnergyTransferModeType
  1784. {
  1785. //not found in ISO15118_2018
  1786. };
  1787. struct ProfileEntryType_DIN70121
  1788. {
  1789. unsigned int ChargingProfileEntryStart;
  1790. short ChargingProfileEntryMaxPower;
  1791. };
  1792. struct ChargingProfileType_DIN70121
  1793. {
  1794. short SAScheduleTupleID;
  1795. struct ProfileEntryType_DIN70121 ProfileEntry[24];
  1796. };
  1797. struct DC_EVPowerDeliveryParameterType_DIN70121
  1798. {
  1799. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1800. BOOL BulkChargingComplete; //Optional
  1801. BOOL ChargingComplete;
  1802. };
  1803. struct ProfileEntryType_ISO15118_2014
  1804. {
  1805. unsigned int ChargingProfileEntryStart;
  1806. struct PhysicalValueType_ISO15118_2018 ChargingProfileEntryMaxPower;
  1807. unsigned char ChargingProfileEntryMaxNumberOfPhasesInUse; //Optional
  1808. };
  1809. struct ChargingProfileType_ISO15118_2014
  1810. {
  1811. struct ProfileEntryType_ISO15118_2014 ProfileEntry[24];
  1812. };
  1813. struct DC_EVPowerDeliveryParameterType_ISO15118_2014
  1814. {
  1815. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1816. BOOL BulkChargingComplete; //Optional
  1817. BOOL ChargingComplete;
  1818. };
  1819. struct TimeInterval
  1820. {
  1821. unsigned int start;
  1822. unsigned int duration; //Optional
  1823. };
  1824. struct PowerScheduleEntryType
  1825. {
  1826. struct TimeInterval TimeInterval;
  1827. struct PhysicalValueType_ISO15118_2018 Power[3];
  1828. };
  1829. struct EVPowerProfileType
  1830. {
  1831. struct PowerScheduleEntryType EVPowerProfileEntry[2048];
  1832. };
  1833. struct Scheduled_PDReqControlModeType
  1834. {
  1835. unsigned char ScheduleTupleID;
  1836. struct EVPowerProfileType EVPowerProfile;
  1837. };
  1838. struct BPT_Scheduled_PDReqControlModeType
  1839. {
  1840. unsigned char ScheduleTupleID;
  1841. struct EVPowerProfileType EVPowerProfile; //Optional
  1842. enum evOperationType EVOperation;
  1843. };
  1844. struct ListOfRootCertificateIDsType
  1845. {
  1846. unsigned char RootCertificateID[20][40];
  1847. };
  1848. struct ContractSignatureEncryptedPrivateKeyType
  1849. {
  1850. unsigned char Id[32];
  1851. };
  1852. struct DiffieHellmanPublickeyType
  1853. {
  1854. unsigned char Id[32];
  1855. };
  1856. struct ContractCertificateEncryptedPrivateKeyType
  1857. {
  1858. unsigned char Id[32];
  1859. };
  1860. struct EVTechnicalStatusType
  1861. {
  1862. BOOL EV_Status_ReadyToCharge;
  1863. BOOL EV_Status_ImmobilizationRequest; //Optional
  1864. BOOL EV_Status_Immobilized;
  1865. struct PhysicalValueType_ISO15118_2018 EV_Status_WLAN_Strength;
  1866. enum EV_CP_StatusType EV_CP_Status;
  1867. unsigned char EV_Status_RESSSOC; //0~100%
  1868. enum EV_Error_Status_CodeType EV_Error_Status_Code;
  1869. BOOL EVSE_Timeout;
  1870. };
  1871. struct MeterInfoType_ISO15118_2014
  1872. {
  1873. unsigned char MeterID[32];
  1874. unsigned long MeterReading; //Optional
  1875. unsigned char SigMeterReading[64]; //Optional
  1876. short MeterStatus; //Optional
  1877. short TMeter; //Optional
  1878. };
  1879. struct Scheduled_MRReqControlModeType
  1880. {
  1881. unsigned char ScheduleTupleID;
  1882. };
  1883. struct MeterInfoType_ISO15118_2018
  1884. {
  1885. unsigned char MeterID[32];
  1886. unsigned long MeterReadingWhCharged; //Optional
  1887. unsigned long MeterReadingWhDischarged; //Optional
  1888. unsigned long MeterReadingVARhLeading; //Optional
  1889. unsigned long MeterReadingVARhLagging; //Optional
  1890. unsigned char SignatureMeterReading[64]; //Optional
  1891. short MeterStatus; //Optional
  1892. short TimeStampMeter; //Optional
  1893. BOOL ReceiptRequired; //Optional
  1894. };
  1895. struct PnC_CLReqIdentificationModeType
  1896. {
  1897. BOOL MeteringReceiptRequested;
  1898. };
  1899. struct Dynamic_CSReqControlModeType
  1900. {
  1901. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest;
  1902. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest;
  1903. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest;
  1904. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1905. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1906. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1907. };
  1908. struct Scheduled_CSReqControlModeType
  1909. {
  1910. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1911. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1912. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1913. BOOL Standby;
  1914. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower; //Optional
  1915. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent; //Optional
  1916. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent; //Optional
  1917. };
  1918. struct DisplayParametersType
  1919. {
  1920. unsigned short CurrentRange;
  1921. unsigned char CurrentSOC; //0~100%
  1922. unsigned char MinimumSOC; //0~100%
  1923. struct PhysicalValueType_ISO15118_2018 RemainingTimeToMaximumSOC;
  1924. struct PhysicalValueType_ISO15118_2018 RemainingTimeToTargetSOC;
  1925. struct PhysicalValueType_ISO15118_2018 RemainingTimeToBulkSOC;
  1926. struct PhysicalValueType_ISO15118_2018 RemainingTimeToMinimumSOC;
  1927. BOOL ChargingComplete;
  1928. BOOL BulkChargingComplete;
  1929. BOOL InletHot;
  1930. };
  1931. struct PnC_CLResIdentificationModeType
  1932. {
  1933. struct MeterInfoType_ISO15118_2018 MeterInfo;
  1934. };
  1935. struct Dynamic_CSResControlModeType
  1936. {
  1937. struct PhysicalValueType_ISO15118_2018 EVSETargetActivePower;
  1938. };
  1939. struct Scheduled_CDResControlModeType
  1940. {
  1941. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower; //Optional
  1942. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent; //Optional
  1943. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage; //Optional
  1944. };
  1945. struct LFA_EVFinePositioningSetupParametersType
  1946. {
  1947. unsigned char NumberOfSensors;
  1948. //NOT complete yet, to be continue.....
  1949. };
  1950. /****SupportedAppProtocolRequest****/
  1951. struct SupportedAppProtocolRequest_DIN70121
  1952. {
  1953. struct AppProtocolType AppProtocol[20];
  1954. };
  1955. struct SupportedAppProtocolRequest_ISO15118_2014
  1956. {
  1957. struct AppProtocolType AppProtocol[20];
  1958. };
  1959. struct SupportedAppProtocolRequest_ISO15118_2018
  1960. {
  1961. struct AppProtocolType AppProtocol[20];
  1962. };
  1963. /****SupportedAppProtocolResponse****/
  1964. struct SupportedAppProtocolResponse_DIN70121
  1965. {
  1966. enum ResponseCodeType_DIN70121 ResponseCode;
  1967. unsigned char SchemaID; //Optional
  1968. };
  1969. struct SupportedAppProtocolResponse_ISO15118_2014
  1970. {
  1971. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1972. unsigned char SchemaID; //Optional
  1973. };
  1974. struct SupportedAppProtocolResponse_ISO15118_2018
  1975. {
  1976. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1977. unsigned char SchemaID; //Optional
  1978. };
  1979. /****SessionSetupRequest****/
  1980. struct SessionSetupRequest_DIN70121
  1981. {
  1982. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1983. };
  1984. struct SessionSetupRequest_ISO15118_2014
  1985. {
  1986. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1987. };
  1988. struct SessionSetupRequest_ISO15118_2018
  1989. {
  1990. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1991. struct ACD_SSEnergyTransferModeType ACD_SSEnergyTransferMode; //For ACD mandatory, optional for rest
  1992. };
  1993. /****SessionSetupResponse****/
  1994. struct SessionSetupResponse_DIN70121
  1995. {
  1996. enum ResponseCodeType_DIN70121 ResponseCode;
  1997. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1998. unsigned int EVSETimeStamp; //EPOCH format, Optional
  1999. };
  2000. struct SessionSetupResponse_ISO15118_2014
  2001. {
  2002. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2003. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2004. unsigned int EVSETimeStamp; //EPOCH format, Optional
  2005. };
  2006. struct SessionSetupResponse_ISO15118_2018
  2007. {
  2008. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2009. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2010. struct EVSEStatusType EVSEStatus; //Optional
  2011. };
  2012. /****ServiceDiscoveryRequest****/
  2013. struct ServiceDiscoveryRequest_DIN70121
  2014. {
  2015. unsigned char ServiceScope[32]; //Optional
  2016. enum ServiceCategoryType ServiceCategory; //Optional
  2017. };
  2018. struct ServiceDiscoveryRequest_ISO15118_2014
  2019. {
  2020. unsigned char ServiceScope[32]; //Optional
  2021. enum ServiceCategoryType ServiceCategory; //Optional
  2022. };
  2023. struct ServiceDiscoveryRequest_ISO15118_2018
  2024. {
  2025. struct ServiceIDListType SupportedServiceIDs; //Optional
  2026. };
  2027. /****ServiceDiscoveryResponse****/
  2028. struct ServiceDiscoveryResponse_DIN70121
  2029. {
  2030. enum ResponseCodeType_DIN70121 ResponseCode;
  2031. struct PaymentOptionListType PaymentOptions;
  2032. struct ServiceChargeType ChargeService_DIN70121;
  2033. };
  2034. struct ServiceDiscoveryResponse_ISO15118_2014
  2035. {
  2036. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2037. struct PaymentOptionListType PaymentOptions;
  2038. struct ChargeServiceType ChargeService;
  2039. struct ServiceListType ServiceList; //Optional
  2040. };
  2041. struct ServiceDiscoveryResponse_ISO15118_2018
  2042. {
  2043. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2044. struct EVSEStatusType EVSEStatus; //Optional
  2045. struct IdentificationOptionListType IdentificationOptionList;
  2046. struct ServiceListType EnergyTransferServiceList;
  2047. struct ServiceListType VASList; //Optional
  2048. };
  2049. /****ServiceDetailRequest****/
  2050. //Only in ISO15118_2014 and ISO15118_2018
  2051. struct ServiceDetailRequest_ISO15118_2014
  2052. {
  2053. unsigned short ServiceID;
  2054. };
  2055. struct ServiceDetailRequest_ISO15118_2018
  2056. {
  2057. unsigned short ServiceID;
  2058. struct WPT_SDlEnergyTransferModeType WPT_SDlEnergyTransferMode;
  2059. };
  2060. /****ServiceDetailResponse****/
  2061. struct ServiceDetailResponse_ISO15118_2014
  2062. {
  2063. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2064. unsigned short ServiceID;
  2065. struct ServiceParameterListType ServiceParameterList;
  2066. };
  2067. struct ServiceDetailResponse_ISO15118_2018
  2068. {
  2069. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2070. unsigned short ServiceID;
  2071. struct ServiceParameterListType ServiceParameterList;
  2072. struct EVSEStatusType EVSEStatus; //Optional
  2073. };
  2074. /****ServiceAndPaymentSelectionRequest / ServiceSelectionRequest****/
  2075. struct ServiceAndPaymentSelectionRequest_DIN70121
  2076. {
  2077. enum PaymentOptionType SelectedPaymentOption;
  2078. struct SelectedServiceListType SelectedServiceList;
  2079. };
  2080. struct ServiceAndPaymentSelectionRequest_ISO15118_2014
  2081. {
  2082. enum PaymentOptionType SelectedPaymentOption;
  2083. struct SelectedServiceListType SelectedServiceList;
  2084. };
  2085. struct ServiceSelectionRequest_ISO15118_2018
  2086. {
  2087. enum PaymentOptionType SelectedPaymentOption;
  2088. struct SelectedServiceType SelectedEnergyTransferService;
  2089. struct SelectedServiceListType SelectedVASList;
  2090. enum ProcessingType EVProcessing;
  2091. };
  2092. /****ServiceAndPaymentSelectionResponse / ServiceSelectionResponse****/
  2093. struct ServiceAndPaymentSelectionResponse_DIN70121
  2094. {
  2095. enum ResponseCodeType_DIN70121 ResponseCode;
  2096. };
  2097. struct ServiceAndPaymentSelectionResponse_ISO15118_2014
  2098. {
  2099. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2100. };
  2101. struct ServiceSelectionResponse_ISO15118_2018
  2102. {
  2103. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2104. struct EVSEStatusType EVSEStatus; //Optional
  2105. };
  2106. /****PaymentDetailsRequest / IdentificationDetailsRequest****/
  2107. struct PaymentDetailsRequest_ISO15118_2014
  2108. {
  2109. unsigned char eMAID[16];
  2110. struct CertificateChainType ContractSignatureCertChain;
  2111. };
  2112. struct IdentificationDetailsRequest_ISO15118_2018
  2113. {
  2114. struct CertificateChainType ContractSignatureCertChain;
  2115. };
  2116. /****PaymentDetailsResponse / IdentificationDetailsResponse ****/
  2117. struct PaymentDetailsResponse_ISO15118_2014
  2118. {
  2119. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2120. unsigned char GenChallenge[16];
  2121. long EVSETimeStamp;
  2122. };
  2123. struct IdentificationDetailsResponse_ISO15118_2018
  2124. {
  2125. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2126. struct EVSEStatusType EVSEStatus; //Optional
  2127. unsigned char GenChallenge[16];
  2128. enum ProcessingType EVSEProcessing;
  2129. };
  2130. /****ContractAuthenticationRequest / AuthorizationRequest****/
  2131. struct ContractAuthenticationRequest_DIN70121
  2132. {
  2133. //None
  2134. };
  2135. struct AuthorizationRequest_ISO15118_2014
  2136. {
  2137. unsigned char GenChallenge[16]; //Optional
  2138. unsigned char Id[32]; //Optional
  2139. };
  2140. struct AuthorizationRequest_ISO15118_2018
  2141. {
  2142. struct PNC_AReqIdentificationModeType PNC_AReqIdentificationMode; //Optional
  2143. };
  2144. /****ContractAuthenticationResponse / AuthorizationResponse****/
  2145. struct ContractAuthenticationResponse_DIN70121
  2146. {
  2147. enum ResponseCodeType_DIN70121 ResponseCode;
  2148. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  2149. };
  2150. struct AuthorizationResponse_ISO15118_2014
  2151. {
  2152. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2153. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  2154. };
  2155. struct AuthorizationResponse_ISO15118_2018
  2156. {
  2157. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2158. enum ProcessingType EVSEProcessing;
  2159. struct EVSEStatusType EVSEStatus; //Optional
  2160. };
  2161. /****ChargeParameterDiscoveryRequest****/
  2162. struct ChargeParameterDiscoveryRequest_DIN70121
  2163. {
  2164. enum EnergyTransferModeType EVRequestedEnergyTransferType;
  2165. struct DC_EVChargeParameterType_DIN70121 DC_EVChargeParameter;
  2166. };
  2167. struct ChargeParameterDiscoveryRequest_ISO15118_2014
  2168. {
  2169. unsigned short MaxEntriesSAScheduleTuple; //Optional
  2170. enum EnergyTransferModeType RequestedEnergyTransferMode;
  2171. struct AC_EVChargeParameterType AC_EVChargeParameter;
  2172. struct DC_EVChargeParameterType_ISO15118_2014 DC_EVChargeParameter;
  2173. };
  2174. struct ChargeParameterDiscoveryRequest_ISO15118_2018
  2175. {
  2176. struct Dynamic_CPDReqControlModeType Dynamic_CPDReqControlMode;
  2177. struct Scheduled_CPDReqControlModeType Scheduled_CPDReqControlMode;
  2178. struct AC_CPDReqEnergyTransferModeType AC_CPDReqEnergyTransferMode;
  2179. struct DC_CPDReqEnergyTransferModeType DC_CPDReqEnergyTransferMode;
  2180. struct BPT_AC_CPDReqEnergyTransferModeType BPT_AC_CPDReqEnergyTransferMode;
  2181. struct BPT_DC_CPDReqEnergyTransferModeType BPT_DC_CPDReqEnergyTransferMode;
  2182. struct WPT_CPDReqEnergyTransferModeType WPT_CPDReqEnergyTransferMode;
  2183. struct ACD_CPDReqEnergyTransferModeType ACD_CPDReqEnergyTransferMode;
  2184. };
  2185. /****ChargeParameterDiscoveryResponse****/
  2186. struct ChargeParameterDiscoveryResponse_DIN70121
  2187. {
  2188. enum ResponseCodeType_DIN70121 ResponseCode;
  2189. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  2190. struct SAScheduleListType SAScheduleList;
  2191. struct DC_EVSEChargeParameterType_DIN70121 DC_EVSEChargeParameter;
  2192. };
  2193. struct ChargeParameterDiscoveryResponse_ISO15118_2014
  2194. {
  2195. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  2196. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2197. struct SAScheduleListType SAScheduleList;
  2198. struct AC_EVSEChargeParameterType AC_EVSEChargeParameter;
  2199. struct DC_EVSEChargeParameterType_ISO15118_2014 DC_EVSEChargeParameter;
  2200. };
  2201. struct ChargeParameterDiscoveryResponse_ISO15118_2018
  2202. {
  2203. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2204. struct EVSEStatusType EVSEStatus; //Optional
  2205. enum ProcessingType EVSEProcessing;
  2206. struct Scheduled_CPDResControlModeType Scheduled_CPDResControlMode; //Optional
  2207. struct AC_CPDResEnergyTransferModeType AC_CPDResEnergyTransferMode;
  2208. struct DC_CPDResEnergyTransferModeType DC_CPDResEnergyTransferMode;
  2209. struct BPT_AC_CPDResEnergyTransferModeType BPT_AC_CPDResEnergyTransferMode;
  2210. struct BPT_DC_CPDResEnergyTransferModeType BPT_DC_CPDResEnergyTransferMode;
  2211. struct WPT_CPDResEnergyTransferModeType WPT_CPDResEnergyTransferMode;
  2212. struct ACD_CPDResEnergyTransferModeType ACD_CPDResEnergyTransferMode;
  2213. };
  2214. /****PowerDeliveryRequest****/
  2215. struct PowerDeliveryRequest_DIN70121
  2216. {
  2217. BOOL ReadyToChargeState;
  2218. struct ChargingProfileType_DIN70121 ChargingProfile;
  2219. struct DC_EVPowerDeliveryParameterType_DIN70121 DC_EVPowerDeliveryParameter;
  2220. };
  2221. struct PowerDeliveryRequest_ISO15118_2014
  2222. {
  2223. enum ChargeProgressType_ISO15118_2014 ChargeProgress;
  2224. short SAScheduleTupleID;
  2225. struct ChargingProfileType_ISO15118_2014 ChargingProfile;
  2226. struct DC_EVPowerDeliveryParameterType_ISO15118_2014 DC_EVPowerDeliveryParameter;
  2227. };
  2228. struct PowerDeliveryRequest_ISO15118_2018
  2229. {
  2230. enum ChargeProgressType_ISO15118_2018 ChargeProgress;
  2231. struct Scheduled_PDReqControlModeType Scheduled_PDReqControlMode;
  2232. struct BPT_Scheduled_PDReqControlModeType BPT_Scheduled_PDReqControlMode;
  2233. };
  2234. /****PowerDeliveryResponse****/
  2235. struct PowerDeliveryResponse_DIN70121
  2236. {
  2237. enum ResponseCodeType_DIN70121 ResponseCode;
  2238. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2239. };
  2240. struct PowerDeliveryResponse_ISO15118_2014
  2241. {
  2242. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2243. struct AC_EVSEStatusType AC_EVSEStatus;
  2244. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2245. };
  2246. struct PowerDeliveryResponse_ISO15118_2018
  2247. {
  2248. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2249. struct EVSEStatusType EVSEStatus; //Optional
  2250. };
  2251. /****CertificateUpdateRequest****/
  2252. struct CertificateUpdateRequest_ISO15118_2014
  2253. {
  2254. unsigned char Id[32];
  2255. struct CertificateChainType ContractSignatureCertChain;
  2256. unsigned char eMAID[16];
  2257. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  2258. };
  2259. /****CertificateUpdateResponse****/
  2260. struct CertificateUpdateResponse_ISO15118_2014
  2261. {
  2262. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2263. struct CertificateChainType SAProvisioningCertificateChain;
  2264. struct CertificateChainType ContractSignatureCertChain;
  2265. struct ContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey;
  2266. struct DiffieHellmanPublickeyType DHpublickey;
  2267. unsigned char eMAID[16];
  2268. short RetryCounter; //Optional
  2269. };
  2270. /****CertificateInstallationRequest****/
  2271. struct CertificateInstallationRequest_ISO15118_2014
  2272. {
  2273. unsigned char Id[32];
  2274. unsigned char OEMProvisioningCert[800];
  2275. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  2276. };
  2277. struct CertificateInstallationRequest_ISO15118_2018
  2278. {
  2279. unsigned char Id[32];
  2280. struct CertificateChainType OEMProvisioningCertChain;
  2281. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  2282. unsigned short MaxSupportedCerts;
  2283. };
  2284. /****CertificateInstallationResponse****/
  2285. struct CertificateInstallationResponse_ISO15118_2014
  2286. {
  2287. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2288. struct CertificateChainType SAProvisioningCertificateChain;
  2289. struct CertificateChainType ContractSignatureCertChain;
  2290. struct ContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey;
  2291. struct DiffieHellmanPublickeyType DHpublickey;
  2292. unsigned char eMAID[16];
  2293. };
  2294. struct CertificateInstallationResponse_ISO15118_2018
  2295. {
  2296. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2297. struct EVSEStatusType EVSEStatus; //Optional
  2298. struct CertificateChainType SAProvisioningCertificateChain;
  2299. struct CertificateChainType ContractCertificateChain;
  2300. struct ContractCertificateEncryptedPrivateKeyType ContractEncryptedPrivateKey;
  2301. struct DiffieHellmanPublickeyType DHpublickey;
  2302. enum ProcessingType EVSEProcessing;
  2303. unsigned short RemainingContractCertificateChains;
  2304. };
  2305. /****SystemStatusRequest****/
  2306. struct SystemStatusRequest_ISO15118_2018
  2307. {
  2308. enum mechanicalChargingDeviceStatusType EVMechanicalChargingDeviceStatus;
  2309. struct EVTechnicalStatusType EVTechnicalStatus;
  2310. unsigned char EV_OEMStatus[800]; //Optional
  2311. };
  2312. /****SystemStatusResponse****/
  2313. struct SystemStatusResponse_ISO15118_2018
  2314. {
  2315. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2316. enum mechanicalChargingDeviceStatusType EVSEMechanicalChargingDeviceStatus;
  2317. BOOL EVSE_ReadyToCharge;
  2318. enum IsolationStatusType EVSE_IsolationStatus;
  2319. BOOL EVSE_Disabled;
  2320. BOOL EVSE_UtilityInterruptEvent;
  2321. BOOL EVSE_EmergencyShutdown;
  2322. BOOL EVSE_Malfunction;
  2323. BOOL EV_InChargePosition;
  2324. BOOL EV_AssociationStatus;
  2325. };
  2326. /****SessionStopRequest****/
  2327. struct SessionStopRequest_DIN70121
  2328. {
  2329. //No member in standard
  2330. };
  2331. struct SessionStopRequest_ISO15118_2014
  2332. {
  2333. enum ChargingSessionType ChargingSession;
  2334. };
  2335. struct SessionStopRequest_ISO15118_2018
  2336. {
  2337. enum ChargingSessionType ChargingSession;
  2338. };
  2339. /****SessionStopResponse****/
  2340. struct SessionStopResponse_DIN70121
  2341. {
  2342. enum ResponseCodeType_DIN70121 ResponseCode;
  2343. };
  2344. struct SessionStopResponse_ISO15118_2014
  2345. {
  2346. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2347. };
  2348. struct SessionStopResponse_ISO15118_2018
  2349. {
  2350. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2351. struct EVSEStatusType EVSEStatus; //Optional
  2352. };
  2353. /****MeteringReceiptRequest****/
  2354. struct MeteringReceiptRequest_ISO15118_2014
  2355. {
  2356. unsigned char Id[32]; //Optional
  2357. unsigned char SessionID[8];
  2358. short SAScheduleTupleID; //Optional
  2359. struct MeterInfoType_ISO15118_2014 MeterInfo;
  2360. };
  2361. struct MeteringReceiptRequest_ISO15118_2018
  2362. {
  2363. unsigned char Id[32]; //Optional
  2364. unsigned char SessionID[8];
  2365. struct Scheduled_MRReqControlModeType Schedule_MRReqControlMode;
  2366. struct MeterInfoType_ISO15118_2018 MeterInfo;
  2367. };
  2368. /****MeteringReceiptResponse****/
  2369. struct MeteringReceiptResponse_ISO15118_2014
  2370. {
  2371. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2372. struct AC_EVSEStatusType AC_EVSEStatus;
  2373. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2374. };
  2375. struct MeteringReceiptResponse_ISO15118_2018
  2376. {
  2377. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2378. struct EVSEStatusType EVSEStatus; //Optional
  2379. };
  2380. /****ChargingStatusRequest (AC Only)****/
  2381. struct ChargingStatusRequest_ISO15118_2014
  2382. {
  2383. //No member in standard
  2384. };
  2385. struct ChargingStatusRequest_ISO15118_2018
  2386. {
  2387. struct PnC_CLReqIdentificationModeType PnC_CLReqIdentificationMode;
  2388. struct Dynamic_CSReqControlModeType Dynamic_CSReqControlMode;
  2389. struct Scheduled_CSReqControlModeType Scheduled_CSReqControlMode;
  2390. struct DisplayParametersType DisplayParameters;
  2391. };
  2392. /****ChargingStatusResponse (AC Only)****/
  2393. struct ChargingStatusResponse_ISO15118_2014
  2394. {
  2395. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2396. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2397. short SAScheduleTupleID;
  2398. struct PhysicalValueType_ISO15118_2014 EVSEMaxCurrent; //Optional
  2399. struct MeterInfoType_ISO15118_2014 MeterInfo; //Optional
  2400. BOOL ReceiptRequired; //Optional
  2401. struct AC_EVSEStatusType AC_EVSEStatus;
  2402. };
  2403. struct ChargingStatusResponse_ISO15118_2018
  2404. {
  2405. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2406. struct EVSEStatusType EVSEStatus; //Optional
  2407. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2408. struct PhysicalValueType_ISO15118_2018 EVSETargetFrequency; //Optional
  2409. struct PnC_CLResIdentificationModeType PnC_CLResIdentificationMode;
  2410. struct Dynamic_CSResControlModeType Dynamic_CSResControlMode;
  2411. struct Scheduled_CSReqControlModeType Scheduled_CSReqControlMode;
  2412. };
  2413. /****CableCheckRequest (DC Only)****/
  2414. struct CableCheckRequest_DIN70121
  2415. {
  2416. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  2417. };
  2418. struct CableCheckRequest_ISO15118_2014
  2419. {
  2420. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  2421. };
  2422. struct CableCheckRequest_ISO15118_2018
  2423. {
  2424. //No member in standard
  2425. };
  2426. /****CableCheckResponse (DC Only)****/
  2427. struct CableCheckResponse_DIN70121
  2428. {
  2429. enum ResponseCodeType_DIN70121 ResponseCode;
  2430. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2431. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  2432. };
  2433. struct CableCheckResponse_ISO15118_2014
  2434. {
  2435. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2436. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2437. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  2438. };
  2439. struct CableCheckResponse_ISO15118_2018
  2440. {
  2441. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2442. struct EVSEStatusType EVSEStatus; //Optional
  2443. enum ProcessingType EVSEProcessing;
  2444. };
  2445. /****PreChargeRequest (DC Only)****/
  2446. struct PreChargeRequest_DIN70121
  2447. {
  2448. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  2449. struct PhysicalValueType_DIN70121 EVTargetVoltage;
  2450. struct PhysicalValueType_DIN70121 EVTargetCurrent;
  2451. };
  2452. struct PreChargeRequest_ISO15118_2014
  2453. {
  2454. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  2455. struct PhysicalValueType_ISO15118_2014 EVTargetVoltage;
  2456. struct PhysicalValueType_ISO15118_2014 EVTargetCurrent;
  2457. };
  2458. struct PreChargeRequest_ISO15118_2018
  2459. {
  2460. struct PhysicalValueType_ISO15118_2018 EVTargetVoltage;
  2461. struct PhysicalValueType_ISO15118_2018 EVTargetCurrent;
  2462. };
  2463. /****PreChargeResponse (DC Only)****/
  2464. struct PreChargeResponse_DIN70121
  2465. {
  2466. enum ResponseCodeType_DIN70121 ResponseCode;
  2467. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2468. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  2469. };
  2470. struct PreChargeResponse_ISO15118_2014
  2471. {
  2472. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2473. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2474. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  2475. };
  2476. struct PreChargeResponse_ISO15118_2018
  2477. {
  2478. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2479. struct EVSEStatusType EVSEStatus; //Optional
  2480. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  2481. };
  2482. /****CurrentDemandRequest (DC Only)****/
  2483. struct CurrentDemandRequest_DIN70121
  2484. {
  2485. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  2486. struct PhysicalValueType_DIN70121 EVTargetCurrent;
  2487. struct PhysicalValueType_DIN70121 EVMaximumVoltageLimit; //Optional
  2488. struct PhysicalValueType_DIN70121 EVMaximumCurrentLimit; //Optional
  2489. struct PhysicalValueType_DIN70121 EVMaximumPowerLimit; //Optional
  2490. BOOL BulkChargingComplete; //Optional
  2491. BOOL ChargingComplete;
  2492. struct PhysicalValueType_DIN70121 RemainingTimeToFullSoC; //Optional
  2493. struct PhysicalValueType_DIN70121 RemainingTimeToBulkSoC; //Optional
  2494. struct PhysicalValueType_DIN70121 EVTargetVoltage;
  2495. };
  2496. struct CurrentDemandRequest_ISO15118_2014
  2497. {
  2498. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  2499. struct PhysicalValueType_ISO15118_2014 EVTargetCurrent;
  2500. struct PhysicalValueType_ISO15118_2014 EVMaximumVoltageLimit; //Optional
  2501. struct PhysicalValueType_ISO15118_2014 EVMaximumCurrentLimit; //Optional
  2502. struct PhysicalValueType_ISO15118_2014 EVMaximumPowerLimit; //Optional
  2503. BOOL BulkChargingComplete; //Optional
  2504. BOOL ChargingComplete;
  2505. struct PhysicalValueType_ISO15118_2014 RemainingTimeToFullSoC; //Optional
  2506. struct PhysicalValueType_ISO15118_2014 RemainingTimeToBulkSoC; //Optional
  2507. struct PhysicalValueType_ISO15118_2014 EVTargetVoltage;
  2508. };
  2509. struct CurrentDemandRequest_ISO15118_2018
  2510. {
  2511. struct DisplayParametersType DisplayParameters; //Optional
  2512. struct PnC_CLReqIdentificationModeType PnC_CLReqIdentificationMode;
  2513. struct Dynamic_CSReqControlModeType Dynamic_CDReqControlMode;
  2514. struct Scheduled_CSReqControlModeType Scheduled_CDReqControlMode;
  2515. };
  2516. /****CurrentDemandResponse (DC Only)****/
  2517. struct CurrentDemandResponse_DIN70121
  2518. {
  2519. enum ResponseCodeType_DIN70121 ResponseCode;
  2520. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2521. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  2522. struct PhysicalValueType_DIN70121 EVSEPresentCurrent;
  2523. BOOL EVSECurrentLimitAchieved;
  2524. BOOL EVSEVoltageLimitAchieved;
  2525. BOOL EVSEPowerLimitAchieved;
  2526. struct PhysicalValueType_DIN70121 EVSEMaximumVoltageLimit; //Optional
  2527. struct PhysicalValueType_DIN70121 EVSEMaximumCurrentLimit; //Optional
  2528. struct PhysicalValueType_DIN70121 EVSEMaximumPowerLimit; //Optional
  2529. };
  2530. struct CurrentDemandResponse_ISO15118_2014
  2531. {
  2532. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2533. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2534. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  2535. struct PhysicalValueType_ISO15118_2014 EVSEPresentCurrent;
  2536. BOOL EVSECurrentLimitAchieved;
  2537. BOOL EVSEVoltageLimitAchieved;
  2538. BOOL EVSEPowerLimitAchieved;
  2539. struct PhysicalValueType_ISO15118_2014 EVSEMaximumVoltageLimit; //Optional
  2540. struct PhysicalValueType_ISO15118_2014 EVSEMaximumCurrentLimit; //Optional
  2541. struct PhysicalValueType_ISO15118_2014 EVSEMaximumPowerLimit; //Optional
  2542. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2543. short SAScheduleTupleID;
  2544. struct MeterInfoType_ISO15118_2014 MeterInfo; //Optional
  2545. BOOL ReceiptRequired; //Optional
  2546. };
  2547. struct CurrentDemandResponse_ISO15118_2018
  2548. {
  2549. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2550. struct EVSEStatusType EVSEStatus; //Optional
  2551. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  2552. struct PhysicalValueType_ISO15118_2018 EVSEPresentCurrent;
  2553. BOOL EVSECurrentLimitAchieved;
  2554. BOOL EVSEVoltageLimitAchieved;
  2555. BOOL EVSEPowerLimitAchieved;
  2556. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeVoltage; //Optional
  2557. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent; //Optional
  2558. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower; //Optional
  2559. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2560. struct PnC_CLResIdentificationModeType PnC_CLResIdentificationMode;
  2561. struct Scheduled_CDResControlModeType Scheduled_CDResControlMode;
  2562. };
  2563. /****WeldingDetectionRequest (DC Only)*****/
  2564. struct WeldingDetectionRequest_DIN70121
  2565. {
  2566. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  2567. };
  2568. struct WeldingDetectionRequest_ISO15118_2014
  2569. {
  2570. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  2571. };
  2572. struct WeldingDetectionRequest_ISO15118_2018
  2573. {
  2574. //No member in Standard
  2575. };
  2576. /****WeldingDetectionResponse (DC Only)****/
  2577. struct WeldingDetectionResponse_DIN70121
  2578. {
  2579. enum ResponseCodeType_DIN70121 ResponseCode;
  2580. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2581. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  2582. };
  2583. struct WeldingDetectionResponse_ISO15118_2014
  2584. {
  2585. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2586. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2587. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  2588. };
  2589. struct WeldingDetectionResponse_ISO15118_2018
  2590. {
  2591. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2592. struct EVSEStatusType EVSEStatus; //Optional
  2593. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  2594. };
  2595. /****FinePositioningSetupRequest (WPT Only)****/
  2596. struct FinePositioningSetupRequest_ISO15118_2018
  2597. {
  2598. struct LFA_EVFinePositioningSetupParametersType LFA_EVFinePositioningSetupParameters; //Optional
  2599. };
  2600. /****FinePositioningSetupResponse (WPT Only)****/
  2601. struct FinePositioningSetupResponse_ISO15118_2018
  2602. {
  2603. //NOT complete yet, to be continue.....
  2604. };
  2605. struct V2GMessageType_DIN70121
  2606. {
  2607. unsigned char SelfTest_Comp;
  2608. unsigned char version[16];
  2609. unsigned char PresentMsgFlowStatus;
  2610. /* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2611. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2612. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2613. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2614. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2615. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2616. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2617. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2618. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2619. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2620. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2621. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2622. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2623. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2624. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2625. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2626. 52: SessionStopRequest, 53: SessionStopResponse
  2627. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2628. */
  2629. struct SupportedAppProtocolRequest_DIN70121 SupportedAppProtocolRequest;
  2630. struct SupportedAppProtocolResponse_DIN70121 SupportedAppProtocolResponse;
  2631. struct SessionSetupRequest_DIN70121 SessionSetupRequest;
  2632. struct SessionSetupResponse_DIN70121 SessionSetupResponse;
  2633. struct ServiceDiscoveryRequest_DIN70121 ServiceDiscoveryRequest;
  2634. struct ServiceDiscoveryResponse_DIN70121 ServiceDiscoveryResponse;
  2635. struct ServiceAndPaymentSelectionRequest_DIN70121 ServiceAndPaymentSelectionRequest;
  2636. struct ServiceAndPaymentSelectionResponse_DIN70121 ServiceAndPaymentSelectionResponse;
  2637. struct ContractAuthenticationRequest_DIN70121 ContractAuthenticationRequest;
  2638. struct ContractAuthenticationResponse_DIN70121 ContractAuthenticationResponse;
  2639. struct ChargeParameterDiscoveryRequest_DIN70121 ChargeParameterDiscoveryRequest;
  2640. struct ChargeParameterDiscoveryResponse_DIN70121 ChargeParameterDiscoveryResponse;
  2641. struct CableCheckRequest_DIN70121 CableCheckRequest;
  2642. struct CableCheckResponse_DIN70121 CableCheckResponse;
  2643. struct PreChargeRequest_DIN70121 PreChargeRequest;
  2644. struct PreChargeResponse_DIN70121 PreChargeResponse;
  2645. struct PowerDeliveryRequest_DIN70121 PowerDeliveryRequest;
  2646. struct PowerDeliveryResponse_DIN70121 PowerDeliveryResponse;
  2647. struct CurrentDemandRequest_DIN70121 CurrentDemandRequest;
  2648. struct CurrentDemandResponse_DIN70121 CurrentDemandResponse;
  2649. struct WeldingDetectionRequest_DIN70121 WeldingDetectionRequest;
  2650. struct WeldingDetectionResponse_DIN70121 WeldingDetectionResponse;
  2651. struct SessionStopRequest_DIN70121 SessionStopRequest;
  2652. struct SessionStopResponse_DIN70121 SessionStopResponse;
  2653. };
  2654. struct V2GMessageType_ISO15118_2014
  2655. {
  2656. unsigned char PresentMsgFlowStatus;
  2657. /* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2658. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2659. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2660. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2661. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2662. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2663. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2664. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2665. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2666. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2667. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2668. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2669. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2670. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2671. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2672. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2673. 52: SessionStopRequest, 53: SessionStopResponse
  2674. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2675. */
  2676. struct SupportedAppProtocolRequest_ISO15118_2014 SupportedAppProtocolRequest;
  2677. struct SupportedAppProtocolResponse_ISO15118_2014 SupportedAppProtocolResponse;
  2678. struct SessionSetupRequest_ISO15118_2014 SessionSetupRequest;
  2679. struct SessionSetupResponse_ISO15118_2014 SessionSetupResponse;
  2680. struct ServiceDiscoveryRequest_ISO15118_2014 ServiceDiscoveryRequest;
  2681. struct ServiceDiscoveryResponse_ISO15118_2014 ServiceDiscoveryResponse;
  2682. struct ServiceDetailRequest_ISO15118_2014 ServiceDetailRequest;
  2683. struct ServiceDetailResponse_ISO15118_2014 ServiceDetailResponse;
  2684. struct ServiceAndPaymentSelectionRequest_ISO15118_2014 ServiceAndPaymentSelectionRequest;
  2685. struct ServiceAndPaymentSelectionResponse_ISO15118_2014 ServiceAndPaymentSelectionResponse;
  2686. struct PaymentDetailsRequest_ISO15118_2014 PaymentDetailsRequest;
  2687. struct PaymentDetailsResponse_ISO15118_2014 PaymentDetailsResponse;
  2688. struct AuthorizationRequest_ISO15118_2014 AuthorizationRequest;
  2689. struct AuthorizationResponse_ISO15118_2014 AuthorizationResponse;
  2690. struct CertificateUpdateRequest_ISO15118_2014 CertificateUpdateRequest;
  2691. struct CertificateUpdateResponse_ISO15118_2014 CertificateUpdateResponse;
  2692. struct CertificateInstallationRequest_ISO15118_2014 CertificateInstallationRequest;
  2693. struct CertificateInstallationResponse_ISO15118_2014 CertificateInstallationResponse;
  2694. struct ChargeParameterDiscoveryRequest_ISO15118_2014 ChargeParameterDiscoveryRequest;
  2695. struct ChargeParameterDiscoveryResponse_ISO15118_2014 ChargeParameterDiscoveryResponse;
  2696. struct CableCheckRequest_ISO15118_2014 CableCheckRequest;
  2697. struct CableCheckResponse_ISO15118_2014 CableCheckResponse;
  2698. struct PreChargeRequest_ISO15118_2014 PreChargeRequest;
  2699. struct PreChargeResponse_ISO15118_2014 PreChargeResponse;
  2700. struct PowerDeliveryRequest_ISO15118_2014 PowerDeliveryRequest;
  2701. struct PowerDeliveryResponse_ISO15118_2014 PowerDeliveryResponse;
  2702. struct ChargingStatusRequest_ISO15118_2014 ChargingStatusRequest;
  2703. struct ChargingStatusResponse_ISO15118_2014 ChargingStatusResponse;
  2704. struct CurrentDemandRequest_ISO15118_2014 CurrentDemandRequest;
  2705. struct CurrentDemandResponse_ISO15118_2014 CurrentDemandResponse;
  2706. struct MeteringReceiptRequest_ISO15118_2014 MeteringReceiptRequest;
  2707. struct MeteringReceiptResponse_ISO15118_2014 MeteringReceiptResponse;
  2708. struct WeldingDetectionRequest_ISO15118_2014 WeldingDetectionRequest;
  2709. struct WeldingDetectionResponse_ISO15118_2014 WeldingDetectionResponse;
  2710. struct SessionStopRequest_ISO15118_2014 SessionStopRequest;
  2711. struct SessionStopResponse_ISO15118_2014 SessionStopResponse;
  2712. };
  2713. struct V2GMessageType_ISO15118_2018
  2714. {
  2715. unsigned char PresentMsgFlowStatus;
  2716. /* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2717. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2718. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2719. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2720. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2721. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2722. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2723. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2724. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2725. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2726. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2727. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2728. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2729. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2730. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2731. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2732. 52: SessionStopRequest, 53: SessionStopResponse
  2733. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2734. */
  2735. struct SupportedAppProtocolRequest_ISO15118_2018 SupportedAppProtocolRequest;
  2736. struct SupportedAppProtocolResponse_ISO15118_2018 SupportedAppProtocolResponse;
  2737. struct SessionSetupRequest_ISO15118_2018 SessionSetupRequest;
  2738. struct SessionSetupResponse_ISO15118_2018 SessionSetupResponse;
  2739. struct ServiceDiscoveryRequest_ISO15118_2018 ServiceDiscoveryRequest;
  2740. struct ServiceDiscoveryResponse_ISO15118_2018 ServiceDiscoveryResponse;
  2741. struct ServiceDetailRequest_ISO15118_2018 ServiceDetailRequest;
  2742. struct ServiceDetailResponse_ISO15118_2018 ServiceDetailResponse;
  2743. struct ServiceSelectionRequest_ISO15118_2018 ServiceSelectionRequest;
  2744. struct ServiceSelectionResponse_ISO15118_2018 ServiceSelectionResponse;
  2745. struct IdentificationDetailsRequest_ISO15118_2018 IdentificationDetailsRequest;
  2746. struct IdentificationDetailsResponse_ISO15118_2018 IdentificationDetailsResponse;
  2747. struct AuthorizationRequest_ISO15118_2018 AuthorizationRequest;
  2748. struct AuthorizationResponse_ISO15118_2018 AuthorizationResponse;
  2749. struct CertificateInstallationRequest_ISO15118_2018 CertificateInstallationRequest;
  2750. struct CertificateInstallationResponse_ISO15118_2018 CertificateInstallationResponse;
  2751. struct ChargeParameterDiscoveryRequest_ISO15118_2018 ChargeParameterDiscoveryRequest;
  2752. struct ChargeParameterDiscoveryResponse_ISO15118_2018 ChargeParameterDiscoveryResponse;
  2753. struct CableCheckRequest_ISO15118_2018 CableCheckRequest;
  2754. struct CableCheckResponse_ISO15118_2018 CableCheckResponse;
  2755. struct PreChargeRequest_ISO15118_2018 PreChargeRequest;
  2756. struct PreChargeResponse_ISO15118_2018 PreChargeResponse;
  2757. struct PowerDeliveryRequest_ISO15118_2018 PowerDeliveryRequest;
  2758. struct PowerDeliveryResponse_ISO15118_2018 PowerDeliveryResponse;
  2759. struct ChargingStatusRequest_ISO15118_2018 ChargingStatusRequest;
  2760. struct ChargingStatusResponse_ISO15118_2018 ChargingStatusResponse;
  2761. struct CurrentDemandRequest_ISO15118_2018 CurrentDemandRequest;
  2762. struct CurrentDemandResponse_ISO15118_2018 CurrentDemandResponse;
  2763. struct MeteringReceiptRequest_ISO15118_2018 MeteringReceiptRequest;
  2764. struct MeteringReceiptResponse_ISO15118_2018 MeteringReceiptResponse;
  2765. struct WeldingDetectionRequest_ISO15118_2018 WeldingDetectionRequest;
  2766. struct WeldingDetectionResponse_ISO15118_2018 WeldingDetectionResponse;
  2767. struct SessionStopRequest_ISO15118_2018 SessionStopRequest;
  2768. struct SessionStopResponse_ISO15118_2018 SessionStopResponse;
  2769. };
  2770. struct CcsData
  2771. {
  2772. unsigned char CommProtocol; // 1: V2GMessage_DIN70121, 2:V2GMessage_ISO15118_2014, 3:V2GMessage_ISO15118_2018
  2773. struct V2GMessageType_DIN70121 V2GMessage_DIN70121[CCS_QUANTITY];
  2774. struct V2GMessageType_ISO15118_2014 V2GMessage_ISO15118_2014[CCS_QUANTITY];
  2775. struct V2GMessageType_ISO15118_2018 V2GMessage_ISO15118_2018[CCS_QUANTITY];
  2776. };
  2777. /**************************************************************************************/
  2778. /***************STM32F407 Communication Share memory**************************/
  2779. /**************************************************************************************/
  2780. struct PrimaryMcuData
  2781. {
  2782. unsigned char SelfTest_Comp;
  2783. unsigned char version[16]; //STM32F407 firmware version
  2784. unsigned int InputVoltage; //value comes from external meter
  2785. unsigned int InputCurrent; //value comes from external meter
  2786. union
  2787. {
  2788. unsigned char OutputDrvValue[1];
  2789. struct
  2790. {
  2791. //OutputDrvValue[0]
  2792. unsigned char AcContactorDrv:1; //bit 0, H: ON, L:OFF
  2793. unsigned char Button1LedDrv:1; //bit 1, H: ON, L:OFF
  2794. unsigned char Button2LedDrv:1; //bit 2, H: ON, L:OFF
  2795. unsigned char SystemLed1Drv:1; //bit 3, H: ON, L:OFF
  2796. unsigned char SystemLed2Drv:1; //bit 4, H: ON, L:OFF
  2797. unsigned char SystemLed3Drv:1; //bit 5, H: ON, L:OFF
  2798. unsigned char SystemLed4Drv:1; //bit 6, H: ON, L:OFF
  2799. unsigned char:1; //bit 7 reserved
  2800. }bits;
  2801. }OutputDrv;
  2802. union
  2803. {
  2804. unsigned char InputDetValue[2];
  2805. struct
  2806. {
  2807. //InputDetValue[0]
  2808. unsigned char AcContactorDetec:1; //bit 0, H: ON, L:OFF
  2809. unsigned char AcMainBreakerDetec:1; //bit 1, H: ON, L:OFF
  2810. unsigned char SpdDetec:1; //bit 2, H: ON, L:OFF
  2811. unsigned char DoorOpen:1; //bit 3, H: Open, L:Close
  2812. unsigned char Gfd1:1; //bit 4, H: Trigger, L:Normal
  2813. unsigned char Gfd2:1; //bit 5, H: Trigger, L:Normal
  2814. unsigned char Button1:1; //bit 6 , H: Push, L:Release
  2815. unsigned char Button2:1; //bit 7, H: Push, L:Release
  2816. //InputDetValue[1]
  2817. unsigned char EmergencyButton:1; //bit 0, H: Push, L:Release
  2818. unsigned char :7; //bit 1~7, Reserved
  2819. }bits;
  2820. }InputDet;
  2821. };
  2822. /**************************************************************************************/
  2823. /*************Fan power module Communication Share memory******************/
  2824. /**************************************************************************************/
  2825. struct FanModuleData
  2826. {
  2827. unsigned char SelfTest_Comp;
  2828. unsigned char version[16]; //fan power module firmware version
  2829. unsigned short PresentFan1Speed; //RPM
  2830. unsigned short PresentFan2Speed; //RPM
  2831. unsigned short PresentFan3Speed; //RPM
  2832. unsigned short PresentFan4Speed; //RPM
  2833. unsigned short SetFan1Speed; //RPM
  2834. unsigned short SetFan2Speed; //RPM
  2835. unsigned short SetFan3Speed; //RPM
  2836. unsigned short SetFan4Speed; //RPM
  2837. unsigned char DiffOfAirPressure; //pa
  2838. unsigned char UpdateFW; //1:do update
  2839. };
  2840. /**************************************************************************************/
  2841. /***********Relay control module Communication Share memory******************/
  2842. /**************************************************************************************/
  2843. struct RelayModuleData
  2844. {
  2845. unsigned char SelfTest_Comp;
  2846. unsigned char version[16]; //fan power module firmware version
  2847. unsigned short InputL1Volt; //XXXXX.x volt
  2848. unsigned short InputL2Volt; //XXXXX.x volt
  2849. unsigned short InputL3Volt; //XXXXX.x volt
  2850. unsigned short Gun1FuseOutputVolt; //XXXXX.x volt
  2851. unsigned short Gun2FuseOutputVolt; //XXXXX.x volt
  2852. unsigned short Gun1RelayOutputVolt; //XXXXX.x volt
  2853. unsigned short Gun2RelayOutputVolt; //XXXXX.x volt
  2854. unsigned short Gun1OutputCurrent; //XXXXX.x amp
  2855. unsigned short Gun2OutputCurrent; //XXXXX.x amp
  2856. unsigned char UpdateFW; //1:do update
  2857. };
  2858. /**************************************************************************************/
  2859. /************************OCPP Share memory***************************************/
  2860. /**************************************************************************************/
  2861. struct StructIdTagInfo
  2862. {
  2863. unsigned char ExpiryDate[28];
  2864. unsigned char ParentIdTag[20];
  2865. unsigned char Status[16]; //Accepted, Blocked, Expired, Invalid, ConcurrentTx
  2866. };
  2867. struct StructLocalAuthorizationList
  2868. {
  2869. unsigned char IdTag[20];
  2870. struct StructIdTagInfo IdTagInfo;
  2871. };
  2872. struct StructSampledValue
  2873. {
  2874. unsigned char Value[128];
  2875. unsigned char Context[20];//Interruption.Begin, Interruption.End, Sample.Clock, Sample.Periodic, Transaction.Begin, Transaction.End, Trigger, Other
  2876. unsigned char Format[12];//Raw,SignedData
  2877. unsigned char Measurand[32];/* "Energy.Active.Export.Register",
  2878. "Energy.Active.Import.Register",
  2879. "Energy.Reactive.Export.Register",
  2880. "Energy.Reactive.Import.Register",
  2881. "Energy.Active.Export.Interval",
  2882. "Energy.Active.Import.Interval",
  2883. "Energy.Reactive.Export.Interval",
  2884. "Energy.Reactive.Import.Interval",
  2885. "Power.Active.Export",
  2886. "Power.Active.Import",
  2887. "Power.Offered",
  2888. "Power.Reactive.Export",
  2889. "Power.Reactive.Import",
  2890. "Power.Factor",
  2891. "Current.Import",
  2892. "Current.Export",
  2893. "Current.Offered",
  2894. "Voltage",
  2895. "Frequency",
  2896. "Temperature",
  2897. "SoC",
  2898. "RPM"
  2899. */
  2900. unsigned char Phase[8]; /* "L1",
  2901. "L2",
  2902. "L3",
  2903. "N",
  2904. "L1-N",
  2905. "L2-N",
  2906. "L3-N",
  2907. "L1-L2",
  2908. "L2-L3",
  2909. "L3-L1"
  2910. */
  2911. unsigned char Location[8]; //Cable,EV,Inlet,Outlet,Body
  2912. unsigned char Unit[12]; /* "Wh",
  2913. "kWh",
  2914. "varh",
  2915. "kvarh",
  2916. "W",
  2917. "kW",
  2918. "VA",
  2919. "kVA",
  2920. "var",
  2921. "kvar",
  2922. "A",
  2923. "V",
  2924. "K",
  2925. "Celcius",
  2926. "Fahrenheit",
  2927. "Percent"
  2928. */
  2929. };
  2930. struct StructMeterValue
  2931. {
  2932. unsigned char TimeStamp[28];
  2933. struct StructSampledValue SampledValue[10];
  2934. };
  2935. struct StructConfigurationKeyItems
  2936. {
  2937. unsigned char Item[50];
  2938. };
  2939. struct StructConfigurationKey
  2940. {
  2941. unsigned char Key[50];
  2942. unsigned char ReadOnly[8]; //boolean
  2943. unsigned char Value[500];
  2944. };
  2945. struct StructChargingSchedulePeriod
  2946. {
  2947. int StartPeriod;
  2948. float Limit;//0.1;
  2949. int NumberPhases;
  2950. };
  2951. struct StructChargingSchedule
  2952. {
  2953. int Duration;
  2954. unsigned char StartSchedule[28];
  2955. unsigned char ChargingRateUnit[4]; //A, W
  2956. struct StructChargingSchedulePeriod ChargingSchedulePeriod[10];
  2957. float MinChargingRate; //0.1;
  2958. };
  2959. struct StructChargingProfile
  2960. {
  2961. int ChargingProfileId;
  2962. int TransactionId;
  2963. int StackLevel;
  2964. unsigned char ChargingProfilePurpose[24]; //ChargePointMaxProfile, TxDefaultProfile, TxProfile
  2965. unsigned char ChargingProfileKind[12]; //Absolute, Recurring, Relative
  2966. unsigned char RecurrencyKind[8]; //Daily, Weekly
  2967. unsigned char ValidFrom[28];
  2968. unsigned char ValidTo[28];
  2969. struct StructChargingSchedule ChargingSchedule;
  2970. };
  2971. struct StructBootNotification
  2972. {
  2973. unsigned char CpVendor[20]; //chargePointVendor //mandatory
  2974. unsigned char CpModel[20]; //chargePointModel //mandatory
  2975. unsigned char CpSN[25]; //chargePointSerialNumber
  2976. unsigned char CbSN[25]; //chargeBoxSerialNumber
  2977. unsigned char CpFwVersion[50]; //firmwareVersion
  2978. unsigned char CpIccid[20]; //iccid
  2979. unsigned char CpImsi[20]; //imsi
  2980. unsigned char CpMeterType[25]; //meterType
  2981. unsigned char CpMeterSerialNumber[25]; //meterSerialNumber
  2982. unsigned char ResponseStatus[16]; //Accepted, Pending, Rejected
  2983. unsigned char ResponseCurrentTime[28]; //currentTime //mandatory
  2984. int ResponseHeartbeatInterval; //interval //mandatory
  2985. };
  2986. struct StructHeartbeat
  2987. {
  2988. unsigned char ResponseCurrentTime[28];
  2989. };
  2990. struct StructAuthorize
  2991. {
  2992. unsigned char IdTag[20];
  2993. struct StructIdTagInfo ResponseIdTagInfo;
  2994. };
  2995. struct StructStartTransaction
  2996. {
  2997. int ConnectorId;
  2998. unsigned char IdTag[20];
  2999. int MeterStart;
  3000. int ReservationId;
  3001. unsigned char Timestamp[28];
  3002. struct StructIdTagInfo ResponseIdTagInfo;
  3003. int ResponseTransactionId;
  3004. };
  3005. struct StructStopTransaction
  3006. {
  3007. unsigned char IdTag[20];
  3008. int MeterStop;
  3009. unsigned char Timestamp[28];
  3010. int TransactionId;
  3011. unsigned char StopReason[20]; /* "EmergencyStop",
  3012. "EVDisconnected",
  3013. "HardReset",
  3014. "Local",
  3015. "Other",
  3016. "PowerLoss",
  3017. "Reboot",
  3018. "Remote",
  3019. "SoftReset",
  3020. "UnlockCommand",
  3021. "DeAuthorized"
  3022. */
  3023. struct StructMeterValue TransactionData[0];
  3024. struct StructIdTagInfo ResponseIdTagInfo;
  3025. };
  3026. struct StructStatusNotification
  3027. {
  3028. int ConnectorId;
  3029. unsigned char ErrorCode[25]; /* "ConnectorLockFailure",
  3030. "EVCommunicationError",
  3031. "GroundFailure",
  3032. "HighTemperature",
  3033. "InternalError",
  3034. "LocalListConflict",
  3035. "NoError",
  3036. "OtherError",
  3037. "OverCurrentFailure",
  3038. "PowerMeterFailure",
  3039. "PowerSwitchFailure",
  3040. "ReaderFailure",
  3041. "ResetFailure",
  3042. "UnderVoltage",
  3043. "OverVoltage",
  3044. "WeakSignal"
  3045. */
  3046. unsigned char Info[50];
  3047. unsigned char Status[20]; /* "Available",
  3048. "Preparing",
  3049. "Charging",
  3050. "SuspendedEVSE",
  3051. "SuspendedEV",
  3052. "Finishing",
  3053. "Reserved",
  3054. "Unavailable",
  3055. "Faulted"
  3056. */
  3057. unsigned char Timestamp[28];
  3058. unsigned char VendorId[256];
  3059. unsigned char VendorErrorCode[50];
  3060. };
  3061. struct StructCancelReservation
  3062. {
  3063. int ReservationId;
  3064. unsigned char ResponseStatus[16]; //Accepted, Rejected
  3065. unsigned char guid[37];
  3066. };
  3067. struct StructChangeAvailability
  3068. {
  3069. int ConnectorId;
  3070. unsigned char Type[16]; //Inoperative, Operative
  3071. unsigned char ResponseStatus[16]; //Accepted, Rejected, Scheduled
  3072. unsigned char guid[37];
  3073. };
  3074. struct StructChangeConfiguration
  3075. {
  3076. unsigned char Key[50];
  3077. unsigned char Value[500];
  3078. unsigned char ResponseStatus[16]; //Accepted, Rejected, RebootRequired, NotSupported
  3079. };
  3080. struct StructClearCache
  3081. {
  3082. unsigned char ResponseStatus[16]; //Accepted, Rejected
  3083. };
  3084. struct StructClearChargingProfile
  3085. {
  3086. int Id;
  3087. int ConnectorId;
  3088. unsigned char ChargingProfilePurpose[24]; //ChargePointMaxProfile, TxDefaultProfile, TxProfile
  3089. int StackLevel;
  3090. unsigned char ResponseStatus[16]; //Accepted, Unknown
  3091. };
  3092. struct StructDataTransfer
  3093. {
  3094. unsigned char VendorId[256];
  3095. unsigned char MessageId[52];
  3096. unsigned char Data[512];
  3097. unsigned char ResponseStatus[18]; //Accepted, Rejected,UnknownMessageId,UnknownVendorId
  3098. unsigned char ResponseData[256];
  3099. };
  3100. struct StructDiagnosticsStatusNotification
  3101. {
  3102. unsigned char Status[16]; //Idle,Uploaded,UploadFailed,Uploading
  3103. };
  3104. struct StructFirmwareStatusNotification
  3105. {
  3106. unsigned char Status[20]; //Downloaded,DownloadFailed,Downloading,Idle,InstallationFailed,Installing,Installed
  3107. };
  3108. struct StructGetCompositeSchedule
  3109. {
  3110. int ConnectorId;
  3111. int Duration;
  3112. unsigned char ChargingRateUnit[4]; //A,W
  3113. unsigned char ResponseStatus[12]; //Accepted,Rejected
  3114. int ResponseConnectorId;
  3115. unsigned char ResponseScheduleStart[28];
  3116. struct StructChargingSchedule ResponseChargingSchedule;
  3117. };
  3118. struct StructGetConfiguration
  3119. {
  3120. struct StructConfigurationKeyItems *Key;
  3121. struct StructConfigurationKey *ResponseConfigurationKey;
  3122. struct StructConfigurationKeyItems *ResponseUnknownKey;
  3123. };
  3124. struct StructGetDiagnostics
  3125. {
  3126. unsigned char Location[256];
  3127. int Retries;
  3128. int RetryInterval;
  3129. unsigned char StartTime[28];
  3130. unsigned char StopTime[28];
  3131. unsigned char ResponseFileName[256];
  3132. };
  3133. struct StructGetLocalListVersion
  3134. {
  3135. int ResponseListVersion;
  3136. };
  3137. struct StructMeterValues
  3138. {
  3139. int ConnectorId;
  3140. int TransactionId;
  3141. struct StructMeterValue MeterValue[0];
  3142. };
  3143. struct StructRemoteStartTransaction
  3144. {
  3145. int ConnectorId;
  3146. unsigned char IdTag[20];
  3147. struct StructChargingProfile ChargingProfile;
  3148. unsigned char ResponseStatus[10]; //Accepted, Rejected
  3149. unsigned char guid[37];
  3150. };
  3151. struct StructRemoteStopTransaction
  3152. {
  3153. int TransactionId;
  3154. unsigned char ResponseStatus[10]; //Accepted, Rejected
  3155. };
  3156. struct StructReserveNow
  3157. {
  3158. int ConnectorId;
  3159. unsigned char ExpiryDate[28];
  3160. unsigned char IdTag[20];
  3161. unsigned char ParentIdTag[20];
  3162. int ReservationId;
  3163. unsigned char ResponseStatus[12]; //Accepted, Faulted, Occupied, Rejected, Unavailable
  3164. unsigned char guid[37]; //OCPP Server request message uuid
  3165. };
  3166. struct StructReset
  3167. {
  3168. unsigned char Type[8]; //Hard, Soft
  3169. unsigned char ResponseStatus[10]; //Accepted, Rejected
  3170. unsigned char guid[37]; //OCPP Server request message uuid
  3171. };
  3172. struct StructSendLocalList
  3173. {
  3174. int ListVersion;
  3175. unsigned char UpdateType[16]; //Differential, Full
  3176. struct StructLocalAuthorizationList *LocalAuthorizationList;
  3177. unsigned char ResponseStatus[16]; //Accepted, Failed, NotSupported, VersionMismatch
  3178. };
  3179. struct StructSetChargingProfile
  3180. {
  3181. int ConnectorId;
  3182. struct StructChargingProfile ChargingProfile;
  3183. unsigned char ResponseStatus[16]; //Accepted, Rejected, NotSupported
  3184. };
  3185. struct StructTriggerMessage
  3186. {
  3187. unsigned char RequestedMessage[32]; /*
  3188. "BootNotification",
  3189. "DiagnosticsStatusNotification",
  3190. "FirmwareStatusNotification",
  3191. "Heartbeat",
  3192. "MeterValues",
  3193. "StatusNotification"
  3194. */
  3195. int ConnectorId;
  3196. unsigned char ResponseStatus[16]; //Accepted, Rejected, NotImplemented
  3197. };
  3198. struct StructUnlockConnector
  3199. {
  3200. int ConnectorId;
  3201. unsigned char ResponseStatus[16]; //Unlocked, UnlockFailed, NotSupported
  3202. unsigned char guid[37]; //OCPP Server request message uuid
  3203. };
  3204. struct StructUpdateFirmware
  3205. {
  3206. unsigned char Location[256];
  3207. int Retries;
  3208. unsigned char RetrieveDate[28];
  3209. int RetryInterval;
  3210. };
  3211. struct OCPP16ConfigurationItem
  3212. {
  3213. unsigned char ItemName[64];
  3214. unsigned char ItemAccessibility;//0:RO, 1:RW
  3215. unsigned char ItemData[128];
  3216. };
  3217. struct OCPP16ConfigurationTable
  3218. {
  3219. //please refer to OCPP 1.6 chapter 9
  3220. struct OCPP16ConfigurationItem CoreProfile[34];
  3221. struct OCPP16ConfigurationItem LocalAuthListManagementProfile[3];
  3222. struct OCPP16ConfigurationItem ReservationProfile[1];
  3223. struct OCPP16ConfigurationItem SmartChargingProfile[5];
  3224. };
  3225. struct OCPP16Data
  3226. {
  3227. unsigned char OcppServerURL[512]; //http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
  3228. unsigned char ChargeBoxId[128];
  3229. unsigned char OcppConnStatus; //0: disconnected, 1: connected
  3230. unsigned int Timeout_Secs;
  3231. unsigned short Ping_Pong_Interval;
  3232. union
  3233. {
  3234. //Operations Initiated by Charge Point
  3235. unsigned char CpMsgValue[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3236. struct
  3237. {
  3238. //CpMsgValue[0]
  3239. unsigned char DataTransferReq:1; //bit 0,
  3240. unsigned char DataTransferConf:1; //bit 1,
  3241. unsigned char StartTransactionReq:1; //bit 2,
  3242. unsigned char StartTransactionConf:1; //bit 3,
  3243. unsigned char StopTransactionReq:1; //bit 4,
  3244. unsigned char StopTransactionConf:1; //bit 5,
  3245. unsigned char :2; //bit 6,7 , reserved
  3246. } bits[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3247. }CpMsg;
  3248. union
  3249. {
  3250. //Operations Initiated by Sequence Point
  3251. unsigned char SpMsgValue[1];
  3252. struct
  3253. {
  3254. //SpMsgValue[0]
  3255. unsigned char BootNotificationReq :1; //bit 0,
  3256. unsigned char BootNotificationConf :1; //bit 1,
  3257. unsigned char AuthorizeReq :1; //bit 2,
  3258. unsigned char AuthorizeConf :1; //bit 3,
  3259. unsigned char DiagnosticsStatusNotificationReq :1; //bit 4,
  3260. unsigned char DiagnosticsStatusNotificationConf :1; //bit 5,
  3261. unsigned char FirmwareStatusNotificationReq :1; //bit 6,
  3262. unsigned char FirmwareStatusNotificationConf :1; //bit 7,
  3263. } bits;
  3264. } SpMsg;
  3265. union
  3266. {
  3267. //Operations Initiated by Central System
  3268. unsigned char CsMsgValue[3 * (CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY)];
  3269. struct
  3270. {
  3271. //CsMsgValue[0]
  3272. unsigned char CancelReservationReq :1; //bit 0,
  3273. unsigned char CancelReservationConf :1; //bit 1,
  3274. unsigned char ChangeAvailabilityReq :1; //bit 2,
  3275. unsigned char ChangeAvailabilityConf :1; //bit 3,
  3276. unsigned char ReserveNowReq :1; //bit 4,
  3277. unsigned char ReserveNowConf :1; //bit 5,
  3278. unsigned char SetChargingProfileReq :1; //bit 6,
  3279. unsigned char SetChargingProfileConf :1; //bit 7,
  3280. //CsMsgValue[1]
  3281. unsigned char TriggerMessageReq :1; //bit 0,
  3282. unsigned char TriggerMessageConf :1; //bit 1,
  3283. unsigned char UnlockConnectorReq :1; //bit 2,
  3284. unsigned char UnlockConnectorConf :1; //bit 3,
  3285. unsigned char RemoteStartTransactionReq :1; //bit 4,
  3286. unsigned char RemoteStartTransactionConf :1; //bit 5,
  3287. unsigned char RemoteStopTransactionReq :1; //bit 6,
  3288. unsigned char RemoteStopTransactionConf :1; //bit 7,
  3289. //CsMsgValue[2]
  3290. unsigned char ClearChargingProfileReq :1; //bit 0,
  3291. unsigned char ClearChargingProfileConf :1; //bit 1,
  3292. unsigned char DataTransferReq :1; //bit 2,
  3293. unsigned char DataTransferConf :1; //bit 3,
  3294. unsigned char GetCompositeScheduleReq :1; //bit 4,
  3295. unsigned char GetCompositeScheduleConf :1; //bit 5,
  3296. unsigned char :2; //bit 6,7
  3297. } bits[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3298. }CsMsg;
  3299. union
  3300. {
  3301. //Operations Initiated by Main System
  3302. unsigned char MsMsgValue[2];
  3303. struct
  3304. {
  3305. //CsMsgValue[0]
  3306. unsigned char ChangeConfigurationReq :1; //bit 0,
  3307. unsigned char ChangeConfigurationConf :1; //bit 1,
  3308. unsigned char ClearCacheReq :1; //bit 2,
  3309. unsigned char ClearCacheConf :1; //bit 3,
  3310. unsigned char GetConfigurationReq :1; //bit 4,
  3311. unsigned char GetConfigurationConf :1; //bit 5,
  3312. unsigned char UpdateFirmwareReq :1; //bit 6,
  3313. unsigned char UpdateFirmwareConf :1; //bit 7,
  3314. //CsMsgValue[1]
  3315. unsigned char GetDiagnosticsReq :1; //bit 0,
  3316. unsigned char GetDiagnosticsConf :1; //bit 1,
  3317. unsigned char GetLocalListVersionReq :1; //bit 2,
  3318. unsigned char GetLocalListVersionConf :1; //bit 3,
  3319. unsigned char ResetReq :1; //bit 4,
  3320. unsigned char ResetConf :1; //bit 5,
  3321. unsigned char SendLocalListReq :1; //bit 6,
  3322. unsigned char SendLocalListConf :1; //bit 7,
  3323. } bits;
  3324. } MsMsg;
  3325. struct StructBootNotification BootNotification;
  3326. struct StructHeartbeat Heartbeat;
  3327. struct StructAuthorize Authorize;
  3328. struct StructStartTransaction StartTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3329. struct StructStopTransaction StopTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3330. struct StructStatusNotification StatusNotification[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3331. struct StructCancelReservation CancelReservation[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3332. struct StructChangeAvailability ChangeAvailability[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3333. struct StructChangeConfiguration ChangeConfiguration;
  3334. struct StructClearCache ClearCache;
  3335. struct StructClearChargingProfile ClearChargingProfile[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3336. struct StructDataTransfer DataTransfer[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3337. struct StructDiagnosticsStatusNotification DiagnosticsStatusNotification;
  3338. struct StructFirmwareStatusNotification FirmwareStatusNotification;
  3339. struct StructGetCompositeSchedule GetCompositeSchedule[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3340. struct StructGetConfiguration GetConfiguration;
  3341. struct StructGetDiagnostics GetDiagnostics;
  3342. struct StructGetLocalListVersion GetLocalListVersion;
  3343. struct StructMeterValues MeterValues[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3344. struct StructRemoteStartTransaction RemoteStartTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3345. struct StructRemoteStopTransaction RemoteStopTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3346. struct StructReserveNow ReserveNow[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3347. struct StructReset Reset;
  3348. struct StructSendLocalList SendLocalList;
  3349. struct StructSetChargingProfile SetChargingProfile[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3350. struct StructTriggerMessage TriggerMessage[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3351. struct StructUnlockConnector UnlockConnector[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
  3352. struct StructUpdateFirmware UpdateFirmware;
  3353. struct OCPP16ConfigurationTable ConfigurationTable;
  3354. struct StructChargingProfile CHAdeMOChargingProfile[CHAdeMO_QUANTITY];
  3355. struct StructChargingProfile CcsChargingProfile[CCS_QUANTITY];
  3356. };
  3357. #endif // DEFINE_H_