1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687 |
- #include <sys/time.h>
- #include <sys/timeb.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <sys/ioctl.h>
- #include <sys/socket.h>
- #include <sys/ipc.h>
- #include <sys/shm.h>
- #include <sys/mman.h>
- #include <linux/can.h>
- #include <linux/can/raw.h>
- #include <linux/wireless.h>
- #include <arpa/inet.h>
- #include <netinet/in.h>
- #include <unistd.h>
- #include <stdarg.h>
- #include <stdio.h> /*標準輸入輸出定義*/
- #include <stdlib.h> /*標準函數庫定義*/
- #include <unistd.h> /*Unix 標準函數定義*/
- #include <fcntl.h> /*檔控制定義*/
- #include <termios.h> /*PPSIX 終端控制定義*/
- #include <errno.h> /*錯誤號定義*/
- #include <string.h>
- #include <time.h>
- #include <ctype.h>
- #include <ifaddrs.h>
- #include "../../define.h"
- #include "Module_EvComm.h"
- //#include "../Module_CSU/Config.h"
- #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
- #define PASS 1
- #define FAIL -1
- #define STOP 0
- #define START 1
- #define COMMUNICATION 2
- #define INITIALIZATION 3
- #define YES 1
- #define NO 0
- #define EQUAL 0
- #define CHK_VOL_RANGE 50
- #define CHK_CUR_RANGE 20
- #define PLUG 1
- #define UNPLUG 0
- #define UNDEFINED_TEMP 255
- #define ALLOW_COUNT_MAX 30
- struct SysConfigAndInfo *ShmSysConfigAndInfo;
- struct StatusCodeData *ShmStatusCodeData;
- struct FanModuleData *ShmFanModuleData;
- struct CHAdeMOData *ShmCHAdeMOData;
- struct GBTData *ShmGBTData;
- struct CcsData *ShmCcsData;
- struct PsuData *ShmPsuData;
- struct MeterInformation *ShmCsuMeterData;
- struct DcCommonInformation *ShmDcCommonData;
- byte gun_count;
- int chargingTime [CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
- byte rtcChkCount = 0;
- float LogInfo [2] [10];
- bool _useOfflineNoCharging = false;
- // 限制最大充電電壓,因應不同 type 槍線來限制
- double Chademo_Simple = 5000;
- double GB_Simple = 7500;
- double CCS_Simple = 7500;
- // ---------------------------------------
- double Chademo_Standard = 5000;
- double GB_Standard = 7500;
- double CCS_Standard = 9500;
- //float maxChargingVol[2] = { 0, 0 }; // 限制最大充電電壓,如依照模塊則填上 0
- // 限制最大充電電流與能量透過 Web
- //float maxChargingCur[2] = { 0, 0 }; // 限制最大充電電流,如依照模塊則填上 0
- float maxChargingPow = 0; // 限制最大充電能量,如依照模塊則填上 0
- // 允許當前輸出與需求落差超過 10A 的累積次數 (超過 ALLOW_COUNT_MAX 即給予當前值)
- byte curAllowCount [2] = { 0, 0 };
- float curTargetCur [2] = { 0, 0 };
- // 避免槍溫偵測誤判
- byte gunTempAllowCount [2] = { 0, 0 };
- // 槍資訊
- struct ChargingInfoData *_chargingData [CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
- struct timespec _chk_ratingPower_timeout [CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
- struct timespec _chk_chademo_permission_timeout [CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
- bool chkChademoPermission [2] = { false, false };
- bool chkChademoPermissionSend [2] = { false, false };
- byte SendErrorCount [2] = { 0, 0 };
- unsigned char mask_table [] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
- void PRINTF_FUNC(char *string, ...);
- void GetMaxVolAndCurMethod(byte index, float *vol, float *cur);
- void GetMaxPowerMethod(byte index, float *pow);
- int GetTimeoutValue(struct timespec *startTime);
- #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
- #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
- #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
- int GetTimeoutValue(struct timespec *startTime)
- {
- struct timespec endTime;
- clock_gettime ( CLOCK_MONOTONIC_COARSE, & endTime );
- return endTime.tv_sec - startTime->tv_sec;
- }
- void GetTimespecFunc(struct timespec *time)
- {
- clock_gettime ( CLOCK_MONOTONIC_COARSE, time );
- }
- int StoreLogMsg(const char *fmt, ...)
- {
- char Buf [4096 + 256];
- char buffer [4096];
- va_list args;
- struct timeb SeqEndTime;
- struct tm *tm;
- va_start( args, fmt );
- int rc = vsnprintf ( buffer, sizeof(buffer), fmt, args );
- va_end( args );
- memset ( Buf, 0, sizeof(Buf) );
- ftime ( & SeqEndTime );
- SeqEndTime.time = time ( NULL );
- tm = localtime ( & SeqEndTime.time );
- if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
- {
- sprintf ( Buf, "%02d:%02d:%02d:%03d - %s", tm->tm_hour, tm->tm_min, tm->tm_sec, SeqEndTime.millitm, buffer );
- printf ( "%s \n", Buf );
- }
- else
- {
- sprintf ( Buf, "echo \"%04d-%02d-%02d %02d:%02d:%02d:%03d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog_%s",
- tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, SeqEndTime.millitm, buffer,
- tm->tm_year + 1900, tm->tm_mon + 1, ShmSysConfigAndInfo->SysConfig.SerialNumber );
- system ( Buf );
- }
- return rc;
- }
- int DiffTimeb(struct timeb ST, struct timeb ET)
- {
- //return milli-second
- unsigned int StartTime , StopTime;
- StartTime = (unsigned int) ST.time;
- StopTime = (unsigned int) ET.time;
- return (StopTime - StartTime) * 1000 + ET.millitm - ST.millitm;
- }
- void PRINTF_FUNC(char *string, ...)
- {
- va_list args;
- char buffer [4096];
- va_start( args, string );
- vsnprintf ( buffer, sizeof(buffer), string, args );
- va_end( args );
- DEBUG_INFO( "%s ", buffer );
- }
- //=================================
- // Common routine
- //=================================
- void getTimeString(char *buff)
- {
- time_t timep;
- struct tm *p;
- time ( & timep );
- p = gmtime ( & timep );
- 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 );
- }
- //bool CheckUniqNumber(byte value)
- //{
- // for (byte index = 0; index < gun_count; index++)
- // {
- // if (_chargingData[index]->Evboard_id == value)
- // {
- // struct timeval _end_time;
- // gettimeofday(&_end_time, NULL);
- // unsigned long diff = 1000000 * (_end_time.tv_sec - _id_assign_time.tv_sec) + _end_time.tv_usec - _id_assign_time.tv_usec;
- // if (diff >= 3000000)
- // {
- // gettimeofday(&_id_assign_time, NULL);
- // return true;
- // }
- // else
- // {
- // return false;
- // }
- // }
- // }
- //
- // gettimeofday(&_id_assign_time, NULL);
- // return true;
- //}
- //==========================================
- // Init all share memory
- //==========================================
- int InitShareMemory()
- {
- int result = PASS;
- int MeterSMId;
- //initial ShmSysConfigAndInfo
- if ((MeterSMId = shmget ( ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo), 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmget ShmSysConfigAndInfo NG\n" );
- #endif
- result = FAIL;
- }
- else if ((ShmSysConfigAndInfo = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmSysConfigAndInfo NG\n" );
- #endif
- result = FAIL;
- }
- //initial ShmStatusCodeData
- if ((MeterSMId = shmget ( ShmStatusCodeKey, sizeof(struct StatusCodeData), 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmget ShmStatusCodeData NG\n" );
- #endif
- result = FAIL;
- }
- else if ((ShmStatusCodeData = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmStatusCodeData NG\n" );
- #endif
- result = FAIL;
- }
- //creat ShmPsuData
- if ((MeterSMId = shmget ( ShmPsuKey, sizeof(struct PsuData), 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmget ShmPsuData NG \n" );
- #endif
- result = FAIL;
- }
- else if ((ShmPsuData = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmPsuData NG \n" );
- #endif
- result = FAIL;
- }
- if (CHAdeMO_QUANTITY > 0)
- {
- if ((MeterSMId = shmget ( ShmCHAdeMOCommKey, sizeof(struct CHAdeMOData), IPC_CREAT | 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "[shmget ShmCHAdeMOData NG \n" );
- #endif
- return FAIL;
- }
- else if ((ShmCHAdeMOData = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmCHAdeMOData NG \n" );
- #endif
- return FAIL;
- }
- }
- if (GB_QUANTITY > 0)
- {
- if ((MeterSMId = shmget ( ShmGBTCommKey, sizeof(struct GBTData), IPC_CREAT | 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "[shmget ShmGBTData NG \n" );
- #endif
- return FAIL;
- }
- else if ((ShmGBTData = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmGBTData NG \n" );
- #endif
- return FAIL;
- }
- }
- if (CCS_QUANTITY > 0)
- {
- if ((MeterSMId = shmget ( ShmCcsCommKey, sizeof(struct CcsData), IPC_CREAT | 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmget ShmCcsData NG \n" );
- #endif
- return FAIL;
- }
- else if ((ShmCcsData = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmCcsData NG \n" );
- #endif
- return FAIL;
- }
- }
- if ((MeterSMId = shmget ( ShmCsuMeterKey, sizeof(struct MeterInformation), IPC_CREAT | 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmget ShmCsuMeterKey NG \n" );
- #endif
- return 0;
- }
- else if ((ShmCsuMeterData = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmCsuMeterData NG \n" );
- #endif
- return 0;
- }
- if ((MeterSMId = shmget ( ShmCommonKey, sizeof(struct DcCommonInformation), IPC_CREAT | 0777 )) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmget ShmCommonKey NG \n" );
- #endif
- return 0;
- }
- else if ((ShmDcCommonData = shmat ( MeterSMId, NULL, 0 )) == (void *) - 1)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "shmat ShmCommonKey NG \n" );
- #endif
- return 0;
- }
- return result;
- }
- //================================================
- // initial can-bus
- //================================================
- int InitCanBus()
- {
- int s0 , nbytes;
- struct timeval tv;
- struct ifreq ifr0;
- struct sockaddr_can addr0;
- system ( "/sbin/ip link set can0 down" );
- system ( "/sbin/ip link set can0 type can bitrate 500000 restart-ms 100" );
- system ( "/sbin/ip link set can0 up" );
- s0 = socket ( PF_CAN, SOCK_RAW, CAN_RAW );
- tv.tv_sec = 0;
- tv.tv_usec = 10000;
- if (setsockopt ( s0, SOL_SOCKET, SO_RCVTIMEO, (char *) & tv, sizeof(struct timeval) ) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "Set SO_RCVTIMEO NG" );
- #endif
- }
- nbytes = 40960;
- if (setsockopt ( s0, SOL_SOCKET, SO_RCVBUF, & nbytes, sizeof(int) ) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "Set SO_RCVBUF NG" );
- #endif
- }
- nbytes = 40960;
- if (setsockopt ( s0, SOL_SOCKET, SO_SNDBUF, & nbytes, sizeof(int) ) < 0)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "Set SO_SNDBUF NG" );
- #endif
- }
- strcpy ( ifr0.ifr_name, "can0" );
- ioctl ( s0, SIOCGIFINDEX, & ifr0 ); /* ifr.ifr_ifindex gets filled with that device's index */
- addr0.can_family = AF_CAN;
- addr0.can_ifindex = ifr0.ifr_ifindex;
- bind ( s0, (struct sockaddr *) & addr0, sizeof(addr0) );
- return s0;
- }
- //================================================
- //================================================
- // CANBUS receive task
- //================================================
- //================================================
- bool FindChargingInfoData(byte target, struct ChargingInfoData **chargingData)
- {
- for (byte index = 0; index < CHAdeMO_QUANTITY; index ++)
- {
- if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData [index].Index == target)
- {
- chargingData [target] = & ShmSysConfigAndInfo->SysInfo.ChademoChargingData [index];
- return true;
- }
- }
- for (byte index = 0; index < CCS_QUANTITY; index ++)
- {
- if (ShmSysConfigAndInfo->SysInfo.CcsChargingData [index].Index == target)
- {
- chargingData [target] = & ShmSysConfigAndInfo->SysInfo.CcsChargingData [index];
- return true;
- }
- }
- for (byte index = 0; index < GB_QUANTITY; index ++)
- {
- if (ShmSysConfigAndInfo->SysInfo.GbChargingData [index].Index == target)
- {
- chargingData [target] = & ShmSysConfigAndInfo->SysInfo.GbChargingData [index];
- return true;
- }
- }
- return false;
- }
- void AddrAssignment(byte *data)
- {
- byte target_number [8];
- byte index = 0x00;
- memcpy ( target_number, data, sizeof(target_number) );
- index = * (data + 4);
- if (gun_count == 1)
- index = 0x01;
- // if (CheckUniqNumber(index))
- {
- if (_chargingData [index - 1]->Type == _Type_Chademo)
- PRINTF_FUNC ( "Set EV board info : (Chademo) TargetAddr = %d \n", index );
- else if (_chargingData [index - 1]->Type == _Type_CCS)
- PRINTF_FUNC ( "Set EV board info : (CCS) TargetAddr = %d \n", index );
- else if (_chargingData [index - 1]->Type == _Type_GB)
- PRINTF_FUNC ( "Set EV board info : (GB) TargetAddr = %d \n", index );
- SetTargetAddr ( target_number, index );
- }
- }
- void ClearAbnormalStatus_Chademo(byte gun_index)
- {
- bool isCleanCheck = false;
- char code [7];
- if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "", 6 ) == EQUAL)
- return;
- if (true)
- {
- if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023700", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail == YES)
- {
- memcpy ( code, "023700", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023704", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun == YES)
- {
- memcpy ( code, "023704", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023705", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission == YES)
- {
- memcpy ( code, "023705", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023706", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility == YES)
- {
- memcpy ( code, "023706", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023707", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP == YES)
- {
- memcpy ( code, "023707", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023708", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP == YES)
- {
- memcpy ( code, "023708", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023709", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP == YES)
- {
- memcpy ( code, "023709", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023710", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff == YES)
- {
- memcpy ( code, "023710", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023711", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff == YES)
- {
- memcpy ( code, "023711", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023712", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition == YES)
- {
- memcpy ( code, "023712", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023713", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault == YES)
- {
- memcpy ( code, "023713", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023714", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError == YES)
- {
- memcpy ( code, "023714", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023715", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop == YES)
- {
- memcpy ( code, "023715", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023716", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken == YES)
- {
- memcpy ( code, "023716", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023717", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail == YES)
- {
- memcpy ( code, "023717", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023718", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive == YES)
- {
- memcpy ( code, "023718", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023719", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout == YES)
- {
- memcpy ( code, "023719", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023720", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout == YES)
- {
- memcpy ( code, "023720", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023721", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout == YES)
- {
- memcpy ( code, "023721", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023722", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout == YES)
- {
- memcpy ( code, "023722", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023723", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout == YES)
- {
- memcpy ( code, "023723", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023724", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout == YES)
- {
- memcpy ( code, "023724", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023725", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout == YES)
- {
- memcpy ( code, "023725", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023726", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V == YES)
- {
- memcpy ( code, "023726", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023727", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V == YES)
- {
- memcpy ( code, "023727", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023728", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop == YES)
- {
- memcpy ( code, "023728", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023729", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop == YES)
- {
- memcpy ( code, "023729", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023730", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop == YES)
- {
- memcpy ( code, "023730", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023731", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail == YES)
- {
- memcpy ( code, "023731", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023732", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard == YES)
- {
- memcpy ( code, "023732", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023733", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit == YES)
- {
- memcpy ( code, "023733", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023734", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit == YES)
- {
- memcpy ( code, "023734", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023735", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed == YES)
- {
- memcpy ( code, "023735", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023736", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown == YES)
- {
- memcpy ( code, "023736", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023980", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_BMS_CHARGE_ALLOW_ERROR == YES)
- {
- memcpy ( code, "023980", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023981", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_OUTPUT_VOLTAGE_MORE_THEN_10_PERCENT == YES)
- {
- memcpy ( code, "023981", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023982", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_ADC_LESS_THAN_10V == YES)
- {
- memcpy ( code, "023982", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- }
- if (isCleanCheck)
- {
- for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index ++)
- {
- if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
- {
- PRINTF_FUNC ( "CHA clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index,
- _chargingData [index]->EvConnAlarmCode, code );
- if (strncmp ( (char *) _chargingData [index]->EvConnAlarmCode, code, 6 ) != EQUAL)
- {
- if (strncmp ( code, "023700", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = NO;
- if (strncmp ( code, "023704", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = NO;
- if (strncmp ( code, "023705", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = NO;
- if (strncmp ( code, "023706", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = NO;
- if (strncmp ( code, "023707", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP = NO;
- if (strncmp ( code, "023708", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP = NO;
- if (strncmp ( code, "023709", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP = NO;
- if (strncmp ( code, "023710", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff = NO;
- if (strncmp ( code, "023711", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff = NO;
- if (strncmp ( code, "023712", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition = NO;
- if (strncmp ( code, "023713", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault = NO;
- if (strncmp ( code, "023714", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError = NO;
- if (strncmp ( code, "023715", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop = NO;
- if (strncmp ( code, "023716", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken = NO;
- if (strncmp ( code, "023717", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail = NO;
- if (strncmp ( code, "023718", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive = NO;
- if (strncmp ( code, "023719", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout = NO;
- if (strncmp ( code, "023720", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout = NO;
- if (strncmp ( code, "023721", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout = NO;
- if (strncmp ( code, "023722", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout = NO;
- if (strncmp ( code, "023723", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout = NO;
- if (strncmp ( code, "023724", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout = NO;
- if (strncmp ( code, "023725", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout = NO;
- if (strncmp ( code, "023726", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V = NO;
- if (strncmp ( code, "023727", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V = NO;
- if (strncmp ( code, "023728", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop = NO;
- if (strncmp ( code, "023729", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop = NO;
- if (strncmp ( code, "023730", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop = NO;
- if (strncmp ( code, "023731", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail = NO;
- if (strncmp ( code, "023732", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard = NO;
- if (strncmp ( code, "023733", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit = NO;
- if (strncmp ( code, "023734", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit = NO;
- if (strncmp ( code, "023735", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = NO;
- if (strncmp ( code, "023736", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = NO;
- if (strncmp ( code, "023980", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_BMS_CHARGE_ALLOW_ERROR = NO;
- if (strncmp ( code, "023981", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_OUTPUT_VOLTAGE_MORE_THEN_10_PERCENT = NO;
- if (strncmp ( code, "023982", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_ADC_LESS_THAN_10V = NO;
- }
- }
- }
- }
- }
- void ClearAbnormalStatus_GB(byte gun_index)
- {
- bool isCleanCheck = false;
- char code [7];
- if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "", 6 ) == EQUAL)
- return;
- if (true)
- {
- if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023702", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail == YES)
- {
- memcpy ( code, "023702", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023900", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 == YES)
- {
- memcpy ( code, "023900", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023901", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL == YES)
- {
- memcpy ( code, "023901", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023902", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE == YES)
- {
- memcpy ( code, "023902", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023903", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT == YES)
- {
- memcpy ( code, "023903", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023904", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT == YES)
- {
- memcpy ( code, "023904", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023905", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT == YES)
- {
- memcpy ( code, "023905", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023906", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE == YES)
- {
- memcpy ( code, "023906", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023907", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE == YES)
- {
- memcpy ( code, "023907", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023908", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT == YES)
- {
- memcpy ( code, "023908", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023909", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V == YES)
- {
- memcpy ( code, "023909", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023910", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V == YES)
- {
- memcpy ( code, "023910", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023911", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD == YES)
- {
- memcpy ( code, "023911", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023912", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD == YES)
- {
- memcpy ( code, "023912", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023913", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL == YES)
- {
- memcpy ( code, "023913", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023914", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK == YES)
- {
- memcpy ( code, "023914", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023915", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT == YES)
- {
- memcpy ( code, "023915", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023916", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT == YES)
- {
- memcpy ( code, "023916", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023917", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT == YES)
- {
- memcpy ( code, "023917", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023918", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT == YES)
- {
- memcpy ( code, "023918", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023919", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V == YES)
- {
- memcpy ( code, "023919", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023930", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT == YES)
- {
- memcpy ( code, "023930", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023931", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT == YES)
- {
- memcpy ( code, "023931", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023932", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT == YES)
- {
- memcpy ( code, "023932", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023933", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT == YES)
- {
- memcpy ( code, "023933", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023934", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT == YES)
- {
- memcpy ( code, "023934", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023935", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT == YES)
- {
- memcpy ( code, "023935", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023936", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT == YES)
- {
- memcpy ( code, "023936", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023937", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT == YES)
- {
- memcpy ( code, "023937", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023938", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT == YES)
- {
- memcpy ( code, "023938", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023939", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT == YES)
- {
- memcpy ( code, "023939", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023940", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT == YES)
- {
- memcpy ( code, "023940", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023941", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT == YES)
- {
- memcpy ( code, "023941", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023942", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT == YES)
- {
- memcpy ( code, "023942", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023943", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT == YES)
- {
- memcpy ( code, "023943", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023944", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT == YES)
- {
- memcpy ( code, "023944", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023945", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT == YES)
- {
- memcpy ( code, "023945", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023946", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT == YES)
- {
- memcpy ( code, "023946", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023947", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT == YES)
- {
- memcpy ( code, "023947", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023950", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL == YES)
- {
- memcpy ( code, "023950", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023951", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL == YES)
- {
- memcpy ( code, "023951", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023952", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL == YES)
- {
- memcpy ( code, "023952", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023953", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST == YES)
- {
- memcpy ( code, "023953", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023954", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION == YES)
- {
- memcpy ( code, "023954", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023955", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP == YES)
- {
- memcpy ( code, "023955", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023956", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT == YES)
- {
- memcpy ( code, "023956", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023957", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR == YES)
- {
- memcpy ( code, "023957", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023958", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP == YES)
- {
- memcpy ( code, "023958", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023959", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER == YES)
- {
- memcpy ( code, "023959", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023960", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V == YES)
- {
- memcpy ( code, "023960", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023961", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 == YES)
- {
- memcpy ( code, "023961", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023962", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT == YES)
- {
- memcpy ( code, "023962", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023963", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE == YES)
- {
- memcpy ( code, "023963", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023964", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON == YES)
- {
- memcpy ( code, "023964", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023970", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE == YES)
- {
- memcpy ( code, "023970", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023971", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE == YES)
- {
- memcpy ( code, "023971", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023972", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC == YES)
- {
- memcpy ( code, "023972", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023973", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC == YES)
- {
- memcpy ( code, "023973", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023974", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT == YES)
- {
- memcpy ( code, "023974", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023975", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE == YES)
- {
- memcpy ( code, "023975", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023976", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE == YES)
- {
- memcpy ( code, "023976", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023977", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR == YES)
- {
- memcpy ( code, "023977", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- }
- if (isCleanCheck)
- {
- for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index ++)
- {
- if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
- {
- PRINTF_FUNC ( "GBT clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index,
- _chargingData [index]->EvConnAlarmCode, code );
- if (strncmp ( (char *) _chargingData [index]->EvConnAlarmCode, code, 6 ) != EQUAL)
- {
- if (strncmp ( code, "023702", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = NO;
- if (strncmp ( code, "023900", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = NO;
- if (strncmp ( code, "023901", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = NO;
- if (strncmp ( code, "023902", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = NO;
- if (strncmp ( code, "023903", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = NO;
- if (strncmp ( code, "023904", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = NO;
- if (strncmp ( code, "023905", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = NO;
- if (strncmp ( code, "023906", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = NO;
- if (strncmp ( code, "023907", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = NO;
- if (strncmp ( code, "023908", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = NO;
- if (strncmp ( code, "023909", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = NO;
- if (strncmp ( code, "023910", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = NO;
- if (strncmp ( code, "023911", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = NO;
- if (strncmp ( code, "023912", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = NO;
- if (strncmp ( code, "023913", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = NO;
- if (strncmp ( code, "023914", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = NO;
- if (strncmp ( code, "023915", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = NO;
- if (strncmp ( code, "023916", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = NO;
- if (strncmp ( code, "023917", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = NO;
- if (strncmp ( code, "023918", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = NO;
- if (strncmp ( code, "023919", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = NO;
- if (strncmp ( code, "023930", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = NO;
- if (strncmp ( code, "023931", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = NO;
- if (strncmp ( code, "023932", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = NO;
- if (strncmp ( code, "023933", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = NO;
- if (strncmp ( code, "023934", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = NO;
- if (strncmp ( code, "023935", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = NO;
- if (strncmp ( code, "023936", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = NO;
- if (strncmp ( code, "023937", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = NO;
- if (strncmp ( code, "023938", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = NO;
- if (strncmp ( code, "023939", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = NO;
- if (strncmp ( code, "023940", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = NO;
- if (strncmp ( code, "023941", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = NO;
- if (strncmp ( code, "023942", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = NO;
- if (strncmp ( code, "023943", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = NO;
- if (strncmp ( code, "023944", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = NO;
- if (strncmp ( code, "023945", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = NO;
- if (strncmp ( code, "023946", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = NO;
- if (strncmp ( code, "023947", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = NO;
- if (strncmp ( code, "023950", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = NO;
- if (strncmp ( code, "023951", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = NO;
- if (strncmp ( code, "023952", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = NO;
- if (strncmp ( code, "023953", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = NO;
- if (strncmp ( code, "023954", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = NO;
- if (strncmp ( code, "023955", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = NO;
- if (strncmp ( code, "023956", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = NO;
- if (strncmp ( code, "023957", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = NO;
- if (strncmp ( code, "023958", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = NO;
- if (strncmp ( code, "023959", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = NO;
- if (strncmp ( code, "023960", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = NO;
- if (strncmp ( code, "023961", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = NO;
- if (strncmp ( code, "023962", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = NO;
- if (strncmp ( code, "023963", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = NO;
- if (strncmp ( code, "023964", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = NO;
- if (strncmp ( code, "023970", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = NO;
- if (strncmp ( code, "023971", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = NO;
- if (strncmp ( code, "023972", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = NO;
- if (strncmp ( code, "023973", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = NO;
- if (strncmp ( code, "023974", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = NO;
- if (strncmp ( code, "023975", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = NO;
- if (strncmp ( code, "023976", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = NO;
- if (strncmp ( code, "023977", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = NO;
- }
- }
- }
- }
- }
- void ClearAbnormalStatus_CCS(byte gun_index)
- {
- bool isCleanCheck = false;
- char code [7];
- if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "", 6 ) == EQUAL)
- return;
- if (true)
- {
- if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023701", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail == YES)
- {
- memcpy ( code, "023701", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023737", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit == YES)
- {
- memcpy ( code, "023737", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023738", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition == YES)
- {
- memcpy ( code, "023738", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023739", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault == YES)
- {
- memcpy ( code, "023739", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023740", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction == YES)
- {
- memcpy ( code, "023740", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023741", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential == YES)
- {
- memcpy ( code, "023741", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023742", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange == YES)
- {
- memcpy ( code, "023742", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023743", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility == YES)
- {
- memcpy ( code, "023743", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023744", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent == YES)
- {
- memcpy ( code, "023744", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023745", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker == YES)
- {
- memcpy ( code, "023745", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023746", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData == YES)
- {
- memcpy ( code, "023746", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023747", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A == YES)
- {
- memcpy ( code, "023747", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023748", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B == YES)
- {
- memcpy ( code, "023748", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023749", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C == YES)
- {
- memcpy ( code, "023749", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023750", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 == YES)
- {
- memcpy ( code, "023750", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023751", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 == YES)
- {
- memcpy ( code, "023751", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023752", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 == YES)
- {
- memcpy ( code, "023752", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023753", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 == YES)
- {
- memcpy ( code, "023753", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023754", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 == YES)
- {
- memcpy ( code, "023754", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023755", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 == YES)
- {
- memcpy ( code, "023755", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023756", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 == YES)
- {
- memcpy ( code, "023756", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023757", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 == YES)
- {
- memcpy ( code, "023757", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023758", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError == YES)
- {
- memcpy ( code, "023758", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023759", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError == YES)
- {
- memcpy ( code, "023759", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023760", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession == YES)
- {
- memcpy ( code, "023760", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023761", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid == YES)
- {
- memcpy ( code, "023761", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023762", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid == YES)
- {
- memcpy ( code, "023762", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023763", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid == YES)
- {
- memcpy ( code, "023763", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023764", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid == YES)
- {
- memcpy ( code, "023764", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023765", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired == YES)
- {
- memcpy ( code, "023765", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023766", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid == YES)
- {
- memcpy ( code, "023766", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023767", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked == YES)
- {
- memcpy ( code, "023767", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023768", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable == YES)
- {
- memcpy ( code, "023768", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023769", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError == YES)
- {
- memcpy ( code, "023769", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023770", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError == YES)
- {
- memcpy ( code, "023770", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023771", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError == YES)
- {
- memcpy ( code, "023771", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023772", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled == YES)
- {
- memcpy ( code, "023772", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023773", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid == YES)
- {
- memcpy ( code, "023773", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023774", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode == YES)
- {
- memcpy ( code, "023774", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023775", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter == YES)
- {
- memcpy ( code, "023775", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023776", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid == YES)
- {
- memcpy ( code, "023776", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023777", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid == YES)
- {
- memcpy ( code, "023777", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023778", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow == YES)
- {
- memcpy ( code, "023778", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023779", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied == YES)
- {
- memcpy ( code, "023779", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023780", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid == YES)
- {
- memcpy ( code, "023780", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023781", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected == YES)
- {
- memcpy ( code, "023781", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023782", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError == YES)
- {
- memcpy ( code, "023782", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023783", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE == YES)
- {
- memcpy ( code, "023783", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023784", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop == YES)
- {
- memcpy ( code, "023784", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023785", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError == YES)
- {
- memcpy ( code, "023785", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023786", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError == YES)
- {
- memcpy ( code, "023786", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023787", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError == YES)
- {
- memcpy ( code, "023787", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023788", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort == YES)
- {
- memcpy ( code, "023788", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023789", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol == YES)
- {
- memcpy ( code, "023789", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023790", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted == YES)
- {
- memcpy ( code, "023790", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023791", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown == YES)
- {
- memcpy ( code, "023791", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023792", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke == YES)
- {
- memcpy ( code, "023792", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023793", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked == YES)
- {
- memcpy ( code, "023793", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023794", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked == YES)
- {
- memcpy ( code, "023794", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023795", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked == YES)
- {
- memcpy ( code, "023795", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023796", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked == YES)
- {
- memcpy ( code, "023796", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023797", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked == YES)
- {
- memcpy ( code, "023797", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023798", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked == YES)
- {
- memcpy ( code, "023798", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023799", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked == YES)
- {
- memcpy ( code, "023799", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023800", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked == YES)
- {
- memcpy ( code, "023800", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023801", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked == YES)
- {
- memcpy ( code, "023801", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023802", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked == YES)
- {
- memcpy ( code, "023802", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023803", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked == YES)
- {
- memcpy ( code, "023803", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023809", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init == YES)
- {
- memcpy ( code, "023809", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023810", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response == YES)
- {
- memcpy ( code, "023810", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023811", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence == YES)
- {
- memcpy ( code, "023811", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023812", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC == YES)
- {
- memcpy ( code, "023812", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023813", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc == YES)
- {
- memcpy ( code, "023813", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023814", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response == YES)
- {
- memcpy ( code, "023814", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023815", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session == YES)
- {
- memcpy ( code, "023815", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023816", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session == YES)
- {
- memcpy ( code, "023816", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023817", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle == YES)
- {
- memcpy ( code, "023817", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023818", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmMnbcSound == YES)
- {
- memcpy ( code, "023818", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023819", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmValidateReq == YES)
- {
- memcpy ( code, "023819", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023823", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join == YES)
- {
- memcpy ( code, "023823", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023824", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join == YES)
- {
- memcpy ( code, "023824", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023825", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange == YES)
- {
- memcpy ( code, "023825", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023826", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification == YES)
- {
- memcpy ( code, "023826", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023832", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes == YES)
- {
- memcpy ( code, "023832", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023833", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes == YES)
- {
- memcpy ( code, "023833", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023834", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes == YES)
- {
- memcpy ( code, "023834", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023835", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes == YES)
- {
- memcpy ( code, "023835", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023836", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes == YES)
- {
- memcpy ( code, "023836", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023837", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes == YES)
- {
- memcpy ( code, "023837", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023838", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes == YES)
- {
- memcpy ( code, "023838", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023839", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes == YES)
- {
- memcpy ( code, "023839", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023840", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes == YES)
- {
- memcpy ( code, "023840", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023841", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes == YES)
- {
- memcpy ( code, "023841", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023842", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes == YES)
- {
- memcpy ( code, "023842", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023843", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes == YES)
- {
- memcpy ( code, "023843", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023844", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time == YES)
- {
- memcpy ( code, "023844", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023845", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time == YES)
- {
- memcpy ( code, "023845", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023846", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time == YES)
- {
- memcpy ( code, "023846", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023847", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time == YES)
- {
- memcpy ( code, "023847", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023848", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time == YES)
- {
- memcpy ( code, "023848", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023849", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time == YES)
- {
- memcpy ( code, "023849", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023850", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime == YES)
- {
- memcpy ( code, "023850", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023855", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO == YES)
- {
- memcpy ( code, "023855", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023856", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO == YES)
- {
- memcpy ( code, "023856", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023857", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO == YES)
- {
- memcpy ( code, "023857", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023858", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO == YES)
- {
- memcpy ( code, "023858", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023859", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT == YES)
- {
- memcpy ( code, "023859", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023860", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT == YES)
- {
- memcpy ( code, "023860", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023861", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT == YES)
- {
- memcpy ( code, "023861", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023862", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT == YES)
- {
- memcpy ( code, "023862", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023863", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO == YES)
- {
- memcpy ( code, "023863", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023864", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO == YES)
- {
- memcpy ( code, "023864", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023865", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST == YES)
- {
- memcpy ( code, "023865", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023866", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST == YES)
- {
- memcpy ( code, "023866", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023867", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER == YES)
- {
- memcpy ( code, "023867", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023868", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER == YES)
- {
- memcpy ( code, "023868", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023869", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER == YES)
- {
- memcpy ( code, "023869", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023870", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER == YES)
- {
- memcpy ( code, "023870", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023871", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH == YES)
- {
- memcpy ( code, "023871", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023872", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH == YES)
- {
- memcpy ( code, "023872", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023873", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS == YES)
- {
- memcpy ( code, "023873", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023874", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS == YES)
- {
- memcpy ( code, "023874", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023875", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO == YES)
- {
- memcpy ( code, "023875", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023876", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO == YES)
- {
- memcpy ( code, "023876", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023877", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO == YES)
- {
- memcpy ( code, "023877", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023878", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO == YES)
- {
- memcpy ( code, "023878", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023879", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO == YES)
- {
- memcpy ( code, "023879", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023880", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO == YES)
- {
- memcpy ( code, "023880", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023881", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence == YES)
- {
- memcpy ( code, "023881", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023882", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID == YES)
- {
- memcpy ( code, "023882", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023883", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error == YES)
- {
- memcpy ( code, "023883", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023884", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error == YES)
- {
- memcpy ( code, "023884", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023885", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error == YES)
- {
- memcpy ( code, "023885", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023886", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error == YES)
- {
- memcpy ( code, "023886", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023887", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error == YES)
- {
- memcpy ( code, "023887", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023888", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error == YES)
- {
- memcpy ( code, "023888", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023889", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error == YES)
- {
- memcpy ( code, "023889", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023890", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error == YES)
- {
- memcpy ( code, "023890", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023891", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging == YES)
- {
- memcpy ( code, "023891", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- // else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023892", 6) == EQUAL &&
- // ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm == YES)
- // {
- // memcpy(code, "023892", 6);
- // memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
- // isCleanCheck = true;
- // }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023893", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccFailForQCA7000SetKey == YES)
- {
- memcpy ( code, "023893", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023979", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.EV_Full_Charging == YES)
- {
- memcpy ( code, "023979", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- else if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "023983", 6 ) == EQUAL && ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason == YES)
- {
- memcpy ( code, "023983", 6 );
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, "", 6 );
- isCleanCheck = true;
- }
- }
- if (isCleanCheck)
- {
- for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index ++)
- {
- if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
- {
- PRINTF_FUNC ( "CCS clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index,
- _chargingData [index]->EvConnAlarmCode, code );
- if (strncmp ( (char *) _chargingData [index]->EvConnAlarmCode, code, 6 ) != EQUAL)
- {
- if (strncmp ( code, "023701", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = NO;
- if (strncmp ( code, "023737", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = NO;
- if (strncmp ( code, "023738", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = NO;
- if (strncmp ( code, "023739", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = NO;
- if (strncmp ( code, "023740", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = NO;
- if (strncmp ( code, "023741", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = NO;
- if (strncmp ( code, "023742", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = NO;
- if (strncmp ( code, "023743", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = NO;
- if (strncmp ( code, "023744", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = NO;
- if (strncmp ( code, "023745", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = NO;
- if (strncmp ( code, "023746", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = NO;
- if (strncmp ( code, "023747", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = NO;
- if (strncmp ( code, "023748", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = NO;
- if (strncmp ( code, "023749", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = NO;
- if (strncmp ( code, "023750", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = NO;
- if (strncmp ( code, "023751", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = NO;
- if (strncmp ( code, "023752", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = NO;
- if (strncmp ( code, "023753", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = NO;
- if (strncmp ( code, "023754", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = NO;
- if (strncmp ( code, "023755", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = NO;
- if (strncmp ( code, "023756", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = NO;
- if (strncmp ( code, "023757", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = NO;
- if (strncmp ( code, "023758", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = NO;
- if (strncmp ( code, "023759", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = NO;
- if (strncmp ( code, "023760", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = NO;
- if (strncmp ( code, "023761", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = NO;
- if (strncmp ( code, "023762", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = NO;
- if (strncmp ( code, "023763", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = NO;
- if (strncmp ( code, "023764", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = NO;
- if (strncmp ( code, "023765", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = NO;
- if (strncmp ( code, "023766", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = NO;
- if (strncmp ( code, "023767", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = NO;
- if (strncmp ( code, "023768", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = NO;
- if (strncmp ( code, "023769", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = NO;
- if (strncmp ( code, "023770", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = NO;
- if (strncmp ( code, "023771", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = NO;
- if (strncmp ( code, "023772", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = NO;
- if (strncmp ( code, "023773", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = NO;
- if (strncmp ( code, "023774", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = NO;
- if (strncmp ( code, "023775", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = NO;
- if (strncmp ( code, "023776", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = NO;
- if (strncmp ( code, "023777", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = NO;
- if (strncmp ( code, "023778", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = NO;
- if (strncmp ( code, "023779", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = NO;
- if (strncmp ( code, "023780", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = NO;
- if (strncmp ( code, "023781", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = NO;
- if (strncmp ( code, "023782", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = NO;
- if (strncmp ( code, "023783", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = NO;
- if (strncmp ( code, "023784", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = NO;
- if (strncmp ( code, "023785", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = NO;
- if (strncmp ( code, "023786", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = NO;
- if (strncmp ( code, "023787", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = NO;
- if (strncmp ( code, "023788", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = NO;
- if (strncmp ( code, "023789", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = NO;
- if (strncmp ( code, "023790", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = NO;
- if (strncmp ( code, "023791", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = NO;
- if (strncmp ( code, "023792", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = NO;
- if (strncmp ( code, "023793", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = NO;
- if (strncmp ( code, "023794", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = NO;
- if (strncmp ( code, "023795", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = NO;
- if (strncmp ( code, "023796", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = NO;
- if (strncmp ( code, "023797", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = NO;
- if (strncmp ( code, "023798", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = NO;
- if (strncmp ( code, "023799", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = NO;
- if (strncmp ( code, "023800", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = NO;
- if (strncmp ( code, "023801", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = NO;
- if (strncmp ( code, "023802", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = NO;
- if (strncmp ( code, "023803", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = NO;
- if (strncmp ( code, "023809", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = NO;
- if (strncmp ( code, "023810", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = NO;
- if (strncmp ( code, "023811", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = NO;
- if (strncmp ( code, "023812", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = NO;
- if (strncmp ( code, "023813", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = NO;
- if (strncmp ( code, "023814", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = NO;
- if (strncmp ( code, "023815", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = NO;
- if (strncmp ( code, "023816", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = NO;
- if (strncmp ( code, "023817", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = NO;
- if (strncmp ( code, "023818", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmMnbcSound = NO;
- if (strncmp ( code, "023819", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmValidateReq = NO;
- if (strncmp ( code, "023823", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = NO;
- if (strncmp ( code, "023824", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = NO;
- if (strncmp ( code, "023825", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = NO;
- if (strncmp ( code, "023826", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = NO;
- if (strncmp ( code, "023832", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = NO;
- if (strncmp ( code, "023833", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = NO;
- if (strncmp ( code, "023834", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = NO;
- if (strncmp ( code, "023835", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = NO;
- if (strncmp ( code, "023836", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = NO;
- if (strncmp ( code, "023837", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = NO;
- if (strncmp ( code, "023838", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = NO;
- if (strncmp ( code, "023839", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = NO;
- if (strncmp ( code, "023840", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = NO;
- if (strncmp ( code, "023841", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = NO;
- if (strncmp ( code, "023842", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = NO;
- if (strncmp ( code, "023843", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = NO;
- if (strncmp ( code, "023844", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = NO;
- if (strncmp ( code, "023845", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = NO;
- if (strncmp ( code, "023846", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = NO;
- if (strncmp ( code, "023847", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = NO;
- if (strncmp ( code, "023848", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = NO;
- if (strncmp ( code, "023849", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = NO;
- if (strncmp ( code, "023850", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime = NO;
- if (strncmp ( code, "023855", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = NO;
- if (strncmp ( code, "023856", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = NO;
- if (strncmp ( code, "023857", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = NO;
- if (strncmp ( code, "023858", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = NO;
- if (strncmp ( code, "023859", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = NO;
- if (strncmp ( code, "023860", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = NO;
- if (strncmp ( code, "023861", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = NO;
- if (strncmp ( code, "023862", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = NO;
- if (strncmp ( code, "023863", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = NO;
- if (strncmp ( code, "023864", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = NO;
- if (strncmp ( code, "023865", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = NO;
- if (strncmp ( code, "023866", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = NO;
- if (strncmp ( code, "023867", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = NO;
- if (strncmp ( code, "023868", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = NO;
- if (strncmp ( code, "023869", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = NO;
- if (strncmp ( code, "023870", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = NO;
- if (strncmp ( code, "023871", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = NO;
- if (strncmp ( code, "023872", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = NO;
- if (strncmp ( code, "023873", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = NO;
- if (strncmp ( code, "023874", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = NO;
- if (strncmp ( code, "023875", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = NO;
- if (strncmp ( code, "023876", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = NO;
- if (strncmp ( code, "023877", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = NO;
- if (strncmp ( code, "023878", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = NO;
- if (strncmp ( code, "023879", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = NO;
- if (strncmp ( code, "023880", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = NO;
- if (strncmp ( code, "023881", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = NO;
- if (strncmp ( code, "023882", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = NO;
- if (strncmp ( code, "023883", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = NO;
- if (strncmp ( code, "023884", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = NO;
- if (strncmp ( code, "023885", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = NO;
- if (strncmp ( code, "023886", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = NO;
- if (strncmp ( code, "023887", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = NO;
- if (strncmp ( code, "023888", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = NO;
- if (strncmp ( code, "023889", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = NO;
- if (strncmp ( code, "023890", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = NO;
- if (strncmp ( code, "023891", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging = NO;
- //if (strncmp(code, "023892", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm = NO;
- if (strncmp ( code, "023893", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccFailForQCA7000SetKey = NO;
- if (strncmp ( code, "023979", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.EV_Full_Charging = NO;
- if (strncmp ( code, "023983", 6 ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason = NO;
- }
- }
- }
- }
- }
- bool AbnormalStopAnalysis(byte gun_index, byte *errCode)
- {
- char string [7];
- sprintf ( string, "%d%d%d%d%d%d", * (errCode + 0), * (errCode + 1), * (errCode + 2), * (errCode + 3), * (errCode + 4),
- * (errCode + 5) );
- PRINTF_FUNC ( "NOTIFICATION_EV_STOP : Err Code = %s \n", string );
- if (strncmp ( string, "000000", 6 ) == EQUAL || strncmp ( string, "012219", 6 ) == EQUAL)
- return false;
- if (strncmp ( (char *) _chargingData [gun_index]->EvConnAlarmCode, "", 6 ) != EQUAL)
- return true;
- memcpy ( _chargingData [gun_index]->EvConnAlarmCode, string, 6 );
- PRINTF_FUNC ( "NOTIFICATION_EV_STOP : EvConnAlarmCode = %s \n", _chargingData [gun_index]->EvConnAlarmCode );
- if (strcmp ( string, "023700" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = YES;
- if (strcmp ( string, "023704" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = YES;
- if (strcmp ( string, "023705" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = YES;
- if (strcmp ( string, "023706" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = YES;
- if (strcmp ( string, "023707" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP = YES;
- if (strcmp ( string, "023708" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP = YES;
- if (strcmp ( string, "023709" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP = YES;
- if (strcmp ( string, "023710" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff = YES;
- if (strcmp ( string, "023711" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff = YES;
- if (strcmp ( string, "023712" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition = YES;
- if (strcmp ( string, "023713" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault = YES;
- if (strcmp ( string, "023714" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError = YES;
- if (strcmp ( string, "023715" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop = YES;
- if (strcmp ( string, "023716" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken = YES;
- if (strcmp ( string, "023717" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail = YES;
- if (strcmp ( string, "023718" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive = YES;
- if (strcmp ( string, "023719" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout = YES;
- if (strcmp ( string, "023720" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout = YES;
- if (strcmp ( string, "023721" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout = YES;
- if (strcmp ( string, "023722" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout = YES;
- if (strcmp ( string, "023723" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout = YES;
- if (strcmp ( string, "023724" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout = YES;
- if (strcmp ( string, "023725" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout = YES;
- if (strcmp ( string, "023726" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V = YES;
- if (strcmp ( string, "023727" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V = YES;
- if (strcmp ( string, "023728" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop = YES;
- if (strcmp ( string, "023729" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop = YES;
- if (strcmp ( string, "023730" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop = YES;
- if (strcmp ( string, "023731" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail = YES;
- if (strcmp ( string, "023732" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard = YES;
- if (strcmp ( string, "023733" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit = YES;
- if (strcmp ( string, "023734" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit = YES;
- if (strcmp ( string, "023735" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = YES;
- if (strcmp ( string, "023736" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = YES;
- if (strcmp ( string, "023980" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_BMS_CHARGE_ALLOW_ERROR = YES;
- if (strcmp ( string, "023981" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_OUTPUT_VOLTAGE_MORE_THEN_10_PERCENT = YES;
- if (strcmp ( string, "023982" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CHADEMO_ADC_LESS_THAN_10V = YES;
- if (strcmp ( string, "012288" ) == EQUAL)
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsOutputUVPFail = YES;
- if (strcmp ( string, "023701" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = YES;
- if (strcmp ( string, "023737" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = YES;
- if (strcmp ( string, "023738" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = YES;
- if (strcmp ( string, "023739" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = YES;
- if (strcmp ( string, "023740" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = YES;
- if (strcmp ( string, "023741" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = YES;
- if (strcmp ( string, "023742" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = YES;
- if (strcmp ( string, "023743" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = YES;
- if (strcmp ( string, "023744" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = YES;
- if (strcmp ( string, "023745" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = YES;
- if (strcmp ( string, "023746" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = YES;
- if (strcmp ( string, "023747" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = YES;
- if (strcmp ( string, "023748" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = YES;
- if (strcmp ( string, "023749" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = YES;
- if (strcmp ( string, "023750" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = YES;
- if (strcmp ( string, "023751" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = YES;
- if (strcmp ( string, "023752" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = YES;
- if (strcmp ( string, "023753" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = YES;
- if (strcmp ( string, "023754" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = YES;
- if (strcmp ( string, "023755" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = YES;
- if (strcmp ( string, "023756" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = YES;
- if (strcmp ( string, "023757" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = YES;
- if (strcmp ( string, "023758" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = YES;
- if (strcmp ( string, "023759" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = YES;
- if (strcmp ( string, "023760" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = YES;
- if (strcmp ( string, "023761" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = YES;
- if (strcmp ( string, "023762" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = YES;
- if (strcmp ( string, "023763" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = YES;
- if (strcmp ( string, "023764" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = YES;
- if (strcmp ( string, "023765" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = YES;
- if (strcmp ( string, "023766" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = YES;
- if (strcmp ( string, "023767" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = YES;
- if (strcmp ( string, "023768" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = YES;
- if (strcmp ( string, "023769" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = YES;
- if (strcmp ( string, "023770" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = YES;
- if (strcmp ( string, "023771" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = YES;
- if (strcmp ( string, "023772" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = YES;
- if (strcmp ( string, "023773" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = YES;
- if (strcmp ( string, "023774" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = YES;
- if (strcmp ( string, "023775" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = YES;
- if (strcmp ( string, "023776" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = YES;
- if (strcmp ( string, "023777" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = YES;
- if (strcmp ( string, "023778" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = YES;
- if (strcmp ( string, "023779" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = YES;
- if (strcmp ( string, "023780" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = YES;
- if (strcmp ( string, "023781" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = YES;
- if (strcmp ( string, "023782" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = YES;
- if (strcmp ( string, "023783" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = YES;
- if (strcmp ( string, "023784" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = YES;
- if (strcmp ( string, "023785" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = YES;
- if (strcmp ( string, "023786" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = YES;
- if (strcmp ( string, "023787" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = YES;
- if (strcmp ( string, "023788" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = YES;
- if (strcmp ( string, "023789" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = YES;
- if (strcmp ( string, "023790" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = YES;
- if (strcmp ( string, "023791" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = YES;
- if (strcmp ( string, "023792" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = YES;
- if (strcmp ( string, "023793" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = YES;
- if (strcmp ( string, "023794" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = YES;
- if (strcmp ( string, "023795" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = YES;
- if (strcmp ( string, "023796" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = YES;
- if (strcmp ( string, "023797" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = YES;
- if (strcmp ( string, "023798" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = YES;
- if (strcmp ( string, "023799" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = YES;
- if (strcmp ( string, "023800" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = YES;
- if (strcmp ( string, "023801" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = YES;
- if (strcmp ( string, "023802" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = YES;
- if (strcmp ( string, "023803" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = YES;
- if (strcmp ( string, "023809" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = YES;
- if (strcmp ( string, "023810" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = YES;
- if (strcmp ( string, "023811" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = YES;
- if (strcmp ( string, "023812" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = YES;
- if (strcmp ( string, "023813" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = YES;
- if (strcmp ( string, "023814" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = YES;
- if (strcmp ( string, "023815" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = YES;
- if (strcmp ( string, "023816" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = YES;
- if (strcmp ( string, "023817" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = YES;
- if (strcmp ( string, "023818" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmMnbcSound = YES;
- if (strcmp ( string, "023819" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccSlacTimeoutCmValidateReq = YES;
- if (strcmp ( string, "023823" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = YES;
- if (strcmp ( string, "023824" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = YES;
- if (strcmp ( string, "023825" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = YES;
- if (strcmp ( string, "023826" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = YES;
- if (strcmp ( string, "023832" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = YES;
- if (strcmp ( string, "023833" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = YES;
- if (strcmp ( string, "023834" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = YES;
- if (strcmp ( string, "023835" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = YES;
- if (strcmp ( string, "023836" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = YES;
- if (strcmp ( string, "023837" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = YES;
- if (strcmp ( string, "023838" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = YES;
- if (strcmp ( string, "023839" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = YES;
- if (strcmp ( string, "023840" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = YES;
- if (strcmp ( string, "023841" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = YES;
- if (strcmp ( string, "023842" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = YES;
- if (strcmp ( string, "023843" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = YES;
- if (strcmp ( string, "023844" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = YES;
- if (strcmp ( string, "023845" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = YES;
- if (strcmp ( string, "023846" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = YES;
- if (strcmp ( string, "023847" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = YES;
- if (strcmp ( string, "023848" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = YES;
- if (strcmp ( string, "023849" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = YES;
- if (strcmp ( string, "023850" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime = YES;
- if (strcmp ( string, "023855" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = YES;
- if (strcmp ( string, "023856" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = YES;
- if (strcmp ( string, "023857" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = YES;
- if (strcmp ( string, "023858" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = YES;
- if (strcmp ( string, "023859" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = YES;
- if (strcmp ( string, "023860" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = YES;
- if (strcmp ( string, "023861" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = YES;
- if (strcmp ( string, "023862" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = YES;
- if (strcmp ( string, "023863" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = YES;
- if (strcmp ( string, "023864" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = YES;
- if (strcmp ( string, "023865" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = YES;
- if (strcmp ( string, "023866" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = YES;
- if (strcmp ( string, "023867" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = YES;
- if (strcmp ( string, "023868" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = YES;
- if (strcmp ( string, "023869" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = YES;
- if (strcmp ( string, "023870" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = YES;
- if (strcmp ( string, "023871" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = YES;
- if (strcmp ( string, "023872" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = YES;
- if (strcmp ( string, "023873" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = YES;
- if (strcmp ( string, "023874" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = YES;
- if (strcmp ( string, "023875" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = YES;
- if (strcmp ( string, "023876" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = YES;
- if (strcmp ( string, "023877" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = YES;
- if (strcmp ( string, "023878" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = YES;
- if (strcmp ( string, "023879" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = YES;
- if (strcmp ( string, "023880" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = YES;
- if (strcmp ( string, "023881" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = YES;
- if (strcmp ( string, "023882" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = YES;
- if (strcmp ( string, "023883" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = YES;
- if (strcmp ( string, "023884" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = YES;
- if (strcmp ( string, "023885" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = YES;
- if (strcmp ( string, "023886" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = YES;
- if (strcmp ( string, "023887" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = YES;
- if (strcmp ( string, "023888" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = YES;
- if (strcmp ( string, "023889" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = YES;
- if (strcmp ( string, "023890" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = YES;
- if (strcmp ( string, "023891" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging = YES;
- if (strcmp ( string, "023892" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm = YES;
- if (strcmp ( string, "023893" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccFailForQCA7000SetKey = YES;
- if (strcmp ( string, "023979" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.EV_Full_Charging = YES;
- if (strcmp ( string, "023983" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason = YES;
- if (strcmp ( string, "023702" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = YES;
- if (strcmp ( string, "023900" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = YES;
- if (strcmp ( string, "023901" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = YES;
- if (strcmp ( string, "023902" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = YES;
- if (strcmp ( string, "023903" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = YES;
- if (strcmp ( string, "023904" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = YES;
- if (strcmp ( string, "023905" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = YES;
- if (strcmp ( string, "023906" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = YES;
- if (strcmp ( string, "023907" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = YES;
- if (strcmp ( string, "023908" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = YES;
- if (strcmp ( string, "023909" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = YES;
- if (strcmp ( string, "023910" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = YES;
- if (strcmp ( string, "023911" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = YES;
- if (strcmp ( string, "023912" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = YES;
- if (strcmp ( string, "023913" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = YES;
- if (strcmp ( string, "023914" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = YES;
- if (strcmp ( string, "023915" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = YES;
- if (strcmp ( string, "023916" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = YES;
- if (strcmp ( string, "023917" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = YES;
- if (strcmp ( string, "023918" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = YES;
- if (strcmp ( string, "023919" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = YES;
- if (strcmp ( string, "023930" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = YES;
- if (strcmp ( string, "023931" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = YES;
- if (strcmp ( string, "023932" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = YES;
- if (strcmp ( string, "023933" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = YES;
- if (strcmp ( string, "023934" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = YES;
- if (strcmp ( string, "023935" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = YES;
- if (strcmp ( string, "023936" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = YES;
- if (strcmp ( string, "023937" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = YES;
- if (strcmp ( string, "023938" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = YES;
- if (strcmp ( string, "023939" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = YES;
- if (strcmp ( string, "023940" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = YES;
- if (strcmp ( string, "023941" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = YES;
- if (strcmp ( string, "023942" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = YES;
- if (strcmp ( string, "023943" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = YES;
- if (strcmp ( string, "023944" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = YES;
- if (strcmp ( string, "023945" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = YES;
- if (strcmp ( string, "023946" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = YES;
- if (strcmp ( string, "023947" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = YES;
- if (strcmp ( string, "023950" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = YES;
- if (strcmp ( string, "023951" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = YES;
- if (strcmp ( string, "023952" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = YES;
- if (strcmp ( string, "023953" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = YES;
- if (strcmp ( string, "023954" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = YES;
- if (strcmp ( string, "023955" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = YES;
- if (strcmp ( string, "023956" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = YES;
- if (strcmp ( string, "023957" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = YES;
- if (strcmp ( string, "023958" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = YES;
- if (strcmp ( string, "023959" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = YES;
- if (strcmp ( string, "023960" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = YES;
- if (strcmp ( string, "023961" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = YES;
- if (strcmp ( string, "023962" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = YES;
- if (strcmp ( string, "023963" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = YES;
- if (strcmp ( string, "023964" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = YES;
- if (strcmp ( string, "023970" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = YES;
- if (strcmp ( string, "023971" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = YES;
- if (strcmp ( string, "023972" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = YES;
- if (strcmp ( string, "023973" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = YES;
- if (strcmp ( string, "023974" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = YES;
- if (strcmp ( string, "023975" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = YES;
- if (strcmp ( string, "023976" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = YES;
- if (strcmp ( string, "023977" ) == EQUAL)
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = YES;
- return true;
- }
- byte ReturnConnectTemp(byte temp1, byte temp2)
- {
- byte result = 0;
- if (temp1 == UNDEFINED_TEMP && temp2 == UNDEFINED_TEMP)
- return UNDEFINED_TEMP;
- if (temp1 != UNDEFINED_TEMP)
- result = temp1;
- else
- temp1 = 0;
- if (temp2 != UNDEFINED_TEMP)
- {
- if (temp2 > temp1)
- result = temp2;
- }
- return result;
- }
- void CANReceiver()
- {
- pid_t canRecPid;
- canRecPid = fork ();
- if (canRecPid > 0)
- {
- int nbytes;
- struct can_frame frame;
- int intCmd;
- bool isClearBuf = false;
- // 槍資訊
- struct ChargingInfoData *_chargingData [CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
- bool isPass = false;
- gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
- while ( ! isPass)
- {
- isPass = true;
- for (byte _index = 0; _index < gun_count; _index ++)
- {
- if ( ! FindChargingInfoData ( _index, & _chargingData [0] ))
- {
- DEBUG_ERROR( "EvComm (main) : FindChargingInfoData false \n" );
- isPass = false;
- break;
- }
- }
- sleep ( 1 );
- }
- while (1)
- {
- memset ( & frame, 0, sizeof(struct can_frame) );
- nbytes = read ( CanFd, & frame, sizeof(struct can_frame) );
- if (nbytes > 0)
- {
- byte target;
- byte targetGun = 0x00;
- byte findIndex = 0x00;
- EvFrame *EvFrameMsg;
- EvFrameMsg = (EvFrame *) & frame.can_id;
- intCmd = EvFrameMsg->EvBdBits.MessageID;
- if ( ! isClearBuf)
- {
- continue;
- }
- if (intCmd == EV_Command_AddressReq)
- {
- ShmDcCommonData->CcsVersion = _CCS_VERSION_CHECK_TAG_V013S0;
- AddrAssignment ( frame.data );
- continue;
- }
- target = EvFrameMsg->EvBdBits.SlaveAddress; // 0x01 or 0x02
- for (byte _index = 0; _index < gun_count; _index ++)
- {
- // 假設有找到回應的 Index
- findIndex = target;
- if (gun_count == 1 && _chargingData [_index]->Type == _Type_CCS && ShmDcCommonData->CcsVersion == _CCS_VERSION_CHECK_TAG_V015S0)
- {
- target -= 1;
- }
- if (_chargingData [_index]->Evboard_id == target)
- {
- targetGun = _index;
- break;
- }
- }
- if (targetGun < 0 || targetGun >= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY)
- {
- PRINTF_FUNC ( "EvComm (CANReceiver) : Target index = %x is < 0 or > QUANTITY \n", targetGun );
- continue;
- }
- if (gun_count == 1)
- {
- if (findIndex == 1)
- ShmDcCommonData->CcsVersion = _CCS_VERSION_CHECK_TAG_V013S0;
- else
- ShmDcCommonData->CcsVersion = _CCS_VERSION_CHECK_TAG_V015S0;
- }
- if (intCmd == 256)
- {
- continue;
- }
- switch (intCmd)
- {
- case EV_Command_EvStatusNotification :
- {
- if (_chargingData [targetGun]->ConnectorPlugIn != frame.data [0])
- {
- if (frame.data [0] == PLUG)
- PRINTF_FUNC ( "Conn %d, Plugin. \n", targetGun );
- else if (frame.data [0] == UNPLUG)
- PRINTF_FUNC ( "Conn %d, Unplug. \n", targetGun );
- else
- PRINTF_FUNC ( "Conn %d, Plug None Check. (%d) \n", targetGun, frame.data [0] );
- }
- _chargingData [targetGun]->ConnectorPlugIn = frame.data [0];
- _chargingData [targetGun]->PilotVoltage = frame.data [1];
- //PRINTF_FUNC("index = %d, ConnectorPlugIn = %x, data[0] = %x \n", targetGun, _chargingData[targetGun]->ConnectorPlugIn, frame.data[0]);
- //PRINTF_FUNC("ConnectorPlugIn = %x \n", (-120 + frame.data[1]) / 10);
- }
- break;
- case EV_Command_GetFwVersion :
- {
- byte ver [16];
- memset ( ver, 0, sizeof(ver) );
- if (_chargingData [targetGun]->Type == _Type_Chademo)
- {
- memcpy ( ver, frame.data, frame.can_dlc );
- memcpy ( ShmCHAdeMOData->evse [_chargingData [targetGun]->type_index].version, ver,
- ARRAY_SIZE( ver ) );
- ShmCHAdeMOData->evse [_chargingData [targetGun]->type_index].SelfTest_Comp = PASS;
- PRINTF_FUNC ( "Connector %d, Chadmoe Ver. : %s\n", targetGun,
- ShmCHAdeMOData->evse [_chargingData [targetGun]->type_index].version );
- }
- else if (_chargingData [targetGun]->Type == _Type_GB)
- {
- memcpy ( ver, frame.data, frame.can_dlc );
- memcpy ( ShmGBTData->evse [_chargingData [targetGun]->type_index].version, ver, ARRAY_SIZE( ver ) );
- ShmGBTData->evse [_chargingData [targetGun]->type_index].SelfTest_Comp = PASS;
- PRINTF_FUNC ( "Connector %d, GBT Ver. : %s\n", targetGun,
- ShmGBTData->evse [_chargingData [targetGun]->type_index].version );
- }
- else if (_chargingData [targetGun]->Type == _Type_CCS)
- {
- if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121)
- {
- memcpy ( ver, frame.data, frame.can_dlc );
- memcpy ( & ShmCcsData->V2GMessage_DIN70121 [_chargingData [targetGun]->type_index].version, ver,
- ARRAY_SIZE( ver ) );
- ShmCcsData->V2GMessage_DIN70121 [_chargingData [targetGun]->type_index].SelfTest_Comp = PASS;
- PRINTF_FUNC ( "Connector %d, CCS Ver. = %s \n", targetGun,
- ShmCcsData->V2GMessage_DIN70121 [_chargingData [targetGun]->type_index].version );
- }
- }
- if (targetGun == 0)
- {
- memset ( ShmSysConfigAndInfo->SysInfo.Connector1FwRev, 0,
- sizeof(ShmSysConfigAndInfo->SysInfo.Connector1FwRev) );
- memcpy ( ShmSysConfigAndInfo->SysInfo.Connector1FwRev, ver, ARRAY_SIZE( ver ) );
- }
- else
- {
- memset ( ShmSysConfigAndInfo->SysInfo.Connector2FwRev, 0,
- sizeof(ShmSysConfigAndInfo->SysInfo.Connector2FwRev) );
- memcpy ( ShmSysConfigAndInfo->SysInfo.Connector2FwRev, ver, ARRAY_SIZE( ver ) );
- }
- }
- break;
- case EV_Command_GetHwVersion :
- {
- //PRINTF_FUNC("Get EV HW = %s \n", frame.data);
- }
- break;
- case EV_Command_GetOutputReq :
- {
- if ((_chargingData [targetGun]->SystemStatus >= SYS_MODE_PREPARE_FOR_EVSE && _chargingData [targetGun]->SystemStatus <= SYS_MODE_CHARGING) || (_chargingData [targetGun]->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && _chargingData [targetGun]->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))
- {
- if (_chargingData [targetGun]->EvBatteryStartSoc <= 0)
- _chargingData [targetGun]->EvBatteryStartSoc = frame.data [1];
- if (frame.data [1] > _chargingData [targetGun]->EvBatterySoc || _chargingData [targetGun]->SystemStatus == SYS_MODE_CHARGING)
- _chargingData [targetGun]->EvBatterySoc = frame.data [1];
- }
- _chargingData [targetGun]->EvBatterytargetVoltage = (float) ((frame.data [3] << 8) + frame.data [2]) / 10;
- _chargingData [targetGun]->EvBatterytargetCurrent = (float) ((frame.data [5] << 8) + frame.data [4]) / 10;
- _chargingData [targetGun]->RemainChargingDuration = ((short) frame.data [7] << 8) + (short) frame.data [6];
- if (_chargingData [targetGun]->Type == _Type_Chademo)
- {
- //if (ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].EvDetection != frame.data[0])
- {
- ShmCHAdeMOData->ev [_chargingData [targetGun]->type_index].PresentMsgFlowStatus = frame.data [0];
- }
- ShmCHAdeMOData->ev [_chargingData [targetGun]->type_index].EvDetection = frame.data [0];
- ShmCHAdeMOData->ev [_chargingData [targetGun]->type_index].SOC = _chargingData [targetGun]->EvBatterySoc;
- ShmCHAdeMOData->ev [_chargingData [targetGun]->type_index].TargetBatteryVoltage = (_chargingData [targetGun]->EvBatterytargetVoltage * 10);
- ShmCHAdeMOData->ev [_chargingData [targetGun]->type_index].ChargingCurrentRequest = (_chargingData [targetGun]->EvBatterytargetCurrent * 10);
- }
- else if (_chargingData [targetGun]->Type == _Type_GB)
- {
- //if (ShmGBTData->ev[_chargingData[targetGun]->type_index].EvDetection != frame.data[0])
- {
- ShmGBTData->ev [_chargingData [targetGun]->type_index].PresentMsgFlowStatus = frame.data [0];
- }
- ShmGBTData->ev [_chargingData [targetGun]->type_index].EvDetection = frame.data [0];
- ShmGBTData->ev [_chargingData [targetGun]->type_index].SOC = _chargingData [targetGun]->EvBatterySoc;
- ShmGBTData->ev [_chargingData [targetGun]->type_index].TargetBatteryVoltage = (_chargingData [targetGun]->EvBatterytargetVoltage * 10);
- ShmGBTData->ev [_chargingData [targetGun]->type_index].ChargingCurrentRequest = (_chargingData [targetGun]->EvBatterytargetCurrent * 10);
- }
- else if (_chargingData [targetGun]->Type == _Type_CCS)
- {
- if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121)
- {
- ShmCcsData->V2GMessage_DIN70121 [_chargingData [targetGun]->type_index].PresentMsgFlowStatus = frame.data [0];
- }
- }
- //PRINTF_FUNC("EvBatterytargetVoltage = %f \n", _chargingData[targetGun]->EvBatterytargetVoltage);
- //PRINTF_FUNC("EvBatterytargetCurrent = %f \n", _chargingData[targetGun]->EvBatterytargetCurrent);
- //PRINTF_FUNC("BatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TargetBatteryVoltage);
- //PRINTF_FUNC("CurrentRequest = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].ChargingCurrentRequest);
- }
- break;
- case EV_Command_GetBetteryInfo :
- {
- //_chargingData[target].EvACorDCcharging = frame.data[0];
- //_chargingData[target]->TotalBatteryCap = ((float) frame.data[4] << 8) + (short) frame.data[3];
- _chargingData [targetGun]->EvBatteryMaxVoltage = (((short) frame.data [4] << 8) + (short) frame.data [3]) / 10;
- //_chargingData[target]->EvBatteryMaxCurrent = ((float) frame.data[4] << 8) + (short) frame.data[3];
- //_chargingData[target].MaxiBatteryCurrent = ((short) frame.data[6] << 8) + (short) frame.data[5];
- if (_chargingData [targetGun]->Type == _Type_Chademo)
- {
- ShmCHAdeMOData->ev [_chargingData [targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data [2] << 8) + (short) frame.data [1];
- ShmCHAdeMOData->ev [_chargingData [targetGun]->type_index].MaxiBatteryVoltage = _chargingData [targetGun]->EvBatteryMaxVoltage;
- //PRINTF_FUNC("EvBatteryMaxVoltage = %f \n", _chargingData[target]->EvBatteryMaxVoltage);
- //PRINTF_FUNC("TotalBatteryCapacity = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TotalBatteryCapacity);
- //PRINTF_FUNC("MaxiBatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].MaxiBatteryVoltage);
- }
- else if (_chargingData [targetGun]->Type == _Type_GB)
- {
- ShmGBTData->ev [_chargingData [targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data [2] << 8) + (short) frame.data [1];
- ShmGBTData->ev [_chargingData [targetGun]->type_index].MaxiBatteryVoltage = _chargingData [targetGun]->EvBatteryMaxVoltage;
- }
- else if (_chargingData [targetGun]->Type == _Type_CCS)
- {
- }
- }
- break;
- case EV_Command_GetMiscellaneous :
- {
- _chargingData [targetGun]->GunLocked = frame.data [0];
- _chargingData [targetGun]->PilotVoltage = (float) ( - 120 + frame.data [3]) / 10;
- ShmDcCommonData->ConnectorTemp1 [targetGun] = frame.data [1];
- ShmDcCommonData->ConnectorTemp2 [targetGun] = frame.data [2];
- if (_chargingData [targetGun]->Type == _Type_Chademo)
- {
- // 200A 以上的槍才會有 cha 槍溫
- _chargingData [targetGun]->ConnectorTemp = UNDEFINED_TEMP;
- ShmCHAdeMOData->evse [_chargingData [targetGun]->type_index].ConnectorTemperatureP = frame.data [1];
- ShmCHAdeMOData->evse [_chargingData [targetGun]->type_index].ConnectorTemperatureN = frame.data [2];
- ShmCHAdeMOData->evse [_chargingData [targetGun]->type_index].EvboardStatus = frame.data [7];
- }
- else if (_chargingData [targetGun]->Type == _Type_GB)
- {
- _chargingData [targetGun]->ConnectorTemp = ReturnConnectTemp ( frame.data [1], frame.data [2] );
- ShmGBTData->evse [_chargingData [targetGun]->type_index].ConnectorTemperatureP = frame.data [1];
- ShmGBTData->evse [_chargingData [targetGun]->type_index].ConnectorTemperatureN = frame.data [2];
- ShmGBTData->evse [_chargingData [targetGun]->type_index].EvboardStatus = frame.data [7];
- }
- else if (_chargingData [targetGun]->Type == _Type_CCS)
- {
- _chargingData [targetGun]->ConnectorTemp = ReturnConnectTemp ( frame.data [1], frame.data [2] );
- if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121)
- {
- //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureP = frame.data[1];
- //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureN = frame.data[2];
- }
- }
- //PRINTF_FUNC("EvboardStatus = %x \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].EvboardStatus);
- //PRINTF_FUNC("ConnectorPlug locked = %x \n", frame.data[0]);
- //PRINTF_FUNC("ConnectorTemp 0= %d \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].ConnectorTemperatureP);
- //PRINTF_FUNC("ConnectorTemp 1= %d \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].ConnectorTemperatureN);
- //PRINTF_FUNC("PilotVoltage = %x \n", (-120 + frame.data[3]) / 10);
- }
- break;
- case EV_Command_IsolationStatus :
- {
- }
- break;
- case EV_Command_EvccidReq :
- {
- if (frame.can_dlc > 0 && strcmp ( (char *) _chargingData [targetGun]->EVCCID, "" ) == EQUAL)
- {
- if (_chargingData [targetGun]->Type == _Type_CCS)
- {
- if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121)
- {
- memset (
- ShmCcsData->V2GMessage_DIN70121 [_chargingData [targetGun]->type_index].SessionSetupRequest.EVCCID,
- 0,
- sizeof(ShmCcsData->V2GMessage_DIN70121 [_chargingData [targetGun]->type_index].SessionSetupRequest.EVCCID) );
- memcpy (
- ShmCcsData->V2GMessage_DIN70121 [_chargingData [targetGun]->type_index].SessionSetupRequest.EVCCID,
- frame.data, frame.can_dlc );
- }
- }
- sprintf ( (char *) _chargingData [targetGun]->EVCCID, "%.2x%.2x%.2x%.2x%.2x%.2x", frame.data [0],
- frame.data [1], frame.data [2], frame.data [3], frame.data [4], frame.data [5] );
- _chargingData [targetGun]->EVCCID [17] = '\0';
- PRINTF_FUNC ( "*******Gun %d->EVCCID = %s \n", targetGun, _chargingData [targetGun]->EVCCID );
- }
- }
- break;
- case EV_Command_EvsePrechargeInfo :
- {
- _chargingData [targetGun]->PrechargeStatus = frame.data [0];
- }
- break;
- case EV_Command_EvStopNotification :
- {
- // 車端要求停止
- if ((_chargingData [targetGun]->SystemStatus >= SYS_MODE_MODE_REASSIGN_CHECK && _chargingData [targetGun]->SystemStatus <= SYS_MODE_CHARGING) || (_chargingData [targetGun]->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && _chargingData [targetGun]->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))
- {
- // frame.data[0] : 0x01 => normal stop, 0x02 => ev emergency stop
- if (frame.data [0] == 0x02)
- {
- PRINTF_FUNC ( "Gun_%d, ** Emc Level **, Stop charging by EV. \n", targetGun );
- if (AbnormalStopAnalysis ( targetGun, frame.data + 1 ))
- {
- _chargingData [targetGun]->StopChargeFlag = YES;
- }
- else
- {
- // 六個蛋
- _chargingData [targetGun]->NormalStopChargeFlag = YES;
- }
- }
- else
- {
- AbnormalStopAnalysis ( targetGun, frame.data + 1 );
- PRINTF_FUNC ( "Gun_%d, ** Normal Level **, Stop charging by EV. \n", targetGun );
- _chargingData [targetGun]->NormalStopChargeFlag = YES;
- }
- }
- }
- break;
- default :
- PRINTF_FUNC ( "EV board = %d, Ack none defined. intCmd = %d \n", targetGun, intCmd );
- break;
- }
- }
- else
- {
- isClearBuf = true;
- usleep ( 10000 );
- }
- }
- }
- }
- //================================================
- // Main process
- //================================================
- // 檢查 Byte 中某個 Bit 的值
- // _byte : 欲改變的 byte
- // _bit : 該 byte 的第幾個 bit
- unsigned char EvDetectionStatus(unsigned char _byte, unsigned char _bit)
- {
- return (_byte & mask_table [_bit]) != 0x00;
- }
- bool IsConnectorPlugIn(struct ChargingInfoData *chargingData)
- {
- return (chargingData->ConnectorPlugIn == 0x01) ? true : false;
- }
- void SetPresentChargingOutputPower(struct ChargingInfoData *chargingData_1, struct ChargingInfoData *chargingData_2)
- {
- float vol1 = 0 , cur1 = 0;
- float vol2 = 0 , cur2 = 0;
- // if (ShmGBTData->ev[chargingData_1->type_index].PresentMsgFlowStatus == 10)
- // vol1 = ShmPsuData->PsuGroup[0].GroupTargetOutputVoltage;
- // else
- vol1 = chargingData_1->FireChargingVoltage;
- cur1 = (chargingData_1->PresentChargingCurrent * 10);
- float targetCur = chargingData_1->EvBatterytargetCurrent * 10;
- if (curTargetCur [0] != chargingData_1->EvBatterytargetCurrent * 10)
- {
- curTargetCur [0] = chargingData_1->EvBatterytargetCurrent * 10;
- curAllowCount [0] = 0;
- }
- if (curAllowCount [0] < ALLOW_COUNT_MAX)
- {
- if (cur1 > targetCur + 100 || cur1 < targetCur - 100)
- {
- cur1 = targetCur;
- curAllowCount [0] ++;
- }
- else
- curAllowCount [0] = 0;
- }
- // if (ShmGBTData->ev[chargingData_2->type_index].PresentMsgFlowStatus == 10)
- // vol2 = ShmPsuData->PsuGroup[1].GroupTargetOutputVoltage;
- // else
- vol2 = chargingData_2->FireChargingVoltage;
- cur2 = (chargingData_2->PresentChargingCurrent * 10);
- if ((LogInfo [0] [EV_LOG_NOW_OUTPUT_VOL] >= vol1 + CHK_VOL_RANGE) || (LogInfo [0] [EV_LOG_NOW_OUTPUT_VOL] <= vol1 - CHK_VOL_RANGE) || (LogInfo [0] [EV_LOG_NOW_OUTPUT_CUR] >= cur1 + CHK_CUR_RANGE) || (LogInfo [0] [EV_LOG_NOW_OUTPUT_CUR] <= cur1 - CHK_CUR_RANGE) || (LogInfo [1] [EV_LOG_NOW_OUTPUT_VOL] >= vol2 + CHK_VOL_RANGE) || (LogInfo [1] [EV_LOG_NOW_OUTPUT_VOL] <= vol2 - CHK_VOL_RANGE) || (LogInfo [1] [EV_LOG_NOW_OUTPUT_CUR] >= cur2 + CHK_CUR_RANGE) || (LogInfo [1] [EV_LOG_NOW_OUTPUT_CUR] <= cur2 - CHK_CUR_RANGE))
- {
- PRINTF_FUNC ( "G1 -> Output Vol = %.1f, Output Cur = %.1f -- G2 -> Output Vol = %.1f, Output Cur = %.1f \n", vol1 / 10,
- cur1 / 10, vol2 / 10, cur2 / 10 );
- LogInfo [0] [EV_LOG_NOW_OUTPUT_VOL] = vol1;
- LogInfo [0] [EV_LOG_NOW_OUTPUT_CUR] = cur1;
- LogInfo [1] [EV_LOG_NOW_OUTPUT_VOL] = vol2;
- LogInfo [1] [EV_LOG_NOW_OUTPUT_CUR] = cur2;
- }
- targetCur = chargingData_2->EvBatterytargetCurrent * 10;
- if (curTargetCur [1] != chargingData_2->EvBatterytargetCurrent * 10)
- {
- curTargetCur [1] = chargingData_2->EvBatterytargetCurrent * 10;
- curAllowCount [1] = 0;
- }
- if (curAllowCount [1] < ALLOW_COUNT_MAX)
- {
- if (cur2 > targetCur + 100 || cur2 < targetCur - 100)
- {
- cur2 = targetCur;
- curAllowCount [1] ++;
- }
- else
- curAllowCount [1] = 0;
- }
- if ( ! _useOfflineNoCharging)
- {
- if (ShmSysConfigAndInfo->SysInfo.OcppConnStatus == NO && ShmSysConfigAndInfo->SysConfig.OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING)
- {
- PRINTF_FUNC ( "Offline Policy : No Charing... \n" );
- _useOfflineNoCharging = true;
- cur1 = cur2 = 0;
- }
- }
- else
- {
- if (ShmSysConfigAndInfo->SysInfo.OcppConnStatus == YES)
- _useOfflineNoCharging = false;
- }
- SetPresentOutputPower ( vol1, cur1, vol2, cur2 );
- }
- void SetPresentChargingOutputCap(struct ChargingInfoData *chargingData_1, struct ChargingInfoData *chargingData_2)
- {
- float pow1 = 0 , cur1 = 0;
- float pow2 = 0 , cur2 = 0;
- float vol = 0;
- pow1 = chargingData_1->AvailableChargingPower;
- cur1 = chargingData_1->AvailableChargingCurrent;
- vol = chargingData_1->MaximumChargingVoltage;
- GetMaxVolAndCurMethod ( chargingData_1->Index, & vol, & cur1 );
- GetMaxPowerMethod ( chargingData_1->Index, & pow1 );
- if (pow1 <= 0)
- cur1 = 0;
- else
- {
- if (chargingData_1->SystemStatus == SYS_MODE_CHARGING && chargingData_1->FireChargingVoltage > 1500)
- {
- float maxCur = 0;
- maxCur = (pow1 * 1000) / chargingData_1->FireChargingVoltage;
- if (maxCur * 10 <= cur1)
- {
- //PRINTF_FUNC("Gun1 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur1);
- cur1 = maxCur * 10;
- }
- }
- }
- pow2 = chargingData_2->AvailableChargingPower;
- cur2 = chargingData_2->AvailableChargingCurrent;
- vol = chargingData_2->MaximumChargingVoltage;
- GetMaxVolAndCurMethod ( chargingData_2->Index, & vol, & cur2 );
- GetMaxPowerMethod ( chargingData_2->Index, & pow2 );
- if (pow2 <= 0)
- cur2 = 0;
- else
- {
- if (chargingData_2->SystemStatus == SYS_MODE_CHARGING && chargingData_2->FireChargingVoltage > 1500)
- {
- float maxCur = 0;
- maxCur = (pow2 * 1000) / chargingData_2->FireChargingVoltage;
- if (maxCur * 10 <= cur2)
- {
- //PRINTF_FUNC("Gun2 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur2);
- cur2 = maxCur * 10;
- }
- }
- }
- if ((LogInfo [0] [EV_LOG_OUTPUT_CAP_POW] <= pow1 - 5 || LogInfo [0] [EV_LOG_OUTPUT_CAP_POW] >= pow1 + 5) || (LogInfo [0] [EV_LOG_OUTPUT_CAP_CUR] <= cur1 - 5 || LogInfo [0] [EV_LOG_OUTPUT_CAP_CUR] >= cur1 + 5) || (LogInfo [1] [EV_LOG_OUTPUT_CAP_POW] <= pow2 - 5 || LogInfo [1] [EV_LOG_OUTPUT_CAP_POW] >= pow2 + 5) || (LogInfo [1] [EV_LOG_OUTPUT_CAP_CUR] <= cur2 - 5 || LogInfo [1] [EV_LOG_OUTPUT_CAP_CUR] >= cur2 + 5))
- {
- PRINTF_FUNC ( "----------------------------------------------------- \n" );
- PRINTF_FUNC ( "To EV (Real) Power_1 = %.1f, Cur_1 = %.1f, Power_2 = %.1f, Cur_2 = %.1f \n", pow1 / 10, cur1 / 10,
- pow2 / 10, cur2 / 10 );
- PRINTF_FUNC ( "----------------------------------------------------- \n" );
- LogInfo [0] [EV_LOG_OUTPUT_CAP_POW] = pow1;
- LogInfo [0] [EV_LOG_OUTPUT_CAP_CUR] = cur1;
- LogInfo [1] [EV_LOG_OUTPUT_CAP_POW] = pow2;
- LogInfo [1] [EV_LOG_OUTPUT_CAP_CUR] = cur2;
- chargingData_1->RealMaxCurrent = cur1;
- chargingData_1->RealMaxPower = pow1;
- if (gun_count == 2)
- {
- chargingData_2->RealMaxCurrent = cur2;
- chargingData_2->RealMaxPower = pow2;
- }
- }
- SetPresentOutputCapacity ( pow1, cur1, pow2, cur2 );
- }
- void Initialization()
- {
- bool isPass = false;
- while ( ! isPass)
- {
- isPass = true;
- for (byte _index = 0; _index < gun_count; _index ++)
- {
- if ( ! FindChargingInfoData ( _index, & _chargingData [0] ))
- {
- DEBUG_ERROR( "EvComm (main) : FindChargingInfoData false \n" );
- isPass = false;
- break;
- }
- }
- sleep ( 1 );
- }
- }
- void GetMaxVolAndCurMethod(byte index, float *vol, float *cur)
- {
- if (_chargingData [index]->ConnectorMaxVoltage != 0 && _chargingData [index]->ConnectorMaxVoltage <= * vol)
- * vol = _chargingData [index]->ConnectorMaxVoltage;
- if (_chargingData [index]->ConnectorMaxCurrent != 0 && _chargingData [index]->ConnectorMaxCurrent <= * cur)
- * cur = _chargingData [index]->ConnectorMaxCurrent;
- if (((_chargingData [index]->SystemStatus >= SYS_MODE_PREPARE_FOR_EVSE && _chargingData [index]->SystemStatus <= SYS_MODE_CHARGING) || (_chargingData [index]->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && _chargingData [index]->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1)) && _chargingData [index]->ChargingProfileCurrent >= 0 && _chargingData [index]->ChargingProfileCurrent <= * cur)
- {
- * cur = _chargingData [index]->ChargingProfileCurrent;
- }
- }
- void GetMaxPowerMethod(byte index, float *pow)
- {
- if (maxChargingPow != 0 && maxChargingPow <= * pow)
- * pow = maxChargingPow;
- if (((_chargingData [index]->SystemStatus >= SYS_MODE_PREPARE_FOR_EVSE && _chargingData [index]->SystemStatus <= SYS_MODE_CHARGING) || (_chargingData [index]->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && _chargingData [index]->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1)) && (_chargingData [index]->ChargingProfilePower / 1000) >= 0 && (_chargingData [index]->ChargingProfilePower / 1000) <= * pow)
- {
- * pow = (float) (_chargingData [index]->ChargingProfilePower / 1000) * 10;
- }
- }
- time_t GetRtcInfoForEpoch()
- {
- struct timeb csuTime;
- struct tm *tmCSU;
- struct tm t;
- time_t result;
- ftime ( & csuTime );
- tmCSU = localtime ( & csuTime.time );
- t.tm_year = tmCSU->tm_year;
- t.tm_mon = tmCSU->tm_mon;
- t.tm_mday = tmCSU->tm_mday;
- t.tm_hour = tmCSU->tm_hour;
- t.tm_min = tmCSU->tm_min;
- t.tm_sec = tmCSU->tm_sec;
- t.tm_isdst = - 1;
- result = mktime ( & t );
- return result;
- }
- byte GetStopChargingReasonByEvse(byte gunIndex, byte *reason)
- {
- byte result = NO;
- if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.EmergencyStopTrip == 0x01)
- {
- // 012251
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '5';
- * (reason + 5) = '1';
- result = YES;
- }
- if (_chargingData [gunIndex]->Type == _Type_Chademo)
- {
- if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.ChaRelayDrivingFault == YES)
- {
- // 011012
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '1';
- * (reason + 3) = '0';
- * (reason + 4) = '1';
- * (reason + 5) = '2';
- result = YES;
- }
- else if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.ChaUvpFail == YES)
- {
- // 012289
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '8';
- * (reason + 5) = '9';
- result = YES;
- }
- else if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.ChaGfdTrip == YES)
- {
- // 012234
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '3';
- * (reason + 5) = '4';
- result = YES;
- }
- }
- else if (_chargingData [gunIndex]->Type == _Type_GB)
- {
- if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.GBTRelayDrivingFault == YES)
- {
- // 012290
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '9';
- * (reason + 5) = '0';
- result = YES;
- }
- else if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.GBTUvpFail == YES)
- {
- // 012290
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '9';
- * (reason + 5) = '0';
- result = YES;
- }
- else if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.GBTGfdTrip == YES)
- {
- // 012236
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '3';
- * (reason + 5) = '6';
- result = YES;
- }
- }
- else if (_chargingData [gunIndex]->Type == _Type_CCS)
- {
- if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.CCSRelayDrivingFault == YES)
- {
- // 011014
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '1';
- * (reason + 3) = '0';
- * (reason + 4) = '1';
- * (reason + 5) = '4';
- result = YES;
- }
- else if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.CCSUvpFail == YES)
- {
- // 012288
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '8';
- * (reason + 5) = '8';
- result = YES;
- }
- else if (ShmDcCommonData->ConnectErrList [gunIndex].GunBits.CCSGfdTrip == YES)
- {
- // 012235
- * (reason + 0) = '0';
- * (reason + 1) = '1';
- * (reason + 2) = '2';
- * (reason + 3) = '2';
- * (reason + 4) = '3';
- * (reason + 5) = '5';
- result = YES;
- }
- }
- return result;
- }
- void SendCommunicationOnly(byte index)
- {
- byte targetID = _chargingData [index]->Evboard_id;
- if (gun_count == 1 && _chargingData [index]->Type == _Type_CCS && ShmDcCommonData->CcsVersion == _CCS_VERSION_CHECK_TAG_V015S0)
- {
- targetID += 1;
- }
- SetChargingPermission ( index, COMMUNICATION, _chargingData [index]->AvailableChargingPower, 0, 0, targetID );
- }
- void SendStopOnly(byte index)
- {
- byte targetID = _chargingData [index]->Evboard_id;
- if (gun_count == 1 && _chargingData [index]->Type == _Type_CCS && ShmDcCommonData->CcsVersion == _CCS_VERSION_CHECK_TAG_V015S0)
- {
- targetID += 1;
- }
- SetChargingPermission ( index, STOP, _chargingData [index]->AvailableChargingPower, 0, 0, targetID );
- }
- void InitialConnectorStatus(byte index)
- {
- SetChargingPermission ( index, INITIALIZATION, 0, 0, 0, _chargingData [index]->Evboard_id );
- }
- void FormatVoltageAndCurrent()
- {
- char isLowCur = 0x00;
- char EvsePower [2];
- EvsePower [2] = '\0';
- if (strlen ( (char *) ShmSysConfigAndInfo->SysConfig.ModelName ) >= 6)
- {
- strncpy ( EvsePower, (char *) (ShmSysConfigAndInfo->SysConfig.ModelName + 4), 2 );
- if (strcmp ( EvsePower, "30" ) == EQUAL)
- {
- isLowCur = 0x00;
- }
- else if (strcmp ( EvsePower, "60" ) == EQUAL)
- {
- isLowCur = 0x01;
- }
- else
- {
- // 60KW 以上的系統
- isLowCur = 0x02;
- }
- }
- for (byte _index = 0; _index < gun_count; _index ++)
- {
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- if (ShmDcCommonData->chargerType == CHARGER_TYPE_STANDARD)
- _chargingData [_index]->ConnectorMaxVoltage = Chademo_Standard;
- else
- _chargingData [_index]->ConnectorMaxVoltage = Chademo_Simple;
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- if (ShmDcCommonData->chargerType == CHARGER_TYPE_STANDARD)
- _chargingData [_index]->ConnectorMaxVoltage = CCS_Standard;
- else
- _chargingData [_index]->ConnectorMaxVoltage = CCS_Simple;
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- if (ShmDcCommonData->chargerType == CHARGER_TYPE_STANDARD)
- _chargingData [_index]->ConnectorMaxVoltage = GB_Standard;
- else
- _chargingData [_index]->ConnectorMaxVoltage = GB_Simple;
- }
- if (isLowCur == 0x00)
- {
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 600;
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- if (_chargingData [_index]->ModelType == 'M' || _chargingData [_index]->ModelType == 'N')
- _chargingData [_index]->ConnectorMaxCurrent = 800;
- else
- _chargingData [_index]->ConnectorMaxCurrent = 600;
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 800;
- }
- }
- else if (isLowCur == 0x01)
- {
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 1200;
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 1200;
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 1200;
- }
- }
- else
- {
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 1200;
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 2000;
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- _chargingData [_index]->ConnectorMaxCurrent = 2500;
- }
- }
- }
- if (ShmDcCommonData->chargerType == CHARGER_TYPE_SIMPLE && strcmp ( EvsePower, "18" ) == EQUAL)
- {
- // 簡易版且180KW -> 限制最小輸出電流 50A
- ShmDcCommonData->minOutputCur = 50;
- }
- }
- // 如果是使用 Meter 計算的話
- void CalOutputPowerAndEnergy(int _index)
- {
- if (ShmSysConfigAndInfo->SysConfig.ModelName [3] == 'M' || ShmSysConfigAndInfo->SysConfig.ModelName [3] == 'L')
- {
- // AC Meter
- //printf("(%d), totalChargingValue = %f \n", _index, ShmCsuMeterData->_meter[_index]._curTotalCharging / 100);
- float totalChargingValue = ShmCsuMeterData->_meter [_index]._curTotalCharging / 100;
- if (totalChargingValue > _chargingData [_index]->PresentChargedEnergy)
- {
- ShmDcCommonData->energy_time_period [_index] [ShmDcCommonData->_hour_index] += totalChargingValue - _chargingData [_index]->PresentChargedEnergy;
- _chargingData [_index]->PowerConsumption += totalChargingValue - _chargingData [_index]->PresentChargedEnergy;
- }
- _chargingData [_index]->PresentChargedEnergy = totalChargingValue;
- if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
- {
- if (strcmp ( (char *) ShmSysConfigAndInfo->SysConfig.OcppServerURL, "" ) == EQUAL || strcmp (
- (char *) ShmSysConfigAndInfo->SysConfig.ChargeBoxId, "" ) == EQUAL)
- _chargingData [_index]->ChargingFee = totalChargingValue * ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee;
- }
- }
- else if (ShmSysConfigAndInfo->SysConfig.ModelName [3] == 'P')
- {
- // DC Meter
- if (ShmCsuMeterData->_meter [_index].curMeterValue == 0)
- ShmCsuMeterData->_meter [_index].curMeterValue = ShmSysConfigAndInfo->SysInfo.DcMeterInfo [_index].totlizeImportEnergy;
- else
- {
- if (ShmSysConfigAndInfo->SysInfo.DcMeterInfo [_index].totlizeImportEnergy > ShmCsuMeterData->_meter [_index].curMeterValue)
- {
- ShmCsuMeterData->_meter [_index]._curTotalCharging += ShmSysConfigAndInfo->SysInfo.DcMeterInfo [_index].totlizeImportEnergy - ShmCsuMeterData->_meter [_index].curMeterValue;
- float totalChargingValue = ShmCsuMeterData->_meter [_index]._curTotalCharging;
- if (totalChargingValue > _chargingData [_index]->PresentChargedEnergy)
- {
- ShmDcCommonData->energy_time_period [_index] [ShmDcCommonData->_hour_index] += totalChargingValue - _chargingData [_index]->PresentChargedEnergy;
- _chargingData [_index]->PowerConsumption += totalChargingValue - _chargingData [_index]->PresentChargedEnergy;
- }
- _chargingData [_index]->PresentChargedEnergy = totalChargingValue;
- if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
- {
- if (strcmp ( (char *) ShmSysConfigAndInfo->SysConfig.OcppServerURL, "" ) == EQUAL || strcmp (
- (char *) ShmSysConfigAndInfo->SysConfig.ChargeBoxId, "" ) == EQUAL)
- _chargingData [_index]->ChargingFee = totalChargingValue * ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee;
- }
- ShmCsuMeterData->_meter [_index].curMeterValue = ShmSysConfigAndInfo->SysInfo.DcMeterInfo [_index].totlizeImportEnergy;
- }
- }
- }
- else
- {
- if (chargingTime [_index] == 0 || chargingTime [_index] > _chargingData [_index]->PresentChargedDuration)
- {
- chargingTime [_index] = _chargingData [_index]->PresentChargedDuration;
- }
- else
- {
- int passTime = _chargingData [_index]->PresentChargedDuration - chargingTime [_index];
- if (passTime > 0)
- {
- float changingPow = (_chargingData [_index]->PresentChargingPower) * passTime / 3600;
- if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
- {
- ShmDcCommonData->energy_time_period [_index] [ShmDcCommonData->_hour_index] += changingPow;
- if (strcmp ( (char *) ShmSysConfigAndInfo->SysConfig.OcppServerURL, "" ) == EQUAL || strcmp (
- (char *) ShmSysConfigAndInfo->SysConfig.ChargeBoxId, "" ) == EQUAL)
- _chargingData [_index]->ChargingFee += changingPow * ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee;
- }
- _chargingData [_index]->PowerConsumption += changingPow;
- _chargingData [_index]->PresentChargedEnergy += changingPow;
- chargingTime [_index] = _chargingData [_index]->PresentChargedDuration;
- }
- }
- }
- }
- void ConnectorOTP(byte _index)
- {
- bool isOTP = false;
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- if (ShmDcCommonData->ConnectErrList [_index].GunBits.ChaConnectOTP)
- isOTP = true;
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- if (ShmDcCommonData->ConnectErrList [_index].GunBits.CCSConnectOTP)
- isOTP = true;
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- if (ShmDcCommonData->ConnectErrList [_index].GunBits.GBTConnectOTP)
- isOTP = true;
- }
- if (isOTP)
- {
- if (gunTempAllowCount [_index] >= 2)
- _chargingData [_index]->StopChargeFlag = YES;
- else
- gunTempAllowCount [_index] += 1;
- }
- else
- gunTempAllowCount [_index] = 0;
- }
- void OfferCurrentAndPowerRecord(byte _index)
- {
- unsigned short maxCurBuf = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
- unsigned short maxPowBuf = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
- if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
- {
- maxCurBuf /= 2;
- maxPowBuf /= 2;
- }
- if (_chargingData [_index]->ConnectorMaxCurrent > 0)
- {
- if (maxCurBuf == 0)
- _chargingData [_index]->CurrentOffered = _chargingData [_index]->ConnectorMaxCurrent;
- else
- _chargingData [_index]->ConnectorMaxCurrent >= maxCurBuf ? (_chargingData [_index]->CurrentOffered = maxCurBuf) : (_chargingData [_index]->CurrentOffered = _chargingData [_index]->ConnectorMaxCurrent);
- }
- else
- _chargingData [_index]->CurrentOffered = 0;
- if (ShmPsuData->PsuGroup [_index].GroupAvailablePower > 0)
- {
- if (maxPowBuf == 0)
- _chargingData [_index]->PowerOffered = ShmPsuData->PsuGroup [_index].GroupAvailablePower;
- else
- _chargingData [_index]->ConnectorMaxCurrent >= maxPowBuf ? (_chargingData [_index]->PowerOffered = maxPowBuf) : (_chargingData [_index]->PowerOffered = ShmPsuData->PsuGroup [_index].GroupAvailablePower);
- }
- else
- _chargingData [_index]->PowerOffered = 0;
- }
- bool CheckDebugInfoTimeout(byte index, byte timeout)
- {
- int _timebuf = 0;
- struct timespec *Timer = NULL;
- if (index == 0)
- Timer = & ShmDcCommonData->DbgInfo.Timer_0;
- else if (index == 1)
- Timer = & ShmDcCommonData->DbgInfo.Timer_1;
- else if (index == 2)
- Timer = & ShmDcCommonData->DbgInfo.Timer_2;
- else if (index == 3)
- Timer = & ShmDcCommonData->DbgInfo.Timer_3;
- else if (index == 4)
- Timer = & ShmDcCommonData->DbgInfo.Timer_4;
- _timebuf = GetTimeoutValue ( Timer );
- if (_timebuf < 0)
- GetTimespecFunc ( Timer );
- else
- {
- if (_timebuf >= timeout)
- {
- GetTimespecFunc ( Timer );
- return TRUE;
- }
- }
- return FALSE;
- }
- int main(int argc, char *argv [])
- {
- if (InitShareMemory () == FAIL)
- {
- #ifdef SystemLogMessage
- DEBUG_ERROR( "InitShareMemory NG\n" );
- #endif
- if (ShmStatusCodeData != NULL)
- {
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
- }
- sleep ( 5 );
- return 0;
- }
- gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
- Initialization ();
- // 根據輸出能量與槍別給予當前最大耐壓耐流
- FormatVoltageAndCurrent ();
- CanFd = InitCanBus ();
- CANReceiver ();
- byte priorityLow = 1;
- time_t rtc = GetRtcInfoForEpoch ();
- for (byte _index = 0; _index < gun_count; _index ++)
- {
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- PRINTF_FUNC ( "Conn %d (Chademo), MaxVol = %f, MaxCur = %f \n", _index, _chargingData [_index]->ConnectorMaxVoltage,
- _chargingData [_index]->ConnectorMaxCurrent );
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- PRINTF_FUNC ( "Conn %d (CCS), MaxVol = %f, MaxCur = %f \n", _index, _chargingData [_index]->ConnectorMaxVoltage,
- _chargingData [_index]->ConnectorMaxCurrent );
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- PRINTF_FUNC ( "Conn %d (GBT), MaxVol = %f, MaxCur = %f \n", _index, _chargingData [_index]->ConnectorMaxVoltage,
- _chargingData [_index]->ConnectorMaxCurrent );
- }
- }
- int _timeBuf = 0;
- while (CanFd)
- {
- for (byte _index = 0; _index < gun_count; _index ++)
- {
- byte targetID = _chargingData [_index]->Evboard_id;
- if (gun_count == 1 && _chargingData [_index]->Type == _Type_CCS && ShmDcCommonData->CcsVersion == _CCS_VERSION_CHECK_TAG_V015S0)
- {
- targetID += 1;
- }
- if (priorityLow == 1)
- {
- // 優先權較低 - 只要有回應即不會再詢問
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- if (ShmCHAdeMOData->evse [_chargingData [_index]->type_index].SelfTest_Comp != PASS)
- {
- if (rtcChkCount == 0)
- SyncRtcInfo ( _index, _chargingData [_index]->Evboard_id, (int) rtc );
- GetFirmwareVersion ( _index, _chargingData [_index]->Evboard_id );
- }
- if (ShmDcCommonData->evBoardResetFlag)
- InitialConnectorStatus ( _index );
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- if (ShmGBTData->evse [_chargingData [_index]->type_index].SelfTest_Comp != PASS)
- {
- if (rtcChkCount == 0)
- SyncRtcInfo ( _index, _chargingData [_index]->Evboard_id, (int) rtc );
- GetFirmwareVersion ( _index, _chargingData [_index]->Evboard_id );
- }
- if (ShmDcCommonData->evBoardResetFlag)
- InitialConnectorStatus ( _index );
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121 && ShmCcsData->V2GMessage_DIN70121 [_chargingData [_index]->type_index].SelfTest_Comp != PASS)
- {
- if (rtcChkCount == 0)
- SyncRtcInfo ( _index, targetID, (int) rtc );
- GetFirmwareVersion ( _index, targetID );
- SetConnectInfo ( ShmDcCommonData->CcsTypeSaved [_index], targetID );
- }
- }
- if (rtcChkCount >= 2)
- rtcChkCount = 0;
- else
- rtcChkCount ++;
- // 固定要取得的資訊 : 1.槍鎖狀態, 2."Connector 1" 溫度, 3."Connector 2" 溫度, 4.Pilot Voltage
- //PRINTF_FUNC("GetMiscellaneousInfo. index = %d, Eid = %d \n", _index, _chargingData[_index]->Evboard_id);
- GetMiscellaneousInfo ( _index, _chargingData [_index]->RelayK1K2Status,
- _chargingData [_index]->PresentChargedEnergy, (_chargingData [_index]->PresentChargingVoltage * 10),
- targetID );
- ConnectorOTP ( _index );
- OfferCurrentAndPowerRecord ( _index );
- }
- switch (_chargingData [_index]->SystemStatus)
- {
- case SYS_MODE_IDLE :
- case SYS_MODE_RESERVATION :
- if (_chargingData [_index]->Type == _Type_Chademo)
- {
- ClearAbnormalStatus_Chademo ( _index );
- if (ShmSysConfigAndInfo->SysInfo.PageIndex == _LCM_WAIT_FOR_PLUG || ShmDcCommonData->_cha_try_communication [_index].try2CommunicationFlag)
- {
- if ( ! chkChademoPermission [_index])
- {
- chkChademoPermission [_index] = true;
- GetTimespecFunc ( & _chk_chademo_permission_timeout [_index] );
- SendStopOnly ( _index );
- chkChademoPermissionSend [_index] = NO;
- }
- else
- {
- _timeBuf = GetTimeoutValue ( & _chk_chademo_permission_timeout [_index] );
- if (_timeBuf < 0)
- GetTimespecFunc ( & _chk_chademo_permission_timeout [_index] );
- else
- {
- if (_timeBuf > 2)
- {
- if (chkChademoPermissionSend [_index] == NO)
- {
- chkChademoPermissionSend [_index] = YES;
- SendCommunicationOnly ( _index );
- }
- if (_timeBuf > 10)
- {
- chkChademoPermissionSend [_index] = NO;
- GetTimespecFunc ( & _chk_chademo_permission_timeout [_index] );
- }
- }
- }
- }
- }
- else if (chkChademoPermission [_index])
- {
- chkChademoPermission [_index] = false;
- //SendStopOnly(_index);
- }
- if (ShmDcCommonData->ConnectErrList [_index].GunBits.ChaConnectOTP == NO)
- _chargingData [_index]->StopChargeFlag = NO;
- }
- else if (_chargingData [_index]->Type == _Type_GB)
- {
- ClearAbnormalStatus_GB ( _index );
- if (ShmDcCommonData->ConnectErrList [_index].GunBits.GBTConnectOTP == NO)
- _chargingData [_index]->StopChargeFlag = NO;
- }
- else if (_chargingData [_index]->Type == _Type_CCS)
- {
- ClearAbnormalStatus_CCS ( _index );
- if (ShmDcCommonData->ConnectErrList [_index].GunBits.CCSConnectOTP == NO)
- _chargingData [_index]->StopChargeFlag = NO;
- }
- if (priorityLow == 1)
- {
- _chargingData [_index]->PresentChargedEnergy = 0;
- _chargingData [_index]->PresentChargingPower = 0;
- _chargingData [_index]->GroundFaultStatus = GFD_WAIT;
- _chargingData [_index]->RealRatingPower = 0;
- _chargingData [_index]->NormalStopChargeFlag = NO;
- _chargingData [_index]->ChargingFee = 0.0;
- _chargingData [_index]->EvBatterySoc = 0;
- _chargingData [_index]->EvBatteryStartSoc = 0;
- _chargingData [_index]->EvBatteryMaxVoltage = 0;
- _chargingData [_index]->ChargingProfilePower = - 1;
- _chargingData [_index]->ChargingProfileCurrent = - 1;
- curAllowCount [_index] = 0;
- curTargetCur [_index] = 0;
- if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
- {
- _chargingData [_index]->PresentChargingVoltage = 0;
- _chargingData [_index]->PresentChargingCurrent = 0;
- }
- chargingTime [_index] = 0;
- SendErrorCount [_index] = 0;
- // 使用 Meter 狀況
- if (ShmSysConfigAndInfo->SysConfig.ModelName [3] == 'M' || ShmSysConfigAndInfo->SysConfig.ModelName [3] == 'L')
- {
- if (ShmCsuMeterData->_meter [_index].isCalculation == NO)
- {
- if (ShmCsuMeterData->_meter [_index].curMeterValue != 0 || ShmCsuMeterData->_meter [_index]._chargingValue != 0 || ShmCsuMeterData->_meter [_index]._curTotalCharging != 0)
- {
- ShmCsuMeterData->_meter [_index].curMeterValue = 0;
- ShmCsuMeterData->_meter [_index]._chargingValue = 0;
- ShmCsuMeterData->_meter [_index]._curTotalCharging = 0;
- }
- }
- }
- //maxChargingPow = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
- // ShmPsuData->SystemAvailablePower 已是 * 10
- maxChargingPow = ShmPsuData->SystemAvailablePower;
- if (ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10 != 0 && ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10 < maxChargingPow)
- maxChargingPow = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
- LogInfo [_index] [EV_LOG_EVSE_MAX_VOL] = 0;
- LogInfo [_index] [EV_LOG_EVSE_MAX_CUR] = 0;
- LogInfo [_index] [EV_LOG_MAX_BATT_VOL] = 0;
- LogInfo [_index] [EV_LOG_REAL_CAP_POW] = 0;
- LogInfo [_index] [EV_LOG_SOC] = 0;
- if (gun_count == 1)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [1] );
- }
- break;
- case SYS_MODE_PREPARING :
- {
- chkChademoPermission [_index] = false;
- // 設定當前輸出
- if (gun_count == 1)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [1] );
- }
- break;
- case SYS_MODE_PREPARE_FOR_EV :
- {
- //LWN_Zanobe
- if (ShmDcCommonData->startTransactionFlag [_index] == START_TRANSATION_STATUS_WAIT)
- {
- //AuthorisationMode = AUTH_MODE_ENABLE.
- //AuthorisationMode = AUTH_MODE_DISABLE & alreay to get the EVCCID.
- if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode != AUTH_MODE_DISABLE
- || (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE
- && strcmp ( (char *) _chargingData [_index]->EVCCID, "" ) != EQUAL
- && ShmDcCommonData->PlugAndCharge_AuthStatus == _LCM_AUTHORIZ_COMP
- && ShmSysConfigAndInfo->SysInfo.OcppConnStatus == YES))
- {
- if (CheckDebugInfoTimeout ( 0, 5 )) //print info per 5 sec
- PRINTF_FUNC ( " Start Transaction Status Wait ... \n" );
- continue;
- }
- }
- // 開始確認車端是否同意開始充電 : 1.SOC, 2.Target Vol, 3.Target Cur, 4.Charging remaining time
- GetOutputReq ( _index, targetID );
- // 設定當前輸出
- if (gun_count == 1)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [1] );
- if (priorityLow == 1)
- {
- float maxVol , maxCur;
- // 樁端輸出能力
- maxVol = _chargingData [_index]->MaximumChargingVoltage;
- maxCur = _chargingData [_index]->AvailableChargingCurrent;
- GetMaxVolAndCurMethod ( _index, & maxVol, & maxCur );
- if (LogInfo [_index] [EV_LOG_EVSE_MAX_VOL] != maxVol || LogInfo [_index] [EV_LOG_EVSE_MAX_CUR] != maxCur)
- {
- LogInfo [_index] [EV_LOG_EVSE_MAX_VOL] = maxVol;
- LogInfo [_index] [EV_LOG_EVSE_MAX_CUR] = maxCur;
- PRINTF_FUNC ( "To EV_%d Max_Vol = %.1f, Cap_Cur = %.1f, Cap_Pow = %.1f \n", _index, maxVol / 10,
- maxCur / 10, _chargingData [_index]->AvailableChargingPower / 10 );
- }
- _chargingData [_index]->RealMaxVoltage = maxVol;
- if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode != AUTH_MODE_DISABLE)
- {
- SetChargingPermission ( _index, START, _chargingData [_index]->AvailableChargingPower, maxCur, maxVol,
- targetID );
- if (_chargingData [_index]->Type == _Type_CCS)
- GetEvccIdReq ( _index, _chargingData [_index]->Evboard_id );
- }
- else //AUTH_MODE_DISABLE
- {
- //LWN_Zanobe
- //Not yet to get the EVCCID.
- //if (strcmp ( (char *) _chargingData [_index]->StartUserId, "" ) == EQUAL
- if (ShmDcCommonData->PlugAndCharge_AuthStatus == _LCM_NONE //LWADD
- && strcmp ( (char *) _chargingData [_index]->EVCCID, "" ) == EQUAL)
- {
- //Ask for the EVCCID, and send to the Backend for authorizing.
- if (CheckDebugInfoTimeout ( 0, 8 )) //print info per 5 sec
- PRINTF_FUNC ( " *********** COMMUNICATION (%d)*********** \n", _index );
- GetEvccIdReq ( _index, _chargingData [_index]->Evboard_id );
- SetChargingPermission ( _index, COMMUNICATION, _chargingData [_index]->AvailableChargingPower,
- maxCur, maxVol, targetID );
- }
- else
- {
- //The EVCCID was already to authorize.
- if (ShmDcCommonData->PlugAndCharge_AuthStatus == _LCM_AUTHORIZ_COMP) //LWADD
- {
- PRINTF_FUNC ( " *********** START (%d)*********** \n", _index );
- SetChargingPermission ( _index, START, _chargingData [_index]->AvailableChargingPower, maxCur,
- maxVol, targetID );
- }
- else //LWADD
- {
- //LWDEBUG
- if (ShmDcCommonData->PlugAndCharge_AuthStatus == _LCM_AUTHORIZING)
- {
- if (CheckDebugInfoTimeout ( 1, 8 )) //print info per 8 sec
- PRINTF_FUNC ( " [LWTEST] EVCCID %s |AuthStatu = _LCM_AUTHORIZING \n",
- _chargingData [_index]->EVCCID );
- }
- else if (ShmDcCommonData->PlugAndCharge_AuthStatus == _LCM_NONE)
- {
- if (CheckDebugInfoTimeout ( 1, 8 )) //print info per 8 sec
- PRINTF_FUNC ( " [LWTEST] EVCCID %s |AuthStatu = _LCM_NONE \n",
- _chargingData [_index]->EVCCID );
- }
- else
- {
- if (CheckDebugInfoTimeout ( 1, 8 )) //print info per 8 sec
- PRINTF_FUNC ( " [LWTEST] EVCCID %s |AuthStatu = %u\n",
- _chargingData [_index]->EVCCID,
- ShmDcCommonData->PlugAndCharge_AuthStatus );
- }
- }
- }
- }
- // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
- GetEvBatteryInfo ( _index, targetID );
- }
- GetTimespecFunc ( & _chk_ratingPower_timeout [_index] );
- }
- break;
- case SYS_MODE_PREPARE_FOR_EVSE :
- case SYS_MODE_CCS_PRECHARGE_STEP0 :
- case SYS_MODE_CCS_PRECHARGE_STEP1 :
- {
- // 開始確認車端是否同意開始充電
- GetOutputReq ( _index, targetID );
- // 設定當前輸出
- if (gun_count == 1)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [1] );
- if (priorityLow % 5 == 1)
- {
- if (_chargingData [_index]->Type == _Type_CCS)
- GetEvccIdReq ( _index, _chargingData [_index]->Evboard_id );
- // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
- GetEvBatteryInfo ( _index, targetID );
- // 樁端輸出能力改變
- if (gun_count == 1)
- SetPresentChargingOutputCap ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputCap ( _chargingData [0], _chargingData [1] );
- }
- if (LogInfo [_index] [EV_LOG_MAX_BATT_VOL] != _chargingData [_index]->EvBatteryMaxVoltage)
- {
- LogInfo [_index] [EV_LOG_MAX_BATT_VOL] = _chargingData [_index]->EvBatteryMaxVoltage;
- PRINTF_FUNC ( "index = %d, Ev Maximum Battery Voltage = %f \n", _index,
- _chargingData [_index]->EvBatteryMaxVoltage );
- }
- if (LogInfo [_index] [EV_LOG_SOC] != _chargingData [_index]->EvBatterySoc)
- {
- LogInfo [_index] [EV_LOG_SOC] = _chargingData [_index]->EvBatterySoc;
- PRINTF_FUNC ( "index = %d, SOC = %d \n", _index, _chargingData [_index]->EvBatterySoc );
- }
- // 持續通知 Isolation 測試狀態
- if (priorityLow == 1)
- {
- // 拉 500 V 如果在一秒鐘內 GFD 都符合則 PASS
- // if (_chargingData[_index]->FireChargingVoltage >= 3500)
- // _chargingData[_index]->GroundFaultStatus = GFD_PASS;
- //PRINTF_FUNC("To EV_%d GFD = %d \n", _index, _chargingData[_index]->GroundFaultStatus);
- //if(_chargingData[_index]->GroundFaultStatus != GFD_WAIT)
- {
- //if ((GetTimeoutValue(_derating_time) / 1000) > 1000)
- unsigned char _result = _chargingData [_index]->GroundFaultStatus;
- // GB & Chademo ~ Warning 也先算 Pass,因為 CCS 認證會驗 Warning 故不可更動
- if (_chargingData [_index]->Type == _Type_Chademo || _chargingData [_index]->Type == _Type_GB)
- {
- if (_result == GFD_WARNING)
- {
- _result = GFD_PASS;
- }
- }
- if (_result == GFD_WARNING || _result == GFD_PASS)
- {
- _timeBuf = GetTimeoutValue ( & _chk_ratingPower_timeout [_index] );
- if (_timeBuf < 0)
- {
- GetTimespecFunc ( & _chk_ratingPower_timeout [_index] );
- }
- else
- {
- if ((_timeBuf > 12 && _chargingData [_index]->RealRatingPower > 0) || _timeBuf > 14)
- {
- if (LogInfo [_index] [EV_LOG_REAL_CAP_POW] != _chargingData [_index]->RealRatingPower)
- {
- LogInfo [_index] [EV_LOG_REAL_CAP_POW] = _chargingData [_index]->RealRatingPower;
- PRINTF_FUNC ( "Conn %d, RealRatingPower = %d \n", _index,
- _chargingData [_index]->RealRatingPower );
- }
- }
- else
- _result = GFD_WAIT;
- }
- }
- SetIsolationStatus ( _index, _result, targetID );
- }
- if (_chargingData [_index]->SystemStatus == SYS_MODE_CCS_PRECHARGE_STEP0 && _chargingData [_index]->PrechargeStatus == PRECHARGE_READY)
- {
- SetEvsePrechargeInfo ( _index, PRECHARGE_PRERELAY_PASS, targetID );
- }
- }
- }
- break;
- case SYS_MODE_CHARGING :
- {
- // 當前 Power
- float powBuf = ((float) ((_chargingData [_index]->PresentChargingVoltage) * (_chargingData [_index]->PresentChargingCurrent)) / 1000);
- if (powBuf >= (_chargingData [_index]->RealMaxPower / 10) - 1.5)
- powBuf = _chargingData [_index]->RealMaxPower / 10;
- _chargingData [_index]->PresentChargingPower = powBuf;
- CalOutputPowerAndEnergy ( _index );
- // 開始確認車端是否同意開始充電
- GetOutputReq ( _index, targetID );
- if (LogInfo [_index] [EV_LOG_MAX_BATT_VOL] != _chargingData [_index]->EvBatteryMaxVoltage)
- {
- LogInfo [_index] [EV_LOG_MAX_BATT_VOL] = _chargingData [_index]->EvBatteryMaxVoltage;
- PRINTF_FUNC ( "index = %d, Ev Maximum Battery Voltage = %f \n", _index,
- _chargingData [_index]->EvBatteryMaxVoltage );
- }
- if (LogInfo [_index] [EV_LOG_SOC] != _chargingData [_index]->EvBatterySoc)
- {
- LogInfo [_index] [EV_LOG_SOC] = _chargingData [_index]->EvBatterySoc;
- PRINTF_FUNC ( "index = %d, SOC = %d \n", _index, _chargingData [_index]->EvBatterySoc );
- }
- // 設定當前輸出
- if (gun_count == 1)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [1] );
- // for test end
- if (priorityLow % 5 == 0)
- {
- // 樁端輸出能力改變
- if (gun_count == 1)
- SetPresentChargingOutputCap ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputCap ( _chargingData [0], _chargingData [1] );
- }
- // GFD 失敗再通知
- if (_chargingData [_index]->GroundFaultStatus == GFD_FAIL || _chargingData [_index]->Type == _Type_CCS)
- {
- SetIsolationStatus ( _index, _chargingData [_index]->GroundFaultStatus, targetID );
- }
- if (priorityLow == 1)
- {
- if (_chargingData [_index]->Type == _Type_CCS && _chargingData [_index]->PrechargeStatus == PRECHARGE_READY)
- {
- SetEvsePrechargeInfo ( _index, PRECHARGE_CHARELAY_PASS, targetID );
- }
- // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
- GetEvBatteryInfo ( _index, targetID );
- }
- }
- break;
- case SYS_MODE_ALARM :
- case SYS_MODE_TERMINATING :
- {
- // 當前 Power
- _chargingData [_index]->PresentChargingPower = ((float) ((_chargingData [_index]->PresentChargingVoltage) * (_chargingData [_index]->PresentChargingCurrent)) / 1000);
- CalOutputPowerAndEnergy ( _index );
- // 設定當前輸出
- if (gun_count == 1)
- {
- if (_chargingData [0]->FireChargingVoltage <= 500)
- _chargingData [0]->PresentChargingCurrent = 0;
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [0] );
- }
- else if (gun_count == 2)
- {
- if (_chargingData [0]->FireChargingVoltage <= 500)
- _chargingData [0]->PresentChargingCurrent = 0;
- if (_chargingData [1]->FireChargingVoltage <= 500)
- _chargingData [1]->PresentChargingCurrent = 0;
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [1] );
- }
- // 槍鎖還在,則代表是樁端要求的停止
- if (SendErrorCount [_index] < 3 && (_chargingData [_index]->GunLocked == START || _chargingData [_index]->Type == _Type_CCS))
- {
- byte normalStop = 0x01;
- byte stopReason [7] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- if (GetStopChargingReasonByEvse ( _index, stopReason ))
- {
- normalStop = 0x02;
- }
- if (SendErrorCount [_index] == 0)
- {
- if (normalStop == 0x01)
- PRINTF_FUNC ( "EVSE : Normal Stop (%d). \n", _index );
- else
- PRINTF_FUNC ( "EVSE : EMC Stop : (%d) - (%s) \n", _index, stopReason );
- }
- EvseStopChargingEvent ( normalStop, stopReason, targetID );
- SendErrorCount [_index] += 1;
- }
- if (_chargingData [_index]->Type == _Type_CCS)
- {
- SetIsolationStatus ( _index, _chargingData [_index]->GroundFaultStatus, targetID );
- }
- GetOutputReq ( _index, targetID );
- if (_chargingData [_index]->SystemStatus == SYS_MODE_ALARM)
- {
- if (priorityLow == 1)
- {
- float maxVol , maxCur;
- // 樁端輸出能力
- maxVol = _chargingData [_index]->MaximumChargingVoltage;
- maxCur = _chargingData [_index]->AvailableChargingCurrent;
- GetMaxVolAndCurMethod ( _index, & maxVol, & maxCur );
- SetChargingPermission ( _index, STOP, _chargingData [_index]->AvailableChargingPower, maxCur, maxVol,
- targetID );
- }
- }
- }
- break;
- case SYS_MODE_COMPLETE :
- {
- // 設定當前輸出
- if (gun_count == 1)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [0] );
- else if (gun_count == 2)
- SetPresentChargingOutputPower ( _chargingData [0], _chargingData [1] );
- if (priorityLow == 1)
- {
- float maxVol , maxCur;
- // 樁端輸出能力
- maxVol = _chargingData [_index]->MaximumChargingVoltage;
- maxCur = _chargingData [_index]->AvailableChargingCurrent;
- GetMaxVolAndCurMethod ( _index, & maxVol, & maxCur );
- SetChargingPermission ( _index, STOP, _chargingData [_index]->AvailableChargingPower, maxCur, maxVol,
- targetID );
- }
- }
- break;
- }
- }
- priorityLow >= 20 ? priorityLow = 1 : priorityLow ++;
- usleep ( 45000 ); //EV 小板通訊 (50 ms)
- }
- DEBUG_INFO( "Module_EvComm : Can-bus port = %d \n", CanFd );
- return FAIL;
- }
|