WebService.c 194 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439
  1. #include <sys/time.h>
  2. #include <sys/timeb.h>
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5. #include <sys/types.h>
  6. #include <sys/ioctl.h>
  7. #include <sys/socket.h>
  8. #include <sys/ipc.h>
  9. #include <sys/shm.h>
  10. #include <sys/shm.h>
  11. #include <sys/mman.h>
  12. #include <linux/wireless.h>
  13. #include <arpa/inet.h>
  14. #include <netinet/in.h>
  15. #include <unistd.h>
  16. #include <stdarg.h>
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <unistd.h>
  20. #include <fcntl.h>
  21. #include <termios.h>
  22. #include <errno.h>
  23. #include <errno.h>
  24. #include <string.h>
  25. #include <time.h>
  26. #include <ctype.h>
  27. #include <ifaddrs.h>
  28. #include <math.h>
  29. #include "define.h"
  30. #include "json.h"
  31. #ifdef DO360
  32. #include "../Projects/DO360/Apps/Config.h"
  33. #endif
  34. #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  35. #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  36. #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  37. #define Debug
  38. #define SystemLogMessage
  39. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  40. #define PASS 1
  41. #define FAIL -1
  42. #define MtdBlockSize 0x300000
  43. struct SysConfigAndInfo *ShmSysConfigAndInfo;
  44. struct StatusCodeData *ShmStatusCodeData;
  45. struct CHAdeMOData *ShmCHAdeMOData;
  46. struct GBTData *ShmGBTData;
  47. struct CcsData *ShmCcsData;
  48. struct PsuData *ShmPsuData;
  49. struct PrimaryMcuData *ShmPrimaryMcuData;
  50. struct OCPP16Data *ShmOCPP16Data;
  51. struct OCPP20Data *ShmOCPP20Data;
  52. #ifdef DO360
  53. ChargerInfoData *ShmChargerInfo;
  54. struct ChargingInfoData *_chargingData[4];
  55. #endif
  56. void trim(char *s);
  57. int mystrcmp(char *p1, char *p2);
  58. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
  59. void split(char **arr, char *str, const char *del);
  60. #ifdef SystemLogMessage
  61. int StoreLogMsg(const char *fmt, ...) {
  62. char Buf[4096 + 256];
  63. char buffer[4096];
  64. time_t CurrentTime;
  65. struct tm *tm;
  66. va_list args;
  67. va_start(args, fmt);
  68. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  69. va_end(args);
  70. memset(Buf, 0, sizeof(Buf));
  71. CurrentTime = time(NULL);
  72. tm = localtime(&CurrentTime);
  73. sprintf(Buf,
  74. "echo \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
  75. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  76. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  77. system(Buf);
  78. #ifdef Debug
  79. printf("[%04d.%02d.%02d %02d:%02d:%02d] - %s", tm->tm_year + 1900,
  80. tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
  81. buffer);
  82. #endif
  83. return rc;
  84. }
  85. int WriteLogMsg(const char *fmt, ...) {
  86. char Buf[4096 + 256];
  87. char buffer[4096];
  88. time_t CurrentTime;
  89. struct tm *tm;
  90. va_list args;
  91. va_start(args, fmt);
  92. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  93. va_end(args);
  94. memset(Buf, 0, sizeof(Buf));
  95. CurrentTime = time(NULL);
  96. tm = localtime(&CurrentTime);
  97. sprintf(Buf,
  98. "echo \"[%04d.%02d.%02d %02d:%02d:%02d WebService] - %s\" >> /Storage/SystemLog/[%04d.%02d]WebService_SystemLog",
  99. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  100. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  101. system(Buf);
  102. return rc;
  103. }
  104. #endif
  105. int runShellCmd(const char*cmd)
  106. {
  107. int result = FAIL;
  108. char buf[256];
  109. FILE *fp;
  110. fp = popen(cmd, "r");
  111. if(fp != NULL)
  112. {
  113. while(fgets(buf, sizeof(buf), fp) != NULL)
  114. {
  115. DEBUG_INFO("%s\n", buf);
  116. }
  117. result = PASS;
  118. }
  119. pclose(fp);
  120. return result;
  121. }
  122. int DiffTimeb(struct timeb ST, struct timeb ET) {
  123. //return milli-second
  124. unsigned int StartTime, StopTime;
  125. StartTime = (unsigned int) ST.time;
  126. StopTime = (unsigned int) ET.time;
  127. return (StopTime - StartTime) * 1000 + ET.millitm - ST.millitm;
  128. }
  129. //=================================
  130. // Common routine
  131. //=================================
  132. void trim(char *s) {
  133. int i = 0, j, k, l = 0;
  134. while ((s[i] == ' ') || (s[i] == '\t') || (s[i] == '\n'))
  135. i++;
  136. j = strlen(s) - 1;
  137. while ((s[j] == ' ') || (s[j] == '\t') || (s[j] == '\n'))
  138. j--;
  139. if (i == 0 && j == strlen(s) - 1) {
  140. } else if (i == 0)
  141. s[j + 1] = '\0';
  142. else {
  143. for (k = i; k <= j; k++)
  144. s[l++] = s[k];
  145. s[l] = '\0';
  146. }
  147. }
  148. int mystrcmp(char *p1, char *p2) {
  149. while (*p1 == *p2) {
  150. if (*p1 == '\0' || *p2 == '\0')
  151. break;
  152. p1++;
  153. p2++;
  154. }
  155. if (*p1 == '\0' && *p2 == '\0')
  156. return (PASS);
  157. else
  158. return (FAIL);
  159. }
  160. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt) {
  161. strncpy(dest, src + start, cnt);
  162. dest[cnt] = 0;
  163. }
  164. void split(char **arr, char *str, const char *del) {
  165. char *s = strtok(str, del);
  166. while (s != NULL) {
  167. *arr++ = s;
  168. s = strtok(NULL, del);
  169. }
  170. }
  171. int ConnectorType(char* connector){
  172. int result;
  173. if(strcmp(connector, "0") == 0){
  174. result= 0;
  175. }
  176. else if(strcmp(connector, "U") == 0 || strcmp(connector, "V") == 0 || strcmp(connector, "E") == 0 || strcmp(connector, "F") == 0 || strcmp(connector, "T") == 0 || strcmp(connector, "D") == 0 || strcmp(connector, "M") == 0 || strcmp(connector, "N") == 0 || strcmp(connector, "P") == 0 || strcmp(connector, "R") == 0 || strcmp(connector, "Y") == 0 || strcmp(connector, "Z") == 0 || strcmp(connector, "I") == 0 || strcmp(connector, "Q") == 0){
  177. result= 1;//CCS
  178. }
  179. else if(strcmp(connector, "G") == 0 || strcmp(connector, "B") == 0){
  180. result= 2;//GB
  181. }
  182. else if(strcmp(connector, "J") == 0 || strcmp(connector, "K") == 0 || strcmp(connector, "L") == 0 || strcmp(connector, "S") == 0 || strcmp(connector, "O") == 0){
  183. result= 3;//CHAdeMO
  184. }
  185. else if(strcmp(connector, "1") == 0 || strcmp(connector, "2") == 0 || strcmp(connector, "3") == 0 || strcmp(connector, "4") == 0 || strcmp(connector, "5") == 0 || strcmp(connector, "6") == 0 || strcmp(connector, "7") == 0 || strcmp(connector, "8") == 0){
  186. result= 4;//AC
  187. }
  188. else{
  189. result= 0;
  190. }
  191. return result;
  192. }
  193. int ModelType(char* type,char* network){
  194. int result=0;
  195. if(strcmp(type, "A") == 0){
  196. if(strcmp(network, "0") == 0 || strcmp(network, "R") == 0 || strcmp(network, "B") == 0){
  197. result=0;
  198. }
  199. else if(strcmp(network, "E") == 0 || strcmp(network, "W") == 0 || strcmp(network, "T") == 0 || strcmp(network, "U") == 0){
  200. result=1;
  201. }
  202. }
  203. else if(strcmp(type, "D") == 0){
  204. result=2;
  205. }
  206. return result;
  207. }
  208. // 四捨五入 取到 小數點第 2 位
  209. float rounding(float a)
  210. {
  211. return (int)(a*100+0.5)/100.0;
  212. }
  213. //==========================================
  214. // Init all share memory
  215. //==========================================
  216. int InitShareMemory() {
  217. int result = PASS;
  218. int MeterSMId;
  219. //creat ShmSysConfigAndInfo
  220. if ((MeterSMId = shmget(ShmSysConfigAndInfoKey,
  221. sizeof(struct SysConfigAndInfo), 0777)) < 0) {
  222. printf("%s\n","InitShareMemory Error");
  223. #ifdef SystemLogMessage
  224. DEBUG_ERROR("shmget ShmSysConfigAndInfo NG\n");
  225. #endif
  226. result = FAIL;
  227. } else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0))
  228. == (void *) -1) {
  229. #ifdef SystemLogMessage
  230. DEBUG_ERROR("shmat ShmSysConfigAndInfo NG\n");
  231. #endif
  232. result = FAIL;
  233. } else {
  234. }
  235. //creat ShmStatusCodeData
  236. if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),
  237. 0777)) < 0) {
  238. #ifdef SystemLogMessage
  239. DEBUG_ERROR("shmget ShmStatusCodeData NG\n");
  240. #endif
  241. result = FAIL;
  242. } else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  243. #ifdef SystemLogMessage
  244. DEBUG_ERROR("shmat ShmStatusCodeData NG\n");
  245. #endif
  246. result = FAIL;
  247. } else {
  248. }
  249. //creat ShmPsuData
  250. if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData),
  251. 0777)) < 0) {
  252. #ifdef SystemLogMessage
  253. DEBUG_ERROR("shmget ShmPsuData NG\n");
  254. #endif
  255. result = FAIL;
  256. } else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  257. #ifdef SystemLogMessage
  258. DEBUG_ERROR("shmat ShmPsuData NG\n");
  259. #endif
  260. result = FAIL;
  261. } else {
  262. }
  263. //creat ShmPrimaryMcuData
  264. if ((MeterSMId = shmget(ShmPrimaryMcuKey, sizeof(struct PrimaryMcuData),
  265. 0777)) < 0) {
  266. #ifdef SystemLogMessage
  267. DEBUG_ERROR("shmget ShmPrimaryMcuData NG\n");
  268. #endif
  269. result = FAIL;
  270. } else if ((ShmPrimaryMcuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  271. #ifdef SystemLogMessage
  272. DEBUG_ERROR("shmat ShmPrimaryMcuData NG\n");
  273. #endif
  274. result = FAIL;
  275. } else {
  276. }
  277. //creat ShmOCPP16Data
  278. if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data), 0777)) < 0)
  279. {
  280. DEBUG_ERROR("shmget ShmOCPP16Data NG\n");
  281. result = FAIL;
  282. }
  283. else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1)
  284. {
  285. DEBUG_ERROR("shmat ShmOCPP16Data NG\n");
  286. result = FAIL;
  287. }
  288. //creat ShmOCPP20Data
  289. if ((MeterSMId = shmget(ShmOcpp20ModuleKey, sizeof(struct OCPP20Data), 0777)) < 0)
  290. {
  291. DEBUG_ERROR("shmget OCPP20Data NG\n");
  292. result = FAIL;
  293. }
  294. else if ((ShmOCPP20Data = shmat(MeterSMId, NULL, 0)) == (void *) -1)
  295. {
  296. DEBUG_ERROR("shmat OCPP20Data NG\n");
  297. result = FAIL;
  298. }
  299. #ifdef DO360
  300. //creat ShmChargerInfo
  301. if ((MeterSMId = shmget(SM_ChargerInfoKey, sizeof(ChargerInfoData), IPC_CREAT | 0777)) < 0)
  302. {
  303. #ifdef SystemLogMessage
  304. DEBUG_ERROR("[main]CreatShareMemory:shmget ChargerInfoData NG");
  305. #endif
  306. return 0;
  307. }
  308. else if ((ShmChargerInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1)
  309. {
  310. #ifdef SystemLogMessage
  311. DEBUG_ERROR("[WebService]CreatShareMemory:shmat ChargerInfoData NG");
  312. #endif
  313. return 0;
  314. } else {
  315. }
  316. // memset(ShmChargerInfo, 0, sizeof(ChargerInfoData));
  317. #endif
  318. return result;
  319. }
  320. int StoreUsrConfigData(struct SysConfigData *UsrData)
  321. {
  322. int result = PASS;
  323. int fd,wrd;
  324. unsigned int i,Chk;
  325. unsigned char *ptr, *BufTmp;
  326. Chk=0;
  327. ptr=(unsigned char *)UsrData;
  328. if((BufTmp=malloc(MtdBlockSize))!=NULL)
  329. {
  330. memset(BufTmp,0,MtdBlockSize);
  331. memcpy(BufTmp,ptr,sizeof(struct SysConfigData));
  332. for(i=ARRAY_SIZE(UsrData->CsuBootLoadFwRev);i<MtdBlockSize-4;i++)
  333. Chk+=*(BufTmp+i);
  334. memcpy(BufTmp+MtdBlockSize-4, &Chk, 4);
  335. // Output configuration to file.
  336. fd = open("/mnt/EvseConfig.bin", O_RDWR|O_CREAT);
  337. if (fd < 0)
  338. {
  339. DEBUG_ERROR("open /mnt/EvseConfig.bin NG\n");
  340. free(BufTmp);
  341. return 0;
  342. }
  343. wrd=write(fd, BufTmp, MtdBlockSize);
  344. close(fd);
  345. if(wrd<MtdBlockSize)
  346. {
  347. DEBUG_ERROR("write /mnt/EvseConfig.bin NG\n");
  348. free(BufTmp);
  349. return 0;
  350. }
  351. DEBUG_INFO("EvseConfig write to file in /mnt OK.\n");
  352. DEBUG_INFO("Erase /dev/mtd10.\n");
  353. runShellCmd("flash_erase /dev/mtd10 0 0");
  354. DEBUG_INFO("Write /dev/mtd10.\n");
  355. runShellCmd("nandwrite -p /dev/mtd10 /mnt/EvseConfig.bin");
  356. DEBUG_INFO("Erase /dev/mtd11.\n");
  357. runShellCmd("flash_erase /dev/mtd11 0 0");
  358. DEBUG_INFO("Write /dev/mtd11.\n");
  359. runShellCmd("nandwrite -p /dev/mtd11 /mnt/EvseConfig.bin");
  360. system("rm -f /mnt/EvseConfig.bin");
  361. DEBUG_INFO("EvseConfig write to flash OK\n");
  362. }
  363. else
  364. {
  365. DEBUG_ERROR("alloc BlockSize NG\r\n");
  366. result = FAIL;
  367. }
  368. if(BufTmp!=NULL)
  369. free(BufTmp);
  370. return result;
  371. }
  372. //================================================
  373. // Main process
  374. //================================================
  375. int main(int argc, char *argv[]) {
  376. //int InitShMry = 1;
  377. if (InitShareMemory() == FAIL) {
  378. //InitShMry = 0;
  379. #ifdef SystemLogMessage
  380. DEBUG_ERROR("InitShareMemory NG\n");
  381. #endif
  382. if (ShmStatusCodeData != NULL) {
  383. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
  384. }
  385. sleep(5);
  386. return 0;
  387. }
  388. //web page submit
  389. if ((argc == 3) & (strlen(argv[1]) == 1)) {
  390. //web page submit system
  391. if (strcmp(argv[1], "1") == 0) {
  392. struct json_object *jobj = json_tokener_parse(argv[2]);
  393. json_object *val_obj = NULL;
  394. char *SystemId=NULL;
  395. char *SystemDateTime = NULL;
  396. int PhaseLossPolicy = 0;
  397. int FactoryConfiguration = 0;
  398. int AuthorisationMode = 0;
  399. int RfidCardNumEndian = 0;
  400. int PsuAcInputType = 0;
  401. char isAPP = 0;
  402. char isQRCode = 0;
  403. char isRFID = 0;
  404. char QRCodeMadeMode = 0;
  405. char *QRCodeContent = NULL;
  406. char Intensity = 0;
  407. char isAuthrizeByEVCCID = 0;
  408. char *DDSystemId1=NULL;
  409. int DDFactoryConfiguration1 = 0;
  410. int DDAuthorisationMode1 = 0;
  411. int DDRfidCardNumEndian1 = 0;
  412. char DDisAPP1 = 0;
  413. char DDisQRCode1 = 0;
  414. char DDisRFID1 = 0;
  415. char DDQRCodeMadeMode1 = 0;
  416. char *DDQRCodeContent1 = NULL;
  417. char DDIntensity1 = 0;
  418. char *DDSystemId2=NULL;
  419. int DDFactoryConfiguration2 = 0;
  420. int DDAuthorisationMode2 = 0;
  421. int DDRfidCardNumEndian2 = 0;
  422. char DDisAPP2 = 0;
  423. char DDisQRCode2 = 0;
  424. char DDisRFID2 = 0;
  425. char DDQRCodeMadeMode2 = 0;
  426. char *DDQRCodeContent2 = NULL;
  427. char DDIntensity2 = 0;
  428. char *DDSystemId3=NULL;
  429. int DDFactoryConfiguration3 = 0;
  430. int DDAuthorisationMode3 = 0;
  431. int DDRfidCardNumEndian3 = 0;
  432. char DDisAPP3 = 0;
  433. char DDisQRCode3 = 0;
  434. char DDisRFID3 = 0;
  435. char DDQRCodeMadeMode3 = 0;
  436. char *DDQRCodeContent3 = NULL;
  437. char DDIntensity3 = 0;
  438. char *DDSystemId4=NULL;
  439. int DDFactoryConfiguration4 = 0;
  440. int DDAuthorisationMode4 = 0;
  441. int DDRfidCardNumEndian4 = 0;
  442. char DDisAPP4 = 0;
  443. char DDisQRCode4 = 0;
  444. char DDisRFID4 = 0;
  445. char DDQRCodeMadeMode4 = 0;
  446. char *DDQRCodeContent4 = NULL;
  447. char DDIntensity4 = 0;
  448. if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
  449. SystemId = (char*)json_object_get_string(val_obj);
  450. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
  451. }
  452. if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
  453. SystemDateTime = (char*)json_object_get_string(val_obj);
  454. if(strlen(SystemDateTime)>0){
  455. char cmd[100];
  456. sprintf(cmd,"date -s '%s'",SystemDateTime);
  457. if(system(cmd)==0){
  458. system("hwclock -w");
  459. }
  460. }
  461. }
  462. if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
  463. PhaseLossPolicy = json_object_get_int(val_obj);
  464. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
  465. }
  466. if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
  467. FactoryConfiguration = json_object_get_int(val_obj);
  468. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
  469. }
  470. if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
  471. AuthorisationMode = json_object_get_int(val_obj);
  472. ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
  473. }
  474. if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
  475. RfidCardNumEndian = json_object_get_int(val_obj);
  476. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
  477. }
  478. if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
  479. PsuAcInputType = json_object_get_int(val_obj);
  480. ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
  481. }
  482. if( json_object_object_get_ex(jobj, "isAPP", &val_obj) ) {
  483. isAPP = json_object_get_int(val_obj);
  484. ShmSysConfigAndInfo->SysConfig.isAPP = isAPP;
  485. }
  486. if( json_object_object_get_ex(jobj, "isQRCode", &val_obj) ) {
  487. isQRCode = json_object_get_int(val_obj);
  488. ShmSysConfigAndInfo->SysConfig.isQRCode = isQRCode;
  489. }
  490. if( json_object_object_get_ex(jobj, "isRFID", &val_obj) ) {
  491. isRFID = json_object_get_int(val_obj);
  492. ShmSysConfigAndInfo->SysConfig.isRFID = isRFID;
  493. }
  494. if( json_object_object_get_ex(jobj, "QRCodeMadeMode", &val_obj) ) {
  495. QRCodeMadeMode = json_object_get_int(val_obj);
  496. ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
  497. }
  498. if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
  499. QRCodeContent = (char*)json_object_get_string(val_obj);
  500. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
  501. }
  502. if( json_object_object_get_ex(jobj, "Intensity", &val_obj) ) {
  503. Intensity = json_object_get_int(val_obj);
  504. ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity = Intensity;
  505. }
  506. if( json_object_object_get_ex(jobj, "isAuthrizeByEVCCID", &val_obj) ) {
  507. isAuthrizeByEVCCID = json_object_get_int(val_obj);
  508. ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID = isAuthrizeByEVCCID;
  509. }
  510. if( json_object_object_get_ex(jobj, "DDSystemId1", &val_obj) ) {
  511. DDSystemId1 = (char*)json_object_get_string(val_obj);
  512. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].SystemId,DDSystemId1);
  513. }
  514. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration1", &val_obj) ) {
  515. DDFactoryConfiguration1 = json_object_get_int(val_obj);
  516. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].FactoryConfiguration = DDFactoryConfiguration1;
  517. }
  518. if( json_object_object_get_ex(jobj, "DDAuthorisationMode1", &val_obj) ) {
  519. DDAuthorisationMode1 = json_object_get_int(val_obj);
  520. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].AuthorisationMode = DDAuthorisationMode1;
  521. }
  522. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian1", &val_obj) ) {
  523. DDRfidCardNumEndian1 = json_object_get_int(val_obj);
  524. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].RfidCardNumEndian = DDRfidCardNumEndian1;
  525. }
  526. if( json_object_object_get_ex(jobj, "DDisAPP1", &val_obj) ) {
  527. DDisAPP1 = json_object_get_int(val_obj);
  528. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isAPP = DDisAPP1;
  529. }
  530. if( json_object_object_get_ex(jobj, "DDisQRCode1", &val_obj) ) {
  531. DDisQRCode1 = json_object_get_int(val_obj);
  532. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isQRCode = DDisQRCode1;
  533. }
  534. if( json_object_object_get_ex(jobj, "DDisRFID1", &val_obj) ) {
  535. DDisRFID1 = json_object_get_int(val_obj);
  536. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isRFID = DDisRFID1;
  537. }
  538. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode1", &val_obj) ) {
  539. DDQRCodeMadeMode1 = json_object_get_int(val_obj);
  540. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeMadeMode = DDQRCodeMadeMode1;
  541. }
  542. if( json_object_object_get_ex(jobj, "DDQRCodeContent1", &val_obj) ) {
  543. DDQRCodeContent1 = (char*)json_object_get_string(val_obj);
  544. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeContent,DDQRCodeContent1);
  545. }
  546. if( json_object_object_get_ex(jobj, "DDIntensity1", &val_obj) ) {
  547. DDIntensity1 = json_object_get_int(val_obj);
  548. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].LedInfo.Intensity = DDIntensity1;
  549. }
  550. if( json_object_object_get_ex(jobj, "DDSystemId2", &val_obj) ) {
  551. DDSystemId2 = (char*)json_object_get_string(val_obj);
  552. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].SystemId,DDSystemId2);
  553. }
  554. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration2", &val_obj) ) {
  555. DDFactoryConfiguration2 = json_object_get_int(val_obj);
  556. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].FactoryConfiguration = DDFactoryConfiguration2;
  557. }
  558. if( json_object_object_get_ex(jobj, "DDAuthorisationMode2", &val_obj) ) {
  559. DDAuthorisationMode2 = json_object_get_int(val_obj);
  560. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].AuthorisationMode = DDAuthorisationMode2;
  561. }
  562. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian2", &val_obj) ) {
  563. DDRfidCardNumEndian2 = json_object_get_int(val_obj);
  564. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].RfidCardNumEndian = DDRfidCardNumEndian2;
  565. }
  566. if( json_object_object_get_ex(jobj, "DDisAPP2", &val_obj) ) {
  567. DDisAPP2 = json_object_get_int(val_obj);
  568. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isAPP = DDisAPP2;
  569. }
  570. if( json_object_object_get_ex(jobj, "DDisQRCode2", &val_obj) ) {
  571. DDisQRCode2 = json_object_get_int(val_obj);
  572. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isQRCode = DDisQRCode2;
  573. }
  574. if( json_object_object_get_ex(jobj, "DDisRFID2", &val_obj) ) {
  575. DDisRFID2 = json_object_get_int(val_obj);
  576. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isRFID = DDisRFID2;
  577. }
  578. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode2", &val_obj) ) {
  579. DDQRCodeMadeMode2 = json_object_get_int(val_obj);
  580. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeMadeMode = DDQRCodeMadeMode2;
  581. }
  582. if( json_object_object_get_ex(jobj, "DDQRCodeContent2", &val_obj) ) {
  583. DDQRCodeContent2 = (char*)json_object_get_string(val_obj);
  584. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeContent,DDQRCodeContent2);
  585. }
  586. if( json_object_object_get_ex(jobj, "DDIntensity2", &val_obj) ) {
  587. DDIntensity2 = json_object_get_int(val_obj);
  588. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].LedInfo.Intensity = DDIntensity2;
  589. }
  590. if( json_object_object_get_ex(jobj, "DDSystemId3", &val_obj) ) {
  591. DDSystemId3 = (char*)json_object_get_string(val_obj);
  592. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].SystemId,DDSystemId3);
  593. }
  594. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration3", &val_obj) ) {
  595. DDFactoryConfiguration3 = json_object_get_int(val_obj);
  596. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].FactoryConfiguration = DDFactoryConfiguration3;
  597. }
  598. if( json_object_object_get_ex(jobj, "DDAuthorisationMode3", &val_obj) ) {
  599. DDAuthorisationMode3 = json_object_get_int(val_obj);
  600. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].AuthorisationMode = DDAuthorisationMode3;
  601. }
  602. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian3", &val_obj) ) {
  603. DDRfidCardNumEndian3 = json_object_get_int(val_obj);
  604. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].RfidCardNumEndian = DDRfidCardNumEndian3;
  605. }
  606. if( json_object_object_get_ex(jobj, "DDisAPP3", &val_obj) ) {
  607. DDisAPP3 = json_object_get_int(val_obj);
  608. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isAPP = DDisAPP3;
  609. }
  610. if( json_object_object_get_ex(jobj, "DDisQRCode3", &val_obj) ) {
  611. DDisQRCode3 = json_object_get_int(val_obj);
  612. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isQRCode = DDisQRCode3;
  613. }
  614. if( json_object_object_get_ex(jobj, "DDisRFID3", &val_obj) ) {
  615. DDisRFID3 = json_object_get_int(val_obj);
  616. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isRFID = DDisRFID3;
  617. }
  618. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode3", &val_obj) ) {
  619. DDQRCodeMadeMode3 = json_object_get_int(val_obj);
  620. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeMadeMode = DDQRCodeMadeMode3;
  621. }
  622. if( json_object_object_get_ex(jobj, "DDQRCodeContent3", &val_obj) ) {
  623. DDQRCodeContent3 = (char*)json_object_get_string(val_obj);
  624. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeContent,DDQRCodeContent3);
  625. }
  626. if( json_object_object_get_ex(jobj, "DDIntensity3", &val_obj) ) {
  627. DDIntensity3 = json_object_get_int(val_obj);
  628. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].LedInfo.Intensity = DDIntensity3;
  629. }
  630. if( json_object_object_get_ex(jobj, "DDSystemId4", &val_obj) ) {
  631. DDSystemId4 = (char*)json_object_get_string(val_obj);
  632. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].SystemId,DDSystemId4);
  633. }
  634. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration4", &val_obj) ) {
  635. DDFactoryConfiguration4 = json_object_get_int(val_obj);
  636. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].FactoryConfiguration = DDFactoryConfiguration4;
  637. }
  638. if( json_object_object_get_ex(jobj, "DDAuthorisationMode4", &val_obj) ) {
  639. DDAuthorisationMode4 = json_object_get_int(val_obj);
  640. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].AuthorisationMode = DDAuthorisationMode4;
  641. }
  642. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian4", &val_obj) ) {
  643. DDRfidCardNumEndian4 = json_object_get_int(val_obj);
  644. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].RfidCardNumEndian = DDRfidCardNumEndian4;
  645. }
  646. if( json_object_object_get_ex(jobj, "DDisAPP4", &val_obj) ) {
  647. DDisAPP4 = json_object_get_int(val_obj);
  648. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isAPP = DDisAPP4;
  649. }
  650. if( json_object_object_get_ex(jobj, "DDisQRCode4", &val_obj) ) {
  651. DDisQRCode4 = json_object_get_int(val_obj);
  652. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isQRCode = DDisQRCode4;
  653. }
  654. if( json_object_object_get_ex(jobj, "DDisRFID4", &val_obj) ) {
  655. DDisRFID4 = json_object_get_int(val_obj);
  656. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isRFID = DDisRFID4;
  657. }
  658. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode4", &val_obj) ) {
  659. DDQRCodeMadeMode4 = json_object_get_int(val_obj);
  660. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeMadeMode = DDQRCodeMadeMode4;
  661. }
  662. if( json_object_object_get_ex(jobj, "DDQRCodeContent4", &val_obj) ) {
  663. DDQRCodeContent4 = (char*)json_object_get_string(val_obj);
  664. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeContent,DDQRCodeContent4);
  665. }
  666. if( json_object_object_get_ex(jobj, "DDIntensity4", &val_obj) ) {
  667. DDIntensity4 = json_object_get_int(val_obj);
  668. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].LedInfo.Intensity = DDIntensity4;
  669. }
  670. }
  671. if (strcmp(argv[1], "2") == 0) {
  672. struct json_object *jobj = json_tokener_parse(argv[2]);
  673. json_object *val_obj = NULL;
  674. int MaxChargingEnergy= 0;
  675. int MaxChargingPower = 0;
  676. int MaxChargingCurrent = 0;
  677. int MaxChargingVoltage = 0;
  678. int AcMaxChargingCurrent = 0;
  679. int MaxChargingDuration = 0;
  680. int MaxChargingSoc = 0;
  681. int StopChargingByButton = 0;
  682. int FanControlPolicy = 0;
  683. int isEnable15118 = 0;
  684. int isEnableR2R = 0;
  685. char *LocalWhiteCard0 = NULL;
  686. char *LocalWhiteCard1 = NULL;
  687. char *LocalWhiteCard2 = NULL;
  688. char *LocalWhiteCard3 = NULL;
  689. char *LocalWhiteCard4 = NULL;
  690. char *LocalWhiteCard5 = NULL;
  691. char *LocalWhiteCard6 = NULL;
  692. char *LocalWhiteCard7 = NULL;
  693. char *LocalWhiteCard8 = NULL;
  694. char *LocalWhiteCard9 = NULL;
  695. char isBilling = 0;
  696. char Currency = 0;
  697. float Fee0 = 0;
  698. float Fee1 = 0;
  699. float Fee2 = 0;
  700. float Fee3 = 0;
  701. float Fee4 = 0;
  702. float Fee5 = 0;
  703. float Fee6 = 0;
  704. float Fee7 = 0;
  705. float Fee8 = 0;
  706. float Fee9 = 0;
  707. float Fee10 = 0;
  708. float Fee11 = 0;
  709. float Fee12 = 0;
  710. float Fee13 = 0;
  711. float Fee14 = 0;
  712. float Fee15 = 0;
  713. float Fee16 = 0;
  714. float Fee17 = 0;
  715. float Fee18 = 0;
  716. float Fee19 = 0;
  717. float Fee20 = 0;
  718. float Fee21 = 0;
  719. float Fee22 = 0;
  720. float Fee23 = 0;
  721. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  722. MaxChargingEnergy = json_object_get_int(val_obj);
  723. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  724. }
  725. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  726. MaxChargingPower = json_object_get_int(val_obj);
  727. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  728. }
  729. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  730. MaxChargingCurrent = json_object_get_int(val_obj);
  731. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  732. }
  733. if( json_object_object_get_ex(jobj, "MaxChargingVoltage", &val_obj) ) {
  734. MaxChargingVoltage = json_object_get_int(val_obj);
  735. ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage = MaxChargingVoltage;
  736. }
  737. if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
  738. AcMaxChargingCurrent = json_object_get_int(val_obj);
  739. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
  740. }
  741. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  742. MaxChargingDuration = json_object_get_int(val_obj);
  743. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  744. }
  745. if( json_object_object_get_ex(jobj, "MaxChargingSoc", &val_obj) ) {
  746. MaxChargingSoc = json_object_get_int(val_obj);
  747. ShmSysConfigAndInfo->SysConfig.MaxChargingSoc = MaxChargingSoc;
  748. }
  749. if( json_object_object_get_ex(jobj, "StopChargingByButton", &val_obj) ) {
  750. StopChargingByButton = json_object_get_int(val_obj);
  751. ShmSysConfigAndInfo->SysConfig.StopChargingByButton = StopChargingByButton;
  752. }
  753. if( json_object_object_get_ex(jobj, "FanControlPolicy", &val_obj) ) {
  754. FanControlPolicy = json_object_get_int(val_obj);
  755. ShmSysConfigAndInfo->SysConfig.FanControlPolicy = FanControlPolicy;
  756. }
  757. if( json_object_object_get_ex(jobj, "isEnable15118", &val_obj) ) {
  758. isEnable15118 = json_object_get_int(val_obj);
  759. ShmSysConfigAndInfo->SysConfig.isEnable15118 = isEnable15118;
  760. }
  761. if( json_object_object_get_ex(jobj, "isEnableR2R", &val_obj) ) {
  762. isEnableR2R = json_object_get_int(val_obj);
  763. ShmSysConfigAndInfo->SysConfig.isEnableR2R = isEnableR2R;
  764. }
  765. if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
  766. LocalWhiteCard0 = (char*)json_object_get_string(val_obj);
  767. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
  768. }
  769. if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
  770. LocalWhiteCard1 = (char*)json_object_get_string(val_obj);
  771. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
  772. }
  773. if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
  774. LocalWhiteCard2 = (char*)json_object_get_string(val_obj);
  775. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
  776. }
  777. if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
  778. LocalWhiteCard3 = (char*)json_object_get_string(val_obj);
  779. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
  780. }
  781. if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
  782. LocalWhiteCard4 = (char*)json_object_get_string(val_obj);
  783. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
  784. }
  785. if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
  786. LocalWhiteCard5 = (char*)json_object_get_string(val_obj);
  787. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
  788. }
  789. if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
  790. LocalWhiteCard6 = (char*)json_object_get_string(val_obj);
  791. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
  792. }
  793. if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
  794. LocalWhiteCard7 = (char*)json_object_get_string(val_obj);
  795. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
  796. }
  797. if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
  798. LocalWhiteCard8 = (char*)json_object_get_string(val_obj);
  799. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
  800. }
  801. if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
  802. LocalWhiteCard9 = (char*)json_object_get_string(val_obj);
  803. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
  804. }
  805. if( json_object_object_get_ex(jobj, "isBilling", &val_obj) ) {
  806. isBilling = json_object_get_int(val_obj);
  807. ShmSysConfigAndInfo->SysConfig.BillingData.isBilling = isBilling;
  808. }
  809. if( json_object_object_get_ex(jobj, "Currency", &val_obj) ) {
  810. Currency = json_object_get_int(val_obj);
  811. ShmSysConfigAndInfo->SysConfig.BillingData.Currency = Currency;
  812. }
  813. if( json_object_object_get_ex(jobj, "Fee0", &val_obj) ) {
  814. Fee0 = json_object_get_double(val_obj);
  815. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0] = rounding(Fee0);
  816. }
  817. if( json_object_object_get_ex(jobj, "Fee1", &val_obj) ) {
  818. Fee1 = json_object_get_double(val_obj);
  819. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1] = rounding(Fee1);
  820. }
  821. if( json_object_object_get_ex(jobj, "Fee2", &val_obj) ) {
  822. Fee2 = json_object_get_double(val_obj);
  823. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2] = rounding(Fee2);
  824. }
  825. if( json_object_object_get_ex(jobj, "Fee3", &val_obj) ) {
  826. Fee3 = json_object_get_double(val_obj);
  827. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3] = rounding(Fee3);
  828. }
  829. if( json_object_object_get_ex(jobj, "Fee4", &val_obj) ) {
  830. Fee4 = json_object_get_double(val_obj);
  831. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4] = rounding(Fee4);
  832. }
  833. if( json_object_object_get_ex(jobj, "Fee5", &val_obj) ) {
  834. Fee5 = json_object_get_double(val_obj);
  835. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5] = rounding(Fee5);
  836. }
  837. if( json_object_object_get_ex(jobj, "Fee6", &val_obj) ) {
  838. Fee6 = json_object_get_double(val_obj);
  839. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6] = rounding(Fee6);
  840. }
  841. if( json_object_object_get_ex(jobj, "Fee7", &val_obj) ) {
  842. Fee7 = json_object_get_double(val_obj);
  843. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7] = rounding(Fee7);
  844. }
  845. if( json_object_object_get_ex(jobj, "Fee8", &val_obj) ) {
  846. Fee8 = json_object_get_double(val_obj);
  847. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8] = rounding(Fee8);
  848. }
  849. if( json_object_object_get_ex(jobj, "Fee9", &val_obj) ) {
  850. Fee9 = json_object_get_double(val_obj);
  851. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9] = rounding(Fee9);
  852. }
  853. if( json_object_object_get_ex(jobj, "Fee10", &val_obj) ) {
  854. Fee10 = json_object_get_double(val_obj);
  855. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10] = rounding(Fee10);
  856. }
  857. if( json_object_object_get_ex(jobj, "Fee11", &val_obj) ) {
  858. Fee11 = json_object_get_double(val_obj);
  859. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11] = rounding(Fee11);
  860. }
  861. if( json_object_object_get_ex(jobj, "Fee12", &val_obj) ) {
  862. Fee12 = json_object_get_double(val_obj);
  863. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12] = rounding(Fee12);
  864. }
  865. if( json_object_object_get_ex(jobj, "Fee13", &val_obj) ) {
  866. Fee13 = json_object_get_double(val_obj);
  867. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13] = rounding(Fee13);
  868. }
  869. if( json_object_object_get_ex(jobj, "Fee14", &val_obj) ) {
  870. Fee14 = json_object_get_double(val_obj);
  871. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14] = rounding(Fee14);
  872. }
  873. if( json_object_object_get_ex(jobj, "Fee15", &val_obj) ) {
  874. Fee15 = json_object_get_double(val_obj);
  875. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15] = rounding(Fee15);
  876. }
  877. if( json_object_object_get_ex(jobj, "Fee16", &val_obj) ) {
  878. Fee16 = json_object_get_double(val_obj);
  879. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16] = rounding(Fee16);
  880. }
  881. if( json_object_object_get_ex(jobj, "Fee17", &val_obj) ) {
  882. Fee17 = json_object_get_double(val_obj);
  883. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17] = rounding(Fee17);
  884. }
  885. if( json_object_object_get_ex(jobj, "Fee18", &val_obj) ) {
  886. Fee18 = json_object_get_double(val_obj);
  887. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18] = rounding(Fee18);
  888. }
  889. if( json_object_object_get_ex(jobj, "Fee19", &val_obj) ) {
  890. Fee19 = json_object_get_double(val_obj);
  891. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19] = rounding(Fee19);
  892. }
  893. if( json_object_object_get_ex(jobj, "Fee20", &val_obj) ) {
  894. Fee20 = json_object_get_double(val_obj);
  895. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20] = rounding(Fee20);
  896. }
  897. if( json_object_object_get_ex(jobj, "Fee21", &val_obj) ) {
  898. Fee21 = json_object_get_double(val_obj);
  899. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21] = rounding(Fee21);
  900. }
  901. if( json_object_object_get_ex(jobj, "Fee22", &val_obj) ) {
  902. Fee22 = json_object_get_double(val_obj);
  903. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22] = rounding(Fee22);
  904. }
  905. if( json_object_object_get_ex(jobj, "Fee23", &val_obj) ) {
  906. Fee23 = json_object_get_double(val_obj);
  907. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23] = rounding(Fee23);
  908. }
  909. }
  910. if (strcmp(argv[1], "3") == 0) {
  911. struct json_object *jobj = json_tokener_parse(argv[2]);
  912. json_object *val_obj = NULL;
  913. int Eth0DhcpClient=0;
  914. char *Eth0IpAddress=NULL;
  915. char *Eth0SubmaskAddress=NULL;
  916. char *Eth0GatewayAddress=NULL;
  917. int WifiMode=0;
  918. char *WifiSsid=NULL;
  919. char *WifiPassword=NULL;
  920. int WifiBroadcastSsid=0;
  921. char *WifiTargetBssidMac=NULL;
  922. int WifiDhcpServer=0;
  923. int WifiDhcpClient=0;
  924. char *WifiIpAddress=NULL;
  925. char *WifiSubmaskAddress=NULL;
  926. char *WifiGatewayAddress=NULL;
  927. char *TelcomApn=NULL;
  928. char *TelcomChapPapId=NULL;
  929. char *TelcomChapPapPwd=NULL;
  930. char *TelcomIpAddress=NULL;
  931. char TelcomEnabled=0;
  932. char TelcomNetworkType=0;
  933. char Wcnt=0;
  934. char Tcnt=0;
  935. char isEnalbleFirewall=0;
  936. char *FirewallAcceptAddr0=NULL;
  937. char *FirewallAcceptAddr1=NULL;
  938. char *FirewallAcceptAddr2=NULL;
  939. char *FirewallAcceptAddr3=NULL;
  940. char *FirewallAcceptAddr4=NULL;
  941. char *FirewallAcceptAddr5=NULL;
  942. char *FirewallAcceptAddr6=NULL;
  943. char *FirewallAcceptAddr7=NULL;
  944. char *FirewallAcceptAddr8=NULL;
  945. char *FirewallAcceptAddr9=NULL;
  946. if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
  947. Eth0DhcpClient = json_object_get_int(val_obj);
  948. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=Eth0DhcpClient;
  949. }
  950. if( json_object_object_get_ex(jobj, "Eth0IpAddress", &val_obj) ) {
  951. Eth0IpAddress = (char*)json_object_get_string(val_obj);
  952. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,Eth0IpAddress);
  953. }
  954. if( json_object_object_get_ex(jobj, "Eth0SubmaskAddress", &val_obj) ) {
  955. Eth0SubmaskAddress = (char*)json_object_get_string(val_obj);
  956. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,Eth0SubmaskAddress);
  957. }
  958. if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
  959. Eth0GatewayAddress = (char*)json_object_get_string(val_obj);
  960. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,Eth0GatewayAddress);
  961. }
  962. if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
  963. WifiMode = json_object_get_int(val_obj);
  964. if(WifiMode!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode) Wcnt++;
  965. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
  966. }
  967. if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
  968. WifiSsid = (char*)json_object_get_string(val_obj);
  969. if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
  970. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
  971. }
  972. if( json_object_object_get_ex(jobj, "WifiPassword", &val_obj) ) {
  973. WifiPassword = (char*)json_object_get_string(val_obj);
  974. if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
  975. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
  976. }
  977. if( json_object_object_get_ex(jobj, "WifiBroadcastSsid", &val_obj) ) {
  978. WifiBroadcastSsid = json_object_get_int(val_obj);
  979. if(WifiBroadcastSsid!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid) Wcnt++;
  980. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid=WifiBroadcastSsid;
  981. }
  982. if( json_object_object_get_ex(jobj, "WifiTargetBssidMac", &val_obj) ) {
  983. WifiTargetBssidMac = (char*)json_object_get_string(val_obj);
  984. if (strcmp(WifiTargetBssidMac, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac) != 0) Wcnt++;
  985. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac,WifiTargetBssidMac);
  986. }
  987. if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
  988. WifiDhcpServer = json_object_get_int(val_obj);
  989. if(WifiDhcpServer!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer) Wcnt++;
  990. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=WifiDhcpServer;
  991. }
  992. if( json_object_object_get_ex(jobj, "WifiDhcpClient", &val_obj) ) {
  993. WifiDhcpClient = json_object_get_int(val_obj);
  994. if(WifiDhcpClient!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient) Wcnt++;
  995. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=WifiDhcpClient;
  996. }
  997. if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
  998. WifiIpAddress = (char*)json_object_get_string(val_obj);
  999. if (strcmp(WifiIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress) != 0) Wcnt++;
  1000. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,WifiIpAddress);
  1001. }
  1002. if( json_object_object_get_ex(jobj, "WifiSubmaskAddress", &val_obj) ) {
  1003. WifiSubmaskAddress = (char*)json_object_get_string(val_obj);
  1004. if (strcmp(WifiSubmaskAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress) != 0) Wcnt++;
  1005. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,WifiSubmaskAddress);
  1006. }
  1007. if( json_object_object_get_ex(jobj, "WifiGatewayAddress", &val_obj) ) {
  1008. WifiGatewayAddress = (char*)json_object_get_string(val_obj);
  1009. if (strcmp(WifiGatewayAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress) != 0) Wcnt++;
  1010. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,WifiGatewayAddress);
  1011. }
  1012. if( json_object_object_get_ex(jobj, "TelcomApn", &val_obj) ) {
  1013. TelcomApn = (char*)json_object_get_string(val_obj);
  1014. if (strcmp(TelcomApn, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn) != 0) Tcnt++;
  1015. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,TelcomApn);
  1016. }
  1017. if( json_object_object_get_ex(jobj, "TelcomChapPapId", &val_obj) ) {
  1018. TelcomChapPapId = (char*)json_object_get_string(val_obj);
  1019. if (strcmp(TelcomChapPapId, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId) != 0) Tcnt++;
  1020. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,TelcomChapPapId);
  1021. }
  1022. if( json_object_object_get_ex(jobj, "TelcomChapPapPwd", &val_obj) ) {
  1023. TelcomChapPapPwd = (char*)json_object_get_string(val_obj);
  1024. if (strcmp(TelcomChapPapPwd, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd) != 0) Tcnt++;
  1025. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,TelcomChapPapPwd);
  1026. }
  1027. if( json_object_object_get_ex(jobj, "TelcomIpAddress", &val_obj) ) {
  1028. TelcomIpAddress = (char*)json_object_get_string(val_obj);
  1029. if (strcmp(TelcomIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress) != 0) Tcnt++;
  1030. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
  1031. }
  1032. if( json_object_object_get_ex(jobj, "TelcomEnabled", &val_obj) ) {
  1033. TelcomEnabled = json_object_get_int(val_obj);
  1034. if(TelcomEnabled!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled) Tcnt++;
  1035. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled=TelcomEnabled;
  1036. }
  1037. if( json_object_object_get_ex(jobj, "TelcomNetworkType", &val_obj) ) {
  1038. TelcomNetworkType = json_object_get_int(val_obj);
  1039. if(TelcomNetworkType!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType) Tcnt++;
  1040. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType=TelcomNetworkType;
  1041. }
  1042. if( json_object_object_get_ex(jobj, "isEnalbleFirewall", &val_obj) ) {
  1043. isEnalbleFirewall = json_object_get_int(val_obj);
  1044. ShmSysConfigAndInfo->SysConfig.isEnalbleFirewall=isEnalbleFirewall;
  1045. }
  1046. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr0", &val_obj) ) {
  1047. FirewallAcceptAddr0 = (char*)json_object_get_string(val_obj);
  1048. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[0],FirewallAcceptAddr0);
  1049. }
  1050. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr1", &val_obj) ) {
  1051. FirewallAcceptAddr1 = (char*)json_object_get_string(val_obj);
  1052. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[1],FirewallAcceptAddr1);
  1053. }
  1054. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr2", &val_obj) ) {
  1055. FirewallAcceptAddr2 = (char*)json_object_get_string(val_obj);
  1056. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[2],FirewallAcceptAddr2);
  1057. }
  1058. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr3", &val_obj) ) {
  1059. FirewallAcceptAddr3 = (char*)json_object_get_string(val_obj);
  1060. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[3],FirewallAcceptAddr3);
  1061. }
  1062. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr4", &val_obj) ) {
  1063. FirewallAcceptAddr4 = (char*)json_object_get_string(val_obj);
  1064. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[4],FirewallAcceptAddr4);
  1065. }
  1066. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr5", &val_obj) ) {
  1067. FirewallAcceptAddr5 = (char*)json_object_get_string(val_obj);
  1068. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[5],FirewallAcceptAddr5);
  1069. }
  1070. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr6", &val_obj) ) {
  1071. FirewallAcceptAddr6 = (char*)json_object_get_string(val_obj);
  1072. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[6],FirewallAcceptAddr6);
  1073. }
  1074. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr7", &val_obj) ) {
  1075. FirewallAcceptAddr7 = (char*)json_object_get_string(val_obj);
  1076. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[7],FirewallAcceptAddr7);
  1077. }
  1078. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr8", &val_obj) ) {
  1079. FirewallAcceptAddr8 = (char*)json_object_get_string(val_obj);
  1080. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[8],FirewallAcceptAddr8);
  1081. }
  1082. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr9", &val_obj) ) {
  1083. FirewallAcceptAddr9 = (char*)json_object_get_string(val_obj);
  1084. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[9],FirewallAcceptAddr9);
  1085. }
  1086. if(Wcnt>0){
  1087. system ("pkill Module_Wifi");
  1088. }
  1089. if(Tcnt>0){
  1090. system ("pkill Module_4g");
  1091. system ("killall 4GDetection");
  1092. system ("killall pppd");
  1093. }
  1094. }
  1095. if (strcmp(argv[1], "4") == 0) {
  1096. struct json_object *jobj = json_tokener_parse(argv[2]);
  1097. json_object *val_obj = NULL;
  1098. int BackendConnTimeout=0;
  1099. int OfflinePolicy=0;
  1100. int OfflineMaxChargeEnergy=0;
  1101. int OfflineMaxChargeDuration=0;
  1102. char *OcppServerURL=NULL;
  1103. char *ChargeBoxId=NULL;
  1104. char *chargePointVendor=NULL;
  1105. int OcppSecurityProfile=0;
  1106. int MaintainServerSecurityProfile=0;
  1107. char *OcppSecurityPassword=NULL;
  1108. char *MaintainServerSecurityPassword=NULL;
  1109. int isEnableLocalPowerSharging=0;
  1110. int PowerSharingCapacity=0;
  1111. char *PowerSharingServerIP=NULL;
  1112. char *OcppReceiptrURL=NULL;
  1113. char *MaintainServerURL=NULL;
  1114. /*for TTIA*/
  1115. char isEnableTTIA=0;
  1116. char *server_addr=NULL;
  1117. int server_port=0;
  1118. int busVenderId=0;
  1119. char *EquipmentProvider=NULL;
  1120. char TransportationCompanyNo=0;
  1121. char TTIAChargeBoxId=0;
  1122. char *evseStation=NULL;
  1123. if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
  1124. BackendConnTimeout = json_object_get_int(val_obj);
  1125. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
  1126. }
  1127. if( json_object_object_get_ex(jobj, "OfflinePolicy", &val_obj) ) {
  1128. OfflinePolicy = json_object_get_int(val_obj);
  1129. ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
  1130. }
  1131. if( json_object_object_get_ex(jobj, "OfflineMaxChargeEnergy", &val_obj) ) {
  1132. OfflineMaxChargeEnergy = json_object_get_int(val_obj);
  1133. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
  1134. }
  1135. if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
  1136. OfflineMaxChargeDuration = json_object_get_int(val_obj);
  1137. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
  1138. }
  1139. if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
  1140. OcppServerURL = (char*)json_object_get_string(val_obj);
  1141. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
  1142. }
  1143. if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
  1144. ChargeBoxId = (char*)json_object_get_string(val_obj);
  1145. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
  1146. }
  1147. if( json_object_object_get_ex(jobj, "chargePointVendor", &val_obj) ) {
  1148. chargePointVendor = (char*)json_object_get_string(val_obj);
  1149. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,chargePointVendor);
  1150. }
  1151. if( json_object_object_get_ex(jobj, "OcppSecurityProfile", &val_obj) ) {
  1152. OcppSecurityProfile = json_object_get_int(val_obj);
  1153. ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile = OcppSecurityProfile;
  1154. }
  1155. if( json_object_object_get_ex(jobj, "OcppSecurityPassword", &val_obj) ) {
  1156. OcppSecurityPassword = (char*)json_object_get_string(val_obj);
  1157. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword,OcppSecurityPassword);
  1158. }
  1159. if( json_object_object_get_ex(jobj, "MaintainServerSecurityProfile", &val_obj) ) {
  1160. MaintainServerSecurityProfile = json_object_get_int(val_obj);
  1161. ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile = MaintainServerSecurityProfile;
  1162. }
  1163. if( json_object_object_get_ex(jobj, "MaintainServerSecurityPassword", &val_obj) ) {
  1164. MaintainServerSecurityPassword = (char*)json_object_get_string(val_obj);
  1165. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword,MaintainServerSecurityPassword);
  1166. }
  1167. if( json_object_object_get_ex(jobj, "isEnableLocalPowerSharging", &val_obj) ) {
  1168. isEnableLocalPowerSharging = json_object_get_int(val_obj);
  1169. ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing = isEnableLocalPowerSharging;
  1170. }
  1171. if( json_object_object_get_ex(jobj, "PowerSharingCapacity", &val_obj) ) {
  1172. PowerSharingCapacity = json_object_get_int(val_obj);
  1173. ShmSysConfigAndInfo->SysConfig.PowerSharingCapacityPower = PowerSharingCapacity;
  1174. }
  1175. if( json_object_object_get_ex(jobj, "PowerSharingServerIP", &val_obj) ) {
  1176. PowerSharingServerIP = (char*)json_object_get_string(val_obj);
  1177. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP,PowerSharingServerIP);
  1178. }
  1179. if( json_object_object_get_ex(jobj, "OcppReceiptrURL", &val_obj) ) {
  1180. OcppReceiptrURL = (char*)json_object_get_string(val_obj);
  1181. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL,OcppReceiptrURL);
  1182. }
  1183. if( json_object_object_get_ex(jobj, "MaintainServerURL", &val_obj) ) {
  1184. MaintainServerURL = (char*)json_object_get_string(val_obj);
  1185. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL,MaintainServerURL);
  1186. }
  1187. /*for TTIA*/
  1188. if( json_object_object_get_ex(jobj, "isEnableTTIA", &val_obj) ) {
  1189. isEnableTTIA = json_object_get_int(val_obj);
  1190. ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA = isEnableTTIA;
  1191. }
  1192. if( json_object_object_get_ex(jobj, "server_addr", &val_obj) ) {
  1193. server_addr = (char*)json_object_get_string(val_obj);
  1194. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr,server_addr);
  1195. }
  1196. if( json_object_object_get_ex(jobj, "server_port", &val_obj) ) {
  1197. server_port = json_object_get_int(val_obj);
  1198. ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port = server_port;
  1199. }
  1200. if( json_object_object_get_ex(jobj, "busVenderId", &val_obj) ) {
  1201. busVenderId = json_object_get_int(val_obj);
  1202. ShmSysConfigAndInfo->SysConfig.TTIA_Info.busVenderId = busVenderId;
  1203. }
  1204. if( json_object_object_get_ex(jobj, "EquipmentProvider", &val_obj) ) {
  1205. EquipmentProvider = (char*)json_object_get_string(val_obj);
  1206. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.EquipmentProvider,EquipmentProvider);
  1207. }
  1208. if( json_object_object_get_ex(jobj, "TransportationCompanyNo", &val_obj) ) {
  1209. TransportationCompanyNo = json_object_get_int(val_obj);
  1210. ShmSysConfigAndInfo->SysConfig.TTIA_Info.TransportationCompanyNo = TransportationCompanyNo;
  1211. }
  1212. if( json_object_object_get_ex(jobj, "TTIAChargeBoxId", &val_obj) ) {
  1213. TTIAChargeBoxId = json_object_get_int(val_obj);
  1214. ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId = TTIAChargeBoxId;
  1215. }
  1216. if( json_object_object_get_ex(jobj, "evseStation", &val_obj) ) {
  1217. evseStation = (char*)json_object_get_string(val_obj);
  1218. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation,evseStation);
  1219. }
  1220. }
  1221. struct SysConfigData SysConfig;
  1222. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  1223. int result = StoreUsrConfigData(&SysConfig);
  1224. if(result != 1){
  1225. #ifdef SystemLogMessage
  1226. StoreLogMsg("[WebService]StoreUsrConfigData: normal NG");
  1227. #endif
  1228. }
  1229. else{
  1230. #ifdef SystemLogMessage
  1231. StoreLogMsg("[WebService]StoreUsrConfigData: normal OK");
  1232. #endif
  1233. }
  1234. #ifdef SystemLogMessage
  1235. DEBUG_INFO("WebServiceConfig update OK");
  1236. #endif
  1237. }
  1238. //web api
  1239. if ((argc == 3) & (strlen(argv[1]) == 2)) {
  1240. if (strcmp(argv[1], "21") == 0) {
  1241. struct json_object *jobj = json_tokener_parse(argv[2]);
  1242. json_object *val_obj = NULL;
  1243. int MaxChargingEnergy= 0;
  1244. int MaxChargingPower = 0;
  1245. int MaxChargingCurrent = 0;
  1246. int MaxChargingVoltage = 0;
  1247. int AcMaxChargingCurrent = 0;
  1248. int MaxChargingDuration = 0;
  1249. int MaxChargingSoc = 0;
  1250. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  1251. MaxChargingEnergy = json_object_get_int(val_obj);
  1252. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  1253. }
  1254. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  1255. MaxChargingPower = json_object_get_int(val_obj);
  1256. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  1257. }
  1258. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  1259. MaxChargingCurrent = json_object_get_int(val_obj);
  1260. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  1261. }
  1262. if( json_object_object_get_ex(jobj, "MaxChargingVoltage", &val_obj) ) {
  1263. MaxChargingVoltage = json_object_get_int(val_obj);
  1264. ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage = MaxChargingVoltage;
  1265. }
  1266. if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
  1267. AcMaxChargingCurrent = json_object_get_int(val_obj);
  1268. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
  1269. }
  1270. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  1271. MaxChargingDuration = json_object_get_int(val_obj);
  1272. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  1273. }
  1274. if( json_object_object_get_ex(jobj, "MaxChargingSoc", &val_obj) ) {
  1275. MaxChargingSoc = json_object_get_int(val_obj);
  1276. ShmSysConfigAndInfo->SysConfig.MaxChargingSoc = MaxChargingSoc;
  1277. }
  1278. DEBUG_INFO("WebService Remote Api update OK");
  1279. }
  1280. }
  1281. if (argc == 2)
  1282. { //init share memory for test
  1283. if (strcmp(argv[1], "aaa") == 0)
  1284. {
  1285. //struct SysConfigData SysConfig;
  1286. //system
  1287. ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=1;
  1288. ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=1;
  1289. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DO0E362001D1P0D");
  1290. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber, "SerialNumber");
  1291. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId, "1234567890");
  1292. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemDateTime, "2019-12-31 23:59:59");
  1293. ShmSysConfigAndInfo->SysConfig.AcPhaseCount=1;
  1294. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy=0;
  1295. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration=0;
  1296. ShmSysConfigAndInfo->SysConfig.AuthorisationMode=0;
  1297. ShmSysConfigAndInfo->SysConfig.DefaultLanguage=0;
  1298. ShmSysConfigAndInfo->SysInfo.InputVoltageR=0;
  1299. ShmSysConfigAndInfo->SysInfo.InputVoltageS=0;
  1300. ShmSysConfigAndInfo->SysInfo.InputVoltageT=0;
  1301. ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed=0;
  1302. ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed=0;
  1303. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian=0;
  1304. ShmSysConfigAndInfo->SysConfig.RatingCurrent=100;
  1305. ShmSysConfigAndInfo->SysConfig.PsuAcInputType=0;
  1306. ShmSysConfigAndInfo->SysInfo.AuxPower5V=0;
  1307. ShmSysConfigAndInfo->SysInfo.AuxPower12V=0;
  1308. ShmSysConfigAndInfo->SysInfo.AuxPower24V=0;
  1309. ShmSysConfigAndInfo->SysInfo.AuxPower48V=0;
  1310. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev, "");
  1311. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev, "");
  1312. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev, "");
  1313. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "");
  1314. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, "");
  1315. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev, "");
  1316. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev, "");
  1317. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev, "");
  1318. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev, "");
  1319. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev, "");
  1320. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev, "");
  1321. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev, "");
  1322. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev, "");
  1323. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev, "");
  1324. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev, "");
  1325. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev, "");
  1326. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev, "");
  1327. ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp=0;
  1328. ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp=0;
  1329. ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp=0;
  1330. ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp=0;
  1331. ShmSysConfigAndInfo->SysConfig.AcPlugInTimes=0;
  1332. ShmSysConfigAndInfo->SysConfig.GbPlugInTimes=0;
  1333. ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime=0;
  1334. ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes=0;
  1335. ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes=0;
  1336. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwPrimaryVersion, "DC 9.01");
  1337. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwPrimaryVersion, "DC 9.02");
  1338. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwSecondVersion, "PFC 9.02");
  1339. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwSecondVersion, "PFC 9.03");
  1340. ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=4;
  1341. ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=2;
  1342. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].ConnectorQuantity=2;
  1343. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].ConnectorQuantity=2;
  1344. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].LocalStatus=0;
  1345. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].LocalStatus=0;
  1346. //charging
  1347. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=0;
  1348. ShmSysConfigAndInfo->SysConfig.MaxChargingPower=0;
  1349. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent= 0;
  1350. ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage= 0;
  1351. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent= 0;
  1352. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=0;
  1353. ShmSysConfigAndInfo->SysConfig.MaxChargingSoc=0;
  1354. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0], "111");
  1355. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1], "222");
  1356. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2], "333");
  1357. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3], "444");
  1358. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4], "555");
  1359. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5], "666");
  1360. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6], "777");
  1361. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7], "888");
  1362. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8], "999");
  1363. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9], "aaa");
  1364. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.UserId, "UserId");
  1365. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingVoltage=0;
  1366. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingCurrent=0;
  1367. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingPower=0;
  1368. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedEnergy=0;
  1369. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedDuration=0;
  1370. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].RemainChargingDuration=0;
  1371. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatteryMaxVoltage=0;
  1372. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetVoltage=0;
  1373. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterySoc=0;
  1374. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].SystemStatus=1;
  1375. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetCurrent=1;
  1376. //network
  1377. ShmSysConfigAndInfo->SysInfo.InternetConn=0;
  1378. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer,"");
  1379. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=1;
  1380. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress,"");
  1381. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,"192.168.1.10");
  1382. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
  1383. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,"192.168.1.1");
  1384. ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=1;
  1385. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress,"");
  1386. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,"192.168.0.10");
  1387. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
  1388. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,"192.168.0.1");
  1389. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=1;
  1390. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,"");
  1391. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,"");
  1392. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi=0;
  1393. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=0;
  1394. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=0;
  1395. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress,"");
  1396. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,"");
  1397. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,"");
  1398. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,"");
  1399. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn=1;
  1400. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,"");
  1401. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=0;
  1402. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,"");
  1403. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,"");
  1404. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei,"");
  1405. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi,"");
  1406. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid,"");
  1407. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
  1408. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=0;
  1409. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,"");
  1410. //backend
  1411. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout=300;
  1412. ShmSysConfigAndInfo->SysConfig.OfflinePolicy=0;
  1413. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy=0;
  1414. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration=0;
  1415. ShmSysConfigAndInfo->SysInfo.OcppConnStatus=0;
  1416. ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus=0;
  1417. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"");
  1418. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,"");
  1419. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,"Phihong");
  1420. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=0;
  1421. struct SysConfigData SysConfig;
  1422. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  1423. StoreUsrConfigData(&SysConfig);
  1424. // struct PsuModuleVer PsuData;
  1425. // memcpy(&PsuData, &ShmPsuData->PsuVersion, sizeof(struct PsuModuleVer));
  1426. // StoreUsrConfigData(&PsuData);
  1427. #ifdef SystemLogMessage
  1428. DEBUG_INFO("WebService initial OK");
  1429. #endif
  1430. }
  1431. if (strcmp(argv[1], "button") == 0)
  1432. {
  1433. unsigned char Button1;
  1434. unsigned char Button2;
  1435. unsigned char EmergencyButton;
  1436. Button1=ShmPrimaryMcuData->InputDet.bits.Button1;
  1437. Button2=ShmPrimaryMcuData->InputDet.bits.Button2;
  1438. EmergencyButton=ShmPrimaryMcuData->InputDet.bits.EmergencyButton;
  1439. struct json_object *jobj;
  1440. struct json_object *sButton1;
  1441. struct json_object *sButton2;
  1442. struct json_object *sEmergencyButton;
  1443. sButton1 = json_object_new_int(Button1);
  1444. sButton2 = json_object_new_int(Button2);
  1445. sEmergencyButton = json_object_new_int(EmergencyButton);
  1446. jobj=json_object_new_object();
  1447. json_object_object_add(jobj,"Button1",sButton1);
  1448. json_object_object_add(jobj,"Button2",sButton2);
  1449. json_object_object_add(jobj,"EmergencyButton",sEmergencyButton);
  1450. printf("%s\n", json_object_to_json_string(jobj));
  1451. }
  1452. if (strcmp(argv[1], "restart") == 0)
  1453. {
  1454. if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16) && (system("pidof -s OcppBackend > /dev/null") == 0))
  1455. {
  1456. sprintf((char*)ShmOCPP16Data->Reset.Type, "Hard");
  1457. ShmOCPP16Data->MsMsg.bits.ResetReq = 1;
  1458. DEBUG_INFO("Hard reset by OCPP1.6 form web page.\n");
  1459. }
  1460. else if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20) && (system("pidof -s OcppBackend20 > /dev/null") == 0))
  1461. {
  1462. sprintf((char*)ShmOCPP20Data->Reset.type, "Immediate");
  1463. ShmOCPP20Data->MsMsg.bits.ResetReq = 1;
  1464. DEBUG_INFO("Hard reset by OCPP2.0.1 form web page.\n");
  1465. }
  1466. else
  1467. {
  1468. //system("exec /usr/bin/run_evse_restart.sh");
  1469. system("exec /sbin/reboot");
  1470. DEBUG_INFO("Hard reset directly form web page.\n");
  1471. }
  1472. }
  1473. }
  1474. if(strcmp(argv[1], "log") == 0)
  1475. {
  1476. char cmd[512];
  1477. char *IsDO[3];
  1478. uint16_t Heartbeat=0;
  1479. substr((char *)IsDO,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,2);
  1480. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  1481. ShmSysConfigAndInfo->SysInfo.isDispenserLog=1;
  1482. for(;;){
  1483. if(ShmSysConfigAndInfo->SysInfo.isDispenserLog==0){
  1484. break;
  1485. }
  1486. if(Heartbeat==0xb4){
  1487. break;
  1488. }
  1489. else{
  1490. Heartbeat++;
  1491. sleep(1);
  1492. }
  1493. }
  1494. }
  1495. if((argc == 3) && isdigit(*argv[2]))
  1496. {
  1497. sprintf(cmd, "exec /root/logPackTools 'log' %s", argv[2]);
  1498. }
  1499. else
  1500. {
  1501. sprintf(cmd, "exec /root/logPackTools 'log'");
  1502. }
  1503. if(system(cmd) == 0)
  1504. {
  1505. DEBUG_INFO("Log pack success.\n");
  1506. }
  1507. else
  1508. {
  1509. DEBUG_INFO("Log pack fail.\n");
  1510. }
  1511. }
  1512. //upgrade firmware
  1513. if ((argc == 3) & (strcmp(argv[1], "upgrade") == 0))
  1514. {
  1515. struct json_object *jobj;
  1516. struct json_object *Result;
  1517. struct json_object *Message;
  1518. //char cmd[100];
  1519. jobj=json_object_new_object();
  1520. //system
  1521. //if((char)ShmSysConfigAndInfo->SysInfo.FirmwareUpdate == '0'){
  1522. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=1;
  1523. Result = json_object_new_string("success");
  1524. Message = json_object_new_string("File is uploaded, please wait a moment to upgrade");
  1525. //}
  1526. /*else{
  1527. sprintf(cmd,"rm /mnt/%s",argv[2]);
  1528. system(cmd);
  1529. Result = json_object_new_string("error");
  1530. Message = json_object_new_string("machine is busy");
  1531. }*/
  1532. json_object_object_add(jobj,"Result",Result);
  1533. json_object_object_add(jobj,"Message",Message);
  1534. printf("%s\n", json_object_to_json_string(jobj));
  1535. }
  1536. #ifdef DO360
  1537. //set power cabinet
  1538. // ./WebService "PowerCabinet" Cmd "{'FTargetVoltage': val,'FTargetCurrent': val, 'Gun': val}"
  1539. if ((strcmp(argv[1], "PowerCabinet") == 0)) {
  1540. char *IsDO[3];
  1541. substr((char *)IsDO,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,2);
  1542. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  1543. struct json_object *jobj2;
  1544. jobj2=json_object_new_object();
  1545. int Gun = 0;
  1546. //force charging
  1547. if (strcmp(argv[2], "1") == 0) {
  1548. json_object_object_add(jobj2,"Cmd",json_object_new_string("1"));
  1549. int FTargetVoltage = 0;
  1550. int FTargetCurrent = 0;
  1551. if(strlen(argv[3]) >0){
  1552. struct json_object *jobj = json_tokener_parse(argv[3]);
  1553. json_object *val_obj = NULL;
  1554. if( json_object_object_get_ex(jobj, "Gun", &val_obj) ) {
  1555. Gun = json_object_get_int(val_obj);
  1556. if( json_object_object_get_ex(jobj, "FTargetVoltage", &val_obj) ) {
  1557. FTargetVoltage = json_object_get_int(val_obj);
  1558. ShmChargerInfo->Control.FCharging[Gun].FTargetVoltage = FTargetVoltage * 10;
  1559. json_object_object_add(jobj2,"FTargetVoltage",json_object_new_int(FTargetVoltage));
  1560. }
  1561. if( json_object_object_get_ex(jobj, "FTargetCurrent", &val_obj) ) {
  1562. FTargetCurrent = json_object_get_int(val_obj);
  1563. ShmChargerInfo->Control.FCharging[Gun].FTargetCurrent = FTargetCurrent * 10;
  1564. json_object_object_add(jobj2,"FTargetCurrent",json_object_new_int(FTargetCurrent));
  1565. }
  1566. ShmChargerInfo->Control.FCharging[Gun].FCtrl.bits.EnableForceCharging=1;
  1567. ShmChargerInfo->Control.FCharging[Gun].FCtrl.bits.StartForceCharging=1;
  1568. ShmChargerInfo->Control.FCharging[Gun].FCtrl.bits.WebApiTrigger=1;
  1569. }
  1570. }
  1571. printf("%s\n", json_object_to_json_string(jobj2));
  1572. }
  1573. //remote stop
  1574. if (strcmp(argv[2], "2") == 0) {
  1575. if(strlen(argv[3]) >0){
  1576. struct json_object *jobj = json_tokener_parse(argv[3]);
  1577. json_object *val_obj = NULL;
  1578. if( json_object_object_get_ex(jobj, "Gun", &val_obj) ) {
  1579. Gun = json_object_get_int(val_obj);
  1580. json_object_object_add(jobj2,"Cmd",json_object_new_string("2"));
  1581. ShmSysConfigAndInfo->SysInfo.ConnectorInfo[Gun].GeneralChargingData.ChargingStopFlag.bits.ManualStop=1;
  1582. printf("%s\n", json_object_to_json_string(jobj2));
  1583. }
  1584. }
  1585. }
  1586. if (strcmp(argv[2], "0") == 0) {
  1587. struct json_object *jobj;
  1588. jobj=json_object_new_object();
  1589. struct json_object *FTargetVoltage;
  1590. struct json_object *FTargetCurrent;
  1591. struct json_object *EnableForceCharging;
  1592. struct json_object *StartForceCharging;
  1593. struct json_object *WebApiTrigger;
  1594. struct json_object *ManualStop;
  1595. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FTargetVoltage);
  1596. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FTargetCurrent);
  1597. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FCtrl.bits.EnableForceCharging);
  1598. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FCtrl.bits.StartForceCharging);
  1599. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FCtrl.bits.WebApiTrigger);
  1600. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[0].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1601. json_object_object_add(jobj,"FTargetVoltage0",FTargetVoltage);
  1602. json_object_object_add(jobj,"FTargetCurrent0",FTargetCurrent);
  1603. json_object_object_add(jobj,"EnableForceCharging0",EnableForceCharging);
  1604. json_object_object_add(jobj,"StartForceCharging0",StartForceCharging);
  1605. json_object_object_add(jobj,"WebApiTrigger0",WebApiTrigger);
  1606. json_object_object_add(jobj,"ManualStop0",ManualStop);
  1607. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FTargetVoltage);
  1608. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FTargetCurrent);
  1609. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FCtrl.bits.EnableForceCharging);
  1610. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FCtrl.bits.StartForceCharging);
  1611. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FCtrl.bits.WebApiTrigger);
  1612. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[1].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1613. json_object_object_add(jobj,"FTargetVoltage1",FTargetVoltage);
  1614. json_object_object_add(jobj,"FTargetCurrent1",FTargetCurrent);
  1615. json_object_object_add(jobj,"EnableForceCharging1",EnableForceCharging);
  1616. json_object_object_add(jobj,"StartForceCharging1",StartForceCharging);
  1617. json_object_object_add(jobj,"WebApiTrigger1",WebApiTrigger);
  1618. json_object_object_add(jobj,"ManualStop1",ManualStop);
  1619. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FTargetVoltage);
  1620. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FTargetCurrent);
  1621. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FCtrl.bits.EnableForceCharging);
  1622. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FCtrl.bits.StartForceCharging);
  1623. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FCtrl.bits.WebApiTrigger);
  1624. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[2].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1625. json_object_object_add(jobj,"FTargetVoltage2",FTargetVoltage);
  1626. json_object_object_add(jobj,"FTargetCurrent2",FTargetCurrent);
  1627. json_object_object_add(jobj,"EnableForceCharging2",EnableForceCharging);
  1628. json_object_object_add(jobj,"StartForceCharging2",StartForceCharging);
  1629. json_object_object_add(jobj,"WebApiTrigger2",WebApiTrigger);
  1630. json_object_object_add(jobj,"ManualStop2",ManualStop);
  1631. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FTargetVoltage);
  1632. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FTargetCurrent);
  1633. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FCtrl.bits.EnableForceCharging);
  1634. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FCtrl.bits.StartForceCharging);
  1635. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FCtrl.bits.WebApiTrigger);
  1636. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[3].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1637. json_object_object_add(jobj,"FTargetVoltage3",FTargetVoltage);
  1638. json_object_object_add(jobj,"FTargetCurrent3",FTargetCurrent);
  1639. json_object_object_add(jobj,"EnableForceCharging3",EnableForceCharging);
  1640. json_object_object_add(jobj,"StartForceCharging3",StartForceCharging);
  1641. json_object_object_add(jobj,"WebApiTrigger3",WebApiTrigger);
  1642. json_object_object_add(jobj,"ManualStop3",ManualStop);
  1643. printf("%s\n", json_object_to_json_string(jobj));
  1644. json_object_put(jobj);
  1645. }
  1646. }
  1647. }
  1648. #endif
  1649. //web page query all
  1650. if ((argc == 2) & (strcmp(argv[1], "query") == 0)) {
  1651. char *IsAcDc[2];
  1652. char *SafetyRegulation[2];
  1653. char *IsDO[3];
  1654. char *Connector1[2];
  1655. char *Connector2[2];
  1656. char *Connector3[2];
  1657. char *Network[2];
  1658. //unsigned char connector1FwVer[32];
  1659. //unsigned char connector2FwVer[32];
  1660. short gunQty;
  1661. char *RatedPower1[2];
  1662. char *RatedPower2[2];
  1663. char *RatedPower3[2];
  1664. short RatedPower;
  1665. short PsuQuantity = 0;
  1666. substr((char *)IsAcDc,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,1);
  1667. substr((char *)SafetyRegulation,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,3,1);
  1668. substr((char *)IsDO,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,2);
  1669. substr((char *)Connector1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,7,1);
  1670. substr((char *)Connector2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
  1671. substr((char *)Connector3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
  1672. substr((char *)Network,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,10,1);
  1673. int connectorType1,connectorType2,connectorType3;
  1674. connectorType1=ConnectorType((char *)Connector1);
  1675. connectorType2=ConnectorType((char *)Connector2);
  1676. connectorType3=ConnectorType((char *)Connector3);
  1677. if(connectorType1 == connectorType2){
  1678. gunQty = 1;
  1679. }
  1680. else{
  1681. gunQty = 0;
  1682. }
  1683. if(connectorType1 != 0){
  1684. if(connectorType1 == 1){
  1685. // strcpy((char *)&connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  1686. // memcpy(connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  1687. }
  1688. else if(connectorType1 == 2){
  1689. // strcpy((char *)&connector1FwVer,ShmGBTData->evse[0].version);
  1690. // memcpy(connector1FwVer,ShmGBTData->evse[0].version,ARRAY_SIZE(ShmGBTData->evse[0].version));
  1691. }
  1692. else if(connectorType1 == 3){
  1693. // strcpy((char *)&connector1FwVer,ShmCHAdeMOData->evse[0].version);
  1694. // memcpy(connector1FwVer,ShmCHAdeMOData->evse[0].version,ARRAY_SIZE(ShmCHAdeMOData->evse[0].version));
  1695. }
  1696. }
  1697. if(connectorType2 != 0){
  1698. if(connectorType2 == 1){
  1699. // strcpy((char *)&connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  1700. // memcpy(connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  1701. }
  1702. else if(connectorType2 == 2){
  1703. // strcpy((char *)&connector2FwVer,ShmGBTData->evse[gunQty].version);
  1704. // memcpy(connector2FwVer,ShmGBTData->evse[gunQty].version,ARRAY_SIZE(ShmGBTData->evse[gunQty].version));
  1705. }
  1706. else if(connectorType2 == 3){
  1707. // strcpy((char *)&connector2FwVer,ShmCHAdeMOData->evse[gunQty].version);
  1708. // memcpy(connector2FwVer,ShmCHAdeMOData->evse[gunQty].version,ARRAY_SIZE(ShmCHAdeMOData->evse[gunQty].version));
  1709. }
  1710. }
  1711. substr((char *)RatedPower1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,4,1);
  1712. substr((char *)RatedPower2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,5,1);
  1713. substr((char *)RatedPower3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,6,1);
  1714. int p1=atoi((char *)RatedPower1);
  1715. int p2=atoi((char *)RatedPower2);
  1716. int p3=atoi((char *)RatedPower3);
  1717. if(strcmp(IsAcDc, "D") == 0){
  1718. RatedPower=(p1*10+p2)*pow(10,p3-1);
  1719. if(RatedPower==50){
  1720. PsuQuantity = 3;
  1721. }
  1722. else{
  1723. // if(RatedPower>=30){
  1724. PsuQuantity = RatedPower/30;
  1725. // }
  1726. }
  1727. }
  1728. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  1729. }
  1730. struct json_object *jobj1;
  1731. struct json_object *jobj2;
  1732. struct json_object *jobj3;
  1733. struct json_object *jobj4;
  1734. //system
  1735. struct json_object *ModelName;
  1736. struct json_object *AcModelName;
  1737. struct json_object *SerialNumber;
  1738. struct json_object *SystemId;
  1739. struct json_object *AcPhaseCount;
  1740. struct json_object *PhaseLossPolicy;
  1741. struct json_object *FactoryConfiguration;
  1742. struct json_object *AuthorisationMode;
  1743. struct json_object *DefaultLanguage;
  1744. struct json_object *InputVoltageR;
  1745. struct json_object *InputVoltageS;
  1746. struct json_object *InputVoltageT;
  1747. struct json_object *InputVoltageDc;
  1748. struct json_object *SystemFanRotaSpeed;
  1749. struct json_object *PsuFanRotaSpeed;
  1750. struct json_object *RfidCardNumEndian;
  1751. struct json_object *PsuAcInputType;
  1752. struct json_object *RatingCurrent;
  1753. struct json_object *AcRatingCurrent;
  1754. struct json_object *isAPP;
  1755. struct json_object *isQRCode;
  1756. struct json_object *isRFID;
  1757. struct json_object *QRCodeMadeMode;
  1758. struct json_object *QRCodeContent;
  1759. struct json_object *Intensity;
  1760. struct json_object *isAuthrizeByEVCCID;
  1761. struct json_object *AuxPower5V;
  1762. struct json_object *AuxPower12V;
  1763. struct json_object *AuxPower24V;
  1764. struct json_object *AuxPower48V;
  1765. struct json_object *CsuHwRev;
  1766. struct json_object *CsuBootLoadFwRev;
  1767. struct json_object *CsuKernelFwRev;
  1768. struct json_object *CsuRootFsFwRev;
  1769. struct json_object *CsuPrimFwRev;
  1770. struct json_object *LcmHwRev;
  1771. struct json_object *LcmFwRev;
  1772. struct json_object *PsuHwRev;
  1773. struct json_object *PsuPrimFwRev;
  1774. struct json_object *PsuSecFwRev;
  1775. struct json_object *AuxPwrHwRev;
  1776. struct json_object *AuxPwrFwRev;
  1777. struct json_object *FanModuleHwRev;
  1778. struct json_object *FanModuleFwRev;
  1779. struct json_object *RelayModuleHwRev;
  1780. struct json_object *RelayModuleFwRev;
  1781. struct json_object *TelcomModemFwRev;
  1782. struct json_object *Connector1FwRev;
  1783. struct json_object *Connector2FwRev;
  1784. struct json_object *PsuLostQuantity;
  1785. /* for DC+AC*/
  1786. struct json_object *Connector3FwRev;
  1787. struct json_object *LedModuleFwRev;
  1788. struct json_object *SystemAmbientTemp;
  1789. struct json_object *SystemCriticalTemp;
  1790. struct json_object *CcsConnectorTemp;
  1791. struct json_object *PsuAmbientTemp;
  1792. struct json_object *AcPlugInTimes;
  1793. struct json_object *GbPlugInTimes;
  1794. struct json_object *Ccs1PlugInTime;
  1795. struct json_object *Ccs2PlugInTimes;
  1796. struct json_object *ChademoPlugInTimes;
  1797. struct json_object *FirmwareUpdate;
  1798. struct json_object *FwPrimaryVersion[PsuQuantity];
  1799. struct json_object *FwPrimaryVersionArr= json_object_new_array();
  1800. struct json_object *FwSecondVersion[PsuQuantity];
  1801. struct json_object *FwSecondVersionArr= json_object_new_array();
  1802. /* for DO & DD*/
  1803. struct json_object *DispenserQuantity;
  1804. struct json_object *TotalConnectorQuantity;
  1805. struct json_object *DDLocalStatus[4];
  1806. struct json_object *DDLocalStatusArr= json_object_new_array();
  1807. struct json_object *DDModelName[4];
  1808. struct json_object *DDModelNameArr= json_object_new_array();
  1809. struct json_object *DDSerialNumber[4];
  1810. struct json_object *DDSerialNumberArr= json_object_new_array();
  1811. struct json_object *DDSystemId[4];
  1812. struct json_object *DDSystemIdArr= json_object_new_array();
  1813. struct json_object *DDAuthorisationMode[4];
  1814. struct json_object *DDAuthorisationModeArr= json_object_new_array();
  1815. struct json_object *DDRfidCardNumEndian[4];
  1816. struct json_object *DDRfidCardNumEndianArr= json_object_new_array();
  1817. struct json_object *DDisAPP[4];
  1818. struct json_object *DDisAPPArr= json_object_new_array();
  1819. struct json_object *DDisQRCode[4];
  1820. struct json_object *DDisQRCodeArr= json_object_new_array();
  1821. struct json_object *DDisRFID[4];
  1822. struct json_object *DDisRFIDArr= json_object_new_array();
  1823. struct json_object *DDQRCodeMadeMode[4];
  1824. struct json_object *DDQRCodeMadeModeArr= json_object_new_array();
  1825. struct json_object *DDQRCodeContent[4];
  1826. struct json_object *DDQRCodeContentArr= json_object_new_array();
  1827. struct json_object *DDFactoryConfiguration[4];
  1828. struct json_object *DDFactoryConfigurationArr= json_object_new_array();
  1829. struct json_object *DDCsuBootLoadFwRev[4];
  1830. struct json_object *DDCsuBootLoadFwRevArr= json_object_new_array();
  1831. struct json_object *DDCsuKernelFwRev[4];
  1832. struct json_object *DDCsuKernelFwRevArr= json_object_new_array();
  1833. struct json_object *DDCsuRootFsFwRev[4];
  1834. struct json_object *DDCsuRootFsFwRevArr= json_object_new_array();
  1835. struct json_object *DDCsuPrimFwRev[4];
  1836. struct json_object *DDCsuPrimFwRevArr= json_object_new_array();
  1837. struct json_object *DDLcmFwRev[4];
  1838. struct json_object *DDLcmFwRevArr= json_object_new_array();
  1839. struct json_object *DDPsuPrimFwRev[4];
  1840. struct json_object *DDPsuPrimFwRevArr= json_object_new_array();
  1841. struct json_object *DDPsuSecFwRev[4];
  1842. struct json_object *DDPsuSecFwRevArr= json_object_new_array();
  1843. struct json_object *DDFanModuleFwRev[4];
  1844. struct json_object *DDFanModuleFwRevArr= json_object_new_array();
  1845. struct json_object *DDRelayModuleFwRev[4];
  1846. struct json_object *DDRelayModuleFwRevArr= json_object_new_array();
  1847. struct json_object *DDTelcomModemFwRev[4];
  1848. struct json_object *DDTelcomModemFwRevArr= json_object_new_array();
  1849. struct json_object *DDLedModuleFwRev[4];
  1850. struct json_object *DDLedModuleFwRevArr= json_object_new_array();
  1851. struct json_object *DDConnector1FwRev[4];
  1852. struct json_object *DDConnector1FwRevArr= json_object_new_array();
  1853. struct json_object *DDConnector2FwRev[4];
  1854. struct json_object *DDConnector2FwRevArr= json_object_new_array();
  1855. struct json_object *DDIntensity[4];
  1856. struct json_object *DDIntensityArr= json_object_new_array();
  1857. struct json_object *Relay2ModuleFwRev;
  1858. //charging
  1859. struct json_object *MaxChargingEnergy;
  1860. struct json_object *MaxChargingPower;
  1861. struct json_object *MaxChargingCurrent;
  1862. struct json_object *MaxChargingVoltage;
  1863. struct json_object *AcMaxChargingCurrent;
  1864. struct json_object *MaxChargingDuration;
  1865. struct json_object *MaxChargingSoc;
  1866. struct json_object *StopChargingByButton;
  1867. struct json_object *FanControlPolicy;
  1868. struct json_object *LocalWhiteCard[10];
  1869. struct json_object *LocalWhiteCardArr= json_object_new_array();
  1870. struct json_object *isBilling;
  1871. struct json_object *Currency;
  1872. struct json_object *Fee[24];
  1873. struct json_object *FeeArr= json_object_new_array();
  1874. struct json_object *ChargingInfo1;
  1875. struct json_object *ChargingInfo2;
  1876. struct json_object *ChargingInfo3;
  1877. struct json_object *StartUserId[3];
  1878. struct json_object *StartDateTime[3];
  1879. struct json_object *StopDateTime[3];
  1880. struct json_object *StartMethod[3];
  1881. struct json_object *ConnectorTemp[3];
  1882. struct json_object *ChillerTemp[3];
  1883. struct json_object *PresentChargingVoltage[3];
  1884. struct json_object *PresentChargingCurrent[3];
  1885. struct json_object *PresentChargingPower[3];
  1886. struct json_object *PresentChargedEnergy[3];
  1887. struct json_object *PresentChargedDuration[3];
  1888. struct json_object *RemainChargingDuration[3];
  1889. struct json_object *EvBatteryMaxVoltage[3];
  1890. struct json_object *EvBatterytargetVoltage[3];
  1891. struct json_object *EvBatterySoc[3];
  1892. struct json_object *PilotVoltage[3];
  1893. struct json_object *SystemStatus[3];
  1894. struct json_object *EvBatterytargetCurrent[3];
  1895. struct json_object *PowerConsumption[3];
  1896. struct json_object *isCalibratedVaGain[3];
  1897. struct json_object *isCalibratedVbGain[3];
  1898. struct json_object *isCalibratedVcGain[3];
  1899. struct json_object *isCalibratedVaOffset[3];
  1900. struct json_object *isCalibratedVbOffset[3];
  1901. struct json_object *isCalibratedVcOffset[3];
  1902. struct json_object *isCalibratedCaGain[3];
  1903. struct json_object *isCalibratedCbGain[3];
  1904. struct json_object *isCalibratedCcGain[3];
  1905. struct json_object *isCalibratedCaOffset[3];
  1906. struct json_object *isCalibratedCbOffset[3];
  1907. struct json_object *isCalibratedCcOffset[3];
  1908. struct json_object *isCalibratedPa[3];
  1909. struct json_object *isCalibratedPb[3];
  1910. struct json_object *isCalibratedPc[3];
  1911. struct json_object *V2GPrivateKey;
  1912. struct json_object *V2GRootCertificate;
  1913. struct json_object *V2GCertificateChain;
  1914. struct json_object *isEnable15118;
  1915. struct json_object *isEnableR2R;
  1916. /* for DO & DD*/
  1917. struct json_object *DDChargingInfo1;
  1918. struct json_object *DDChargingInfo2;
  1919. struct json_object *DDChargingInfo3;
  1920. struct json_object *DDChargingInfo4;
  1921. struct json_object *DDStartUserId[4];
  1922. struct json_object *DDStartDateTime[4];
  1923. struct json_object *DDStopDateTime[4];
  1924. struct json_object *DDStartMethod[4];
  1925. struct json_object *DDConnectorTemp[4];
  1926. struct json_object *DDChillerTemp[4];
  1927. struct json_object *DDPresentChargingVoltage[4];
  1928. struct json_object *DDPresentChargingCurrent[4];
  1929. struct json_object *DDPresentChargingPower[4];
  1930. struct json_object *DDPresentChargedEnergy[4];
  1931. struct json_object *DDPresentChargedDuration[4];
  1932. struct json_object *DDRemainChargingDuration[4];
  1933. struct json_object *DDEvBatteryMaxVoltage[4];
  1934. struct json_object *DDEvBatterytargetVoltage[4];
  1935. struct json_object *DDEvBatterySoc[4];
  1936. struct json_object *DDSystemStatus[4];
  1937. struct json_object *DDEvBatterytargetCurrent[4];
  1938. struct json_object *DDPowerConsumption[4];
  1939. //network
  1940. struct json_object *InternetConn;
  1941. struct json_object *FtpServer;
  1942. struct json_object *Eth0DhcpClient;
  1943. struct json_object *Eth0MacAddress;
  1944. struct json_object *Eth0IpAddress;
  1945. struct json_object *Eth0SubmaskAddress;
  1946. struct json_object *Eth0GatewayAddress;
  1947. struct json_object *Eth1DhcpClient;
  1948. struct json_object *Eth1MacAddress;
  1949. struct json_object *Eth1IpAddress;
  1950. struct json_object *Eth1SubmaskAddress;
  1951. struct json_object *Eth1GatewayAddress;
  1952. struct json_object *WifiMode;
  1953. struct json_object *WifiSsid;
  1954. struct json_object *WifiPassword;
  1955. struct json_object *WifiBroadcastSsid;
  1956. struct json_object *WifiTargetBssidMac;
  1957. struct json_object *WifiRssi;
  1958. struct json_object *WifiDhcpServer;
  1959. struct json_object *WifiDhcpClient;
  1960. struct json_object *WifiMacAddress;
  1961. struct json_object *WifiIpAddress;
  1962. struct json_object *WifiSubmaskAddress;
  1963. struct json_object *WifiGatewayAddress;
  1964. struct json_object *WifiNetworkConn;
  1965. struct json_object *TelcomApn;
  1966. struct json_object *TelcomRssi;
  1967. struct json_object *TelcomChapPapId;
  1968. struct json_object *TelcomChapPapPwd;
  1969. struct json_object *TelcomModemImei;
  1970. struct json_object *TelcomSimImsi;
  1971. struct json_object *TelcomSimIccid;
  1972. struct json_object *TelcomSimStatus;
  1973. struct json_object *TelcomModemMode;
  1974. struct json_object *TelcomIpAddress;
  1975. struct json_object *TelcomNetworkConn;
  1976. struct json_object *TelcomEnabled;
  1977. struct json_object *TelcomNetworkType;
  1978. struct json_object *isEnalbleFirewall;
  1979. struct json_object *FirewallAcceptAddr[10];
  1980. struct json_object *FirewallAcceptAddrArr= json_object_new_array();
  1981. //backend
  1982. struct json_object *BackendConnTimeout;
  1983. struct json_object *OfflinePolicy;
  1984. struct json_object *OfflineMaxChargeEnergy;
  1985. struct json_object *OfflineMaxChargeDuration;
  1986. struct json_object *OcppConnStatus;
  1987. struct json_object *MaintainServerConnStatus;
  1988. struct json_object *OcppServerURL;
  1989. struct json_object *ChargeBoxId;
  1990. struct json_object *chargePointVendor;
  1991. struct json_object *OcppSecurityProfile;
  1992. struct json_object *OcppSecurityPassword;
  1993. struct json_object *MaintainServerSecurityProfile;
  1994. struct json_object *MaintainServerSecurityPassword;
  1995. struct json_object *isEnableLocalPowerSharging;
  1996. struct json_object *PowerSharingCapacity;
  1997. struct json_object *PowerSharingServerIP;
  1998. struct json_object *OcppReceiptrURL;
  1999. struct json_object *MaintainServerURL;
  2000. struct json_object *ChargePointPrivateKey;
  2001. struct json_object *ChargePointCertificate;
  2002. struct json_object *MORootCertificate;
  2003. struct json_object *CSRootCertificate;
  2004. struct json_object *ManufacturerRootCertificate;
  2005. /*for TTIA*/
  2006. struct json_object *isEnableTTIA;
  2007. struct json_object *server_addr;
  2008. struct json_object *server_port;
  2009. struct json_object *busVenderId;
  2010. struct json_object *EquipmentProvider;
  2011. struct json_object *TransportationCompanyNo;
  2012. struct json_object *TTIAChargeBoxId;
  2013. struct json_object *evseStation;
  2014. jobj1=json_object_new_object();
  2015. jobj2=json_object_new_object();
  2016. jobj3=json_object_new_object();
  2017. jobj4=json_object_new_object();
  2018. //system
  2019. ModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ModelName);
  2020. AcModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AcModelName);
  2021. SerialNumber = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber);
  2022. SystemId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SystemId);
  2023. AcPhaseCount = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPhaseCount);
  2024. PhaseLossPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy);
  2025. FactoryConfiguration = json_object_new_int(ShmSysConfigAndInfo->SysInfo.FactoryConfiguration);
  2026. AuthorisationMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
  2027. DefaultLanguage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.DefaultLanguage);
  2028. InputVoltageR = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageR);
  2029. InputVoltageS = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageS);
  2030. InputVoltageT = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageT);
  2031. InputVoltageDc = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageDc);
  2032. SystemFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed);
  2033. PsuFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed);
  2034. RfidCardNumEndian = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
  2035. PsuAcInputType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PsuAcInputType);
  2036. RatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RatingCurrent);
  2037. AcRatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcRatingCurrent);
  2038. isAPP = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAPP);
  2039. isQRCode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isQRCode);
  2040. isRFID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isRFID);
  2041. QRCodeMadeMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
  2042. QRCodeContent = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent);
  2043. Intensity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity);
  2044. isAuthrizeByEVCCID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID);
  2045. AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
  2046. AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
  2047. AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
  2048. AuxPower48V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower48V);
  2049. CsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
  2050. CsuBootLoadFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
  2051. CsuKernelFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
  2052. CsuRootFsFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
  2053. CsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
  2054. LcmHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
  2055. LcmFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
  2056. PsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
  2057. PsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
  2058. PsuSecFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
  2059. AuxPwrHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
  2060. AuxPwrFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
  2061. FanModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
  2062. FanModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
  2063. RelayModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
  2064. RelayModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
  2065. TelcomModemFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
  2066. Connector1FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector1FwRev);
  2067. Connector2FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector2FwRev);
  2068. PsuLostQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuLostQuantity);
  2069. /* for DC+AC*/
  2070. if(connectorType3==4){
  2071. Connector3FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[0].version);
  2072. }
  2073. LedModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LedModuleFwRev);
  2074. SystemAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
  2075. SystemCriticalTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
  2076. CcsConnectorTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
  2077. PsuAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp);
  2078. AcPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPlugInTimes);
  2079. GbPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.GbPlugInTimes);
  2080. Ccs1PlugInTime = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime);
  2081. Ccs2PlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes);
  2082. ChademoPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes);
  2083. FirmwareUpdate = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
  2084. if(strcmp(IsAcDc, "D") == 0){
  2085. for(int i=0;i<PsuQuantity;i++){
  2086. FwPrimaryVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwPrimaryVersion);
  2087. FwSecondVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwSecondVersion);
  2088. json_object_array_add(FwPrimaryVersionArr,FwPrimaryVersion[i]);
  2089. json_object_array_add(FwSecondVersionArr,FwSecondVersion[i]);
  2090. }
  2091. }
  2092. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  2093. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=0;
  2094. DispenserQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity);
  2095. TotalConnectorQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity);
  2096. int DDDispenserQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity;
  2097. for(int i=0;i<DDDispenserQuantity;i++){
  2098. DDLocalStatus[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LocalStatus);
  2099. DDModelName[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ModelName);
  2100. DDSerialNumber[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].SerialNumber);
  2101. DDSystemId[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].SystemId);
  2102. DDAuthorisationMode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].AuthorisationMode);
  2103. DDRfidCardNumEndian[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].RfidCardNumEndian);
  2104. DDisAPP[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isAPP);
  2105. DDisQRCode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isQRCode);
  2106. DDisRFID[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isRFID);
  2107. DDQRCodeMadeMode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].QRCodeMadeMode);
  2108. DDQRCodeContent[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].QRCodeContent);
  2109. DDFactoryConfiguration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].FactoryConfiguration);
  2110. DDCsuBootLoadFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuBootLoadFwRev);
  2111. DDCsuKernelFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuKernelFwRev);
  2112. DDCsuRootFsFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuRootFsFwRev);
  2113. DDCsuPrimFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuPrimFwRev);
  2114. DDLcmFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LcmFwRev);
  2115. DDPsuPrimFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].PsuPrimFwRev);
  2116. DDPsuSecFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].PsuSecFwRev);
  2117. DDFanModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].FanModuleFwRev);
  2118. DDRelayModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].RelayModuleFwRev);
  2119. DDTelcomModemFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].TelcomModemFwRev);
  2120. DDLedModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LedModuleFwRev);
  2121. DDConnector1FwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].Connector1FwRev);
  2122. DDConnector2FwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].Connector2FwRev);
  2123. DDIntensity[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LedInfo.Intensity);
  2124. json_object_array_add(DDLocalStatusArr,DDLocalStatus[i]);
  2125. json_object_array_add(DDModelNameArr,DDModelName[i]);
  2126. json_object_array_add(DDSerialNumberArr,DDSerialNumber[i]);
  2127. json_object_array_add(DDSystemIdArr,DDSystemId[i]);
  2128. json_object_array_add(DDAuthorisationModeArr,DDAuthorisationMode[i]);
  2129. json_object_array_add(DDRfidCardNumEndianArr,DDRfidCardNumEndian[i]);
  2130. json_object_array_add(DDisAPPArr,DDisAPP[i]);
  2131. json_object_array_add(DDisQRCodeArr,DDisQRCode[i]);
  2132. json_object_array_add(DDisRFIDArr,DDisRFID[i]);
  2133. json_object_array_add(DDQRCodeMadeModeArr,DDQRCodeMadeMode[i]);
  2134. json_object_array_add(DDQRCodeContentArr,DDQRCodeContent[i]);
  2135. json_object_array_add(DDFactoryConfigurationArr,DDFactoryConfiguration[i]);
  2136. json_object_array_add(DDCsuBootLoadFwRevArr,DDCsuBootLoadFwRev[i]);
  2137. json_object_array_add(DDCsuKernelFwRevArr,DDCsuKernelFwRev[i]);
  2138. json_object_array_add(DDCsuRootFsFwRevArr,DDCsuRootFsFwRev[i]);
  2139. json_object_array_add(DDCsuPrimFwRevArr,DDCsuPrimFwRev[i]);
  2140. json_object_array_add(DDLcmFwRevArr,DDLcmFwRev[i]);
  2141. json_object_array_add(DDPsuPrimFwRevArr,DDPsuPrimFwRev[i]);
  2142. json_object_array_add(DDPsuSecFwRevArr,DDPsuSecFwRev[i]);
  2143. json_object_array_add(DDFanModuleFwRevArr,DDFanModuleFwRev[i]);
  2144. json_object_array_add(DDRelayModuleFwRevArr,DDRelayModuleFwRev[i]);
  2145. json_object_array_add(DDTelcomModemFwRevArr,DDTelcomModemFwRev[i]);
  2146. json_object_array_add(DDLedModuleFwRevArr,DDLedModuleFwRev[i]);
  2147. json_object_array_add(DDConnector1FwRevArr,DDConnector1FwRev[i]);
  2148. json_object_array_add(DDConnector2FwRevArr,DDConnector2FwRev[i]);
  2149. json_object_array_add(DDIntensityArr,DDIntensity[i]);
  2150. }
  2151. Relay2ModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Relay2ModuleFwRev);
  2152. }
  2153. //charging
  2154. int CcsGunQty=0;
  2155. int GbGunQty=0;
  2156. int CHAdeMOGunQty=0;
  2157. int AcGunQty=0;
  2158. ChargingInfo1=json_object_new_object();
  2159. ChargingInfo2=json_object_new_object();
  2160. ChargingInfo3=json_object_new_object();
  2161. MaxChargingEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
  2162. MaxChargingPower = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
  2163. MaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
  2164. MaxChargingVoltage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage);
  2165. AcMaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent);
  2166. MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
  2167. MaxChargingSoc = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingSoc);
  2168. StopChargingByButton = json_object_new_int(ShmSysConfigAndInfo->SysConfig.StopChargingByButton);
  2169. FanControlPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.FanControlPolicy);
  2170. isEnable15118 = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnable15118);
  2171. isEnableR2R = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableR2R);
  2172. LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
  2173. LocalWhiteCard[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
  2174. LocalWhiteCard[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
  2175. LocalWhiteCard[3] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
  2176. LocalWhiteCard[4] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
  2177. LocalWhiteCard[5] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
  2178. LocalWhiteCard[6] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
  2179. LocalWhiteCard[7] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
  2180. LocalWhiteCard[8] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
  2181. LocalWhiteCard[9] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
  2182. isBilling = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling);
  2183. Currency = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.Currency);
  2184. Fee[0] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0]);
  2185. Fee[1] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1]);
  2186. Fee[2] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2]);
  2187. Fee[3] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3]);
  2188. Fee[4] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4]);
  2189. Fee[5] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5]);
  2190. Fee[6] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6]);
  2191. Fee[7] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7]);
  2192. Fee[8] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8]);
  2193. Fee[9] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9]);
  2194. Fee[10] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10]);
  2195. Fee[11] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11]);
  2196. Fee[12] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12]);
  2197. Fee[13] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13]);
  2198. Fee[14] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14]);
  2199. Fee[15] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15]);
  2200. Fee[16] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16]);
  2201. Fee[17] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17]);
  2202. Fee[18] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18]);
  2203. Fee[19] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19]);
  2204. Fee[20] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20]);
  2205. Fee[21] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21]);
  2206. Fee[22] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22]);
  2207. Fee[23] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23]);
  2208. if(connectorType1 != 0){
  2209. if(connectorType1 == 1){//CCS
  2210. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  2211. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  2212. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  2213. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  2214. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  2215. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  2216. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  2217. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  2218. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  2219. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PilotVoltage);
  2220. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  2221. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  2222. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  2223. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  2224. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  2225. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  2226. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  2227. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  2228. }
  2229. else{
  2230. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  2231. }
  2232. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  2233. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  2234. }
  2235. else{
  2236. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  2237. }
  2238. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  2239. CcsGunQty++;
  2240. }
  2241. else if(connectorType1 == 2){//GB
  2242. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  2243. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  2244. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  2245. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  2246. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  2247. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  2248. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  2249. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  2250. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  2251. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PilotVoltage);
  2252. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  2253. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  2254. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  2255. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  2256. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  2257. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  2258. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  2259. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  2260. }
  2261. else{
  2262. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  2263. }
  2264. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  2265. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  2266. }
  2267. else{
  2268. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  2269. }
  2270. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  2271. GbGunQty++;
  2272. }
  2273. else if(connectorType1 == 3){//CHAdeMO
  2274. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2275. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2276. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2277. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2278. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2279. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2280. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2281. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2282. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2283. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PilotVoltage);
  2284. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2285. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2286. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2287. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2288. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2289. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2290. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2291. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2292. }
  2293. else{
  2294. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2295. }
  2296. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2297. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2298. }
  2299. else{
  2300. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2301. }
  2302. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2303. CHAdeMOGunQty++;
  2304. }
  2305. else if(connectorType1 == 4){//AC
  2306. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2307. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2308. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2309. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2310. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2311. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2312. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2313. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2314. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2315. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PilotVoltage);
  2316. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2317. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2318. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2319. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2320. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2321. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2322. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2323. ChillerTemp[0] = json_object_new_int(255);
  2324. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2325. if(strcmp(IsDO, "AX") == 0){
  2326. isCalibratedVaGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2327. isCalibratedVbGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2328. isCalibratedVcGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2329. isCalibratedVaOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2330. isCalibratedVbOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2331. isCalibratedVcOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2332. isCalibratedCaGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2333. isCalibratedCbGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2334. isCalibratedCcGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2335. isCalibratedCaOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2336. isCalibratedCbOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2337. isCalibratedCcOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2338. isCalibratedPa[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2339. isCalibratedPb[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2340. isCalibratedPc[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2341. }
  2342. AcGunQty++;
  2343. }
  2344. }
  2345. if(connectorType2 != 0){
  2346. if(connectorType2 == 1){//CCS
  2347. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  2348. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  2349. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  2350. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  2351. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  2352. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  2353. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  2354. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  2355. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  2356. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PilotVoltage);
  2357. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  2358. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  2359. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  2360. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  2361. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  2362. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  2363. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  2364. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  2365. }
  2366. else{
  2367. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  2368. }
  2369. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  2370. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  2371. }
  2372. else{
  2373. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  2374. }
  2375. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  2376. CcsGunQty++;
  2377. }
  2378. else if(connectorType2 == 2){//GB
  2379. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  2380. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  2381. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  2382. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  2383. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  2384. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  2385. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  2386. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  2387. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  2388. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PilotVoltage);
  2389. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  2390. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  2391. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  2392. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  2393. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  2394. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  2395. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  2396. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  2397. }
  2398. else{
  2399. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  2400. }
  2401. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  2402. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  2403. }
  2404. else{
  2405. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  2406. }
  2407. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  2408. GbGunQty++;
  2409. }
  2410. else if(connectorType2 == 3){//CHAdeMO
  2411. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2412. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2413. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2414. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2415. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2416. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2417. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2418. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2419. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2420. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PilotVoltage);
  2421. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2422. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2423. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2424. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2425. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2426. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2427. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2428. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2429. }
  2430. else{
  2431. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2432. }
  2433. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2434. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2435. }
  2436. else{
  2437. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2438. }
  2439. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2440. CHAdeMOGunQty++;
  2441. }
  2442. else if(connectorType2 == 4){//AC
  2443. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2444. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2445. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2446. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2447. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2448. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2449. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2450. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2451. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2452. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PilotVoltage);
  2453. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2454. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2455. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2456. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2457. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2458. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2459. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2460. ChillerTemp[1] = json_object_new_int(255);
  2461. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2462. if(strcmp(IsDO, "AX") == 0){
  2463. isCalibratedVaGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2464. isCalibratedVbGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2465. isCalibratedVcGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2466. isCalibratedVaOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2467. isCalibratedVbOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2468. isCalibratedVcOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2469. isCalibratedCaGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2470. isCalibratedCbGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2471. isCalibratedCcGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2472. isCalibratedCaOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2473. isCalibratedCbOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2474. isCalibratedCcOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2475. isCalibratedPa[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2476. isCalibratedPb[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2477. isCalibratedPc[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2478. }
  2479. AcGunQty++;
  2480. }
  2481. }
  2482. if(connectorType3 != 0){
  2483. if(connectorType3 == 1){//CCS
  2484. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  2485. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  2486. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  2487. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  2488. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  2489. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  2490. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  2491. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  2492. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  2493. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PilotVoltage);
  2494. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  2495. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  2496. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  2497. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  2498. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  2499. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  2500. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  2501. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  2502. }
  2503. else{
  2504. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  2505. }
  2506. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  2507. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  2508. }
  2509. else{
  2510. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  2511. }
  2512. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  2513. CcsGunQty++;
  2514. }
  2515. else if(connectorType3 == 2){//GB
  2516. PresentChargingVoltage[2]= json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  2517. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  2518. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  2519. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  2520. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  2521. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  2522. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  2523. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  2524. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  2525. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PilotVoltage);
  2526. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  2527. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  2528. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  2529. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  2530. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  2531. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  2532. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  2533. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  2534. }
  2535. else{
  2536. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  2537. }
  2538. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  2539. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  2540. }
  2541. else{
  2542. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  2543. }
  2544. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  2545. GbGunQty++;
  2546. }
  2547. else if(connectorType3 == 3){//CHAdeMO
  2548. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2549. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2550. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2551. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2552. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2553. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2554. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2555. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2556. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2557. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PilotVoltage);
  2558. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2559. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2560. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2561. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2562. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2563. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2564. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2565. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2566. }
  2567. else{
  2568. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2569. }
  2570. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2571. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2572. }
  2573. else{
  2574. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2575. }
  2576. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2577. CHAdeMOGunQty++;
  2578. }
  2579. else if(connectorType3 == 4){//AC
  2580. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2581. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2582. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2583. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2584. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2585. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2586. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2587. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2588. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2589. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PilotVoltage);
  2590. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2591. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2592. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2593. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2594. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2595. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2596. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2597. ChillerTemp[2] = json_object_new_int(255);
  2598. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2599. if(strcmp(IsDO, "AX") == 0){
  2600. isCalibratedVaGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2601. isCalibratedVbGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2602. isCalibratedVcGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2603. isCalibratedVaOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2604. isCalibratedVbOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2605. isCalibratedVcOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2606. isCalibratedCaGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2607. isCalibratedCbGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2608. isCalibratedCcGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2609. isCalibratedCaOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2610. isCalibratedCbOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2611. isCalibratedCcOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2612. isCalibratedPa[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2613. isCalibratedPb[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2614. isCalibratedPc[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2615. }
  2616. AcGunQty++;
  2617. }
  2618. }
  2619. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  2620. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
  2621. int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
  2622. for(int i=0;i<DDTotalConnectorQuantity;i++){
  2623. DDPresentChargingVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingVoltage);
  2624. DDPresentChargingCurrent[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingCurrent);
  2625. DDPresentChargingPower[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingPower);
  2626. DDPresentChargedEnergy[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargedEnergy);
  2627. DDPresentChargedDuration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargedDuration);
  2628. DDRemainChargingDuration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.RemainChargingDuration);
  2629. DDEvBatteryMaxVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatteryMaxVoltage);
  2630. DDEvBatterytargetVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterytargetVoltage);
  2631. DDEvBatterySoc[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterySoc);
  2632. DDSystemStatus[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.SystemStatus);
  2633. DDEvBatterytargetCurrent[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterytargetCurrent);
  2634. DDStartUserId[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartUserId);
  2635. DDStartDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartDateTime);
  2636. DDStopDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StopDateTime);
  2637. DDStartMethod[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartMethod);
  2638. if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 255){
  2639. DDConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp);
  2640. }
  2641. else{
  2642. DDConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp-60);
  2643. }
  2644. if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 255){
  2645. DDChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp);
  2646. }
  2647. else{
  2648. DDChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp-60);
  2649. }
  2650. DDPowerConsumption[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PowerConsumption);
  2651. }
  2652. }
  2653. //V2G certificate
  2654. FILE *file;
  2655. char line[0];
  2656. V2GPrivateKey = json_object_new_string("");
  2657. file = popen("sha256sum /Storage/certV2G.key", "r");
  2658. if (NULL != file)
  2659. {
  2660. int i=0;
  2661. while (fgets(line, 65, file) != NULL)
  2662. {
  2663. if(i==0){
  2664. V2GPrivateKey = json_object_new_string(line);
  2665. }
  2666. i++;
  2667. }
  2668. }
  2669. pclose(file);
  2670. V2GRootCertificate = json_object_new_string("");
  2671. file = popen("sha256sum /Storage/rootCaV2g.pem", "r");
  2672. if (NULL != file)
  2673. {
  2674. int i=0;
  2675. while (fgets(line, 65, file) != NULL)
  2676. {
  2677. if(i==0){
  2678. V2GRootCertificate = json_object_new_string(line);
  2679. }
  2680. i++;
  2681. }
  2682. }
  2683. pclose(file);
  2684. V2GCertificateChain = json_object_new_string("");
  2685. file = popen("sha256sum /Storage/certV2g.pem", "r");
  2686. if (NULL != file)
  2687. {
  2688. int i=0;
  2689. while (fgets(line, 65, file) != NULL)
  2690. {
  2691. if(i==0){
  2692. V2GCertificateChain = json_object_new_string(line);
  2693. }
  2694. i++;
  2695. }
  2696. }
  2697. pclose(file);
  2698. //network
  2699. InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
  2700. FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
  2701. Eth0DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient);
  2702. Eth0MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
  2703. Eth0IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
  2704. Eth0SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
  2705. Eth0GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
  2706. Eth1DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient);
  2707. Eth1MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
  2708. Eth1IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
  2709. Eth1SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
  2710. Eth1GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
  2711. WifiMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
  2712. WifiSsid = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
  2713. WifiPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
  2714. WifiBroadcastSsid = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid);
  2715. WifiTargetBssidMac = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac);
  2716. WifiRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
  2717. WifiDhcpServer = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer);
  2718. WifiDhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient);
  2719. WifiMacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
  2720. WifiIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
  2721. WifiSubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
  2722. WifiGatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
  2723. WifiNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn);
  2724. TelcomApn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
  2725. TelcomRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
  2726. TelcomChapPapId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
  2727. TelcomChapPapPwd = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
  2728. TelcomModemImei = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
  2729. TelcomSimImsi = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
  2730. TelcomSimIccid = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid);
  2731. TelcomSimStatus = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus);
  2732. TelcomModemMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode);
  2733. TelcomIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
  2734. TelcomNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn);
  2735. TelcomEnabled = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled);
  2736. TelcomNetworkType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType);
  2737. isEnalbleFirewall = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnalbleFirewall);
  2738. FirewallAcceptAddr[0] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[0]);
  2739. FirewallAcceptAddr[1] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[1]);
  2740. FirewallAcceptAddr[2] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[2]);
  2741. FirewallAcceptAddr[3] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[3]);
  2742. FirewallAcceptAddr[4] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[4]);
  2743. FirewallAcceptAddr[5] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[5]);
  2744. FirewallAcceptAddr[6] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[6]);
  2745. FirewallAcceptAddr[7] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[7]);
  2746. FirewallAcceptAddr[8] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[8]);
  2747. FirewallAcceptAddr[9] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[9]);
  2748. //backend
  2749. BackendConnTimeout = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
  2750. OfflinePolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
  2751. OfflineMaxChargeEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
  2752. OfflineMaxChargeDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
  2753. OcppConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.OcppConnStatus);
  2754. MaintainServerConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus);
  2755. OcppServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL);
  2756. ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
  2757. OcppSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile);
  2758. OcppSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword);
  2759. MaintainServerSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile);
  2760. MaintainServerSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword);
  2761. chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
  2762. MaintainServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
  2763. if(strcmp(IsDO, "AX") == 0 || strcmp(IsDO, "AW") == 0 || strcmp(IsAcDc, "D") == 0){
  2764. isEnableLocalPowerSharging = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing);
  2765. PowerSharingCapacity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PowerSharingCapacityPower);
  2766. PowerSharingServerIP = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP);
  2767. OcppReceiptrURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL);
  2768. }
  2769. /*for TTIA*/
  2770. if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){
  2771. isEnableTTIA = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA);
  2772. server_addr = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr);
  2773. server_port = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port);
  2774. busVenderId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.busVenderId);
  2775. EquipmentProvider = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.EquipmentProvider);
  2776. TransportationCompanyNo = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.TransportationCompanyNo);
  2777. TTIAChargeBoxId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId);
  2778. evseStation = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation);
  2779. }
  2780. //PnC certificate
  2781. ChargePointPrivateKey = json_object_new_string("");
  2782. file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
  2783. if (NULL != file)
  2784. {
  2785. int i=0;
  2786. while (fgets(line, 65, file) != NULL)
  2787. {
  2788. if(i==0){
  2789. ChargePointPrivateKey = json_object_new_string(line);
  2790. }
  2791. i++;
  2792. }
  2793. }
  2794. pclose(file);
  2795. ChargePointCertificate = json_object_new_string("");
  2796. file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
  2797. if (NULL != file)
  2798. {
  2799. int i=0;
  2800. while (fgets(line, 65, file) != NULL)
  2801. {
  2802. if(i==0){
  2803. ChargePointCertificate = json_object_new_string(line);
  2804. }
  2805. i++;
  2806. }
  2807. }
  2808. pclose(file);
  2809. MORootCertificate = json_object_new_string("");
  2810. file = popen("sha256sum /Storage/rootCaMo.pem", "r");
  2811. if (NULL != file)
  2812. {
  2813. int i=0;
  2814. while (fgets(line, 65, file) != NULL)
  2815. {
  2816. if(i==0){
  2817. MORootCertificate = json_object_new_string(line);
  2818. }
  2819. i++;
  2820. }
  2821. }
  2822. pclose(file);
  2823. CSRootCertificate = json_object_new_string("");
  2824. file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
  2825. if (NULL != file)
  2826. {
  2827. int i=0;
  2828. while (fgets(line, 65, file) != NULL)
  2829. {
  2830. if(i==0){
  2831. CSRootCertificate = json_object_new_string(line);
  2832. }
  2833. i++;
  2834. }
  2835. }
  2836. pclose(file);
  2837. ManufacturerRootCertificate = json_object_new_string("");
  2838. file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
  2839. if (NULL != file)
  2840. {
  2841. int i=0;
  2842. while (fgets(line, 65, file) != NULL)
  2843. {
  2844. if(i==0){
  2845. ManufacturerRootCertificate = json_object_new_string(line);
  2846. }
  2847. i++;
  2848. }
  2849. }
  2850. pclose(file);
  2851. //system
  2852. json_object_object_add(jobj1,"ModelName",ModelName);
  2853. json_object_object_add(jobj1,"AcModelName",AcModelName);
  2854. json_object_object_add(jobj1,"SerialNumber",SerialNumber);
  2855. json_object_object_add(jobj1,"SystemId",SystemId);
  2856. json_object_object_add(jobj1,"AcPhaseCount",AcPhaseCount);
  2857. json_object_object_add(jobj1,"PhaseLossPolicy",PhaseLossPolicy);
  2858. json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
  2859. json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
  2860. json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
  2861. json_object_object_add(jobj1,"InputVoltageR",InputVoltageR);
  2862. json_object_object_add(jobj1,"InputVoltageS",InputVoltageS);
  2863. json_object_object_add(jobj1,"InputVoltageT",InputVoltageT);
  2864. json_object_object_add(jobj1,"InputVoltageDc",InputVoltageDc);
  2865. json_object_object_add(jobj1,"SystemFanRotaSpeed",SystemFanRotaSpeed);
  2866. json_object_object_add(jobj1,"PsuFanRotaSpeed",PsuFanRotaSpeed);
  2867. json_object_object_add(jobj1,"RfidCardNumEndian",RfidCardNumEndian);
  2868. json_object_object_add(jobj1,"PsuAcInputType",PsuAcInputType);
  2869. json_object_object_add(jobj1,"RatingCurrent",RatingCurrent);
  2870. json_object_object_add(jobj1,"AcRatingCurrent",AcRatingCurrent);
  2871. json_object_object_add(jobj1,"isAPP",isAPP);
  2872. json_object_object_add(jobj1,"isQRCode",isQRCode);
  2873. json_object_object_add(jobj1,"isRFID",isRFID);
  2874. json_object_object_add(jobj1,"QRCodeMadeMode",QRCodeMadeMode);
  2875. json_object_object_add(jobj1,"QRCodeContent",QRCodeContent);
  2876. json_object_object_add(jobj1,"Intensity",Intensity);
  2877. json_object_object_add(jobj1,"isAuthrizeByEVCCID",isAuthrizeByEVCCID);
  2878. json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
  2879. json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
  2880. json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
  2881. json_object_object_add(jobj1,"AuxPower48V",AuxPower48V);
  2882. json_object_object_add(jobj1,"CsuHwRev",CsuHwRev);
  2883. json_object_object_add(jobj1,"CsuBootLoadFwRev",CsuBootLoadFwRev);
  2884. json_object_object_add(jobj1,"CsuKernelFwRev",CsuKernelFwRev);
  2885. json_object_object_add(jobj1,"CsuRootFsFwRev",CsuRootFsFwRev);
  2886. json_object_object_add(jobj1,"CsuPrimFwRev",CsuPrimFwRev);
  2887. json_object_object_add(jobj1,"LcmHwRev",LcmHwRev);
  2888. json_object_object_add(jobj1,"LcmFwRev",LcmFwRev);
  2889. json_object_object_add(jobj1,"PsuHwRev",PsuHwRev);
  2890. json_object_object_add(jobj1,"PsuPrimFwRev",PsuPrimFwRev);
  2891. json_object_object_add(jobj1,"PsuSecFwRev",PsuSecFwRev);
  2892. json_object_object_add(jobj1,"AuxPwrHwRev",AuxPwrHwRev);
  2893. json_object_object_add(jobj1,"AuxPwrFwRev",AuxPwrFwRev);
  2894. json_object_object_add(jobj1,"FanModuleHwRev",FanModuleHwRev);
  2895. json_object_object_add(jobj1,"FanModuleFwRev",FanModuleFwRev);
  2896. json_object_object_add(jobj1,"RelayModuleHwRev",RelayModuleHwRev);
  2897. json_object_object_add(jobj1,"RelayModuleFwRev",RelayModuleFwRev);
  2898. json_object_object_add(jobj1,"TelcomModemFwRev",TelcomModemFwRev);
  2899. json_object_object_add(jobj1,"Connector1FwRev",Connector1FwRev);
  2900. json_object_object_add(jobj1,"Connector2FwRev",Connector2FwRev);
  2901. json_object_object_add(jobj1,"PsuLostQuantity",PsuLostQuantity);
  2902. /* for DC+AC*/
  2903. if(connectorType3==4){
  2904. json_object_object_add(jobj1,"Connector3FwRev",Connector3FwRev);
  2905. }
  2906. json_object_object_add(jobj1,"LedModuleFwRev",LedModuleFwRev);
  2907. json_object_object_add(jobj1,"SystemAmbientTemp",SystemAmbientTemp);
  2908. json_object_object_add(jobj1,"SystemCriticalTemp",SystemCriticalTemp);
  2909. json_object_object_add(jobj1,"CcsConnectorTemp",CcsConnectorTemp);
  2910. json_object_object_add(jobj1,"PsuAmbientTemp",PsuAmbientTemp);
  2911. json_object_object_add(jobj1,"AcPlugInTimes",AcPlugInTimes);
  2912. json_object_object_add(jobj1,"GbPlugInTimes",GbPlugInTimes);
  2913. json_object_object_add(jobj1,"Ccs1PlugInTimes",Ccs1PlugInTime);
  2914. json_object_object_add(jobj1,"Ccs2PlugInTimes",Ccs2PlugInTimes);
  2915. json_object_object_add(jobj1,"ChademoPlugInTimes",ChademoPlugInTimes);
  2916. json_object_object_add(jobj1,"FirmwareUpdate",FirmwareUpdate);
  2917. if(strcmp(IsAcDc, "D") == 0){
  2918. json_object_object_add(jobj1,"FwPrimaryVersion",FwPrimaryVersionArr);
  2919. json_object_object_add(jobj1,"FwSecondVersion",FwSecondVersionArr);
  2920. }
  2921. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0|| strcmp(IsDO, "DB") == 0|| strcmp(IsDO, "DL") == 0){
  2922. json_object_object_add(jobj1,"DispenserQuantity",DispenserQuantity);
  2923. json_object_object_add(jobj1,"TotalConnectorQuantity",TotalConnectorQuantity);
  2924. json_object_object_add(jobj1,"DDLocalStatus",DDLocalStatusArr);
  2925. json_object_object_add(jobj1,"DDModelName",DDModelNameArr);
  2926. json_object_object_add(jobj1,"DDSerialNumber",DDSerialNumberArr);
  2927. json_object_object_add(jobj1,"DDSystemId",DDSystemIdArr);
  2928. json_object_object_add(jobj1,"DDAuthorisationMode",DDAuthorisationModeArr);
  2929. json_object_object_add(jobj1,"DDRfidCardNumEndian",DDRfidCardNumEndianArr);
  2930. json_object_object_add(jobj1,"DDisAPP",DDisAPPArr);
  2931. json_object_object_add(jobj1,"DDisQRCode",DDisQRCodeArr);
  2932. json_object_object_add(jobj1,"DDisRFID",DDisRFIDArr);
  2933. json_object_object_add(jobj1,"DDQRCodeMadeMode",DDQRCodeMadeModeArr);
  2934. json_object_object_add(jobj1,"DDQRCodeContent",DDQRCodeContentArr);
  2935. json_object_object_add(jobj1,"DDFactoryConfiguration",DDFactoryConfigurationArr);
  2936. json_object_object_add(jobj1,"DDCsuBootLoadFwRev",DDCsuBootLoadFwRevArr);
  2937. json_object_object_add(jobj1,"DDCsuKernelFwRev",DDCsuKernelFwRevArr);
  2938. json_object_object_add(jobj1,"DDCsuRootFsFwRev",DDCsuRootFsFwRevArr);
  2939. json_object_object_add(jobj1,"DDCsuPrimFwRev",DDCsuPrimFwRevArr);
  2940. json_object_object_add(jobj1,"DDLcmFwRev",DDLcmFwRevArr);
  2941. json_object_object_add(jobj1,"DDPsuPrimFwRev",DDPsuPrimFwRevArr);
  2942. json_object_object_add(jobj1,"DDPsuSecFwRev",DDPsuSecFwRevArr);
  2943. json_object_object_add(jobj1,"DDFanModuleFwRev",DDFanModuleFwRevArr);
  2944. json_object_object_add(jobj1,"DDRelayModuleFwRev",DDRelayModuleFwRevArr);
  2945. json_object_object_add(jobj1,"DDTelcomModemFwRev",DDTelcomModemFwRevArr);
  2946. json_object_object_add(jobj1,"DDLedModuleFwRev",DDLedModuleFwRevArr);
  2947. json_object_object_add(jobj1,"DDConnector1FwRev",DDConnector1FwRevArr);
  2948. json_object_object_add(jobj1,"DDConnector2FwRev",DDConnector2FwRevArr);
  2949. json_object_object_add(jobj1,"DDIntensity",DDIntensityArr);
  2950. json_object_object_add(jobj1,"Relay2ModuleFwRev",Relay2ModuleFwRev);
  2951. }
  2952. printf("%s\n", json_object_to_json_string(jobj1));
  2953. json_object_put(jobj1);
  2954. //charging
  2955. json_object_object_add(jobj2,"MaxChargingEnergy",MaxChargingEnergy);
  2956. json_object_object_add(jobj2,"MaxChargingPower",MaxChargingPower);
  2957. json_object_object_add(jobj2,"MaxChargingCurrent",MaxChargingCurrent);
  2958. json_object_object_add(jobj2,"MaxChargingVoltage",MaxChargingVoltage);
  2959. json_object_object_add(jobj2,"AcMaxChargingCurrent",AcMaxChargingCurrent);
  2960. json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
  2961. json_object_object_add(jobj2,"MaxChargingSoc",MaxChargingSoc);
  2962. json_object_object_add(jobj2,"StopChargingByButton",StopChargingByButton);
  2963. json_object_object_add(jobj2,"FanControlPolicy",FanControlPolicy);
  2964. json_object_object_add(jobj2,"isEnable15118",isEnable15118);
  2965. json_object_object_add(jobj2,"isEnableR2R",isEnableR2R);
  2966. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
  2967. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
  2968. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);
  2969. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[3]);
  2970. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[4]);
  2971. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[5]);
  2972. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[6]);
  2973. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[7]);
  2974. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[8]);
  2975. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[9]);
  2976. json_object_object_add(jobj2,"LocalWhiteCard",LocalWhiteCardArr);
  2977. json_object_object_add(jobj2,"isBilling",isBilling);
  2978. json_object_object_add(jobj2,"Currency",Currency);
  2979. json_object_array_add(FeeArr,Fee[0]);
  2980. json_object_array_add(FeeArr,Fee[1]);
  2981. json_object_array_add(FeeArr,Fee[2]);
  2982. json_object_array_add(FeeArr,Fee[3]);
  2983. json_object_array_add(FeeArr,Fee[4]);
  2984. json_object_array_add(FeeArr,Fee[5]);
  2985. json_object_array_add(FeeArr,Fee[6]);
  2986. json_object_array_add(FeeArr,Fee[7]);
  2987. json_object_array_add(FeeArr,Fee[8]);
  2988. json_object_array_add(FeeArr,Fee[9]);
  2989. json_object_array_add(FeeArr,Fee[10]);
  2990. json_object_array_add(FeeArr,Fee[11]);
  2991. json_object_array_add(FeeArr,Fee[12]);
  2992. json_object_array_add(FeeArr,Fee[13]);
  2993. json_object_array_add(FeeArr,Fee[14]);
  2994. json_object_array_add(FeeArr,Fee[15]);
  2995. json_object_array_add(FeeArr,Fee[16]);
  2996. json_object_array_add(FeeArr,Fee[17]);
  2997. json_object_array_add(FeeArr,Fee[18]);
  2998. json_object_array_add(FeeArr,Fee[19]);
  2999. json_object_array_add(FeeArr,Fee[20]);
  3000. json_object_array_add(FeeArr,Fee[21]);
  3001. json_object_array_add(FeeArr,Fee[22]);
  3002. json_object_array_add(FeeArr,Fee[23]);
  3003. json_object_object_add(jobj2,"Fee",FeeArr);
  3004. if(connectorType1 != 0){
  3005. json_object_object_add(ChargingInfo1,"StartUserId",StartUserId[0]);
  3006. json_object_object_add(ChargingInfo1,"StartDateTime",StartDateTime[0]);
  3007. json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
  3008. json_object_object_add(ChargingInfo1,"StartMethod",StartMethod[0]);
  3009. json_object_object_add(ChargingInfo1,"ConnectorTemp",ConnectorTemp[0]);
  3010. json_object_object_add(ChargingInfo1,"ChillerTemp",ChillerTemp[0]);
  3011. json_object_object_add(ChargingInfo1,"PresentChargingVoltage",PresentChargingVoltage[0]);
  3012. json_object_object_add(ChargingInfo1,"PresentChargingCurrent",PresentChargingCurrent[0]);
  3013. json_object_object_add(ChargingInfo1,"PresentChargingPower",PresentChargingPower[0]);
  3014. json_object_object_add(ChargingInfo1,"PresentChargedEnergy",PresentChargedEnergy[0]);
  3015. json_object_object_add(ChargingInfo1,"PresentChargedDuration",PresentChargedDuration[0]);
  3016. json_object_object_add(ChargingInfo1,"RemainChargingDuration",RemainChargingDuration[0]);
  3017. json_object_object_add(ChargingInfo1,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[0]);
  3018. json_object_object_add(ChargingInfo1,"EvBatterytargetVoltage",EvBatterytargetVoltage[0]);
  3019. json_object_object_add(ChargingInfo1,"EvBatterySoc",EvBatterySoc[0]);
  3020. json_object_object_add(ChargingInfo1,"PilotVoltage",PilotVoltage[0]);
  3021. json_object_object_add(ChargingInfo1,"SystemStatus",SystemStatus[0]);
  3022. json_object_object_add(ChargingInfo1,"EvBatterytargetCurrent",EvBatterytargetCurrent[0]);
  3023. json_object_object_add(ChargingInfo1,"PowerConsumption",PowerConsumption[0]);
  3024. if(strcmp(IsDO, "AX") == 0){
  3025. json_object_object_add(ChargingInfo1,"isCalibratedVaGain",isCalibratedVaGain[0]);
  3026. json_object_object_add(ChargingInfo1,"isCalibratedVbGain",isCalibratedVbGain[0]);
  3027. json_object_object_add(ChargingInfo1,"isCalibratedVcGain",isCalibratedVcGain[0]);
  3028. json_object_object_add(ChargingInfo1,"isCalibratedVaOffset",isCalibratedVaOffset[0]);
  3029. json_object_object_add(ChargingInfo1,"isCalibratedVbOffset",isCalibratedVbOffset[0]);
  3030. json_object_object_add(ChargingInfo1,"isCalibratedVcOffset",isCalibratedVcOffset[0]);
  3031. json_object_object_add(ChargingInfo1,"isCalibratedCaGain",isCalibratedCaGain[0]);
  3032. json_object_object_add(ChargingInfo1,"isCalibratedCbGain",isCalibratedCbGain[0]);
  3033. json_object_object_add(ChargingInfo1,"isCalibratedCcGain",isCalibratedCcGain[0]);
  3034. json_object_object_add(ChargingInfo1,"isCalibratedCaOffset",isCalibratedCaOffset[0]);
  3035. json_object_object_add(ChargingInfo1,"isCalibratedCbOffset",isCalibratedCbOffset[0]);
  3036. json_object_object_add(ChargingInfo1,"isCalibratedCcOffset",isCalibratedCcOffset[0]);
  3037. json_object_object_add(ChargingInfo1,"isCalibratedPa",isCalibratedPa[0]);
  3038. json_object_object_add(ChargingInfo1,"isCalibratedPb",isCalibratedPb[0]);
  3039. json_object_object_add(ChargingInfo1,"isCalibratedPc",isCalibratedPc[0]);
  3040. }
  3041. json_object_object_add(jobj2,"ChargingInfo1",ChargingInfo1);
  3042. }
  3043. if(connectorType2 != 0){
  3044. json_object_object_add(ChargingInfo2,"StartUserId",StartUserId[1]);
  3045. json_object_object_add(ChargingInfo2,"StartDateTime",StartDateTime[1]);
  3046. json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
  3047. json_object_object_add(ChargingInfo2,"StartMethod",StartMethod[1]);
  3048. json_object_object_add(ChargingInfo2,"ConnectorTemp",ConnectorTemp[1]);
  3049. json_object_object_add(ChargingInfo2,"ChillerTemp",ChillerTemp[1]);
  3050. json_object_object_add(ChargingInfo2,"PresentChargingVoltage",PresentChargingVoltage[1]);
  3051. json_object_object_add(ChargingInfo2,"PresentChargingCurrent",PresentChargingCurrent[1]);
  3052. json_object_object_add(ChargingInfo2,"PresentChargingPower",PresentChargingPower[1]);
  3053. json_object_object_add(ChargingInfo2,"PresentChargedEnergy",PresentChargedEnergy[1]);
  3054. json_object_object_add(ChargingInfo2,"PresentChargedDuration",PresentChargedDuration[1]);
  3055. json_object_object_add(ChargingInfo2,"RemainChargingDuration",RemainChargingDuration[1]);
  3056. json_object_object_add(ChargingInfo2,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[1]);
  3057. json_object_object_add(ChargingInfo2,"EvBatterytargetVoltage",EvBatterytargetVoltage[1]);
  3058. json_object_object_add(ChargingInfo2,"EvBatterySoc",EvBatterySoc[1]);
  3059. json_object_object_add(ChargingInfo2,"PilotVoltage",PilotVoltage[1]);
  3060. json_object_object_add(ChargingInfo2,"SystemStatus",SystemStatus[1]);
  3061. json_object_object_add(ChargingInfo2,"EvBatterytargetCurrent",EvBatterytargetCurrent[1]);
  3062. json_object_object_add(ChargingInfo2,"PowerConsumption",PowerConsumption[1]);
  3063. if(strcmp(IsDO, "AX") == 0){
  3064. json_object_object_add(ChargingInfo2,"isCalibratedVaGain",isCalibratedVaGain[1]);
  3065. json_object_object_add(ChargingInfo2,"isCalibratedVbGain",isCalibratedVbGain[1]);
  3066. json_object_object_add(ChargingInfo2,"isCalibratedVcGain",isCalibratedVcGain[1]);
  3067. json_object_object_add(ChargingInfo2,"isCalibratedVaOffset",isCalibratedVaOffset[1]);
  3068. json_object_object_add(ChargingInfo2,"isCalibratedVbOffset",isCalibratedVbOffset[1]);
  3069. json_object_object_add(ChargingInfo2,"isCalibratedVcOffset",isCalibratedVcOffset[1]);
  3070. json_object_object_add(ChargingInfo2,"isCalibratedCaGain",isCalibratedCaGain[1]);
  3071. json_object_object_add(ChargingInfo2,"isCalibratedCbGain",isCalibratedCbGain[1]);
  3072. json_object_object_add(ChargingInfo2,"isCalibratedCcGain",isCalibratedCcGain[1]);
  3073. json_object_object_add(ChargingInfo2,"isCalibratedCaOffset",isCalibratedCaOffset[1]);
  3074. json_object_object_add(ChargingInfo2,"isCalibratedCbOffset",isCalibratedCbOffset[1]);
  3075. json_object_object_add(ChargingInfo2,"isCalibratedCcOffset",isCalibratedCcOffset[1]);
  3076. json_object_object_add(ChargingInfo2,"isCalibratedPa",isCalibratedPa[1]);
  3077. json_object_object_add(ChargingInfo2,"isCalibratedPb",isCalibratedPb[1]);
  3078. json_object_object_add(ChargingInfo2,"isCalibratedPc",isCalibratedPc[1]);
  3079. }
  3080. json_object_object_add(jobj2,"ChargingInfo2",ChargingInfo2);
  3081. }
  3082. if(connectorType3 != 0){
  3083. json_object_object_add(ChargingInfo3,"StartUserId",StartUserId[2]);
  3084. json_object_object_add(ChargingInfo3,"StartDateTime",StartDateTime[2]);
  3085. json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);
  3086. json_object_object_add(ChargingInfo3,"StartMethod",StartMethod[2]);
  3087. json_object_object_add(ChargingInfo3,"ConnectorTemp",ConnectorTemp[2]);
  3088. json_object_object_add(ChargingInfo3,"ChillerTemp",ChillerTemp[2]);
  3089. json_object_object_add(ChargingInfo3,"PresentChargingVoltage",PresentChargingVoltage[2]);
  3090. json_object_object_add(ChargingInfo3,"PresentChargingCurrent",PresentChargingCurrent[2]);
  3091. json_object_object_add(ChargingInfo3,"PresentChargingPower",PresentChargingPower[2]);
  3092. json_object_object_add(ChargingInfo3,"PresentChargedEnergy",PresentChargedEnergy[2]);
  3093. json_object_object_add(ChargingInfo3,"PresentChargedDuration",PresentChargedDuration[2]);
  3094. json_object_object_add(ChargingInfo3,"RemainChargingDuration",RemainChargingDuration[2]);
  3095. json_object_object_add(ChargingInfo3,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[2]);
  3096. json_object_object_add(ChargingInfo3,"EvBatterytargetVoltage",EvBatterytargetVoltage[2]);
  3097. json_object_object_add(ChargingInfo3,"EvBatterySoc",EvBatterySoc[2]);
  3098. json_object_object_add(ChargingInfo3,"PilotVoltage",PilotVoltage[2]);
  3099. json_object_object_add(ChargingInfo3,"SystemStatus",SystemStatus[2]);
  3100. json_object_object_add(ChargingInfo3,"EvBatterytargetCurrent",EvBatterytargetCurrent[2]);
  3101. json_object_object_add(ChargingInfo3,"PowerConsumption",PowerConsumption[2]);
  3102. if(strcmp(IsDO, "AX") == 0){
  3103. json_object_object_add(ChargingInfo3,"isCalibratedVaGain",isCalibratedVaGain[2]);
  3104. json_object_object_add(ChargingInfo3,"isCalibratedVbGain",isCalibratedVbGain[2]);
  3105. json_object_object_add(ChargingInfo3,"isCalibratedVcGain",isCalibratedVcGain[2]);
  3106. json_object_object_add(ChargingInfo3,"isCalibratedVaOffset",isCalibratedVaOffset[2]);
  3107. json_object_object_add(ChargingInfo3,"isCalibratedVbOffset",isCalibratedVbOffset[2]);
  3108. json_object_object_add(ChargingInfo3,"isCalibratedVcOffset",isCalibratedVcOffset[2]);
  3109. json_object_object_add(ChargingInfo3,"isCalibratedCaGain",isCalibratedCaGain[2]);
  3110. json_object_object_add(ChargingInfo3,"isCalibratedCbGain",isCalibratedCbGain[2]);
  3111. json_object_object_add(ChargingInfo3,"isCalibratedCcGain",isCalibratedCcGain[2]);
  3112. json_object_object_add(ChargingInfo3,"isCalibratedCaOffset",isCalibratedCaOffset[2]);
  3113. json_object_object_add(ChargingInfo3,"isCalibratedCbOffset",isCalibratedCbOffset[2]);
  3114. json_object_object_add(ChargingInfo3,"isCalibratedCcOffset",isCalibratedCcOffset[2]);
  3115. json_object_object_add(ChargingInfo3,"isCalibratedPa",isCalibratedPa[2]);
  3116. json_object_object_add(ChargingInfo3,"isCalibratedPb",isCalibratedPb[2]);
  3117. json_object_object_add(ChargingInfo3,"isCalibratedPc",isCalibratedPc[2]);
  3118. }
  3119. json_object_object_add(jobj2,"ChargingInfo3",ChargingInfo3);
  3120. }
  3121. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  3122. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4|| ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
  3123. int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
  3124. DDChargingInfo1=json_object_new_object();
  3125. DDChargingInfo2=json_object_new_object();
  3126. DDChargingInfo3=json_object_new_object();
  3127. DDChargingInfo4=json_object_new_object();
  3128. if(DDTotalConnectorQuantity>0){
  3129. json_object_object_add(DDChargingInfo1,"StartUserId",DDStartUserId[0]);
  3130. json_object_object_add(DDChargingInfo1,"StartDateTime",DDStartDateTime[0]);
  3131. json_object_object_add(DDChargingInfo1,"StopDateTime",DDStopDateTime[0]);
  3132. json_object_object_add(DDChargingInfo1,"StartMethod",DDStartMethod[0]);
  3133. json_object_object_add(DDChargingInfo1,"ConnectorTemp",DDConnectorTemp[0]);
  3134. json_object_object_add(DDChargingInfo1,"ChillerTemp",DDChillerTemp[0]);
  3135. json_object_object_add(DDChargingInfo1,"PresentChargingVoltage",DDPresentChargingVoltage[0]);
  3136. json_object_object_add(DDChargingInfo1,"PresentChargingCurrent",DDPresentChargingCurrent[0]);
  3137. json_object_object_add(DDChargingInfo1,"PresentChargingPower",DDPresentChargingPower[0]);
  3138. json_object_object_add(DDChargingInfo1,"PresentChargedEnergy",DDPresentChargedEnergy[0]);
  3139. json_object_object_add(DDChargingInfo1,"PresentChargedDuration",DDPresentChargedDuration[0]);
  3140. json_object_object_add(DDChargingInfo1,"RemainChargingDuration",DDRemainChargingDuration[0]);
  3141. json_object_object_add(DDChargingInfo1,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[0]);
  3142. json_object_object_add(DDChargingInfo1,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[0]);
  3143. json_object_object_add(DDChargingInfo1,"EvBatterySoc",DDEvBatterySoc[0]);
  3144. json_object_object_add(DDChargingInfo1,"SystemStatus",DDSystemStatus[0]);
  3145. json_object_object_add(DDChargingInfo1,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[0]);
  3146. json_object_object_add(DDChargingInfo1,"PowerConsumption",DDPowerConsumption[0]);
  3147. json_object_object_add(jobj2,"DDChargingInfo1",DDChargingInfo1);
  3148. }
  3149. if(DDTotalConnectorQuantity>1){
  3150. json_object_object_add(DDChargingInfo2,"StartUserId",DDStartUserId[1]);
  3151. json_object_object_add(DDChargingInfo2,"StartDateTime",DDStartDateTime[1]);
  3152. json_object_object_add(DDChargingInfo2,"StopDateTime",DDStopDateTime[1]);
  3153. json_object_object_add(DDChargingInfo2,"StartMethod",DDStartMethod[1]);
  3154. json_object_object_add(DDChargingInfo2,"ConnectorTemp",DDConnectorTemp[1]);
  3155. json_object_object_add(DDChargingInfo2,"ChillerTemp",DDChillerTemp[1]);
  3156. json_object_object_add(DDChargingInfo2,"PresentChargingVoltage",DDPresentChargingVoltage[1]);
  3157. json_object_object_add(DDChargingInfo2,"PresentChargingCurrent",DDPresentChargingCurrent[1]);
  3158. json_object_object_add(DDChargingInfo2,"PresentChargingPower",DDPresentChargingPower[1]);
  3159. json_object_object_add(DDChargingInfo2,"PresentChargedEnergy",DDPresentChargedEnergy[1]);
  3160. json_object_object_add(DDChargingInfo2,"PresentChargedDuration",DDPresentChargedDuration[1]);
  3161. json_object_object_add(DDChargingInfo2,"RemainChargingDuration",DDRemainChargingDuration[1]);
  3162. json_object_object_add(DDChargingInfo2,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[1]);
  3163. json_object_object_add(DDChargingInfo2,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[1]);
  3164. json_object_object_add(DDChargingInfo2,"EvBatterySoc",DDEvBatterySoc[1]);
  3165. json_object_object_add(DDChargingInfo2,"SystemStatus",DDSystemStatus[1]);
  3166. json_object_object_add(DDChargingInfo2,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[1]);
  3167. json_object_object_add(DDChargingInfo2,"PowerConsumption",DDPowerConsumption[1]);
  3168. json_object_object_add(jobj2,"DDChargingInfo2",DDChargingInfo2);
  3169. }
  3170. if(DDTotalConnectorQuantity>2){
  3171. json_object_object_add(DDChargingInfo3,"StartUserId",DDStartUserId[2]);
  3172. json_object_object_add(DDChargingInfo3,"StartDateTime",DDStartDateTime[2]);
  3173. json_object_object_add(DDChargingInfo3,"StopDateTime",DDStopDateTime[2]);
  3174. json_object_object_add(DDChargingInfo3,"StartMethod",DDStartMethod[2]);
  3175. json_object_object_add(DDChargingInfo3,"ConnectorTemp",DDConnectorTemp[2]);
  3176. json_object_object_add(DDChargingInfo3,"ChillerTemp",DDChillerTemp[2]);
  3177. json_object_object_add(DDChargingInfo3,"PresentChargingVoltage",DDPresentChargingVoltage[2]);
  3178. json_object_object_add(DDChargingInfo3,"PresentChargingCurrent",DDPresentChargingCurrent[2]);
  3179. json_object_object_add(DDChargingInfo3,"PresentChargingPower",DDPresentChargingPower[2]);
  3180. json_object_object_add(DDChargingInfo3,"PresentChargedEnergy",DDPresentChargedEnergy[2]);
  3181. json_object_object_add(DDChargingInfo3,"PresentChargedDuration",DDPresentChargedDuration[2]);
  3182. json_object_object_add(DDChargingInfo3,"RemainChargingDuration",DDRemainChargingDuration[2]);
  3183. json_object_object_add(DDChargingInfo3,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[2]);
  3184. json_object_object_add(DDChargingInfo3,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[2]);
  3185. json_object_object_add(DDChargingInfo3,"EvBatterySoc",DDEvBatterySoc[2]);
  3186. json_object_object_add(DDChargingInfo3,"SystemStatus",DDSystemStatus[2]);
  3187. json_object_object_add(DDChargingInfo3,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[2]);
  3188. json_object_object_add(DDChargingInfo3,"PowerConsumption",DDPowerConsumption[2]);
  3189. json_object_object_add(jobj2,"DDChargingInfo3",DDChargingInfo3);
  3190. }
  3191. if(DDTotalConnectorQuantity>3){
  3192. json_object_object_add(DDChargingInfo4,"StartUserId",DDStartUserId[3]);
  3193. json_object_object_add(DDChargingInfo4,"StartDateTime",DDStartDateTime[3]);
  3194. json_object_object_add(DDChargingInfo4,"StopDateTime",DDStopDateTime[3]);
  3195. json_object_object_add(DDChargingInfo4,"StartMethod",DDStartMethod[3]);
  3196. json_object_object_add(DDChargingInfo4,"ConnectorTemp",DDConnectorTemp[3]);
  3197. json_object_object_add(DDChargingInfo4,"ChillerTemp",DDChillerTemp[3]);
  3198. json_object_object_add(DDChargingInfo4,"PresentChargingVoltage",DDPresentChargingVoltage[3]);
  3199. json_object_object_add(DDChargingInfo4,"PresentChargingCurrent",DDPresentChargingCurrent[3]);
  3200. json_object_object_add(DDChargingInfo4,"PresentChargingPower",DDPresentChargingPower[3]);
  3201. json_object_object_add(DDChargingInfo4,"PresentChargedEnergy",DDPresentChargedEnergy[3]);
  3202. json_object_object_add(DDChargingInfo4,"PresentChargedDuration",DDPresentChargedDuration[3]);
  3203. json_object_object_add(DDChargingInfo4,"RemainChargingDuration",DDRemainChargingDuration[3]);
  3204. json_object_object_add(DDChargingInfo4,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[3]);
  3205. json_object_object_add(DDChargingInfo4,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[3]);
  3206. json_object_object_add(DDChargingInfo4,"EvBatterySoc",DDEvBatterySoc[3]);
  3207. json_object_object_add(DDChargingInfo4,"SystemStatus",DDSystemStatus[3]);
  3208. json_object_object_add(DDChargingInfo4,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[3]);
  3209. json_object_object_add(DDChargingInfo4,"PowerConsumption",DDPowerConsumption[3]);
  3210. json_object_object_add(jobj2,"DDChargingInfo4",DDChargingInfo4);
  3211. }
  3212. }
  3213. json_object_object_add(jobj2,"V2GPrivateKey",V2GPrivateKey);
  3214. json_object_object_add(jobj2,"V2GRootCertificate",V2GRootCertificate);
  3215. json_object_object_add(jobj2,"V2GCertificateChain",V2GCertificateChain);
  3216. printf("%s\n", json_object_to_json_string(jobj2));
  3217. json_object_put(jobj2);
  3218. //network
  3219. json_object_object_add(jobj3,"InternetConn",InternetConn);
  3220. json_object_object_add(jobj3,"FtpServer",FtpServer);
  3221. json_object_object_add(jobj3,"Eth0DhcpClient",Eth0DhcpClient);
  3222. json_object_object_add(jobj3,"Eth0MacAddress",Eth0MacAddress);
  3223. json_object_object_add(jobj3,"Eth0IpAddress",Eth0IpAddress);
  3224. json_object_object_add(jobj3,"Eth0SubmaskAddress",Eth0SubmaskAddress);
  3225. json_object_object_add(jobj3,"Eth0GatewayAddress",Eth0GatewayAddress);
  3226. json_object_object_add(jobj3,"Eth1DhcpClient",Eth1DhcpClient);
  3227. json_object_object_add(jobj3,"Eth1MacAddress",Eth1MacAddress);
  3228. json_object_object_add(jobj3,"Eth1IpAddress",Eth1IpAddress);
  3229. json_object_object_add(jobj3,"Eth1SubmaskAddress",Eth1SubmaskAddress);
  3230. json_object_object_add(jobj3,"Eth1GatewayAddress",Eth1GatewayAddress);
  3231. json_object_object_add(jobj3,"WifiMode",WifiMode);
  3232. json_object_object_add(jobj3,"WifiSsid",WifiSsid);
  3233. json_object_object_add(jobj3,"WifiPassword",WifiPassword);
  3234. json_object_object_add(jobj3,"WifiBroadcastSsid",WifiBroadcastSsid);
  3235. json_object_object_add(jobj3,"WifiTargetBssidMac",WifiTargetBssidMac);
  3236. json_object_object_add(jobj3,"WifiRssi",WifiRssi);
  3237. json_object_object_add(jobj3,"WifiDhcpServer",WifiDhcpServer);
  3238. json_object_object_add(jobj3,"WifiDhcpClient",WifiDhcpClient);
  3239. json_object_object_add(jobj3,"WifiMacAddress",WifiMacAddress);
  3240. json_object_object_add(jobj3,"WifiIpAddress",WifiIpAddress);
  3241. json_object_object_add(jobj3,"WifiSubmaskAddress",WifiSubmaskAddress);
  3242. json_object_object_add(jobj3,"WifiGatewayAddress",WifiGatewayAddress);
  3243. json_object_object_add(jobj3,"WifiNetworkConn",WifiNetworkConn);
  3244. json_object_object_add(jobj3,"TelcomApn",TelcomApn);
  3245. json_object_object_add(jobj3,"TelcomRssi",TelcomRssi);
  3246. json_object_object_add(jobj3,"TelcomChapPapId",TelcomChapPapId);
  3247. json_object_object_add(jobj3,"TelcomChapPapPwd",TelcomChapPapPwd);
  3248. json_object_object_add(jobj3,"TelcomModemImei",TelcomModemImei);
  3249. json_object_object_add(jobj3,"TelcomSimImsi",TelcomSimImsi);
  3250. json_object_object_add(jobj3,"TelcomSimIccid",TelcomSimIccid);
  3251. json_object_object_add(jobj3,"TelcomSimStatus",TelcomSimStatus);
  3252. json_object_object_add(jobj3,"TelcomModemMode",TelcomModemMode);
  3253. json_object_object_add(jobj3,"TelcomIpAddress",TelcomIpAddress);
  3254. json_object_object_add(jobj3,"TelcomNetworkConn",TelcomNetworkConn);
  3255. json_object_object_add(jobj3,"TelcomEnabled",TelcomEnabled);
  3256. json_object_object_add(jobj3,"TelcomNetworkType",TelcomNetworkType);
  3257. json_object_object_add(jobj3,"isEnalbleFirewall",isEnalbleFirewall);
  3258. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[0]);
  3259. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[1]);
  3260. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[2]);
  3261. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[3]);
  3262. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[4]);
  3263. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[5]);
  3264. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[6]);
  3265. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[7]);
  3266. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[8]);
  3267. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[9]);
  3268. json_object_object_add(jobj3,"FirewallAcceptAddr",FirewallAcceptAddrArr);
  3269. printf("%s\n", json_object_to_json_string(jobj3));
  3270. json_object_put(jobj3);
  3271. //backend
  3272. json_object_object_add(jobj4,"BackendConnTimeout",BackendConnTimeout);
  3273. json_object_object_add(jobj4,"OfflinePolicy",OfflinePolicy);
  3274. json_object_object_add(jobj4,"OfflineMaxChargeEnergy",OfflineMaxChargeEnergy);
  3275. json_object_object_add(jobj4,"OfflineMaxChargeDuration",OfflineMaxChargeDuration);
  3276. json_object_object_add(jobj4,"OcppConnStatus",OcppConnStatus);
  3277. json_object_object_add(jobj4,"MaintainServerConnStatus",MaintainServerConnStatus);
  3278. json_object_object_add(jobj4,"OcppServerURL",OcppServerURL);
  3279. json_object_object_add(jobj4,"ChargeBoxId",ChargeBoxId);
  3280. json_object_object_add(jobj4,"chargePointVendor",chargePointVendor);
  3281. json_object_object_add(jobj4,"OcppSecurityProfile",OcppSecurityProfile);
  3282. json_object_object_add(jobj4,"OcppSecurityPassword",OcppSecurityPassword);
  3283. json_object_object_add(jobj4,"MaintainServerSecurityProfile",MaintainServerSecurityProfile);
  3284. json_object_object_add(jobj4,"MaintainServerSecurityPassword",MaintainServerSecurityPassword);
  3285. json_object_object_add(jobj4,"MaintainServerURL",MaintainServerURL);
  3286. if(strcmp(IsDO, "AX") == 0 || strcmp(IsDO, "AW") == 0 || strcmp(IsAcDc, "D") == 0){
  3287. json_object_object_add(jobj4,"isEnableLocalPowerSharging",isEnableLocalPowerSharging);
  3288. json_object_object_add(jobj4,"PowerSharingCapacity",PowerSharingCapacity);
  3289. json_object_object_add(jobj4,"PowerSharingServerIP",PowerSharingServerIP);
  3290. json_object_object_add(jobj4,"OcppReceiptrURL",OcppReceiptrURL);
  3291. }
  3292. /*for TTIA*/
  3293. if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){
  3294. json_object_object_add(jobj4,"isEnableTTIA",isEnableTTIA);
  3295. json_object_object_add(jobj4,"server_addr",server_addr);
  3296. json_object_object_add(jobj4,"server_port",server_port);
  3297. json_object_object_add(jobj4,"busVenderId",busVenderId);
  3298. json_object_object_add(jobj4,"EquipmentProvider",EquipmentProvider);
  3299. json_object_object_add(jobj4,"TransportationCompanyNo",TransportationCompanyNo);
  3300. json_object_object_add(jobj4,"TTIAChargeBoxId",TTIAChargeBoxId);
  3301. json_object_object_add(jobj4,"evseStation",evseStation);
  3302. }
  3303. json_object_object_add(jobj4,"ChargePointPrivateKey",ChargePointPrivateKey);
  3304. json_object_object_add(jobj4,"ChargePointCertificate",ChargePointCertificate);
  3305. json_object_object_add(jobj4,"MORootCertificate",MORootCertificate);
  3306. json_object_object_add(jobj4,"CSRootCertificate",CSRootCertificate);
  3307. json_object_object_add(jobj4,"ManufacturerRootCertificate",ManufacturerRootCertificate);
  3308. printf("%s\n", json_object_to_json_string(jobj4));
  3309. json_object_put(jobj4);
  3310. }
  3311. // get status code
  3312. if(strcmp(argv[1], "StatusCode") == 0)
  3313. {
  3314. int type = atoi(argv[2]);
  3315. int bytes = atoi(argv[3]);
  3316. int bits = atoi(argv[4]);
  3317. struct json_object *jobj1;
  3318. //FaultCode
  3319. struct json_object *FaultCode;
  3320. //AlarmCode
  3321. struct json_object *AlarmCode;
  3322. //InfoCode
  3323. struct json_object *InfoCode;
  3324. jobj1=json_object_new_object();
  3325. //FaultCode
  3326. if(type==1){
  3327. FaultCode = json_object_new_int(((ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[bytes]) >> bits) & 1);//(num >> n) & 1
  3328. json_object_object_add(jobj1,"FaultCode",FaultCode);
  3329. }
  3330. //AlarmCode
  3331. if(type==2){
  3332. AlarmCode = json_object_new_int(((ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[bytes]) >> bits) & 1);//(num >> n) & 1
  3333. json_object_object_add(jobj1,"AlarmCode",AlarmCode);
  3334. }
  3335. //InfoCode
  3336. if(type==3){
  3337. InfoCode = json_object_new_int(((ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[bytes]) >> bits) & 1);//(num >> n) & 1
  3338. json_object_object_add(jobj1,"InfoCode",InfoCode);
  3339. }
  3340. printf("%s\n", json_object_to_json_string(jobj1));
  3341. json_object_put(jobj1);
  3342. }
  3343. // for(;;)
  3344. // {
  3345. // }
  3346. return FAIL;
  3347. }