define.h 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510
  1. /*===========================================================================
  2. Combined Charging System (CCS): SECC
  3. define.h
  4. initiated by Vern, Joseph
  5. (since 2019/07/19)
  6. =============================================================================*/
  7. #ifndef DEFINE_H_
  8. #define DEFINE_H_
  9. #include "version.h"
  10. #include <stdlib.h>
  11. #include <stdio.h>
  12. #include <time.h>
  13. #include <sys/timeb.h>
  14. //#include "CsuCommAC.h"
  15. /**************************************************************************************/
  16. /*********************************NAND Flash mapping *****************************/
  17. /**************************************************************************************/
  18. /*
  19. sector size 512 KiB
  20. Page size 4096 b
  21. OOB size 224 b
  22. Erase size 524288 b
  23. -------------------------------------------------------------------------------------------------------------------------------
  24. Segment Physical address Size
  25. -------------------------------------------------------------------------------------------------------------------------------
  26. MLO 0x00000000-0x0007FFFF 512 KB
  27. Primary u-boot 0x00080000-0x0017FFFF 1 MB
  28. Environment 0x00180000-0x001FFFFF 512 KB
  29. Secondary u-boot 0x00200000-0x002FFFFF 1 MB
  30. Primary dtb 0x00300000-0x0037FFFF 512 KB
  31. Secondary dtb 0x00380000-0x003FFFFF 512 KB
  32. Primary kernel 0x00400000-0x00DFFFFF 10 MB
  33. Secondary Kernel 0x00E00000-0x017FFFFF 10 MB
  34. Primary root file system 0x01800000-0x029FFFFF 24 MB
  35. Secondary root file system 0x03000000-0x047FFFFF 24 MB
  36. Primary user configuration 0x04800000-0x004DFFFF 6 MB
  37. Secondary user configuration 0x04E00000-0x0053FFFF 6 MB
  38. Factory default configuration 0x05400000-0x0059FFFF 6 MB
  39. Storage 0x05A00000-0x7FFFFFFF 1958 MB
  40. */
  41. #define ENABLE 1
  42. #define DISABLE 0
  43. #define PASS 1
  44. #define FAIL 0
  45. /**************************************************************************************/
  46. /*********************************System Limitation**********************************/
  47. /**************************************************************************************/
  48. #ifdef AWCCS
  49. #undef CONNECTOR_TEMP_DETECTION
  50. #define CCS_ENERGY_TRANSFER_MODE MODE_AC_SINGLE_PHASE_CORE
  51. #else
  52. #define CCS_ENERGY_TRANSFER_MODE MODE_DC_EXTENDED
  53. #endif
  54. //#define SUPPORT_ISO15118_PnC
  55. //#define SUPPORT_ISO15118_VAS
  56. //#define SUPPORT_TLS_CONNECTION
  57. #define SUPPORT_DIN70122_ISO15118_4 0
  58. #define MIN_SUPPORTED_CURRENT 3
  59. #define CONNECTOR_TEMP_DETECTION //REMA
  60. #ifdef SUPPORT_ISO15118_VAS
  61. #define SUPPORT_TLS_CONNECTION
  62. #endif
  63. #ifdef SUPPORT_ISO15118_PnC
  64. #define SUPPORT_TLS_CONNECTION
  65. #endif
  66. #define SIZE_OF_LOG_BUFFER 256 //Bytes
  67. #define PARAMETER_NORMAL_MODE ENABLE //DISABLE: using sudo parameters
  68. //ENABLE: using CAN commands
  69. //For Test or Burn-in Purpose
  70. #define MANUAL_SET_EV_TARGET_FUNCTION DISABLE
  71. #define SUDO_EV_TARGET_VOLTAGE 500 //unit: 1V
  72. #define SUDO_EV_TARGET_CURRENT 60 //unit: 1A
  73. //Configuration for CCS EVSE Process
  74. #define CABLECHECK_TARGET_VOLTAGE 500 //unit 1V, default: 500V
  75. #define CABLECHECK_TARGET_CURRENT 2 //unit: 1A, default: 2A
  76. #define PRECHARGE_TARGET_CURRENT 2 //unit: 1A, default: 2A
  77. //EVSE ID
  78. #define CCS_AC_EVSEID "PHIHONG_CCS_AC_001" //max: DIN = 32, ISO1/ISO2 = 37 bytes
  79. #define CCS_DC_EVSEID "PHIHONG_CCS_DC_001" //max: DIN = 32, ISO1/ISO2 = 37 bytes
  80. #define CCS_AC_METER_ID "ABCDE-0123456789-0123456789" //max = 32 bytes
  81. #define CCS_AC_SIG_METER_READING "SIG_METER_READING_ABCDE-0123456789" //max = 64 bytes
  82. /*CCS Protocol ID*/
  83. #define V2GT_MSG_PROTOCOL_DIN70121 0
  84. #define V2GT_MSG_PROTOCOL_ISO15118_2014 1 //i.e. ISO15118-2 (ISO 1)
  85. #define V2GT_MSG_PROTOCOL_ISO15118_2018 2 //i.e. ISO15118-20 (ISO 2)
  86. #define V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY 255 //for auto detect highest priority protocol
  87. #define V2GT_MSG_PROTOCOL_PREFERENCE V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY // V2GT_MSG_PROTOCOL_ISO15118_2014//V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY
  88. //#define CCS_ENERGY_TRANSFER_MODE MODE_DC_EXTENDED
  89. //DC: MODE_DC_EXTENDED (default)
  90. //AC: MODE_AC_SINGLE_PHASE_CORE, MODE_AC_THREE_PHASE_CORE
  91. #define SET_NO_PWM_IF_NOT_GET_PERMISSION 0
  92. #define SET_5_PWM_ONCE_RX_CM_SLAC_PARM_REQ 1
  93. #define SET_5_PWM_ONCE_GET_PERMISSION_IN_AUTHORIZATIONRES 2
  94. #define FIRMWARE_VERSION_COMPILE_SETTING_RELEASE_MODE ENABLE //default: ENABLE: release; DISABLE: debug
  95. #define NEW_SLAC_ARCHITECTURE_SWITCH ENABLE //defualt: ENABLE
  96. #define CAN_RAMDOM_MATCHING_ID_MECHANISM ENABLE //defualt: ENABLE
  97. #define CAN_RX_TIMEOUT_MECHANISM DISABLE //defualt: ENABLE
  98. #define SLAC_FIRST_RESPONSE_METHOD SET_5_PWM_ONCE_RX_CM_SLAC_PARM_REQ
  99. #define TCPDUMP_PACKETS_SNIFFER_SWITCH DISABLE //default: DISABLE
  100. #define CANDUMP_PACKETS_SNIFFER_SWITCH DISABLE //default: DISABLE
  101. #define DYNAMIC_ETH0_IP_MECHANISM ENABLE //default: DISABLE
  102. #define CP_PROTECTION_MECHANISM ENABLE //default: ENABLE
  103. #define PP_PROTECTION_MECHANISM DISABLE //default: DISABLE
  104. #define SUDO_PSD_PARAMETER_MECHANISM ENABLE //default: ENABLE
  105. #define TESLA_SLOW_INCREASE_CURRENT_FUNCTION DISABLE
  106. #define V2G_SECC_TIMEOUT_PROTECTION ENABLE
  107. #define PATCH_FOR_BMW_I3_BUG_EVSEMAXIMUMVOLTAGELIMIT_599V ENABLE //default: ENABLE; CE/UL: DISABLE
  108. //CSU CAN Message EV Stop Type
  109. #define EV_NORMAL_STOP 1
  110. #define EV_EMERGENCY_STOP 2
  111. //CSU CAN Message GFD Isolation Status Type
  112. #define GFD_Invalid 0 //ongoing
  113. #define GFD_Valid 1
  114. #define GFD_Warning 2
  115. #define GFD_Fault 3
  116. #define GFD_No_IMD 4 //for ISO 15118
  117. //Default Ethernet Port Base for eth0
  118. #define ETH0_PORT_BASE 20
  119. //Energy Transfer Mode
  120. #define MODE_AC_SINGLE_PHASE_CORE 0
  121. #define MODE_AC_THREE_PHASE_CORE 1
  122. #define MODE_DC_CORE 2
  123. #define MODE_DC_EXTENDED 3
  124. #define MODE_DC_COMBO_CORE 4
  125. #define MODE_DC_UNIQUE 5
  126. /*
  127. 0xAaBbCcDd
  128. Aa: main version
  129. Bb: minor version
  130. Cc:
  131. 0x01: UL
  132. 0x02: CE
  133. 0x03: JP
  134. 0x04: GB
  135. Dd:
  136. 0x01: CCS protocol
  137. 0x02: CHAdeMO protocol
  138. 0x03: GB Protocol
  139. */
  140. /*Download Image Type*/
  141. #define IMAGE_TYPE_KERNEL_CONFIGURATION_DTB 1
  142. #define IMAGE_TYPE_BOOTLOADER_UBOOT 2
  143. #define IMAGE_TYPE_OS_KERNEL_ZIMAGE 3
  144. #define IMAGE_TYPE_ROOT_FILESYSTEM_RAMDISK 4
  145. #define IMAGE_TYPE_ROOT_APP_ZIP 5
  146. #define IMAGE_TYPE_BOOTLOADER_MLO_SPL 6
  147. #define IMAGE_TYPE_USER_CONFIGURATION 7
  148. //--- [CAUTION] To increase type ID, please modify this condition.
  149. //(Check_DwnldImgParameter())
  150. /*relevant to Quantity */
  151. #define CHAdeMO_QUANTITY 1
  152. #define CCS_QUANTITY 1
  153. #define GB_QUANTITY 1
  154. /*SystemLog message*/
  155. #define SystemLogMessage //for engineer to do analysis
  156. #define CSUCOMMDC_TASK_FLAG (ShmInternalComm->InternalCommUnion.bits)
  157. //#define CSUCOMMAC_SHM (ShmInternalCommAC->gun_info[0].acCcsInfo)
  158. #define EVCOMM_SYS_INFO (ShmSysConfigAndInfo->SysInfo.CcsChargingData[0])
  159. #define SLAC_INFO (ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].evcc_slac_data)
  160. #define CCS_HANDSHAKE_PROTOCOLS (ccs_handshake.supportedAppProtocolReq.AppProtocol)
  161. #define GPIO_SYS_DIR "/sys/class/gpio"
  162. #define GPIO_2_23_AM_IO_1 87
  163. // Debug Message
  164. #define DEBUG_CCS_EVEM_MESSAGE_SHOW ENABLE
  165. #if DEBUG_CCS_EVEM_MESSAGE_SHOW == ENABLE
  166. #define DEBUG_MAIN_PRINTF printf
  167. #define DEBUG_EVCOMM_PRINTF printf
  168. #else
  169. #define DEBUG_MAIN_PRINTF(...)
  170. #define DEBUG_EVCOMM_PRINTF(...)
  171. #endif
  172. //Precharge Relay Status
  173. #define EVSE_STATUS_NOT_READY_FOR_PRECHARGE 0 //un-initialized
  174. #define EVSE_STATUS_READY_FOR_PRECHARGE 2 //DC+ Relay: OFF, Precharge Relay: ON
  175. #define EVSE_STATUS_READY_FOR_ENERGY_TRANSFER 3 //DC+ Relay: ON, Precharge Relay: OFF
  176. /**************************************************************************************/
  177. /**************************share memory key information***************************/
  178. /**************************************************************************************/
  179. #define ShmSysConfigAndInfoKey 3001 //0xBB9
  180. #define ShmCcsCommKey 3004 //0xBBC
  181. #define ShmStatusCodeKey 3005 //0xBBD
  182. #define ShmInternalCommKey 3009 //0xBC1
  183. #define ShmInternalCommACKey 3007 //0x7D1
  184. /**************************************************************************************/
  185. /****structure SysConfigData => shall store the data to NAND flash****************/
  186. /****structure SysInfoData => shall NOT store the data to NAND flash***************/
  187. /****according to System Configuration and Information Table.xlsx Rev.0.2 *******/
  188. /**************************************************************************************/
  189. struct EthConfigData
  190. {
  191. unsigned char EthDhcpClient; //0: enable,1: disable
  192. unsigned char EthMacAddress[18]; //default: Null
  193. unsigned char EthIpAddress[16]; //Eth0 default:192.168.0.10 ,Eth1 default:192.168.1.10
  194. unsigned char EthSubmaskAddress[16]; //Eth0 default:255.255.255.0 ,Eth1 default:255.255.255.0
  195. unsigned char EthGatewayAddress[16]; //Eth0 default:192.168.0.254 ,Eth1 default:192.168.1.254
  196. };
  197. struct WifiConfigData
  198. {
  199. unsigned char WifiMode; //0: disable, 1: Infrastructure client, 2: Infrastructure server, 3: Ad-Hoc
  200. unsigned char WifiSsid[256]; //default: Null
  201. unsigned char WifiPassword[256]; //default: Null
  202. int WifiRssi; //dbm
  203. unsigned char WifiDhcpServer; //0: enable, 1: disable
  204. unsigned char WifiDhcpClient; //0: enable, 1: disable
  205. unsigned char WifiMacAddress[18]; //default: Null
  206. unsigned char WifiIpAddress[16]; //default:192.168.2.10
  207. unsigned char WifiSubmaskAddress[16]; //default:255.255.255.0
  208. unsigned char WifiGatewayAddress[16]; //default:192.168.2.254
  209. };
  210. struct TeleConfigData
  211. {
  212. unsigned char TelcomApn[256]; //default: Null
  213. int TelcomRssi; //dbm
  214. unsigned char TelcomChapPapId[256]; //default: Null
  215. unsigned char TelcomChapPapPwd[256]; //default: Null
  216. unsigned char TelcomModemImei[16]; //default: Null
  217. unsigned char TelcomSimImsi[16]; //default: Null
  218. unsigned char TelcomSimStatus; //0: no SIM card is found, 1: valid SIM card, 2: invalid SIM card
  219. unsigned char TelcomModemMode; //0: No services, 1: CDMA, 2: GSM/GPRS, 3: WCDMA, 4: GSM/WCDMA, 5: TD_SCDMA mode, 6: Unknow
  220. unsigned char TelcomIpAddress[16]; //default: Null
  221. };
  222. struct SysConfigData
  223. {
  224. /**************System***************/
  225. unsigned char ModelName[64]; //charger model name
  226. unsigned char SerialNumber[64]; //charger system serial number
  227. unsigned char SystemId[128]; //charger system ID
  228. unsigned char SystemDateTime[32]; //charger system date and time
  229. unsigned char AuthorisationMode; //0: Phihong RFID tag, 1: OCPP backend, 2: Phihong backend, 3: free mode
  230. unsigned char DefaultLanguage; //
  231. unsigned char RfidCardNumEndian; //0: little endian, 1: big endian
  232. unsigned short AcPlugInTimes; //0~65535
  233. unsigned short GbPlugInTimes; //0~65535
  234. unsigned short Ccs1PlugInTime; //0~65535
  235. unsigned short Ccs2PlugInTimes; //0~65535
  236. unsigned short ChademoPlugInTimes; //0~65535
  237. /**************Charging***************/
  238. unsigned short MaxChargingEnergy; //0: no limit, 1 ~ 65535 kWh
  239. unsigned short MaxChargingPower; //0: rating value, 1 ~ RATING_POWER kW"
  240. unsigned short MaxChargingCurrent; //0: rating value, 1 ~ RATING_CURRENT amp"
  241. unsigned short MaxChargingDuration; //0: no limit, 1 ~ 65535 minutes
  242. unsigned char PhaseLossPolicy; //0: charging, 1: stop charging
  243. unsigned char LocalWhiteCard[10][32]; //Max. card quantity is 10
  244. unsigned char UserId[32]; //the user use this ID to trigger charging event, it can be RFID card number, OCPP IdTag, etc.
  245. /**************Network***************/
  246. unsigned char FtpServer[32]; //the ftp server for Phihong server to do data transimission
  247. struct EthConfigData Eth0Interface;
  248. struct EthConfigData Eth1Interface;
  249. struct WifiConfigData AthInterface;
  250. struct TeleConfigData TelecomInterface;
  251. /**************Backend***************/
  252. unsigned int BackendConnTimeout; //default : 300s
  253. unsigned char OfflinePolicy; //0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
  254. unsigned short OfflineMaxChargeEnergy; //0: same as MaxChargingEnergy, 1 ~ 65535 kWh
  255. unsigned short OfflineMaxChargeDuration; //0: same as MaxChargeDuration, 1 ~ 65535 minutes
  256. 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"
  257. unsigned char ChargeBoxId[128];
  258. unsigned int Checksum; //4 bytes checksum
  259. };
  260. #define SLAC_EVSE_MAC_LENGTH 6
  261. #define SLAC_EVMAC_LENGTH 6
  262. #define SLAC_RUNID_LENGTH 8
  263. #define SLAC_AAG_LENGTH 64 //ISO 15118 defines it as 0x3A, i.e. 58
  264. struct EVCC_SLAC_DATA_ARRAY_TYPE {
  265. unsigned char EvMac[SLAC_EVMAC_LENGTH];
  266. unsigned char RunID[SLAC_RUNID_LENGTH];
  267. unsigned short AAG[SLAC_AAG_LENGTH];
  268. unsigned char StartAttenCharCnt;
  269. unsigned char StartAttenCharErr;
  270. unsigned char MnbcSoundNum;
  271. unsigned char MnbcSoundCnt;
  272. unsigned char AttenProfileCnt;
  273. unsigned char AagGroupsNum;
  274. unsigned char AttenCharRspCnt;
  275. unsigned char ValidateReqCnt;
  276. unsigned char MatchReqNum;
  277. float AAG_quality_ori;
  278. float AAG_quality_refined;
  279. };
  280. #define EVCC_SLAC_DATA_ARRAY_TYPE_ARRAY_SIZE 20
  281. struct EVCC_SLAC_DATA_TYPE {
  282. unsigned char arrayLen;
  283. struct EVCC_SLAC_DATA_ARRAY_TYPE array[EVCC_SLAC_DATA_ARRAY_TYPE_ARRAY_SIZE];
  284. };
  285. struct ChargingInfoData {
  286. float MaximumChargingVoltage; //0~6553.5 volt, unit = 1V
  287. float AvailableChargingCurrent; //0~6553.5 amp, unit =1A
  288. float AvailableChargingPower; //0~6553.5 kW, unit = 1KW
  289. float PresentChargingVoltage; //0~6553.5 volt, unit = 1V
  290. float PresentChargingCurrent; //0~6553.5 amp, unit = 1A
  291. float PresentChargingPower; //0~6553.5 kW, unit = 1KW
  292. float PresentChargedEnergy; //0~6553.5 kWh, unit = 1KWH
  293. int PresentChargedDuration; // second, unit = 1s
  294. int RemainChargingDuration; // second, unit = 1s
  295. float EvBatteryMaxVoltage; // 0~6553.5 volt, unit = 1V
  296. float EvBatteryMaxCurrent; //1V
  297. float EvBatteryMaxPower; //1KW
  298. float EvBatterytargetVoltage; // 0~6553.5 volt, unit = 1V
  299. float EvBatterytargetCurrent; //1A
  300. int EvBatterySoc; // 0~100%, unit = 1%
  301. float EvBatteryCapacity; //1KWH
  302. float EvBatteryEngergyRequest; //1KWH
  303. unsigned char ConnectorPlugIn; //0: unplug, 1: Plug-in
  304. unsigned char ConnectorLocked; //0: unlocked, 1:locked.
  305. float CpVoltage; //
  306. unsigned char CpState; //1:state A, 2:State B1, 3:State B2, 4:State C, 5:State D, 6:State E, 7:State F, 8: Pilot error
  307. unsigned char CpDuty; //0~100%
  308. float PpVoltage;
  309. unsigned char EVSEPrechargeStatus; //00:not ready, 01:ready for precharge, 02: ready for engergy trnasfer (> 2A)
  310. unsigned char IsolationStatus; //0:ongoing, 1:valid, 2:warning/fault
  311. unsigned char DC_EVSEStatus;
  312. unsigned char SwitchCpStateE_status;
  313. unsigned char QCA7K_SetKeyDone;
  314. unsigned char CpState_err;
  315. unsigned char CpState_err_logged;
  316. unsigned char CableCheckPreCountDownDone;
  317. unsigned char End_Process_inused;
  318. struct timeb V2G_SECC_CableCheck_Timer_Start;
  319. struct timeb V2G_SECC_CableCheck_Timer_End;
  320. struct timeb V2G_SECC_Precharge_Timer_Start;
  321. struct timeb V2G_SECC_Precharge_Timer_End;
  322. struct timeb V2G_SECC_CurrentDemand_Timer_Start;
  323. struct timeb V2G_SECC_CurrentDemand_Timer_End;
  324. struct timeb V2G_SECC_ChargingStatus_Timer_Start;
  325. struct timeb V2G_SECC_ChargingStatus_Timer_End;
  326. struct timeb V2G_SECC_WeldingDetection_Timer_Start;
  327. struct timeb V2G_SECC_WeldingDetection_Timer_End;
  328. struct timeb V2G_SECC_Sequence_Timer_Start;
  329. struct timeb V2G_SECC_Sequence_Timer_End;
  330. struct timeb V2G_SECC_Msg_Timer_Start;
  331. struct timeb V2G_SECC_Msg_Timer_End;
  332. unsigned short SDP_TCP_Server_Port_active;
  333. unsigned char SessionID[8];
  334. unsigned char V2G_Rx_Msg;
  335. unsigned char SequenceError;
  336. unsigned char SupportedAppProtocol_result; //appHandresponseCodeType: 0,1,2
  337. char CM_ATTEN_CHAR_IND_retry;
  338. struct EVCC_SLAC_DATA_TYPE evcc_slac_data;
  339. unsigned char State_Change_Ignored_Notice;
  340. unsigned char EVCCID[8];
  341. unsigned char EVCCID_length;
  342. float AC_EVSENominalVoltage; //unit: 1V
  343. //previous state
  344. float MaximumChargingVoltage_pre; //0~6553.5 volt, unit = 1V
  345. float AvailableChargingCurrent_pre; //0~6553.5 amp, unit =1A
  346. float AvailableChargingPower_pre; //0~6553.5 kW, unit = 1KW
  347. float PresentChargingVoltage_pre; //0~6553.5 volt, unit = 1V
  348. float PresentChargingCurrent_pre; //0~6553.5 amp, unit = 1A
  349. float PresentChargingPower_pre; //0~6553.5 kW, unit = 1KW
  350. float PresentChargedEnergy_pre; //0~6553.5 kWh, unit = 1KWH
  351. int PresentChargedDuration_pre; // second, unit = 1s
  352. int RemainChargingDuration_pre; // second, unit = 1s
  353. float EvBatteryMaxVoltage_pre; // 0~6553.5 volt, unit = 1V
  354. float EvBatteryMaxCurrent_pre; //1A
  355. float EvBatteryMaxPower_pre; //1KW
  356. float EvBatterytargetVoltage_pre; // 0~6553.5 volt, unit = 1V
  357. float EvBatterytargetCurrent_pre; //1A
  358. int EvBatterySoc_pre; // 0~100%, unit = 1%
  359. float EvBatteryCapacity_pre; //1KWH
  360. float EvBatteryEngergyRequest_pre; //1KWH
  361. unsigned char ConnectorPlugIn_pre; //0: unplug, 1: Plug-in
  362. unsigned char ConnectorPlugIn_new; //0: unplug, 1: Plug-in
  363. unsigned char ConnectorLocked_pre; //0: unlocked, 1:locked.
  364. float CpVoltage_pre; //
  365. unsigned char CpState_pre; //1:state A, 2:State B1, 3:State B2, 4:State C, 5:State D, 6:State E, 7:State F, 8: Pilot error
  366. unsigned char CpDuty_pre; //0~100%
  367. float PpVoltage_pre;
  368. unsigned char EVSEPrechargeStatus_pre; //
  369. unsigned char IsolationStatus_pre; //0:ongoing, 1:valid, 2:warning/fault
  370. unsigned char DC_EVSEStatus_pre;
  371. unsigned char SwitchCpStateE_status_pre;
  372. unsigned char V2G_Rx_Msg_pre;
  373. float AC_EVSENominalVoltage_pre; //unit: 1V
  374. };
  375. struct SysInfoData
  376. {
  377. /**************System***************/
  378. unsigned char SystemStatus; //0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
  379. unsigned char FactoryConfiguration; //0: normal, 1: trigger, charger will return the configuration to factory default if trigger
  380. float InputVoltageR; //0~655.35 volt
  381. float InputVoltageS; //0~655.35 volt
  382. float InputVoltageT; //0~655.35 volt
  383. unsigned int SystemFanRotaSpeed; //0 ~ 65535 RPM
  384. unsigned int PsuFanRotaSpeed; //0 ~ 65535 RPM
  385. unsigned char AuxPower5V; //0 ~ 255 volt
  386. unsigned char AuxPower12V; //0 ~ 255 volt
  387. unsigned char AuxPower24V; //0 ~ 255 volt
  388. unsigned char AuxPower48V; //0 ~ 255 volt
  389. unsigned char CsuHwRev[32]; //CSU board hardware version
  390. unsigned char CsuBootLoadFwRev[32]; //CSU board bootloader firmware version
  391. unsigned char CsuKernelFwRev[32]; //CSU board OS kernel firmware version
  392. unsigned char CsuRootFsFwRev[32]; //CSU board root file system firmware version
  393. unsigned char CsuPrimFwRev[32]; //CSU board root file system firmware version
  394. unsigned char LcmHwRev[32]; //LCM module hardware version
  395. unsigned char LcmFwRev[32]; //LCM module firmware version
  396. unsigned char PsuHwRev[32]; //PSU hardware version
  397. unsigned char PsuPrimFwRev[32]; //PSU primary firmware version
  398. unsigned char PsuSecFwRev[32]; //PSU secondary firmware version
  399. unsigned char AuxPwrHwRev[32]; //Aux. power module hardware version
  400. unsigned char AuxPwrFwRev[32]; //Aux. power module firmware version
  401. unsigned char FanModuleHwRev[32]; //Fan module hardware version
  402. unsigned char FanModuleFwRev[32]; //Fan module firmware version
  403. unsigned char RelayModuleHwRev[32]; //Relay control module hardware version
  404. unsigned char RelayModuleFwRev[32]; //Relay control module firmware version
  405. unsigned char TelcomModemFwRev[32]; //the 3G/4G modem firmware version
  406. int SystemAmbientTemp; // -40 ~ 215 degree C
  407. int SystemCriticalTemp; // -40 ~ 215 degree C
  408. int CcsConnectorTemp; // -40 ~ 215 degree C
  409. int PsuAmbientTemp; // -40 ~ 215 degree C
  410. /**************Charging***************/
  411. struct ChargingInfoData ChademoChargingData[CHAdeMO_QUANTITY];
  412. struct ChargingInfoData CcsChargingData[CCS_QUANTITY];
  413. struct ChargingInfoData GbChargingData[GB_QUANTITY];
  414. /**************Network***************/
  415. unsigned char InternetConn; //0: disconnected, 1: connected
  416. /**************Backend***************/
  417. unsigned char OcppConnStatus; //0: disconnected, 1: connected
  418. };
  419. struct SysConfigAndInfo
  420. {
  421. struct SysConfigData SysConfig;
  422. struct SysInfoData SysInfo;
  423. };
  424. struct FaultCodeData
  425. {
  426. unsigned char PreviousFaultVal[4];
  427. union
  428. {
  429. unsigned char FaultVal[4];
  430. struct
  431. {
  432. //FaultVal[0]
  433. unsigned char ChademoOutputFuseBlew : 1; //bit 0
  434. unsigned char CcsOutputFuseBlew : 1; //bit 1
  435. unsigned char GbOutputFuseBlew : 1; //bit 2
  436. unsigned char RcdSelfTestFail : 1; //bit 3
  437. unsigned char AcInputContactor1Welding : 1; //bit 4
  438. unsigned char AcInputContactor1DrivingFault : 1; //bit 5
  439. unsigned char AcInputContactor2Welding : 1; //bit 6
  440. unsigned char AcInputContactor2DrivingFault : 1; //bit 7
  441. //FaultVal[1]
  442. unsigned char AcOutputRelayWelding : 1; //bit 0
  443. unsigned char AcOutputRelayDrivingFault : 1; //bit 1
  444. unsigned char ChademoOutputRelayWelding : 1; //bit 2
  445. unsigned char ChademoOutputRelayDrivingFault : 1; //bit 3
  446. unsigned char CcsOutputRelayWelding : 1; //bit 4
  447. unsigned char CcsOutputRelayDrivingFault : 1; //bit 5
  448. unsigned char GbOutputRelayWelding : 1; //bit 6
  449. unsigned char GbOutputRelayDrivingFault : 1; //bit 7
  450. //FaultVal[2]
  451. unsigned char AcConnectorTempSensorBroken : 1; //bit 0
  452. unsigned char ChademoConnectorTempSensorBroken : 1; //bit 1
  453. unsigned char CcsConnectorTempSensorBroken : 1; //bit 2
  454. unsigned char GbConnectorTempSensorBroken : 1; //bit 3
  455. unsigned char WiFiModuleBroken : 1; //bit 4
  456. unsigned char Telecom4GModuleBroken : 1; //bit 5
  457. unsigned char AuxPowerModuleBroken : 1; //bit 6
  458. unsigned char RelayControlModuleBroken : 1; //bit 7
  459. //FaultVal[3]
  460. unsigned char ChademoConnectorLockFail : 1; //bit 0
  461. unsigned char GbConnectorLockFail : 1; //bit 1
  462. unsigned char AcConnectorLockFail : 1; //bit 2
  463. unsigned char ChademoModuleBroken : 1; //bit 3
  464. unsigned char CcsModuleBroken : 1; //bit 4
  465. unsigned char GbModuleBroken : 1; //bit 5
  466. unsigned char PsuModuleBroken : 1; //bit 6
  467. unsigned char : 1; //bit 7 reserved
  468. } bits;
  469. } FaultEvents;
  470. };
  471. struct AlarmCodeData
  472. {
  473. unsigned char PreviousAlarmVal[8];
  474. union
  475. {
  476. unsigned char AlarmVal[8];
  477. struct
  478. {
  479. //AlarmVal[0]
  480. unsigned char SystemL1InputOVP : 1; //bit 0
  481. unsigned char SystemL2InputOVP : 1; //bit 1
  482. unsigned char SystemL3InputOVP : 1; //bit 2
  483. unsigned char SystemL1InputUVP : 1; //bit 3
  484. unsigned char SystemL2InputUVP : 1; //bit 4
  485. unsigned char SystemL3InputUVP : 1; //bit 5
  486. unsigned char PsuL1InputOVP : 1; //bit 6
  487. unsigned char PsuL2InputOVP : 1; //bit 7
  488. //AlarmVal[1]
  489. unsigned char PsuL3InputOVP : 1; //bit 0
  490. unsigned char PsuL1InputUVP : 1; //bit 1
  491. unsigned char PsuL2InputUVP : 1; //bit 2
  492. unsigned char PsuL3InputUVP : 1; //bit 3
  493. unsigned char SystemL1InputDrop : 1; //bit 4
  494. unsigned char SystemL2InputDrop : 1; //bit 5
  495. unsigned char SystemL3InputDrop : 1; //bit 6
  496. unsigned char SystemAcOutputOVP : 1; //bit 7
  497. //AlarmVal[2]
  498. unsigned char SystemAcOutputOCP : 1; //bit 0
  499. unsigned char SystemChademoOutputOVP : 1; //bit 1
  500. unsigned char SystemChademoOutputOCP : 1; //bit 2
  501. unsigned char SystemCcsOutputOVP : 1; //bit 3
  502. unsigned char SystemCcsOutputOCP : 1; //bit 4
  503. unsigned char SystemGbOutputOVP : 1; //bit 5
  504. unsigned char SystemGbOutputOCP : 1; //bit 6
  505. unsigned char SystemAmbientOTP : 1; //bit 7
  506. //AlarmVal[3]
  507. unsigned char SystemCriticalPointOTP : 1; //bit 0
  508. unsigned char PsuAmbientOTP : 1; //bit 1
  509. unsigned char PsuCriticalPointOTP : 1; //bit 2
  510. unsigned char AuxPowerModuleOTP : 1; //bit 3
  511. unsigned char RelayBoardOTP : 1; //bit 4
  512. unsigned char ChademoConnectorOTP : 1; //bit 5
  513. unsigned char CcsConnectorOTP : 1; //bit 6
  514. unsigned char GbConnectorOTP : 1; //bit 7
  515. //AlarmVal[4]
  516. unsigned char AcConnectorOTP : 1; //bit 0
  517. unsigned char RcdTrip : 1; //bit 1
  518. unsigned char ChademoGfdTrip : 1; //bit 2
  519. unsigned char CcsGfdTrip : 1; //bit 3
  520. unsigned char GbGfdTrip : 1; //bit 4
  521. unsigned char SpdTrip : 1; //bit 5
  522. unsigned char MainPowerBreakerTrip : 1; //bit 6
  523. unsigned char AuxPowerBreakerTrip : 1; //bit 7
  524. //AlarmVal[5]
  525. unsigned char PsuCommunicationFail : 1; //bit 0
  526. unsigned char WiFiModuleCommFail : 1; //bit 1
  527. unsigned char Telecom4GModuleCommFail : 1; //bit 2
  528. unsigned char RfidModuleCommFail : 1; //bit 3
  529. unsigned char BluetoothModuleCommFail : 1; //bit 4
  530. unsigned char LcmModuleCommFail : 1; //bit 5
  531. unsigned char AuxPowerModuleCommFail : 1; //bit 6
  532. unsigned char RelayBoardCommFail : 1; //bit 7
  533. //AlarmVal[6]
  534. unsigned char CcsModuleCommFail : 1; //bit 0
  535. unsigned char ChademoModuleCommFail : 1; //bit 1
  536. unsigned char GbModuleCommFail : 1; //bit 2
  537. unsigned char EmergencyStopTrip : 1; //bit 3
  538. unsigned char DoorOpen : 1; //bit 4
  539. unsigned char SystemFanDecay : 1; //bit 5
  540. unsigned char FailToCreateShareMemory : 1; //bit 6
  541. unsigned char CsuInitFailed : 1; //bit 7
  542. //AlarmVal[7]
  543. unsigned char : 8; //reserved
  544. } bits;
  545. } AlarmEvents;
  546. };
  547. struct InfoCodeData
  548. {
  549. unsigned char PreviousInfoVal[8];
  550. union
  551. {
  552. unsigned char InfoVal[8];
  553. struct
  554. {
  555. //InfoVal[0]
  556. unsigned char NormalStopChargingByUser : 1; //bit 0
  557. unsigned char ChargingTimesUp : 1; //bit 1
  558. unsigned char ReplaceSystemAirFilter : 1; //bit 2
  559. unsigned char ReachChademoMaxPluggingTimes : 1; //bit 3
  560. unsigned char ReachCcsMaxPluggingTimes : 1; //bit 4
  561. unsigned char ReachGbMaxPluggingTimes : 1; //bit 5
  562. unsigned char ReachAcMaxPluggingTimes : 1; //bit 6
  563. unsigned char CsuFimrwareUpdateFail : 1; //bit 7
  564. //InfoVal[1]
  565. unsigned char ChademoModuleFimrwareUpdateFail : 1; //bit 0
  566. unsigned char CcsModuleFimrwareUpdateFail : 1; //bit 1
  567. unsigned char GbModuleFimrwareUpdateFail : 1; //bit 2
  568. unsigned char AuxPowerModuleFimrwareUpdateFail : 1; //bit 3
  569. unsigned char RelayBoardFimrwareUpdateFail : 1; //bit 4
  570. unsigned char LcmModuleFimrwareUpdateFail : 1; //bit 5
  571. unsigned char BluetoothModuleFimrwareUpdateFail : 1; //bit 6
  572. unsigned char WiFiModuleFimrwareUpdateFail : 1; //bit 7
  573. //InfoVal[2]
  574. unsigned char Telocom4GModuleFimrwareUpdateFail : 1; //bit 0
  575. unsigned char PsuFimrwareUpdateFail : 1; //bit 1
  576. unsigned char RfidModuleFimrwareUpdateFail : 1; //bit 2
  577. unsigned char ConfiguredByUsbFlashDrive : 1; //bit 3
  578. unsigned char ConfiguredByBackend : 1; //bit 4
  579. unsigned char ConfiguredByWebpage : 1; //bit 5
  580. unsigned char InternetDisconnectViaEthernet : 1; //bit 6
  581. unsigned char InternetDisconnectViaWiFi : 1; //bit 7
  582. //InfoVal[3]
  583. unsigned char InternetDisconnectVia4Gi : 1; //bit 0
  584. unsigned char ApDisconnectViaWiFi : 1; //bit 1
  585. unsigned char ApnDisconnectVia4Gi : 1; //bit 2
  586. unsigned char : 5; //bit 3~7 reserved
  587. //InfoVal[4]
  588. unsigned char ChademoSeccCommFail : 1; //bit 0
  589. unsigned char CcsSeccCommFail : 1; //bit 1
  590. unsigned char GbSeccCommFail : 1; //bit 2
  591. unsigned char PilotFault : 1; //bit 3
  592. unsigned char ChademoBatteryMalfun : 1; //bit 4
  593. unsigned char ChademoNoPermission : 1; //bit 5
  594. unsigned char ChademoBatteryIncompatibility : 1; //bit 6
  595. unsigned char ChademoBatteryOVP : 1; //bit 7
  596. //InfoVal[5]
  597. unsigned char ChademoBatteryUVP : 1; //bit 0
  598. unsigned char ChademoBatteryOTP : 1; //bit 1
  599. unsigned char ChademoBatteryCurrentDiff : 1; //bit 2
  600. unsigned char ChademoBatteryVoltageDiff : 1; //bit 3
  601. unsigned char ChademoShiftPosition : 1; //bit 4
  602. unsigned char ChademoBatteryOtherFault : 1; //bit 5
  603. unsigned char ChademoChargingSystemError : 1; //bit 6
  604. unsigned char ChademoEvNormalStop : 1; //bit 7
  605. //InfoVal[6]
  606. unsigned char : 8; //bit 0~7 reserved
  607. //InfoVal[7]
  608. unsigned char BackendDisconnectedViaEthernet : 1; //bit 0
  609. unsigned char BackendDisconnectViaWiFi : 1; //bit 1
  610. unsigned char BackendDisconnectVia4G : 1; //bit 2
  611. unsigned char BackendRemoteStart : 1; //bit 3
  612. unsigned char BackendRemoteStop : 1; //bit 4
  613. unsigned char BackendRemoteReset : 1; //bit 5
  614. unsigned char : 2; //bit 6~7 reserved
  615. } bits;
  616. } InfoEvents;
  617. };
  618. struct StatusCodeData {
  619. unsigned char PresentStatusCode[10][6];
  620. struct FaultCodeData FaultCode;
  621. struct AlarmCodeData AlarmCode;
  622. struct InfoCodeData InfoCode;
  623. };
  624. /************************************************************************************/
  625. /**************************CCS protocol Share memory***************************/
  626. /**************************DIN70121: 201412***************************************/
  627. /**************************ISO15118_2014: 2014************************************/
  628. /**************************ISO15118_2018: 2018************************************/
  629. /************************************************************************************/
  630. typedef enum boolean { FALSE, TRUE } BOOL;
  631. enum ResponseCodeType_DIN70121 {
  632. OK_DIN70121 = 0,
  633. OK_NewSessionEstablished_DIN70121 = 1,
  634. OK_OldSessionJoined_DIN70121 = 2,
  635. OK_CertificateExpiresSoon_DIN70121 = 3,
  636. FAILED_DIN70121 = 4,
  637. FAILED_SequenceError_DIN70121 = 5,
  638. FAILED_ServiceIDInvalid_DIN70121 = 6,
  639. FAILED_UnknownSession_DIN70121 = 7,
  640. FAILED_ServiceSelectionInvalid_DIN70121 = 8,
  641. FAILED_PaymentSelectionInvalid_DIN70121 = 9,
  642. FAILED_CertificateExpired_DIN70121 = 10,
  643. FAILED_SignatureError_DIN70121 = 11,
  644. FAILED_NoCertificateAvailable_DIN70121 = 12,
  645. FAILED_CertChainError_DIN70121 = 13,
  646. FAILED_ChallengeInvalid_DIN70121 = 14,
  647. FAILED_ContractCanceled_DIN70121 = 15,
  648. FAILED_WrongChargeParameter_DIN70121 = 16,
  649. FAILED_PowerDeliveryNotApplied_DIN70121 = 17,
  650. FAILED_TariffSelectionInvalid_DIN70121 = 18,
  651. FAILED_ChargingProfileInvalid_DIN70121 = 19,
  652. FAILED_EVSEPresentVoltageToLow_DIN70121 = 20,
  653. FAILED_MeteringSignatureNotValid_DIN70121 = 21,
  654. FAILED_WrongEnergyTransferType_DIN70121 = 22
  655. };
  656. enum ResponseCodeType_ISO15118_2014 {
  657. OK_ISO15118_2014 = 0,
  658. OK_NewSessionEstablished_ISO15118_2014 = 1,
  659. OK_OldSessionJoined_ISO15118_2014 = 2,
  660. OK_CertificateExpiresSoon_ISO15118_2014 = 3,
  661. FAILED_ISO15118_2014 = 4,
  662. FAILED_SequenceError_ISO15118_2014 = 5,
  663. FAILED_ServiceIDInvalid_ISO15118_2014 = 6,
  664. FAILED_UnknownSession_ISO15118_2014 = 7,
  665. FAILED_ServiceSelectionInvalid_ISO15118_2014 = 8,
  666. FAILED_PaymentSelectionInvalid_ISO15118_2014 = 9,
  667. FAILED_CertificateExpired_ISO15118_2014 = 10,
  668. FAILED_SignatureError_ISO15118_2014 = 11,
  669. FAILED_NoCertificateAvailable_ISO15118_2014 = 12,
  670. FAILED_CertChainError_ISO15118_2014 = 13,
  671. FAILED_ChallengeInvalid_ISO15118_2014 = 14,
  672. FAILED_ContractCanceled_ISO15118_2014 = 15,
  673. FAILED_WrongChargeParameter_ISO15118_2014 = 16,
  674. FAILED_PowerDeliveryNotApplied_ISO15118_2014 = 17,
  675. FAILED_TariffSelectionInvalid_ISO15118_2014 = 18,
  676. FAILED_ChargingProfileInvalid_ISO15118_2014 = 19,
  677. FAILED_MeteringSignatureNotValid_ISO15118_2014 = 20,
  678. FAILED_NoChargeServiceSelected_ISO15118_2014 = 21,
  679. FAILED_WrongEnergyTransferMode_ISO15118_2014 = 22,
  680. FAILED_ContactorError_ISO15118_2014 = 23,
  681. FAILED_CertificateNotAllowedAtThisEVSE_ISO15118_2014 = 24,
  682. FAILED_CertificateRevoked_ISO15118_2014 = 25
  683. };
  684. enum ResponseCodeType_ISO15118_2018 {
  685. OK_ISO15118_2018 = 0,
  686. OK_NewSessionEstablished_ISO15118_2018 = 1,
  687. OK_OldSessionJoined_ISO15118_2018 = 2,
  688. OK_CertificateExpiresSoon_ISO15118_2018 = 3,
  689. OK_IsolationValid_ISO15118_2018 = 4,
  690. OK_IsolationWarning_ISO15118_2018 = 5,
  691. WARNING_CertificateExpired_ISO15118_2018 = 6,
  692. WARNING_NoCertificateAvailable_ISO15118_2018 = 7,
  693. WARNING_CertValidationError_ISO15118_2018 = 8,
  694. WARNING_CertVerificationError_ISO15118_2018 = 9,
  695. WARNING_ContractCanceled_ISO15118_2018 = 10,
  696. FAILED_ISO15118_2018 = 11,
  697. FAILED_SequenceError_ISO15118_2018 = 12,
  698. FAILED_ServiceIDInvalid_ISO15118_2018 = 13,
  699. FAILED_UnknownSession_ISO15118_2018 = 14,
  700. FAILED_ServiceSelectionInvalid_ISO15118_2018 = 15,
  701. FAILED_SignatureError_ISO15118_2018 = 16,
  702. FAILED_IdentificationSelectionInvalid_ISO15118_2018 = 17,
  703. FAILED_ChallengeInvalid_ISO15118_2018 = 18,
  704. FAILED_WrongChargeParameter_ISO15118_2018 = 19,
  705. FAILED_IsolationFault_ISO15118_2018 = 20,
  706. FAILED_PowerDeliveryNotApplied_ISO15118_2018 = 21,
  707. FAILED_TariffSelectionInvalid_ISO15118_2018 = 22,
  708. FAILED_ChargingProfileInvalid_ISO15118_2018 = 23,
  709. FAILED_MeteringSignatureNotValid_ISO15118_2018 = 24,
  710. FAILED_NoChargeServiceSelected_ISO15118_2018 = 25,
  711. FAILED_WrongEnergyTransferMode_ISO15118_2018 = 26,
  712. FAILED_ContactorError_ISO15118_2018 = 27,
  713. FAILED_CertificateRevoked_ISO15118_2018 = 28,
  714. FAILED_CertificateNotYetValid_ISO15118_2018 = 29
  715. };
  716. enum EVSENotificationType { None = 0, StopCharging = 1, ReNegotiation = 2};
  717. enum ServiceCategoryType { EVCharging = 0, Internet = 1, ContractCertificate = 2, OtherCustom = 3};
  718. enum PaymentOptionType { Contract = 0, ExternalPayment = 1};
  719. /*enum EVSESupportedEnergyTransferType { AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
  720. DC_combo_core = 4, DC_dual = 5, AC_core1p_DC_extended = 6, AC_single_DC_core = 7,
  721. AC_single_phase_three_phase_core_DC_extended = 8, AC_core3p_DC_extended = 9};*/
  722. enum EnergyTransferModeType {
  723. AC_single_phase_core = 0,
  724. AC_three_phase_core = 1,
  725. DC_core = 2,
  726. DC_extended = 3,
  727. DC_combo_core = 4,
  728. DC_unique = 5
  729. };
  730. //enum identificationOptionType { Contract = 0, ExternalIdentification = 1};
  731. enum unitSymbolType_DIN70121 {
  732. H_DIN70121 = 0,
  733. M_DIN70121 = 1,
  734. S_DIN70121 = 2,
  735. A_DIN70121 = 3,
  736. AH_DIN70121 = 4,
  737. V_DIN70121 = 5,
  738. VA_DIN70121 = 6,
  739. W_DIN70121 = 7,
  740. WS_DIN70121 = 8,
  741. WH_DIN70121 = 9};
  742. enum unitSymbolType_ISO15118_2014 {
  743. h_ISO15118_2014 = 0,
  744. m_ISO15118_2014 = 1,
  745. s_ISO15118_2014 = 2,
  746. A_ISO15118_2014 = 3,
  747. V_ISO15118_2014 = 4,
  748. W_ISO15118_2014 = 5,
  749. Wh_ISO15118_2014 = 6
  750. };
  751. enum ProcessingType { Finished = 0, Ongoing = 1, Ongoing_WaitingForCustomerInteraction = 2};
  752. enum EVSEProcessingType_DIN70121 { Finished_DIN70121 = 0, Ongoing_DIN70121 = 1};
  753. enum EVSEProcessingType_ISO15118_2014 { Finished_ISO15118_2014 = 0, Ongoing_ISO15118_2014 = 1, Ongoing_WaitingForCustomerInteraction_ISO15118_2014=2 };
  754. enum DC_EVErrorCodeType {
  755. NO_ERROR = 0,
  756. FAILED_RESSTemperatureInhibit = 1,
  757. FAILED_EVShiftPosition = 2,
  758. FAILED_ChargerConnectorLockFault = 3,
  759. FAILED_EVRESSMalfunction = 4,
  760. FAILED_ChargingCurrentdifferential = 5,
  761. FAILED_ChargingVoltageOutOfRange = 6,
  762. Reserved_A = 7,
  763. Reserved_B = 8,
  764. Reserved_C = 9,
  765. FAILED_ChargingSystemIncompatibility = 10,
  766. NoData = 11
  767. };
  768. enum IsolationLevelType_DIN70121 {
  769. Invalid_DIN70121 = 0,
  770. Valid_DIN70121 = 1,
  771. Warning_DIN70121 = 2,
  772. Fault_DIN70121 = 3
  773. };
  774. enum IsolationLevelType_ISO15118_2014 {
  775. Invalid_ISO15118_2014 = 0,
  776. Valid_ISO15118_2014 = 1,
  777. Warning_ISO15118_2014 = 2,
  778. Fault_ISO15118_2014 = 3,
  779. No_IMD_ISO15118_2014 = 4
  780. };
  781. enum DC_EVSEStatusCodeType {
  782. EVSE_NotReady = 0,
  783. EVSE_Ready = 1,
  784. EVSE_Shutdown = 2,
  785. EVSE_UtilityInterruptEvent = 3,
  786. EVSE_IsolationMonitoringActive = 4,
  787. EVSE_EmergencyShutdown = 5,
  788. EVSE_Malfunction = 6,
  789. Reserved_8 = 7,
  790. Reserved_9 = 8
  791. };
  792. enum ScheduleOriginType { EV = 0, SA = 1};
  793. enum ChargeProgressType_ISO15118_2014 {start_ISO15118_2014 = 0, Stop_ISO15118_2014 = 1, Renegotiate_ISO15118_2014 = 2};
  794. enum ChargeProgressType_ISO15118_2018 {start_ISO15118_2018 = 0, Renegotiate_ISO15118_2018 = 1, Standby_ISO15118_2018 = 2, Stop_ISO15118_2018 = 3};
  795. enum evOperationType {Charge = 0, Discharge = 1, Standby = 2};
  796. enum mechanicalChargingDeviceStatusType {Home = 0, Moving = 1, EndPosition = 2};
  797. enum EV_CP_StatusType {A = 0, B = 1, C = 2, D = 3, E = 4, F = 5};
  798. enum EV_Error_Status_CodeType { No_EV_Error = 0, EV_FAILED_EmergencyEvent = 1, EV_FAILED_Breaker = 2, EV_FAILED_RESSTemperatureInhibit = 3,
  799. EV_FAILED_RESS = 4, EV_FAILED_ChargingCurrentDifferential = 5, EV_FAILED_ChargingVoltageOutOfRange = 6,
  800. Reserved_by_ISO_1 = 7, Reserved_by_ISO_2 = 8, Reserved_by_ISO_3 = 9, OEM1 = 10,
  801. OEM2 = 11, OEM3 = 12, OEM4 = 13};
  802. enum IsolationStatusType { Invalid = 0, Safe = 1, Warning = 2, Fault = 3};
  803. enum ChargingSessionType { Terminate = 0, Pause = 1};
  804. enum CostKindType { relativePricePercentage = 0, RenewableGenerationPercentage = 1, CarbonDioxideEmission = 2};
  805. enum MsgFlowStatus {
  806. IDLE = 0,
  807. CM_SLAC_PARM_REQ = 1,
  808. CM_SLAC_PARM_CONF = 2,
  809. CM_START_ATTEN_CHAR_IND = 3,
  810. CM_MNBC_SOUND_IND = 4,
  811. CM_ATTEN_CHAR_IND = 5,
  812. CM_ATTEN_CHAR_RSP = 6,
  813. CM_VALIDATE_REQ = 7,
  814. CM_VALIDATE_CNF = 8,
  815. CM_SLAC_MATCH_REQ = 9,
  816. CM_SLAC_MATCH_CNF = 10,
  817. CM_AMP_MAP_REQ = 11,
  818. CM_AMP_MAP_CNF = 12,
  819. CM_SET_KEY_REQ = 13,
  820. CM_SET_KEY_CNF = 14,
  821. SLACC_SDP_UDP_Connection = 15,
  822. SLACC_SDP_TCP_Connection = 16,
  823. SupportedAppProtocolRequest = 17,
  824. SupportedAppProtocolResponse = 18,
  825. SessionSetupRequest = 19,
  826. SessionSetupResponse = 20,
  827. ServiceDiscoveryRequest = 21,
  828. ServiceDiscoveryResponse = 22,
  829. ServiceDetailRequest = 23,
  830. ServiceDetailResponse = 24,
  831. ServiceAndPaymentSelectionRequest = 25,
  832. ServiceAndPaymentSelectionResponse = 26,
  833. PaymentDetailsRequest = 27,
  834. PaymentDetailsResponse = 28,
  835. AuthorizationRequest = 29,
  836. AuthorizationResponse = 30,
  837. CertificateUpdateRequest = 31,
  838. CertificateUpdateResponse = 32,
  839. CertificateInstallationRequest = 33,
  840. CertificateInstallationResponse = 34,
  841. ChargeParameterDiscoveryRequest = 35,
  842. ChargeParameterDiscoveryResponse = 36,
  843. CableCheckRequest = 37,
  844. CableCheckResponse = 38,
  845. PreChargeRequest = 39,
  846. PreChargeResponse = 40,
  847. PowerDeliveryRequestStart = 41,
  848. PowerDeliveryResponsetStart = 42,
  849. ChargingStatusRequest = 43,
  850. ChargingStatusResponse = 44,
  851. CurrentDemandRequest = 45,
  852. CurrentDemandResponse = 46,
  853. MeteringReceiptRequest = 47,
  854. MeteringReceiptResponse = 48,
  855. PowerDeliveryRequestStop = 49,
  856. PowerDeliveryResponseStop = 50,
  857. WeldingDetectionRequest = 51,
  858. WeldingDetectionResponse = 52,
  859. SessionStopRequest = 53,
  860. SessionStopResponse = 54,
  861. Performance_Timeout = 253,
  862. Sequence_Timeout = 254,
  863. Other_Fault = 255
  864. };
  865. struct PhysicalValueType_DIN70121 { //The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
  866. int Multiplier; //range: -3..+3
  867. enum unitSymbolType_DIN70121 Unit;
  868. short Value;
  869. };
  870. struct PhysicalValueType_ISO15118_2014 { //The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
  871. int Multiplier; //range: -3..+3
  872. enum unitSymbolType_ISO15118_2014 Unit;
  873. short Value;
  874. };
  875. struct PhysicalValueType_ISO15118_2018 //The final physical value is determined by: Value * 10 ^ Exponent [Unit]
  876. {
  877. int Exponent; //range: -3..+3
  878. short Value;
  879. };
  880. struct AppProtocolType {
  881. unsigned char ProtocolNamespace[100];
  882. unsigned int ProtocolNamespaceLen;
  883. unsigned int VersionNumberMajor;
  884. unsigned int VersionNumberMinor;
  885. unsigned char SchemaID;
  886. unsigned char Priority; //range 1..20
  887. };
  888. struct ACD_SSEnergyTransferModeType
  889. {
  890. unsigned char EVID[20];
  891. };
  892. struct EVSEStatusType
  893. {
  894. unsigned short NotificationMaxDelay; //in seconds
  895. enum EVSENotificationType EVSENotification;
  896. };
  897. struct ServiceIDListType
  898. {
  899. unsigned short ServiceID[10]; //refer to chapter 8.6.2.1 Table 192
  900. };
  901. struct PaymentOptionListType
  902. {
  903. enum PaymentOptionType PaymentOption[2];
  904. };
  905. struct ServiceTagType
  906. {
  907. unsigned short ServiceID;
  908. unsigned char ServiceName[32]; //Optional Element
  909. enum ServiceCategoryType ServiceCategory;
  910. unsigned char ServiceScope[32]; //Optional Element
  911. };
  912. struct ServiceType_DIN70121
  913. {
  914. struct ServiceTagType ServiceTag;
  915. BOOL FreeService;
  916. };
  917. struct ServiceType_ISO15118_2014
  918. {
  919. unsigned short ServiceID;
  920. unsigned char ServiceName[32]; //Optional
  921. enum ServiceCategoryType ServiceCategory;
  922. unsigned char ServiceScope[64]; //Optional
  923. BOOL FreeService;
  924. };
  925. /*struct ServiceType_ISO15118_2018
  926. {
  927. unsigned short ServiceID;
  928. BOOL FreeService;
  929. }; */
  930. struct SupportedEnergyTransferModeType
  931. {
  932. enum EnergyTransferModeType EnergyTransferMode[6];
  933. };
  934. struct ServiceChargeType
  935. {
  936. struct ServiceType_DIN70121 Services;
  937. //enum EVSESupportedEnergyTransferType EnergyTransferType;
  938. enum EnergyTransferModeType EnergyTransferType;
  939. };
  940. struct ChargeServiceType
  941. {
  942. struct ServiceType_ISO15118_2014 Services;
  943. struct SupportedEnergyTransferModeType SupportedEnergyTransferMode;
  944. };
  945. struct ServiceListType
  946. {
  947. struct ServiceType_ISO15118_2014 Service[8];
  948. };
  949. struct IdentificationOptionListType
  950. {
  951. enum PaymentOptionType IdentificationOption[2];
  952. };
  953. struct ParameterType
  954. {
  955. unsigned char Name[32];
  956. struct PhysicalValueType_ISO15118_2014 PhysicalValue_ISO15118_2014;
  957. struct PhysicalValueType_ISO15118_2018 PhysicalValue_ISO15118_2018;
  958. };
  959. struct ParameterSetType
  960. {
  961. short ParameterSetID;
  962. struct ParameterType Parameter[16];
  963. };
  964. struct ServiceParameterListType
  965. {
  966. struct ParameterSetType ParameterSet[255];
  967. };
  968. struct WPT_SDlEnergyTransferModeType
  969. {
  970. struct ServiceParameterListType ServiceParameterList;
  971. };
  972. struct SelectedServiceType
  973. {
  974. unsigned short ServiceID;
  975. short ParameterSetID;
  976. };
  977. struct SelectedServiceListType
  978. {
  979. struct SelectedServiceType SelectedService[16];
  980. unsigned int SelectedServiceLen;
  981. };
  982. struct CertificateChainType
  983. {
  984. unsigned char Id[32]; //Optional
  985. unsigned char Certificate[800]; //check size again
  986. unsigned char SubCertificates[4][800]; //Optional, check size again
  987. };
  988. struct PNC_AReqIdentificationModeType
  989. {
  990. unsigned char GenChallenge[16]; //DIN70121=> None, ISO15118_2014=>None, ISO15118_2018=>Optional
  991. unsigned char Id[32]; //DIN70121=> None, ISO15118_2014=>None, ISO15118_2018=>Optional
  992. };
  993. struct AC_EVChargeParameterType
  994. {
  995. unsigned int DepartureTime; //Optional
  996. struct PhysicalValueType_ISO15118_2014 EAmount;
  997. struct PhysicalValueType_ISO15118_2014 EVMaxVoltage;
  998. struct PhysicalValueType_ISO15118_2014 EVMaxCurrent;
  999. struct PhysicalValueType_ISO15118_2014 EVMinCurrent;
  1000. };
  1001. struct DC_EVStatusType_DIN70121
  1002. {
  1003. BOOL EVReady;
  1004. BOOL EVCabinConditioning;
  1005. BOOL EVRESSConiditioning;
  1006. enum DC_EVErrorCodeType EVErrorCode;
  1007. unsigned char EVRESSSOC; /*0-100 percentage*/
  1008. };
  1009. struct DC_EVChargeParameterType_DIN70121
  1010. {
  1011. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1012. struct PhysicalValueType_DIN70121 EVMaximumCurrentLimit;
  1013. struct PhysicalValueType_DIN70121 EVMaximumPowerLimit; //Optional
  1014. struct PhysicalValueType_DIN70121 EVMaximumVoltageLimit;
  1015. struct PhysicalValueType_DIN70121 EVEnergyCapacity; //Optional
  1016. struct PhysicalValueType_DIN70121 EVEnergyRequest; //Optional
  1017. unsigned char FullSOC; /*0-100 percentage*/ //Optional
  1018. unsigned char BulkSOC; /*0-100 percentage*/ //Optional
  1019. };
  1020. struct DC_EVStatusType_ISO15118_2014
  1021. {
  1022. BOOL EVReady;
  1023. enum DC_EVErrorCodeType EVErrorCode;
  1024. unsigned char EVRESSSOC; /*0-100 percentage*/
  1025. };
  1026. struct DC_EVChargeParameterType_ISO15118_2014
  1027. {
  1028. unsigned int DepartureTime; //Optional
  1029. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1030. struct PhysicalValueType_ISO15118_2014 EVMaximumCurrentLimit;
  1031. struct PhysicalValueType_ISO15118_2014 EVMaximumPowerLimit; //Optional
  1032. struct PhysicalValueType_ISO15118_2014 EVMaximumVoltageLimit;
  1033. struct PhysicalValueType_ISO15118_2014 EVEnergyCapacity; //Optional
  1034. struct PhysicalValueType_ISO15118_2014 EVEnergyRequest; //Optional
  1035. unsigned char FullSOC; /*0-100 percentage*/ //Optional
  1036. unsigned char BulkSOC; /*0-100 percentage*/ //Optional
  1037. };
  1038. struct Dynamic_CPDReqControlModeType
  1039. {
  1040. unsigned int DepartureTime;
  1041. };
  1042. struct RelativeTimeIntervalType
  1043. {
  1044. unsigned int duration; //Optional
  1045. unsigned int start;
  1046. };
  1047. struct PMaxScheduleEntryType
  1048. {
  1049. struct RelativeTimeIntervalType RelativeTimeInterval;
  1050. unsigned short PMax;
  1051. };
  1052. struct PMaxScheduleType
  1053. {
  1054. unsigned short PMaxScheduleID; //no this itme in ISO15118_2014
  1055. struct PMaxScheduleEntryType PMaxScheduleEntry[1024];
  1056. };
  1057. struct CostType
  1058. {
  1059. unsigned int amount;
  1060. enum CostKindType costKind;
  1061. int amountMultiplier; //Optional , range: -3..+3
  1062. };
  1063. struct ConsumptionCostType
  1064. {
  1065. struct CostType Cost[3];
  1066. struct PhysicalValueType_ISO15118_2014 startValue;
  1067. };
  1068. struct SalesTariffEntryType
  1069. {
  1070. struct RelativeTimeIntervalType RelativeTimeInterval;
  1071. unsigned char EPriceLevel; //Optional
  1072. struct ConsumptionCostType ConsumptionCost[3]; //Optional
  1073. };
  1074. struct SalesTariffType
  1075. {
  1076. unsigned char Id[32]; //Optional
  1077. short SalesTariffID;
  1078. unsigned char SalesTariffDescription[32]; //Optional
  1079. unsigned char NumEPriceLevels; //Optional
  1080. struct SalesTariffEntryType SalesTariffEntry[1024];
  1081. };
  1082. struct SAScheduleTupleType
  1083. {
  1084. short SAScheduleTupleID;
  1085. struct PMaxScheduleType PMaxSchedule;
  1086. struct SalesTariffType SalesTariff; //Optional
  1087. };
  1088. struct ScheduleListType
  1089. {
  1090. enum ScheduleOriginType ScheduleOrigin;
  1091. struct SAScheduleTupleType ScheduleTuple[3];
  1092. };
  1093. struct Scheduled_CPDReqControlModeType
  1094. {
  1095. enum ProcessingType EVProcessing;
  1096. unsigned int DepartureTime; //Optional
  1097. unsigned short MaxSupportingPoints;
  1098. struct ScheduleListType ScheduleList; //Optional
  1099. };
  1100. struct AC_CPDReqEnergyTransferModeType
  1101. {
  1102. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1103. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1104. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1105. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1106. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1107. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1108. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1109. };
  1110. struct DC_CPDReqEnergyTransferModeType
  1111. {
  1112. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower; //Optional
  1113. struct PhysicalValueType_ISO15118_2018 EVMinimumChargePower; //Optional
  1114. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1115. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1116. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1117. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1118. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1119. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1120. unsigned char TargetSOC; //Optional
  1121. unsigned char BulkSOC; //Optional
  1122. };
  1123. struct BPT_AC_CPDReqEnergyTransferModeType
  1124. {
  1125. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1126. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargePower;
  1127. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargePower;
  1128. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1129. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargeCurrent;
  1130. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1131. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargeCurrent;
  1132. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1133. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1134. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1135. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1136. };
  1137. struct BPT_DC_CPDReqEnergyTransferModeType
  1138. {
  1139. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1140. struct PhysicalValueType_ISO15118_2018 EVMinimumChargePower;
  1141. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargePower;
  1142. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargePower;
  1143. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1144. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1145. struct PhysicalValueType_ISO15118_2018 EVMaximumDischargeCurrent;
  1146. struct PhysicalValueType_ISO15118_2018 EVMinimumDischargeCurrent;
  1147. struct PhysicalValueType_ISO15118_2018 EVMaximumVoltage;
  1148. struct PhysicalValueType_ISO15118_2018 EVMinimumVoltage;
  1149. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest;
  1150. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest;
  1151. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest;
  1152. unsigned char TargetSOC; //Optional
  1153. unsigned char BulkSOC; //Optional
  1154. };
  1155. struct WPT_CPDReqEnergyTransferModeType
  1156. {
  1157. struct PhysicalValueType_ISO15118_2018 EVMaximumPower; //Optional
  1158. struct PhysicalValueType_ISO15118_2018 EVMinimumPower; //Optional
  1159. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1160. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1161. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1162. };
  1163. struct ACD_CPDReqEnergyTransferModeType
  1164. {
  1165. //cannot be found in standard
  1166. };
  1167. struct SAScheduleListType
  1168. {
  1169. struct SAScheduleTupleType SAScheduleTuple[3];
  1170. };
  1171. struct DC_EVSEStatusType_DIN70121
  1172. {
  1173. enum IsolationLevelType_DIN70121 EVSEIsolationStatus; //Optional
  1174. enum DC_EVSEStatusCodeType EVSEStatusCode;
  1175. unsigned int NotificationMaxDelay;
  1176. enum EVSENotificationType EVSENotification;
  1177. };
  1178. struct DC_EVSEChargeParameterType_DIN70121
  1179. {
  1180. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1181. struct PhysicalValueType_DIN70121 EVSEMaximumCurrentLimit;
  1182. struct PhysicalValueType_DIN70121 EVSEMaximumPowerLimit; //Optional
  1183. struct PhysicalValueType_DIN70121 EVSEMaximumVoltageLimit;
  1184. struct PhysicalValueType_DIN70121 EVSEMinimumCurrentLimit;
  1185. struct PhysicalValueType_DIN70121 EVSEMinimumVoltageLimit;
  1186. struct PhysicalValueType_DIN70121 EVSECurrentRegulationTolerance; //Optional
  1187. struct PhysicalValueType_DIN70121 EVSEPeakCurrentRipple;
  1188. struct PhysicalValueType_DIN70121 EVSEEnergyToBeDelivered; //Optional
  1189. };
  1190. struct AC_EVSEStatusType_ISO15118_2014
  1191. {
  1192. BOOL RCD;
  1193. unsigned short NotificationMaxDelay;
  1194. enum EVSENotificationType EVSENotification; //need to be confirmed
  1195. };
  1196. struct AC_EVSEChargeParameterType_ISO15118_2014
  1197. {
  1198. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1199. struct PhysicalValueType_ISO15118_2014 EVSENominalVoltage;
  1200. struct PhysicalValueType_ISO15118_2014 EVSEMaxCurrent;
  1201. };
  1202. struct DC_EVSEStatusType_ISO15118_2014
  1203. {
  1204. unsigned short NotificationMaxDelay;
  1205. enum EVSENotificationType EVSENotification;
  1206. enum IsolationLevelType_ISO15118_2014 EVSEIsolationStatus; //Optional
  1207. enum DC_EVSEStatusCodeType DC_EVSEStatusCode;
  1208. };
  1209. struct DC_EVSEChargeParameterType_ISO15118_2014
  1210. {
  1211. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1212. struct PhysicalValueType_ISO15118_2014 EVSEMaximumCurrentLimit;
  1213. struct PhysicalValueType_ISO15118_2014 EVSEMaximumPowerLimit;
  1214. struct PhysicalValueType_ISO15118_2014 EVSEMaximumVoltageLimit;
  1215. struct PhysicalValueType_ISO15118_2014 EVSEMinimumCurrentLimit;
  1216. struct PhysicalValueType_ISO15118_2014 EVSEMinimumVoltageLimit;
  1217. struct PhysicalValueType_ISO15118_2014 EVSECurrentRegulationTolerance; //Optional
  1218. struct PhysicalValueType_ISO15118_2014 EVSEPeakCurrentRipple;
  1219. struct PhysicalValueType_ISO15118_2014 EVSEEnergyToBeDelivered; //Optional
  1220. };
  1221. struct Scheduled_CPDResControlModeType
  1222. {
  1223. struct ScheduleListType ScheduleList;
  1224. };
  1225. struct AC_CPDResEnergyTransferModeType
  1226. {
  1227. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent[3];
  1228. struct PhysicalValueType_ISO15118_2018 EVSENominalVoltage;
  1229. struct PhysicalValueType_ISO15118_2018 EVSENominalFrequency;
  1230. };
  1231. struct DC_CPDResEnergyTransferModeType
  1232. {
  1233. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower;
  1234. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent;
  1235. struct PhysicalValueType_ISO15118_2018 EVSEMinimumChargeCurrent;
  1236. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage;
  1237. struct PhysicalValueType_ISO15118_2018 EVSEMinimumVoltage;
  1238. };
  1239. struct BPT_AC_CPDResEnergyTransferModeType
  1240. {
  1241. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent[3];
  1242. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargeCurrent[3];
  1243. struct PhysicalValueType_ISO15118_2018 EVSENominalVoltage;
  1244. struct PhysicalValueType_ISO15118_2018 EVSENominalFrequency;
  1245. };
  1246. struct BPT_DC_CPDResEnergyTransferModeType
  1247. {
  1248. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower;
  1249. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargePower;
  1250. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent;
  1251. struct PhysicalValueType_ISO15118_2018 EVSEMaximumDischargeCurrent;
  1252. struct PhysicalValueType_ISO15118_2018 EVSEMinimumChargeCurrent;
  1253. struct PhysicalValueType_ISO15118_2018 EVSEMinimumDischargeCurrent;
  1254. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage;
  1255. struct PhysicalValueType_ISO15118_2018 EVSEMinimumVoltage;
  1256. };
  1257. struct WPT_CPDResEnergyTransferModeType
  1258. {
  1259. struct PhysicalValueType_ISO15118_2018 EVSEMaximumPower;
  1260. struct PhysicalValueType_ISO15118_2018 EVSEMinimumPower;
  1261. };
  1262. struct ACD_CPDResEnergyTransferModeType
  1263. {
  1264. //not found in ISO15118_2018
  1265. };
  1266. struct ProfileEntryType_DIN70121
  1267. {
  1268. unsigned int ChargingProfileEntryStart;
  1269. short ChargingProfileEntryMaxPower;
  1270. };
  1271. struct ChargingProfileType_DIN70121
  1272. {
  1273. short SAScheduleTupleID;
  1274. struct ProfileEntryType_DIN70121 ProfileEntry[24];
  1275. };
  1276. struct DC_EVPowerDeliveryParameterType_DIN70121
  1277. {
  1278. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1279. BOOL BulkChargingComplete; //Optional
  1280. BOOL ChargingComplete;
  1281. };
  1282. struct ProfileEntryType_ISO15118_2014
  1283. {
  1284. unsigned int ChargingProfileEntryStart;
  1285. struct PhysicalValueType_ISO15118_2018 ChargingProfileEntryMaxPower;
  1286. unsigned char ChargingProfileEntryMaxNumberOfPhasesInUse; //Optional
  1287. };
  1288. struct ChargingProfileType_ISO15118_2014
  1289. {
  1290. struct ProfileEntryType_ISO15118_2014 ProfileEntry[24];
  1291. };
  1292. struct DC_EVPowerDeliveryParameterType_ISO15118_2014
  1293. {
  1294. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1295. BOOL BulkChargingComplete; //Optional
  1296. BOOL ChargingComplete;
  1297. };
  1298. struct TimeInterval
  1299. {
  1300. unsigned int start;
  1301. unsigned int duration; //Optional
  1302. };
  1303. struct PowerScheduleEntryType
  1304. {
  1305. struct TimeInterval TimeInterval;
  1306. struct PhysicalValueType_ISO15118_2018 Power[3];
  1307. };
  1308. struct EVPowerProfileType
  1309. {
  1310. struct PowerScheduleEntryType EVPowerProfileEntry[2048];
  1311. };
  1312. struct Scheduled_PDReqControlModeType
  1313. {
  1314. unsigned char ScheduleTupleID;
  1315. struct EVPowerProfileType EVPowerProfile;
  1316. };
  1317. struct BPT_Scheduled_PDReqControlModeType
  1318. {
  1319. unsigned char ScheduleTupleID;
  1320. struct EVPowerProfileType EVPowerProfile; //Optional
  1321. enum evOperationType EVOperation;
  1322. };
  1323. struct ListOfRootCertificateIDsType
  1324. {
  1325. unsigned char RootCertificateID[20][40];
  1326. };
  1327. struct ContractSignatureEncryptedPrivateKeyType
  1328. {
  1329. unsigned char Id[32];
  1330. };
  1331. struct DiffieHellmanPublickeyType
  1332. {
  1333. unsigned char Id[32];
  1334. };
  1335. struct ContractCertificateEncryptedPrivateKeyType
  1336. {
  1337. unsigned char Id[32];
  1338. };
  1339. struct EVTechnicalStatusType
  1340. {
  1341. BOOL EV_Status_ReadyToCharge;
  1342. BOOL EV_Status_ImmobilizationRequest; //Optional
  1343. BOOL EV_Status_Immobilized;
  1344. struct PhysicalValueType_ISO15118_2018 EV_Status_WLAN_Strength;
  1345. enum EV_CP_StatusType EV_CP_Status;
  1346. unsigned char EV_Status_RESSSOC; //0~100%
  1347. enum EV_Error_Status_CodeType EV_Error_Status_Code;
  1348. BOOL EVSE_Timeout;
  1349. };
  1350. struct MeterInfoType_ISO15118_2014
  1351. {
  1352. unsigned char MeterID[32];
  1353. unsigned long MeterReading; //Optional
  1354. unsigned char SigMeterReading[64]; //Optional
  1355. short MeterStatus; //Optional
  1356. long TMeter; //Optional
  1357. };
  1358. struct Scheduled_MRReqControlModeType
  1359. {
  1360. unsigned char ScheduleTupleID;
  1361. };
  1362. struct MeterInfoType_ISO15118_2018
  1363. {
  1364. unsigned char MeterID[32];
  1365. unsigned long MeterReadingWhCharged; //Optional
  1366. unsigned long MeterReadingWhDischarged; //Optional
  1367. unsigned long MeterReadingVARhLeading; //Optional
  1368. unsigned long MeterReadingVARhLagging; //Optional
  1369. unsigned char SignatureMeterReading[64]; //Optional
  1370. short MeterStatus; //Optional
  1371. short TimeStampMeter; //Optional
  1372. BOOL ReceiptRequired; //Optional
  1373. };
  1374. struct PnC_CLReqIdentificationModeType
  1375. {
  1376. BOOL MeteringReceiptRequested;
  1377. };
  1378. struct Dynamic_CSReqControlModeType
  1379. {
  1380. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest;
  1381. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest;
  1382. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest;
  1383. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower;
  1384. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent;
  1385. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent;
  1386. };
  1387. struct Scheduled_CSReqControlModeType
  1388. {
  1389. struct PhysicalValueType_ISO15118_2018 EVTargetEnergyRequest; //Optional
  1390. struct PhysicalValueType_ISO15118_2018 EVMaximumEnergyRequest; //Optional
  1391. struct PhysicalValueType_ISO15118_2018 EVMinimumEnergyRequest; //Optional
  1392. BOOL Standby;
  1393. struct PhysicalValueType_ISO15118_2018 EVMaximumChargePower; //Optional
  1394. struct PhysicalValueType_ISO15118_2018 EVMaximumChargeCurrent; //Optional
  1395. struct PhysicalValueType_ISO15118_2018 EVMinimumChargeCurrent; //Optional
  1396. };
  1397. struct DisplayParametersType
  1398. {
  1399. unsigned short CurrentRange;
  1400. unsigned char CurrentSOC; //0~100%
  1401. unsigned char MinimumSOC; //0~100%
  1402. struct PhysicalValueType_ISO15118_2018 RemainingTimeToMaximumSOC;
  1403. struct PhysicalValueType_ISO15118_2018 RemainingTimeToTargetSOC;
  1404. struct PhysicalValueType_ISO15118_2018 RemainingTimeToBulkSOC;
  1405. struct PhysicalValueType_ISO15118_2018 RemainingTimeToMinimumSOC;
  1406. BOOL ChargingComplete;
  1407. BOOL BulkChargingComplete;
  1408. BOOL InletHot;
  1409. };
  1410. struct PnC_CLResIdentificationModeType
  1411. {
  1412. struct MeterInfoType_ISO15118_2018 MeterInfo;
  1413. };
  1414. struct Dynamic_CSResControlModeType
  1415. {
  1416. struct PhysicalValueType_ISO15118_2018 EVSETargetActivePower;
  1417. };
  1418. struct Scheduled_CDResControlModeType
  1419. {
  1420. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower; //Optional
  1421. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent; //Optional
  1422. struct PhysicalValueType_ISO15118_2018 EVSEMaximumVoltage; //Optional
  1423. };
  1424. struct LFA_EVFinePositioningSetupParametersType
  1425. {
  1426. unsigned char NumberOfSensors;
  1427. //NOT complete yet, to be continue.....
  1428. };
  1429. /****SupportedAppProtocolRequest****/
  1430. struct SupportedAppProtocolRequest_DIN70121 {
  1431. struct AppProtocolType AppProtocol[20];
  1432. };
  1433. struct SupportedAppProtocolRequest_ISO15118_2014
  1434. {
  1435. struct AppProtocolType AppProtocol[20];
  1436. };
  1437. struct SupportedAppProtocolRequest_ISO15118_2018
  1438. {
  1439. struct AppProtocolType AppProtocol[20];
  1440. };
  1441. /****SupportedAppProtocolResponse****/
  1442. struct SupportedAppProtocolResponse_DIN70121
  1443. {
  1444. enum ResponseCodeType_DIN70121 ResponseCode;
  1445. unsigned char SchemaID; //Optional
  1446. };
  1447. struct SupportedAppProtocolResponse_ISO15118_2014
  1448. {
  1449. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1450. unsigned char SchemaID; //Optional
  1451. };
  1452. struct SupportedAppProtocolResponse_ISO15118_2018
  1453. {
  1454. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1455. unsigned char SchemaID; //Optional
  1456. };
  1457. /****SessionSetupRequest****/
  1458. struct SessionSetupRequest_DIN70121
  1459. {
  1460. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1461. };
  1462. struct SessionSetupRequest_ISO15118_2014
  1463. {
  1464. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1465. };
  1466. struct SessionSetupRequest_ISO15118_2018
  1467. {
  1468. unsigned char EVCCID[8]; //the MAC address of the EVCC in Hex
  1469. struct ACD_SSEnergyTransferModeType ACD_SSEnergyTransferMode; //For ACD mandatory, optional for rest
  1470. };
  1471. /****SessionSetupResponse****/
  1472. struct SessionSetupResponse_DIN70121
  1473. {
  1474. enum ResponseCodeType_DIN70121 ResponseCode;
  1475. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1476. long EVSETimeStamp; //EPOCH format, Optional
  1477. };
  1478. struct SessionSetupResponse_ISO15118_2014
  1479. {
  1480. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1481. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1482. long EVSETimeStamp; //EPOCH format, Optional
  1483. };
  1484. struct SessionSetupResponse_ISO15118_2018
  1485. {
  1486. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1487. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1488. struct EVSEStatusType EVSEStatus; //Optional
  1489. };
  1490. /****ServiceDiscoveryRequest****/
  1491. struct ServiceDiscoveryRequest_DIN70121
  1492. {
  1493. unsigned char ServiceScope[32]; //Optional
  1494. unsigned int ServiceScopeLen;
  1495. enum ServiceCategoryType ServiceCategory; //Optional
  1496. };
  1497. struct ServiceDiscoveryRequest_ISO15118_2014
  1498. {
  1499. unsigned char ServiceScope[32]; //Optional
  1500. unsigned int ServiceScopeLen;
  1501. enum ServiceCategoryType ServiceCategory; //Optional
  1502. };
  1503. struct ServiceDiscoveryRequest_ISO15118_2018
  1504. {
  1505. struct ServiceIDListType SupportedServiceIDs; //Optional
  1506. };
  1507. /****ServiceDiscoveryResponse****/
  1508. struct ServiceDiscoveryResponse_DIN70121
  1509. {
  1510. enum ResponseCodeType_DIN70121 ResponseCode;
  1511. struct PaymentOptionListType PaymentOptions;
  1512. struct ServiceChargeType ChargeService_DIN70121;
  1513. };
  1514. struct ServiceDiscoveryResponse_ISO15118_2014
  1515. {
  1516. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1517. struct PaymentOptionListType PaymentOptions;
  1518. struct ChargeServiceType ChargeService;
  1519. struct ServiceListType ServiceList; //Optional
  1520. };
  1521. struct ServiceDiscoveryResponse_ISO15118_2018
  1522. {
  1523. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1524. struct EVSEStatusType EVSEStatus; //Optional
  1525. struct IdentificationOptionListType IdentificationOptionList;
  1526. struct ServiceListType EnergyTransferServiceList;
  1527. struct ServiceListType VASList; //Optional
  1528. };
  1529. /****ServiceDetailRequest****/
  1530. //Only in ISO15118_2014 and ISO15118_2018
  1531. struct ServiceDetailRequest_ISO15118_2014
  1532. {
  1533. unsigned short ServiceID;
  1534. };
  1535. struct ServiceDetailRequest_ISO15118_2018
  1536. {
  1537. unsigned short ServiceID;
  1538. struct WPT_SDlEnergyTransferModeType WPT_SDlEnergyTransferMode;
  1539. };
  1540. /****ServiceDetailResponse****/
  1541. struct ServiceDetailResponse_ISO15118_2014
  1542. {
  1543. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1544. unsigned short ServiceID;
  1545. struct ServiceParameterListType ServiceParameterList;
  1546. };
  1547. struct ServiceDetailResponse_ISO15118_2018
  1548. {
  1549. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1550. unsigned short ServiceID;
  1551. struct ServiceParameterListType ServiceParameterList;
  1552. struct EVSEStatusType EVSEStatus; //Optional
  1553. };
  1554. /****ServiceAndPaymentSelectionRequest / ServiceSelectionRequest****/
  1555. struct ServiceAndPaymentSelectionRequest_DIN70121
  1556. {
  1557. enum PaymentOptionType SelectedPaymentOption;
  1558. struct SelectedServiceListType SelectedServiceList;
  1559. };
  1560. struct ServiceAndPaymentSelectionRequest_ISO15118_2014
  1561. {
  1562. enum PaymentOptionType SelectedPaymentOption;
  1563. struct SelectedServiceListType SelectedServiceList;
  1564. };
  1565. struct ServiceSelectionRequest_ISO15118_2018
  1566. {
  1567. enum PaymentOptionType SelectedPaymentOption;
  1568. struct SelectedServiceType SelectedEnergyTransferService;
  1569. struct SelectedServiceListType SelectedVASList;
  1570. enum ProcessingType EVProcessing;
  1571. };
  1572. /****ServiceAndPaymentSelectionResponse / ServiceSelectionResponse****/
  1573. struct ServiceAndPaymentSelectionResponse_DIN70121
  1574. {
  1575. enum ResponseCodeType_DIN70121 ResponseCode;
  1576. };
  1577. struct ServiceAndPaymentSelectionResponse_ISO15118_2014
  1578. {
  1579. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1580. };
  1581. struct ServiceSelectionResponse_ISO15118_2018
  1582. {
  1583. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1584. struct EVSEStatusType EVSEStatus; //Optional
  1585. };
  1586. /****PaymentDetailsRequest / IdentificationDetailsRequest****/
  1587. struct PaymentDetailsRequest_ISO15118_2014
  1588. {
  1589. unsigned char eMAID[16];
  1590. struct CertificateChainType ContractSignatureCertChain;
  1591. };
  1592. struct IdentificationDetailsRequest_ISO15118_2018
  1593. {
  1594. struct CertificateChainType ContractSignatureCertChain;
  1595. };
  1596. /****PaymentDetailsResponse / IdentificationDetailsResponse ****/
  1597. struct PaymentDetailsResponse_ISO15118_2014
  1598. {
  1599. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1600. unsigned char GenChallenge[16];
  1601. long EVSETimeStamp;
  1602. };
  1603. struct IdentificationDetailsResponse_ISO15118_2018
  1604. {
  1605. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1606. struct EVSEStatusType EVSEStatus; //Optional
  1607. unsigned char GenChallenge[16];
  1608. enum ProcessingType EVSEProcessing;
  1609. };
  1610. /****ContractAuthenticationRequest / AuthorizationRequest****/
  1611. struct ContractAuthenticationRequest_DIN70121
  1612. {
  1613. //None
  1614. };
  1615. struct AuthorizationRequest_ISO15118_2014
  1616. {
  1617. unsigned char GenChallenge[16]; //Optional
  1618. unsigned char Id[32]; //Optional
  1619. };
  1620. struct AuthorizationRequest_ISO15118_2018
  1621. {
  1622. struct PNC_AReqIdentificationModeType PNC_AReqIdentificationMode; //Optional
  1623. };
  1624. /****ContractAuthenticationResponse / AuthorizationResponse****/
  1625. struct ContractAuthenticationResponse_DIN70121
  1626. {
  1627. enum ResponseCodeType_DIN70121 ResponseCode;
  1628. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  1629. };
  1630. struct AuthorizationResponse_ISO15118_2014
  1631. {
  1632. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1633. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  1634. };
  1635. struct AuthorizationResponse_ISO15118_2018
  1636. {
  1637. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1638. enum ProcessingType EVSEProcessing;
  1639. struct EVSEStatusType EVSEStatus; //Optional
  1640. };
  1641. /****ChargeParameterDiscoveryRequest****/
  1642. struct ChargeParameterDiscoveryRequest_DIN70121
  1643. {
  1644. enum EnergyTransferModeType EVRequestedEnergyTransferType;
  1645. struct DC_EVChargeParameterType_DIN70121 DC_EVChargeParameter;
  1646. };
  1647. struct ChargeParameterDiscoveryRequest_ISO15118_2014
  1648. {
  1649. unsigned short MaxEntriesSAScheduleTuple; //Optional
  1650. enum EnergyTransferModeType RequestedEnergyTransferMode;
  1651. struct AC_EVChargeParameterType AC_EVChargeParameter;
  1652. struct DC_EVChargeParameterType_ISO15118_2014 DC_EVChargeParameter;
  1653. };
  1654. struct ChargeParameterDiscoveryRequest_ISO15118_2018
  1655. {
  1656. struct Dynamic_CPDReqControlModeType Dynamic_CPDReqControlMode;
  1657. struct Scheduled_CPDReqControlModeType Scheduled_CPDReqControlMode;
  1658. struct AC_CPDReqEnergyTransferModeType AC_CPDReqEnergyTransferMode;
  1659. struct DC_CPDReqEnergyTransferModeType DC_CPDReqEnergyTransferMode;
  1660. struct BPT_AC_CPDReqEnergyTransferModeType BPT_AC_CPDReqEnergyTransferMode;
  1661. struct BPT_DC_CPDReqEnergyTransferModeType BPT_DC_CPDReqEnergyTransferMode;
  1662. struct WPT_CPDReqEnergyTransferModeType WPT_CPDReqEnergyTransferMode;
  1663. struct ACD_CPDReqEnergyTransferModeType ACD_CPDReqEnergyTransferMode;
  1664. };
  1665. /****ChargeParameterDiscoveryResponse****/
  1666. struct ChargeParameterDiscoveryResponse_DIN70121
  1667. {
  1668. enum ResponseCodeType_DIN70121 ResponseCode;
  1669. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  1670. struct SAScheduleListType SAScheduleList;
  1671. struct DC_EVSEChargeParameterType_DIN70121 DC_EVSEChargeParameter;
  1672. };
  1673. struct ChargeParameterDiscoveryResponse_ISO15118_2014
  1674. {
  1675. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  1676. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1677. struct SAScheduleListType SAScheduleList;
  1678. struct AC_EVSEChargeParameterType_ISO15118_2014 AC_EVSEChargeParameter;
  1679. struct DC_EVSEChargeParameterType_ISO15118_2014 DC_EVSEChargeParameter;
  1680. };
  1681. struct ChargeParameterDiscoveryResponse_ISO15118_2018
  1682. {
  1683. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1684. struct EVSEStatusType EVSEStatus; //Optional
  1685. enum ProcessingType EVSEProcessing;
  1686. struct Scheduled_CPDResControlModeType Scheduled_CPDResControlMode; //Optional
  1687. struct AC_CPDResEnergyTransferModeType AC_CPDResEnergyTransferMode;
  1688. struct DC_CPDResEnergyTransferModeType DC_CPDResEnergyTransferMode;
  1689. struct BPT_AC_CPDResEnergyTransferModeType BPT_AC_CPDResEnergyTransferMode;
  1690. struct BPT_DC_CPDResEnergyTransferModeType BPT_DC_CPDResEnergyTransferMode;
  1691. struct WPT_CPDResEnergyTransferModeType WPT_CPDResEnergyTransferMode;
  1692. struct ACD_CPDResEnergyTransferModeType ACD_CPDResEnergyTransferMode;
  1693. };
  1694. /****PowerDeliveryRequest****/
  1695. struct PowerDeliveryRequest_DIN70121
  1696. {
  1697. BOOL ReadyToChargeState;
  1698. struct ChargingProfileType_DIN70121 ChargingProfile;
  1699. struct DC_EVPowerDeliveryParameterType_DIN70121 DC_EVPowerDeliveryParameter;
  1700. };
  1701. struct PowerDeliveryRequest_ISO15118_2014
  1702. {
  1703. enum ChargeProgressType_ISO15118_2014 ChargeProgress;
  1704. short SAScheduleTupleID;
  1705. struct ChargingProfileType_ISO15118_2014 ChargingProfile;
  1706. struct DC_EVPowerDeliveryParameterType_ISO15118_2014 DC_EVPowerDeliveryParameter;
  1707. };
  1708. struct PowerDeliveryRequest_ISO15118_2018
  1709. {
  1710. enum ChargeProgressType_ISO15118_2018 ChargeProgress;
  1711. struct Scheduled_PDReqControlModeType Scheduled_PDReqControlMode;
  1712. struct BPT_Scheduled_PDReqControlModeType BPT_Scheduled_PDReqControlMode;
  1713. };
  1714. /****PowerDeliveryResponse****/
  1715. struct PowerDeliveryResponse_DIN70121
  1716. {
  1717. enum ResponseCodeType_DIN70121 ResponseCode;
  1718. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1719. };
  1720. struct PowerDeliveryResponse_ISO15118_2014
  1721. {
  1722. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1723. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1724. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1725. };
  1726. struct PowerDeliveryResponse_ISO15118_2018
  1727. {
  1728. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1729. struct EVSEStatusType EVSEStatus; //Optional
  1730. };
  1731. /****CertificateUpdateRequest****/
  1732. struct CertificateUpdateRequest_ISO15118_2014
  1733. {
  1734. unsigned char Id[32];
  1735. struct CertificateChainType ContractSignatureCertChain;
  1736. unsigned char eMAID[16];
  1737. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  1738. };
  1739. /****CertificateUpdateResponse****/
  1740. struct CertificateUpdateResponse_ISO15118_2014
  1741. {
  1742. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1743. struct CertificateChainType SAProvisioningCertificateChain;
  1744. struct CertificateChainType ContractSignatureCertChain;
  1745. struct ContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey;
  1746. struct DiffieHellmanPublickeyType DHpublickey;
  1747. unsigned char eMAID[16];
  1748. short RetryCounter; //Optional
  1749. };
  1750. /****CertificateInstallationRequest****/
  1751. struct CertificateInstallationRequest_ISO15118_2014
  1752. {
  1753. unsigned char Id[32];
  1754. unsigned char OEMProvisioningCert[800];
  1755. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  1756. };
  1757. struct CertificateInstallationRequest_ISO15118_2018
  1758. {
  1759. unsigned char Id[32];
  1760. struct CertificateChainType OEMProvisioningCertChain;
  1761. struct ListOfRootCertificateIDsType ListOfRootCertificateIDs;
  1762. unsigned short MaxSupportedCerts;
  1763. };
  1764. /****CertificateInstallationResponse****/
  1765. struct CertificateInstallationResponse_ISO15118_2014
  1766. {
  1767. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1768. struct CertificateChainType SAProvisioningCertificateChain;
  1769. struct CertificateChainType ContractSignatureCertChain;
  1770. struct ContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey;
  1771. struct DiffieHellmanPublickeyType DHpublickey;
  1772. unsigned char eMAID[16];
  1773. };
  1774. struct CertificateInstallationResponse_ISO15118_2018
  1775. {
  1776. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1777. struct EVSEStatusType EVSEStatus; //Optional
  1778. struct CertificateChainType SAProvisioningCertificateChain;
  1779. struct CertificateChainType ContractCertificateChain;
  1780. struct ContractCertificateEncryptedPrivateKeyType ContractEncryptedPrivateKey;
  1781. struct DiffieHellmanPublickeyType DHpublickey;
  1782. enum ProcessingType EVSEProcessing;
  1783. unsigned short RemainingContractCertificateChains;
  1784. };
  1785. /****SystemStatusRequest****/
  1786. struct SystemStatusRequest_ISO15118_2018
  1787. {
  1788. enum mechanicalChargingDeviceStatusType EVMechanicalChargingDeviceStatus;
  1789. struct EVTechnicalStatusType EVTechnicalStatus;
  1790. unsigned char EV_OEMStatus[800]; //Optional
  1791. };
  1792. /****SystemStatusResponse****/
  1793. struct SystemStatusResponse_ISO15118_2018
  1794. {
  1795. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1796. enum mechanicalChargingDeviceStatusType EVSEMechanicalChargingDeviceStatus;
  1797. BOOL EVSE_ReadyToCharge;
  1798. enum IsolationStatusType EVSE_IsolationStatus;
  1799. BOOL EVSE_Disabled;
  1800. BOOL EVSE_UtilityInterruptEvent;
  1801. BOOL EVSE_EmergencyShutdown;
  1802. BOOL EVSE_Malfunction;
  1803. BOOL EV_InChargePosition;
  1804. BOOL EV_AssociationStatus;
  1805. };
  1806. /****SessionStopRequest****/
  1807. struct SessionStopRequest_DIN70121
  1808. {
  1809. //No member in standard
  1810. };
  1811. struct SessionStopRequest_ISO15118_2014
  1812. {
  1813. enum ChargingSessionType ChargingSession;
  1814. };
  1815. struct SessionStopRequest_ISO15118_2018
  1816. {
  1817. enum ChargingSessionType ChargingSession;
  1818. };
  1819. /****SessionStopResponse****/
  1820. struct SessionStopResponse_DIN70121
  1821. {
  1822. enum ResponseCodeType_DIN70121 ResponseCode;
  1823. };
  1824. struct SessionStopResponse_ISO15118_2014
  1825. {
  1826. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1827. };
  1828. struct SessionStopResponse_ISO15118_2018
  1829. {
  1830. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1831. struct EVSEStatusType EVSEStatus; //Optional
  1832. };
  1833. /****MeteringReceiptRequest****/
  1834. struct MeteringReceiptRequest_ISO15118_2014
  1835. {
  1836. unsigned char Id[32]; //Optional
  1837. unsigned char SessionID[8];
  1838. short SAScheduleTupleID; //Optional
  1839. struct MeterInfoType_ISO15118_2014 MeterInfo;
  1840. };
  1841. struct MeteringReceiptRequest_ISO15118_2018
  1842. {
  1843. unsigned char Id[32]; //Optional
  1844. unsigned char SessionID[8];
  1845. struct Scheduled_MRReqControlModeType Schedule_MRReqControlMode;
  1846. struct MeterInfoType_ISO15118_2018 MeterInfo;
  1847. };
  1848. /****MeteringReceiptResponse****/
  1849. struct MeteringReceiptResponse_ISO15118_2014
  1850. {
  1851. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1852. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1853. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1854. };
  1855. struct MeteringReceiptResponse_ISO15118_2018
  1856. {
  1857. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1858. struct EVSEStatusType EVSEStatus; //Optional
  1859. };
  1860. /****ChargingStatusRequest (AC Only)****/
  1861. struct ChargingStatusRequest_ISO15118_2014
  1862. {
  1863. //No member in standard
  1864. };
  1865. struct ChargingStatusRequest_ISO15118_2018
  1866. {
  1867. struct PnC_CLReqIdentificationModeType PnC_CLReqIdentificationMode;
  1868. struct Dynamic_CSReqControlModeType Dynamic_CSReqControlMode;
  1869. struct Scheduled_CSReqControlModeType Scheduled_CSReqControlMode;
  1870. struct DisplayParametersType DisplayParameters;
  1871. };
  1872. /****ChargingStatusResponse (AC Only)****/
  1873. struct ChargingStatusResponse_ISO15118_2014
  1874. {
  1875. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1876. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1877. short SAScheduleTupleID;
  1878. struct PhysicalValueType_ISO15118_2014 EVSEMaxCurrent; //Optional
  1879. struct MeterInfoType_ISO15118_2014 MeterInfo; //Optional
  1880. BOOL ReceiptRequired; //Optional
  1881. struct AC_EVSEStatusType_ISO15118_2014 AC_EVSEStatus;
  1882. };
  1883. struct ChargingStatusResponse_ISO15118_2018
  1884. {
  1885. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1886. struct EVSEStatusType EVSEStatus; //Optional
  1887. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  1888. struct PhysicalValueType_ISO15118_2018 EVSETargetFrequency; //Optional
  1889. struct PnC_CLResIdentificationModeType PnC_CLResIdentificationMode;
  1890. struct Dynamic_CSResControlModeType Dynamic_CSResControlMode;
  1891. struct Scheduled_CSReqControlModeType Scheduled_CSReqControlMode;
  1892. };
  1893. /****CableCheckRequest (DC Only)****/
  1894. struct CableCheckRequest_DIN70121
  1895. {
  1896. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1897. };
  1898. struct CableCheckRequest_ISO15118_2014
  1899. {
  1900. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1901. };
  1902. struct CableCheckRequest_ISO15118_2018
  1903. {
  1904. //No member in standard
  1905. };
  1906. /****CableCheckResponse (DC Only)****/
  1907. struct CableCheckResponse_DIN70121
  1908. {
  1909. unsigned int cnt; //self added
  1910. enum ResponseCodeType_DIN70121 ResponseCode;
  1911. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1912. enum EVSEProcessingType_DIN70121 EVSEProcessing;
  1913. };
  1914. struct CableCheckResponse_ISO15118_2014
  1915. {
  1916. unsigned int cnt; //self added
  1917. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1918. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1919. enum EVSEProcessingType_ISO15118_2014 EVSEProcessing;
  1920. };
  1921. struct CableCheckResponse_ISO15118_2018
  1922. {
  1923. unsigned int cnt; //self added
  1924. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1925. struct EVSEStatusType EVSEStatus; //Optional
  1926. enum ProcessingType EVSEProcessing;
  1927. };
  1928. /****PreChargeRequest (DC Only)****/
  1929. struct PreChargeRequest_DIN70121
  1930. {
  1931. unsigned int cnt; //self added
  1932. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1933. struct PhysicalValueType_DIN70121 EVTargetVoltage;
  1934. struct PhysicalValueType_DIN70121 EVTargetCurrent;
  1935. };
  1936. struct PreChargeRequest_ISO15118_2014
  1937. {
  1938. unsigned int cnt; //self added
  1939. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1940. struct PhysicalValueType_ISO15118_2014 EVTargetVoltage;
  1941. struct PhysicalValueType_ISO15118_2014 EVTargetCurrent;
  1942. };
  1943. struct PreChargeRequest_ISO15118_2018
  1944. {
  1945. unsigned int cnt; //self added
  1946. struct PhysicalValueType_ISO15118_2018 EVTargetVoltage;
  1947. struct PhysicalValueType_ISO15118_2018 EVTargetCurrent;
  1948. };
  1949. /****PreChargeResponse (DC Only)****/
  1950. struct PreChargeResponse_DIN70121
  1951. {
  1952. enum ResponseCodeType_DIN70121 ResponseCode;
  1953. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  1954. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  1955. };
  1956. struct PreChargeResponse_ISO15118_2014
  1957. {
  1958. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  1959. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  1960. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  1961. };
  1962. struct PreChargeResponse_ISO15118_2018
  1963. {
  1964. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  1965. struct EVSEStatusType EVSEStatus; //Optional
  1966. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  1967. };
  1968. /****CurrentDemandRequest (DC Only)****/
  1969. struct CurrentDemandRequest_DIN70121
  1970. {
  1971. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  1972. struct PhysicalValueType_DIN70121 EVTargetCurrent;
  1973. struct PhysicalValueType_DIN70121 EVMaximumVoltageLimit; //Optional
  1974. struct PhysicalValueType_DIN70121 EVMaximumCurrentLimit; //Optional
  1975. struct PhysicalValueType_DIN70121 EVMaximumPowerLimit; //Optional
  1976. BOOL BulkChargingComplete; //Optional
  1977. BOOL ChargingComplete;
  1978. struct PhysicalValueType_DIN70121 RemainingTimeToFullSoC; //Optional
  1979. struct PhysicalValueType_DIN70121 RemainingTimeToBulkSoC; //Optional
  1980. struct PhysicalValueType_DIN70121 EVTargetVoltage;
  1981. };
  1982. struct CurrentDemandRequest_ISO15118_2014
  1983. {
  1984. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  1985. struct PhysicalValueType_ISO15118_2014 EVTargetCurrent;
  1986. struct PhysicalValueType_ISO15118_2014 EVMaximumVoltageLimit; //Optional
  1987. struct PhysicalValueType_ISO15118_2014 EVMaximumCurrentLimit; //Optional
  1988. struct PhysicalValueType_ISO15118_2014 EVMaximumPowerLimit; //Optional
  1989. BOOL BulkChargingComplete; //Optional
  1990. BOOL ChargingComplete;
  1991. struct PhysicalValueType_ISO15118_2014 RemainingTimeToFullSoC; //Optional
  1992. struct PhysicalValueType_ISO15118_2014 RemainingTimeToBulkSoC; //Optional
  1993. struct PhysicalValueType_ISO15118_2014 EVTargetVoltage;
  1994. };
  1995. struct CurrentDemandRequest_ISO15118_2018
  1996. {
  1997. struct DisplayParametersType DisplayParameters; //Optional
  1998. struct PnC_CLReqIdentificationModeType PnC_CLReqIdentificationMode;
  1999. struct Dynamic_CSReqControlModeType Dynamic_CDReqControlMode;
  2000. struct Scheduled_CSReqControlModeType Scheduled_CDReqControlMode;
  2001. };
  2002. /****CurrentDemandResponse (DC Only)****/
  2003. struct CurrentDemandResponse_DIN70121
  2004. {
  2005. enum ResponseCodeType_DIN70121 ResponseCode;
  2006. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2007. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  2008. struct PhysicalValueType_DIN70121 EVSEPresentCurrent;
  2009. BOOL EVSECurrentLimitAchieved;
  2010. BOOL EVSEVoltageLimitAchieved;
  2011. BOOL EVSEPowerLimitAchieved;
  2012. struct PhysicalValueType_DIN70121 EVSEMaximumVoltageLimit; //Optional
  2013. struct PhysicalValueType_DIN70121 EVSEMaximumCurrentLimit; //Optional
  2014. struct PhysicalValueType_DIN70121 EVSEMaximumPowerLimit; //Optional
  2015. };
  2016. struct CurrentDemandResponse_ISO15118_2014
  2017. {
  2018. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2019. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2020. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  2021. struct PhysicalValueType_ISO15118_2014 EVSEPresentCurrent;
  2022. BOOL EVSECurrentLimitAchieved;
  2023. BOOL EVSEVoltageLimitAchieved;
  2024. BOOL EVSEPowerLimitAchieved;
  2025. struct PhysicalValueType_ISO15118_2014 EVSEMaximumVoltageLimit; //Optional
  2026. struct PhysicalValueType_ISO15118_2014 EVSEMaximumCurrentLimit; //Optional
  2027. struct PhysicalValueType_ISO15118_2014 EVSEMaximumPowerLimit; //Optional
  2028. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2029. short SAScheduleTupleID;
  2030. struct MeterInfoType_ISO15118_2014 MeterInfo; //Optional
  2031. BOOL ReceiptRequired; //Optional
  2032. };
  2033. struct CurrentDemandResponse_ISO15118_2018
  2034. {
  2035. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2036. struct EVSEStatusType EVSEStatus; //Optional
  2037. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  2038. struct PhysicalValueType_ISO15118_2018 EVSEPresentCurrent;
  2039. BOOL EVSECurrentLimitAchieved;
  2040. BOOL EVSEVoltageLimitAchieved;
  2041. BOOL EVSEPowerLimitAchieved;
  2042. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeVoltage; //Optional
  2043. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargeCurrent; //Optional
  2044. struct PhysicalValueType_ISO15118_2018 EVSEMaximumChargePower; //Optional
  2045. unsigned char EVSEID[40]; //DIN70121=>Max length:32, ISO15118=>min length:7, max length:37
  2046. struct PnC_CLResIdentificationModeType PnC_CLResIdentificationMode;
  2047. struct Scheduled_CDResControlModeType Scheduled_CDResControlMode;
  2048. };
  2049. /****WeldingDetectionRequest (DC Only)*****/
  2050. struct WeldingDetectionRequest_DIN70121
  2051. {
  2052. struct DC_EVStatusType_DIN70121 DC_EVStatus;
  2053. };
  2054. struct WeldingDetectionRequest_ISO15118_2014
  2055. {
  2056. struct DC_EVStatusType_ISO15118_2014 DC_EVStatus;
  2057. };
  2058. struct WeldingDetectionRequest_ISO15118_2018
  2059. {
  2060. //No member in Standard
  2061. };
  2062. /****WeldingDetectionResponse (DC Only)****/
  2063. struct WeldingDetectionResponse_DIN70121
  2064. {
  2065. enum ResponseCodeType_DIN70121 ResponseCode;
  2066. struct DC_EVSEStatusType_DIN70121 DC_EVSEStatus;
  2067. struct PhysicalValueType_DIN70121 EVSEPresentVoltage;
  2068. };
  2069. struct WeldingDetectionResponse_ISO15118_2014
  2070. {
  2071. enum ResponseCodeType_ISO15118_2014 ResponseCode;
  2072. struct DC_EVSEStatusType_ISO15118_2014 DC_EVSEStatus;
  2073. struct PhysicalValueType_ISO15118_2014 EVSEPresentVoltage;
  2074. };
  2075. struct WeldingDetectionResponse_ISO15118_2018
  2076. {
  2077. enum ResponseCodeType_ISO15118_2018 ResponseCode;
  2078. struct EVSEStatusType EVSEStatus; //Optional
  2079. struct PhysicalValueType_ISO15118_2018 EVSEPresentVoltage;
  2080. };
  2081. /****FinePositioningSetupRequest (WPT Only)****/
  2082. struct FinePositioningSetupRequest_ISO15118_2018
  2083. {
  2084. struct LFA_EVFinePositioningSetupParametersType LFA_EVFinePositioningSetupParameters; //Optional
  2085. };
  2086. /****FinePositioningSetupResponse (WPT Only)****/
  2087. struct FinePositioningSetupResponse_ISO15118_2018
  2088. {
  2089. //NOT complete yet, to be continue.....
  2090. };
  2091. struct V2GMessageType_DIN70121 {
  2092. enum MsgFlowStatus PresentMsgFlowStatus;
  2093. enum MsgFlowStatus PresentMsgFlowStatus_pre;
  2094. /* 0: IDLE(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2095. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2096. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2097. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2098. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2099. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2100. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2101. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2102. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2103. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2104. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2105. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2106. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2107. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2108. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2109. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2110. 52: SessionStopRequest, 53: SessionStopResponse
  2111. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2112. */
  2113. struct SupportedAppProtocolRequest_DIN70121 SupportedAppProtocolRequest;
  2114. struct SupportedAppProtocolResponse_DIN70121 SupportedAppProtocolResponse;
  2115. struct SessionSetupRequest_DIN70121 SessionSetupRequest;
  2116. struct SessionSetupResponse_DIN70121 SessionSetupResponse;
  2117. struct ServiceDiscoveryRequest_DIN70121 ServiceDiscoveryRequest;
  2118. struct ServiceDiscoveryResponse_DIN70121 ServiceDiscoveryResponse;
  2119. struct ServiceAndPaymentSelectionRequest_DIN70121 ServiceAndPaymentSelectionRequest;
  2120. struct ServiceAndPaymentSelectionResponse_DIN70121 ServiceAndPaymentSelectionResponse;
  2121. struct ContractAuthenticationRequest_DIN70121 ContractAuthenticationRequest;
  2122. struct ContractAuthenticationResponse_DIN70121 ContractAuthenticationResponse;
  2123. struct ChargeParameterDiscoveryRequest_DIN70121 ChargeParameterDiscoveryRequest;
  2124. struct ChargeParameterDiscoveryResponse_DIN70121 ChargeParameterDiscoveryResponse;
  2125. struct CableCheckRequest_DIN70121 CableCheckRequest;
  2126. struct CableCheckResponse_DIN70121 CableCheckResponse;
  2127. struct PreChargeRequest_DIN70121 PreChargeRequest;
  2128. struct PreChargeResponse_DIN70121 PreChargeResponse;
  2129. struct PowerDeliveryRequest_DIN70121 PowerDeliveryRequest;
  2130. struct PowerDeliveryResponse_DIN70121 PowerDeliveryResponse;
  2131. struct CurrentDemandRequest_DIN70121 CurrentDemandRequest;
  2132. struct CurrentDemandResponse_DIN70121 CurrentDemandResponse;
  2133. struct WeldingDetectionRequest_DIN70121 WeldingDetectionRequest;
  2134. struct WeldingDetectionResponse_DIN70121 WeldingDetectionResponse;
  2135. struct SessionStopRequest_DIN70121 SessionStopRequest;
  2136. struct SessionStopResponse_DIN70121 SessionStopResponse;
  2137. };
  2138. struct V2GMessageType_ISO15118_2014 {
  2139. enum MsgFlowStatus PresentMsgFlowStatus;
  2140. enum MsgFlowStatus PresentMsgFlowStatus_pre;
  2141. /* 0: IDLE(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2142. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2143. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2144. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2145. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2146. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2147. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2148. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2149. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2150. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2151. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2152. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2153. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2154. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2155. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2156. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2157. 52: SessionStopRequest, 53: SessionStopResponse
  2158. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2159. */
  2160. struct SupportedAppProtocolRequest_ISO15118_2014 SupportedAppProtocolRequest;
  2161. struct SupportedAppProtocolResponse_ISO15118_2014 SupportedAppProtocolResponse;
  2162. struct SessionSetupRequest_ISO15118_2014 SessionSetupRequest;
  2163. struct SessionSetupResponse_ISO15118_2014 SessionSetupResponse;
  2164. struct ServiceDiscoveryRequest_ISO15118_2014 ServiceDiscoveryRequest;
  2165. struct ServiceDiscoveryResponse_ISO15118_2014 ServiceDiscoveryResponse;
  2166. struct ServiceDetailRequest_ISO15118_2014 ServiceDetailRequest;
  2167. struct ServiceDetailResponse_ISO15118_2014 ServiceDetailResponse;
  2168. struct ServiceAndPaymentSelectionRequest_ISO15118_2014 ServiceAndPaymentSelectionRequest;
  2169. struct ServiceAndPaymentSelectionResponse_ISO15118_2014 ServiceAndPaymentSelectionResponse;
  2170. struct PaymentDetailsRequest_ISO15118_2014 PaymentDetailsRequest;
  2171. struct PaymentDetailsResponse_ISO15118_2014 PaymentDetailsResponse;
  2172. struct AuthorizationRequest_ISO15118_2014 AuthorizationRequest;
  2173. struct AuthorizationResponse_ISO15118_2014 AuthorizationResponse;
  2174. struct CertificateUpdateRequest_ISO15118_2014 CertificateUpdateRequest;
  2175. struct CertificateUpdateResponse_ISO15118_2014 CertificateUpdateResponse;
  2176. struct CertificateInstallationRequest_ISO15118_2014 CertificateInstallationRequest;
  2177. struct CertificateInstallationResponse_ISO15118_2014 CertificateInstallationResponse;
  2178. struct ChargeParameterDiscoveryRequest_ISO15118_2014 ChargeParameterDiscoveryRequest;
  2179. struct ChargeParameterDiscoveryResponse_ISO15118_2014 ChargeParameterDiscoveryResponse;
  2180. struct CableCheckRequest_ISO15118_2014 CableCheckRequest;
  2181. struct CableCheckResponse_ISO15118_2014 CableCheckResponse;
  2182. struct PreChargeRequest_ISO15118_2014 PreChargeRequest;
  2183. struct PreChargeResponse_ISO15118_2014 PreChargeResponse;
  2184. struct PowerDeliveryRequest_ISO15118_2014 PowerDeliveryRequest;
  2185. struct PowerDeliveryResponse_ISO15118_2014 PowerDeliveryResponse;
  2186. struct ChargingStatusRequest_ISO15118_2014 ChargingStatusRequest;
  2187. struct ChargingStatusResponse_ISO15118_2014 ChargingStatusResponse;
  2188. struct CurrentDemandRequest_ISO15118_2014 CurrentDemandRequest;
  2189. struct CurrentDemandResponse_ISO15118_2014 CurrentDemandResponse;
  2190. struct MeteringReceiptRequest_ISO15118_2014 MeteringReceiptRequest;
  2191. struct MeteringReceiptResponse_ISO15118_2014 MeteringReceiptResponse;
  2192. struct WeldingDetectionRequest_ISO15118_2014 WeldingDetectionRequest;
  2193. struct WeldingDetectionResponse_ISO15118_2014 WeldingDetectionResponse;
  2194. struct SessionStopRequest_ISO15118_2014 SessionStopRequest;
  2195. struct SessionStopResponse_ISO15118_2014 SessionStopResponse;
  2196. };
  2197. struct V2GMessageType_ISO15118_2018 {
  2198. enum MsgFlowStatus PresentMsgFlowStatus;
  2199. enum MsgFlowStatus PresentMsgFlowStatus_pre;
  2200. /* 0: IDLE(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
  2201. 4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
  2202. 8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
  2203. 12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
  2204. 16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
  2205. 19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
  2206. 22: ServiceDetailRequest, 23: ServiceDetailResponse
  2207. 24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  2208. 26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  2209. 28: AuthorizationRequest, 29: AuthorizationResponse,
  2210. 30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
  2211. 34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
  2212. 36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
  2213. 40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
  2214. 44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse
  2215. 48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse,
  2216. 52: SessionStopRequest, 53: SessionStopResponse
  2217. 253: Performance Timeout, 254: Sequence Timeout, 255: Fault
  2218. */
  2219. struct SupportedAppProtocolRequest_ISO15118_2018 SupportedAppProtocolRequest;
  2220. struct SupportedAppProtocolResponse_ISO15118_2018 SupportedAppProtocolResponse;
  2221. struct SessionSetupRequest_ISO15118_2018 SessionSetupRequest;
  2222. struct SessionSetupResponse_ISO15118_2018 SessionSetupResponse;
  2223. struct ServiceDiscoveryRequest_ISO15118_2018 ServiceDiscoveryRequest;
  2224. struct ServiceDiscoveryResponse_ISO15118_2018 ServiceDiscoveryResponse;
  2225. struct ServiceDetailRequest_ISO15118_2018 ServiceDetailRequest;
  2226. struct ServiceDetailResponse_ISO15118_2018 ServiceDetailResponse;
  2227. struct ServiceSelectionRequest_ISO15118_2018 ServiceSelectionRequest;
  2228. struct ServiceSelectionResponse_ISO15118_2018 ServiceSelectionResponse;
  2229. struct IdentificationDetailsRequest_ISO15118_2018 IdentificationDetailsRequest;
  2230. struct IdentificationDetailsResponse_ISO15118_2018 IdentificationDetailsResponse;
  2231. struct AuthorizationRequest_ISO15118_2018 AuthorizationRequest;
  2232. struct AuthorizationResponse_ISO15118_2018 AuthorizationResponse;
  2233. struct CertificateInstallationRequest_ISO15118_2018 CertificateInstallationRequest;
  2234. struct CertificateInstallationResponse_ISO15118_2018 CertificateInstallationResponse;
  2235. struct ChargeParameterDiscoveryRequest_ISO15118_2018 ChargeParameterDiscoveryRequest;
  2236. struct ChargeParameterDiscoveryResponse_ISO15118_2018 ChargeParameterDiscoveryResponse;
  2237. struct CableCheckRequest_ISO15118_2018 CableCheckRequest;
  2238. struct CableCheckResponse_ISO15118_2018 CableCheckResponse;
  2239. struct PreChargeRequest_ISO15118_2018 PreChargeRequest;
  2240. struct PreChargeResponse_ISO15118_2018 PreChargeResponse;
  2241. struct PowerDeliveryRequest_ISO15118_2018 PowerDeliveryRequest;
  2242. struct PowerDeliveryResponse_ISO15118_2018 PowerDeliveryResponse;
  2243. struct ChargingStatusRequest_ISO15118_2018 ChargingStatusRequest;
  2244. struct ChargingStatusResponse_ISO15118_2018 ChargingStatusResponse;
  2245. struct CurrentDemandRequest_ISO15118_2018 CurrentDemandRequest;
  2246. struct CurrentDemandResponse_ISO15118_2018 CurrentDemandResponse;
  2247. struct MeteringReceiptRequest_ISO15118_2018 MeteringReceiptRequest;
  2248. struct MeteringReceiptResponse_ISO15118_2018 MeteringReceiptResponse;
  2249. struct WeldingDetectionRequest_ISO15118_2018 WeldingDetectionRequest;
  2250. struct WeldingDetectionResponse_ISO15118_2018 WeldingDetectionResponse;
  2251. struct SessionStopRequest_ISO15118_2018 SessionStopRequest;
  2252. struct SessionStopResponse_ISO15118_2018 SessionStopResponse;
  2253. };
  2254. struct CcsData {
  2255. unsigned char CommProtocol;
  2256. //0: V2GT_MSG_PROTOCOL_DIN70121
  2257. //1: V2GT_MSG_PROTOCOL_ISO15118_2014
  2258. //2: V2GT_MSG_PROTOCOL_ISO15118_2018
  2259. unsigned char EnergyTransferMode;
  2260. struct V2GMessageType_DIN70121 V2GMessage_DIN70121;
  2261. struct V2GMessageType_ISO15118_2014 V2GMessage_ISO15118_2014;
  2262. struct V2GMessageType_ISO15118_2018 V2GMessage_ISO15118_2018;
  2263. };
  2264. struct InternalComm {
  2265. unsigned char ChargingPermission;
  2266. unsigned char SlaveAddress;
  2267. unsigned char IsolationStatus; //0:ongoing, 1:valid, 2:warning/fault
  2268. unsigned char CCSConnectorType; //0:CCS1, 1:CCS2
  2269. unsigned char MaximumAllowedChargingTime; //0x00: unlimited
  2270. //(0x01: 1 minutes ~ 0xFF: 255 minutes, resolution: 1 minute)
  2271. unsigned int RTC; //4 bytes
  2272. unsigned char EVSEPrechargeStatus;
  2273. int MaximumChargingVoltage; //0~6553.5 volt, resolution: 0.1V
  2274. int AvailableChargingCurrent; //0~6553.5 amp, resolution: 0.1V
  2275. int AvailableChargingPower; //0~6553.5 kW, resolution: 0.1KW
  2276. int PresentChargingVoltage; //0~6553.5 volt, resolution: 0.1V
  2277. int PresentChargingCurrent; //0~6553.5 amp, resolution: 0.1A
  2278. int PresentChargingPower; //0~6553.5 KW, resolution: 0.1KW
  2279. struct timeb CAN_Rx_Timer_Start;
  2280. struct timeb CAN_Rx_Timer_End;
  2281. int FD_CAN_Socket;
  2282. struct timeb Start_Time;
  2283. struct timeb End_Time;
  2284. unsigned char ChargingPermission_new;
  2285. BOOL AC_RcdStatus; //0:no error, 1:error
  2286. unsigned char AC_EVSEID[40];
  2287. unsigned char AC_MeterID[32];
  2288. unsigned char AC_EVSEModelName[32];
  2289. unsigned char AC_BatteryChargeType;
  2290. unsigned char AC_CpPresentPWMDuty;
  2291. unsigned char AC_CpPresentState;
  2292. unsigned short AC_ChargingRemainTime;
  2293. unsigned int AC_CSUAlarmStatusCode;
  2294. unsigned int AC_CcsHeartBeat;
  2295. float AC_GridVoltage[3];
  2296. float AC_MeterReadingValue;
  2297. float AC_CpPositiveVoltage;
  2298. float AC_CpNegativeVoltage;
  2299. float AC_EVSEMaxCurrent;
  2300. float AC_EVSEMinCurrent;
  2301. float AC_EVSEPresentCurrent[3];
  2302. BOOL AC_OutputRelayStatus;
  2303. float AC_AvailableChargingPower; //1KW
  2304. unsigned char AC_EVSENotification; //0:none, 1:StopCharging, 2:RenNgotiation
  2305. unsigned char ChargingPermission_pre;
  2306. unsigned char SlaveAddress_pre;
  2307. unsigned char IsolationStatus_pre; //0:ongoing, 1:valid, 2:warning/fault
  2308. unsigned char CCSConnectorType_pre; //0:CCS1, 1:CCS2
  2309. unsigned char MaximumAllowedChargingTime_pre; //0x00: unlimited
  2310. //(0x01: 1 minutes ~ 0xFF: 255 minutes, resolution: 1 minute)
  2311. unsigned int RTC_pre; //4 bytes
  2312. unsigned char EVSEPrechargeStatus_pre;
  2313. int MaximumChargingVoltage_pre; //0~6553.5 volt, resolution: 0.1V
  2314. int AvailableChargingCurrent_pre; //0~6553.5 amp, resolution: 0.1V
  2315. int AvailableChargingPower_pre; //0~6553.5 kW, resolution: 0.1KW
  2316. int PresentChargingVoltage_pre; //0~6553.5 volt, resolution: 0.1V
  2317. int PresentChargingCurrent_pre; //0~6553.5 amp, resolution: 0.1A
  2318. int PresentChargingPower_pre; //0~6553.5 KW, resolution: 0.1KW
  2319. BOOL AC_RcdStatus_pre; //0:no error, 1:error
  2320. unsigned char AC_EVSEID_pre[40];
  2321. unsigned char AC_MeterID_pre[32];
  2322. unsigned char AC_EVSEModelName_pre[32];
  2323. unsigned char AC_BatteryChargeType_pre;
  2324. unsigned char AC_CpPresentPWMDuty_pre;
  2325. unsigned char AC_CpPresentState_pre;
  2326. unsigned short AC_ChargingRemainTime_pre;
  2327. unsigned int AC_CSUAlarmStatusCode_pre;
  2328. unsigned int AC_CcsHeartBeat_pre;
  2329. float AC_GridVoltage_pre[3];
  2330. float AC_MeterReadingValue_pre;
  2331. float AC_CpPositiveVoltage_pre;
  2332. float AC_CpNegativeVoltage_pre;
  2333. float AC_EVSEMaxCurrent_pre;
  2334. float AC_EVSEMinCurrent_pre;
  2335. float AC_EVSEPresentCurrent_pre[3];
  2336. BOOL AC_OutputRelayStatus_pre;
  2337. float AC_AvailableChargingPower_pre; //1KW
  2338. unsigned char AC_EVSENotification_pre; //0:none, 1:StopCharging, 2:RenNgotiation
  2339. struct DownloadImageInfoStructure {
  2340. FILE *file;
  2341. unsigned char active;
  2342. unsigned char type;
  2343. char filename[128];
  2344. unsigned long image_rx_cnt;
  2345. unsigned long image_size;
  2346. unsigned long total_can_packets;
  2347. unsigned long image_size_received; //unit: byte
  2348. unsigned char block_quantity;
  2349. unsigned char block_sequence_number;
  2350. unsigned char block_size_KByte; //unit: KBytes
  2351. unsigned char block_checksum;
  2352. unsigned char final_canmsg_size; //unit: byte
  2353. unsigned char downlaod_percentage;
  2354. unsigned char downlaod_percentage_pre;
  2355. } DownloadImageInfo;
  2356. struct EVSEStopChargingReqType {
  2357. unsigned char type;
  2358. unsigned char alarmcode[6];
  2359. } EVSEStopChargingReq;
  2360. union
  2361. {
  2362. unsigned char InternalCommVal;
  2363. struct
  2364. {
  2365. //FaultVal[0]
  2366. unsigned int matched: 1; //CAN_CMD_ADDRESS_REQUEST 0x00000100
  2367. unsigned int Got_AssignedAddress: 1; //CAN_CMD_ADDRESS_ASSIGN 0x00000200
  2368. unsigned int Send_EVBoardStatus: 1; //CAN_CMD_EV_BOARD_STATUS 0x00000300
  2369. unsigned int Got_FWVersionReq: 1; //CAN_CMD_GET_FW_VERSION 0x00000400
  2370. unsigned int Got_HWVersionReq: 1; //CAN_CMD_GET_HW_VERSION 0x00000500
  2371. unsigned int Got_ChargingPermission: 1; //CAN_CMD_CHARGING_PERMISSION 0x00000600
  2372. unsigned int Got_EVSEOutputStatus: 1; //CAN_CMD_EVSE_OUTPUT_STATUS_ANNOUNCEMENT 0x00000700
  2373. unsigned int Got_EnergyCapacity: 1; //CAN_CMD_EVSE_CAPACITY_ANNOUNCEMENT 0x00000800
  2374. unsigned int Got_EVTargetReq: 1; //CAN_CMD_GET_EV_TARGET_INFO 0x00000900
  2375. unsigned int Got_EVBatteryInfoReq: 1; //CAN_CMD_GET_EV_BATTERY_INFO 0x00000A00
  2376. unsigned int Send_EVStopReq: 1; //#define CAN_CMD_EV_STOP_EVENT 0x00000B00
  2377. unsigned int Got_EVSEStopReq: 1; //#define CAN_CMD_EVSE_STOP_EVENT 0x00000C00
  2378. unsigned int Got_MiscellaneousInfoReq: 1; //#define CAN_CMD_GET_MISC_INFO 0x00000D00
  2379. unsigned int Got_DownloadImageReq: 1; //#define CAN_CMD_DOWNLOAD_REQUEST 0x00000E00
  2380. unsigned int Got_BlockTransferStartReq: 1; //#define CAN_CMD_START_BLOCK_TRANSFER 0x00000F00
  2381. unsigned int Got_DataTransferReq: 1; //CAN_CMD_DATA_TRANSFER 0x00001000
  2382. unsigned int Got_DownloadFinishReq: 1; //CAN_CMD_DOWNLOAD_FINISH 0x00001100
  2383. unsigned int Got_IsolationStatus: 1; //CAN_CMD_ISOLATION_STATUS 0x00001200
  2384. unsigned int Got_CCSConnectorReq: 1; //CAN_CMD_CCS_CONNECTOR_INFO 0x00001300
  2385. unsigned int Got_RTC: 1; //CAN_CMD_RTC_INFO 0x00001400
  2386. unsigned int Got_EVSE_Precharge_Info: 1; //CAN_CMD_EVSE_PRECHARGE_INFO 0x00001500
  2387. unsigned int Got_EVCCID_Req: 1; //CAN_CMD_EVCCID_REQUEST 0x00001600
  2388. unsigned int EV_Stop_Type_Emergency: 1;
  2389. unsigned int FW_Update_Done: 1;
  2390. unsigned int FW_Update_Task_inused: 1;
  2391. unsigned int FW_Update_result: 1;
  2392. unsigned int FW_Update_Reboot_inused: 1;
  2393. unsigned int CAN_Rx_Timeout: 1;
  2394. unsigned int Reboot_Process_inused: 1;
  2395. unsigned int reserved: 3;
  2396. } bits;
  2397. } InternalCommUnion;
  2398. };
  2399. #endif // DEFINE_H_