WebService.c 102 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879
  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> /*Unix 標準函數定義*/
  20. #include <fcntl.h> /*檔控制定義*/
  21. #include <termios.h> /*PPSIX 終端控制定義*/
  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. void trim(char *s);
  47. int mystrcmp(char *p1, char *p2);
  48. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
  49. void split(char **arr, char *str, const char *del);
  50. #ifdef SystemLogMessage
  51. int StoreLogMsg(const char *fmt, ...) {
  52. char Buf[4096 + 256];
  53. char buffer[4096];
  54. time_t CurrentTime;
  55. struct tm *tm;
  56. va_list args;
  57. va_start(args, fmt);
  58. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  59. va_end(args);
  60. memset(Buf, 0, sizeof(Buf));
  61. CurrentTime = time(NULL);
  62. tm = localtime(&CurrentTime);
  63. sprintf(Buf,
  64. "echo \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
  65. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  66. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  67. system(Buf);
  68. #ifdef Debug
  69. printf("[%04d.%02d.%02d %02d:%02d:%02d] - %s", tm->tm_year + 1900,
  70. tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
  71. buffer);
  72. #endif
  73. return rc;
  74. }
  75. int WriteLogMsg(const char *fmt, ...) {
  76. char Buf[4096 + 256];
  77. char buffer[4096];
  78. time_t CurrentTime;
  79. struct tm *tm;
  80. va_list args;
  81. va_start(args, fmt);
  82. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  83. va_end(args);
  84. memset(Buf, 0, sizeof(Buf));
  85. CurrentTime = time(NULL);
  86. tm = localtime(&CurrentTime);
  87. sprintf(Buf,
  88. "echo \"[%04d.%02d.%02d %02d:%02d:%02d WebService] - %s\" >> /Storage/SystemLog/[%04d.%02d]WebService_SystemLog",
  89. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  90. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  91. system(Buf);
  92. return rc;
  93. }
  94. #endif
  95. int DiffTimeb(struct timeb ST, struct timeb ET) {
  96. //return milli-second
  97. unsigned int StartTime, StopTime;
  98. StartTime = (unsigned int) ST.time;
  99. StopTime = (unsigned int) ET.time;
  100. return (StopTime - StartTime) * 1000 + ET.millitm - ST.millitm;
  101. }
  102. //=================================
  103. // Common routine
  104. //=================================
  105. void trim(char *s) {
  106. int i = 0, j, k, l = 0;
  107. while ((s[i] == ' ') || (s[i] == '\t') || (s[i] == '\n'))
  108. i++;
  109. j = strlen(s) - 1;
  110. while ((s[j] == ' ') || (s[j] == '\t') || (s[j] == '\n'))
  111. j--;
  112. if (i == 0 && j == strlen(s) - 1) {
  113. } else if (i == 0)
  114. s[j + 1] = '\0';
  115. else {
  116. for (k = i; k <= j; k++)
  117. s[l++] = s[k];
  118. s[l] = '\0';
  119. }
  120. }
  121. int mystrcmp(char *p1, char *p2) {
  122. while (*p1 == *p2) {
  123. if (*p1 == '\0' || *p2 == '\0')
  124. break;
  125. p1++;
  126. p2++;
  127. }
  128. if (*p1 == '\0' && *p2 == '\0')
  129. return (PASS);
  130. else
  131. return (FAIL);
  132. }
  133. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt) {
  134. strncpy(dest, src + start, cnt);
  135. dest[cnt] = 0;
  136. }
  137. void split(char **arr, char *str, const char *del) {
  138. char *s = strtok(str, del);
  139. while (s != NULL) {
  140. *arr++ = s;
  141. s = strtok(NULL, del);
  142. }
  143. }
  144. int ConnectorType(char* connector){
  145. int result;
  146. if(strcmp(connector, "0") == 0){
  147. result= 0;
  148. }
  149. else if(strcmp(connector, "U") == 0 || strcmp(connector, "E") == 0){
  150. result= 1;//CCS
  151. }
  152. else if(strcmp(connector, "G") == 0 || strcmp(connector, "D") == 0){
  153. result= 2;//GB
  154. }
  155. else if(strcmp(connector, "J") == 0){
  156. result= 3;//CHAdeMO
  157. }
  158. 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){
  159. result= 4;//AC
  160. }
  161. else{
  162. result= 0;
  163. }
  164. return result;
  165. }
  166. int ModelType(char* type,char* network){
  167. int result=0;
  168. if(strcmp(type, "A") == 0){
  169. if(strcmp(network, "0") == 0 || strcmp(network, "R") == 0 || strcmp(network, "B") == 0){
  170. result=0;
  171. }
  172. else if(strcmp(network, "E") == 0 || strcmp(network, "W") == 0 || strcmp(network, "T") == 0 || strcmp(network, "U") == 0){
  173. result=1;
  174. }
  175. }
  176. else if(strcmp(type, "D") == 0){
  177. result=2;
  178. }
  179. return result;
  180. }
  181. // 四捨五入 取到 小數點第 2 位
  182. float rounding(float a)
  183. {
  184. return (int)(a*100+0.5)/100.0;
  185. }
  186. //==========================================
  187. // Init all share memory
  188. //==========================================
  189. int InitShareMemory() {
  190. int result = PASS;
  191. int MeterSMId;
  192. //creat ShmSysConfigAndInfo
  193. if ((MeterSMId = shmget(ShmSysConfigAndInfoKey,
  194. sizeof(struct SysConfigAndInfo), 0777)) < 0) {
  195. printf("%s\n","InitShareMemory Error");
  196. #ifdef SystemLogMessage
  197. DEBUG_ERROR("shmget ShmSysConfigAndInfo NG\n");
  198. #endif
  199. result = FAIL;
  200. } else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0))
  201. == (void *) -1) {
  202. #ifdef SystemLogMessage
  203. DEBUG_ERROR("shmat ShmSysConfigAndInfo NG\n");
  204. #endif
  205. result = FAIL;
  206. } else {
  207. }
  208. //creat ShmStatusCodeData
  209. if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),
  210. 0777)) < 0) {
  211. #ifdef SystemLogMessage
  212. DEBUG_ERROR("shmget ShmStatusCodeData NG\n");
  213. #endif
  214. result = FAIL;
  215. } else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  216. #ifdef SystemLogMessage
  217. DEBUG_ERROR("shmat ShmStatusCodeData NG\n");
  218. #endif
  219. result = FAIL;
  220. } else {
  221. }
  222. //creat ShmPsuData
  223. if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData),
  224. 0777)) < 0) {
  225. #ifdef SystemLogMessage
  226. DEBUG_ERROR("shmget ShmPsuData NG\n");
  227. #endif
  228. result = FAIL;
  229. } else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  230. #ifdef SystemLogMessage
  231. DEBUG_ERROR("shmat ShmPsuData NG\n");
  232. #endif
  233. result = FAIL;
  234. } else {
  235. }
  236. return result;
  237. }
  238. int StoreUsrConfigData(struct SysConfigData *UsrData)
  239. {
  240. int result = PASS;
  241. int fd,wrd;
  242. unsigned int i,Chk;
  243. unsigned char *ptr, *BufTmp;
  244. Chk=0;
  245. ptr=(unsigned char *)UsrData;
  246. if((BufTmp=malloc(MtdBlockSize))!=NULL)
  247. {
  248. memset(BufTmp,0,MtdBlockSize);
  249. memcpy(BufTmp,ptr,sizeof(struct SysConfigData));
  250. for(i=0;i<MtdBlockSize-4;i++)
  251. Chk+=*(BufTmp+i);
  252. memcpy( BufTmp+MtdBlockSize-4,&Chk,4);
  253. fd = open("/dev/mtdblock10", O_RDWR);
  254. if (fd>0)
  255. {
  256. wrd=write(fd, BufTmp, MtdBlockSize);
  257. close(fd);
  258. if(wrd>=MtdBlockSize)
  259. {
  260. fd = open("/dev/mtdblock11", O_RDWR);
  261. if (fd>0)
  262. {
  263. wrd=write(fd, BufTmp, MtdBlockSize);
  264. close(fd);
  265. if(wrd<MtdBlockSize)
  266. {
  267. DEBUG_ERROR("write /dev/mtdblock11(backup) NG\r\n");
  268. result = FAIL;
  269. }
  270. }
  271. else
  272. {
  273. DEBUG_ERROR("open /dev/mtdblock11(backup) NG\r\n");
  274. result = FAIL;
  275. }
  276. }
  277. else
  278. {
  279. DEBUG_ERROR("write /dev/mtdblock10 NG\r\n");
  280. result = FAIL;
  281. }
  282. }
  283. else
  284. {
  285. DEBUG_ERROR("open /dev/mtdblock10 NG\r\n");
  286. result = FAIL;
  287. }
  288. }
  289. else
  290. {
  291. DEBUG_ERROR("alloc BlockSize NG\r\n");
  292. result = FAIL;
  293. }
  294. if(BufTmp!=NULL)
  295. free(BufTmp);
  296. return result;
  297. }
  298. //================================================
  299. // Main process
  300. //================================================
  301. int main(int argc, char *argv[]) {
  302. //int InitShMry = 1;
  303. if (InitShareMemory() == FAIL) {
  304. //InitShMry = 0;
  305. #ifdef SystemLogMessage
  306. DEBUG_ERROR("InitShareMemory NG\n");
  307. #endif
  308. if (ShmStatusCodeData != NULL) {
  309. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
  310. }
  311. sleep(5);
  312. return 0;
  313. }
  314. //web page submit
  315. if ((argc == 3) & (strlen(argv[1]) == 1)) {
  316. //web page submit system
  317. if (strcmp(argv[1], "1") == 0) {
  318. struct json_object *jobj = json_tokener_parse(argv[2]);
  319. json_object *val_obj = NULL;
  320. char *SystemId=NULL;
  321. char *SystemDateTime = NULL;
  322. int PhaseLossPolicy = 0;
  323. int FactoryConfiguration = 0;
  324. int AuthorisationMode = 0;
  325. int RfidCardNumEndian = 0;
  326. int PsuAcInputType = 0;
  327. char isAPP = NULL;
  328. char isQRCode = NULL;
  329. char isRFID = NULL;
  330. char QRCodeMadeMode = NULL;
  331. char *QRCodeContent = NULL;
  332. char Intensity = NULL;
  333. if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
  334. SystemId = (char*)json_object_get_string(val_obj);
  335. }
  336. if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
  337. SystemDateTime = (char*)json_object_get_string(val_obj);
  338. }
  339. if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
  340. PhaseLossPolicy = json_object_get_int(val_obj);
  341. }
  342. if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
  343. FactoryConfiguration = json_object_get_int(val_obj);
  344. }
  345. if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
  346. AuthorisationMode = json_object_get_int(val_obj);
  347. }
  348. if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
  349. RfidCardNumEndian = json_object_get_int(val_obj);
  350. }
  351. if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
  352. PsuAcInputType = json_object_get_int(val_obj);
  353. }
  354. if( json_object_object_get_ex(jobj, "isAPP", &val_obj) ) {
  355. isAPP = json_object_get_int(val_obj);
  356. }
  357. if( json_object_object_get_ex(jobj, "isQRCode", &val_obj) ) {
  358. isQRCode = json_object_get_int(val_obj);
  359. }
  360. if( json_object_object_get_ex(jobj, "isRFID", &val_obj) ) {
  361. isRFID = json_object_get_int(val_obj);
  362. }
  363. if( json_object_object_get_ex(jobj, "QRCodeMadeMode", &val_obj) ) {
  364. QRCodeMadeMode = json_object_get_int(val_obj);
  365. }
  366. if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
  367. QRCodeContent = json_object_get_string(val_obj);
  368. }
  369. if( json_object_object_get_ex(jobj, "Intensity", &val_obj) ) {
  370. Intensity = json_object_get_int(val_obj);
  371. }
  372. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
  373. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
  374. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
  375. ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
  376. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
  377. ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
  378. ShmSysConfigAndInfo->SysConfig.isAPP = isAPP;
  379. ShmSysConfigAndInfo->SysConfig.isQRCode = isQRCode;
  380. ShmSysConfigAndInfo->SysConfig.isRFID = isRFID;
  381. ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
  382. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
  383. ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity = Intensity;
  384. if(strlen(SystemDateTime)>0){
  385. char cmd[100];
  386. sprintf(cmd,"date -s '%s'",SystemDateTime);
  387. if(system(cmd)==0){
  388. system("hwclock -w");
  389. }
  390. }
  391. }
  392. if (strcmp(argv[1], "2") == 0) {
  393. struct json_object *jobj = json_tokener_parse(argv[2]);
  394. json_object *val_obj = NULL;
  395. int MaxChargingEnergy= 0;
  396. int MaxChargingPower = 0;
  397. int MaxChargingCurrent = 0;
  398. int AcMaxChargingCurrent = 0;
  399. int MaxChargingDuration = 0;
  400. char *LocalWhiteCard0 = NULL;
  401. char *LocalWhiteCard1 = NULL;
  402. char *LocalWhiteCard2 = NULL;
  403. char *LocalWhiteCard3 = NULL;
  404. char *LocalWhiteCard4 = NULL;
  405. char *LocalWhiteCard5 = NULL;
  406. char *LocalWhiteCard6 = NULL;
  407. char *LocalWhiteCard7 = NULL;
  408. char *LocalWhiteCard8 = NULL;
  409. char *LocalWhiteCard9 = NULL;
  410. char isBilling = 0;
  411. char Currency = 0;
  412. float Fee0 = 0;
  413. float Fee1 = 0;
  414. float Fee2 = 0;
  415. float Fee3 = 0;
  416. float Fee4 = 0;
  417. float Fee5 = 0;
  418. float Fee6 = 0;
  419. float Fee7 = 0;
  420. float Fee8 = 0;
  421. float Fee9 = 0;
  422. float Fee10 = 0;
  423. float Fee11 = 0;
  424. float Fee12 = 0;
  425. float Fee13 = 0;
  426. float Fee14 = 0;
  427. float Fee15 = 0;
  428. float Fee16 = 0;
  429. float Fee17 = 0;
  430. float Fee18 = 0;
  431. float Fee19 = 0;
  432. float Fee20 = 0;
  433. float Fee21 = 0;
  434. float Fee22 = 0;
  435. float Fee23 = 0;
  436. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  437. MaxChargingEnergy = json_object_get_int(val_obj);
  438. }
  439. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  440. MaxChargingPower = json_object_get_int(val_obj);
  441. }
  442. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  443. MaxChargingCurrent = json_object_get_int(val_obj);
  444. }
  445. if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
  446. AcMaxChargingCurrent = json_object_get_int(val_obj);
  447. }
  448. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  449. MaxChargingDuration = json_object_get_int(val_obj);
  450. }
  451. if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
  452. LocalWhiteCard0 = (char*)json_object_get_string(val_obj);
  453. }
  454. if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
  455. LocalWhiteCard1 = (char*)json_object_get_string(val_obj);
  456. }
  457. if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
  458. LocalWhiteCard2 = (char*)json_object_get_string(val_obj);
  459. }
  460. if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
  461. LocalWhiteCard3 = (char*)json_object_get_string(val_obj);
  462. }
  463. if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
  464. LocalWhiteCard4 = (char*)json_object_get_string(val_obj);
  465. }
  466. if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
  467. LocalWhiteCard5 = (char*)json_object_get_string(val_obj);
  468. }
  469. if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
  470. LocalWhiteCard6 = (char*)json_object_get_string(val_obj);
  471. }
  472. if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
  473. LocalWhiteCard7 = (char*)json_object_get_string(val_obj);
  474. }
  475. if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
  476. LocalWhiteCard8 = (char*)json_object_get_string(val_obj);
  477. }
  478. if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
  479. LocalWhiteCard9 = (char*)json_object_get_string(val_obj);
  480. }
  481. if( json_object_object_get_ex(jobj, "isBilling", &val_obj) ) {
  482. isBilling = json_object_get_int(val_obj);
  483. }
  484. if( json_object_object_get_ex(jobj, "Currency", &val_obj) ) {
  485. Currency = json_object_get_int(val_obj);
  486. }
  487. if( json_object_object_get_ex(jobj, "Fee0", &val_obj) ) {
  488. Fee0 = json_object_get_double(val_obj);
  489. }
  490. if( json_object_object_get_ex(jobj, "Fee1", &val_obj) ) {
  491. Fee1 = json_object_get_double(val_obj);
  492. }
  493. if( json_object_object_get_ex(jobj, "Fee2", &val_obj) ) {
  494. Fee2 = json_object_get_double(val_obj);
  495. }
  496. if( json_object_object_get_ex(jobj, "Fee3", &val_obj) ) {
  497. Fee3 = json_object_get_double(val_obj);
  498. }
  499. if( json_object_object_get_ex(jobj, "Fee4", &val_obj) ) {
  500. Fee4 = json_object_get_double(val_obj);
  501. }
  502. if( json_object_object_get_ex(jobj, "Fee5", &val_obj) ) {
  503. Fee5 = json_object_get_double(val_obj);
  504. }
  505. if( json_object_object_get_ex(jobj, "Fee6", &val_obj) ) {
  506. Fee6 = json_object_get_double(val_obj);
  507. }
  508. if( json_object_object_get_ex(jobj, "Fee7", &val_obj) ) {
  509. Fee7 = json_object_get_double(val_obj);
  510. }
  511. if( json_object_object_get_ex(jobj, "Fee8", &val_obj) ) {
  512. Fee8 = json_object_get_double(val_obj);
  513. }
  514. if( json_object_object_get_ex(jobj, "Fee9", &val_obj) ) {
  515. Fee9 = json_object_get_double(val_obj);
  516. }
  517. if( json_object_object_get_ex(jobj, "Fee10", &val_obj) ) {
  518. Fee10 = json_object_get_double(val_obj);
  519. }
  520. if( json_object_object_get_ex(jobj, "Fee11", &val_obj) ) {
  521. Fee11 = json_object_get_double(val_obj);
  522. }
  523. if( json_object_object_get_ex(jobj, "Fee12", &val_obj) ) {
  524. Fee12 = json_object_get_double(val_obj);
  525. }
  526. if( json_object_object_get_ex(jobj, "Fee13", &val_obj) ) {
  527. Fee13 = json_object_get_double(val_obj);
  528. }
  529. if( json_object_object_get_ex(jobj, "Fee14", &val_obj) ) {
  530. Fee14 = json_object_get_double(val_obj);
  531. }
  532. if( json_object_object_get_ex(jobj, "Fee15", &val_obj) ) {
  533. Fee15 = json_object_get_double(val_obj);
  534. }
  535. if( json_object_object_get_ex(jobj, "Fee16", &val_obj) ) {
  536. Fee16 = json_object_get_double(val_obj);
  537. }
  538. if( json_object_object_get_ex(jobj, "Fee17", &val_obj) ) {
  539. Fee17 = json_object_get_double(val_obj);
  540. }
  541. if( json_object_object_get_ex(jobj, "Fee18", &val_obj) ) {
  542. Fee18 = json_object_get_double(val_obj);
  543. }
  544. if( json_object_object_get_ex(jobj, "Fee19", &val_obj) ) {
  545. Fee19 = json_object_get_double(val_obj);
  546. }
  547. if( json_object_object_get_ex(jobj, "Fee20", &val_obj) ) {
  548. Fee20 = json_object_get_double(val_obj);
  549. }
  550. if( json_object_object_get_ex(jobj, "Fee21", &val_obj) ) {
  551. Fee21 = json_object_get_double(val_obj);
  552. }
  553. if( json_object_object_get_ex(jobj, "Fee22", &val_obj) ) {
  554. Fee22 = json_object_get_double(val_obj);
  555. }
  556. if( json_object_object_get_ex(jobj, "Fee23", &val_obj) ) {
  557. Fee23 = json_object_get_double(val_obj);
  558. }
  559. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  560. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  561. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  562. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
  563. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  564. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
  565. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
  566. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
  567. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
  568. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
  569. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
  570. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
  571. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
  572. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
  573. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
  574. ShmSysConfigAndInfo->SysConfig.BillingData.isBilling = isBilling;
  575. ShmSysConfigAndInfo->SysConfig.BillingData.Currency = Currency;
  576. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0] = rounding(Fee0);
  577. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1] = rounding(Fee1);
  578. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2] = rounding(Fee2);
  579. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3] = rounding(Fee3);
  580. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4] = rounding(Fee4);
  581. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5] = rounding(Fee5);
  582. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6] = rounding(Fee6);
  583. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7] = rounding(Fee7);
  584. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8] = rounding(Fee8);
  585. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9] = rounding(Fee9);
  586. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10] = rounding(Fee10);
  587. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11] = rounding(Fee11);
  588. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12] = rounding(Fee12);
  589. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13] = rounding(Fee13);
  590. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14] = rounding(Fee14);
  591. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15] = rounding(Fee15);
  592. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16] = rounding(Fee16);
  593. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17] = rounding(Fee17);
  594. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18] = rounding(Fee18);
  595. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19] = rounding(Fee19);
  596. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20] = rounding(Fee20);
  597. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21] = rounding(Fee21);
  598. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22] = rounding(Fee22);
  599. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23] = rounding(Fee23);
  600. }
  601. if (strcmp(argv[1], "3") == 0) {
  602. struct json_object *jobj = json_tokener_parse(argv[2]);
  603. json_object *val_obj = NULL;
  604. int Eth0DhcpClient=0;
  605. char *Eth0IpAddress=NULL;
  606. char *Eth0SubmaskAddress=NULL;
  607. char *Eth0GatewayAddress=NULL;
  608. int Eth1DhcpClient=0;
  609. int WifiMode=0;
  610. char *WifiSsid=NULL;
  611. char *WifiPassword=NULL;
  612. int WifiDhcpServer=0;
  613. int WifiDhcpClient=0;
  614. char *WifiIpAddress=NULL;
  615. char *WifiSubmaskAddress=NULL;
  616. char *WifiGatewayAddress=NULL;
  617. char *TelcomApn=NULL;
  618. char *TelcomChapPapId=NULL;
  619. char *TelcomChapPapPwd=NULL;
  620. char *TelcomIpAddress=NULL;
  621. char TelcomEnabled=NULL;
  622. if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
  623. Eth0DhcpClient = json_object_get_int(val_obj);
  624. }
  625. if( json_object_object_get_ex(jobj, "Eth0IpAddress", &val_obj) ) {
  626. Eth0IpAddress = (char*)json_object_get_string(val_obj);
  627. }
  628. if( json_object_object_get_ex(jobj, "Eth0SubmaskAddress", &val_obj) ) {
  629. Eth0SubmaskAddress = (char*)json_object_get_string(val_obj);
  630. }
  631. if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
  632. Eth0GatewayAddress = (char*)json_object_get_string(val_obj);
  633. }
  634. if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
  635. WifiMode = json_object_get_int(val_obj);
  636. }
  637. if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
  638. WifiSsid = (char*)json_object_get_string(val_obj);
  639. }
  640. if( json_object_object_get_ex(jobj, "WifiPassword", &val_obj) ) {
  641. WifiPassword = (char*)json_object_get_string(val_obj);
  642. }
  643. if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
  644. WifiDhcpServer = json_object_get_int(val_obj);
  645. }
  646. if( json_object_object_get_ex(jobj, "WifiDhcpClient", &val_obj) ) {
  647. WifiDhcpClient = json_object_get_int(val_obj);
  648. }
  649. if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
  650. WifiIpAddress = (char*)json_object_get_string(val_obj);
  651. }
  652. if( json_object_object_get_ex(jobj, "WifiSubmaskAddress", &val_obj) ) {
  653. WifiSubmaskAddress = (char*)json_object_get_string(val_obj);
  654. }
  655. if( json_object_object_get_ex(jobj, "WifiGatewayAddress", &val_obj) ) {
  656. WifiGatewayAddress = (char*)json_object_get_string(val_obj);
  657. }
  658. if( json_object_object_get_ex(jobj, "TelcomApn", &val_obj) ) {
  659. TelcomApn = (char*)json_object_get_string(val_obj);
  660. }
  661. if( json_object_object_get_ex(jobj, "TelcomChapPapId", &val_obj) ) {
  662. TelcomChapPapId = (char*)json_object_get_string(val_obj);
  663. }
  664. if( json_object_object_get_ex(jobj, "TelcomChapPapPwd", &val_obj) ) {
  665. TelcomChapPapPwd = (char*)json_object_get_string(val_obj);
  666. }
  667. if( json_object_object_get_ex(jobj, "TelcomIpAddress", &val_obj) ) {
  668. TelcomIpAddress = (char*)json_object_get_string(val_obj);
  669. }
  670. if( json_object_object_get_ex(jobj, "TelcomEnabled", &val_obj) ) {
  671. TelcomEnabled = json_object_get_int(val_obj);
  672. }
  673. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=Eth0DhcpClient;
  674. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,Eth0IpAddress);
  675. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,Eth0SubmaskAddress);
  676. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,Eth0GatewayAddress);
  677. ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=Eth1DhcpClient;
  678. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
  679. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
  680. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
  681. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=WifiDhcpServer;
  682. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=WifiDhcpClient;
  683. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,WifiIpAddress);
  684. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,WifiSubmaskAddress);
  685. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,WifiGatewayAddress);
  686. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,TelcomApn);
  687. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,TelcomChapPapId);
  688. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,TelcomChapPapPwd);
  689. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
  690. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled=TelcomEnabled;
  691. }
  692. if (strcmp(argv[1], "4") == 0) {
  693. struct json_object *jobj = json_tokener_parse(argv[2]);
  694. json_object *val_obj = NULL;
  695. int BackendConnTimeout=0;
  696. int OfflinePolicy=0;
  697. int OfflineMaxChargeEnergy=0;
  698. int OfflineMaxChargeDuration=0;
  699. char *OcppServerURL=NULL;
  700. char *ChargeBoxId=NULL;
  701. char *chargePointVendor=NULL;
  702. if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
  703. BackendConnTimeout = json_object_get_int(val_obj);
  704. }
  705. if( json_object_object_get_ex(jobj, "OfflinePolicy", &val_obj) ) {
  706. OfflinePolicy = json_object_get_int(val_obj);
  707. }
  708. if( json_object_object_get_ex(jobj, "OfflineMaxChargeEnergy", &val_obj) ) {
  709. OfflineMaxChargeEnergy = json_object_get_int(val_obj);
  710. }
  711. if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
  712. OfflineMaxChargeDuration = json_object_get_int(val_obj);
  713. }
  714. if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
  715. OcppServerURL = (char*)json_object_get_string(val_obj);
  716. }
  717. if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
  718. ChargeBoxId = (char*)json_object_get_string(val_obj);
  719. }
  720. if( json_object_object_get_ex(jobj, "chargePointVendor", &val_obj) ) {
  721. chargePointVendor = (char*)json_object_get_string(val_obj);
  722. }
  723. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
  724. ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
  725. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
  726. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
  727. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
  728. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
  729. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,chargePointVendor);
  730. }
  731. struct SysConfigData SysConfig;
  732. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  733. int result = StoreUsrConfigData(&SysConfig);
  734. if(result != 1){
  735. #ifdef SystemLogMessage
  736. StoreLogMsg("[WebService]StoreUsrConfigData: normal NG");
  737. #endif
  738. }
  739. else{
  740. #ifdef SystemLogMessage
  741. StoreLogMsg("[WebService]StoreUsrConfigData: normal OK");
  742. #endif
  743. }
  744. #ifdef SystemLogMessage
  745. DEBUG_INFO("WebServiceConfig update OK");
  746. #endif
  747. }
  748. if (argc == 2) { //init share memory for test
  749. if (strcmp(argv[1], "aaa") == 0) {
  750. //struct SysConfigData SysConfig;
  751. //system
  752. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "AW0E770001W1P0D");
  753. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber, "SerialNumber");
  754. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId, "1234567890");
  755. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemDateTime, "2019-12-31 23:59:59");
  756. ShmSysConfigAndInfo->SysConfig.AcPhaseCount=1;
  757. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy=0;
  758. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration=0;
  759. ShmSysConfigAndInfo->SysConfig.AuthorisationMode=0;
  760. ShmSysConfigAndInfo->SysConfig.DefaultLanguage=0;
  761. ShmSysConfigAndInfo->SysInfo.InputVoltageR=0;
  762. ShmSysConfigAndInfo->SysInfo.InputVoltageS=0;
  763. ShmSysConfigAndInfo->SysInfo.InputVoltageT=0;
  764. ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed=0;
  765. ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed=0;
  766. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian=0;
  767. ShmSysConfigAndInfo->SysConfig.RatingCurrent=100;
  768. ShmSysConfigAndInfo->SysConfig.PsuAcInputType=0;
  769. ShmSysConfigAndInfo->SysInfo.AuxPower5V=0;
  770. ShmSysConfigAndInfo->SysInfo.AuxPower12V=0;
  771. ShmSysConfigAndInfo->SysInfo.AuxPower24V=0;
  772. ShmSysConfigAndInfo->SysInfo.AuxPower48V=0;
  773. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev, "");
  774. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev, "");
  775. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev, "");
  776. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "");
  777. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, "");
  778. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev, "");
  779. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev, "");
  780. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev, "");
  781. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev, "");
  782. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev, "");
  783. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev, "");
  784. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev, "");
  785. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev, "");
  786. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev, "");
  787. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev, "");
  788. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev, "");
  789. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev, "");
  790. ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp=0;
  791. ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp=0;
  792. ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp=0;
  793. ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp=0;
  794. ShmSysConfigAndInfo->SysConfig.AcPlugInTimes=0;
  795. ShmSysConfigAndInfo->SysConfig.GbPlugInTimes=0;
  796. ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime=0;
  797. ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes=0;
  798. ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes=0;
  799. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwPrimaryVersion, "DC 9.01");
  800. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwPrimaryVersion, "DC 9.02");
  801. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwSecondVersion, "PFC 9.02");
  802. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwSecondVersion, "PFC 9.03");
  803. //charging
  804. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=0;
  805. ShmSysConfigAndInfo->SysConfig.MaxChargingPower=0;
  806. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent= 0;
  807. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent= 0;
  808. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=0;
  809. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0], "111");
  810. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1], "222");
  811. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2], "333");
  812. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3], "444");
  813. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4], "555");
  814. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5], "666");
  815. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6], "777");
  816. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7], "888");
  817. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8], "999");
  818. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9], "aaa");
  819. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.UserId, "UserId");
  820. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingVoltage=0;
  821. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingCurrent=0;
  822. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingPower=0;
  823. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedEnergy=0;
  824. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedDuration=0;
  825. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].RemainChargingDuration=0;
  826. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatteryMaxVoltage=0;
  827. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetVoltage=0;
  828. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterySoc=0;
  829. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].SystemStatus=1;
  830. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].Index=0;
  831. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].Type=0;
  832. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].type_index=0;
  833. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetCurrent=1;
  834. //network
  835. ShmSysConfigAndInfo->SysInfo.InternetConn=0;
  836. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer,"");
  837. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=1;
  838. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress,"");
  839. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,"192.168.1.10");
  840. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
  841. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,"192.168.1.1");
  842. ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=1;
  843. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress,"");
  844. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,"192.168.0.10");
  845. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
  846. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,"192.168.0.1");
  847. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=1;
  848. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,"");
  849. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,"");
  850. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi=0;
  851. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=0;
  852. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=0;
  853. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress,"");
  854. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,"");
  855. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,"");
  856. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,"");
  857. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn=1;
  858. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,"");
  859. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=0;
  860. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,"");
  861. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,"");
  862. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei,"");
  863. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi,"");
  864. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid,"");
  865. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
  866. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=0;
  867. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,"");
  868. //backend
  869. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout=300;
  870. ShmSysConfigAndInfo->SysConfig.OfflinePolicy=0;
  871. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy=0;
  872. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration=0;
  873. ShmSysConfigAndInfo->SysInfo.OcppConnStatus=0;
  874. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"");
  875. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,"");
  876. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,"Phihong");
  877. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=0;
  878. struct SysConfigData SysConfig;
  879. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  880. StoreUsrConfigData(&SysConfig);
  881. // struct PsuModuleVer PsuData;
  882. // memcpy(&PsuData, &ShmPsuData->PsuVersion, sizeof(struct PsuModuleVer));
  883. // StoreUsrConfigData(&PsuData);
  884. #ifdef SystemLogMessage
  885. DEBUG_INFO("WebService initial OK");
  886. #endif
  887. }
  888. if (strcmp(argv[1], "log") == 0) {
  889. unsigned char ModelName[64];;
  890. unsigned char SerialNo[64];;
  891. memcpy(ModelName,ShmSysConfigAndInfo->SysConfig.ModelName,ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.ModelName));
  892. printf("%s", ModelName);
  893. memcpy(SerialNo,ShmSysConfigAndInfo->SysConfig.SerialNumber,ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber));
  894. printf("%s", SerialNo);
  895. time_t tt = time(0); //獲取當前時間
  896. int year,month;
  897. char cmd[512];
  898. struct tm *pst = localtime(&tt); //把time_t類型轉換為struct tm類型
  899. year = pst->tm_year + 1900;
  900. month = pst->tm_mon + 1;
  901. // sprintf(cmd,"cp /mnt/*%s*%s*.zip /var/www/log.zip",ModelName,SerialNo);
  902. if(system("exec /root/logPackTools 'log'")==0){
  903. system(cmd);
  904. }
  905. }
  906. if (strcmp(argv[1], "restart") == 0) {
  907. system("exec /usr/bin/run_evse_restart.sh");
  908. }
  909. }
  910. //upgrade firmware
  911. if ((argc == 3) & (strcmp(argv[1], "upgrade") == 0)) {
  912. struct json_object *jobj;
  913. struct json_object *Result;
  914. struct json_object *Message;
  915. //char cmd[100];
  916. jobj=json_object_new_object();
  917. //system
  918. //if((char)ShmSysConfigAndInfo->SysInfo.FirmwareUpdate == '0'){
  919. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=1;
  920. Result = json_object_new_string("success");
  921. Message = json_object_new_string("file is uploaded");
  922. //}
  923. /*else{
  924. sprintf(cmd,"rm /mnt/%s",argv[2]);
  925. system(cmd);
  926. Result = json_object_new_string("error");
  927. Message = json_object_new_string("machine is busy");
  928. }*/
  929. json_object_object_add(jobj,"Result",Result);
  930. json_object_object_add(jobj,"Message",Message);
  931. printf("%s\n", json_object_to_json_string(jobj));
  932. }
  933. //web page query all
  934. if ((argc == 2) & (strcmp(argv[1], "query") == 0)) {
  935. char *IsAcDc[2];
  936. char *Connector1[2];
  937. char *Connector2[2];
  938. char *Connector3[2];
  939. char *Network[2];
  940. unsigned char connector1FwVer[32];
  941. unsigned char connector2FwVer[32];
  942. short gunQty;
  943. char *RatedPower1[2];
  944. char *RatedPower2[2];
  945. char *RatedPower3[2];
  946. short RatedPower;
  947. short PsuQuantity = 0;
  948. substr((char *)IsAcDc,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,1);
  949. substr((char *)Connector1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,7,1);
  950. substr((char *)Connector2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
  951. substr((char *)Connector3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
  952. substr((char *)Network,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,10,1);
  953. int connectorType1,connectorType2,connectorType3;
  954. connectorType1=ConnectorType((char *)Connector1);
  955. connectorType2=ConnectorType((char *)Connector2);
  956. connectorType3=ConnectorType((char *)Connector3);
  957. if(connectorType1 == connectorType2){
  958. gunQty = 1;
  959. }
  960. else{
  961. gunQty = 0;
  962. }
  963. if(connectorType1 != 0){
  964. if(connectorType1 == 1){
  965. // strcpy((char *)&connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  966. // memcpy(connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  967. }
  968. else if(connectorType1 == 2){
  969. // strcpy((char *)&connector1FwVer,ShmGBTData->evse[0].version);
  970. // memcpy(connector1FwVer,ShmGBTData->evse[0].version,ARRAY_SIZE(ShmGBTData->evse[0].version));
  971. }
  972. else if(connectorType1 == 3){
  973. // strcpy((char *)&connector1FwVer,ShmCHAdeMOData->evse[0].version);
  974. // memcpy(connector1FwVer,ShmCHAdeMOData->evse[0].version,ARRAY_SIZE(ShmCHAdeMOData->evse[0].version));
  975. }
  976. }
  977. if(connectorType2 != 0){
  978. if(connectorType2 == 1){
  979. // strcpy((char *)&connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  980. // memcpy(connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  981. }
  982. else if(connectorType2 == 2){
  983. // strcpy((char *)&connector2FwVer,ShmGBTData->evse[gunQty].version);
  984. // memcpy(connector2FwVer,ShmGBTData->evse[gunQty].version,ARRAY_SIZE(ShmGBTData->evse[gunQty].version));
  985. }
  986. else if(connectorType2 == 3){
  987. // strcpy((char *)&connector2FwVer,ShmCHAdeMOData->evse[gunQty].version);
  988. // memcpy(connector2FwVer,ShmCHAdeMOData->evse[gunQty].version,ARRAY_SIZE(ShmCHAdeMOData->evse[gunQty].version));
  989. }
  990. }
  991. substr((char *)RatedPower1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,4,1);
  992. substr((char *)RatedPower2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,5,1);
  993. substr((char *)RatedPower3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,6,1);
  994. int p1=atoi(RatedPower1);
  995. int p2=atoi(RatedPower2);
  996. int p3=atoi(RatedPower3);
  997. if(strcmp(IsAcDc, "D") == 0){
  998. RatedPower=(p1*10+p2)*pow(10,p3-1);
  999. if(RatedPower>=30){
  1000. PsuQuantity = RatedPower/30;
  1001. }
  1002. }
  1003. struct json_object *jobj1;
  1004. struct json_object *jobj2;
  1005. struct json_object *jobj3;
  1006. struct json_object *jobj4;
  1007. //system
  1008. struct json_object *ModelName;
  1009. struct json_object *AcModelName;
  1010. struct json_object *SerialNumber;
  1011. struct json_object *SystemId;
  1012. struct json_object *AcPhaseCount;
  1013. struct json_object *PhaseLossPolicy;
  1014. struct json_object *FactoryConfiguration;
  1015. struct json_object *AuthorisationMode;
  1016. struct json_object *DefaultLanguage;
  1017. struct json_object *InputVoltageR;
  1018. struct json_object *InputVoltageS;
  1019. struct json_object *InputVoltageT;
  1020. struct json_object *SystemFanRotaSpeed;
  1021. struct json_object *PsuFanRotaSpeed;
  1022. struct json_object *RfidCardNumEndian;
  1023. struct json_object *PsuAcInputType;
  1024. struct json_object *RatingCurrent;
  1025. struct json_object *AcRatingCurrent;
  1026. struct json_object *isAPP;
  1027. struct json_object *isQRCode;
  1028. struct json_object *isRFID;
  1029. struct json_object *QRCodeMadeMode;
  1030. struct json_object *QRCodeContent;
  1031. struct json_object *Intensity;
  1032. struct json_object *AuxPower5V;
  1033. struct json_object *AuxPower12V;
  1034. struct json_object *AuxPower24V;
  1035. struct json_object *AuxPower48V;
  1036. struct json_object *CsuHwRev;
  1037. struct json_object *CsuBootLoadFwRev;
  1038. struct json_object *CsuKernelFwRev;
  1039. struct json_object *CsuRootFsFwRev;
  1040. struct json_object *CsuPrimFwRev;
  1041. struct json_object *LcmHwRev;
  1042. struct json_object *LcmFwRev;
  1043. struct json_object *PsuHwRev;
  1044. struct json_object *PsuPrimFwRev;
  1045. struct json_object *PsuSecFwRev;
  1046. struct json_object *AuxPwrHwRev;
  1047. struct json_object *AuxPwrFwRev;
  1048. struct json_object *FanModuleHwRev;
  1049. struct json_object *FanModuleFwRev;
  1050. struct json_object *RelayModuleHwRev;
  1051. struct json_object *RelayModuleFwRev;
  1052. struct json_object *TelcomModemFwRev;
  1053. struct json_object *Connector1FwRev;
  1054. struct json_object *Connector2FwRev;
  1055. struct json_object *LedModuleFwRev;
  1056. struct json_object *SystemAmbientTemp;
  1057. struct json_object *SystemCriticalTemp;
  1058. struct json_object *CcsConnectorTemp;
  1059. struct json_object *PsuAmbientTemp;
  1060. struct json_object *AcPlugInTimes;
  1061. struct json_object *GbPlugInTimes;
  1062. struct json_object *Ccs1PlugInTime;
  1063. struct json_object *Ccs2PlugInTimes;
  1064. struct json_object *ChademoPlugInTimes;
  1065. struct json_object *FirmwareUpdate;
  1066. struct json_object *FwPrimaryVersion[PsuQuantity];
  1067. struct json_object *FwPrimaryVersionArr= json_object_new_array();
  1068. struct json_object *FwSecondVersion[PsuQuantity];
  1069. struct json_object *FwSecondVersionArr= json_object_new_array();
  1070. //charging
  1071. struct json_object *MaxChargingEnergy;
  1072. struct json_object *MaxChargingPower;
  1073. struct json_object *MaxChargingCurrent;
  1074. struct json_object *AcMaxChargingCurrent;
  1075. struct json_object *MaxChargingDuration;
  1076. struct json_object *LocalWhiteCard[10];
  1077. struct json_object *LocalWhiteCardArr= json_object_new_array();
  1078. struct json_object *isBilling;
  1079. struct json_object *Currency;
  1080. struct json_object *Fee[24];
  1081. struct json_object *FeeArr= json_object_new_array();
  1082. struct json_object *ChargingInfo1;
  1083. struct json_object *ChargingInfo2;
  1084. struct json_object *ChargingInfo3;
  1085. struct json_object *StartUserId[3];
  1086. struct json_object *StartDateTime[3];
  1087. struct json_object *StopDateTime[3];
  1088. struct json_object *StartMethod[3];
  1089. struct json_object *ConnectorTemp[3];
  1090. struct json_object *PresentChargingVoltage[3];
  1091. struct json_object *PresentChargingCurrent[3];
  1092. struct json_object *PresentChargingPower[3];
  1093. struct json_object *PresentChargedEnergy[3];
  1094. struct json_object *PresentChargedDuration[3];
  1095. struct json_object *RemainChargingDuration[3];
  1096. struct json_object *EvBatteryMaxVoltage[3];
  1097. struct json_object *EvBatterytargetVoltage[3];
  1098. struct json_object *EvBatterySoc[3];
  1099. struct json_object *SystemStatus[3];
  1100. struct json_object *Index[3];
  1101. struct json_object *Type[3];
  1102. struct json_object *type_index[3];
  1103. struct json_object *EvBatterytargetCurrent[3];
  1104. //network
  1105. struct json_object *InternetConn;
  1106. struct json_object *FtpServer;
  1107. struct json_object *Eth0DhcpClient;
  1108. struct json_object *Eth0MacAddress;
  1109. struct json_object *Eth0IpAddress;
  1110. struct json_object *Eth0SubmaskAddress;
  1111. struct json_object *Eth0GatewayAddress;
  1112. struct json_object *Eth1DhcpClient;
  1113. struct json_object *Eth1MacAddress;
  1114. struct json_object *Eth1IpAddress;
  1115. struct json_object *Eth1SubmaskAddress;
  1116. struct json_object *Eth1GatewayAddress;
  1117. struct json_object *WifiMode;
  1118. struct json_object *WifiSsid;
  1119. struct json_object *WifiPassword;
  1120. struct json_object *WifiRssi;
  1121. struct json_object *WifiDhcpServer;
  1122. struct json_object *WifiDhcpClient;
  1123. struct json_object *WifiMacAddress;
  1124. struct json_object *WifiIpAddress;
  1125. struct json_object *WifiSubmaskAddress;
  1126. struct json_object *WifiGatewayAddress;
  1127. struct json_object *WifiNetworkConn;
  1128. struct json_object *TelcomApn;
  1129. struct json_object *TelcomRssi;
  1130. struct json_object *TelcomChapPapId;
  1131. struct json_object *TelcomChapPapPwd;
  1132. struct json_object *TelcomModemImei;
  1133. struct json_object *TelcomSimImsi;
  1134. struct json_object *TelcomSimIccid;
  1135. struct json_object *TelcomSimStatus;
  1136. struct json_object *TelcomModemMode;
  1137. struct json_object *TelcomIpAddress;
  1138. struct json_object *TelcomNetworkConn;
  1139. struct json_object *TelcomEnabled;
  1140. //backend
  1141. struct json_object *BackendConnTimeout;
  1142. struct json_object *OfflinePolicy;
  1143. struct json_object *OfflineMaxChargeEnergy;
  1144. struct json_object *OfflineMaxChargeDuration;
  1145. struct json_object *OcppConnStatus;
  1146. struct json_object *OcppServerURL;
  1147. struct json_object *ChargeBoxId;
  1148. struct json_object *chargePointVendor;
  1149. jobj1=json_object_new_object();
  1150. jobj2=json_object_new_object();
  1151. jobj3=json_object_new_object();
  1152. jobj4=json_object_new_object();
  1153. //system
  1154. ModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ModelName);
  1155. AcModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AcModelName);
  1156. SerialNumber = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber);
  1157. SystemId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SystemId);
  1158. AcPhaseCount = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPhaseCount);
  1159. PhaseLossPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy);
  1160. FactoryConfiguration = json_object_new_int(ShmSysConfigAndInfo->SysInfo.FactoryConfiguration);
  1161. AuthorisationMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
  1162. DefaultLanguage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.DefaultLanguage);
  1163. InputVoltageR = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageR);
  1164. InputVoltageS = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageS);
  1165. InputVoltageT = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageT);
  1166. SystemFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed);
  1167. PsuFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed);
  1168. RfidCardNumEndian = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
  1169. PsuAcInputType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PsuAcInputType);
  1170. RatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RatingCurrent);
  1171. AcRatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcRatingCurrent);
  1172. isAPP = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAPP);
  1173. isQRCode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isQRCode);
  1174. isRFID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isRFID);
  1175. QRCodeMadeMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
  1176. QRCodeContent = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent);
  1177. Intensity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity);
  1178. AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
  1179. AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
  1180. AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
  1181. AuxPower48V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower48V);
  1182. CsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
  1183. CsuBootLoadFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
  1184. CsuKernelFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
  1185. CsuRootFsFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
  1186. CsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
  1187. LcmHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
  1188. LcmFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
  1189. PsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
  1190. PsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
  1191. PsuSecFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
  1192. AuxPwrHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
  1193. AuxPwrFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
  1194. FanModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
  1195. FanModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
  1196. RelayModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
  1197. RelayModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
  1198. TelcomModemFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
  1199. Connector1FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector1FwRev);
  1200. Connector2FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector2FwRev);
  1201. LedModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LedModuleFwRev);
  1202. SystemAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
  1203. SystemCriticalTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
  1204. CcsConnectorTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
  1205. PsuAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp);
  1206. AcPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPlugInTimes);
  1207. GbPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.GbPlugInTimes);
  1208. Ccs1PlugInTime = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime);
  1209. Ccs2PlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes);
  1210. ChademoPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes);
  1211. FirmwareUpdate = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
  1212. if(strcmp(IsAcDc, "D") == 0){
  1213. for(int i=0;i<PsuQuantity;i++){
  1214. FwPrimaryVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwPrimaryVersion);
  1215. FwSecondVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwSecondVersion);
  1216. json_object_array_add(FwPrimaryVersionArr,FwPrimaryVersion[i]);
  1217. json_object_array_add(FwSecondVersionArr,FwSecondVersion[i]);
  1218. }
  1219. }
  1220. //charging
  1221. int CcsGunQty=0;
  1222. int GbGunQty=0;
  1223. int CHAdeMOGunQty=0;
  1224. int AcGunQty=0;
  1225. ChargingInfo1=json_object_new_object();
  1226. ChargingInfo2=json_object_new_object();
  1227. ChargingInfo3=json_object_new_object();
  1228. MaxChargingEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
  1229. MaxChargingPower = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
  1230. MaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
  1231. AcMaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent);
  1232. MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
  1233. LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
  1234. LocalWhiteCard[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
  1235. LocalWhiteCard[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
  1236. LocalWhiteCard[3] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
  1237. LocalWhiteCard[4] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
  1238. LocalWhiteCard[5] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
  1239. LocalWhiteCard[6] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
  1240. LocalWhiteCard[7] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
  1241. LocalWhiteCard[8] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
  1242. LocalWhiteCard[9] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
  1243. isBilling = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling);
  1244. Currency = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.Currency);
  1245. Fee[0] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0]);
  1246. Fee[1] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1]);
  1247. Fee[2] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2]);
  1248. Fee[3] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3]);
  1249. Fee[4] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4]);
  1250. Fee[5] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5]);
  1251. Fee[6] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6]);
  1252. Fee[7] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7]);
  1253. Fee[8] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8]);
  1254. Fee[9] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9]);
  1255. Fee[10] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10]);
  1256. Fee[11] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11]);
  1257. Fee[12] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12]);
  1258. Fee[13] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13]);
  1259. Fee[14] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14]);
  1260. Fee[15] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15]);
  1261. Fee[16] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16]);
  1262. Fee[17] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17]);
  1263. Fee[18] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18]);
  1264. Fee[19] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19]);
  1265. Fee[20] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20]);
  1266. Fee[21] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21]);
  1267. Fee[22] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22]);
  1268. Fee[23] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23]);
  1269. if(connectorType1 != 0){
  1270. if(connectorType1 == 1){//CCS
  1271. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1272. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1273. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1274. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1275. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1276. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1277. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1278. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1279. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1280. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1281. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1282. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1283. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1284. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1285. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1286. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1287. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1288. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1289. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1290. CcsGunQty++;
  1291. }
  1292. else if(connectorType1 == 2){//GB
  1293. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1294. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1295. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1296. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1297. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1298. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1299. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1300. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1301. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1302. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1303. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1304. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1305. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1306. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1307. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1308. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1309. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1310. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1311. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1312. GbGunQty++;
  1313. }
  1314. else if(connectorType1 == 3){//CHAdeMO
  1315. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1316. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1317. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1318. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1319. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1320. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1321. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1322. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1323. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1324. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1325. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1326. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1327. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1328. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1329. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1330. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1331. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1332. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1333. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1334. CHAdeMOGunQty++;
  1335. }
  1336. else if(connectorType1 == 4){//AC
  1337. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1338. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1339. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1340. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1341. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1342. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1343. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1344. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1345. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1346. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1347. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1348. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1349. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1350. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1351. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1352. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1353. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1354. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1355. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1356. AcGunQty++;
  1357. }
  1358. }
  1359. if(connectorType2 != 0){
  1360. if(connectorType2 == 1){//CCS
  1361. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1362. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1363. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1364. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1365. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1366. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1367. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1368. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1369. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1370. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1371. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1372. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1373. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1374. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1375. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1376. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1377. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1378. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1379. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1380. CcsGunQty++;
  1381. }
  1382. else if(connectorType2 == 2){//GB
  1383. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1384. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1385. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1386. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1387. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1388. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1389. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1390. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1391. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1392. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1393. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1394. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1395. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1396. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1397. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1398. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1399. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1400. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1401. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1402. GbGunQty++;
  1403. }
  1404. else if(connectorType2 == 3){//CHAdeMO
  1405. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1406. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1407. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1408. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1409. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1410. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1411. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1412. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1413. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1414. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1415. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1416. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1417. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1418. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1419. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1420. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1421. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1422. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1423. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1424. CHAdeMOGunQty++;
  1425. }
  1426. else if(connectorType2 == 4){//AC
  1427. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1428. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1429. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1430. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1431. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1432. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1433. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1434. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1435. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1436. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1437. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1438. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1439. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1440. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1441. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1442. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1443. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1444. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1445. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1446. AcGunQty++;
  1447. }
  1448. }
  1449. if(connectorType3 != 0){
  1450. if(connectorType3 == 1){//CCS
  1451. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1452. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1453. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1454. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1455. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1456. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1457. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1458. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1459. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1460. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1461. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1462. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1463. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1464. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1465. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1466. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1467. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1468. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1469. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1470. CcsGunQty++;
  1471. }
  1472. else if(connectorType3 == 2){//GB
  1473. PresentChargingVoltage[2]= json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1474. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1475. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1476. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1477. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1478. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1479. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1480. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1481. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1482. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1483. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1484. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1485. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1486. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1487. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1488. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1489. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1490. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1491. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1492. GbGunQty++;
  1493. }
  1494. else if(connectorType3 == 3){//CHAdeMO
  1495. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1496. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1497. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1498. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1499. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1500. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1501. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1502. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1503. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1504. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1505. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1506. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1507. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1508. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1509. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1510. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1511. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1512. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1513. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1514. CHAdeMOGunQty++;
  1515. }
  1516. else if(connectorType3 == 4){//AC
  1517. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1518. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1519. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1520. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1521. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1522. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1523. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1524. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1525. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1526. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1527. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1528. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1529. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1530. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1531. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1532. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1533. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1534. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1535. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1536. AcGunQty++;
  1537. }
  1538. }
  1539. //network
  1540. InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
  1541. FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
  1542. Eth0DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient);
  1543. Eth0MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
  1544. Eth0IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
  1545. Eth0SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
  1546. Eth0GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
  1547. Eth1DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient);
  1548. Eth1MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
  1549. Eth1IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
  1550. Eth1SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
  1551. Eth1GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
  1552. WifiMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
  1553. WifiSsid = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
  1554. WifiPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
  1555. WifiRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
  1556. WifiDhcpServer = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer);
  1557. WifiDhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient);
  1558. WifiMacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
  1559. WifiIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
  1560. WifiSubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
  1561. WifiGatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
  1562. WifiNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn);
  1563. TelcomApn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
  1564. TelcomRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
  1565. TelcomChapPapId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
  1566. TelcomChapPapPwd = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
  1567. TelcomModemImei = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
  1568. TelcomSimImsi = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
  1569. TelcomSimIccid = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid);
  1570. TelcomSimStatus = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus);
  1571. TelcomModemMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode);
  1572. TelcomIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
  1573. TelcomNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn);
  1574. TelcomEnabled = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled);
  1575. //backend
  1576. BackendConnTimeout = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
  1577. OfflinePolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
  1578. OfflineMaxChargeEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
  1579. OfflineMaxChargeDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
  1580. OcppConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.OcppConnStatus);
  1581. OcppServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL);
  1582. ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
  1583. chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
  1584. //system
  1585. json_object_object_add(jobj1,"ModelName",ModelName);
  1586. json_object_object_add(jobj1,"AcModelName",AcModelName);
  1587. json_object_object_add(jobj1,"SerialNumber",SerialNumber);
  1588. json_object_object_add(jobj1,"SystemId",SystemId);
  1589. json_object_object_add(jobj1,"AcPhaseCount",AcPhaseCount);
  1590. json_object_object_add(jobj1,"PhaseLossPolicy",PhaseLossPolicy);
  1591. json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
  1592. json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
  1593. json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
  1594. json_object_object_add(jobj1,"InputVoltageR",InputVoltageR);
  1595. json_object_object_add(jobj1,"InputVoltageS",InputVoltageS);
  1596. json_object_object_add(jobj1,"InputVoltageT",InputVoltageT);
  1597. json_object_object_add(jobj1,"SystemFanRotaSpeed",SystemFanRotaSpeed);
  1598. json_object_object_add(jobj1,"PsuFanRotaSpeed",PsuFanRotaSpeed);
  1599. json_object_object_add(jobj1,"RfidCardNumEndian",RfidCardNumEndian);
  1600. json_object_object_add(jobj1,"PsuAcInputType",PsuAcInputType);
  1601. json_object_object_add(jobj1,"RatingCurrent",RatingCurrent);
  1602. json_object_object_add(jobj1,"AcRatingCurrent",AcRatingCurrent);
  1603. json_object_object_add(jobj1,"isAPP",isAPP);
  1604. json_object_object_add(jobj1,"isQRCode",isQRCode);
  1605. json_object_object_add(jobj1,"isRFID",isRFID);
  1606. json_object_object_add(jobj1,"QRCodeMadeMode",QRCodeMadeMode);
  1607. json_object_object_add(jobj1,"QRCodeContent",QRCodeContent);
  1608. json_object_object_add(jobj1,"Intensity",Intensity);
  1609. json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
  1610. json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
  1611. json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
  1612. json_object_object_add(jobj1,"AuxPower48V",AuxPower48V);
  1613. json_object_object_add(jobj1,"CsuHwRev",CsuHwRev);
  1614. json_object_object_add(jobj1,"CsuBootLoadFwRev",CsuBootLoadFwRev);
  1615. json_object_object_add(jobj1,"CsuKernelFwRev",CsuKernelFwRev);
  1616. json_object_object_add(jobj1,"CsuRootFsFwRev",CsuRootFsFwRev);
  1617. json_object_object_add(jobj1,"CsuPrimFwRev",CsuPrimFwRev);
  1618. json_object_object_add(jobj1,"LcmHwRev",LcmHwRev);
  1619. json_object_object_add(jobj1,"LcmFwRev",LcmFwRev);
  1620. json_object_object_add(jobj1,"PsuHwRev",PsuHwRev);
  1621. json_object_object_add(jobj1,"PsuPrimFwRev",PsuPrimFwRev);
  1622. json_object_object_add(jobj1,"PsuSecFwRev",PsuSecFwRev);
  1623. json_object_object_add(jobj1,"AuxPwrHwRev",AuxPwrHwRev);
  1624. json_object_object_add(jobj1,"AuxPwrFwRev",AuxPwrFwRev);
  1625. json_object_object_add(jobj1,"FanModuleHwRev",FanModuleHwRev);
  1626. json_object_object_add(jobj1,"FanModuleFwRev",FanModuleFwRev);
  1627. json_object_object_add(jobj1,"RelayModuleHwRev",RelayModuleHwRev);
  1628. json_object_object_add(jobj1,"RelayModuleFwRev",RelayModuleFwRev);
  1629. json_object_object_add(jobj1,"TelcomModemFwRev",TelcomModemFwRev);
  1630. json_object_object_add(jobj1,"Connector1FwRev",Connector1FwRev);
  1631. json_object_object_add(jobj1,"Connector2FwRev",Connector2FwRev);
  1632. json_object_object_add(jobj1,"LedModuleFwRev",LedModuleFwRev);
  1633. json_object_object_add(jobj1,"SystemAmbientTemp",SystemAmbientTemp);
  1634. json_object_object_add(jobj1,"SystemCriticalTemp",SystemCriticalTemp);
  1635. json_object_object_add(jobj1,"CcsConnectorTemp",CcsConnectorTemp);
  1636. json_object_object_add(jobj1,"PsuAmbientTemp",PsuAmbientTemp);
  1637. json_object_object_add(jobj1,"AcPlugInTimes",AcPlugInTimes);
  1638. json_object_object_add(jobj1,"GbPlugInTimes",GbPlugInTimes);
  1639. json_object_object_add(jobj1,"Ccs1PlugInTimes",Ccs1PlugInTime);
  1640. json_object_object_add(jobj1,"Ccs2PlugInTimes",Ccs2PlugInTimes);
  1641. json_object_object_add(jobj1,"ChademoPlugInTimes",ChademoPlugInTimes);
  1642. json_object_object_add(jobj1,"FirmwareUpdate",FirmwareUpdate);
  1643. if(strcmp(IsAcDc, "D") == 0){
  1644. json_object_object_add(jobj1,"FwPrimaryVersion",FwPrimaryVersionArr);
  1645. json_object_object_add(jobj1,"FwSecondVersion",FwSecondVersionArr);
  1646. }
  1647. printf("%s\n", json_object_to_json_string(jobj1));
  1648. json_object_put(jobj1);
  1649. //charging
  1650. json_object_object_add(jobj2,"MaxChargingEnergy",MaxChargingEnergy);
  1651. json_object_object_add(jobj2,"MaxChargingPower",MaxChargingPower);
  1652. json_object_object_add(jobj2,"MaxChargingCurrent",MaxChargingCurrent);
  1653. json_object_object_add(jobj2,"AcMaxChargingCurrent",AcMaxChargingCurrent);
  1654. json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
  1655. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
  1656. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
  1657. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);
  1658. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[3]);
  1659. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[4]);
  1660. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[5]);
  1661. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[6]);
  1662. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[7]);
  1663. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[8]);
  1664. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[9]);
  1665. json_object_object_add(jobj2,"LocalWhiteCard",LocalWhiteCardArr);
  1666. json_object_object_add(jobj2,"isBilling",isBilling);
  1667. json_object_object_add(jobj2,"Currency",Currency);
  1668. json_object_array_add(FeeArr,Fee[0]);
  1669. json_object_array_add(FeeArr,Fee[1]);
  1670. json_object_array_add(FeeArr,Fee[2]);
  1671. json_object_array_add(FeeArr,Fee[3]);
  1672. json_object_array_add(FeeArr,Fee[4]);
  1673. json_object_array_add(FeeArr,Fee[5]);
  1674. json_object_array_add(FeeArr,Fee[6]);
  1675. json_object_array_add(FeeArr,Fee[7]);
  1676. json_object_array_add(FeeArr,Fee[8]);
  1677. json_object_array_add(FeeArr,Fee[9]);
  1678. json_object_array_add(FeeArr,Fee[10]);
  1679. json_object_array_add(FeeArr,Fee[11]);
  1680. json_object_array_add(FeeArr,Fee[12]);
  1681. json_object_array_add(FeeArr,Fee[13]);
  1682. json_object_array_add(FeeArr,Fee[14]);
  1683. json_object_array_add(FeeArr,Fee[15]);
  1684. json_object_array_add(FeeArr,Fee[16]);
  1685. json_object_array_add(FeeArr,Fee[17]);
  1686. json_object_array_add(FeeArr,Fee[18]);
  1687. json_object_array_add(FeeArr,Fee[19]);
  1688. json_object_array_add(FeeArr,Fee[20]);
  1689. json_object_array_add(FeeArr,Fee[21]);
  1690. json_object_array_add(FeeArr,Fee[22]);
  1691. json_object_array_add(FeeArr,Fee[23]);
  1692. json_object_object_add(jobj2,"Fee",FeeArr);
  1693. if(connectorType1 != 0){
  1694. json_object_object_add(ChargingInfo1,"StartUserId",StartUserId[0]);
  1695. json_object_object_add(ChargingInfo1,"StartDateTime",StartDateTime[0]);
  1696. json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
  1697. json_object_object_add(ChargingInfo1,"StartMethod",StartMethod[0]);
  1698. json_object_object_add(ChargingInfo1,"ConnectorTemp",ConnectorTemp[0]);
  1699. json_object_object_add(ChargingInfo1,"PresentChargingVoltage",PresentChargingVoltage[0]);
  1700. json_object_object_add(ChargingInfo1,"PresentChargingCurrent",PresentChargingCurrent[0]);
  1701. json_object_object_add(ChargingInfo1,"PresentChargingPower",PresentChargingPower[0]);
  1702. json_object_object_add(ChargingInfo1,"PresentChargedEnergy",PresentChargedEnergy[0]);
  1703. json_object_object_add(ChargingInfo1,"PresentChargedDuration",PresentChargedDuration[0]);
  1704. json_object_object_add(ChargingInfo1,"RemainChargingDuration",RemainChargingDuration[0]);
  1705. json_object_object_add(ChargingInfo1,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[0]);
  1706. json_object_object_add(ChargingInfo1,"EvBatterytargetVoltage",EvBatterytargetVoltage[0]);
  1707. json_object_object_add(ChargingInfo1,"EvBatterySoc",EvBatterySoc[0]);
  1708. json_object_object_add(ChargingInfo1,"SystemStatus",SystemStatus[0]);
  1709. json_object_object_add(ChargingInfo1,"Index",Index[0]);
  1710. json_object_object_add(ChargingInfo1,"Type",Type[0]);
  1711. json_object_object_add(ChargingInfo1,"type_index",type_index[0]);
  1712. json_object_object_add(ChargingInfo1,"EvBatterytargetCurrent",EvBatterytargetCurrent[0]);
  1713. json_object_object_add(jobj2,"ChargingInfo1",ChargingInfo1);
  1714. }
  1715. if(connectorType2 != 0){
  1716. json_object_object_add(ChargingInfo2,"StartUserId",StartUserId[1]);
  1717. json_object_object_add(ChargingInfo2,"StartDateTime",StartDateTime[1]);
  1718. json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
  1719. json_object_object_add(ChargingInfo2,"StartMethod",StartMethod[1]);
  1720. json_object_object_add(ChargingInfo2,"ConnectorTemp",ConnectorTemp[1]);
  1721. json_object_object_add(ChargingInfo2,"PresentChargingVoltage",PresentChargingVoltage[1]);
  1722. json_object_object_add(ChargingInfo2,"PresentChargingCurrent",PresentChargingCurrent[1]);
  1723. json_object_object_add(ChargingInfo2,"PresentChargingPower",PresentChargingPower[1]);
  1724. json_object_object_add(ChargingInfo2,"PresentChargedEnergy",PresentChargedEnergy[1]);
  1725. json_object_object_add(ChargingInfo2,"PresentChargedDuration",PresentChargedDuration[1]);
  1726. json_object_object_add(ChargingInfo2,"RemainChargingDuration",RemainChargingDuration[1]);
  1727. json_object_object_add(ChargingInfo2,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[1]);
  1728. json_object_object_add(ChargingInfo2,"EvBatterytargetVoltage",EvBatterytargetVoltage[1]);
  1729. json_object_object_add(ChargingInfo2,"EvBatterySoc",EvBatterySoc[1]);
  1730. json_object_object_add(ChargingInfo2,"SystemStatus",SystemStatus[1]);
  1731. json_object_object_add(ChargingInfo2,"Index",Index[1]);
  1732. json_object_object_add(ChargingInfo2,"Type",Type[1]);
  1733. json_object_object_add(ChargingInfo2,"type_index",type_index[1]);
  1734. json_object_object_add(ChargingInfo2,"EvBatterytargetCurrent",EvBatterytargetCurrent[1]);
  1735. json_object_object_add(jobj2,"ChargingInfo2",ChargingInfo2);
  1736. }
  1737. if(connectorType3 != 0){
  1738. json_object_object_add(ChargingInfo3,"StartUserId",StartUserId[2]);
  1739. json_object_object_add(ChargingInfo3,"StartDateTime",StartDateTime[2]);
  1740. json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);
  1741. json_object_object_add(ChargingInfo3,"StartMethod",StartMethod[2]);
  1742. json_object_object_add(ChargingInfo3,"ConnectorTemp",ConnectorTemp[2]);
  1743. json_object_object_add(ChargingInfo3,"PresentChargingVoltage",PresentChargingVoltage[2]);
  1744. json_object_object_add(ChargingInfo3,"PresentChargingCurrent",PresentChargingCurrent[2]);
  1745. json_object_object_add(ChargingInfo3,"PresentChargingPower",PresentChargingPower[2]);
  1746. json_object_object_add(ChargingInfo3,"PresentChargedEnergy",PresentChargedEnergy[2]);
  1747. json_object_object_add(ChargingInfo3,"PresentChargedDuration",PresentChargedDuration[2]);
  1748. json_object_object_add(ChargingInfo3,"RemainChargingDuration",RemainChargingDuration[2]);
  1749. json_object_object_add(ChargingInfo3,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[2]);
  1750. json_object_object_add(ChargingInfo3,"EvBatterytargetVoltage",EvBatterytargetVoltage[2]);
  1751. json_object_object_add(ChargingInfo3,"EvBatterySoc",EvBatterySoc[2]);
  1752. json_object_object_add(ChargingInfo3,"SystemStatus",SystemStatus[2]);
  1753. json_object_object_add(ChargingInfo3,"Index",Index[2]);
  1754. json_object_object_add(ChargingInfo3,"Type",Type[2]);
  1755. json_object_object_add(ChargingInfo3,"type_index",type_index[2]);
  1756. json_object_object_add(ChargingInfo3,"EvBatterytargetCurrent",EvBatterytargetCurrent[2]);
  1757. json_object_object_add(jobj2,"ChargingInfo3",ChargingInfo3);
  1758. }
  1759. printf("%s\n", json_object_to_json_string(jobj2));
  1760. json_object_put(jobj2);
  1761. //network
  1762. json_object_object_add(jobj3,"InternetConn",InternetConn);
  1763. json_object_object_add(jobj3,"FtpServer",FtpServer);
  1764. json_object_object_add(jobj3,"Eth0DhcpClient",Eth0DhcpClient);
  1765. json_object_object_add(jobj3,"Eth0MacAddress",Eth0MacAddress);
  1766. json_object_object_add(jobj3,"Eth0IpAddress",Eth0IpAddress);
  1767. json_object_object_add(jobj3,"Eth0SubmaskAddress",Eth0SubmaskAddress);
  1768. json_object_object_add(jobj3,"Eth0GatewayAddress",Eth0GatewayAddress);
  1769. json_object_object_add(jobj3,"Eth1DhcpClient",Eth1DhcpClient);
  1770. json_object_object_add(jobj3,"Eth1MacAddress",Eth1MacAddress);
  1771. json_object_object_add(jobj3,"Eth1IpAddress",Eth1IpAddress);
  1772. json_object_object_add(jobj3,"Eth1SubmaskAddress",Eth1SubmaskAddress);
  1773. json_object_object_add(jobj3,"Eth1GatewayAddress",Eth1GatewayAddress);
  1774. json_object_object_add(jobj3,"WifiMode",WifiMode);
  1775. json_object_object_add(jobj3,"WifiSsid",WifiSsid);
  1776. json_object_object_add(jobj3,"WifiPassword",WifiPassword);
  1777. json_object_object_add(jobj3,"WifiRssi",WifiRssi);
  1778. json_object_object_add(jobj3,"WifiDhcpServer",WifiDhcpServer);
  1779. json_object_object_add(jobj3,"WifiDhcpClient",WifiDhcpClient);
  1780. json_object_object_add(jobj3,"WifiMacAddress",WifiMacAddress);
  1781. json_object_object_add(jobj3,"WifiIpAddress",WifiIpAddress);
  1782. json_object_object_add(jobj3,"WifiSubmaskAddress",WifiSubmaskAddress);
  1783. json_object_object_add(jobj3,"WifiGatewayAddress",WifiGatewayAddress);
  1784. json_object_object_add(jobj3,"WifiNetworkConn",WifiNetworkConn);
  1785. json_object_object_add(jobj3,"TelcomApn",TelcomApn);
  1786. json_object_object_add(jobj3,"TelcomRssi",TelcomRssi);
  1787. json_object_object_add(jobj3,"TelcomChapPapId",TelcomChapPapId);
  1788. json_object_object_add(jobj3,"TelcomChapPapPwd",TelcomChapPapPwd);
  1789. json_object_object_add(jobj3,"TelcomModemImei",TelcomModemImei);
  1790. json_object_object_add(jobj3,"TelcomSimImsi",TelcomSimImsi);
  1791. json_object_object_add(jobj3,"TelcomSimIccid",TelcomSimIccid);
  1792. json_object_object_add(jobj3,"TelcomSimStatus",TelcomSimStatus);
  1793. json_object_object_add(jobj3,"TelcomModemMode",TelcomModemMode);
  1794. json_object_object_add(jobj3,"TelcomIpAddress",TelcomIpAddress);
  1795. json_object_object_add(jobj3,"TelcomNetworkConn",TelcomNetworkConn);
  1796. json_object_object_add(jobj3,"TelcomEnabled",TelcomEnabled);
  1797. printf("%s\n", json_object_to_json_string(jobj3));
  1798. json_object_put(jobj3);
  1799. //backend
  1800. json_object_object_add(jobj4,"BackendConnTimeout",BackendConnTimeout);
  1801. json_object_object_add(jobj4,"OfflinePolicy",OfflinePolicy);
  1802. json_object_object_add(jobj4,"OfflineMaxChargeEnergy",OfflineMaxChargeEnergy);
  1803. json_object_object_add(jobj4,"OfflineMaxChargeDuration",OfflineMaxChargeDuration);
  1804. json_object_object_add(jobj4,"OcppConnStatus",OcppConnStatus);
  1805. json_object_object_add(jobj4,"OcppServerURL",OcppServerURL);
  1806. json_object_object_add(jobj4,"ChargeBoxId",ChargeBoxId);
  1807. json_object_object_add(jobj4,"chargePointVendor",chargePointVendor);
  1808. printf("%s\n", json_object_to_json_string(jobj4));
  1809. json_object_put(jobj4);
  1810. }
  1811. // for(;;)
  1812. // {
  1813. // }
  1814. return FAIL;
  1815. }