define.h 129 KB

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