define.h 123 KB

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