WebService.c 102 KB

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