Module_EvComm.c 220 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530
  1. #include <sys/time.h>
  2. #include <sys/timeb.h>
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5. #include <sys/types.h>
  6. #include <sys/ioctl.h>
  7. #include <sys/socket.h>
  8. #include <sys/ipc.h>
  9. #include <sys/shm.h>
  10. #include <sys/shm.h>
  11. #include <sys/mman.h>
  12. #include <linux/can.h>
  13. #include <linux/can/raw.h>
  14. #include <linux/wireless.h>
  15. #include <arpa/inet.h>
  16. #include <netinet/in.h>
  17. #include <unistd.h>
  18. #include <stdarg.h>
  19. #include <stdio.h> /*標準輸入輸出定義*/
  20. #include <stdlib.h> /*標準函數庫定義*/
  21. #include <unistd.h> /*Unix 標準函數定義*/
  22. #include <fcntl.h> /*檔控制定義*/
  23. #include <termios.h> /*PPSIX 終端控制定義*/
  24. #include <errno.h> /*錯誤號定義*/
  25. #include <errno.h>
  26. #include <string.h>
  27. #include <time.h>
  28. #include <ctype.h>
  29. #include <ifaddrs.h>
  30. #include "../Define/define.h"
  31. #include "../Config.h"
  32. #include "Module_EvComm.h"
  33. #include "Ev_Comm.h"
  34. //------------------------------------------------------------------------------
  35. struct SysConfigAndInfo *ShmSysConfigAndInfo;
  36. struct StatusCodeData *ShmStatusCodeData;
  37. struct FanModuleData *ShmFanModuleData;
  38. struct CHAdeMOData *ShmCHAdeMOData;
  39. struct GBTData *ShmGBTData;
  40. struct CcsData *ShmCcsData;
  41. struct PsuData *ShmPsuData;
  42. DcCommonInfo *ShmDcCommonData;
  43. uint8_t gun_count;
  44. int CanFd = -1;
  45. int chargingTime[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  46. //struct timeval _chk_ratingPower_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY]; //DS60-120 remove
  47. float LogInfo[2][10]; //DS60-120 add
  48. //DS60-120 remove
  49. //float _pow_1 = 0;
  50. //float _cur_1 = 0;
  51. //float _pow_2 = 0;
  52. //float _cur_2 = 0;
  53. //float _outVol_1 = 0;
  54. //float _outCur_1 = 0;
  55. //float _outVol_2 = 0;
  56. //float _outCur_2 = 0;
  57. // 限制最大充電電壓,因應不同 type 槍線來限制
  58. // Chademo : 500V, 125A,
  59. // GB : 750, 120A
  60. // CCS : 950V, 120A
  61. //DS60-120 add
  62. double chademoVol = 5000;
  63. double ccsVol = 9500;
  64. double gbVol = 7500;
  65. float maxChargingVol[2] = { 0, 0 }; // 限制最大充電電壓,如依照模塊則填上 0
  66. // 限制最大充電電流與能量透過 Web
  67. float maxChargingCur[2] = { 0, 0 }; // 限制最大充電電流,如依照模塊則填上 0
  68. float maxChargingPow = 0; // 限制最大充電能量,如依照模塊則填上 0
  69. //float maxChargingVol[2] = { 9500, 9500 }; // 限制最大充電電壓,如依照模塊則填上 0
  70. //// 限制最大充電電流與能量透過 Web
  71. //float maxChargingCur[2] = { 5000, 2000 }; // 限制最大充電電流,如依照模塊則填上 0
  72. //float maxChargingPow = 0; // 限制最大充電能量,如依照模塊則填上 0
  73. // 槍資訊
  74. struct ChargingInfoData *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  75. //DS60-120 add
  76. struct timeval _chk_ratingPower_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  77. struct timeval _chk_chademo_permission_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  78. bool chkChademoPermission[2] = { false, false };
  79. uint8_t SendErrorCount[2] = { 0, 0};
  80. uint8_t mask_table[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
  81. void GetMaxVolAndCurMethod(uint8_t index, float *vol, float *cur);
  82. void GetMaxPowerMethod(uint8_t index, float *pow);
  83. uint32_t GetTimeoutValue(struct timeval _sour_time);
  84. #define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  85. #define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  86. #define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  87. int GetCanFd(void)
  88. {
  89. return CanFd;
  90. }
  91. uint32_t GetTimeoutValue(struct timeval _sour_time)
  92. {
  93. struct timeval _end_time;
  94. gettimeofday(&_end_time, NULL);
  95. return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
  96. }
  97. int StoreLogMsg(const char *fmt, ...)
  98. {
  99. char Buf[4096 + 256];
  100. char buffer[4096];
  101. va_list args;
  102. struct timeb SeqEndTime;
  103. struct tm *tm;
  104. va_start(args, fmt);
  105. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  106. va_end(args);
  107. memset(Buf, 0, sizeof(Buf));
  108. ftime(&SeqEndTime);
  109. SeqEndTime.time = time(NULL);
  110. tm = localtime(&SeqEndTime.time);
  111. if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES) {
  112. sprintf(Buf, "%02d:%02d:%02d:%03d - %s",
  113. tm->tm_hour, tm->tm_min, tm->tm_sec, SeqEndTime.millitm, buffer);
  114. printf("%s \n", Buf);
  115. } else {
  116. sprintf(Buf, "echo \"%04d-%02d-%02d %02d:%02d:%02d:%03d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
  117. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, SeqEndTime.millitm,
  118. buffer,
  119. tm->tm_year + 1900, tm->tm_mon + 1);
  120. system(Buf);
  121. }
  122. return rc;
  123. }
  124. int DiffTimeb(struct timeb ST, struct timeb ET)
  125. {
  126. //return milli-second
  127. uint32_t StartTime, StopTime;
  128. StartTime = (uint32_t)ST.time;
  129. StopTime = (uint32_t)ET.time;
  130. return (StopTime - StartTime) * 1000 + ET.millitm - ST.millitm;
  131. }
  132. //=================================
  133. // Common routine
  134. //=================================
  135. void getTimeString(char *buff)
  136. {
  137. time_t timep;
  138. struct tm *p;
  139. time(&timep);
  140. p = gmtime(&timep);
  141. sprintf(buff, "[%04d-%02d-%02d %02d:%02d:%02d]", (1900 + p->tm_year), (1 + p->tm_mon), p->tm_mday, p->tm_hour, p->tm_hour, p->tm_sec);
  142. }
  143. bool CheckUniqNumber(uint8_t value)
  144. {
  145. static struct timeval _id_assign_time;
  146. for (uint8_t index = 0; index < gun_count; index++) {
  147. if (_chargingData[index]->Evboard_id == value) {
  148. struct timeval _end_time;
  149. gettimeofday(&_end_time, NULL);
  150. uint32_t diff = 1000000 * (_end_time.tv_sec - _id_assign_time.tv_sec) + _end_time.tv_usec - _id_assign_time.tv_usec;
  151. if (diff >= 3000000) {
  152. gettimeofday(&_id_assign_time, NULL);
  153. return true;
  154. } else {
  155. return false;
  156. }
  157. }
  158. }
  159. gettimeofday(&_id_assign_time, NULL);
  160. return true;
  161. }
  162. //==========================================
  163. // Init all share memory
  164. //==========================================
  165. int InitShareMemory()
  166. {
  167. int result = PASS;
  168. int MeterSMId;
  169. //initial ShmSysConfigAndInfo
  170. if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo), 0777)) < 0) {
  171. result = FAIL;
  172. } else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) - 1) {
  173. result = FAIL;
  174. }
  175. //initial ShmStatusCodeData
  176. if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData), 0777)) < 0) {
  177. result = FAIL;
  178. } else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) - 1) {
  179. result = FAIL;
  180. }
  181. //creat ShmPsuData
  182. if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData), 0777)) < 0) { //DS60-120 add
  183. result = FAIL;
  184. } else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) - 1) {
  185. result = FAIL;
  186. }
  187. if (CHAdeMO_QUANTITY > 0) {
  188. if ((MeterSMId = shmget(ShmCHAdeMOCommKey, sizeof(struct CHAdeMOData), IPC_CREAT | 0777)) < 0) {
  189. return FAIL;
  190. } else if ((ShmCHAdeMOData = shmat(MeterSMId, NULL, 0)) == (void *) - 1) {
  191. return FAIL;
  192. }
  193. }
  194. if (GB_QUANTITY > 0) {
  195. if ((MeterSMId = shmget(ShmGBTCommKey, sizeof(struct GBTData), IPC_CREAT | 0777)) < 0) {
  196. return FAIL;
  197. } else if ((ShmGBTData = shmat(MeterSMId, NULL, 0)) == (void *) - 1) {
  198. return FAIL;
  199. }
  200. }
  201. if (CCS_QUANTITY > 0) {
  202. if ((MeterSMId = shmget(ShmCcsCommKey, sizeof(struct CcsData), IPC_CREAT | 0777)) < 0) {
  203. return FAIL;
  204. } else if ((ShmCcsData = shmat(MeterSMId, NULL, 0)) == (void *) - 1) {
  205. return FAIL;
  206. }
  207. }
  208. if ((MeterSMId = shmget(ShmCommonKey, sizeof(DcCommonInfo), IPC_CREAT | 0777)) < 0) {
  209. return FAIL;
  210. } else if ((ShmDcCommonData = shmat(MeterSMId, NULL, 0)) == (void *) - 1) {
  211. return FAIL;
  212. }
  213. return result;
  214. }
  215. //================================================
  216. // initial can-bus
  217. //================================================
  218. int InitCanBus()
  219. {
  220. int s0, nbytes;
  221. struct timeval tv;
  222. struct ifreq ifr0;
  223. struct sockaddr_can addr0;
  224. system("/sbin/ip link set can0 down");
  225. system("/sbin/ip link set can0 type can bitrate 500000 restart-ms 100");
  226. system("/sbin/ip link set can0 up");
  227. s0 = socket(PF_CAN, SOCK_RAW, CAN_RAW);
  228. tv.tv_sec = 0;
  229. tv.tv_usec = 10000;
  230. if (setsockopt(s0, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)) < 0) {
  231. #ifdef SystemLogMessage
  232. log_error("Set SO_RCVTIMEO NG");
  233. #endif
  234. }
  235. nbytes = 40960;
  236. if (setsockopt(s0, SOL_SOCKET, SO_RCVBUF, &nbytes, sizeof(int)) < 0) {
  237. #ifdef SystemLogMessage
  238. log_error("Set SO_RCVBUF NG");
  239. #endif
  240. }
  241. nbytes = 40960;
  242. if (setsockopt(s0, SOL_SOCKET, SO_SNDBUF, &nbytes, sizeof(int)) < 0) {
  243. #ifdef SystemLogMessage
  244. log_error("Set SO_SNDBUF NG");
  245. #endif
  246. }
  247. strcpy(ifr0.ifr_name, "can0" );
  248. ioctl(s0, SIOCGIFINDEX, &ifr0); /* ifr.ifr_ifindex gets filled with that device's index */
  249. addr0.can_family = AF_CAN;
  250. addr0.can_ifindex = ifr0.ifr_ifindex;
  251. bind(s0, (struct sockaddr *)&addr0, sizeof(addr0));
  252. return s0;
  253. }
  254. //================================================
  255. //================================================
  256. // CANBUS receive task
  257. //================================================
  258. //================================================
  259. bool FindChargingInfoData(uint8_t target, struct ChargingInfoData **chargingData)
  260. {
  261. for (uint8_t index = 0; index < CHAdeMO_QUANTITY; index++) {
  262. if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == target) {
  263. chargingData[target] = &ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index];
  264. return true;
  265. }
  266. }
  267. for (uint8_t index = 0; index < CCS_QUANTITY; index++) {
  268. if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == target) {
  269. chargingData[target] = &ShmSysConfigAndInfo->SysInfo.CcsChargingData[index];
  270. return true;
  271. }
  272. }
  273. for (uint8_t index = 0; index < GB_QUANTITY; index++) {
  274. if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == target) {
  275. chargingData[target] = &ShmSysConfigAndInfo->SysInfo.GbChargingData[index];
  276. return true;
  277. }
  278. }
  279. return false;
  280. }
  281. void AddrAssignment(uint8_t *data)
  282. {
  283. uint8_t target_number[8];
  284. uint8_t index = 0x00;
  285. memcpy(target_number, data, sizeof(target_number));
  286. index = *(data + 4);
  287. if (gun_count == 1) {
  288. index = 0x01;
  289. }
  290. // if (CheckUniqNumber(index))
  291. {
  292. //DS60-120 add
  293. if (_chargingData[index - 1]->Type == _Type_Chademo) {
  294. log_info("Set EV board info : (Chademo) TargetAddr = %d \n", index);
  295. } else if (_chargingData[index - 1]->Type == _Type_CCS_2) {
  296. log_info("Set EV board info : (CCS) TargetAddr = %d \n", index);
  297. } else if (_chargingData[index - 1]->Type == _Type_GB) {
  298. log_info("Set EV board info : (GB) TargetAddr = %d \n", index);
  299. }
  300. //log_info("EV board id = %x \n", index); //DS60-120 remove
  301. // log_info("target_number[0] = %x \n", target_number[0]);
  302. // log_info("target_number[1] = %x \n", target_number[1]);
  303. // log_info("target_number[2] = %x \n", target_number[2]);
  304. // log_info("target_number[3] = %x \n", target_number[3]);
  305. // log_info("target_number[4] = %x \n", target_number[4]);
  306. log_info("SetTargetAddr = %d, type = %d \n", index, _chargingData[index - 1]->Type);
  307. SetTargetAddr(target_number, index);
  308. }
  309. }
  310. void ClearAbnormalStatus_Chademo(uint8_t gun_index)
  311. {
  312. bool isCleanCheck = false;
  313. char code[7];
  314. if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) == EQUAL) {
  315. return;
  316. }
  317. if (true) {
  318. if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023700", 6) == EQUAL &&
  319. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail == YES) {
  320. memcpy(code, "023700", 6);
  321. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  322. isCleanCheck = true;
  323. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023704", 6) == EQUAL &&
  324. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun == YES) {
  325. memcpy(code, "023704", 6);
  326. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  327. isCleanCheck = true;
  328. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023705", 6) == EQUAL &&
  329. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission == YES) {
  330. memcpy(code, "023705", 6);
  331. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  332. isCleanCheck = true;
  333. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023706", 6) == EQUAL &&
  334. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility == YES) {
  335. memcpy(code, "023706", 6);
  336. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  337. isCleanCheck = true;
  338. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023707", 6) == EQUAL &&
  339. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP == YES) {
  340. memcpy(code, "023707", 6);
  341. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  342. isCleanCheck = true;
  343. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023708", 6) == EQUAL &&
  344. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP == YES) {
  345. memcpy(code, "023708", 6);
  346. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  347. isCleanCheck = true;
  348. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023709", 6) == EQUAL &&
  349. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP == YES) {
  350. memcpy(code, "023709", 6);
  351. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  352. isCleanCheck = true;
  353. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023710", 6) == EQUAL &&
  354. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff == YES) {
  355. memcpy(code, "023710", 6);
  356. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  357. isCleanCheck = true;
  358. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023711", 6) == EQUAL &&
  359. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff == YES) {
  360. memcpy(code, "023711", 6);
  361. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  362. isCleanCheck = true;
  363. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023712", 6) == EQUAL &&
  364. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition == YES) {
  365. memcpy(code, "023712", 6);
  366. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  367. isCleanCheck = true;
  368. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023713", 6) == EQUAL &&
  369. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault == YES) {
  370. memcpy(code, "023713", 6);
  371. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  372. isCleanCheck = true;
  373. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023714", 6) == EQUAL &&
  374. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError == YES) {
  375. memcpy(code, "023714", 6);
  376. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  377. isCleanCheck = true;
  378. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023715", 6) == EQUAL &&
  379. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop == YES) {
  380. memcpy(code, "023715", 6);
  381. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  382. isCleanCheck = true;
  383. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023716", 6) == EQUAL &&
  384. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken == YES) {
  385. memcpy(code, "023716", 6);
  386. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  387. isCleanCheck = true;
  388. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023717", 6) == EQUAL &&
  389. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail == YES) {
  390. memcpy(code, "023717", 6);
  391. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  392. isCleanCheck = true;
  393. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023718", 6) == EQUAL &&
  394. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive == YES) {
  395. memcpy(code, "023718", 6);
  396. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  397. isCleanCheck = true;
  398. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023719", 6) == EQUAL &&
  399. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout == YES) {
  400. memcpy(code, "023719", 6);
  401. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  402. isCleanCheck = true;
  403. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023720", 6) == EQUAL &&
  404. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout == YES) {
  405. memcpy(code, "023720", 6);
  406. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  407. isCleanCheck = true;
  408. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023721", 6) == EQUAL &&
  409. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout == YES) {
  410. memcpy(code, "023721", 6);
  411. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  412. isCleanCheck = true;
  413. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023722", 6) == EQUAL &&
  414. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout == YES) {
  415. memcpy(code, "023722", 6);
  416. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  417. isCleanCheck = true;
  418. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023723", 6) == EQUAL &&
  419. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout == YES) {
  420. memcpy(code, "023723", 6);
  421. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  422. isCleanCheck = true;
  423. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023724", 6) == EQUAL &&
  424. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout == YES) {
  425. memcpy(code, "023724", 6);
  426. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  427. isCleanCheck = true;
  428. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023725", 6) == EQUAL &&
  429. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout == YES) {
  430. memcpy(code, "023725", 6);
  431. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  432. isCleanCheck = true;
  433. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023726", 6) == EQUAL &&
  434. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V == YES) {
  435. memcpy(code, "023726", 6);
  436. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  437. isCleanCheck = true;
  438. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023727", 6) == EQUAL &&
  439. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V == YES) {
  440. memcpy(code, "023727", 6);
  441. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  442. isCleanCheck = true;
  443. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023728", 6) == EQUAL &&
  444. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop == YES) {
  445. memcpy(code, "023728", 6);
  446. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  447. isCleanCheck = true;
  448. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023729", 6) == EQUAL &&
  449. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop == YES) {
  450. memcpy(code, "023729", 6);
  451. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  452. isCleanCheck = true;
  453. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023730", 6) == EQUAL &&
  454. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop == YES) {
  455. memcpy(code, "023730", 6);
  456. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  457. isCleanCheck = true;
  458. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023731", 6) == EQUAL &&
  459. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail == YES) {
  460. memcpy(code, "023731", 6);
  461. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  462. isCleanCheck = true;
  463. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023732", 6) == EQUAL &&
  464. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard == YES) {
  465. memcpy(code, "023732", 6);
  466. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  467. isCleanCheck = true;
  468. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023733", 6) == EQUAL &&
  469. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit == YES) {
  470. memcpy(code, "023733", 6);
  471. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  472. isCleanCheck = true;
  473. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023734", 6) == EQUAL &&
  474. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit == YES) {
  475. memcpy(code, "023734", 6);
  476. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  477. isCleanCheck = true;
  478. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023735", 6) == EQUAL &&
  479. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed == YES) {
  480. memcpy(code, "023735", 6);
  481. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  482. isCleanCheck = true;
  483. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023736", 6) == EQUAL &&
  484. ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown == YES) {
  485. memcpy(code, "023736", 6);
  486. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  487. isCleanCheck = true;
  488. }
  489. }
  490. if (isCleanCheck) {
  491. for (uint8_t index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++) {
  492. if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1) {
  493. log_info("CHA clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index, _chargingData[index]->EvConnAlarmCode, code);
  494. if (strncmp((char *)_chargingData[index]->EvConnAlarmCode, code, 6) != EQUAL) {
  495. if (strncmp(code, "023700", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = NO; }
  496. if (strncmp(code, "023704", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = NO; }
  497. if (strncmp(code, "023705", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = NO; }
  498. if (strncmp(code, "023706", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = NO; }
  499. if (strncmp(code, "023707", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP = NO; }
  500. if (strncmp(code, "023708", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP = NO; }
  501. if (strncmp(code, "023709", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP = NO; }
  502. if (strncmp(code, "023710", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff = NO; }
  503. if (strncmp(code, "023711", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff = NO; }
  504. if (strncmp(code, "023712", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition = NO; }
  505. if (strncmp(code, "023713", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault = NO; }
  506. if (strncmp(code, "023714", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError = NO; }
  507. if (strncmp(code, "023715", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop = NO; }
  508. if (strncmp(code, "023716", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken = NO; }
  509. if (strncmp(code, "023717", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail = NO; }
  510. if (strncmp(code, "023718", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive = NO; }
  511. if (strncmp(code, "023719", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout = NO; }
  512. if (strncmp(code, "023720", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout = NO; }
  513. if (strncmp(code, "023721", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout = NO; }
  514. if (strncmp(code, "023722", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout = NO; }
  515. if (strncmp(code, "023723", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout = NO; }
  516. if (strncmp(code, "023724", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout = NO; }
  517. if (strncmp(code, "023725", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout = NO; }
  518. if (strncmp(code, "023726", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V = NO; }
  519. if (strncmp(code, "023727", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V = NO; }
  520. if (strncmp(code, "023728", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop = NO; }
  521. if (strncmp(code, "023729", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop = NO; }
  522. if (strncmp(code, "023730", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop = NO; }
  523. if (strncmp(code, "023731", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail = NO; }
  524. if (strncmp(code, "023732", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard = NO; }
  525. if (strncmp(code, "023733", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit = NO; }
  526. if (strncmp(code, "023734", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit = NO; }
  527. if (strncmp(code, "023735", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = NO; }
  528. if (strncmp(code, "023736", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = NO; }
  529. }
  530. }
  531. }
  532. }
  533. }
  534. void ClearAbnormalStatus_GB(uint8_t gun_index)
  535. {
  536. bool isCleanCheck = false;
  537. char code[7];
  538. if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) == EQUAL) {
  539. return;
  540. }
  541. if (true) {
  542. if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023702", 6) == EQUAL &&
  543. ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail == YES) {
  544. memcpy(code, "023702", 6);
  545. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  546. isCleanCheck = true;
  547. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023900", 6) == EQUAL &&
  548. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 == YES) {
  549. memcpy(code, "023900", 6);
  550. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  551. isCleanCheck = true;
  552. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023901", 6) == EQUAL &&
  553. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL == YES) {
  554. memcpy(code, "023901", 6);
  555. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  556. isCleanCheck = true;
  557. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023902", 6) == EQUAL &&
  558. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE == YES) {
  559. memcpy(code, "023902", 6);
  560. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  561. isCleanCheck = true;
  562. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023903", 6) == EQUAL &&
  563. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT == YES) {
  564. memcpy(code, "023903", 6);
  565. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  566. isCleanCheck = true;
  567. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023904", 6) == EQUAL &&
  568. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT == YES) {
  569. memcpy(code, "023904", 6);
  570. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  571. isCleanCheck = true;
  572. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023905", 6) == EQUAL &&
  573. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT == YES) {
  574. memcpy(code, "023905", 6);
  575. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  576. isCleanCheck = true;
  577. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023906", 6) == EQUAL &&
  578. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE == YES) {
  579. memcpy(code, "023906", 6);
  580. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  581. isCleanCheck = true;
  582. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023907", 6) == EQUAL &&
  583. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE == YES) {
  584. memcpy(code, "023907", 6);
  585. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  586. isCleanCheck = true;
  587. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023908", 6) == EQUAL &&
  588. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT == YES) {
  589. memcpy(code, "023908", 6);
  590. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  591. isCleanCheck = true;
  592. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023909", 6) == EQUAL &&
  593. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V == YES) {
  594. memcpy(code, "023909", 6);
  595. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  596. isCleanCheck = true;
  597. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023910", 6) == EQUAL &&
  598. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V == YES) {
  599. memcpy(code, "023910", 6);
  600. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  601. isCleanCheck = true;
  602. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023911", 6) == EQUAL &&
  603. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD == YES) {
  604. memcpy(code, "023911", 6);
  605. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  606. isCleanCheck = true;
  607. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023912", 6) == EQUAL &&
  608. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD == YES) {
  609. memcpy(code, "023912", 6);
  610. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  611. isCleanCheck = true;
  612. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023913", 6) == EQUAL &&
  613. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL == YES) {
  614. memcpy(code, "023913", 6);
  615. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  616. isCleanCheck = true;
  617. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023914", 6) == EQUAL &&
  618. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK == YES) {
  619. memcpy(code, "023914", 6);
  620. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  621. isCleanCheck = true;
  622. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023915", 6) == EQUAL &&
  623. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT == YES) {
  624. memcpy(code, "023915", 6);
  625. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  626. isCleanCheck = true;
  627. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023916", 6) == EQUAL &&
  628. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT == YES) {
  629. memcpy(code, "023916", 6);
  630. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  631. isCleanCheck = true;
  632. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023917", 6) == EQUAL &&
  633. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT == YES) {
  634. memcpy(code, "023917", 6);
  635. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  636. isCleanCheck = true;
  637. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023918", 6) == EQUAL &&
  638. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT == YES) {
  639. memcpy(code, "023918", 6);
  640. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  641. isCleanCheck = true;
  642. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023919", 6) == EQUAL &&
  643. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V == YES) {
  644. memcpy(code, "023919", 6);
  645. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  646. isCleanCheck = true;
  647. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023930", 6) == EQUAL &&
  648. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT == YES) {
  649. memcpy(code, "023930", 6);
  650. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  651. isCleanCheck = true;
  652. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023931", 6) == EQUAL &&
  653. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT == YES) {
  654. memcpy(code, "023931", 6);
  655. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  656. isCleanCheck = true;
  657. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023932", 6) == EQUAL &&
  658. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT == YES) {
  659. memcpy(code, "023932", 6);
  660. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  661. isCleanCheck = true;
  662. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023933", 6) == EQUAL &&
  663. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT == YES) {
  664. memcpy(code, "023933", 6);
  665. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  666. isCleanCheck = true;
  667. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023934", 6) == EQUAL &&
  668. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT == YES) {
  669. memcpy(code, "023934", 6);
  670. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  671. isCleanCheck = true;
  672. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023935", 6) == EQUAL &&
  673. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT == YES) {
  674. memcpy(code, "023935", 6);
  675. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  676. isCleanCheck = true;
  677. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023936", 6) == EQUAL &&
  678. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT == YES) {
  679. memcpy(code, "023936", 6);
  680. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  681. isCleanCheck = true;
  682. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023937", 6) == EQUAL &&
  683. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT == YES) {
  684. memcpy(code, "023937", 6);
  685. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  686. isCleanCheck = true;
  687. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023938", 6) == EQUAL &&
  688. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT == YES) {
  689. memcpy(code, "023938", 6);
  690. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  691. isCleanCheck = true;
  692. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023939", 6) == EQUAL &&
  693. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT == YES) {
  694. memcpy(code, "023939", 6);
  695. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  696. isCleanCheck = true;
  697. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023940", 6) == EQUAL &&
  698. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT == YES) {
  699. memcpy(code, "023940", 6);
  700. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  701. isCleanCheck = true;
  702. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023941", 6) == EQUAL &&
  703. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT == YES) {
  704. memcpy(code, "023941", 6);
  705. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  706. isCleanCheck = true;
  707. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023942", 6) == EQUAL &&
  708. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT == YES) {
  709. memcpy(code, "023942", 6);
  710. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  711. isCleanCheck = true;
  712. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023943", 6) == EQUAL &&
  713. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT == YES) {
  714. memcpy(code, "023943", 6);
  715. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  716. isCleanCheck = true;
  717. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023944", 6) == EQUAL &&
  718. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT == YES) {
  719. memcpy(code, "023944", 6);
  720. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  721. isCleanCheck = true;
  722. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023945", 6) == EQUAL &&
  723. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT == YES) {
  724. memcpy(code, "023945", 6);
  725. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  726. isCleanCheck = true;
  727. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023946", 6) == EQUAL &&
  728. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT == YES) {
  729. memcpy(code, "023946", 6);
  730. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  731. isCleanCheck = true;
  732. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023947", 6) == EQUAL &&
  733. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT == YES) {
  734. memcpy(code, "023947", 6);
  735. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  736. isCleanCheck = true;
  737. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023950", 6) == EQUAL &&
  738. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL == YES) {
  739. memcpy(code, "023950", 6);
  740. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  741. isCleanCheck = true;
  742. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023951", 6) == EQUAL &&
  743. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL == YES) {
  744. memcpy(code, "023951", 6);
  745. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  746. isCleanCheck = true;
  747. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023952", 6) == EQUAL &&
  748. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL == YES) {
  749. memcpy(code, "023952", 6);
  750. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  751. isCleanCheck = true;
  752. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023953", 6) == EQUAL &&
  753. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST == YES) {
  754. memcpy(code, "023953", 6);
  755. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  756. isCleanCheck = true;
  757. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023954", 6) == EQUAL &&
  758. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION == YES) {
  759. memcpy(code, "023954", 6);
  760. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  761. isCleanCheck = true;
  762. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023955", 6) == EQUAL &&
  763. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP == YES) {
  764. memcpy(code, "023955", 6);
  765. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  766. isCleanCheck = true;
  767. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023956", 6) == EQUAL &&
  768. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT == YES) {
  769. memcpy(code, "023956", 6);
  770. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  771. isCleanCheck = true;
  772. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023957", 6) == EQUAL &&
  773. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR == YES) {
  774. memcpy(code, "023957", 6);
  775. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  776. isCleanCheck = true;
  777. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023958", 6) == EQUAL &&
  778. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP == YES) {
  779. memcpy(code, "023958", 6);
  780. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  781. isCleanCheck = true;
  782. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023959", 6) == EQUAL &&
  783. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER == YES) {
  784. memcpy(code, "023959", 6);
  785. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  786. isCleanCheck = true;
  787. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023960", 6) == EQUAL &&
  788. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V == YES) {
  789. memcpy(code, "023960", 6);
  790. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  791. isCleanCheck = true;
  792. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023961", 6) == EQUAL &&
  793. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 == YES) {
  794. memcpy(code, "023961", 6);
  795. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  796. isCleanCheck = true;
  797. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023962", 6) == EQUAL &&
  798. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT == YES) {
  799. memcpy(code, "023962", 6);
  800. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  801. isCleanCheck = true;
  802. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023963", 6) == EQUAL &&
  803. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE == YES) {
  804. memcpy(code, "023963", 6);
  805. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  806. isCleanCheck = true;
  807. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023964", 6) == EQUAL &&
  808. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON == YES) {
  809. memcpy(code, "023964", 6);
  810. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  811. isCleanCheck = true;
  812. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023970", 6) == EQUAL &&
  813. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE == YES) {
  814. memcpy(code, "023970", 6);
  815. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  816. isCleanCheck = true;
  817. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023971", 6) == EQUAL &&
  818. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE == YES) {
  819. memcpy(code, "023971", 6);
  820. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  821. isCleanCheck = true;
  822. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023972", 6) == EQUAL &&
  823. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC == YES) {
  824. memcpy(code, "023972", 6);
  825. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  826. isCleanCheck = true;
  827. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023973", 6) == EQUAL &&
  828. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC == YES) {
  829. memcpy(code, "023973", 6);
  830. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  831. isCleanCheck = true;
  832. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023974", 6) == EQUAL &&
  833. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT == YES) {
  834. memcpy(code, "023974", 6);
  835. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  836. isCleanCheck = true;
  837. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023975", 6) == EQUAL &&
  838. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE == YES) {
  839. memcpy(code, "023975", 6);
  840. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  841. isCleanCheck = true;
  842. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023976", 6) == EQUAL &&
  843. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE == YES) {
  844. memcpy(code, "023976", 6);
  845. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  846. isCleanCheck = true;
  847. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023977", 6) == EQUAL &&
  848. ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR == YES) {
  849. memcpy(code, "023977", 6);
  850. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  851. isCleanCheck = true;
  852. }
  853. }
  854. if (isCleanCheck) {
  855. for (uint8_t index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++) {
  856. if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1) {
  857. log_info("GBT clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index, _chargingData[index]->EvConnAlarmCode, code);
  858. if (strncmp((char *)_chargingData[index]->EvConnAlarmCode, code, 6) != EQUAL) {
  859. if (strncmp(code, "023702", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = NO; }
  860. if (strncmp(code, "023900", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = NO; }
  861. if (strncmp(code, "023901", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = NO; }
  862. if (strncmp(code, "023902", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = NO; }
  863. if (strncmp(code, "023903", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = NO; }
  864. if (strncmp(code, "023904", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = NO; }
  865. if (strncmp(code, "023905", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = NO; }
  866. if (strncmp(code, "023906", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = NO; }
  867. if (strncmp(code, "023907", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = NO; }
  868. if (strncmp(code, "023908", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = NO; }
  869. if (strncmp(code, "023909", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = NO; }
  870. if (strncmp(code, "023910", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = NO; }
  871. if (strncmp(code, "023911", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = NO; }
  872. if (strncmp(code, "023912", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = NO; }
  873. if (strncmp(code, "023913", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = NO; }
  874. if (strncmp(code, "023914", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = NO; }
  875. if (strncmp(code, "023915", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = NO; }
  876. if (strncmp(code, "023916", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = NO; }
  877. if (strncmp(code, "023917", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = NO; }
  878. if (strncmp(code, "023918", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = NO; }
  879. if (strncmp(code, "023919", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = NO; }
  880. if (strncmp(code, "023930", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = NO; }
  881. if (strncmp(code, "023931", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = NO; }
  882. if (strncmp(code, "023932", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = NO; }
  883. if (strncmp(code, "023933", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = NO; }
  884. if (strncmp(code, "023934", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = NO; }
  885. if (strncmp(code, "023935", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = NO; }
  886. if (strncmp(code, "023936", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = NO; }
  887. if (strncmp(code, "023937", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = NO; }
  888. if (strncmp(code, "023938", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = NO; }
  889. if (strncmp(code, "023939", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = NO; }
  890. if (strncmp(code, "023940", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = NO; }
  891. if (strncmp(code, "023941", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = NO; }
  892. if (strncmp(code, "023942", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = NO; }
  893. if (strncmp(code, "023943", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = NO; }
  894. if (strncmp(code, "023944", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = NO; }
  895. if (strncmp(code, "023945", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = NO; }
  896. if (strncmp(code, "023946", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = NO; }
  897. if (strncmp(code, "023947", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = NO; }
  898. if (strncmp(code, "023950", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = NO; }
  899. if (strncmp(code, "023951", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = NO; }
  900. if (strncmp(code, "023952", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = NO; }
  901. if (strncmp(code, "023953", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = NO; }
  902. if (strncmp(code, "023954", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = NO; }
  903. if (strncmp(code, "023955", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = NO; }
  904. if (strncmp(code, "023956", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = NO; }
  905. if (strncmp(code, "023957", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = NO; }
  906. if (strncmp(code, "023958", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = NO; }
  907. if (strncmp(code, "023959", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = NO; }
  908. if (strncmp(code, "023960", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = NO; }
  909. if (strncmp(code, "023961", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = NO; }
  910. if (strncmp(code, "023962", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = NO; }
  911. if (strncmp(code, "023963", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = NO; }
  912. if (strncmp(code, "023964", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = NO; }
  913. if (strncmp(code, "023970", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = NO; }
  914. if (strncmp(code, "023971", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = NO; }
  915. if (strncmp(code, "023972", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = NO; }
  916. if (strncmp(code, "023973", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = NO; }
  917. if (strncmp(code, "023974", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = NO; }
  918. if (strncmp(code, "023975", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = NO; }
  919. if (strncmp(code, "023976", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = NO; }
  920. if (strncmp(code, "023977", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = NO; }
  921. }
  922. }
  923. }
  924. }
  925. }
  926. void ClearAbnormalStatus_CCS(uint8_t gun_index)
  927. {
  928. bool isCleanCheck = false;
  929. char code[7];
  930. if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) == EQUAL) {
  931. return;
  932. }
  933. if (true) {
  934. if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "012219", 6) == EQUAL &&
  935. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemCcsOutputOVP == YES) {
  936. memcpy(code, "012219", 6);
  937. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  938. isCleanCheck = true;
  939. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023701", 6) == EQUAL &&
  940. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail == YES) {
  941. memcpy(code, "023701", 6);
  942. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  943. isCleanCheck = true;
  944. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023737", 6) == EQUAL &&
  945. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit == YES) {
  946. memcpy(code, "023737", 6);
  947. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  948. isCleanCheck = true;
  949. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023738", 6) == EQUAL &&
  950. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition == YES) {
  951. memcpy(code, "023738", 6);
  952. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  953. isCleanCheck = true;
  954. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023739", 6) == EQUAL &&
  955. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault == YES) {
  956. memcpy(code, "023739", 6);
  957. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  958. isCleanCheck = true;
  959. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023740", 6) == EQUAL &&
  960. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction == YES) {
  961. memcpy(code, "023740", 6);
  962. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  963. isCleanCheck = true;
  964. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023741", 6) == EQUAL &&
  965. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential == YES) {
  966. memcpy(code, "023741", 6);
  967. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  968. isCleanCheck = true;
  969. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023742", 6) == EQUAL &&
  970. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange == YES) {
  971. memcpy(code, "023742", 6);
  972. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  973. isCleanCheck = true;
  974. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023743", 6) == EQUAL &&
  975. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility == YES) {
  976. memcpy(code, "023743", 6);
  977. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  978. isCleanCheck = true;
  979. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023744", 6) == EQUAL &&
  980. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent == YES) {
  981. memcpy(code, "023744", 6);
  982. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  983. isCleanCheck = true;
  984. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023745", 6) == EQUAL &&
  985. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker == YES) {
  986. memcpy(code, "023745", 6);
  987. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  988. isCleanCheck = true;
  989. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023746", 6) == EQUAL &&
  990. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData == YES) {
  991. memcpy(code, "023746", 6);
  992. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  993. isCleanCheck = true;
  994. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023747", 6) == EQUAL &&
  995. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A == YES) {
  996. memcpy(code, "023747", 6);
  997. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  998. isCleanCheck = true;
  999. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023748", 6) == EQUAL &&
  1000. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B == YES) {
  1001. memcpy(code, "023748", 6);
  1002. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1003. isCleanCheck = true;
  1004. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023749", 6) == EQUAL &&
  1005. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C == YES) {
  1006. memcpy(code, "023749", 6);
  1007. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1008. isCleanCheck = true;
  1009. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023750", 6) == EQUAL &&
  1010. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 == YES) {
  1011. memcpy(code, "023750", 6);
  1012. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1013. isCleanCheck = true;
  1014. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023751", 6) == EQUAL &&
  1015. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 == YES) {
  1016. memcpy(code, "023751", 6);
  1017. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1018. isCleanCheck = true;
  1019. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023752", 6) == EQUAL &&
  1020. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 == YES) {
  1021. memcpy(code, "023752", 6);
  1022. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1023. isCleanCheck = true;
  1024. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023753", 6) == EQUAL &&
  1025. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 == YES) {
  1026. memcpy(code, "023753", 6);
  1027. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1028. isCleanCheck = true;
  1029. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023754", 6) == EQUAL &&
  1030. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 == YES) {
  1031. memcpy(code, "023754", 6);
  1032. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1033. isCleanCheck = true;
  1034. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023755", 6) == EQUAL &&
  1035. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 == YES) {
  1036. memcpy(code, "023755", 6);
  1037. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1038. isCleanCheck = true;
  1039. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023756", 6) == EQUAL &&
  1040. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 == YES) {
  1041. memcpy(code, "023756", 6);
  1042. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1043. isCleanCheck = true;
  1044. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023757", 6) == EQUAL &&
  1045. ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 == YES) {
  1046. memcpy(code, "023757", 6);
  1047. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1048. isCleanCheck = true;
  1049. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023758", 6) == EQUAL &&
  1050. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError == YES) {
  1051. memcpy(code, "023758", 6);
  1052. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1053. isCleanCheck = true;
  1054. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023759", 6) == EQUAL &&
  1055. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError == YES) {
  1056. memcpy(code, "023759", 6);
  1057. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1058. isCleanCheck = true;
  1059. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023760", 6) == EQUAL &&
  1060. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession == YES) {
  1061. memcpy(code, "023760", 6);
  1062. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1063. isCleanCheck = true;
  1064. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023761", 6) == EQUAL &&
  1065. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid == YES) {
  1066. memcpy(code, "023761", 6);
  1067. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1068. isCleanCheck = true;
  1069. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023762", 6) == EQUAL &&
  1070. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid == YES) {
  1071. memcpy(code, "023762", 6);
  1072. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1073. isCleanCheck = true;
  1074. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023763", 6) == EQUAL &&
  1075. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid == YES) {
  1076. memcpy(code, "023763", 6);
  1077. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1078. isCleanCheck = true;
  1079. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023764", 6) == EQUAL &&
  1080. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid == YES) {
  1081. memcpy(code, "023764", 6);
  1082. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1083. isCleanCheck = true;
  1084. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023765", 6) == EQUAL &&
  1085. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired == YES) {
  1086. memcpy(code, "023765", 6);
  1087. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1088. isCleanCheck = true;
  1089. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023766", 6) == EQUAL &&
  1090. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid == YES) {
  1091. memcpy(code, "023766", 6);
  1092. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1093. isCleanCheck = true;
  1094. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023767", 6) == EQUAL &&
  1095. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked == YES) {
  1096. memcpy(code, "023767", 6);
  1097. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1098. isCleanCheck = true;
  1099. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023768", 6) == EQUAL &&
  1100. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable == YES) {
  1101. memcpy(code, "023768", 6);
  1102. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1103. isCleanCheck = true;
  1104. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023769", 6) == EQUAL &&
  1105. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError == YES) {
  1106. memcpy(code, "023769", 6);
  1107. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1108. isCleanCheck = true;
  1109. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023770", 6) == EQUAL &&
  1110. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError == YES) {
  1111. memcpy(code, "023770", 6);
  1112. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1113. isCleanCheck = true;
  1114. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023771", 6) == EQUAL &&
  1115. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError == YES) {
  1116. memcpy(code, "023771", 6);
  1117. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1118. isCleanCheck = true;
  1119. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023772", 6) == EQUAL &&
  1120. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled == YES) {
  1121. memcpy(code, "023772", 6);
  1122. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1123. isCleanCheck = true;
  1124. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023773", 6) == EQUAL &&
  1125. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid == YES) {
  1126. memcpy(code, "023773", 6);
  1127. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1128. isCleanCheck = true;
  1129. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023774", 6) == EQUAL &&
  1130. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode == YES) {
  1131. memcpy(code, "023774", 6);
  1132. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1133. isCleanCheck = true;
  1134. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023775", 6) == EQUAL &&
  1135. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter == YES) {
  1136. memcpy(code, "023775", 6);
  1137. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1138. isCleanCheck = true;
  1139. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023776", 6) == EQUAL &&
  1140. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid == YES) {
  1141. memcpy(code, "023776", 6);
  1142. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1143. isCleanCheck = true;
  1144. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023777", 6) == EQUAL &&
  1145. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid == YES) {
  1146. memcpy(code, "023777", 6);
  1147. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1148. isCleanCheck = true;
  1149. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023778", 6) == EQUAL &&
  1150. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow == YES) {
  1151. memcpy(code, "023778", 6);
  1152. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1153. isCleanCheck = true;
  1154. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023779", 6) == EQUAL &&
  1155. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied == YES) {
  1156. memcpy(code, "023779", 6);
  1157. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1158. isCleanCheck = true;
  1159. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023780", 6) == EQUAL &&
  1160. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid == YES) {
  1161. memcpy(code, "023780", 6);
  1162. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1163. isCleanCheck = true;
  1164. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023781", 6) == EQUAL &&
  1165. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected == YES) {
  1166. memcpy(code, "023781", 6);
  1167. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1168. isCleanCheck = true;
  1169. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023782", 6) == EQUAL &&
  1170. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError == YES) {
  1171. memcpy(code, "023782", 6);
  1172. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1173. isCleanCheck = true;
  1174. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023783", 6) == EQUAL &&
  1175. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE == YES) {
  1176. memcpy(code, "023783", 6);
  1177. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1178. isCleanCheck = true;
  1179. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023784", 6) == EQUAL &&
  1180. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop == YES) {
  1181. memcpy(code, "023784", 6);
  1182. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1183. isCleanCheck = true;
  1184. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023785", 6) == EQUAL &&
  1185. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError == YES) {
  1186. memcpy(code, "023785", 6);
  1187. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1188. isCleanCheck = true;
  1189. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023786", 6) == EQUAL &&
  1190. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError == YES) {
  1191. memcpy(code, "023786", 6);
  1192. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1193. isCleanCheck = true;
  1194. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023787", 6) == EQUAL &&
  1195. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError == YES) {
  1196. memcpy(code, "023787", 6);
  1197. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1198. isCleanCheck = true;
  1199. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023788", 6) == EQUAL &&
  1200. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort == YES) {
  1201. memcpy(code, "023788", 6);
  1202. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1203. isCleanCheck = true;
  1204. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023789", 6) == EQUAL &&
  1205. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol == YES) {
  1206. memcpy(code, "023789", 6);
  1207. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1208. isCleanCheck = true;
  1209. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023790", 6) == EQUAL &&
  1210. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted == YES) {
  1211. memcpy(code, "023790", 6);
  1212. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1213. isCleanCheck = true;
  1214. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023791", 6) == EQUAL &&
  1215. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown == YES) {
  1216. memcpy(code, "023791", 6);
  1217. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1218. isCleanCheck = true;
  1219. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023792", 6) == EQUAL &&
  1220. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke == YES) {
  1221. memcpy(code, "023792", 6);
  1222. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1223. isCleanCheck = true;
  1224. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023793", 6) == EQUAL &&
  1225. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked == YES) {
  1226. memcpy(code, "023793", 6);
  1227. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1228. isCleanCheck = true;
  1229. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023794", 6) == EQUAL &&
  1230. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked == YES) {
  1231. memcpy(code, "023794", 6);
  1232. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1233. isCleanCheck = true;
  1234. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023795", 6) == EQUAL &&
  1235. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked == YES) {
  1236. memcpy(code, "023795", 6);
  1237. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1238. isCleanCheck = true;
  1239. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023796", 6) == EQUAL &&
  1240. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked == YES) {
  1241. memcpy(code, "023796", 6);
  1242. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1243. isCleanCheck = true;
  1244. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023797", 6) == EQUAL &&
  1245. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked == YES) {
  1246. memcpy(code, "023797", 6);
  1247. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1248. isCleanCheck = true;
  1249. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023798", 6) == EQUAL &&
  1250. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked == YES) {
  1251. memcpy(code, "023798", 6);
  1252. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1253. isCleanCheck = true;
  1254. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023799", 6) == EQUAL &&
  1255. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked == YES) {
  1256. memcpy(code, "023799", 6);
  1257. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1258. isCleanCheck = true;
  1259. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023800", 6) == EQUAL &&
  1260. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked == YES) {
  1261. memcpy(code, "023800", 6);
  1262. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1263. isCleanCheck = true;
  1264. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023801", 6) == EQUAL &&
  1265. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked == YES) {
  1266. memcpy(code, "023801", 6);
  1267. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1268. isCleanCheck = true;
  1269. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023802", 6) == EQUAL &&
  1270. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked == YES) {
  1271. memcpy(code, "023802", 6);
  1272. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1273. isCleanCheck = true;
  1274. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023803", 6) == EQUAL &&
  1275. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked == YES) {
  1276. memcpy(code, "023803", 6);
  1277. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1278. isCleanCheck = true;
  1279. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023809", 6) == EQUAL &&
  1280. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init == YES) {
  1281. memcpy(code, "023809", 6);
  1282. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1283. isCleanCheck = true;
  1284. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023810", 6) == EQUAL &&
  1285. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response == YES) {
  1286. memcpy(code, "023810", 6);
  1287. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1288. isCleanCheck = true;
  1289. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023811", 6) == EQUAL &&
  1290. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence == YES) {
  1291. memcpy(code, "023811", 6);
  1292. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1293. isCleanCheck = true;
  1294. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023812", 6) == EQUAL &&
  1295. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC == YES) {
  1296. memcpy(code, "023812", 6);
  1297. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1298. isCleanCheck = true;
  1299. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023813", 6) == EQUAL &&
  1300. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc == YES) {
  1301. memcpy(code, "023813", 6);
  1302. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1303. isCleanCheck = true;
  1304. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023814", 6) == EQUAL &&
  1305. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response == YES) {
  1306. memcpy(code, "023814", 6);
  1307. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1308. isCleanCheck = true;
  1309. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023815", 6) == EQUAL &&
  1310. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session == YES) {
  1311. memcpy(code, "023815", 6);
  1312. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1313. isCleanCheck = true;
  1314. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023816", 6) == EQUAL &&
  1315. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session == YES) {
  1316. memcpy(code, "023816", 6);
  1317. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1318. isCleanCheck = true;
  1319. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023817", 6) == EQUAL &&
  1320. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle == YES) {
  1321. memcpy(code, "023817", 6);
  1322. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1323. isCleanCheck = true;
  1324. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023818", 6) == EQUAL &&
  1325. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmMnbcSound == YES) {
  1326. memcpy(code, "023818", 6);
  1327. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1328. isCleanCheck = true;
  1329. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023819", 6) == EQUAL &&
  1330. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmValidateReq == YES) {
  1331. memcpy(code, "023819", 6);
  1332. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1333. isCleanCheck = true;
  1334. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023823", 6) == EQUAL &&
  1335. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join == YES) {
  1336. memcpy(code, "023823", 6);
  1337. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1338. isCleanCheck = true;
  1339. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023824", 6) == EQUAL &&
  1340. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join == YES) {
  1341. memcpy(code, "023824", 6);
  1342. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1343. isCleanCheck = true;
  1344. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023825", 6) == EQUAL &&
  1345. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange == YES) {
  1346. memcpy(code, "023825", 6);
  1347. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1348. isCleanCheck = true;
  1349. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023826", 6) == EQUAL &&
  1350. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification == YES) {
  1351. memcpy(code, "023826", 6);
  1352. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1353. isCleanCheck = true;
  1354. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023832", 6) == EQUAL &&
  1355. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes == YES) {
  1356. memcpy(code, "023832", 6);
  1357. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1358. isCleanCheck = true;
  1359. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023833", 6) == EQUAL &&
  1360. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes == YES) {
  1361. memcpy(code, "023833", 6);
  1362. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1363. isCleanCheck = true;
  1364. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023834", 6) == EQUAL &&
  1365. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes == YES) {
  1366. memcpy(code, "023834", 6);
  1367. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1368. isCleanCheck = true;
  1369. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023835", 6) == EQUAL &&
  1370. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes == YES) {
  1371. memcpy(code, "023835", 6);
  1372. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1373. isCleanCheck = true;
  1374. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023836", 6) == EQUAL &&
  1375. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes == YES) {
  1376. memcpy(code, "023836", 6);
  1377. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1378. isCleanCheck = true;
  1379. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023837", 6) == EQUAL &&
  1380. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes == YES) {
  1381. memcpy(code, "023837", 6);
  1382. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1383. isCleanCheck = true;
  1384. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023838", 6) == EQUAL &&
  1385. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes == YES) {
  1386. memcpy(code, "023838", 6);
  1387. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1388. isCleanCheck = true;
  1389. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023839", 6) == EQUAL &&
  1390. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes == YES) {
  1391. memcpy(code, "023839", 6);
  1392. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1393. isCleanCheck = true;
  1394. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023840", 6) == EQUAL &&
  1395. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes == YES) {
  1396. memcpy(code, "023840", 6);
  1397. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1398. isCleanCheck = true;
  1399. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023841", 6) == EQUAL &&
  1400. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes == YES) {
  1401. memcpy(code, "023841", 6);
  1402. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1403. isCleanCheck = true;
  1404. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023842", 6) == EQUAL &&
  1405. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes == YES) {
  1406. memcpy(code, "023842", 6);
  1407. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1408. isCleanCheck = true;
  1409. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023843", 6) == EQUAL &&
  1410. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes == YES) {
  1411. memcpy(code, "023843", 6);
  1412. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1413. isCleanCheck = true;
  1414. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023844", 6) == EQUAL &&
  1415. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time == YES) {
  1416. memcpy(code, "023844", 6);
  1417. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1418. isCleanCheck = true;
  1419. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023845", 6) == EQUAL &&
  1420. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time == YES) {
  1421. memcpy(code, "023845", 6);
  1422. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1423. isCleanCheck = true;
  1424. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023846", 6) == EQUAL &&
  1425. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time == YES) {
  1426. memcpy(code, "023846", 6);
  1427. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1428. isCleanCheck = true;
  1429. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023847", 6) == EQUAL &&
  1430. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time == YES) {
  1431. memcpy(code, "023847", 6);
  1432. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1433. isCleanCheck = true;
  1434. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023848", 6) == EQUAL &&
  1435. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time == YES) {
  1436. memcpy(code, "023848", 6);
  1437. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1438. isCleanCheck = true;
  1439. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023849", 6) == EQUAL &&
  1440. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time == YES) {
  1441. memcpy(code, "023849", 6);
  1442. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1443. isCleanCheck = true;
  1444. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023850", 6) == EQUAL &&
  1445. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime == YES) {
  1446. memcpy(code, "023850", 6);
  1447. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1448. isCleanCheck = true;
  1449. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023855", 6) == EQUAL &&
  1450. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO == YES) {
  1451. memcpy(code, "023855", 6);
  1452. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1453. isCleanCheck = true;
  1454. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023856", 6) == EQUAL &&
  1455. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO == YES) {
  1456. memcpy(code, "023856", 6);
  1457. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1458. isCleanCheck = true;
  1459. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023857", 6) == EQUAL &&
  1460. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO == YES) {
  1461. memcpy(code, "023857", 6);
  1462. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1463. isCleanCheck = true;
  1464. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023858", 6) == EQUAL &&
  1465. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO == YES) {
  1466. memcpy(code, "023858", 6);
  1467. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1468. isCleanCheck = true;
  1469. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023859", 6) == EQUAL &&
  1470. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT == YES) {
  1471. memcpy(code, "023859", 6);
  1472. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1473. isCleanCheck = true;
  1474. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023860", 6) == EQUAL &&
  1475. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT == YES) {
  1476. memcpy(code, "023860", 6);
  1477. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1478. isCleanCheck = true;
  1479. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023861", 6) == EQUAL &&
  1480. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT == YES) {
  1481. memcpy(code, "023861", 6);
  1482. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1483. isCleanCheck = true;
  1484. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023862", 6) == EQUAL &&
  1485. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT == YES) {
  1486. memcpy(code, "023862", 6);
  1487. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1488. isCleanCheck = true;
  1489. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023863", 6) == EQUAL &&
  1490. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO == YES) {
  1491. memcpy(code, "023863", 6);
  1492. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1493. isCleanCheck = true;
  1494. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023864", 6) == EQUAL &&
  1495. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO == YES) {
  1496. memcpy(code, "023864", 6);
  1497. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1498. isCleanCheck = true;
  1499. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023865", 6) == EQUAL &&
  1500. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST == YES) {
  1501. memcpy(code, "023865", 6);
  1502. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1503. isCleanCheck = true;
  1504. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023866", 6) == EQUAL &&
  1505. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST == YES) {
  1506. memcpy(code, "023866", 6);
  1507. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1508. isCleanCheck = true;
  1509. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023867", 6) == EQUAL &&
  1510. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER == YES) {
  1511. memcpy(code, "023867", 6);
  1512. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1513. isCleanCheck = true;
  1514. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023868", 6) == EQUAL &&
  1515. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER == YES) {
  1516. memcpy(code, "023868", 6);
  1517. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1518. isCleanCheck = true;
  1519. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023869", 6) == EQUAL &&
  1520. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER == YES) {
  1521. memcpy(code, "023869", 6);
  1522. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1523. isCleanCheck = true;
  1524. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023870", 6) == EQUAL &&
  1525. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER == YES) {
  1526. memcpy(code, "023870", 6);
  1527. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1528. isCleanCheck = true;
  1529. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023871", 6) == EQUAL &&
  1530. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH == YES) {
  1531. memcpy(code, "023871", 6);
  1532. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1533. isCleanCheck = true;
  1534. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023872", 6) == EQUAL &&
  1535. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH == YES) {
  1536. memcpy(code, "023872", 6);
  1537. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1538. isCleanCheck = true;
  1539. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023873", 6) == EQUAL &&
  1540. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS == YES) {
  1541. memcpy(code, "023873", 6);
  1542. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1543. isCleanCheck = true;
  1544. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023874", 6) == EQUAL &&
  1545. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS == YES) {
  1546. memcpy(code, "023874", 6);
  1547. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1548. isCleanCheck = true;
  1549. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023875", 6) == EQUAL &&
  1550. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO == YES) {
  1551. memcpy(code, "023875", 6);
  1552. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1553. isCleanCheck = true;
  1554. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023876", 6) == EQUAL &&
  1555. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO == YES) {
  1556. memcpy(code, "023876", 6);
  1557. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1558. isCleanCheck = true;
  1559. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023877", 6) == EQUAL &&
  1560. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO == YES) {
  1561. memcpy(code, "023877", 6);
  1562. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1563. isCleanCheck = true;
  1564. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023878", 6) == EQUAL &&
  1565. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO == YES) {
  1566. memcpy(code, "023878", 6);
  1567. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1568. isCleanCheck = true;
  1569. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023879", 6) == EQUAL &&
  1570. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO == YES) {
  1571. memcpy(code, "023879", 6);
  1572. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1573. isCleanCheck = true;
  1574. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023880", 6) == EQUAL &&
  1575. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO == YES) {
  1576. memcpy(code, "023880", 6);
  1577. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1578. isCleanCheck = true;
  1579. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023881", 6) == EQUAL &&
  1580. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence == YES) {
  1581. memcpy(code, "023881", 6);
  1582. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1583. isCleanCheck = true;
  1584. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023882", 6) == EQUAL &&
  1585. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID == YES) {
  1586. memcpy(code, "023882", 6);
  1587. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1588. isCleanCheck = true;
  1589. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023883", 6) == EQUAL &&
  1590. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error == YES) {
  1591. memcpy(code, "023883", 6);
  1592. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1593. isCleanCheck = true;
  1594. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023884", 6) == EQUAL &&
  1595. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error == YES) {
  1596. memcpy(code, "023884", 6);
  1597. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1598. isCleanCheck = true;
  1599. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023885", 6) == EQUAL &&
  1600. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error == YES) {
  1601. memcpy(code, "023885", 6);
  1602. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1603. isCleanCheck = true;
  1604. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023886", 6) == EQUAL &&
  1605. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error == YES) {
  1606. memcpy(code, "023886", 6);
  1607. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1608. isCleanCheck = true;
  1609. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023887", 6) == EQUAL &&
  1610. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error == YES) {
  1611. memcpy(code, "023887", 6);
  1612. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1613. isCleanCheck = true;
  1614. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023888", 6) == EQUAL &&
  1615. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error == YES) {
  1616. memcpy(code, "023888", 6);
  1617. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1618. isCleanCheck = true;
  1619. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023889", 6) == EQUAL &&
  1620. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error == YES) {
  1621. memcpy(code, "023889", 6);
  1622. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1623. isCleanCheck = true;
  1624. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023890", 6) == EQUAL &&
  1625. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error == YES) {
  1626. memcpy(code, "023890", 6);
  1627. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1628. isCleanCheck = true;
  1629. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023891", 6) == EQUAL &&
  1630. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging == YES) {
  1631. memcpy(code, "023891", 6);
  1632. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1633. isCleanCheck = true;
  1634. }
  1635. // else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023892", 6) == EQUAL &&
  1636. // ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm == YES)
  1637. // {
  1638. // memcpy(code, "023892", 6);
  1639. // memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1640. // isCleanCheck = true;
  1641. // }
  1642. else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023893", 6) == EQUAL &&
  1643. ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccFailForQCA7000SetKey == YES) {
  1644. memcpy(code, "023893", 6);
  1645. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1646. isCleanCheck = true;
  1647. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023979", 6) == EQUAL &&
  1648. ShmStatusCodeData->InfoCode.InfoEvents.bits.EV_Full_Charging == YES) {
  1649. memcpy(code, "023979", 6);
  1650. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1651. isCleanCheck = true;
  1652. } else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023983", 6) == EQUAL &&
  1653. ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason == YES) {
  1654. memcpy(code, "023983", 6);
  1655. memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
  1656. isCleanCheck = true;
  1657. }
  1658. }
  1659. if (isCleanCheck) {
  1660. for (uint8_t index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++) {
  1661. if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1) {
  1662. log_info("CCS clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index, _chargingData[index]->EvConnAlarmCode, code);
  1663. if (strncmp((char *)_chargingData[index]->EvConnAlarmCode, code, 6) != EQUAL) {
  1664. if (strncmp(code, "012219", 6) == EQUAL) { ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemCcsOutputOVP = NO; }
  1665. if (strncmp(code, "023701", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = NO; }
  1666. if (strncmp(code, "023737", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = NO; }
  1667. if (strncmp(code, "023738", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = NO; }
  1668. if (strncmp(code, "023739", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = NO; }
  1669. if (strncmp(code, "023740", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = NO; }
  1670. if (strncmp(code, "023741", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = NO; }
  1671. if (strncmp(code, "023742", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = NO; }
  1672. if (strncmp(code, "023743", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = NO; }
  1673. if (strncmp(code, "023744", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = NO; }
  1674. if (strncmp(code, "023745", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = NO; }
  1675. if (strncmp(code, "023746", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = NO; }
  1676. if (strncmp(code, "023747", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = NO; }
  1677. if (strncmp(code, "023748", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = NO; }
  1678. if (strncmp(code, "023749", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = NO; }
  1679. if (strncmp(code, "023750", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = NO; }
  1680. if (strncmp(code, "023751", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = NO; }
  1681. if (strncmp(code, "023752", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = NO; }
  1682. if (strncmp(code, "023753", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = NO; }
  1683. if (strncmp(code, "023754", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = NO; }
  1684. if (strncmp(code, "023755", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = NO; }
  1685. if (strncmp(code, "023756", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = NO; }
  1686. if (strncmp(code, "023757", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = NO; }
  1687. if (strncmp(code, "023758", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = NO; }
  1688. if (strncmp(code, "023759", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = NO; }
  1689. if (strncmp(code, "023760", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = NO; }
  1690. if (strncmp(code, "023761", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = NO; }
  1691. if (strncmp(code, "023762", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = NO; }
  1692. if (strncmp(code, "023763", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = NO; }
  1693. if (strncmp(code, "023764", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = NO; }
  1694. if (strncmp(code, "023765", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = NO; }
  1695. if (strncmp(code, "023766", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = NO; }
  1696. if (strncmp(code, "023767", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = NO; }
  1697. if (strncmp(code, "023768", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = NO; }
  1698. if (strncmp(code, "023769", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = NO; }
  1699. if (strncmp(code, "023770", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = NO; }
  1700. if (strncmp(code, "023771", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = NO; }
  1701. if (strncmp(code, "023772", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = NO; }
  1702. if (strncmp(code, "023773", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = NO; }
  1703. if (strncmp(code, "023774", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = NO; }
  1704. if (strncmp(code, "023775", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = NO; }
  1705. if (strncmp(code, "023776", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = NO; }
  1706. if (strncmp(code, "023777", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = NO; }
  1707. if (strncmp(code, "023778", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = NO; }
  1708. if (strncmp(code, "023779", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = NO; }
  1709. if (strncmp(code, "023780", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = NO; }
  1710. if (strncmp(code, "023781", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = NO; }
  1711. if (strncmp(code, "023782", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = NO; }
  1712. if (strncmp(code, "023783", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = NO; }
  1713. if (strncmp(code, "023784", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = NO; }
  1714. if (strncmp(code, "023785", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = NO; }
  1715. if (strncmp(code, "023786", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = NO; }
  1716. if (strncmp(code, "023787", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = NO; }
  1717. if (strncmp(code, "023788", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = NO; }
  1718. if (strncmp(code, "023789", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = NO; }
  1719. if (strncmp(code, "023790", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = NO; }
  1720. if (strncmp(code, "023791", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = NO; }
  1721. if (strncmp(code, "023792", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = NO; }
  1722. if (strncmp(code, "023793", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = NO; }
  1723. if (strncmp(code, "023794", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = NO; }
  1724. if (strncmp(code, "023795", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = NO; }
  1725. if (strncmp(code, "023796", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = NO; }
  1726. if (strncmp(code, "023797", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = NO; }
  1727. if (strncmp(code, "023798", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = NO; }
  1728. if (strncmp(code, "023799", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = NO; }
  1729. if (strncmp(code, "023800", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = NO; }
  1730. if (strncmp(code, "023801", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = NO; }
  1731. if (strncmp(code, "023802", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = NO; }
  1732. if (strncmp(code, "023803", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = NO; }
  1733. if (strncmp(code, "023809", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = NO; }
  1734. if (strncmp(code, "023810", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = NO; }
  1735. if (strncmp(code, "023811", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = NO; }
  1736. if (strncmp(code, "023812", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = NO; }
  1737. if (strncmp(code, "023813", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = NO; }
  1738. if (strncmp(code, "023814", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = NO; }
  1739. if (strncmp(code, "023815", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = NO; }
  1740. if (strncmp(code, "023816", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = NO; }
  1741. if (strncmp(code, "023817", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = NO; }
  1742. if (strncmp(code, "023818", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmMnbcSound = NO; }
  1743. if (strncmp(code, "023819", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmValidateReq = NO; }
  1744. if (strncmp(code, "023823", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = NO; }
  1745. if (strncmp(code, "023824", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = NO; }
  1746. if (strncmp(code, "023825", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = NO; }
  1747. if (strncmp(code, "023826", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = NO; }
  1748. if (strncmp(code, "023832", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = NO; }
  1749. if (strncmp(code, "023833", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = NO; }
  1750. if (strncmp(code, "023834", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = NO; }
  1751. if (strncmp(code, "023835", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = NO; }
  1752. if (strncmp(code, "023836", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = NO; }
  1753. if (strncmp(code, "023837", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = NO; }
  1754. if (strncmp(code, "023838", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = NO; }
  1755. if (strncmp(code, "023839", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = NO; }
  1756. if (strncmp(code, "023840", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = NO; }
  1757. if (strncmp(code, "023841", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = NO; }
  1758. if (strncmp(code, "023842", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = NO; }
  1759. if (strncmp(code, "023843", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = NO; }
  1760. if (strncmp(code, "023844", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = NO; }
  1761. if (strncmp(code, "023845", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = NO; }
  1762. if (strncmp(code, "023846", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = NO; }
  1763. if (strncmp(code, "023847", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = NO; }
  1764. if (strncmp(code, "023848", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = NO; }
  1765. if (strncmp(code, "023849", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = NO; }
  1766. if (strncmp(code, "023850", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime = NO; }
  1767. if (strncmp(code, "023855", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = NO; }
  1768. if (strncmp(code, "023856", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = NO; }
  1769. if (strncmp(code, "023857", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = NO; }
  1770. if (strncmp(code, "023858", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = NO; }
  1771. if (strncmp(code, "023859", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = NO; }
  1772. if (strncmp(code, "023860", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = NO; }
  1773. if (strncmp(code, "023861", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = NO; }
  1774. if (strncmp(code, "023862", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = NO; }
  1775. if (strncmp(code, "023863", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = NO; }
  1776. if (strncmp(code, "023864", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = NO; }
  1777. if (strncmp(code, "023865", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = NO; }
  1778. if (strncmp(code, "023866", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = NO; }
  1779. if (strncmp(code, "023867", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = NO; }
  1780. if (strncmp(code, "023868", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = NO; }
  1781. if (strncmp(code, "023869", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = NO; }
  1782. if (strncmp(code, "023870", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = NO; }
  1783. if (strncmp(code, "023871", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = NO; }
  1784. if (strncmp(code, "023872", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = NO; }
  1785. if (strncmp(code, "023873", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = NO; }
  1786. if (strncmp(code, "023874", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = NO; }
  1787. if (strncmp(code, "023875", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = NO; }
  1788. if (strncmp(code, "023876", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = NO; }
  1789. if (strncmp(code, "023877", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = NO; }
  1790. if (strncmp(code, "023878", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = NO; }
  1791. if (strncmp(code, "023879", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = NO; }
  1792. if (strncmp(code, "023880", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = NO; }
  1793. if (strncmp(code, "023881", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = NO; }
  1794. if (strncmp(code, "023882", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = NO; }
  1795. if (strncmp(code, "023883", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = NO; }
  1796. if (strncmp(code, "023884", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = NO; }
  1797. if (strncmp(code, "023885", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = NO; }
  1798. if (strncmp(code, "023886", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = NO; }
  1799. if (strncmp(code, "023887", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = NO; }
  1800. if (strncmp(code, "023888", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = NO; }
  1801. if (strncmp(code, "023889", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = NO; }
  1802. if (strncmp(code, "023890", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = NO; }
  1803. if (strncmp(code, "023891", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging = NO; }
  1804. //if (strncmp(code, "023892", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm = NO;
  1805. if (strncmp(code, "023893", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccFailForQCA7000SetKey = NO; }
  1806. if (strncmp(code, "023979", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.EV_Full_Charging = NO; }
  1807. if (strncmp(code, "023983", 6) == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason = NO; }
  1808. }
  1809. }
  1810. }
  1811. }
  1812. }
  1813. bool AbnormalStopAnalysis(uint8_t gun_index, uint8_t *errCode)
  1814. {
  1815. char string[7];
  1816. sprintf(string, "%d%d%d%d%d%d", *(errCode + 0), *(errCode + 1), *(errCode + 2), *(errCode + 3), *(errCode + 4), *(errCode + 5));
  1817. log_info("NOTIFICATION_EV_STOP : Err Code = %s \n", string);
  1818. //if (strncmp(string, "000000", 6) == EQUAL ||
  1819. // strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) != EQUAL) {
  1820. // return;
  1821. //}
  1822. if (strncmp(string, "000000", 6) == EQUAL ||
  1823. strncmp(string, "023979", 6) == EQUAL) {
  1824. return false;
  1825. }
  1826. if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) != EQUAL) {
  1827. return true;
  1828. }
  1829. memcpy(_chargingData[gun_index]->EvConnAlarmCode, string, 6);
  1830. log_info("NOTIFICATION_EV_STOP : EvConnAlarmCode = %s \n", _chargingData[gun_index]->EvConnAlarmCode);
  1831. //OVP error
  1832. if (strcmp(string, "012217") == EQUAL) { ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemChademoOutputOVP = YES; }
  1833. if (strcmp(string, "012219") == EQUAL) { ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemCcsOutputOVP = YES; }
  1834. if (strcmp(string, "012221") == EQUAL) { ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemGbOutputOVP = YES; }
  1835. if (strcmp(string, "023700") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = YES; }
  1836. if (strcmp(string, "023704") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = YES; }
  1837. if (strcmp(string, "023705") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = YES; }
  1838. if (strcmp(string, "023706") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = YES; }
  1839. if (strcmp(string, "023707") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP = YES; }
  1840. if (strcmp(string, "023708") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP = YES; }
  1841. if (strcmp(string, "023709") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP = YES; }
  1842. if (strcmp(string, "023710") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff = YES; }
  1843. if (strcmp(string, "023711") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff = YES; }
  1844. if (strcmp(string, "023712") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition = YES; }
  1845. if (strcmp(string, "023713") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault = YES; }
  1846. if (strcmp(string, "023714") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError = YES; }
  1847. if (strcmp(string, "023715") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop = YES; }
  1848. if (strcmp(string, "023716") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken = YES; }
  1849. if (strcmp(string, "023717") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail = YES; }
  1850. if (strcmp(string, "023718") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive = YES; }
  1851. if (strcmp(string, "023719") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout = YES; }
  1852. if (strcmp(string, "023720") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout = YES; }
  1853. if (strcmp(string, "023721") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout = YES; }
  1854. if (strcmp(string, "023722") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout = YES; }
  1855. if (strcmp(string, "023723") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout = YES; }
  1856. if (strcmp(string, "023724") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout = YES; }
  1857. if (strcmp(string, "023725") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout = YES; }
  1858. if (strcmp(string, "023726") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V = YES; }
  1859. if (strcmp(string, "023727") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V = YES; }
  1860. if (strcmp(string, "023728") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop = YES; }
  1861. if (strcmp(string, "023729") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop = YES; }
  1862. if (strcmp(string, "023730") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop = YES; }
  1863. if (strcmp(string, "023731") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail = YES; }
  1864. if (strcmp(string, "023732") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard = YES; }
  1865. if (strcmp(string, "023733") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit = YES; }
  1866. if (strcmp(string, "023734") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit = YES; }
  1867. if (strcmp(string, "023735") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = YES; }
  1868. if (strcmp(string, "023736") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = YES; }
  1869. if (strcmp(string, "012288") == EQUAL) { ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsOutputUVPFail = YES; }
  1870. if (strcmp(string, "023701") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = YES; }
  1871. if (strcmp(string, "023737") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = YES; }
  1872. if (strcmp(string, "023738") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = YES; }
  1873. if (strcmp(string, "023739") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = YES; }
  1874. if (strcmp(string, "023740") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = YES; }
  1875. if (strcmp(string, "023741") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = YES; }
  1876. if (strcmp(string, "023742") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = YES; }
  1877. if (strcmp(string, "023743") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = YES; }
  1878. if (strcmp(string, "023744") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = YES; }
  1879. if (strcmp(string, "023745") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = YES; }
  1880. if (strcmp(string, "023746") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = YES; }
  1881. if (strcmp(string, "023747") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = YES; }
  1882. if (strcmp(string, "023748") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = YES; }
  1883. if (strcmp(string, "023749") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = YES; }
  1884. if (strcmp(string, "023750") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = YES; }
  1885. if (strcmp(string, "023751") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = YES; }
  1886. if (strcmp(string, "023752") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = YES; }
  1887. if (strcmp(string, "023753") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = YES; }
  1888. if (strcmp(string, "023754") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = YES; }
  1889. if (strcmp(string, "023755") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = YES; }
  1890. if (strcmp(string, "023756") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = YES; }
  1891. if (strcmp(string, "023757") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = YES; }
  1892. if (strcmp(string, "023758") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = YES; }
  1893. if (strcmp(string, "023759") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = YES; }
  1894. if (strcmp(string, "023760") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = YES; }
  1895. if (strcmp(string, "023761") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = YES; }
  1896. if (strcmp(string, "023762") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = YES; }
  1897. if (strcmp(string, "023763") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = YES; }
  1898. if (strcmp(string, "023764") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = YES; }
  1899. if (strcmp(string, "023765") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = YES; }
  1900. if (strcmp(string, "023766") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = YES; }
  1901. if (strcmp(string, "023767") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = YES; }
  1902. if (strcmp(string, "023768") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = YES; }
  1903. if (strcmp(string, "023769") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = YES; }
  1904. if (strcmp(string, "023770") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = YES; }
  1905. if (strcmp(string, "023771") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = YES; }
  1906. if (strcmp(string, "023772") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = YES; }
  1907. if (strcmp(string, "023773") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = YES; }
  1908. if (strcmp(string, "023774") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = YES; }
  1909. if (strcmp(string, "023775") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = YES; }
  1910. if (strcmp(string, "023776") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = YES; }
  1911. if (strcmp(string, "023777") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = YES; }
  1912. if (strcmp(string, "023778") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = YES; }
  1913. if (strcmp(string, "023779") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = YES; }
  1914. if (strcmp(string, "023780") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = YES; }
  1915. if (strcmp(string, "023781") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = YES; }
  1916. if (strcmp(string, "023782") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = YES; }
  1917. if (strcmp(string, "023783") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = YES; }
  1918. if (strcmp(string, "023784") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = YES; }
  1919. if (strcmp(string, "023785") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = YES; }
  1920. if (strcmp(string, "023786") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = YES; }
  1921. if (strcmp(string, "023787") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = YES; }
  1922. if (strcmp(string, "023788") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = YES; }
  1923. if (strcmp(string, "023789") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = YES; }
  1924. if (strcmp(string, "023790") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = YES; }
  1925. if (strcmp(string, "023791") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = YES; }
  1926. if (strcmp(string, "023792") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = YES; }
  1927. if (strcmp(string, "023793") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = YES; }
  1928. if (strcmp(string, "023794") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = YES; }
  1929. if (strcmp(string, "023795") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = YES; }
  1930. if (strcmp(string, "023796") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = YES; }
  1931. if (strcmp(string, "023797") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = YES; }
  1932. if (strcmp(string, "023798") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = YES; }
  1933. if (strcmp(string, "023799") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = YES; }
  1934. if (strcmp(string, "023800") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = YES; }
  1935. if (strcmp(string, "023801") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = YES; }
  1936. if (strcmp(string, "023802") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = YES; }
  1937. if (strcmp(string, "023803") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = YES; }
  1938. if (strcmp(string, "023809") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = YES; }
  1939. if (strcmp(string, "023810") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = YES; }
  1940. if (strcmp(string, "023811") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = YES; }
  1941. if (strcmp(string, "023812") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = YES; }
  1942. if (strcmp(string, "023813") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = YES; }
  1943. if (strcmp(string, "023814") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = YES; }
  1944. if (strcmp(string, "023815") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = YES; }
  1945. if (strcmp(string, "023816") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = YES; }
  1946. if (strcmp(string, "023817") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = YES; }
  1947. if (strcmp(string, "023818") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmMnbcSound = YES; }
  1948. if (strcmp(string, "023819") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmValidateReq = YES; }
  1949. if (strcmp(string, "023823") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = YES; }
  1950. if (strcmp(string, "023824") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = YES; }
  1951. if (strcmp(string, "023825") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = YES; }
  1952. if (strcmp(string, "023826") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = YES; }
  1953. if (strcmp(string, "023832") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = YES; }
  1954. if (strcmp(string, "023833") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = YES; }
  1955. if (strcmp(string, "023834") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = YES; }
  1956. if (strcmp(string, "023835") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = YES; }
  1957. if (strcmp(string, "023836") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = YES; }
  1958. if (strcmp(string, "023837") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = YES; }
  1959. if (strcmp(string, "023838") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = YES; }
  1960. if (strcmp(string, "023839") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = YES; }
  1961. if (strcmp(string, "023840") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = YES; }
  1962. if (strcmp(string, "023841") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = YES; }
  1963. if (strcmp(string, "023842") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = YES; }
  1964. if (strcmp(string, "023843") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = YES; }
  1965. if (strcmp(string, "023844") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = YES; }
  1966. if (strcmp(string, "023845") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = YES; }
  1967. if (strcmp(string, "023846") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = YES; }
  1968. if (strcmp(string, "023847") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = YES; }
  1969. if (strcmp(string, "023848") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = YES; }
  1970. if (strcmp(string, "023849") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = YES; }
  1971. if (strcmp(string, "023850") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime = YES; }
  1972. if (strcmp(string, "023855") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = YES; }
  1973. if (strcmp(string, "023856") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = YES; }
  1974. if (strcmp(string, "023857") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = YES; }
  1975. if (strcmp(string, "023858") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = YES; }
  1976. if (strcmp(string, "023859") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = YES; }
  1977. if (strcmp(string, "023860") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = YES; }
  1978. if (strcmp(string, "023861") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = YES; }
  1979. if (strcmp(string, "023862") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = YES; }
  1980. if (strcmp(string, "023863") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = YES; }
  1981. if (strcmp(string, "023864") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = YES; }
  1982. if (strcmp(string, "023865") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = YES; }
  1983. if (strcmp(string, "023866") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = YES; }
  1984. if (strcmp(string, "023867") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = YES; }
  1985. if (strcmp(string, "023868") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = YES; }
  1986. if (strcmp(string, "023869") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = YES; }
  1987. if (strcmp(string, "023870") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = YES; }
  1988. if (strcmp(string, "023871") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = YES; }
  1989. if (strcmp(string, "023872") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = YES; }
  1990. if (strcmp(string, "023873") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = YES; }
  1991. if (strcmp(string, "023874") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = YES; }
  1992. if (strcmp(string, "023875") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = YES; }
  1993. if (strcmp(string, "023876") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = YES; }
  1994. if (strcmp(string, "023877") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = YES; }
  1995. if (strcmp(string, "023878") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = YES; }
  1996. if (strcmp(string, "023879") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = YES; }
  1997. if (strcmp(string, "023880") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = YES; }
  1998. if (strcmp(string, "023881") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = YES; }
  1999. if (strcmp(string, "023882") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = YES; }
  2000. if (strcmp(string, "023883") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = YES; }
  2001. if (strcmp(string, "023884") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = YES; }
  2002. if (strcmp(string, "023885") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = YES; }
  2003. if (strcmp(string, "023886") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = YES; }
  2004. if (strcmp(string, "023887") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = YES; }
  2005. if (strcmp(string, "023888") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = YES; }
  2006. if (strcmp(string, "023889") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = YES; }
  2007. if (strcmp(string, "023890") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = YES; }
  2008. if (strcmp(string, "023891") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging = YES; }
  2009. if (strcmp(string, "023892") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm = YES; }
  2010. if (strcmp(string, "023893") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccFailForQCA7000SetKey = YES; }
  2011. if (strcmp(string, "023702") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = YES; }
  2012. if (strcmp(string, "023900") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = YES; }
  2013. if (strcmp(string, "023901") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = YES; }
  2014. if (strcmp(string, "023902") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = YES; }
  2015. if (strcmp(string, "023903") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = YES; }
  2016. if (strcmp(string, "023904") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = YES; }
  2017. if (strcmp(string, "023905") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = YES; }
  2018. if (strcmp(string, "023906") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = YES; }
  2019. if (strcmp(string, "023907") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = YES; }
  2020. if (strcmp(string, "023908") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = YES; }
  2021. if (strcmp(string, "023909") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = YES; }
  2022. if (strcmp(string, "023910") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = YES; }
  2023. if (strcmp(string, "023911") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = YES; }
  2024. if (strcmp(string, "023912") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = YES; }
  2025. if (strcmp(string, "023913") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = YES; }
  2026. if (strcmp(string, "023914") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = YES; }
  2027. if (strcmp(string, "023915") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = YES; }
  2028. if (strcmp(string, "023916") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = YES; }
  2029. if (strcmp(string, "023917") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = YES; }
  2030. if (strcmp(string, "023918") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = YES; }
  2031. if (strcmp(string, "023919") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = YES; }
  2032. if (strcmp(string, "023930") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = YES; }
  2033. if (strcmp(string, "023931") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = YES; }
  2034. if (strcmp(string, "023932") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = YES; }
  2035. if (strcmp(string, "023933") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = YES; }
  2036. if (strcmp(string, "023934") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = YES; }
  2037. if (strcmp(string, "023935") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = YES; }
  2038. if (strcmp(string, "023936") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = YES; }
  2039. if (strcmp(string, "023937") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = YES; }
  2040. if (strcmp(string, "023938") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = YES; }
  2041. if (strcmp(string, "023939") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = YES; }
  2042. if (strcmp(string, "023940") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = YES; }
  2043. if (strcmp(string, "023941") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = YES; }
  2044. if (strcmp(string, "023942") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = YES; }
  2045. if (strcmp(string, "023943") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = YES; }
  2046. if (strcmp(string, "023944") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = YES; }
  2047. if (strcmp(string, "023945") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = YES; }
  2048. if (strcmp(string, "023946") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = YES; }
  2049. if (strcmp(string, "023947") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = YES; }
  2050. if (strcmp(string, "023950") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = YES; }
  2051. if (strcmp(string, "023951") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = YES; }
  2052. if (strcmp(string, "023952") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = YES; }
  2053. if (strcmp(string, "023953") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = YES; }
  2054. if (strcmp(string, "023954") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = YES; }
  2055. if (strcmp(string, "023955") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = YES; }
  2056. if (strcmp(string, "023956") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = YES; }
  2057. if (strcmp(string, "023957") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = YES; }
  2058. if (strcmp(string, "023958") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = YES; }
  2059. if (strcmp(string, "023959") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = YES; }
  2060. if (strcmp(string, "023960") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = YES; }
  2061. if (strcmp(string, "023961") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = YES; }
  2062. if (strcmp(string, "023962") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = YES; }
  2063. if (strcmp(string, "023963") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = YES; }
  2064. if (strcmp(string, "023964") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = YES; }
  2065. if (strcmp(string, "023970") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = YES; }
  2066. if (strcmp(string, "023971") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = YES; }
  2067. if (strcmp(string, "023972") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = YES; }
  2068. if (strcmp(string, "023973") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = YES; }
  2069. if (strcmp(string, "023974") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = YES; }
  2070. if (strcmp(string, "023975") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = YES; }
  2071. if (strcmp(string, "023976") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = YES; }
  2072. if (strcmp(string, "023977") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = YES; }
  2073. if (strcmp(string, "023979") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.EV_Full_Charging = YES; }
  2074. if (strcmp(string, "023983") == EQUAL) { ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason = YES; }
  2075. return true;
  2076. }
  2077. static uint8_t returnConnectTempAndChiller(uint8_t headTemp1, uint8_t headTemp2,
  2078. uint8_t chillerTemp1, uint8_t chillerTemp2)
  2079. {
  2080. uint8_t i = 0;
  2081. uint8_t tempSource[4] = {headTemp1, headTemp2, chillerTemp1, chillerTemp2};
  2082. uint8_t maxTemp = 0;
  2083. if (headTemp1 == UNDEFINED_TEMP &&
  2084. headTemp2 == UNDEFINED_TEMP &&
  2085. chillerTemp1 == UNDEFINED_TEMP &&
  2086. chillerTemp2 == UNDEFINED_TEMP) {
  2087. return UNDEFINED_TEMP;
  2088. }
  2089. for (i = 0; i < (sizeof(tempSource) / sizeof(uint8_t)); i++) {
  2090. if (tempSource[i] != UNDEFINED_TEMP) {
  2091. maxTemp = tempSource[i];
  2092. break;
  2093. }
  2094. }
  2095. for (i = 0; i < (sizeof(tempSource) / sizeof(uint8_t)); i++) {
  2096. if (tempSource[i] != UNDEFINED_TEMP) {
  2097. if (maxTemp < tempSource[i]) {
  2098. maxTemp = tempSource[i];
  2099. }
  2100. }
  2101. }
  2102. return maxTemp;
  2103. }
  2104. static uint8_t returnConnectTemp(uint8_t headTemp1, uint8_t headTemp2)
  2105. {
  2106. uint8_t maxTemp = 0;
  2107. if (headTemp1 == UNDEFINED_TEMP &&
  2108. headTemp2 == UNDEFINED_TEMP) {
  2109. return UNDEFINED_TEMP;
  2110. }
  2111. if (headTemp1 != UNDEFINED_TEMP) {
  2112. maxTemp = headTemp1;
  2113. } else {
  2114. headTemp1 = 0;
  2115. }
  2116. if (headTemp2 != UNDEFINED_TEMP) {
  2117. if (headTemp2 > headTemp1) {
  2118. maxTemp = headTemp2;
  2119. }
  2120. }
  2121. return maxTemp;
  2122. }
  2123. static float ReadAdcVolt(uint8_t AdcChannel)
  2124. {
  2125. //AIN0=CCS GUN Temp 1
  2126. //AIN1=CCS GUN Temp 2
  2127. //AIN2=CCS_Proximity/2
  2128. //AIN3=pilot voltage
  2129. int fd = -1;
  2130. uint8_t str[64];
  2131. uint8_t AdcValue[4];
  2132. if (AdcChannel > 7) {
  2133. return -1;
  2134. }
  2135. memset(str, 0, sizeof(str));
  2136. memset(AdcValue, 0, sizeof(AdcValue));
  2137. sprintf((char *)str, "/sys/bus/iio/devices/iio\:device0/in_voltage%d_raw", AdcChannel);
  2138. fd = open((char *)str, O_RDONLY);
  2139. read(fd, AdcValue, 4);
  2140. close(fd);
  2141. return (1.8 * atoi(AdcValue)) / 4095;
  2142. }
  2143. static void getChillerTemperature(ChillerTemp *chillerTemp)
  2144. {
  2145. uint8_t i = 0;
  2146. float adcVoltage = 0.0;
  2147. ChillerTemp *pChillerTemp = (ChillerTemp *)chillerTemp;
  2148. for (i = 0; i < 2; i++) {
  2149. adcVoltage = 0.0;
  2150. adcVoltage = ReadAdcVolt(i);
  2151. if ((adcVoltage <= 0.9) && (adcVoltage >= 0.8)) { //0 ~ -40
  2152. chillerTemp->Temp[i] = ((adcVoltage - 0.908) * 500) + 60;
  2153. //log_info("1 adcVoltage = %f", (adcVoltage - 0.9) * 500);
  2154. } else if ((adcVoltage <= 1.07) && (adcVoltage > 0.9)) {
  2155. chillerTemp->Temp[i] = ((adcVoltage - 0.91) * 705.88) + 60;
  2156. //log_info("2 adcVoltage = %f", (adcVoltage - 0.9) * 500);
  2157. } /*else {
  2158. chillerTemp->Temp[i] = 195;
  2159. }*/
  2160. //CcsConnectorTemp1 = ReadAdcVolt(i);
  2161. //if ((CcsConnectorTemp1 <= 0.9) && (CcsConnectorTemp1 >= 0.8)) { //0 ~ -40
  2162. // CcsConnectorTemp1 = (CcsConnectorTemp1 - 0.9) * 500;
  2163. //} else if ((CcsConnectorTemp1 <= 1.07) && (CcsConnectorTemp1 > 0.9)) {
  2164. // CcsConnectorTemp1 = (CcsConnectorTemp1 - 0.9) * 705.88;
  2165. //} else {
  2166. // CcsConnectorTemp1 = 195; //not available
  2167. //}
  2168. //CcsConnectorTemp |= ((unsigned int)(CcsConnectorTemp1 + 60) & 0xFF) << (i * 8); //0x00(-60)~0xFE(194)
  2169. }
  2170. }
  2171. void CANReceiver()
  2172. {
  2173. pid_t canRecPid;
  2174. canRecPid = fork();
  2175. if (canRecPid > 0) {
  2176. int nbytes;
  2177. struct can_frame frame;
  2178. int intCmd;
  2179. bool isClearBuf = false; //DS60-120 add
  2180. ChillerTemp chiilerTemp = {0};
  2181. // 槍資訊
  2182. struct ChargingInfoData *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  2183. struct timeval _cmd_ack_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  2184. bool isPass = false;
  2185. gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
  2186. while (!isPass) {
  2187. isPass = true;
  2188. for (uint8_t _index = 0; _index < gun_count; _index++) {
  2189. if (!FindChargingInfoData(_index, &_chargingData[0])) {
  2190. log_error("EvComm (main) : FindChargingInfoData false \n");
  2191. isPass = false;
  2192. break;
  2193. }
  2194. }
  2195. sleep(1);
  2196. }
  2197. for (uint8_t _index = 0; _index < gun_count; _index++) {
  2198. gettimeofday(&_cmd_ack_timeout[_index], NULL);
  2199. }
  2200. while (1) {
  2201. memset(&frame, 0, sizeof(struct can_frame));
  2202. nbytes = read(CanFd, &frame, sizeof(struct can_frame));
  2203. for (uint8_t _index = 0; _index < gun_count; _index++) {
  2204. if (GetTimeoutValue(_cmd_ack_timeout[_index]) >= 5000000) {
  2205. // ACK timeout
  2206. //log_info("gun = %x, ack timeout \n", _index);
  2207. }
  2208. }
  2209. if (nbytes > 0) {
  2210. uint8_t target;
  2211. uint8_t targetGun = 0x00;
  2212. intCmd = (int) (frame.can_id & CAN_EFF_MASK);
  2213. if (!isClearBuf) { //DS60-120 add
  2214. continue;
  2215. }
  2216. if (intCmd == ADDRESS_REQ) {
  2217. AddrAssignment(frame.data);
  2218. continue;
  2219. }
  2220. intCmd = (int) (frame.can_id & CAN_EFF_MASK & 0xFFFFFF00);
  2221. target = ((uint8_t) (frame.can_id & 0x000000FF)); // 0x01 or 0x02
  2222. for (uint8_t _index = 0; _index < gun_count; _index++) { // 假設有找到回應的 Index
  2223. if (_chargingData[_index]->Evboard_id == target) {
  2224. targetGun = _index;
  2225. break;
  2226. }
  2227. }
  2228. //log_info("target = %d, %d, %d\r\n", target, _chargingData[targetGun]->Evboard_id, targetGun);
  2229. if (targetGun < 0 || targetGun >= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY) {
  2230. log_info("EvComm (CANReceiver) : Target index = %x is < 0 or > QUANTITY \n", targetGun);
  2231. continue;
  2232. }
  2233. if (intCmd == 256) {
  2234. continue;
  2235. }
  2236. gettimeofday(&_cmd_ack_timeout[targetGun], NULL);
  2237. switch (intCmd) {
  2238. case NOTIFICATION_EV_STATUS: {
  2239. if (_chargingData[targetGun]->ConnectorPlugIn != frame.data[0]) {
  2240. //log_info("index = %d, ConnectorPlugIn = %x, data[0] = %x \n", targetGun, _chargingData[targetGun]->ConnectorPlugIn, frame.data[0]);
  2241. if (frame.data[0] == PLUG) {
  2242. log_info("Conn %d, Plugin. \n", targetGun);
  2243. } else if (frame.data[0] == UNPLUG) {
  2244. log_info("Conn %d, Unplug. \n", targetGun);
  2245. } else {
  2246. log_info("Conn %d, None Check. (%d) \n", targetGun, frame.data[0]);
  2247. }
  2248. }
  2249. _chargingData[targetGun]->ConnectorPlugIn = frame.data[0];
  2250. _chargingData[targetGun]->PilotVoltage = frame.data[1];
  2251. //log_info("index = %d, ConnectorPlugIn = %x, data[0] = %x \n", targetGun, _chargingData[targetGun]->ConnectorPlugIn, frame.data[0]);
  2252. //log_info("ConnectorPlugIn = %x \n", (-120 + frame.data[1]) / 10);
  2253. }
  2254. break;
  2255. case ACK_EV_FW_VERSION: {
  2256. uint8_t ver[16];
  2257. memset(ver, 0, sizeof(ver));
  2258. if (_chargingData[targetGun]->Type == _Type_Chademo) {
  2259. memcpy(ver, frame.data, frame.can_dlc);
  2260. memcpy(ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version, ver, ARRAY_SIZE(ver));
  2261. ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
  2262. //log_info("chademo ver. : %s\n", ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version);
  2263. } else if (_chargingData[targetGun]->Type == _Type_GB) {
  2264. memcpy(ver, frame.data, frame.can_dlc);
  2265. memcpy(ShmGBTData->evse[_chargingData[targetGun]->type_index].version, ver, ARRAY_SIZE(ver));
  2266. ShmGBTData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
  2267. //log_info("gbt ver. : %s\n", ShmGBTData->evse[_chargingData[targetGun]->type_index].version);
  2268. } else if (_chargingData[targetGun]->Type == _Type_CCS_2) {
  2269. if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121) {
  2270. memcpy(ver, frame.data, frame.can_dlc); //DS60-120 add
  2271. //for (uint8_t _vCount = 0, _vPoint = 0; _vCount < frame.can_dlc; _vCount++) {//DS60-120 remove
  2272. /*if (_vCount % 2 == 0 && _vCount != 0)
  2273. {
  2274. ver[_vCount + _vPoint] = 0x2E;
  2275. _vPoint++;
  2276. }*/
  2277. //ver[_vCount + _vPoint] = frame.data[_vCount];
  2278. //}
  2279. memcpy(&ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].version, ver, ARRAY_SIZE(ver));
  2280. ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
  2281. //log_info("CCS FW = %s \n", ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].version);
  2282. }
  2283. }
  2284. if (targetGun == 0) {
  2285. memset(ShmSysConfigAndInfo->SysInfo.Connector1FwRev, 0, sizeof(ShmSysConfigAndInfo->SysInfo.Connector1FwRev));
  2286. memcpy(ShmSysConfigAndInfo->SysInfo.Connector1FwRev, ver, ARRAY_SIZE(ver));
  2287. } else {
  2288. memset(ShmSysConfigAndInfo->SysInfo.Connector2FwRev, 0, sizeof(ShmSysConfigAndInfo->SysInfo.Connector2FwRev));
  2289. memcpy(ShmSysConfigAndInfo->SysInfo.Connector2FwRev, ver, ARRAY_SIZE(ver));
  2290. }
  2291. }
  2292. break;
  2293. case ACK_EV_HW_VERSION: {
  2294. //log_info("Get EV HW = %s \n", frame.data);
  2295. }
  2296. break;
  2297. case ACK_GET_OUTPUT_REQ: {
  2298. //DS60-120 add
  2299. if ((_chargingData[targetGun]->SystemStatus >= S_PREPARING_FOR_EV &&
  2300. _chargingData[targetGun]->SystemStatus <= S_CHARGING) ||
  2301. (_chargingData[targetGun]->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
  2302. _chargingData[targetGun]->SystemStatus <= S_CCS_PRECHARGE_ST1)) {
  2303. if (_chargingData[targetGun]->EvBatteryStartSoc <= 0) {
  2304. _chargingData[targetGun]->EvBatteryStartSoc = frame.data[1];
  2305. }
  2306. if (frame.data[1] > _chargingData[targetGun]->EvBatterySoc) {
  2307. _chargingData[targetGun]->EvBatterySoc = frame.data[1];
  2308. }
  2309. }
  2310. //_chargingData[targetGun]->EvBatterySoc = frame.data[1]; //DS60-120 remove
  2311. //Jerry add set voltage limit
  2312. _chargingData[targetGun]->EvBatterytargetVoltage = (float)((frame.data[3] << 8) + frame.data[2]) / 10;
  2313. if (_chargingData[targetGun]->EvBatterytargetVoltage > maxChargingVol[targetGun] * 0.1) {
  2314. _chargingData[targetGun]->EvBatterytargetVoltage = maxChargingVol[targetGun] * 0.1;
  2315. }
  2316. //printf("id = %d, EvBatterytargetVoltage = %.2f\r\n", targetGun, _chargingData[targetGun]->EvBatterytargetVoltage);
  2317. //Jerry add set currency limit
  2318. _chargingData[targetGun]->EvBatterytargetCurrent = (float)((frame.data[5] << 8) + frame.data[4]) / 10;
  2319. if (_chargingData[targetGun]->EvBatterytargetCurrent > maxChargingCur[targetGun] * 0.1) {
  2320. _chargingData[targetGun]->EvBatterytargetCurrent = maxChargingCur[targetGun] * 0.1;
  2321. }
  2322. //printf("id = %d, EvBatterytargetCurrent = %.2f\r\n", targetGun, _chargingData[targetGun]->EvBatterytargetCurrent);
  2323. _chargingData[targetGun]->RemainChargingDuration = ((short) frame.data[7] << 8) + (short) frame.data[6];
  2324. //printf("RemainChargingDuration = %d\r\n", _chargingData[targetGun]->RemainChargingDuration);
  2325. if (_chargingData[targetGun]->Type == _Type_Chademo) {
  2326. //if (ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].EvDetection != frame.data[0])
  2327. {
  2328. ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
  2329. }
  2330. ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].EvDetection = frame.data[0];
  2331. ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].SOC = _chargingData[targetGun]->EvBatterySoc;
  2332. ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].TargetBatteryVoltage = (_chargingData[targetGun]->EvBatterytargetVoltage * 10);
  2333. ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].ChargingCurrentRequest = (_chargingData[targetGun]->EvBatterytargetCurrent * 10);
  2334. } else if (_chargingData[targetGun]->Type == _Type_GB) {
  2335. //if (ShmGBTData->ev[_chargingData[targetGun]->type_index].EvDetection != frame.data[0])
  2336. {
  2337. ShmGBTData->ev[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
  2338. }
  2339. ShmGBTData->ev[_chargingData[targetGun]->type_index].EvDetection = frame.data[0];
  2340. ShmGBTData->ev[_chargingData[targetGun]->type_index].SOC = _chargingData[targetGun]->EvBatterySoc;
  2341. ShmGBTData->ev[_chargingData[targetGun]->type_index].TargetBatteryVoltage = (_chargingData[targetGun]->EvBatterytargetVoltage * 10);
  2342. ShmGBTData->ev[_chargingData[targetGun]->type_index].ChargingCurrentRequest = (_chargingData[targetGun]->EvBatterytargetCurrent * 10);
  2343. } else if (_chargingData[targetGun]->Type == _Type_CCS_2) {
  2344. if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121) {
  2345. ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
  2346. }
  2347. }
  2348. //log_info("EvBatterytargetVoltage = %f \n", _chargingData[targetGun]->EvBatterytargetVoltage);
  2349. //log_info("EvBatterytargetCurrent = %f \n", _chargingData[targetGun]->EvBatterytargetCurrent);
  2350. //log_info("BatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TargetBatteryVoltage);
  2351. //log_info("CurrentRequest = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].ChargingCurrentRequest);
  2352. }
  2353. break;
  2354. case ACK_GET_EV_BATTERY_INFO: {
  2355. //_chargingData[target].EvACorDCcharging = frame.data[0];
  2356. //_chargingData[target]->TotalBatteryCap = ((float) frame.data[4] << 8) + (short) frame.data[3];
  2357. _chargingData[targetGun]->EvBatteryMaxVoltage = (((short) frame.data[4] << 8) + (short) frame.data[3]) / 10;
  2358. //_chargingData[target]->EvBatteryMaxCurrent = ((float) frame.data[4] << 8) + (short) frame.data[3];
  2359. //_chargingData[target].MaxiBatteryCurrent = ((short) frame.data[6] << 8) + (short) frame.data[5];
  2360. if (_chargingData[targetGun]->Type == _Type_Chademo) {
  2361. ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data[2] << 8) + (short) frame.data[1];
  2362. ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].MaxiBatteryVoltage = _chargingData[targetGun]->EvBatteryMaxVoltage;
  2363. //log_info("EvBatteryMaxVoltage = %f \n", _chargingData[target]->EvBatteryMaxVoltage);
  2364. //log_info("TotalBatteryCapacity = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TotalBatteryCapacity);
  2365. //log_info("MaxiBatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].MaxiBatteryVoltage);
  2366. } else if (_chargingData[targetGun]->Type == _Type_GB) {
  2367. ShmGBTData->ev[_chargingData[targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data[2] << 8) + (short) frame.data[1];
  2368. ShmGBTData->ev[_chargingData[targetGun]->type_index].MaxiBatteryVoltage = _chargingData[targetGun]->EvBatteryMaxVoltage;
  2369. } else if (_chargingData[targetGun]->Type == _Type_CCS_2) {
  2370. }
  2371. }
  2372. break;
  2373. case ACK_GET_MISCELLANEOUS_INFO: {
  2374. _chargingData[targetGun]->GunLocked = frame.data[0];
  2375. _chargingData[targetGun]->PilotVoltage = (float)(-120 + frame.data[3]) / 10;
  2376. if (_chargingData[targetGun]->Type == _Type_Chademo) {
  2377. ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureP = frame.data[1];
  2378. ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureN = frame.data[2];
  2379. ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].EvboardStatus = frame.data[7];
  2380. } else if (_chargingData[targetGun]->Type == _Type_GB) {
  2381. ShmGBTData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureP = frame.data[1];
  2382. ShmGBTData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureN = frame.data[2];
  2383. ShmGBTData->evse[_chargingData[targetGun]->type_index].EvboardStatus = frame.data[7];
  2384. }
  2385. /*else if (_chargingData[targetGun]->Type == _Type_CCS_2) {
  2386. if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121) {
  2387. //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureP = frame.data[1];
  2388. //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureN = frame.data[2];
  2389. }
  2390. }*/
  2391. //memset((uint8_t)&chiilerTemp, 0, sizeof(ChillerTemp));
  2392. if (targetGun == 0 &&
  2393. ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "V", 1) == 0) ||
  2394. (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "F", 1) == 0))
  2395. ) {
  2396. getChillerTemperature(&chiilerTemp);
  2397. //log_info("%d chillerTemp1 = %d, temp2 = %d\r\n", targetGun, chiilerTemp.Temp[0], chiilerTemp.Temp[1]);
  2398. _chargingData[targetGun]->ConnectorTemp = returnConnectTempAndChiller(
  2399. frame.data[1],
  2400. frame.data[2],
  2401. chiilerTemp.Temp[0],
  2402. chiilerTemp.Temp[1]);
  2403. } else if (targetGun == 1 &&
  2404. ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "V", 1) == 0) ||
  2405. (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "F", 1) == 0))
  2406. ) {
  2407. getChillerTemperature(&chiilerTemp);
  2408. //log_info("%d chillerTemp1 = %d, temp2 = %d\r\n", targetGun, chiilerTemp.Temp[0], chiilerTemp.Temp[1]);
  2409. _chargingData[targetGun]->ConnectorTemp = returnConnectTempAndChiller(
  2410. frame.data[1],
  2411. frame.data[2],
  2412. chiilerTemp.Temp[0],
  2413. chiilerTemp.Temp[1]);
  2414. } else {
  2415. _chargingData[targetGun]->ConnectorTemp = returnConnectTemp(frame.data[1], frame.data[2]);
  2416. //log_info("connector temperature = %d\r\n", _chargingData[targetGun]->ConnectorTemp);
  2417. }
  2418. //log_info("EvboardStatus = %x \n",
  2419. // ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].EvboardStatus);
  2420. //log_info("ConnectorPlug locked = %x \n",
  2421. // frame.data[0]);
  2422. //if (frame.data[1] >= GUN_OTP_VALUE ||
  2423. // frame.data[2] >= GUN_OTP_VALUE ||
  2424. // chiilerTemp.Temp[0] >= GUN_OTP_VALUE ||
  2425. // chiilerTemp.Temp[1] >= GUN_OTP_VALUE) {
  2426. // log_info("Conn %d Temp 0= %d, Temp 1 = %d, chillerTemp1 = %d, chillerTemp2 = %d\r\n",
  2427. // targetGun,
  2428. // frame.data[1],
  2429. // frame.data[2],
  2430. // chiilerTemp.Temp[0],
  2431. // chiilerTemp.Temp[1]);
  2432. //}
  2433. //log_info("PilotVoltage = %x \n", (-120 + frame.data[3]) / 10);
  2434. }
  2435. break;
  2436. case ACK_EVSE_ISOLATION_STATUS: {}
  2437. break;
  2438. case ACK_EVSE_PRECHAGE_INFO: {
  2439. _chargingData[targetGun]->PrechargeStatus = frame.data[0];
  2440. }
  2441. break;
  2442. case NOTIFICATION_EV_STOP: {
  2443. // 車端要求停止
  2444. if ((_chargingData[targetGun]->SystemStatus >= S_REASSIGN_CHECK && //DS60-120 add
  2445. _chargingData[targetGun]->SystemStatus <= S_TERMINATING) ||
  2446. (_chargingData[targetGun]->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
  2447. _chargingData[targetGun]->SystemStatus <= S_CCS_PRECHARGE_ST1)) {
  2448. // frame.data[0] : 0x01 => normal stop, 0x02 => ev emergency stop
  2449. log_info("(%d) NOTIFICATION_EV_STOP err level = %d-----------------------------\n",
  2450. targetGun,
  2451. frame.data[0]);
  2452. if (frame.data[0] == 0x02) {
  2453. if (AbnormalStopAnalysis(targetGun, frame.data + 1) == true) {
  2454. _chargingData[targetGun]->StopChargeFlag = YES;
  2455. } else {
  2456. _chargingData[targetGun]->NormalStopChargeFlag = YES;
  2457. }
  2458. } else {
  2459. AbnormalStopAnalysis(targetGun, frame.data + 1);
  2460. _chargingData[targetGun]->NormalStopChargeFlag = YES;
  2461. }
  2462. }
  2463. }
  2464. break;
  2465. default:
  2466. log_info("EV board = %d, Ack none defined. intCmd = %d \n", targetGun, intCmd);
  2467. break;
  2468. }
  2469. } else { //DS60-120 add
  2470. isClearBuf = true;
  2471. usleep(10000);
  2472. }
  2473. }
  2474. }
  2475. }
  2476. //================================================
  2477. // Main process
  2478. //================================================
  2479. // 檢查 uint8_t 中某個 Bit 的值
  2480. // _uint8_t : 欲改變的 byte
  2481. // _bit : 該 uint8_t 的第幾個 bit
  2482. uint8_t EvDetectionStatus(uint8_t _byte, uint8_t _bit)
  2483. {
  2484. return ( _byte & mask_table[_bit] ) != 0x00;
  2485. }
  2486. bool IsConnectorPlugIn(struct ChargingInfoData *chargingData)
  2487. {
  2488. return (chargingData->ConnectorPlugIn == 0x01) ? true : false;
  2489. }
  2490. void SetPresentChargingOutputPower(struct ChargingInfoData *chargingData_1, struct ChargingInfoData *chargingData_2)
  2491. {
  2492. float vol1 = 0, cur1 = 0;
  2493. float vol2 = 0, cur2 = 0;
  2494. vol1 = chargingData_1->FireChargingVoltage;
  2495. cur1 = (chargingData_1->PresentChargingCurrent * 10);
  2496. vol2 = chargingData_2->FireChargingVoltage;
  2497. cur2 = (chargingData_2->PresentChargingCurrent * 10);
  2498. //DS60-120 add
  2499. if (
  2500. (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] >= vol1 + CHK_VOL_RANGE) || (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] <= vol1 - CHK_VOL_RANGE) ||
  2501. (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] >= cur1 + CHK_CUR_RANGE) || (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] <= cur1 - CHK_CUR_RANGE) ||
  2502. (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] >= vol2 + CHK_VOL_RANGE) || (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] <= vol2 - CHK_VOL_RANGE) ||
  2503. (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] >= cur2 + CHK_CUR_RANGE) || (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] <= cur2 - CHK_CUR_RANGE)
  2504. ) {
  2505. log_info("G1 -> Output Vol = %.1f, Output Cur = %.1f -- G2 -> Output Vol = %.1f, Output Cur = %.1f\r\n",
  2506. vol1 / 10, cur1 / 10, vol2 / 10, cur2 / 10);
  2507. LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] = vol1;
  2508. LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] = cur1;
  2509. LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] = vol2;
  2510. LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] = cur2;
  2511. }
  2512. //if (_outVol_1 != vol1 ||
  2513. // _outCur_1 != cur1 ||
  2514. // _outVol_2 != vol2 ||
  2515. // _outCur_2 != cur2) {
  2516. /*log_info("G1 -> Output Vol = %f, Output Cur = %f -- G2 -> Output Vol = %f, Output Cur = %f \n",
  2517. vol1, cur1, vol2, cur2);
  2518. */
  2519. // _outVol_1 = vol1; _outCur_1 = cur1; _outVol_2 = vol2; _outCur_2 = cur2;
  2520. //}
  2521. SetPresentOutputPower(vol1, cur1, vol2, cur2);
  2522. }
  2523. void SetPresentChargingOutputCap(struct ChargingInfoData *chargingData_1, struct ChargingInfoData *chargingData_2)
  2524. {
  2525. float pow1 = 0, cur1 = 0;
  2526. float pow2 = 0, cur2 = 0;
  2527. #if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
  2528. float vol = 0;
  2529. #endif //!defined DD360 && !defined DD360Audi
  2530. pow1 = chargingData_1->AvailableChargingPower;
  2531. cur1 = chargingData_1->AvailableChargingCurrent;
  2532. #if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
  2533. vol = chargingData_1->MaximumChargingVoltage;
  2534. GetMaxVolAndCurMethod(chargingData_1->Index, &vol, &cur1);
  2535. GetMaxPowerMethod(chargingData_1->Index, &pow1);
  2536. #endif //!defined DD360 && !defined DD360Audi
  2537. //DS60-120 add
  2538. if (pow1 <= 0) {
  2539. cur1 = 0;
  2540. } else {
  2541. if (chargingData_1->SystemStatus == S_CHARGING &&
  2542. chargingData_1->FireChargingVoltage > 1500) {
  2543. float maxCur = 0;
  2544. maxCur = (pow1 * 1000) / chargingData_1->FireChargingVoltage;
  2545. if (maxCur * 10 <= cur1) {
  2546. //log_info("Gun1 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur1);
  2547. cur1 = maxCur * 10;
  2548. }
  2549. }
  2550. }
  2551. pow2 = chargingData_2->AvailableChargingPower;
  2552. cur2 = chargingData_2->AvailableChargingCurrent;
  2553. #if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
  2554. vol = chargingData_2->MaximumChargingVoltage;
  2555. GetMaxVolAndCurMethod(chargingData_2->Index, &vol, &cur2);
  2556. GetMaxPowerMethod(chargingData_2->Index, &pow2);
  2557. #endif //!defined DD360 && !defined DD360Audi
  2558. //DS60-120 add
  2559. if (pow2 <= 0) {
  2560. cur2 = 0;
  2561. } else {
  2562. if (chargingData_2->SystemStatus == S_CHARGING &&
  2563. chargingData_2->FireChargingVoltage > 1500) {
  2564. float maxCur = 0;
  2565. maxCur = (pow2 * 1000) / chargingData_2->FireChargingVoltage;
  2566. if (maxCur * 10 <= cur2) {
  2567. //log_info("Gun2 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur2);
  2568. cur2 = maxCur * 10;
  2569. }
  2570. }
  2571. }
  2572. //DS60-120 add
  2573. if ((LogInfo[0][EV_LOG_OUTPUT_CAP_POW] <= pow1 - 5 || LogInfo[0][EV_LOG_OUTPUT_CAP_POW] >= pow1 + 5) ||
  2574. (LogInfo[0][EV_LOG_OUTPUT_CAP_CUR] <= cur1 - 5 || LogInfo[0][EV_LOG_OUTPUT_CAP_CUR] >= cur1 + 5) ||
  2575. (LogInfo[1][EV_LOG_OUTPUT_CAP_POW] <= pow2 - 5 || LogInfo[1][EV_LOG_OUTPUT_CAP_POW] >= pow2 + 5) ||
  2576. (LogInfo[1][EV_LOG_OUTPUT_CAP_CUR] <= cur2 - 5 || LogInfo[1][EV_LOG_OUTPUT_CAP_CUR] >= cur2 + 5)) {
  2577. //log_info("----------------------------------------------------- \n");
  2578. log_info("To EV (Real) Power_1 = %.1f, Cur_1 = %.1f, Power_2 = %.1f, Cur_2 = %.1f\r\n",
  2579. pow1 / 10, cur1 / 10, pow2 / 10, cur2 / 10);
  2580. //log_info("----------------------------------------------------- \n");
  2581. LogInfo[0][EV_LOG_OUTPUT_CAP_POW] = pow1;
  2582. LogInfo[0][EV_LOG_OUTPUT_CAP_CUR] = cur1;
  2583. LogInfo[1][EV_LOG_OUTPUT_CAP_POW] = pow2;
  2584. LogInfo[1][EV_LOG_OUTPUT_CAP_CUR] = cur2;
  2585. chargingData_1->RealMaxCurrent = cur1;
  2586. chargingData_1->RealMaxPower = pow1;
  2587. if (gun_count == 2) {
  2588. chargingData_2->RealMaxCurrent = cur2;
  2589. chargingData_2->RealMaxPower = pow2;
  2590. }
  2591. }
  2592. //DS60-120 remove
  2593. /*if (_pow_1 != pow1 ||
  2594. _cur_1 != cur1 ||
  2595. _pow_2 != pow2 ||
  2596. _cur_2 != cur2) {
  2597. log_info("To EV (Real) Power_1 = %f, Cur_1 = %f, Power_2 = %f, Cur_2 = %f \n",
  2598. pow1, cur1, pow2, cur2);
  2599. _pow_1 = pow1; _cur_1 = cur1; _pow_2 = pow2; _cur_2 = cur2;
  2600. chargingData_1->RealMaxCurrent = _cur_1;
  2601. chargingData_1->RealMaxPower = pow1;
  2602. if (gun_count == 2) {
  2603. chargingData_2->RealMaxCurrent = cur2;
  2604. chargingData_2->RealMaxPower = pow2;
  2605. }
  2606. }*/
  2607. SetPresentOutputCapacity(pow1, cur1, pow2, cur2);
  2608. }
  2609. void Initialization()
  2610. {
  2611. bool isPass = false;
  2612. while (!isPass) {
  2613. isPass = true;
  2614. for (uint8_t _index = 0; _index < gun_count; _index++) {
  2615. if (!FindChargingInfoData(_index, &_chargingData[0])) {
  2616. log_error("EvComm (main) : FindChargingInfoData false \n");
  2617. isPass = false;
  2618. break;
  2619. }
  2620. }
  2621. sleep(1);
  2622. }
  2623. }
  2624. void GetMaxVolAndCurMethod(uint8_t index, float *vol, float *cur)
  2625. {
  2626. if (maxChargingVol[index] != 0 && maxChargingVol[index] <= *vol) {
  2627. *vol = maxChargingVol[index];
  2628. }
  2629. if (maxChargingCur[index] != 0 && maxChargingCur[index] <= *cur) {
  2630. *cur = maxChargingCur[index];
  2631. }
  2632. //if (_chargingData[index]->SystemStatus == S_CHARGING && //DS60-120 remove
  2633. // _chargingData[index]->ChargingProfileCurrent > 0 &&
  2634. if (((_chargingData[index]->SystemStatus >= S_PREPARING_FOR_EVSE && _chargingData[index]->SystemStatus <= S_CHARGING) ||
  2635. (_chargingData[index]->SystemStatus >= S_CCS_PRECHARGE_ST0 && _chargingData[index]->SystemStatus <= S_CCS_PRECHARGE_ST1)) &&
  2636. _chargingData[index]->ChargingProfileCurrent >= 0 &&
  2637. _chargingData[index]->ChargingProfileCurrent <= *cur) {
  2638. *cur = _chargingData[index]->ChargingProfileCurrent;
  2639. }
  2640. }
  2641. void GetMaxPowerMethod(uint8_t index, float *pow)
  2642. {
  2643. if (maxChargingPow != 0 && maxChargingPow <= *pow) {
  2644. *pow = maxChargingPow;
  2645. }
  2646. if (_chargingData[index]->SystemStatus == S_CHARGING &&
  2647. _chargingData[index]->ChargingProfilePower > 0 &&
  2648. _chargingData[index]->ChargingProfilePower <= *pow) {
  2649. *pow = _chargingData[index]->ChargingProfilePower;
  2650. }
  2651. }
  2652. time_t GetRtcInfoForEpoch()
  2653. {
  2654. struct timeb csuTime;
  2655. struct tm *tmCSU;
  2656. struct tm t;
  2657. time_t result;
  2658. ftime(&csuTime);
  2659. tmCSU = localtime(&csuTime.time);
  2660. t.tm_year = tmCSU->tm_year;
  2661. t.tm_mon = tmCSU->tm_mon;
  2662. t.tm_mday = tmCSU->tm_mday;
  2663. t.tm_hour = tmCSU->tm_hour;
  2664. t.tm_min = tmCSU->tm_min;
  2665. t.tm_sec = tmCSU->tm_sec;
  2666. t.tm_isdst = -1;
  2667. result = mktime(&t);
  2668. return result;
  2669. }
  2670. uint8_t GetStopChargingReasonByEvse(uint8_t gunIndex, uint8_t *reason)
  2671. {
  2672. uint8_t result = NO;
  2673. if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.EmergencyStopTrip == 0x01) {
  2674. // 012251
  2675. *(reason + 5) = 0;
  2676. *(reason + 4) = 1;
  2677. *(reason + 3) = 2;
  2678. *(reason + 2) = 2;
  2679. *(reason + 1) = 5;
  2680. *(reason + 0) = 1;
  2681. result = YES;
  2682. }
  2683. if (_chargingData[gunIndex]->Type == _Type_Chademo) {
  2684. if (ShmStatusCodeData->FaultCode.FaultEvents.bits.ChademoOutputRelayDrivingFault == YES) {
  2685. // 011012
  2686. *(reason + 5) = 0;
  2687. *(reason + 4) = 1;
  2688. *(reason + 3) = 1;
  2689. *(reason + 2) = 0;
  2690. *(reason + 1) = 1;
  2691. *(reason + 0) = 2;
  2692. result = YES;
  2693. } else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoOutputUVPFail == YES) {
  2694. // 012289
  2695. *(reason + 5) = 0;
  2696. *(reason + 4) = 1;
  2697. *(reason + 3) = 2;
  2698. *(reason + 2) = 2;
  2699. *(reason + 1) = 8;
  2700. *(reason + 0) = 9;
  2701. result = YES;
  2702. } else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoGfdTrip == YES) {
  2703. // 012234
  2704. *(reason + 5) = 0;
  2705. *(reason + 4) = 1;
  2706. *(reason + 3) = 2;
  2707. *(reason + 2) = 2;
  2708. *(reason + 1) = 3;
  2709. *(reason + 0) = 4;
  2710. result = YES;
  2711. }
  2712. } else if (_chargingData[gunIndex]->Type == _Type_GB) {
  2713. if (ShmStatusCodeData->FaultCode.FaultEvents.bits.ChademoOutputRelayDrivingFault == YES) {
  2714. // 012290
  2715. *(reason + 5) = 0;
  2716. *(reason + 4) = 1;
  2717. *(reason + 3) = 2;
  2718. *(reason + 2) = 2;
  2719. *(reason + 1) = 9;
  2720. *(reason + 0) = 0;
  2721. result = YES;
  2722. } else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbGfdTrip == YES) {
  2723. // 012236
  2724. *(reason + 5) = 0;
  2725. *(reason + 4) = 1;
  2726. *(reason + 3) = 2;
  2727. *(reason + 2) = 2;
  2728. *(reason + 1) = 3;
  2729. *(reason + 0) = 6;
  2730. result = YES;
  2731. }
  2732. } else if (_chargingData[gunIndex]->Type == _Type_CCS_2) {
  2733. if (ShmStatusCodeData->FaultCode.FaultEvents.bits.CcsOutputRelayDrivingFault == YES) {
  2734. // 011014
  2735. *(reason + 5) = 0;
  2736. *(reason + 4) = 1;
  2737. *(reason + 3) = 1;
  2738. *(reason + 2) = 0;
  2739. *(reason + 1) = 1;
  2740. *(reason + 0) = 4;
  2741. result = YES;
  2742. } else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsOutputUVPFail == YES) {
  2743. // 012288
  2744. *(reason + 5) = 0;
  2745. *(reason + 4) = 1;
  2746. *(reason + 3) = 2;
  2747. *(reason + 2) = 2;
  2748. *(reason + 1) = 8;
  2749. *(reason + 0) = 8;
  2750. result = YES;
  2751. } else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsGfdTrip == YES) {
  2752. // 012235
  2753. *(reason + 5) = 0;
  2754. *(reason + 4) = 1;
  2755. *(reason + 3) = 2;
  2756. *(reason + 2) = 2;
  2757. *(reason + 1) = 3;
  2758. *(reason + 0) = 5;
  2759. result = YES;
  2760. }
  2761. }
  2762. return result;
  2763. }
  2764. void FormatVoltageAndCurrent()
  2765. {
  2766. uint8_t gunIndex = 0;
  2767. ParsingRatedCur parsingRatedCur = {0};
  2768. RateCurInfo *pRatedCurInfo = NULL;
  2769. if (RatedCurrentParsing((char *)ShmSysConfigAndInfo->SysConfig.ModelName, &parsingRatedCur) != PASS) {
  2770. log_error("Parsing rated current failed\r\n");
  2771. return;
  2772. }
  2773. maxChargingPow = parsingRatedCur.Power;
  2774. for (gunIndex = 0; gunIndex < gun_count; gunIndex++) {
  2775. pRatedCurInfo = (RateCurInfo *)&parsingRatedCur.ParsingInfo[gunIndex];
  2776. maxChargingVol[gunIndex] = pRatedCurInfo->Voltage;
  2777. maxChargingCur[gunIndex] = pRatedCurInfo->Current;
  2778. }
  2779. #if 0
  2780. char isLowCur = 0x00;
  2781. char EvsePower[2];
  2782. EvsePower[2] = '\0';
  2783. if (strlen((char *) ShmSysConfigAndInfo->SysConfig.ModelName) >= 6) {
  2784. strncpy(EvsePower, (char *)(ShmSysConfigAndInfo->SysConfig.ModelName + 4), 2);
  2785. if (strcmp(EvsePower, "30") == EQUAL) {
  2786. isLowCur = 0x00;
  2787. } else if (strcmp(EvsePower, "60") == EQUAL) {
  2788. isLowCur = 0x01;
  2789. } else {
  2790. isLowCur = 0x02;
  2791. }
  2792. }
  2793. for (uint8_t _index = 0; _index < gun_count; _index++) {
  2794. if (_chargingData[_index]->Type == _Type_Chademo) {
  2795. maxChargingVol[_index] = chademoVol;
  2796. } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  2797. maxChargingVol[_index] = ccsVol;
  2798. } else if (_chargingData[_index]->Type == _Type_GB) {
  2799. maxChargingVol[_index] = gbVol;
  2800. }
  2801. if (isLowCur == 0x00) {
  2802. if (_chargingData[_index]->Type == _Type_Chademo) {
  2803. maxChargingCur[_index] = 600;
  2804. } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  2805. maxChargingCur[_index] = 600;
  2806. } else if (_chargingData[_index]->Type == _Type_GB) {
  2807. maxChargingCur[_index] = 800;
  2808. }
  2809. } else if (isLowCur == 0x01) {
  2810. if (_chargingData[_index]->Type == _Type_Chademo) {
  2811. maxChargingCur[_index] = 1200;
  2812. } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  2813. maxChargingCur[_index] = 1200;
  2814. } else if (_chargingData[_index]->Type == _Type_GB) {
  2815. maxChargingCur[_index] = 1200;
  2816. }
  2817. } else {
  2818. if (_chargingData[_index]->Type == _Type_Chademo) {
  2819. if (_index == 0) {
  2820. if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "K", 1) == 0) {
  2821. maxChargingCur[_index] = 2000;
  2822. } else {
  2823. maxChargingCur[_index] = 1200;
  2824. }
  2825. } else if (_index == 1) {
  2826. if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "K", 1) == 0) {
  2827. maxChargingCur[_index] = 2000;
  2828. } else {
  2829. maxChargingCur[_index] = 1200;
  2830. }
  2831. }
  2832. } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  2833. if (_index == 0) {
  2834. if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "V", 1) == 0) ||
  2835. (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "F", 1) == 0)
  2836. ) {
  2837. maxChargingCur[_index] = 5000;
  2838. continue;
  2839. }
  2840. if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "T", 1) == 0) ||
  2841. (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "D", 1) == 0)
  2842. ) {
  2843. maxChargingCur[_index] = 3000;
  2844. continue;
  2845. }
  2846. maxChargingCur[_index] = 2000;
  2847. } else if (_index == 1) {
  2848. if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "V", 1) == 0) ||
  2849. (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "F", 1) == 0)
  2850. ) {
  2851. maxChargingCur[_index] = 5000;
  2852. continue;
  2853. }
  2854. if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "T", 1) == 0) ||
  2855. (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "D", 1) == 0)
  2856. ) {
  2857. maxChargingCur[_index] = 3000;
  2858. continue;
  2859. }
  2860. maxChargingCur[_index] = 2000;
  2861. }
  2862. } else if (_chargingData[_index]->Type == _Type_GB) {
  2863. maxChargingCur[_index] = 2500;
  2864. }
  2865. }
  2866. }
  2867. #endif //0
  2868. }
  2869. static void checkConnectorOVPState(uint8_t _index)
  2870. {
  2871. // 避免槍溫偵測誤判
  2872. static uint8_t gunTempAllowCount[2] = {0, 0};
  2873. bool isOTP = false;
  2874. switch (_chargingData[_index]->Type) {
  2875. case _Type_Chademo:
  2876. if (ShmDcCommonData->ConnectErrList[_index].GunBits.ChaConnectOTP) {
  2877. isOTP = true;
  2878. }
  2879. break;
  2880. case _Type_CCS_2:
  2881. if (ShmDcCommonData->ConnectErrList[_index].GunBits.CCSConnectOTP) {
  2882. isOTP = true;
  2883. }
  2884. break;
  2885. case _Type_GB:
  2886. if (ShmDcCommonData->ConnectErrList[_index].GunBits.GBTConnectOTP) {
  2887. isOTP = true;
  2888. }
  2889. break;
  2890. }
  2891. if (isOTP) {
  2892. if (gunTempAllowCount[_index] >= 2) {
  2893. _chargingData[_index]->StopChargeFlag = YES;
  2894. } else {
  2895. gunTempAllowCount[_index] += 1;
  2896. }
  2897. } else {
  2898. gunTempAllowCount[_index] = 0;
  2899. }
  2900. }
  2901. int main(int argc, char *argv[])
  2902. {
  2903. if (InitShareMemory() == FAIL) {
  2904. #ifdef SystemLogMessage
  2905. log_error("InitShareMemory NG\n");
  2906. #endif
  2907. if (ShmStatusCodeData != NULL) {
  2908. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
  2909. }
  2910. sleep(5);
  2911. return 0;
  2912. }
  2913. gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
  2914. Initialization();
  2915. // 根據輸出能量與槍別給予當前最大耐壓耐流
  2916. FormatVoltageAndCurrent(); //DS60-120 add
  2917. CanFd = InitCanBus();
  2918. CANReceiver();
  2919. uint8_t priorityLow = 1;
  2920. time_t rtc = GetRtcInfoForEpoch();
  2921. for (uint8_t _index = 0; _index < gun_count; _index++) { //DS60-120 add
  2922. if (_chargingData[_index]->Type == _Type_Chademo) {
  2923. log_info("Conn %d (Chademo), MaxVol = %f, MaxCur = %f \n",
  2924. _index, maxChargingVol[_index], maxChargingCur[_index]);
  2925. } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  2926. log_info("Conn %d (CCS), MaxVol = %f, MaxCur = %f \n",
  2927. _index, maxChargingVol[_index], maxChargingCur[_index]);
  2928. } else if (_chargingData[_index]->Type == _Type_GB) {
  2929. log_info("Conn %d (GBT), MaxVol = %f, MaxCur = %f \n",
  2930. _index, maxChargingVol[_index], maxChargingCur[_index]);
  2931. }
  2932. }
  2933. while (CanFd) {
  2934. for (uint8_t _index = 0; _index < gun_count; _index++) {
  2935. if (priorityLow == 1) {
  2936. // 優先權較低 - 只要有回應即不會再詢問
  2937. if (_chargingData[_index]->Type == _Type_Chademo &&
  2938. ShmCHAdeMOData->evse[_chargingData[_index]->type_index].SelfTest_Comp != PASS) {
  2939. SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
  2940. GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
  2941. } else if (_chargingData[_index]->Type == _Type_GB &&
  2942. ShmGBTData->evse[_chargingData[_index]->type_index].SelfTest_Comp != PASS) {
  2943. SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
  2944. GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
  2945. } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  2946. if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121 &&
  2947. ShmCcsData->V2GMessage_DIN70121[_chargingData[_index]->type_index].SelfTest_Comp != PASS) {
  2948. SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
  2949. GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
  2950. }
  2951. }
  2952. // 固定要取得的資訊 : 1.槍鎖狀態, 2."Connector 1" 溫度, 3."Connector 2" 溫度, 4.Pilot Voltage
  2953. //log_info("GetMiscellaneousInfo. index = %d, Eid = %d \n", _index, _chargingData[_index]->Evboard_id);
  2954. GetMiscellaneousInfo(_index,
  2955. _chargingData[_index]->RelayK1K2Status,
  2956. _chargingData[_index]->PresentChargedEnergy,
  2957. (_chargingData[_index]->PresentChargingVoltage * 10),
  2958. _chargingData[_index]->Evboard_id);
  2959. checkConnectorOVPState(_index);
  2960. }
  2961. switch (_chargingData[_index]->SystemStatus) {
  2962. case S_IDLE:
  2963. case S_RESERVATION:
  2964. if (_chargingData[_index]->Type == _Type_Chademo) {
  2965. ClearAbnormalStatus_Chademo(_index);
  2966. } else if (_chargingData[_index]->Type == _Type_GB) {
  2967. ClearAbnormalStatus_GB(_index);
  2968. } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  2969. ClearAbnormalStatus_CCS(_index);
  2970. }
  2971. if (priorityLow == 1) {
  2972. _chargingData[_index]->PresentChargedEnergy = 0;
  2973. _chargingData[_index]->PresentChargingPower = 0;
  2974. _chargingData[_index]->GroundFaultStatus = GFD_WAIT;
  2975. _chargingData[_index]->RealRatingPower = 0;
  2976. _chargingData[_index]->StopChargeFlag = NO;
  2977. _chargingData[_index]->NormalStopChargeFlag = NO;//DS60-120 add
  2978. _chargingData[_index]->ChargingFee = 0.0;
  2979. _chargingData[_index]->EvBatterySoc = 0;
  2980. _chargingData[_index]->EvBatteryStartSoc = 0; //DS60-120 add
  2981. _chargingData[_index]->EvBatteryMaxVoltage = 0; //DS60-120 add
  2982. _chargingData[_index]->ChargingProfilePower = -1; //DS60-120 add
  2983. _chargingData[_index]->ChargingProfileCurrent = -1; //DS60-120 add
  2984. if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX) { //DS60-120 add
  2985. _chargingData[_index]->PresentChargingVoltage = 0;
  2986. _chargingData[_index]->PresentChargingCurrent = 0;
  2987. _chargingData[_index]->EvBatteryMaxVoltage = 0;
  2988. }
  2989. chargingTime[_index] = 0;
  2990. //maxChargingCur[_index] = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
  2991. //maxChargingPow = (ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10);
  2992. //DS60-120 add
  2993. SendErrorCount[_index] = 0;
  2994. //maxChargingPow = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
  2995. // ShmPsuData->SystemAvailablePower 已是 * 10
  2996. //maxChargingPow = ShmPsuData->SystemAvailablePower;
  2997. if (ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10 != 0 &&
  2998. ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10 < maxChargingPow) {
  2999. maxChargingPow = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
  3000. }
  3001. LogInfo[_index][EV_LOG_EVSE_MAX_VOL] = 0;
  3002. LogInfo[_index][EV_LOG_EVSE_MAX_CUR] = 0;
  3003. LogInfo[_index][EV_LOG_MAX_BATT_VOL] = 0;
  3004. LogInfo[_index][EV_LOG_REAL_CAP_POW] = 0;
  3005. LogInfo[_index][EV_LOG_SOC] = 0;
  3006. if (gun_count == 1) {
  3007. SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
  3008. } else if (gun_count == 2) {
  3009. SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
  3010. }
  3011. }
  3012. break;
  3013. case S_PREPARNING: {
  3014. chkChademoPermission[_index] = false; //DS60-120 add
  3015. // 設定當前輸出
  3016. if (gun_count == 1) {
  3017. SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
  3018. } else if (gun_count == 2) {
  3019. SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
  3020. }
  3021. _chargingData[_index]->PowerConsumption = 0;
  3022. }
  3023. break;
  3024. case S_PREPARING_FOR_EV: {
  3025. // 開始確認車端是否同意開始充電 : 1.SOC, 2.Target Vol, 3.Target Cur, 4.Charging remaining time
  3026. GetOutputReq(_index, _chargingData[_index]->Evboard_id);
  3027. // log_info("PresentChargingVoltage = %f \n", _chargingData[_index]->PresentChargingVoltage);
  3028. // log_info("PresentChargingCurrent = %f \n", _chargingData[_index]->PresentChargingCurrent);
  3029. // log_info("AvailableChargingPower = %f \n", _chargingData[_index]->AvailableChargingPower);
  3030. // log_info("AvailableChargingCurrent = %f \n", _chargingData[_index]->AvailableChargingCurrent);
  3031. // log_info("MaximumChargingVoltage = %f \n", _chargingData[_index]->MaximumChargingVoltage);
  3032. // 設定當前輸出
  3033. if (gun_count == 1) {
  3034. SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
  3035. } else if (gun_count == 2) {
  3036. SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
  3037. }
  3038. if (priorityLow == 1) {
  3039. float maxVol, maxCur;
  3040. // 樁端輸出能力
  3041. maxVol = _chargingData[_index]->MaximumChargingVoltage;
  3042. maxCur = _chargingData[_index]->AvailableChargingCurrent;
  3043. GetMaxVolAndCurMethod(_index, &maxVol, &maxCur);
  3044. //DS60-120 add
  3045. if (LogInfo[_index][EV_LOG_EVSE_MAX_VOL] != maxVol ||
  3046. LogInfo[_index][EV_LOG_EVSE_MAX_CUR] != maxCur) {
  3047. LogInfo[_index][EV_LOG_EVSE_MAX_VOL] = maxVol;
  3048. LogInfo[_index][EV_LOG_EVSE_MAX_CUR] = maxCur;
  3049. log_info("To EV_%d Max_Vol = %.1f, Cap_Cur = %.1f, Cap_Pow = %.1f \n",
  3050. _index, maxVol / 10, maxCur / 10, _chargingData[_index]->AvailableChargingPower / 10);
  3051. }
  3052. //log_info("To EV_%d Max_Vol = %f, Cap_Cur = %f, Cap_Pow = %f \n",
  3053. // _index, maxVol, maxCur, _chargingData[_index]->AvailableChargingPower);
  3054. _chargingData[_index]->RealMaxVoltage = maxVol;
  3055. SetChargingPermission(_index, START,
  3056. _chargingData[_index]->AvailableChargingPower,
  3057. maxCur,
  3058. maxVol,
  3059. _chargingData[_index]->Evboard_id);
  3060. // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
  3061. GetEvBatteryInfo(_index, _chargingData[_index]->Evboard_id);
  3062. }
  3063. gettimeofday(&_chk_ratingPower_timeout[_index], NULL);
  3064. }
  3065. break;
  3066. case S_PREPARING_FOR_EVSE:
  3067. case S_CCS_PRECHARGE_ST0:
  3068. case S_CCS_PRECHARGE_ST1: {
  3069. // 開始確認車端是否同意開始充電
  3070. GetOutputReq(_index, _chargingData[_index]->Evboard_id);
  3071. // 設定當前輸出
  3072. if (gun_count == 1) {
  3073. SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
  3074. } else if (gun_count == 2) {
  3075. SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
  3076. }
  3077. if (priorityLow % 5 == 1) {
  3078. // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
  3079. GetEvBatteryInfo(_index, _chargingData[_index]->Evboard_id); //DS60-120 add
  3080. // 樁端輸出能力改變
  3081. if (gun_count == 1) {
  3082. SetPresentChargingOutputCap(_chargingData[0], _chargingData[0]);
  3083. } else if (gun_count == 2) {
  3084. SetPresentChargingOutputCap(_chargingData[0], _chargingData[1]);
  3085. }
  3086. }
  3087. //DS60-120 add
  3088. if (LogInfo[_index][EV_LOG_MAX_BATT_VOL] != _chargingData[_index]->EvBatteryMaxVoltage) {
  3089. LogInfo[_index][EV_LOG_MAX_BATT_VOL] = _chargingData[_index]->EvBatteryMaxVoltage;
  3090. log_info("index = %d, Ev Maximum Battery Voltage = %f \n", _index, _chargingData[_index]->EvBatteryMaxVoltage);
  3091. }
  3092. if (LogInfo[_index][EV_LOG_SOC] != _chargingData[_index]->EvBatterySoc) {
  3093. LogInfo[_index][EV_LOG_SOC] = _chargingData[_index]->EvBatterySoc;
  3094. log_info("index = %d, SOC = %d \n", _index, _chargingData[_index]->EvBatterySoc);
  3095. }
  3096. // 持續通知 Isolation 測試狀態
  3097. if (priorityLow == 1) {
  3098. // 拉 500 V 如果在一秒鐘內 GFD 都符合則 PASS
  3099. // if (_chargingData[_index]->FireChargingVoltage >= 3500)
  3100. // _chargingData[_index]->GroundFaultStatus = GFD_PASS;
  3101. //log_info("To EV_%d GFD = %d \n", _index, _chargingData[_index]->GroundFaultStatus);
  3102. //if(_chargingData[_index]->GroundFaultStatus != GFD_WAIT)
  3103. {
  3104. //if ((GetTimeoutValue(_derating_time) / 1000) > 1000)
  3105. uint8_t _result = _chargingData[_index]->GroundFaultStatus;
  3106. // GB & Chademo ~ Warning 也先算 Pass,因為 CCS 認證會驗 Warning 故不可更動
  3107. if (_chargingData[_index]->Type == _Type_Chademo ||
  3108. _chargingData[_index]->Type == _Type_GB) {
  3109. if (_result == GFD_WARNING) {
  3110. _result = GFD_PASS;
  3111. }
  3112. }
  3113. if (_result == GFD_WARNING || _result == GFD_PASS) {
  3114. if (((GetTimeoutValue(_chk_ratingPower_timeout[_index]) / 1000) > 12000 &&
  3115. _chargingData[_index]->RealRatingPower > 0) ||
  3116. (GetTimeoutValue(_chk_ratingPower_timeout[_index]) / 1000) > 14000) {
  3117. //log_info("**********EvComm : _index= %d, RealRatingPower = %d \n",
  3118. // _index, _chargingData[_index]->RealRatingPower);
  3119. //_result = GFD_PASS;
  3120. //DS60-120 add
  3121. if (LogInfo[_index][EV_LOG_REAL_CAP_POW] != _chargingData[_index]->RealRatingPower) {
  3122. LogInfo[_index][EV_LOG_REAL_CAP_POW] = _chargingData[_index]->RealRatingPower;
  3123. log_info("Conn %d, RealRatingPower = %d \n",
  3124. _index, _chargingData[_index]->RealRatingPower);
  3125. }
  3126. } else {
  3127. _result = GFD_WAIT;
  3128. }
  3129. }
  3130. SetIsolationStatus(_index, _result, _chargingData[_index]->Evboard_id);
  3131. }
  3132. if (_chargingData[_index]->SystemStatus == S_CCS_PRECHARGE_ST0 &&
  3133. _chargingData[_index]->PrechargeStatus == PRECHARGE_READY) {
  3134. SetEvsePrechargeInfo(_index, PRECHARGE_PRERELAY_PASS, _chargingData[_index]->Evboard_id);
  3135. }
  3136. }
  3137. }
  3138. break;
  3139. case S_CHARGING: {
  3140. // 計算 Power
  3141. _chargingData[_index]->PresentChargingPower = ((float)((_chargingData[_index]->PresentChargingVoltage) * (_chargingData[_index]->PresentChargingCurrent)) / 1000);
  3142. //DS60-120 remove
  3143. if (chargingTime[_index] == 0 ||
  3144. chargingTime[_index] > _chargingData[_index]->PresentChargedDuration) {
  3145. chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
  3146. } else {
  3147. int passTime = _chargingData[_index]->PresentChargedDuration - chargingTime[_index];
  3148. if (passTime > 0) {
  3149. float changingPow = (_chargingData[_index]->PresentChargingPower) * passTime / 3600;
  3150. if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling) {
  3151. _chargingData[_index]->ChargingFee += changingPow * ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee;
  3152. }
  3153. _chargingData[_index]->PresentChargedEnergy += changingPow;
  3154. _chargingData[_index]->PowerConsumption += changingPow;
  3155. chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
  3156. }
  3157. }
  3158. // 開始確認車端是否同意開始充電
  3159. GetOutputReq(_index, _chargingData[_index]->Evboard_id);
  3160. // 設定當前輸出
  3161. if (gun_count == 1) {
  3162. SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
  3163. } else if (gun_count == 2) {
  3164. SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
  3165. }
  3166. // for test end
  3167. if (priorityLow % 5 == 0) {
  3168. // 樁端輸出能力改變
  3169. if (gun_count == 1) {
  3170. SetPresentChargingOutputCap(_chargingData[0], _chargingData[0]);
  3171. } else if (gun_count == 2) {
  3172. SetPresentChargingOutputCap(_chargingData[0], _chargingData[1]);
  3173. }
  3174. }
  3175. if ((_chargingData[_index]->GroundFaultStatus == GFD_FAIL) ||
  3176. (_chargingData[_index]->Type == _Type_CCS_2)) {
  3177. SetIsolationStatus(_index, _chargingData[_index]->GroundFaultStatus, _chargingData[_index]->Evboard_id);
  3178. }
  3179. /*
  3180. else if (_chargingData[_index]->Type == _Type_CCS_2) {
  3181. SetIsolationStatus(_index, _chargingData[_index]->GroundFaultStatus, _chargingData[_index]->Evboard_id);
  3182. }*/
  3183. // GFD 失敗再通知
  3184. if (priorityLow == 1) {
  3185. if (_chargingData[_index]->Type == _Type_CCS_2 &&
  3186. _chargingData[_index]->PrechargeStatus == PRECHARGE_READY) {
  3187. SetEvsePrechargeInfo(_index, PRECHARGE_CHARELAY_PASS, _chargingData[_index]->Evboard_id);
  3188. }
  3189. }
  3190. }
  3191. break;
  3192. case S_ALARM:
  3193. case S_TERMINATING: {
  3194. // 設定當前輸出
  3195. if (gun_count == 1) {
  3196. if (_chargingData[0]->FireChargingVoltage <= 500) { //DS60-120 add
  3197. _chargingData[0]->PresentChargingCurrent = 0;
  3198. }
  3199. SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
  3200. } else if (gun_count == 2) {
  3201. if (_chargingData[0]->FireChargingVoltage <= 500) { //DS60-120 add
  3202. _chargingData[0]->PresentChargingCurrent = 0;
  3203. }
  3204. if (_chargingData[1]->FireChargingVoltage <= 500) {
  3205. _chargingData[1]->PresentChargingCurrent = 0;
  3206. }
  3207. SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
  3208. }
  3209. // 槍鎖還在,則代表是樁端要求的停止
  3210. if (_chargingData[_index]->GunLocked == START ||
  3211. _chargingData[_index]->Type == _Type_CCS_2) {
  3212. uint8_t normalStop = 0x01;
  3213. uint8_t stopReason[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
  3214. if (GetStopChargingReasonByEvse(_index, stopReason)) {
  3215. normalStop = 0x02;
  3216. }
  3217. EvseStopChargingEvent(normalStop, stopReason, _chargingData[_index]->Evboard_id);
  3218. SendErrorCount[_index] += 1; //DS60-120 add
  3219. }
  3220. if (_chargingData[_index]->Type == _Type_CCS_2) {
  3221. SetIsolationStatus(_index, _chargingData[_index]->GroundFaultStatus, _chargingData[_index]->Evboard_id);
  3222. }
  3223. GetOutputReq(_index, _chargingData[_index]->Evboard_id);
  3224. //DS60-120 add
  3225. if (_chargingData[_index]->SystemStatus == S_ALARM) {
  3226. if (priorityLow == 1) {
  3227. float maxVol, maxCur;
  3228. // 樁端輸出能力
  3229. maxVol = _chargingData[_index]->MaximumChargingVoltage;
  3230. maxCur = _chargingData[_index]->AvailableChargingCurrent;
  3231. GetMaxVolAndCurMethod(_index, &maxVol, &maxCur);
  3232. SetChargingPermission(_index,
  3233. STOP,
  3234. _chargingData[_index]->AvailableChargingPower,
  3235. maxCur,
  3236. maxVol,
  3237. _chargingData[_index]->Evboard_id);
  3238. }
  3239. }
  3240. }
  3241. break;
  3242. case S_COMPLETE: {
  3243. // 設定當前輸出
  3244. if (gun_count == 1) {
  3245. SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
  3246. } else if (gun_count == 2) {
  3247. SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
  3248. }
  3249. if (priorityLow == 1) {
  3250. float maxVol, maxCur;
  3251. // 樁端輸出能力
  3252. maxVol = _chargingData[_index]->MaximumChargingVoltage;
  3253. maxCur = _chargingData[_index]->AvailableChargingCurrent;
  3254. GetMaxVolAndCurMethod(_index, &maxVol, &maxCur);
  3255. SetChargingPermission(_index, STOP,
  3256. _chargingData[_index]->AvailableChargingPower,
  3257. maxCur,
  3258. maxVol,
  3259. _chargingData[_index]->Evboard_id);
  3260. //DS60-120 add
  3261. //if (_chargingData[_index]->EvBatterySoc >= 100) {
  3262. // //滿電,則直接清掉錯誤
  3263. // if (_chargingData[_index]->Type == _Type_Chademo) {
  3264. // ClearAbnormalStatus_Chademo(_index);
  3265. // } else if (_chargingData[_index]->Type == _Type_GB) {
  3266. // ClearAbnormalStatus_GB(_index);
  3267. // } else if (_chargingData[_index]->Type == _Type_CCS_2) {
  3268. // ClearAbnormalStatus_CCS(_index);
  3269. // }
  3270. //}
  3271. }
  3272. }
  3273. break;
  3274. }
  3275. }
  3276. priorityLow >= 20 ? priorityLow = 1 : priorityLow++;
  3277. usleep(45000); //EV 小板通訊 (50 ms)
  3278. }
  3279. log_info("Module_EvComm : Can-bus port = %d \n", CanFd);
  3280. return FAIL;
  3281. }