WebService.c 170 KB

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