WebService.c 135 KB

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