WebService.c 101 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863
  1. #include <sys/time.h>
  2. #include <sys/timeb.h>
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5. #include <sys/types.h>
  6. #include <sys/ioctl.h>
  7. #include <sys/socket.h>
  8. #include <sys/ipc.h>
  9. #include <sys/shm.h>
  10. #include <sys/shm.h>
  11. #include <sys/mman.h>
  12. #include <linux/wireless.h>
  13. #include <arpa/inet.h>
  14. #include <netinet/in.h>
  15. #include <unistd.h>
  16. #include <stdarg.h>
  17. #include <stdio.h> /*標準輸入輸出定義*/
  18. #include <stdlib.h> /*標準函數庫定義*/
  19. #include <unistd.h> /*Unix 標準函數定義*/
  20. #include <fcntl.h> /*檔控制定義*/
  21. #include <termios.h> /*PPSIX 終端控制定義*/
  22. #include <errno.h> /*錯誤號定義*/
  23. #include <errno.h>
  24. #include <string.h>
  25. #include <time.h>
  26. #include <ctype.h>
  27. #include <ifaddrs.h>
  28. #include <math.h>
  29. #include "define.h"
  30. #include "json.h"
  31. #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  32. #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  33. #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  34. #define Debug
  35. #define SystemLogMessage
  36. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  37. #define PASS 1
  38. #define FAIL -1
  39. #define MtdBlockSize 0x600000
  40. struct SysConfigAndInfo *ShmSysConfigAndInfo;
  41. struct StatusCodeData *ShmStatusCodeData;
  42. struct CHAdeMOData *ShmCHAdeMOData;
  43. struct GBTData *ShmGBTData;
  44. struct CcsData *ShmCcsData;
  45. struct PsuData *ShmPsuData;
  46. void trim(char *s);
  47. int mystrcmp(char *p1, char *p2);
  48. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
  49. void split(char **arr, char *str, const char *del);
  50. #ifdef SystemLogMessage
  51. int StoreLogMsg(const char *fmt, ...) {
  52. char Buf[4096 + 256];
  53. char buffer[4096];
  54. time_t CurrentTime;
  55. struct tm *tm;
  56. va_list args;
  57. va_start(args, fmt);
  58. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  59. va_end(args);
  60. memset(Buf, 0, sizeof(Buf));
  61. CurrentTime = time(NULL);
  62. tm = localtime(&CurrentTime);
  63. sprintf(Buf,
  64. "echo \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
  65. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  66. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  67. system(Buf);
  68. #ifdef Debug
  69. printf("[%04d.%02d.%02d %02d:%02d:%02d] - %s", tm->tm_year + 1900,
  70. tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
  71. buffer);
  72. #endif
  73. return rc;
  74. }
  75. int WriteLogMsg(const char *fmt, ...) {
  76. char Buf[4096 + 256];
  77. char buffer[4096];
  78. time_t CurrentTime;
  79. struct tm *tm;
  80. va_list args;
  81. va_start(args, fmt);
  82. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  83. va_end(args);
  84. memset(Buf, 0, sizeof(Buf));
  85. CurrentTime = time(NULL);
  86. tm = localtime(&CurrentTime);
  87. sprintf(Buf,
  88. "echo \"[%04d.%02d.%02d %02d:%02d:%02d WebService] - %s\" >> /Storage/SystemLog/[%04d.%02d]WebService_SystemLog",
  89. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  90. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  91. system(Buf);
  92. return rc;
  93. }
  94. #endif
  95. int DiffTimeb(struct timeb ST, struct timeb ET) {
  96. //return milli-second
  97. unsigned int StartTime, StopTime;
  98. StartTime = (unsigned int) ST.time;
  99. StopTime = (unsigned int) ET.time;
  100. return (StopTime - StartTime) * 1000 + ET.millitm - ST.millitm;
  101. }
  102. //=================================
  103. // Common routine
  104. //=================================
  105. void trim(char *s) {
  106. int i = 0, j, k, l = 0;
  107. while ((s[i] == ' ') || (s[i] == '\t') || (s[i] == '\n'))
  108. i++;
  109. j = strlen(s) - 1;
  110. while ((s[j] == ' ') || (s[j] == '\t') || (s[j] == '\n'))
  111. j--;
  112. if (i == 0 && j == strlen(s) - 1) {
  113. } else if (i == 0)
  114. s[j + 1] = '\0';
  115. else {
  116. for (k = i; k <= j; k++)
  117. s[l++] = s[k];
  118. s[l] = '\0';
  119. }
  120. }
  121. int mystrcmp(char *p1, char *p2) {
  122. while (*p1 == *p2) {
  123. if (*p1 == '\0' || *p2 == '\0')
  124. break;
  125. p1++;
  126. p2++;
  127. }
  128. if (*p1 == '\0' && *p2 == '\0')
  129. return (PASS);
  130. else
  131. return (FAIL);
  132. }
  133. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt) {
  134. strncpy(dest, src + start, cnt);
  135. dest[cnt] = 0;
  136. }
  137. void split(char **arr, char *str, const char *del) {
  138. char *s = strtok(str, del);
  139. while (s != NULL) {
  140. *arr++ = s;
  141. s = strtok(NULL, del);
  142. }
  143. }
  144. int ConnectorType(char* connector){
  145. int result;
  146. if(strcmp(connector, "0") == 0){
  147. result= 0;
  148. }
  149. else if(strcmp(connector, "U") == 0 || strcmp(connector, "E") == 0){
  150. result= 1;//CCS
  151. }
  152. else if(strcmp(connector, "G") == 0 || strcmp(connector, "D") == 0){
  153. result= 2;//GB
  154. }
  155. else if(strcmp(connector, "J") == 0){
  156. result= 3;//CHAdeMO
  157. }
  158. else if(strcmp(connector, "1") == 0 || strcmp(connector, "2") == 0 || strcmp(connector, "3") == 0 || strcmp(connector, "4") == 0 || strcmp(connector, "5") == 0 || strcmp(connector, "6") == 0){
  159. result= 4;//AC
  160. }
  161. else{
  162. result= 0;
  163. }
  164. return result;
  165. }
  166. int ModelType(char* type,char* network){
  167. int result=0;
  168. if(strcmp(type, "A") == 0){
  169. if(strcmp(network, "0") == 0 || strcmp(network, "R") == 0 || strcmp(network, "B") == 0){
  170. result=0;
  171. }
  172. else if(strcmp(network, "E") == 0 || strcmp(network, "W") == 0 || strcmp(network, "T") == 0 || strcmp(network, "U") == 0){
  173. result=1;
  174. }
  175. }
  176. else if(strcmp(type, "D") == 0){
  177. result=2;
  178. }
  179. return result;
  180. }
  181. // 四捨五入 取到 小數點第 2 位
  182. float rounding(float a)
  183. {
  184. return (int)(a*100+0.5)/100.0;
  185. }
  186. //==========================================
  187. // Init all share memory
  188. //==========================================
  189. int InitShareMemory() {
  190. int result = PASS;
  191. int MeterSMId;
  192. //creat ShmSysConfigAndInfo
  193. if ((MeterSMId = shmget(ShmSysConfigAndInfoKey,
  194. sizeof(struct SysConfigAndInfo), 0777)) < 0) {
  195. printf("%s\n","InitShareMemory Error");
  196. #ifdef SystemLogMessage
  197. DEBUG_ERROR("shmget ShmSysConfigAndInfo NG\n");
  198. #endif
  199. result = FAIL;
  200. } else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0))
  201. == (void *) -1) {
  202. #ifdef SystemLogMessage
  203. DEBUG_ERROR("shmat ShmSysConfigAndInfo NG\n");
  204. #endif
  205. result = FAIL;
  206. } else {
  207. }
  208. //creat ShmStatusCodeData
  209. if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),
  210. 0777)) < 0) {
  211. #ifdef SystemLogMessage
  212. DEBUG_ERROR("shmget ShmStatusCodeData NG\n");
  213. #endif
  214. result = FAIL;
  215. } else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  216. #ifdef SystemLogMessage
  217. DEBUG_ERROR("shmat ShmStatusCodeData NG\n");
  218. #endif
  219. result = FAIL;
  220. } else {
  221. }
  222. //creat ShmPsuData
  223. if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData),
  224. 0777)) < 0) {
  225. #ifdef SystemLogMessage
  226. DEBUG_ERROR("shmget ShmPsuData NG\n");
  227. #endif
  228. result = FAIL;
  229. } else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  230. #ifdef SystemLogMessage
  231. DEBUG_ERROR("shmat ShmPsuData NG\n");
  232. #endif
  233. result = FAIL;
  234. } else {
  235. }
  236. return result;
  237. }
  238. int StoreUsrConfigData(struct SysConfigData *UsrData)
  239. {
  240. int result = PASS;
  241. int fd,wrd;
  242. unsigned int i,Chk;
  243. unsigned char *ptr, *BufTmp;
  244. Chk=0;
  245. ptr=(unsigned char *)UsrData;
  246. if((BufTmp=malloc(MtdBlockSize))!=NULL)
  247. {
  248. memset(BufTmp,0,MtdBlockSize);
  249. memcpy(BufTmp,ptr,sizeof(struct SysConfigData));
  250. for(i=0;i<MtdBlockSize-4;i++)
  251. Chk+=*(BufTmp+i);
  252. memcpy( BufTmp+MtdBlockSize-4,&Chk,4);
  253. fd = open("/dev/mtdblock10", O_RDWR);
  254. if (fd>0)
  255. {
  256. wrd=write(fd, BufTmp, MtdBlockSize);
  257. close(fd);
  258. if(wrd>=MtdBlockSize)
  259. {
  260. fd = open("/dev/mtdblock11", O_RDWR);
  261. if (fd>0)
  262. {
  263. wrd=write(fd, BufTmp, MtdBlockSize);
  264. close(fd);
  265. if(wrd<MtdBlockSize)
  266. {
  267. DEBUG_ERROR("write /dev/mtdblock11(backup) NG\r\n");
  268. result = FAIL;
  269. }
  270. }
  271. else
  272. {
  273. DEBUG_ERROR("open /dev/mtdblock11(backup) NG\r\n");
  274. result = FAIL;
  275. }
  276. }
  277. else
  278. {
  279. DEBUG_ERROR("write /dev/mtdblock10 NG\r\n");
  280. result = FAIL;
  281. }
  282. }
  283. else
  284. {
  285. DEBUG_ERROR("open /dev/mtdblock10 NG\r\n");
  286. result = FAIL;
  287. }
  288. }
  289. else
  290. {
  291. DEBUG_ERROR("alloc BlockSize NG\r\n");
  292. result = FAIL;
  293. }
  294. if(BufTmp!=NULL)
  295. free(BufTmp);
  296. return result;
  297. }
  298. //================================================
  299. // Main process
  300. //================================================
  301. int main(int argc, char *argv[]) {
  302. //int InitShMry = 1;
  303. if (InitShareMemory() == FAIL) {
  304. //InitShMry = 0;
  305. #ifdef SystemLogMessage
  306. DEBUG_ERROR("InitShareMemory NG\n");
  307. #endif
  308. if (ShmStatusCodeData != NULL) {
  309. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
  310. }
  311. sleep(5);
  312. return 0;
  313. }
  314. //web page submit
  315. if ((argc == 3) & (strlen(argv[1]) == 1)) {
  316. //web page submit system
  317. if (strcmp(argv[1], "1") == 0) {
  318. struct json_object *jobj = json_tokener_parse(argv[2]);
  319. json_object *val_obj = NULL;
  320. char *SystemId=NULL;
  321. char *SystemDateTime = NULL;
  322. int PhaseLossPolicy = 0;
  323. int FactoryConfiguration = 0;
  324. int AuthorisationMode = 0;
  325. int RfidCardNumEndian = 0;
  326. int PsuAcInputType = 0;
  327. char isAPP = NULL;
  328. char isQRCode = NULL;
  329. char isRFID = NULL;
  330. char QRCodeMadeMode = NULL;
  331. char *QRCodeContent = NULL;
  332. if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
  333. SystemId = (char*)json_object_get_string(val_obj);
  334. }
  335. if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
  336. SystemDateTime = (char*)json_object_get_string(val_obj);
  337. }
  338. if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
  339. PhaseLossPolicy = json_object_get_int(val_obj);
  340. }
  341. if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
  342. FactoryConfiguration = json_object_get_int(val_obj);
  343. }
  344. if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
  345. AuthorisationMode = json_object_get_int(val_obj);
  346. }
  347. if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
  348. RfidCardNumEndian = json_object_get_int(val_obj);
  349. }
  350. if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
  351. PsuAcInputType = json_object_get_int(val_obj);
  352. }
  353. if( json_object_object_get_ex(jobj, "isAPP", &val_obj) ) {
  354. isAPP = json_object_get_int(val_obj);
  355. }
  356. if( json_object_object_get_ex(jobj, "isQRCode", &val_obj) ) {
  357. isQRCode = json_object_get_int(val_obj);
  358. }
  359. if( json_object_object_get_ex(jobj, "isRFID", &val_obj) ) {
  360. isRFID = json_object_get_int(val_obj);
  361. }
  362. if( json_object_object_get_ex(jobj, "QRCodeMadeMode", &val_obj) ) {
  363. QRCodeMadeMode = json_object_get_int(val_obj);
  364. }
  365. if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
  366. QRCodeContent = json_object_get_string(val_obj);
  367. }
  368. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
  369. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
  370. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
  371. ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
  372. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
  373. ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
  374. ShmSysConfigAndInfo->SysConfig.isAPP = isAPP;
  375. ShmSysConfigAndInfo->SysConfig.isQRCode = isQRCode;
  376. ShmSysConfigAndInfo->SysConfig.isRFID = isRFID;
  377. ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
  378. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
  379. if(strlen(SystemDateTime)>0){
  380. char cmd[100];
  381. sprintf(cmd,"date -s '%s'",SystemDateTime);
  382. if(system(cmd)==0){
  383. system("hwclock -w");
  384. }
  385. }
  386. }
  387. if (strcmp(argv[1], "2") == 0) {
  388. struct json_object *jobj = json_tokener_parse(argv[2]);
  389. json_object *val_obj = NULL;
  390. int MaxChargingEnergy= 0;
  391. int MaxChargingPower = 0;
  392. int MaxChargingCurrent = 0;
  393. int AcMaxChargingCurrent = 0;
  394. int MaxChargingDuration = 0;
  395. char *LocalWhiteCard0 = NULL;
  396. char *LocalWhiteCard1 = NULL;
  397. char *LocalWhiteCard2 = NULL;
  398. char *LocalWhiteCard3 = NULL;
  399. char *LocalWhiteCard4 = NULL;
  400. char *LocalWhiteCard5 = NULL;
  401. char *LocalWhiteCard6 = NULL;
  402. char *LocalWhiteCard7 = NULL;
  403. char *LocalWhiteCard8 = NULL;
  404. char *LocalWhiteCard9 = NULL;
  405. char isBilling = 0;
  406. char Currency = 0;
  407. float Fee0 = 0;
  408. float Fee1 = 0;
  409. float Fee2 = 0;
  410. float Fee3 = 0;
  411. float Fee4 = 0;
  412. float Fee5 = 0;
  413. float Fee6 = 0;
  414. float Fee7 = 0;
  415. float Fee8 = 0;
  416. float Fee9 = 0;
  417. float Fee10 = 0;
  418. float Fee11 = 0;
  419. float Fee12 = 0;
  420. float Fee13 = 0;
  421. float Fee14 = 0;
  422. float Fee15 = 0;
  423. float Fee16 = 0;
  424. float Fee17 = 0;
  425. float Fee18 = 0;
  426. float Fee19 = 0;
  427. float Fee20 = 0;
  428. float Fee21 = 0;
  429. float Fee22 = 0;
  430. float Fee23 = 0;
  431. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  432. MaxChargingEnergy = json_object_get_int(val_obj);
  433. }
  434. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  435. MaxChargingPower = json_object_get_int(val_obj);
  436. }
  437. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  438. MaxChargingCurrent = json_object_get_int(val_obj);
  439. }
  440. if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
  441. AcMaxChargingCurrent = json_object_get_int(val_obj);
  442. }
  443. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  444. MaxChargingDuration = json_object_get_int(val_obj);
  445. }
  446. if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
  447. LocalWhiteCard0 = (char*)json_object_get_string(val_obj);
  448. }
  449. if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
  450. LocalWhiteCard1 = (char*)json_object_get_string(val_obj);
  451. }
  452. if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
  453. LocalWhiteCard2 = (char*)json_object_get_string(val_obj);
  454. }
  455. if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
  456. LocalWhiteCard3 = (char*)json_object_get_string(val_obj);
  457. }
  458. if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
  459. LocalWhiteCard4 = (char*)json_object_get_string(val_obj);
  460. }
  461. if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
  462. LocalWhiteCard5 = (char*)json_object_get_string(val_obj);
  463. }
  464. if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
  465. LocalWhiteCard6 = (char*)json_object_get_string(val_obj);
  466. }
  467. if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
  468. LocalWhiteCard7 = (char*)json_object_get_string(val_obj);
  469. }
  470. if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
  471. LocalWhiteCard8 = (char*)json_object_get_string(val_obj);
  472. }
  473. if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
  474. LocalWhiteCard9 = (char*)json_object_get_string(val_obj);
  475. }
  476. if( json_object_object_get_ex(jobj, "isBilling", &val_obj) ) {
  477. isBilling = json_object_get_int(val_obj);
  478. }
  479. if( json_object_object_get_ex(jobj, "Currency", &val_obj) ) {
  480. Currency = json_object_get_int(val_obj);
  481. }
  482. if( json_object_object_get_ex(jobj, "Fee0", &val_obj) ) {
  483. Fee0 = json_object_get_double(val_obj);
  484. }
  485. if( json_object_object_get_ex(jobj, "Fee1", &val_obj) ) {
  486. Fee1 = json_object_get_double(val_obj);
  487. }
  488. if( json_object_object_get_ex(jobj, "Fee2", &val_obj) ) {
  489. Fee2 = json_object_get_double(val_obj);
  490. }
  491. if( json_object_object_get_ex(jobj, "Fee3", &val_obj) ) {
  492. Fee3 = json_object_get_double(val_obj);
  493. }
  494. if( json_object_object_get_ex(jobj, "Fee4", &val_obj) ) {
  495. Fee4 = json_object_get_double(val_obj);
  496. }
  497. if( json_object_object_get_ex(jobj, "Fee5", &val_obj) ) {
  498. Fee5 = json_object_get_double(val_obj);
  499. }
  500. if( json_object_object_get_ex(jobj, "Fee6", &val_obj) ) {
  501. Fee6 = json_object_get_double(val_obj);
  502. }
  503. if( json_object_object_get_ex(jobj, "Fee7", &val_obj) ) {
  504. Fee7 = json_object_get_double(val_obj);
  505. }
  506. if( json_object_object_get_ex(jobj, "Fee8", &val_obj) ) {
  507. Fee8 = json_object_get_double(val_obj);
  508. }
  509. if( json_object_object_get_ex(jobj, "Fee9", &val_obj) ) {
  510. Fee9 = json_object_get_double(val_obj);
  511. }
  512. if( json_object_object_get_ex(jobj, "Fee10", &val_obj) ) {
  513. Fee10 = json_object_get_double(val_obj);
  514. }
  515. if( json_object_object_get_ex(jobj, "Fee11", &val_obj) ) {
  516. Fee11 = json_object_get_double(val_obj);
  517. }
  518. if( json_object_object_get_ex(jobj, "Fee12", &val_obj) ) {
  519. Fee12 = json_object_get_double(val_obj);
  520. }
  521. if( json_object_object_get_ex(jobj, "Fee13", &val_obj) ) {
  522. Fee13 = json_object_get_double(val_obj);
  523. }
  524. if( json_object_object_get_ex(jobj, "Fee14", &val_obj) ) {
  525. Fee14 = json_object_get_double(val_obj);
  526. }
  527. if( json_object_object_get_ex(jobj, "Fee15", &val_obj) ) {
  528. Fee15 = json_object_get_double(val_obj);
  529. }
  530. if( json_object_object_get_ex(jobj, "Fee16", &val_obj) ) {
  531. Fee16 = json_object_get_double(val_obj);
  532. }
  533. if( json_object_object_get_ex(jobj, "Fee17", &val_obj) ) {
  534. Fee17 = json_object_get_double(val_obj);
  535. }
  536. if( json_object_object_get_ex(jobj, "Fee18", &val_obj) ) {
  537. Fee18 = json_object_get_double(val_obj);
  538. }
  539. if( json_object_object_get_ex(jobj, "Fee19", &val_obj) ) {
  540. Fee19 = json_object_get_double(val_obj);
  541. }
  542. if( json_object_object_get_ex(jobj, "Fee20", &val_obj) ) {
  543. Fee20 = json_object_get_double(val_obj);
  544. }
  545. if( json_object_object_get_ex(jobj, "Fee21", &val_obj) ) {
  546. Fee21 = json_object_get_double(val_obj);
  547. }
  548. if( json_object_object_get_ex(jobj, "Fee22", &val_obj) ) {
  549. Fee22 = json_object_get_double(val_obj);
  550. }
  551. if( json_object_object_get_ex(jobj, "Fee23", &val_obj) ) {
  552. Fee23 = json_object_get_double(val_obj);
  553. }
  554. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  555. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  556. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  557. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
  558. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  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, "DSLU601J1UT1P0D");
  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->SysConfig.PhaseLossPolicy=0;
  748. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration=0;
  749. ShmSysConfigAndInfo->SysConfig.AuthorisationMode=0;
  750. ShmSysConfigAndInfo->SysConfig.DefaultLanguage=0;
  751. ShmSysConfigAndInfo->SysInfo.InputVoltageR=0;
  752. ShmSysConfigAndInfo->SysInfo.InputVoltageS=0;
  753. ShmSysConfigAndInfo->SysInfo.InputVoltageT=0;
  754. ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed=0;
  755. ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed=0;
  756. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian=0;
  757. ShmSysConfigAndInfo->SysConfig.RatingCurrent=100;
  758. ShmSysConfigAndInfo->SysConfig.PsuAcInputType=0;
  759. ShmSysConfigAndInfo->SysInfo.AuxPower5V=0;
  760. ShmSysConfigAndInfo->SysInfo.AuxPower12V=0;
  761. ShmSysConfigAndInfo->SysInfo.AuxPower24V=0;
  762. ShmSysConfigAndInfo->SysInfo.AuxPower48V=0;
  763. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev, "");
  764. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev, "");
  765. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev, "");
  766. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "");
  767. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, "");
  768. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev, "");
  769. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev, "");
  770. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev, "");
  771. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev, "");
  772. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev, "");
  773. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev, "");
  774. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev, "");
  775. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev, "");
  776. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev, "");
  777. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev, "");
  778. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev, "");
  779. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev, "");
  780. ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp=0;
  781. ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp=0;
  782. ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp=0;
  783. ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp=0;
  784. ShmSysConfigAndInfo->SysConfig.AcPlugInTimes=0;
  785. ShmSysConfigAndInfo->SysConfig.GbPlugInTimes=0;
  786. ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime=0;
  787. ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes=0;
  788. ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes=0;
  789. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwPrimaryVersion, "DC 9.01");
  790. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwPrimaryVersion, "DC 9.02");
  791. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwSecondVersion, "PFC 9.02");
  792. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwSecondVersion, "PFC 9.03");
  793. //charging
  794. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=0;
  795. ShmSysConfigAndInfo->SysConfig.MaxChargingPower=0;
  796. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent= 0;
  797. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent= 0;
  798. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=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 *AcModelName;
  1000. struct json_object *SerialNumber;
  1001. struct json_object *SystemId;
  1002. struct json_object *AcPhaseCount;
  1003. struct json_object *PhaseLossPolicy;
  1004. struct json_object *FactoryConfiguration;
  1005. struct json_object *AuthorisationMode;
  1006. struct json_object *DefaultLanguage;
  1007. struct json_object *InputVoltageR;
  1008. struct json_object *InputVoltageS;
  1009. struct json_object *InputVoltageT;
  1010. struct json_object *SystemFanRotaSpeed;
  1011. struct json_object *PsuFanRotaSpeed;
  1012. struct json_object *RfidCardNumEndian;
  1013. struct json_object *PsuAcInputType;
  1014. struct json_object *RatingCurrent;
  1015. struct json_object *AcRatingCurrent;
  1016. struct json_object *isAPP;
  1017. struct json_object *isQRCode;
  1018. struct json_object *isRFID;
  1019. struct json_object *QRCodeMadeMode;
  1020. struct json_object *QRCodeContent;
  1021. struct json_object *AuxPower5V;
  1022. struct json_object *AuxPower12V;
  1023. struct json_object *AuxPower24V;
  1024. struct json_object *AuxPower48V;
  1025. struct json_object *CsuHwRev;
  1026. struct json_object *CsuBootLoadFwRev;
  1027. struct json_object *CsuKernelFwRev;
  1028. struct json_object *CsuRootFsFwRev;
  1029. struct json_object *CsuPrimFwRev;
  1030. struct json_object *LcmHwRev;
  1031. struct json_object *LcmFwRev;
  1032. struct json_object *PsuHwRev;
  1033. struct json_object *PsuPrimFwRev;
  1034. struct json_object *PsuSecFwRev;
  1035. struct json_object *AuxPwrHwRev;
  1036. struct json_object *AuxPwrFwRev;
  1037. struct json_object *FanModuleHwRev;
  1038. struct json_object *FanModuleFwRev;
  1039. struct json_object *RelayModuleHwRev;
  1040. struct json_object *RelayModuleFwRev;
  1041. struct json_object *TelcomModemFwRev;
  1042. struct json_object *Connector1FwRev;
  1043. struct json_object *Connector2FwRev;
  1044. struct json_object *LedModuleFwRev;
  1045. struct json_object *SystemAmbientTemp;
  1046. struct json_object *SystemCriticalTemp;
  1047. struct json_object *CcsConnectorTemp;
  1048. struct json_object *PsuAmbientTemp;
  1049. struct json_object *AcPlugInTimes;
  1050. struct json_object *GbPlugInTimes;
  1051. struct json_object *Ccs1PlugInTime;
  1052. struct json_object *Ccs2PlugInTimes;
  1053. struct json_object *ChademoPlugInTimes;
  1054. struct json_object *FirmwareUpdate;
  1055. struct json_object *FwPrimaryVersion[PsuQuantity];
  1056. struct json_object *FwPrimaryVersionArr= json_object_new_array();
  1057. struct json_object *FwSecondVersion[PsuQuantity];
  1058. struct json_object *FwSecondVersionArr= json_object_new_array();
  1059. //charging
  1060. struct json_object *MaxChargingEnergy;
  1061. struct json_object *MaxChargingPower;
  1062. struct json_object *MaxChargingCurrent;
  1063. struct json_object *AcMaxChargingCurrent;
  1064. struct json_object *MaxChargingDuration;
  1065. struct json_object *LocalWhiteCard[10];
  1066. struct json_object *LocalWhiteCardArr= json_object_new_array();
  1067. struct json_object *isBilling;
  1068. struct json_object *Currency;
  1069. struct json_object *Fee[24];
  1070. struct json_object *FeeArr= json_object_new_array();
  1071. struct json_object *ChargingInfo1;
  1072. struct json_object *ChargingInfo2;
  1073. struct json_object *ChargingInfo3;
  1074. struct json_object *StartUserId[3];
  1075. struct json_object *StartDateTime[3];
  1076. struct json_object *StopDateTime[3];
  1077. struct json_object *StartMethod[3];
  1078. struct json_object *ConnectorTemp[3];
  1079. struct json_object *PresentChargingVoltage[3];
  1080. struct json_object *PresentChargingCurrent[3];
  1081. struct json_object *PresentChargingPower[3];
  1082. struct json_object *PresentChargedEnergy[3];
  1083. struct json_object *PresentChargedDuration[3];
  1084. struct json_object *RemainChargingDuration[3];
  1085. struct json_object *EvBatteryMaxVoltage[3];
  1086. struct json_object *EvBatterytargetVoltage[3];
  1087. struct json_object *EvBatterySoc[3];
  1088. struct json_object *SystemStatus[3];
  1089. struct json_object *Index[3];
  1090. struct json_object *Type[3];
  1091. struct json_object *type_index[3];
  1092. struct json_object *EvBatterytargetCurrent[3];
  1093. //network
  1094. struct json_object *InternetConn;
  1095. struct json_object *FtpServer;
  1096. struct json_object *Eth0DhcpClient;
  1097. struct json_object *Eth0MacAddress;
  1098. struct json_object *Eth0IpAddress;
  1099. struct json_object *Eth0SubmaskAddress;
  1100. struct json_object *Eth0GatewayAddress;
  1101. struct json_object *Eth1DhcpClient;
  1102. struct json_object *Eth1MacAddress;
  1103. struct json_object *Eth1IpAddress;
  1104. struct json_object *Eth1SubmaskAddress;
  1105. struct json_object *Eth1GatewayAddress;
  1106. struct json_object *WifiMode;
  1107. struct json_object *WifiSsid;
  1108. struct json_object *WifiPassword;
  1109. struct json_object *WifiRssi;
  1110. struct json_object *WifiDhcpServer;
  1111. struct json_object *WifiDhcpClient;
  1112. struct json_object *WifiMacAddress;
  1113. struct json_object *WifiIpAddress;
  1114. struct json_object *WifiSubmaskAddress;
  1115. struct json_object *WifiGatewayAddress;
  1116. struct json_object *WifiNetworkConn;
  1117. struct json_object *TelcomApn;
  1118. struct json_object *TelcomRssi;
  1119. struct json_object *TelcomChapPapId;
  1120. struct json_object *TelcomChapPapPwd;
  1121. struct json_object *TelcomModemImei;
  1122. struct json_object *TelcomSimImsi;
  1123. struct json_object *TelcomSimIccid;
  1124. struct json_object *TelcomSimStatus;
  1125. struct json_object *TelcomModemMode;
  1126. struct json_object *TelcomIpAddress;
  1127. struct json_object *TelcomNetworkConn;
  1128. //backend
  1129. struct json_object *BackendConnTimeout;
  1130. struct json_object *OfflinePolicy;
  1131. struct json_object *OfflineMaxChargeEnergy;
  1132. struct json_object *OfflineMaxChargeDuration;
  1133. struct json_object *OcppConnStatus;
  1134. struct json_object *OcppServerURL;
  1135. struct json_object *ChargeBoxId;
  1136. struct json_object *chargePointVendor;
  1137. jobj1=json_object_new_object();
  1138. jobj2=json_object_new_object();
  1139. jobj3=json_object_new_object();
  1140. jobj4=json_object_new_object();
  1141. //system
  1142. ModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ModelName);
  1143. AcModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AcModelName);
  1144. SerialNumber = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber);
  1145. SystemId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SystemId);
  1146. AcPhaseCount = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPhaseCount);
  1147. PhaseLossPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy);
  1148. FactoryConfiguration = json_object_new_int(ShmSysConfigAndInfo->SysInfo.FactoryConfiguration);
  1149. AuthorisationMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
  1150. DefaultLanguage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.DefaultLanguage);
  1151. InputVoltageR = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageR);
  1152. InputVoltageS = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageS);
  1153. InputVoltageT = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageT);
  1154. SystemFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed);
  1155. PsuFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed);
  1156. RfidCardNumEndian = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
  1157. PsuAcInputType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PsuAcInputType);
  1158. RatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RatingCurrent);
  1159. AcRatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcRatingCurrent);
  1160. isAPP = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAPP);
  1161. isQRCode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isQRCode);
  1162. isRFID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isRFID);
  1163. QRCodeMadeMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
  1164. QRCodeContent = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent);
  1165. AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
  1166. AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
  1167. AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
  1168. AuxPower48V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower48V);
  1169. CsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
  1170. CsuBootLoadFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
  1171. CsuKernelFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
  1172. CsuRootFsFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
  1173. CsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
  1174. LcmHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
  1175. LcmFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
  1176. PsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
  1177. PsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
  1178. PsuSecFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
  1179. AuxPwrHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
  1180. AuxPwrFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
  1181. FanModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
  1182. FanModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
  1183. RelayModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
  1184. RelayModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
  1185. TelcomModemFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
  1186. Connector1FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector1FwRev);
  1187. Connector2FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector2FwRev);
  1188. LedModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LedModuleFwRev);
  1189. SystemAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
  1190. SystemCriticalTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
  1191. CcsConnectorTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
  1192. PsuAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp);
  1193. AcPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPlugInTimes);
  1194. GbPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.GbPlugInTimes);
  1195. Ccs1PlugInTime = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime);
  1196. Ccs2PlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes);
  1197. ChademoPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes);
  1198. FirmwareUpdate = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
  1199. if(strcmp(IsAcDc, "D") == 0){
  1200. for(int i=0;i<PsuQuantity;i++){
  1201. FwPrimaryVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwPrimaryVersion);
  1202. FwSecondVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwSecondVersion);
  1203. json_object_array_add(FwPrimaryVersionArr,FwPrimaryVersion[i]);
  1204. json_object_array_add(FwSecondVersionArr,FwSecondVersion[i]);
  1205. }
  1206. }
  1207. //charging
  1208. int CcsGunQty=0;
  1209. int GbGunQty=0;
  1210. int CHAdeMOGunQty=0;
  1211. int AcGunQty=0;
  1212. ChargingInfo1=json_object_new_object();
  1213. ChargingInfo2=json_object_new_object();
  1214. ChargingInfo3=json_object_new_object();
  1215. MaxChargingEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
  1216. MaxChargingPower = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
  1217. MaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
  1218. AcMaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent);
  1219. MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
  1220. LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
  1221. LocalWhiteCard[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
  1222. LocalWhiteCard[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
  1223. LocalWhiteCard[3] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
  1224. LocalWhiteCard[4] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
  1225. LocalWhiteCard[5] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
  1226. LocalWhiteCard[6] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
  1227. LocalWhiteCard[7] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
  1228. LocalWhiteCard[8] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
  1229. LocalWhiteCard[9] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
  1230. isBilling = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling);
  1231. Currency = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.Currency);
  1232. Fee[0] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0]);
  1233. Fee[1] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1]);
  1234. Fee[2] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2]);
  1235. Fee[3] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3]);
  1236. Fee[4] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4]);
  1237. Fee[5] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5]);
  1238. Fee[6] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6]);
  1239. Fee[7] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7]);
  1240. Fee[8] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8]);
  1241. Fee[9] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9]);
  1242. Fee[10] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10]);
  1243. Fee[11] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11]);
  1244. Fee[12] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12]);
  1245. Fee[13] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13]);
  1246. Fee[14] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14]);
  1247. Fee[15] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15]);
  1248. Fee[16] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16]);
  1249. Fee[17] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17]);
  1250. Fee[18] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18]);
  1251. Fee[19] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19]);
  1252. Fee[20] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20]);
  1253. Fee[21] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21]);
  1254. Fee[22] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22]);
  1255. Fee[23] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23]);
  1256. if(connectorType1 != 0){
  1257. if(connectorType1 == 1){//CCS
  1258. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1259. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1260. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1261. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1262. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1263. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1264. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1265. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1266. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1267. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1268. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1269. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1270. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1271. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1272. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1273. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1274. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1275. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1276. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1277. CcsGunQty++;
  1278. }
  1279. else if(connectorType1 == 2){//GB
  1280. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1281. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1282. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1283. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1284. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1285. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1286. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1287. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1288. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1289. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1290. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1291. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1292. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1293. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1294. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1295. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1296. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1297. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1298. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1299. GbGunQty++;
  1300. }
  1301. else if(connectorType1 == 3){//CHAdeMO
  1302. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1303. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1304. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1305. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1306. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1307. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1308. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1309. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1310. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1311. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1312. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1313. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1314. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1315. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1316. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1317. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1318. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1319. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1320. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1321. CHAdeMOGunQty++;
  1322. }
  1323. else if(connectorType1 == 4){//AC
  1324. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1325. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1326. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1327. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1328. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1329. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1330. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1331. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1332. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1333. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1334. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1335. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1336. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1337. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1338. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1339. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1340. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1341. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1342. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1343. AcGunQty++;
  1344. }
  1345. }
  1346. if(connectorType2 != 0){
  1347. if(connectorType2 == 1){//CCS
  1348. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1349. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1350. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1351. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1352. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1353. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1354. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1355. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1356. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1357. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1358. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1359. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1360. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1361. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1362. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1363. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1364. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1365. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1366. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1367. CcsGunQty++;
  1368. }
  1369. else if(connectorType2 == 2){//GB
  1370. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1371. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1372. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1373. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1374. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1375. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1376. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1377. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1378. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1379. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1380. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1381. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1382. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1383. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1384. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1385. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1386. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1387. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1388. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1389. GbGunQty++;
  1390. }
  1391. else if(connectorType2 == 3){//CHAdeMO
  1392. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1393. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1394. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1395. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1396. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1397. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1398. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1399. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1400. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1401. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1402. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1403. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1404. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1405. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1406. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1407. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1408. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1409. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1410. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1411. CHAdeMOGunQty++;
  1412. }
  1413. else if(connectorType2 == 4){//AC
  1414. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1415. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1416. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1417. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1418. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1419. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1420. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1421. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1422. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1423. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1424. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1425. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1426. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1427. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1428. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1429. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1430. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1431. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1432. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1433. AcGunQty++;
  1434. }
  1435. }
  1436. if(connectorType3 != 0){
  1437. if(connectorType3 == 1){//CCS
  1438. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1439. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1440. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1441. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1442. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1443. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1444. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1445. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1446. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1447. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1448. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1449. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1450. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1451. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1452. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1453. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1454. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1455. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1456. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1457. CcsGunQty++;
  1458. }
  1459. else if(connectorType3 == 2){//GB
  1460. PresentChargingVoltage[2]= json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1461. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1462. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1463. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1464. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1465. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1466. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1467. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1468. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1469. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1470. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1471. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1472. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1473. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1474. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1475. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1476. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1477. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1478. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1479. GbGunQty++;
  1480. }
  1481. else if(connectorType3 == 3){//CHAdeMO
  1482. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1483. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1484. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1485. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1486. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1487. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1488. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1489. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1490. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1491. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1492. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1493. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1494. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1495. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1496. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1497. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1498. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1499. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1500. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1501. CHAdeMOGunQty++;
  1502. }
  1503. else if(connectorType3 == 4){//AC
  1504. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1505. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1506. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1507. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1508. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1509. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1510. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1511. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1512. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1513. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1514. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1515. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1516. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1517. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1518. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1519. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1520. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1521. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1522. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1523. AcGunQty++;
  1524. }
  1525. }
  1526. //network
  1527. InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
  1528. FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
  1529. Eth0DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient);
  1530. Eth0MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
  1531. Eth0IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
  1532. Eth0SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
  1533. Eth0GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
  1534. Eth1DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient);
  1535. Eth1MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
  1536. Eth1IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
  1537. Eth1SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
  1538. Eth1GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
  1539. WifiMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
  1540. WifiSsid = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
  1541. WifiPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
  1542. WifiRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
  1543. WifiDhcpServer = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer);
  1544. WifiDhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient);
  1545. WifiMacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
  1546. WifiIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
  1547. WifiSubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
  1548. WifiGatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
  1549. WifiNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn);
  1550. TelcomApn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
  1551. TelcomRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
  1552. TelcomChapPapId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
  1553. TelcomChapPapPwd = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
  1554. TelcomModemImei = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
  1555. TelcomSimImsi = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
  1556. TelcomSimIccid = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid);
  1557. TelcomSimStatus = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus);
  1558. TelcomModemMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode);
  1559. TelcomIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
  1560. TelcomNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn);
  1561. //backend
  1562. BackendConnTimeout = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
  1563. OfflinePolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
  1564. OfflineMaxChargeEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
  1565. OfflineMaxChargeDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
  1566. OcppConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.OcppConnStatus);
  1567. OcppServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL);
  1568. ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
  1569. chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
  1570. //system
  1571. json_object_object_add(jobj1,"ModelName",ModelName);
  1572. json_object_object_add(jobj1,"AcModelName",AcModelName);
  1573. json_object_object_add(jobj1,"SerialNumber",SerialNumber);
  1574. json_object_object_add(jobj1,"SystemId",SystemId);
  1575. json_object_object_add(jobj1,"AcPhaseCount",AcPhaseCount);
  1576. json_object_object_add(jobj2,"PhaseLossPolicy",PhaseLossPolicy);
  1577. json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
  1578. json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
  1579. json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
  1580. json_object_object_add(jobj1,"InputVoltageR",InputVoltageR);
  1581. json_object_object_add(jobj1,"InputVoltageS",InputVoltageS);
  1582. json_object_object_add(jobj1,"InputVoltageT",InputVoltageT);
  1583. json_object_object_add(jobj1,"SystemFanRotaSpeed",SystemFanRotaSpeed);
  1584. json_object_object_add(jobj1,"PsuFanRotaSpeed",PsuFanRotaSpeed);
  1585. json_object_object_add(jobj1,"RfidCardNumEndian",RfidCardNumEndian);
  1586. json_object_object_add(jobj1,"PsuAcInputType",PsuAcInputType);
  1587. json_object_object_add(jobj1,"RatingCurrent",RatingCurrent);
  1588. json_object_object_add(jobj1,"AcRatingCurrent",AcRatingCurrent);
  1589. json_object_object_add(jobj1,"isAPP",isAPP);
  1590. json_object_object_add(jobj1,"isQRCode",isQRCode);
  1591. json_object_object_add(jobj1,"isRFID",isRFID);
  1592. json_object_object_add(jobj1,"QRCodeMadeMode",QRCodeMadeMode);
  1593. json_object_object_add(jobj1,"QRCodeContent",QRCodeContent);
  1594. json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
  1595. json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
  1596. json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
  1597. json_object_object_add(jobj1,"AuxPower48V",AuxPower48V);
  1598. json_object_object_add(jobj1,"CsuHwRev",CsuHwRev);
  1599. json_object_object_add(jobj1,"CsuBootLoadFwRev",CsuBootLoadFwRev);
  1600. json_object_object_add(jobj1,"CsuKernelFwRev",CsuKernelFwRev);
  1601. json_object_object_add(jobj1,"CsuRootFsFwRev",CsuRootFsFwRev);
  1602. json_object_object_add(jobj1,"CsuPrimFwRev",CsuPrimFwRev);
  1603. json_object_object_add(jobj1,"LcmHwRev",LcmHwRev);
  1604. json_object_object_add(jobj1,"LcmFwRev",LcmFwRev);
  1605. json_object_object_add(jobj1,"PsuHwRev",PsuHwRev);
  1606. json_object_object_add(jobj1,"PsuPrimFwRev",PsuPrimFwRev);
  1607. json_object_object_add(jobj1,"PsuSecFwRev",PsuSecFwRev);
  1608. json_object_object_add(jobj1,"AuxPwrHwRev",AuxPwrHwRev);
  1609. json_object_object_add(jobj1,"AuxPwrFwRev",AuxPwrFwRev);
  1610. json_object_object_add(jobj1,"FanModuleHwRev",FanModuleHwRev);
  1611. json_object_object_add(jobj1,"FanModuleFwRev",FanModuleFwRev);
  1612. json_object_object_add(jobj1,"RelayModuleHwRev",RelayModuleHwRev);
  1613. json_object_object_add(jobj1,"RelayModuleFwRev",RelayModuleFwRev);
  1614. json_object_object_add(jobj1,"TelcomModemFwRev",TelcomModemFwRev);
  1615. json_object_object_add(jobj1,"Connector1FwRev",Connector1FwRev);
  1616. json_object_object_add(jobj1,"Connector2FwRev",Connector2FwRev);
  1617. json_object_object_add(jobj1,"LedModuleFwRev",LedModuleFwRev);
  1618. json_object_object_add(jobj1,"SystemAmbientTemp",SystemAmbientTemp);
  1619. json_object_object_add(jobj1,"SystemCriticalTemp",SystemCriticalTemp);
  1620. json_object_object_add(jobj1,"CcsConnectorTemp",CcsConnectorTemp);
  1621. json_object_object_add(jobj1,"PsuAmbientTemp",PsuAmbientTemp);
  1622. json_object_object_add(jobj1,"AcPlugInTimes",AcPlugInTimes);
  1623. json_object_object_add(jobj1,"GbPlugInTimes",GbPlugInTimes);
  1624. json_object_object_add(jobj1,"Ccs1PlugInTimes",Ccs1PlugInTime);
  1625. json_object_object_add(jobj1,"Ccs2PlugInTimes",Ccs2PlugInTimes);
  1626. json_object_object_add(jobj1,"ChademoPlugInTimes",ChademoPlugInTimes);
  1627. json_object_object_add(jobj1,"FirmwareUpdate",FirmwareUpdate);
  1628. if(strcmp(IsAcDc, "D") == 0){
  1629. json_object_object_add(jobj1,"FwPrimaryVersion",FwPrimaryVersionArr);
  1630. json_object_object_add(jobj1,"FwSecondVersion",FwSecondVersionArr);
  1631. }
  1632. printf("%s\n", json_object_to_json_string(jobj1));
  1633. json_object_put(jobj1);
  1634. //charging
  1635. json_object_object_add(jobj2,"MaxChargingEnergy",MaxChargingEnergy);
  1636. json_object_object_add(jobj2,"MaxChargingPower",MaxChargingPower);
  1637. json_object_object_add(jobj2,"MaxChargingCurrent",MaxChargingCurrent);
  1638. json_object_object_add(jobj2,"AcMaxChargingCurrent",AcMaxChargingCurrent);
  1639. json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
  1640. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
  1641. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
  1642. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);
  1643. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[3]);
  1644. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[4]);
  1645. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[5]);
  1646. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[6]);
  1647. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[7]);
  1648. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[8]);
  1649. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[9]);
  1650. json_object_object_add(jobj2,"LocalWhiteCard",LocalWhiteCardArr);
  1651. json_object_object_add(jobj2,"isBilling",isBilling);
  1652. json_object_object_add(jobj2,"Currency",Currency);
  1653. json_object_array_add(FeeArr,Fee[0]);
  1654. json_object_array_add(FeeArr,Fee[1]);
  1655. json_object_array_add(FeeArr,Fee[2]);
  1656. json_object_array_add(FeeArr,Fee[3]);
  1657. json_object_array_add(FeeArr,Fee[4]);
  1658. json_object_array_add(FeeArr,Fee[5]);
  1659. json_object_array_add(FeeArr,Fee[6]);
  1660. json_object_array_add(FeeArr,Fee[7]);
  1661. json_object_array_add(FeeArr,Fee[8]);
  1662. json_object_array_add(FeeArr,Fee[9]);
  1663. json_object_array_add(FeeArr,Fee[10]);
  1664. json_object_array_add(FeeArr,Fee[11]);
  1665. json_object_array_add(FeeArr,Fee[12]);
  1666. json_object_array_add(FeeArr,Fee[13]);
  1667. json_object_array_add(FeeArr,Fee[14]);
  1668. json_object_array_add(FeeArr,Fee[15]);
  1669. json_object_array_add(FeeArr,Fee[16]);
  1670. json_object_array_add(FeeArr,Fee[17]);
  1671. json_object_array_add(FeeArr,Fee[18]);
  1672. json_object_array_add(FeeArr,Fee[19]);
  1673. json_object_array_add(FeeArr,Fee[20]);
  1674. json_object_array_add(FeeArr,Fee[21]);
  1675. json_object_array_add(FeeArr,Fee[22]);
  1676. json_object_array_add(FeeArr,Fee[23]);
  1677. json_object_object_add(jobj2,"Fee",FeeArr);
  1678. if(connectorType1 != 0){
  1679. json_object_object_add(ChargingInfo1,"StartUserId",StartUserId[0]);
  1680. json_object_object_add(ChargingInfo1,"StartDateTime",StartDateTime[0]);
  1681. json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
  1682. json_object_object_add(ChargingInfo1,"StartMethod",StartMethod[0]);
  1683. json_object_object_add(ChargingInfo1,"ConnectorTemp",ConnectorTemp[0]);
  1684. json_object_object_add(ChargingInfo1,"PresentChargingVoltage",PresentChargingVoltage[0]);
  1685. json_object_object_add(ChargingInfo1,"PresentChargingCurrent",PresentChargingCurrent[0]);
  1686. json_object_object_add(ChargingInfo1,"PresentChargingPower",PresentChargingPower[0]);
  1687. json_object_object_add(ChargingInfo1,"PresentChargedEnergy",PresentChargedEnergy[0]);
  1688. json_object_object_add(ChargingInfo1,"PresentChargedDuration",PresentChargedDuration[0]);
  1689. json_object_object_add(ChargingInfo1,"RemainChargingDuration",RemainChargingDuration[0]);
  1690. json_object_object_add(ChargingInfo1,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[0]);
  1691. json_object_object_add(ChargingInfo1,"EvBatterytargetVoltage",EvBatterytargetVoltage[0]);
  1692. json_object_object_add(ChargingInfo1,"EvBatterySoc",EvBatterySoc[0]);
  1693. json_object_object_add(ChargingInfo1,"SystemStatus",SystemStatus[0]);
  1694. json_object_object_add(ChargingInfo1,"Index",Index[0]);
  1695. json_object_object_add(ChargingInfo1,"Type",Type[0]);
  1696. json_object_object_add(ChargingInfo1,"type_index",type_index[0]);
  1697. json_object_object_add(ChargingInfo1,"EvBatterytargetCurrent",EvBatterytargetCurrent[0]);
  1698. json_object_object_add(jobj2,"ChargingInfo1",ChargingInfo1);
  1699. }
  1700. if(connectorType2 != 0){
  1701. json_object_object_add(ChargingInfo2,"StartUserId",StartUserId[1]);
  1702. json_object_object_add(ChargingInfo2,"StartDateTime",StartDateTime[1]);
  1703. json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
  1704. json_object_object_add(ChargingInfo2,"StartMethod",StartMethod[1]);
  1705. json_object_object_add(ChargingInfo2,"ConnectorTemp",ConnectorTemp[1]);
  1706. json_object_object_add(ChargingInfo2,"PresentChargingVoltage",PresentChargingVoltage[1]);
  1707. json_object_object_add(ChargingInfo2,"PresentChargingCurrent",PresentChargingCurrent[1]);
  1708. json_object_object_add(ChargingInfo2,"PresentChargingPower",PresentChargingPower[1]);
  1709. json_object_object_add(ChargingInfo2,"PresentChargedEnergy",PresentChargedEnergy[1]);
  1710. json_object_object_add(ChargingInfo2,"PresentChargedDuration",PresentChargedDuration[1]);
  1711. json_object_object_add(ChargingInfo2,"RemainChargingDuration",RemainChargingDuration[1]);
  1712. json_object_object_add(ChargingInfo2,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[1]);
  1713. json_object_object_add(ChargingInfo2,"EvBatterytargetVoltage",EvBatterytargetVoltage[1]);
  1714. json_object_object_add(ChargingInfo2,"EvBatterySoc",EvBatterySoc[1]);
  1715. json_object_object_add(ChargingInfo2,"SystemStatus",SystemStatus[1]);
  1716. json_object_object_add(ChargingInfo2,"Index",Index[1]);
  1717. json_object_object_add(ChargingInfo2,"Type",Type[1]);
  1718. json_object_object_add(ChargingInfo2,"type_index",type_index[1]);
  1719. json_object_object_add(ChargingInfo2,"EvBatterytargetCurrent",EvBatterytargetCurrent[1]);
  1720. json_object_object_add(jobj2,"ChargingInfo2",ChargingInfo2);
  1721. }
  1722. if(connectorType3 != 0){
  1723. json_object_object_add(ChargingInfo3,"StartUserId",StartUserId[2]);
  1724. json_object_object_add(ChargingInfo3,"StartDateTime",StartDateTime[2]);
  1725. json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);
  1726. json_object_object_add(ChargingInfo3,"StartMethod",StartMethod[2]);
  1727. json_object_object_add(ChargingInfo3,"ConnectorTemp",ConnectorTemp[2]);
  1728. json_object_object_add(ChargingInfo3,"PresentChargingVoltage",PresentChargingVoltage[2]);
  1729. json_object_object_add(ChargingInfo3,"PresentChargingCurrent",PresentChargingCurrent[2]);
  1730. json_object_object_add(ChargingInfo3,"PresentChargingPower",PresentChargingPower[2]);
  1731. json_object_object_add(ChargingInfo3,"PresentChargedEnergy",PresentChargedEnergy[2]);
  1732. json_object_object_add(ChargingInfo3,"PresentChargedDuration",PresentChargedDuration[2]);
  1733. json_object_object_add(ChargingInfo3,"RemainChargingDuration",RemainChargingDuration[2]);
  1734. json_object_object_add(ChargingInfo3,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[2]);
  1735. json_object_object_add(ChargingInfo3,"EvBatterytargetVoltage",EvBatterytargetVoltage[2]);
  1736. json_object_object_add(ChargingInfo3,"EvBatterySoc",EvBatterySoc[2]);
  1737. json_object_object_add(ChargingInfo3,"SystemStatus",SystemStatus[2]);
  1738. json_object_object_add(ChargingInfo3,"Index",Index[2]);
  1739. json_object_object_add(ChargingInfo3,"Type",Type[2]);
  1740. json_object_object_add(ChargingInfo3,"type_index",type_index[2]);
  1741. json_object_object_add(ChargingInfo3,"EvBatterytargetCurrent",EvBatterytargetCurrent[2]);
  1742. json_object_object_add(jobj2,"ChargingInfo3",ChargingInfo3);
  1743. }
  1744. printf("%s\n", json_object_to_json_string(jobj2));
  1745. json_object_put(jobj2);
  1746. //network
  1747. json_object_object_add(jobj3,"InternetConn",InternetConn);
  1748. json_object_object_add(jobj3,"FtpServer",FtpServer);
  1749. json_object_object_add(jobj3,"Eth0DhcpClient",Eth0DhcpClient);
  1750. json_object_object_add(jobj3,"Eth0MacAddress",Eth0MacAddress);
  1751. json_object_object_add(jobj3,"Eth0IpAddress",Eth0IpAddress);
  1752. json_object_object_add(jobj3,"Eth0SubmaskAddress",Eth0SubmaskAddress);
  1753. json_object_object_add(jobj3,"Eth0GatewayAddress",Eth0GatewayAddress);
  1754. json_object_object_add(jobj3,"Eth1DhcpClient",Eth1DhcpClient);
  1755. json_object_object_add(jobj3,"Eth1MacAddress",Eth1MacAddress);
  1756. json_object_object_add(jobj3,"Eth1IpAddress",Eth1IpAddress);
  1757. json_object_object_add(jobj3,"Eth1SubmaskAddress",Eth1SubmaskAddress);
  1758. json_object_object_add(jobj3,"Eth1GatewayAddress",Eth1GatewayAddress);
  1759. json_object_object_add(jobj3,"WifiMode",WifiMode);
  1760. json_object_object_add(jobj3,"WifiSsid",WifiSsid);
  1761. json_object_object_add(jobj3,"WifiPassword",WifiPassword);
  1762. json_object_object_add(jobj3,"WifiRssi",WifiRssi);
  1763. json_object_object_add(jobj3,"WifiDhcpServer",WifiDhcpServer);
  1764. json_object_object_add(jobj3,"WifiDhcpClient",WifiDhcpClient);
  1765. json_object_object_add(jobj3,"WifiMacAddress",WifiMacAddress);
  1766. json_object_object_add(jobj3,"WifiIpAddress",WifiIpAddress);
  1767. json_object_object_add(jobj3,"WifiSubmaskAddress",WifiSubmaskAddress);
  1768. json_object_object_add(jobj3,"WifiGatewayAddress",WifiGatewayAddress);
  1769. json_object_object_add(jobj3,"WifiNetworkConn",WifiNetworkConn);
  1770. json_object_object_add(jobj3,"TelcomApn",TelcomApn);
  1771. json_object_object_add(jobj3,"TelcomRssi",TelcomRssi);
  1772. json_object_object_add(jobj3,"TelcomChapPapId",TelcomChapPapId);
  1773. json_object_object_add(jobj3,"TelcomChapPapPwd",TelcomChapPapPwd);
  1774. json_object_object_add(jobj3,"TelcomModemImei",TelcomModemImei);
  1775. json_object_object_add(jobj3,"TelcomSimImsi",TelcomSimImsi);
  1776. json_object_object_add(jobj3,"TelcomSimIccid",TelcomSimIccid);
  1777. json_object_object_add(jobj3,"TelcomSimStatus",TelcomSimStatus);
  1778. json_object_object_add(jobj3,"TelcomModemMode",TelcomModemMode);
  1779. json_object_object_add(jobj3,"TelcomIpAddress",TelcomIpAddress);
  1780. json_object_object_add(jobj3,"TelcomNetworkConn",TelcomNetworkConn);
  1781. printf("%s\n", json_object_to_json_string(jobj3));
  1782. json_object_put(jobj3);
  1783. //backend
  1784. json_object_object_add(jobj4,"BackendConnTimeout",BackendConnTimeout);
  1785. json_object_object_add(jobj4,"OfflinePolicy",OfflinePolicy);
  1786. json_object_object_add(jobj4,"OfflineMaxChargeEnergy",OfflineMaxChargeEnergy);
  1787. json_object_object_add(jobj4,"OfflineMaxChargeDuration",OfflineMaxChargeDuration);
  1788. json_object_object_add(jobj4,"OcppConnStatus",OcppConnStatus);
  1789. json_object_object_add(jobj4,"OcppServerURL",OcppServerURL);
  1790. json_object_object_add(jobj4,"ChargeBoxId",ChargeBoxId);
  1791. json_object_object_add(jobj4,"chargePointVendor",chargePointVendor);
  1792. printf("%s\n", json_object_to_json_string(jobj4));
  1793. json_object_put(jobj4);
  1794. }
  1795. // for(;;)
  1796. // {
  1797. // }
  1798. return FAIL;
  1799. }