WebService.c 100 KB

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