define.h 147 KB

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