WebService.c 102 KB

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