define.h.bak 129 KB

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