define.h 129 KB

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