WebService.c 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491
  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 "../Projects/define.h"
  29. #include "json.h"
  30. //#include <json-c/json.h>
  31. #include <math.h>
  32. #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  33. #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  34. #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  35. #define Debug
  36. #define SystemLogMessage
  37. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  38. #define PASS 1
  39. #define FAIL -1
  40. struct SysConfigAndInfo *ShmSysConfigAndInfo;
  41. struct StatusCodeData *ShmStatusCodeData;
  42. void trim(char *s);
  43. int mystrcmp(char *p1, char *p2);
  44. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
  45. void split(char **arr, char *str, const char *del);
  46. #ifdef SystemLogMessage
  47. int StoreLogMsg(const char *fmt, ...) {
  48. char Buf[4096 + 256];
  49. char buffer[4096];
  50. time_t CurrentTime;
  51. struct tm *tm;
  52. va_list args;
  53. va_start(args, fmt);
  54. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  55. va_end(args);
  56. memset(Buf, 0, sizeof(Buf));
  57. CurrentTime = time(NULL);
  58. tm = localtime(&CurrentTime);
  59. sprintf(Buf,
  60. "echo \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
  61. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  62. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  63. system(Buf);
  64. #ifdef Debug
  65. printf("[%04d.%02d.%02d %02d:%02d:%02d] - %s", tm->tm_year + 1900,
  66. tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
  67. buffer);
  68. #endif
  69. return rc;
  70. }
  71. #endif
  72. int DiffTimeb(struct timeb ST, struct timeb ET) {
  73. //return milli-second
  74. unsigned int StartTime, StopTime;
  75. StartTime = (unsigned int) ST.time;
  76. StopTime = (unsigned int) ET.time;
  77. return (StopTime - StartTime) * 1000 + ET.millitm - ST.millitm;
  78. }
  79. //=================================
  80. // Common routine
  81. //=================================
  82. void trim(char *s) {
  83. int i = 0, j, k, l = 0;
  84. while ((s[i] == ' ') || (s[i] == '\t') || (s[i] == '\n'))
  85. i++;
  86. j = strlen(s) - 1;
  87. while ((s[j] == ' ') || (s[j] == '\t') || (s[j] == '\n'))
  88. j--;
  89. if (i == 0 && j == strlen(s) - 1) {
  90. } else if (i == 0)
  91. s[j + 1] = '\0';
  92. else {
  93. for (k = i; k <= j; k++)
  94. s[l++] = s[k];
  95. s[l] = '\0';
  96. }
  97. }
  98. int mystrcmp(char *p1, char *p2) {
  99. while (*p1 == *p2) {
  100. if (*p1 == '\0' || *p2 == '\0')
  101. break;
  102. p1++;
  103. p2++;
  104. }
  105. if (*p1 == '\0' && *p2 == '\0')
  106. return (PASS);
  107. else
  108. return (FAIL);
  109. }
  110. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt) {
  111. strncpy(dest, src + start, cnt);
  112. dest[cnt] = 0;
  113. }
  114. void split(char **arr, char *str, const char *del) {
  115. char *s = strtok(str, del);
  116. while (s != NULL) {
  117. *arr++ = s;
  118. s = strtok(NULL, del);
  119. }
  120. }
  121. int ConnectorType(char* connector){
  122. int result;
  123. if(strcmp(connector, "0") == 0){
  124. result= 0;
  125. }
  126. else if(strcmp(connector, "U") == 0 || strcmp(connector, "E") == 0){
  127. result= 1;//CCS
  128. }
  129. else if(strcmp(connector, "G") == 0 || strcmp(connector, "D") == 0){
  130. result= 2;//GB
  131. }
  132. else if(strcmp(connector, "J") == 0){
  133. result= 3;//CHAdeMO
  134. }
  135. 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){
  136. result= 4;//AC
  137. }
  138. else{
  139. }
  140. return result;
  141. }
  142. int ModelType(char* type,char* network){
  143. int result=0;
  144. if(strcmp(type, "A") == 0){
  145. if(strcmp(network, "0") == 0 || strcmp(network, "R") == 0 || strcmp(network, "B") == 0){
  146. result=0;
  147. }
  148. else if(strcmp(network, "E") == 0 || strcmp(network, "W") == 0 || strcmp(network, "T") == 0 || strcmp(network, "U") == 0){
  149. result=1;
  150. }
  151. }
  152. else if(strcmp(type, "D") == 0){
  153. result=2;
  154. }
  155. return result;
  156. }
  157. //==========================================
  158. // Init all share memory
  159. //==========================================
  160. int InitShareMemory() {
  161. int result = PASS;
  162. int MeterSMId;
  163. //creat ShmSysConfigAndInfo
  164. if ((MeterSMId = shmget(ShmSysConfigAndInfoKey,
  165. sizeof(struct SysConfigAndInfo), 0777)) < 0) {
  166. #ifdef SystemLogMessage
  167. DEBUG_ERROR("shmget ShmSysConfigAndInfo NG\n");
  168. #endif
  169. result = FAIL;
  170. } else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0))
  171. == (void *) -1) {
  172. #ifdef SystemLogMessage
  173. DEBUG_ERROR("shmat ShmSysConfigAndInfo NG\n");
  174. #endif
  175. result = FAIL;
  176. } else {
  177. }
  178. //creat ShmStatusCodeData
  179. if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),
  180. 0777)) < 0) {
  181. #ifdef SystemLogMessage
  182. DEBUG_ERROR("shmget ShmStatusCodeData NG\n");
  183. #endif
  184. result = FAIL;
  185. } else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  186. #ifdef SystemLogMessage
  187. DEBUG_ERROR("shmat ShmStatusCodeData NG\n");
  188. #endif
  189. result = FAIL;
  190. } else {
  191. }
  192. return result;
  193. }
  194. int StoreUsrConfigData(struct SysConfigData *UsrData)
  195. {
  196. int fd,wrd;
  197. unsigned int i,Chk;
  198. unsigned char *ptr;
  199. Chk=0;
  200. ptr=(unsigned char *)UsrData;
  201. for(i=0;i<sizeof(struct SysConfigData)-4;i++)
  202. {
  203. Chk+=*(ptr+i);
  204. }
  205. UsrData->Checksum=Chk;
  206. fd = open("/dev/mtdblock10", O_RDWR);
  207. if (fd < 0)
  208. {
  209. #ifdef SystemLogMessage
  210. StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock10 NG");
  211. #endif
  212. return 0;
  213. }
  214. wrd=write(fd, UsrData, sizeof(struct SysConfigData));
  215. close(fd);
  216. if(wrd!=(sizeof(struct SysConfigData)))
  217. {
  218. #ifdef SystemLogMessage
  219. StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock10 NG");
  220. #endif
  221. return 0;
  222. }
  223. fd = open("/dev/mtdblock11", O_RDWR);
  224. if (fd < 0)
  225. {
  226. #ifdef SystemLogMessage
  227. StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock11(backup) NG");
  228. #endif
  229. return 0;
  230. }
  231. wrd=write(fd, UsrData, sizeof(struct SysConfigData));
  232. close(fd);
  233. if(wrd!=(sizeof(struct SysConfigData)))
  234. {
  235. #ifdef SystemLogMessage
  236. StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock11(backup) NG");
  237. #endif
  238. return 0;
  239. }
  240. return 1;
  241. }
  242. //================================================
  243. // Main process
  244. //================================================
  245. int main(int argc, char *argv[]) {
  246. if (InitShareMemory() == FAIL) {
  247. #ifdef SystemLogMessage
  248. DEBUG_ERROR("InitShareMemory NG\n");
  249. #endif
  250. if (ShmStatusCodeData != NULL) {
  251. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
  252. }
  253. sleep(5);
  254. return 0;
  255. }
  256. //web page submit
  257. if ((argc == 3) & (strlen(argv[1]) == 1)) {
  258. //web page submit system
  259. if (strcmp(argv[1], "1") == 0) {
  260. struct json_object *jobj = json_tokener_parse(argv[2]);
  261. json_object *val_obj = NULL;
  262. char *SystemId=NULL;
  263. char *SystemDateTime = NULL;
  264. int AcPhaseCount = 0;
  265. int FactoryConfiguration = 0;
  266. int AuthorisationMode = 0;
  267. int DefaultLanguage = 0;
  268. int RfidCardNumEndian = 0;
  269. int PsuAcInputType = 0;
  270. if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
  271. SystemId = json_object_get_string(val_obj);
  272. }
  273. if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
  274. SystemDateTime = json_object_get_string(val_obj);
  275. }
  276. if( json_object_object_get_ex(jobj, "AcPhaseCount", &val_obj) ) {
  277. AcPhaseCount = json_object_get_int(val_obj);
  278. }
  279. if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
  280. FactoryConfiguration = json_object_get_int(val_obj);
  281. }
  282. if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
  283. AuthorisationMode = json_object_get_int(val_obj);
  284. }
  285. if( json_object_object_get_ex(jobj, "DefaultLanguage", &val_obj) ) {
  286. DefaultLanguage = json_object_get_int(val_obj);
  287. }
  288. if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
  289. RfidCardNumEndian = json_object_get_int(val_obj);
  290. }
  291. if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
  292. PsuAcInputType = json_object_get_int(val_obj);
  293. }
  294. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
  295. ShmSysConfigAndInfo->SysConfig.AcPhaseCount = AcPhaseCount;
  296. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
  297. ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
  298. ShmSysConfigAndInfo->SysConfig.DefaultLanguage = DefaultLanguage;
  299. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
  300. ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
  301. if(strlen(SystemDateTime)>0){
  302. char cmd[100];
  303. sprintf(cmd,"date -s '%s'",SystemDateTime);
  304. if(system(cmd)==0){
  305. system("hwclock -w");
  306. }
  307. }
  308. }
  309. if (strcmp(argv[1], "2") == 0) {
  310. struct json_object *jobj = json_tokener_parse(argv[2]);
  311. json_object *val_obj = NULL;
  312. int MaxChargingEnergy= 0;
  313. int MaxChargingPower = 0;
  314. int MaxChargingCurrent = 0;
  315. int MaxChargingDuration = 0;
  316. int PhaseLossPolicy = 0;
  317. char *LocalWhiteCard0 = NULL;
  318. char *LocalWhiteCard1 = NULL;
  319. char *LocalWhiteCard2 = NULL;
  320. char *LocalWhiteCard3 = NULL;
  321. char *LocalWhiteCard4 = NULL;
  322. char *LocalWhiteCard5 = NULL;
  323. char *LocalWhiteCard6 = NULL;
  324. char *LocalWhiteCard7 = NULL;
  325. char *LocalWhiteCard8 = NULL;
  326. char *LocalWhiteCard9 = NULL;
  327. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  328. MaxChargingEnergy = json_object_get_int(val_obj);
  329. }
  330. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  331. MaxChargingPower = json_object_get_int(val_obj);
  332. }
  333. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  334. MaxChargingCurrent = json_object_get_int(val_obj);
  335. }
  336. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  337. MaxChargingDuration = json_object_get_int(val_obj);
  338. }
  339. if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
  340. PhaseLossPolicy = json_object_get_int(val_obj);
  341. }
  342. if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
  343. LocalWhiteCard0 = json_object_get_string(val_obj);
  344. }
  345. if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
  346. LocalWhiteCard1 = json_object_get_string(val_obj);
  347. }
  348. if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
  349. LocalWhiteCard2 = json_object_get_string(val_obj);
  350. }
  351. if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
  352. LocalWhiteCard3 = json_object_get_string(val_obj);
  353. }
  354. if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
  355. LocalWhiteCard4 = json_object_get_string(val_obj);
  356. }
  357. if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
  358. LocalWhiteCard5 = json_object_get_string(val_obj);
  359. }
  360. if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
  361. LocalWhiteCard6 = json_object_get_string(val_obj);
  362. }
  363. if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
  364. LocalWhiteCard7 = json_object_get_string(val_obj);
  365. }
  366. if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
  367. LocalWhiteCard8 = json_object_get_string(val_obj);
  368. }
  369. if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
  370. LocalWhiteCard9 = json_object_get_string(val_obj);
  371. }
  372. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  373. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  374. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  375. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  376. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
  377. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
  378. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
  379. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
  380. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
  381. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
  382. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
  383. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
  384. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
  385. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
  386. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
  387. }
  388. if (strcmp(argv[1], "3") == 0) {
  389. struct json_object *jobj = json_tokener_parse(argv[2]);
  390. json_object *val_obj = NULL;
  391. char *FtpServer=NULL;
  392. int Eth0DhcpClient=0;
  393. char *Eth0IpAddress=NULL;
  394. char *Eth0SubmaskAddress=NULL;
  395. char *Eth0GatewayAddress=NULL;
  396. int Eth1DhcpClient=0;
  397. char *Eth1IpAddress=NULL;
  398. char *Eth1SubmaskAddress=NULL;
  399. char *Eth1GatewayAddress=NULL;
  400. int WifiMode=0;
  401. char *WifiSsid=NULL;
  402. char *WifiPassword=NULL;
  403. int WifiDhcpServer=0;
  404. int WifiDhcpClient=0;
  405. char *WifiIpAddress=NULL;
  406. char *WifiSubmaskAddress=NULL;
  407. char *WifiGatewayAddress=NULL;
  408. char *TelcomApn=NULL;
  409. char *TelcomChapPapId=NULL;
  410. char *TelcomChapPapPwd=NULL;
  411. char *TelcomIpAddress=NULL;
  412. if( json_object_object_get_ex(jobj, "FtpServer", &val_obj) ) {
  413. FtpServer = json_object_get_string(val_obj);
  414. }
  415. if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
  416. Eth0DhcpClient = json_object_get_int(val_obj);
  417. }
  418. if( json_object_object_get_ex(jobj, "Eth0IpAddress", &val_obj) ) {
  419. Eth0IpAddress = json_object_get_string(val_obj);
  420. }
  421. if( json_object_object_get_ex(jobj, "Eth0SubmaskAddress", &val_obj) ) {
  422. Eth0SubmaskAddress = json_object_get_string(val_obj);
  423. }
  424. if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
  425. Eth0GatewayAddress = json_object_get_string(val_obj);
  426. }
  427. if( json_object_object_get_ex(jobj, "Eth1DhcpClient", &val_obj) ) {
  428. Eth1DhcpClient = json_object_get_int(val_obj);
  429. }
  430. if( json_object_object_get_ex(jobj, "Eth1IpAddress", &val_obj) ) {
  431. Eth1IpAddress = json_object_get_string(val_obj);
  432. }
  433. if( json_object_object_get_ex(jobj, "Eth1SubmaskAddress", &val_obj) ) {
  434. Eth1SubmaskAddress = json_object_get_string(val_obj);
  435. }
  436. if( json_object_object_get_ex(jobj, "Eth1GatewayAddress", &val_obj) ) {
  437. Eth1GatewayAddress = json_object_get_string(val_obj);
  438. }
  439. if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
  440. WifiMode = json_object_get_int(val_obj);
  441. }
  442. if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
  443. WifiSsid = json_object_get_string(val_obj);
  444. }
  445. if( json_object_object_get_ex(jobj, "WifiPassword", &val_obj) ) {
  446. WifiPassword = json_object_get_string(val_obj);
  447. }
  448. if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
  449. WifiDhcpServer = json_object_get_int(val_obj);
  450. }
  451. if( json_object_object_get_ex(jobj, "WifiDhcpClient", &val_obj) ) {
  452. WifiDhcpClient = json_object_get_int(val_obj);
  453. }
  454. if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
  455. WifiIpAddress = json_object_get_string(val_obj);
  456. }
  457. if( json_object_object_get_ex(jobj, "WifiSubmaskAddress", &val_obj) ) {
  458. WifiSubmaskAddress = json_object_get_string(val_obj);
  459. }
  460. if( json_object_object_get_ex(jobj, "WifiGatewayAddress", &val_obj) ) {
  461. WifiGatewayAddress = json_object_get_string(val_obj);
  462. }
  463. if( json_object_object_get_ex(jobj, "TelcomApn", &val_obj) ) {
  464. TelcomApn = json_object_get_string(val_obj);
  465. }
  466. if( json_object_object_get_ex(jobj, "TelcomChapPapId", &val_obj) ) {
  467. TelcomChapPapId = json_object_get_string(val_obj);
  468. }
  469. if( json_object_object_get_ex(jobj, "TelcomChapPapPwd", &val_obj) ) {
  470. TelcomChapPapPwd = json_object_get_string(val_obj);
  471. }
  472. if( json_object_object_get_ex(jobj, "TelcomIpAddress", &val_obj) ) {
  473. TelcomIpAddress = json_object_get_string(val_obj);
  474. }
  475. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer,FtpServer);
  476. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=Eth0DhcpClient;
  477. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,Eth0IpAddress);
  478. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,Eth0SubmaskAddress);
  479. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,Eth0GatewayAddress);
  480. ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=Eth1DhcpClient;
  481. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,Eth1IpAddress);
  482. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,Eth1SubmaskAddress);
  483. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,Eth1GatewayAddress);
  484. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
  485. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
  486. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
  487. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=WifiDhcpServer;
  488. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=WifiDhcpClient;
  489. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,WifiIpAddress);
  490. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,WifiSubmaskAddress);
  491. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,WifiGatewayAddress);
  492. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,TelcomApn);
  493. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,TelcomChapPapId);
  494. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,TelcomChapPapPwd);
  495. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
  496. }
  497. if (strcmp(argv[1], "4") == 0) {
  498. struct json_object *jobj = json_tokener_parse(argv[2]);
  499. json_object *val_obj = NULL;
  500. int BackendConnTimeout=0;
  501. int OfflinePolicy=0;
  502. int OfflineMaxChargeEnergy=0;
  503. int OfflineMaxChargeDuration=0;
  504. char *OcppServerURL=NULL;
  505. char *ChargeBoxId=NULL;
  506. if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
  507. BackendConnTimeout = json_object_get_int(val_obj);
  508. }
  509. if( json_object_object_get_ex(jobj, "OfflinePolicy", &val_obj) ) {
  510. OfflinePolicy = json_object_get_int(val_obj);
  511. }
  512. if( json_object_object_get_ex(jobj, "OfflineMaxChargeEnergy", &val_obj) ) {
  513. OfflineMaxChargeEnergy = json_object_get_int(val_obj);
  514. }
  515. if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
  516. OfflineMaxChargeDuration = json_object_get_int(val_obj);
  517. }
  518. if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
  519. OcppServerURL = json_object_get_string(val_obj);
  520. }
  521. if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
  522. ChargeBoxId = json_object_get_string(val_obj);
  523. }
  524. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
  525. ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
  526. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
  527. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
  528. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
  529. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
  530. }
  531. StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
  532. #ifdef SystemLogMessage
  533. DEBUG_INFO("WebServiceConfig update OK");
  534. #endif
  535. }
  536. if (argc == 2) { //init share memory for test
  537. if (strcmp(argv[1], "aaa") == 0) {
  538. struct SysConfigData SysConfig;
  539. //system
  540. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DSLU122110T1P0");
  541. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber, "SerialNumber");
  542. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId, "1234567890");
  543. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemDateTime, "2019-12-31 23:59:59");
  544. ShmSysConfigAndInfo->SysConfig.AcPhaseCount=1;
  545. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration=0;
  546. ShmSysConfigAndInfo->SysConfig.AuthorisationMode=0;
  547. ShmSysConfigAndInfo->SysConfig.DefaultLanguage=0;
  548. ShmSysConfigAndInfo->SysInfo.InputVoltageR=0;
  549. ShmSysConfigAndInfo->SysInfo.InputVoltageS=0;
  550. ShmSysConfigAndInfo->SysInfo.InputVoltageT=0;
  551. ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed=0;
  552. ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed=0;
  553. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian=0;
  554. ShmSysConfigAndInfo->SysConfig.PsuAcInputType=0;
  555. ShmSysConfigAndInfo->SysInfo.AuxPower5V=0;
  556. ShmSysConfigAndInfo->SysInfo.AuxPower12V=0;
  557. ShmSysConfigAndInfo->SysInfo.AuxPower24V=0;
  558. ShmSysConfigAndInfo->SysInfo.AuxPower48V=0;
  559. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev, "");
  560. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev, "");
  561. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev, "");
  562. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "");
  563. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, "");
  564. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev, "");
  565. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev, "");
  566. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev, "");
  567. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev, "");
  568. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev, "");
  569. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev, "");
  570. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev, "");
  571. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev, "");
  572. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev, "");
  573. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev, "");
  574. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev, "");
  575. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev, "");
  576. ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp=0;
  577. ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp=0;
  578. ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp=0;
  579. ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp=0;
  580. ShmSysConfigAndInfo->SysConfig.AcPlugInTimes=0;
  581. ShmSysConfigAndInfo->SysConfig.GbPlugInTimes=0;
  582. ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime=0;
  583. ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes=0;
  584. ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes=0;
  585. //charging
  586. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=0;
  587. ShmSysConfigAndInfo->SysConfig.MaxChargingPower=0;
  588. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent= 0;
  589. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=0;
  590. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy=0;
  591. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0], "111");
  592. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1], "222");
  593. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2], "333");
  594. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3], "444");
  595. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4], "555");
  596. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5], "666");
  597. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6], "777");
  598. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7], "888");
  599. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8], "999");
  600. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9], "aaa");
  601. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.UserId, "UserId");
  602. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingVoltage=0;
  603. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingCurrent=0;
  604. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingPower=0;
  605. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedEnergy=0;
  606. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedDuration=0;
  607. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].RemainChargingDuration=0;
  608. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatteryMaxVoltage=0;
  609. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetVoltage=0;
  610. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterySoc=0;
  611. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].SystemStatus=1;
  612. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].Index=0;
  613. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].Type=0;
  614. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].type_index=0;
  615. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetCurrent=1;
  616. //network
  617. ShmSysConfigAndInfo->SysInfo.InternetConn=0;
  618. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer,"");
  619. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=1;
  620. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress,"");
  621. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,"192.168.1.10");
  622. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
  623. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,"192.168.1.1");
  624. ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=1;
  625. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress,"");
  626. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,"192.168.0.10");
  627. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
  628. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,"192.168.0.1");
  629. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=1;
  630. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,"");
  631. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,"");
  632. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi=0;
  633. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=0;
  634. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=0;
  635. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress,"");
  636. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,"");
  637. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,"");
  638. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,"");
  639. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,"");
  640. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=0;
  641. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,"");
  642. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,"");
  643. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei,"");
  644. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi,"");
  645. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid,"");
  646. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
  647. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=0;
  648. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,"");
  649. //backend
  650. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout=300;
  651. ShmSysConfigAndInfo->SysConfig.OfflinePolicy=0;
  652. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy=0;
  653. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration=0;
  654. ShmSysConfigAndInfo->SysInfo.OcppConnStatus=0;
  655. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"");
  656. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,"");
  657. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=0;
  658. StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
  659. #ifdef SystemLogMessage
  660. DEBUG_INFO("WebService initial OK");
  661. #endif
  662. }
  663. if (strcmp(argv[1], "log") == 0) {
  664. time_t tt = time(0); //獲取當前時間
  665. int year,month;
  666. char cmd[100];
  667. struct tm *pst = localtime(&tt); //把time_t類型轉換為struct tm類型
  668. year = pst->tm_year + 1900;
  669. month = pst->tm_mon + 1;
  670. sprintf(cmd,"cp /mnt/%04d-%02d.zip /var/www/log.zip",year,month);
  671. if(system("exec /root/logPackTools 'log'")==0){
  672. system(cmd);
  673. }
  674. }
  675. }
  676. //upgrade firmware
  677. if ((argc == 3) & (strcmp(argv[1], "upgrade") == 0)) {
  678. struct json_object *jobj;
  679. struct json_object *Result;
  680. struct json_object *Message;
  681. char cmd[100];
  682. jobj=json_object_new_object();
  683. //system
  684. //if((char)ShmSysConfigAndInfo->SysInfo.FirmwareUpdate == '0'){
  685. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=1;
  686. Result = json_object_new_string("success");
  687. Message = json_object_new_string("file is uploaded");
  688. //}
  689. /*else{
  690. sprintf(cmd,"rm /mnt/%s",argv[2]);
  691. system(cmd);
  692. Result = json_object_new_string("error");
  693. Message = json_object_new_string("machine is busy");
  694. }*/
  695. json_object_object_add(jobj,"Result",Result);
  696. json_object_object_add(jobj,"Message",Message);
  697. printf("%s\n", json_object_to_json_string(jobj));
  698. }
  699. //web page query all
  700. if ((argc == 2) & (strcmp(argv[1], "query") == 0)) {
  701. char *IsAcDc[2];
  702. char *Connector1[2];
  703. char *Connector2[2];
  704. char *Connector3[2];
  705. char *Network[2];
  706. substr((char *)IsAcDc,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,1);
  707. substr((char *)Connector1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,7,1);
  708. substr((char *)Connector2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
  709. substr((char *)Connector3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
  710. substr((char *)Network,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,10,1);
  711. int connectorType1,connectorType2,connectorType3;
  712. connectorType1=ConnectorType((char *)Connector1);
  713. connectorType2=ConnectorType((char *)Connector2);
  714. connectorType3=ConnectorType((char *)Connector3);
  715. // modelType=ModelType((char *)IsAcDc,(char *)Network);
  716. // printf("modelType:%d\n",modelType);
  717. struct json_object *jobj1;
  718. struct json_object *jobj2;
  719. struct json_object *jobj3;
  720. struct json_object *jobj4;
  721. // struct json_object *array_obj;
  722. //system
  723. struct json_object *ModelName;
  724. struct json_object *SerialNumber;
  725. struct json_object *SystemId;
  726. // struct json_object *SystemDateTime;
  727. struct json_object *AcPhaseCount;
  728. struct json_object *FactoryConfiguration;
  729. struct json_object *AuthorisationMode;
  730. struct json_object *DefaultLanguage;
  731. struct json_object *InputVoltageR;
  732. struct json_object *InputVoltageS;
  733. struct json_object *InputVoltageT;
  734. struct json_object *SystemFanRotaSpeed;
  735. struct json_object *PsuFanRotaSpeed;
  736. struct json_object *RfidCardNumEndian;
  737. struct json_object *PsuAcInputType;
  738. struct json_object *AuxPower5V;
  739. struct json_object *AuxPower12V;
  740. struct json_object *AuxPower24V;
  741. struct json_object *AuxPower48V;
  742. struct json_object *CsuHwRev;
  743. struct json_object *CsuBootLoadFwRev;
  744. struct json_object *CsuKernelFwRev;
  745. struct json_object *CsuRootFsFwRev;
  746. struct json_object *CsuPrimFwRev;
  747. struct json_object *LcmHwRev;
  748. struct json_object *LcmFwRev;
  749. struct json_object *PsuHwRev;
  750. struct json_object *PsuPrimFwRev;
  751. struct json_object *PsuSecFwRev;
  752. struct json_object *AuxPwrHwRev;
  753. struct json_object *AuxPwrFwRev;
  754. struct json_object *FanModuleHwRev;
  755. struct json_object *FanModuleFwRev;
  756. struct json_object *RelayModuleHwRev;
  757. struct json_object *RelayModuleFwRev;
  758. struct json_object *TelcomModemFwRev;
  759. struct json_object *SystemAmbientTemp;
  760. struct json_object *SystemCriticalTemp;
  761. struct json_object *CcsConnectorTemp;
  762. struct json_object *PsuAmbientTemp;
  763. struct json_object *AcPlugInTimes;
  764. struct json_object *GbPlugInTimes;
  765. struct json_object *Ccs1PlugInTime;
  766. struct json_object *Ccs2PlugInTimes;
  767. struct json_object *ChademoPlugInTimes;
  768. struct json_object *FirmwareUpdate;
  769. //charging
  770. struct json_object *MaxChargingEnergy;
  771. struct json_object *MaxChargingPower;
  772. struct json_object *MaxChargingCurrent;
  773. struct json_object *MaxChargingDuration;
  774. struct json_object *PhaseLossPolicy;
  775. struct json_object *LocalWhiteCard[10];
  776. struct json_object *LocalWhiteCardArr= json_object_new_array();
  777. // struct json_object *CcsAuthentication;
  778. // struct json_object *AcCcsChargingMode;
  779. struct json_object *UserId;
  780. struct json_object *ChargingInfo1;
  781. struct json_object *ChargingInfo2;
  782. struct json_object *ChargingInfo3;
  783. struct json_object *CardNumber[3];
  784. struct json_object *StartUserId[3];
  785. struct json_object *StartDateTime[3];
  786. struct json_object *StopDateTime[3];
  787. struct json_object *StartMethod[3];
  788. struct json_object *ConnectorTemp[3];
  789. struct json_object *PresentChargingVoltage[3];
  790. struct json_object *PresentChargingCurrent[3];
  791. struct json_object *PresentChargingPower[3];
  792. struct json_object *PresentChargedEnergy[3];
  793. struct json_object *PresentChargedDuration[3];
  794. struct json_object *RemainChargingDuration[3];
  795. struct json_object *EvBatteryMaxVoltage[3];
  796. struct json_object *EvBatterytargetVoltage[3];
  797. struct json_object *EvBatterySoc[3];
  798. struct json_object *SystemStatus[3];
  799. struct json_object *Index[3];
  800. struct json_object *Type[3];
  801. struct json_object *type_index[3];
  802. struct json_object *EvBatterytargetCurrent[3];
  803. //network
  804. struct json_object *InternetConn;
  805. struct json_object *FtpServer;
  806. struct json_object *Eth0DhcpClient;
  807. struct json_object *Eth0MacAddress;
  808. struct json_object *Eth0IpAddress;
  809. struct json_object *Eth0SubmaskAddress;
  810. struct json_object *Eth0GatewayAddress;
  811. struct json_object *Eth1DhcpClient;
  812. struct json_object *Eth1MacAddress;
  813. struct json_object *Eth1IpAddress;
  814. struct json_object *Eth1SubmaskAddress;
  815. struct json_object *Eth1GatewayAddress;
  816. struct json_object *WifiMode;
  817. struct json_object *WifiSsid;
  818. struct json_object *WifiPassword;
  819. struct json_object *WifiRssi;
  820. struct json_object *WifiDhcpServer;
  821. struct json_object *WifiDhcpClient;
  822. struct json_object *WifiMacAddress;
  823. struct json_object *WifiIpAddress;
  824. struct json_object *WifiSubmaskAddress;
  825. struct json_object *WifiGatewayAddress;
  826. struct json_object *WifiNetworkConn;
  827. struct json_object *TelcomApn;
  828. struct json_object *TelcomRssi;
  829. struct json_object *TelcomChapPapId;
  830. struct json_object *TelcomChapPapPwd;
  831. struct json_object *TelcomModemImei;
  832. struct json_object *TelcomSimImsi;
  833. struct json_object *TelcomSimIccid;
  834. struct json_object *TelcomSimStatus;
  835. struct json_object *TelcomModemMode;
  836. struct json_object *TelcomIpAddress;
  837. struct json_object *TelcomNetworkConn;
  838. //backend
  839. struct json_object *BackendConnTimeout;
  840. struct json_object *OfflinePolicy;
  841. struct json_object *OfflineMaxChargeEnergy;
  842. struct json_object *OfflineMaxChargeDuration;
  843. struct json_object *OcppConnStatus;
  844. struct json_object *OcppServerURL;
  845. struct json_object *ChargeBoxId;
  846. // array_obj = json_object_new_array();
  847. jobj1=json_object_new_object();
  848. jobj2=json_object_new_object();
  849. jobj3=json_object_new_object();
  850. jobj4=json_object_new_object();
  851. //system
  852. ModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ModelName);
  853. SerialNumber = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber);
  854. SystemId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SystemId);
  855. // SystemDateTime = json_object_new_string(ShmSysConfigAndInfo->SysConfig.SystemDateTime);
  856. AcPhaseCount = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPhaseCount);
  857. FactoryConfiguration = json_object_new_int(ShmSysConfigAndInfo->SysInfo.FactoryConfiguration);
  858. AuthorisationMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
  859. DefaultLanguage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.DefaultLanguage);
  860. InputVoltageR = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageR);
  861. InputVoltageS = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageS);
  862. InputVoltageT = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageT);
  863. SystemFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed);
  864. PsuFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed);
  865. RfidCardNumEndian = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
  866. PsuAcInputType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PsuAcInputType);
  867. AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
  868. AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
  869. AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
  870. AuxPower48V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower48V);
  871. CsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
  872. CsuBootLoadFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
  873. CsuKernelFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
  874. CsuRootFsFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
  875. CsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
  876. LcmHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
  877. LcmFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
  878. PsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
  879. PsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
  880. PsuSecFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
  881. AuxPwrHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
  882. AuxPwrFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
  883. FanModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
  884. FanModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
  885. RelayModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
  886. RelayModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
  887. TelcomModemFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
  888. SystemAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
  889. SystemCriticalTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
  890. CcsConnectorTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
  891. PsuAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp);
  892. AcPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPlugInTimes);
  893. GbPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.GbPlugInTimes);
  894. Ccs1PlugInTime = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime);
  895. Ccs2PlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes);
  896. ChademoPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes);
  897. FirmwareUpdate = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
  898. //charging
  899. int CcsGunQty=0;
  900. int GbGunQty=0;
  901. int CHAdeMOGunQty=0;
  902. int AcGunQty=0;
  903. ChargingInfo1=json_object_new_object();
  904. ChargingInfo2=json_object_new_object();
  905. ChargingInfo3=json_object_new_object();
  906. MaxChargingEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
  907. MaxChargingPower = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
  908. MaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
  909. MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
  910. PhaseLossPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy);
  911. LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
  912. LocalWhiteCard[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
  913. LocalWhiteCard[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
  914. LocalWhiteCard[3] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
  915. LocalWhiteCard[4] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
  916. LocalWhiteCard[5] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
  917. LocalWhiteCard[6] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
  918. LocalWhiteCard[7] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
  919. LocalWhiteCard[8] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
  920. LocalWhiteCard[9] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
  921. UserId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.UserId);
  922. if(connectorType1 != 0){
  923. if(connectorType1 == 1){//CCS
  924. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  925. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  926. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  927. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  928. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  929. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  930. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  931. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  932. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  933. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  934. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  935. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  936. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  937. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  938. CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].CardNumber);
  939. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  940. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  941. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  942. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  943. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  944. CcsGunQty++;
  945. }
  946. else if(connectorType1 == 2){//GB
  947. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  948. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  949. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  950. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  951. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  952. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  953. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  954. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  955. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  956. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  957. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  958. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  959. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  960. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  961. CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].CardNumber);
  962. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  963. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  964. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  965. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  966. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  967. GbGunQty++;
  968. }
  969. else if(connectorType1 == 3){//CHAdeMO
  970. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  971. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  972. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  973. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  974. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  975. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  976. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  977. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  978. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  979. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  980. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  981. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  982. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  983. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  984. CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].CardNumber);
  985. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  986. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  987. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  988. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  989. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  990. CHAdeMOGunQty++;
  991. }
  992. else if(connectorType1 == 4){//AC
  993. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  994. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  995. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  996. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  997. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  998. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  999. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1000. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1001. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1002. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1003. Index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1004. Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1005. type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1006. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1007. CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].CardNumber);
  1008. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1009. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1010. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1011. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1012. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1013. AcGunQty++;
  1014. }
  1015. }
  1016. if(connectorType2 != 0){
  1017. if(connectorType2 == 1){//CCS
  1018. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1019. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1020. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1021. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1022. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1023. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1024. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1025. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1026. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1027. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1028. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1029. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1030. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1031. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1032. CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].CardNumber);
  1033. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1034. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1035. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1036. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1037. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1038. CcsGunQty++;
  1039. }
  1040. else if(connectorType2 == 2){//GB
  1041. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1042. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1043. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1044. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1045. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1046. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1047. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1048. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1049. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1050. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1051. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1052. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1053. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1054. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1055. CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].CardNumber);
  1056. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1057. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1058. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1059. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1060. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1061. GbGunQty++;
  1062. }
  1063. else if(connectorType2 == 3){//CHAdeMO
  1064. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1065. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1066. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1067. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1068. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1069. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1070. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1071. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1072. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1073. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1074. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1075. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1076. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1077. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1078. CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].CardNumber);
  1079. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1080. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1081. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1082. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1083. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1084. CHAdeMOGunQty++;
  1085. }
  1086. else if(connectorType2 == 4){//AC
  1087. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1088. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1089. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1090. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1091. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1092. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1093. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1094. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1095. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1096. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1097. Index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1098. Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1099. type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1100. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1101. CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].CardNumber);
  1102. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1103. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1104. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1105. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1106. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1107. AcGunQty++;
  1108. }
  1109. }
  1110. if(connectorType3 != 0){
  1111. if(connectorType3 == 1){//CCS
  1112. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1113. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1114. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1115. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1116. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1117. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1118. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1119. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1120. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1121. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1122. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index);
  1123. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
  1124. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
  1125. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1126. CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].CardNumber);
  1127. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1128. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1129. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1130. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1131. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1132. CcsGunQty++;
  1133. }
  1134. else if(connectorType3 == 2){//GB
  1135. PresentChargingVoltage[2]= json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1136. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1137. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1138. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1139. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1140. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1141. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1142. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1143. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1144. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1145. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Index);
  1146. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
  1147. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
  1148. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1149. CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].CardNumber);
  1150. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1151. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1152. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1153. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1154. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1155. GbGunQty++;
  1156. }
  1157. else if(connectorType3 == 3){//CHAdeMO
  1158. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1159. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1160. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1161. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1162. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1163. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1164. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1165. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1166. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1167. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1168. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Index);
  1169. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
  1170. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
  1171. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1172. CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].CardNumber);
  1173. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1174. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1175. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1176. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1177. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1178. CHAdeMOGunQty++;
  1179. }
  1180. else if(connectorType3 == 4){//AC
  1181. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1182. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1183. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1184. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1185. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1186. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1187. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1188. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1189. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1190. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1191. Index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Index);
  1192. Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
  1193. type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
  1194. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1195. CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].CardNumber);
  1196. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1197. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1198. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1199. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1200. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1201. AcGunQty++;
  1202. }
  1203. }
  1204. //network
  1205. InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
  1206. FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
  1207. Eth0DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient);
  1208. Eth0MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
  1209. Eth0IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
  1210. Eth0SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
  1211. Eth0GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
  1212. Eth1DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient);
  1213. Eth1MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
  1214. Eth1IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
  1215. Eth1SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
  1216. Eth1GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
  1217. WifiMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
  1218. WifiSsid = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
  1219. WifiPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
  1220. WifiRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
  1221. WifiDhcpServer = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer);
  1222. WifiDhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient);
  1223. WifiMacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
  1224. WifiIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
  1225. WifiSubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
  1226. WifiGatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
  1227. WifiNetworkConn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn);
  1228. TelcomApn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
  1229. TelcomRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
  1230. TelcomChapPapId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
  1231. TelcomChapPapPwd = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
  1232. TelcomModemImei = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
  1233. TelcomSimImsi = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
  1234. TelcomSimIccid = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid);
  1235. TelcomSimStatus = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus);
  1236. TelcomModemMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode);
  1237. TelcomIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
  1238. TelcomNetworkConn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn);
  1239. //backend
  1240. BackendConnTimeout = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
  1241. OfflinePolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
  1242. OfflineMaxChargeEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
  1243. OfflineMaxChargeDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
  1244. OcppConnStatus = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.OcppConnStatus,1);
  1245. OcppServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL);
  1246. ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
  1247. //system
  1248. json_object_object_add(jobj1,"ModelName",ModelName);
  1249. json_object_object_add(jobj1,"SerialNumber",SerialNumber);
  1250. json_object_object_add(jobj1,"SystemId",SystemId);
  1251. // json_object_object_add(jobj1,"SystemDateTime",SystemDateTime);
  1252. json_object_object_add(jobj1,"AcPhaseCount",AcPhaseCount);
  1253. json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
  1254. json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
  1255. json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
  1256. json_object_object_add(jobj1,"InputVoltageR",InputVoltageR);
  1257. json_object_object_add(jobj1,"InputVoltageS",InputVoltageS);
  1258. json_object_object_add(jobj1,"InputVoltageT",InputVoltageT);
  1259. json_object_object_add(jobj1,"SystemFanRotaSpeed",SystemFanRotaSpeed);
  1260. json_object_object_add(jobj1,"PsuFanRotaSpeed",PsuFanRotaSpeed);
  1261. json_object_object_add(jobj1,"RfidCardNumEndian",RfidCardNumEndian);
  1262. json_object_object_add(jobj1,"PsuAcInputType",PsuAcInputType);
  1263. json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
  1264. json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
  1265. json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
  1266. json_object_object_add(jobj1,"AuxPower48V",AuxPower48V);
  1267. json_object_object_add(jobj1,"CsuHwRev",CsuHwRev);
  1268. json_object_object_add(jobj1,"CsuBootLoadFwRev",CsuBootLoadFwRev);
  1269. json_object_object_add(jobj1,"CsuKernelFwRev",CsuKernelFwRev);
  1270. json_object_object_add(jobj1,"CsuRootFsFwRev",CsuRootFsFwRev);
  1271. json_object_object_add(jobj1,"CsuPrimFwRev",CsuPrimFwRev);
  1272. json_object_object_add(jobj1,"LcmHwRev",LcmHwRev);
  1273. json_object_object_add(jobj1,"LcmFwRev",LcmFwRev);
  1274. json_object_object_add(jobj1,"PsuHwRev",PsuHwRev);
  1275. json_object_object_add(jobj1,"PsuPrimFwRev",PsuPrimFwRev);
  1276. json_object_object_add(jobj1,"PsuSecFwRev",PsuSecFwRev);
  1277. json_object_object_add(jobj1,"AuxPwrHwRev",AuxPwrHwRev);
  1278. json_object_object_add(jobj1,"AuxPwrFwRev",AuxPwrFwRev);
  1279. json_object_object_add(jobj1,"FanModuleHwRev",FanModuleHwRev);
  1280. json_object_object_add(jobj1,"FanModuleFwRev",FanModuleFwRev);
  1281. json_object_object_add(jobj1,"RelayModuleHwRev",RelayModuleHwRev);
  1282. json_object_object_add(jobj1,"RelayModuleFwRev",RelayModuleFwRev);
  1283. json_object_object_add(jobj1,"TelcomModemFwRev",TelcomModemFwRev);
  1284. json_object_object_add(jobj1,"SystemAmbientTemp",SystemAmbientTemp);
  1285. json_object_object_add(jobj1,"SystemCriticalTemp",SystemCriticalTemp);
  1286. json_object_object_add(jobj1,"CcsConnectorTemp",CcsConnectorTemp);
  1287. json_object_object_add(jobj1,"PsuAmbientTemp",PsuAmbientTemp);
  1288. json_object_object_add(jobj1,"AcPlugInTimes",AcPlugInTimes);
  1289. json_object_object_add(jobj1,"GbPlugInTimes",GbPlugInTimes);
  1290. json_object_object_add(jobj1,"Ccs1PlugInTimes",Ccs1PlugInTime);
  1291. json_object_object_add(jobj1,"Ccs2PlugInTimes",Ccs2PlugInTimes);
  1292. json_object_object_add(jobj1,"ChademoPlugInTimes",ChademoPlugInTimes);
  1293. json_object_object_add(jobj1,"FirmwareUpdate",FirmwareUpdate);
  1294. printf("%s\n", json_object_to_json_string(jobj1));
  1295. json_object_put(jobj1);
  1296. //charging
  1297. json_object_object_add(jobj2,"MaxChargingEnergy",MaxChargingEnergy);
  1298. json_object_object_add(jobj2,"MaxChargingPower",MaxChargingPower);
  1299. json_object_object_add(jobj2,"MaxChargingCurrent",MaxChargingCurrent);
  1300. json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
  1301. json_object_object_add(jobj2,"PhaseLossPolicy",PhaseLossPolicy);
  1302. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
  1303. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
  1304. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);
  1305. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[3]);
  1306. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[4]);
  1307. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[5]);
  1308. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[6]);
  1309. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[7]);
  1310. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[8]);
  1311. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[9]);
  1312. json_object_object_add(jobj2,"LocalWhiteCard",LocalWhiteCardArr);
  1313. // json_object_object_add(jobj2,"CcsAuthentication",CcsAuthentication);
  1314. // json_object_object_add(jobj2,"AcCcsChargingMode",AcCcsChargingMode);
  1315. if(connectorType1 != 0){
  1316. json_object_object_add(ChargingInfo1,"CardNumber",CardNumber[0]);
  1317. json_object_object_add(ChargingInfo1,"StartUserId",StartUserId[0]);
  1318. json_object_object_add(ChargingInfo1,"StartDateTime",StartDateTime[0]);
  1319. json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
  1320. json_object_object_add(ChargingInfo1,"StartMethod",StartMethod[0]);
  1321. json_object_object_add(ChargingInfo1,"ConnectorTemp",ConnectorTemp[0]);
  1322. json_object_object_add(ChargingInfo1,"PresentChargingVoltage",PresentChargingVoltage[0]);
  1323. json_object_object_add(ChargingInfo1,"PresentChargingCurrent",PresentChargingCurrent[0]);
  1324. json_object_object_add(ChargingInfo1,"PresentChargingPower",PresentChargingPower[0]);
  1325. json_object_object_add(ChargingInfo1,"PresentChargedEnergy",PresentChargedEnergy[0]);
  1326. json_object_object_add(ChargingInfo1,"PresentChargedDuration",PresentChargedDuration[0]);
  1327. json_object_object_add(ChargingInfo1,"RemainChargingDuration",RemainChargingDuration[0]);
  1328. json_object_object_add(ChargingInfo1,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[0]);
  1329. json_object_object_add(ChargingInfo1,"EvBatterytargetVoltage",EvBatterytargetVoltage[0]);
  1330. json_object_object_add(ChargingInfo1,"EvBatterySoc",EvBatterySoc[0]);
  1331. json_object_object_add(ChargingInfo1,"SystemStatus",SystemStatus[0]);
  1332. json_object_object_add(ChargingInfo1,"Index",Index[0]);
  1333. json_object_object_add(ChargingInfo1,"Type",Type[0]);
  1334. json_object_object_add(ChargingInfo1,"type_index",type_index[0]);
  1335. json_object_object_add(ChargingInfo1,"EvBatterytargetCurrent",EvBatterytargetCurrent[0]);
  1336. json_object_object_add(jobj2,"ChargingInfo1",ChargingInfo1);
  1337. }
  1338. if(connectorType2 != 0){
  1339. json_object_object_add(ChargingInfo2,"CardNumber",CardNumber[1]);
  1340. json_object_object_add(ChargingInfo2,"StartUserId",StartUserId[1]);
  1341. json_object_object_add(ChargingInfo2,"StartDateTime",StartDateTime[1]);
  1342. json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
  1343. json_object_object_add(ChargingInfo2,"StartMethod",StartMethod[1]);
  1344. json_object_object_add(ChargingInfo2,"ConnectorTemp",ConnectorTemp[1]);
  1345. json_object_object_add(ChargingInfo2,"PresentChargingVoltage",PresentChargingVoltage[1]);
  1346. json_object_object_add(ChargingInfo2,"PresentChargingCurrent",PresentChargingCurrent[1]);
  1347. json_object_object_add(ChargingInfo2,"PresentChargingPower",PresentChargingPower[1]);
  1348. json_object_object_add(ChargingInfo2,"PresentChargedEnergy",PresentChargedEnergy[1]);
  1349. json_object_object_add(ChargingInfo2,"PresentChargedDuration",PresentChargedDuration[1]);
  1350. json_object_object_add(ChargingInfo2,"RemainChargingDuration",RemainChargingDuration[1]);
  1351. json_object_object_add(ChargingInfo2,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[1]);
  1352. json_object_object_add(ChargingInfo2,"EvBatterytargetVoltage",EvBatterytargetVoltage[1]);
  1353. json_object_object_add(ChargingInfo2,"EvBatterySoc",EvBatterySoc[1]);
  1354. json_object_object_add(ChargingInfo2,"SystemStatus",SystemStatus[1]);
  1355. json_object_object_add(ChargingInfo2,"Index",Index[1]);
  1356. json_object_object_add(ChargingInfo2,"Type",Type[1]);
  1357. json_object_object_add(ChargingInfo2,"type_index",type_index[1]);
  1358. json_object_object_add(ChargingInfo2,"EvBatterytargetCurrent",EvBatterytargetCurrent[1]);
  1359. json_object_object_add(jobj2,"ChargingInfo2",ChargingInfo2);
  1360. }
  1361. if(connectorType3 != 0){
  1362. json_object_object_add(ChargingInfo3,"CardNumber",CardNumber[2]);
  1363. json_object_object_add(ChargingInfo3,"StartUserId",StartUserId[2]);
  1364. json_object_object_add(ChargingInfo3,"StartDateTime",StartDateTime[2]);
  1365. json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);
  1366. json_object_object_add(ChargingInfo3,"StartMethod",StartMethod[2]);
  1367. json_object_object_add(ChargingInfo3,"ConnectorTemp",ConnectorTemp[2]);
  1368. json_object_object_add(ChargingInfo3,"PresentChargingVoltage",PresentChargingVoltage[2]);
  1369. json_object_object_add(ChargingInfo3,"PresentChargingCurrent",PresentChargingCurrent[2]);
  1370. json_object_object_add(ChargingInfo3,"PresentChargingPower",PresentChargingPower[2]);
  1371. json_object_object_add(ChargingInfo3,"PresentChargedEnergy",PresentChargedEnergy[2]);
  1372. json_object_object_add(ChargingInfo3,"PresentChargedDuration",PresentChargedDuration[2]);
  1373. json_object_object_add(ChargingInfo3,"RemainChargingDuration",RemainChargingDuration[2]);
  1374. json_object_object_add(ChargingInfo3,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[2]);
  1375. json_object_object_add(ChargingInfo3,"EvBatterytargetVoltage",EvBatterytargetVoltage[2]);
  1376. json_object_object_add(ChargingInfo3,"EvBatterySoc",EvBatterySoc[2]);
  1377. json_object_object_add(ChargingInfo3,"SystemStatus",SystemStatus[2]);
  1378. json_object_object_add(ChargingInfo3,"Index",Index[2]);
  1379. json_object_object_add(ChargingInfo3,"Type",Type[2]);
  1380. json_object_object_add(ChargingInfo3,"type_index",type_index[2]);
  1381. json_object_object_add(ChargingInfo3,"EvBatterytargetCurrent",EvBatterytargetCurrent[2]);
  1382. json_object_object_add(jobj2,"ChargingInfo3",ChargingInfo3);
  1383. }
  1384. printf("%s\n", json_object_to_json_string(jobj2));
  1385. json_object_put(jobj2);
  1386. //network
  1387. json_object_object_add(jobj3,"InternetConn",InternetConn);
  1388. json_object_object_add(jobj3,"FtpServer",FtpServer);
  1389. json_object_object_add(jobj3,"Eth0DhcpClient",Eth0DhcpClient);
  1390. json_object_object_add(jobj3,"Eth0MacAddress",Eth0MacAddress);
  1391. json_object_object_add(jobj3,"Eth0IpAddress",Eth0IpAddress);
  1392. json_object_object_add(jobj3,"Eth0SubmaskAddress",Eth0SubmaskAddress);
  1393. json_object_object_add(jobj3,"Eth0GatewayAddress",Eth0GatewayAddress);
  1394. json_object_object_add(jobj3,"Eth1DhcpClient",Eth1DhcpClient);
  1395. json_object_object_add(jobj3,"Eth1MacAddress",Eth1MacAddress);
  1396. json_object_object_add(jobj3,"Eth1IpAddress",Eth1IpAddress);
  1397. json_object_object_add(jobj3,"Eth1SubmaskAddress",Eth1SubmaskAddress);
  1398. json_object_object_add(jobj3,"Eth1GatewayAddress",Eth1GatewayAddress);
  1399. json_object_object_add(jobj3,"WifiMode",WifiMode);
  1400. json_object_object_add(jobj3,"WifiSsid",WifiSsid);
  1401. json_object_object_add(jobj3,"WifiPassword",WifiPassword);
  1402. json_object_object_add(jobj3,"WifiRssi",WifiRssi);
  1403. json_object_object_add(jobj3,"WifiDhcpServer",WifiDhcpServer);
  1404. json_object_object_add(jobj3,"WifiDhcpClient",WifiDhcpClient);
  1405. json_object_object_add(jobj3,"WifiMacAddress",WifiMacAddress);
  1406. json_object_object_add(jobj3,"WifiIpAddress",WifiIpAddress);
  1407. json_object_object_add(jobj3,"WifiSubmaskAddress",WifiSubmaskAddress);
  1408. json_object_object_add(jobj3,"WifiGatewayAddress",WifiGatewayAddress);
  1409. json_object_object_add(jobj3,"WifiNetworkConn",WifiNetworkConn);
  1410. json_object_object_add(jobj3,"TelcomApn",TelcomApn);
  1411. json_object_object_add(jobj3,"TelcomRssi",TelcomRssi);
  1412. json_object_object_add(jobj3,"TelcomChapPapId",TelcomChapPapId);
  1413. json_object_object_add(jobj3,"TelcomChapPapPwd",TelcomChapPapPwd);
  1414. json_object_object_add(jobj3,"TelcomModemImei",TelcomModemImei);
  1415. json_object_object_add(jobj3,"TelcomSimImsi",TelcomSimImsi);
  1416. json_object_object_add(jobj3,"TelcomSimIccid",TelcomSimIccid);
  1417. json_object_object_add(jobj3,"TelcomSimStatus",TelcomSimStatus);
  1418. json_object_object_add(jobj3,"TelcomModemMode",TelcomModemMode);
  1419. json_object_object_add(jobj3,"TelcomIpAddress",TelcomIpAddress);
  1420. json_object_object_add(jobj3,"TelcomNetworkConn",TelcomNetworkConn);
  1421. printf("%s\n", json_object_to_json_string(jobj3));
  1422. json_object_put(jobj3);
  1423. //backend
  1424. json_object_object_add(jobj4,"BackendConnTimeout",BackendConnTimeout);
  1425. json_object_object_add(jobj4,"OfflinePolicy",OfflinePolicy);
  1426. json_object_object_add(jobj4,"OfflineMaxChargeEnergy",OfflineMaxChargeEnergy);
  1427. json_object_object_add(jobj4,"OfflineMaxChargeDuration",OfflineMaxChargeDuration);
  1428. json_object_object_add(jobj4,"OcppConnStatus",OcppConnStatus);
  1429. json_object_object_add(jobj4,"OcppServerURL",OcppServerURL);
  1430. json_object_object_add(jobj4,"ChargeBoxId",ChargeBoxId);
  1431. printf("%s\n", json_object_to_json_string(jobj4));
  1432. json_object_put(jobj4);
  1433. }
  1434. // for(;;)
  1435. // {
  1436. // }
  1437. return FAIL;
  1438. }