WebService.c 101 KB

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