WebService.c 161 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805
  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>
  20. #include <fcntl.h>
  21. #include <termios.h>
  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 0x300000
  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. struct PrimaryMcuData *ShmPrimaryMcuData;
  47. void trim(char *s);
  48. int mystrcmp(char *p1, char *p2);
  49. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
  50. void split(char **arr, char *str, const char *del);
  51. #ifdef SystemLogMessage
  52. int StoreLogMsg(const char *fmt, ...) {
  53. char Buf[4096 + 256];
  54. char buffer[4096];
  55. time_t CurrentTime;
  56. struct tm *tm;
  57. va_list args;
  58. va_start(args, fmt);
  59. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  60. va_end(args);
  61. memset(Buf, 0, sizeof(Buf));
  62. CurrentTime = time(NULL);
  63. tm = localtime(&CurrentTime);
  64. sprintf(Buf,
  65. "echo \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
  66. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  67. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  68. system(Buf);
  69. #ifdef Debug
  70. printf("[%04d.%02d.%02d %02d:%02d:%02d] - %s", tm->tm_year + 1900,
  71. tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
  72. buffer);
  73. #endif
  74. return rc;
  75. }
  76. int WriteLogMsg(const char *fmt, ...) {
  77. char Buf[4096 + 256];
  78. char buffer[4096];
  79. time_t CurrentTime;
  80. struct tm *tm;
  81. va_list args;
  82. va_start(args, fmt);
  83. int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
  84. va_end(args);
  85. memset(Buf, 0, sizeof(Buf));
  86. CurrentTime = time(NULL);
  87. tm = localtime(&CurrentTime);
  88. sprintf(Buf,
  89. "echo \"[%04d.%02d.%02d %02d:%02d:%02d WebService] - %s\" >> /Storage/SystemLog/[%04d.%02d]WebService_SystemLog",
  90. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
  91. tm->tm_min, tm->tm_sec, buffer, tm->tm_year + 1900, tm->tm_mon + 1);
  92. system(Buf);
  93. return rc;
  94. }
  95. #endif
  96. int runShellCmd(const char*cmd)
  97. {
  98. int result = FAIL;
  99. char buf[256];
  100. FILE *fp;
  101. fp = popen(cmd, "r");
  102. if(fp != NULL)
  103. {
  104. while(fgets(buf, sizeof(buf), fp) != NULL)
  105. {
  106. DEBUG_INFO("%s\n", buf);
  107. }
  108. result = PASS;
  109. }
  110. pclose(fp);
  111. return result;
  112. }
  113. int DiffTimeb(struct timeb ST, struct timeb ET) {
  114. //return milli-second
  115. unsigned int StartTime, StopTime;
  116. StartTime = (unsigned int) ST.time;
  117. StopTime = (unsigned int) ET.time;
  118. return (StopTime - StartTime) * 1000 + ET.millitm - ST.millitm;
  119. }
  120. //=================================
  121. // Common routine
  122. //=================================
  123. void trim(char *s) {
  124. int i = 0, j, k, l = 0;
  125. while ((s[i] == ' ') || (s[i] == '\t') || (s[i] == '\n'))
  126. i++;
  127. j = strlen(s) - 1;
  128. while ((s[j] == ' ') || (s[j] == '\t') || (s[j] == '\n'))
  129. j--;
  130. if (i == 0 && j == strlen(s) - 1) {
  131. } else if (i == 0)
  132. s[j + 1] = '\0';
  133. else {
  134. for (k = i; k <= j; k++)
  135. s[l++] = s[k];
  136. s[l] = '\0';
  137. }
  138. }
  139. int mystrcmp(char *p1, char *p2) {
  140. while (*p1 == *p2) {
  141. if (*p1 == '\0' || *p2 == '\0')
  142. break;
  143. p1++;
  144. p2++;
  145. }
  146. if (*p1 == '\0' && *p2 == '\0')
  147. return (PASS);
  148. else
  149. return (FAIL);
  150. }
  151. void substr(char *dest, const char* src, unsigned int start, unsigned int cnt) {
  152. strncpy(dest, src + start, cnt);
  153. dest[cnt] = 0;
  154. }
  155. void split(char **arr, char *str, const char *del) {
  156. char *s = strtok(str, del);
  157. while (s != NULL) {
  158. *arr++ = s;
  159. s = strtok(NULL, del);
  160. }
  161. }
  162. int ConnectorType(char* connector){
  163. int result;
  164. if(strcmp(connector, "0") == 0){
  165. result= 0;
  166. }
  167. else if(strcmp(connector, "U") == 0 || strcmp(connector, "V") == 0 || strcmp(connector, "E") == 0 || strcmp(connector, "F") == 0 || strcmp(connector, "T") == 0 || strcmp(connector, "D") == 0 || strcmp(connector, "M") == 0 || strcmp(connector, "N") == 0 || strcmp(connector, "P") == 0 || strcmp(connector, "R") == 0){
  168. result= 1;//CCS
  169. }
  170. else if(strcmp(connector, "G") == 0 || strcmp(connector, "B") == 0){
  171. result= 2;//GB
  172. }
  173. else if(strcmp(connector, "J") == 0 || strcmp(connector, "K") == 0){
  174. result= 3;//CHAdeMO
  175. }
  176. 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 || strcmp(connector, "7") == 0 || strcmp(connector, "8") == 0){
  177. result= 4;//AC
  178. }
  179. else{
  180. result= 0;
  181. }
  182. return result;
  183. }
  184. int ModelType(char* type,char* network){
  185. int result=0;
  186. if(strcmp(type, "A") == 0){
  187. if(strcmp(network, "0") == 0 || strcmp(network, "R") == 0 || strcmp(network, "B") == 0){
  188. result=0;
  189. }
  190. else if(strcmp(network, "E") == 0 || strcmp(network, "W") == 0 || strcmp(network, "T") == 0 || strcmp(network, "U") == 0){
  191. result=1;
  192. }
  193. }
  194. else if(strcmp(type, "D") == 0){
  195. result=2;
  196. }
  197. return result;
  198. }
  199. // 四捨五入 取到 小數點第 2 位
  200. float rounding(float a)
  201. {
  202. return (int)(a*100+0.5)/100.0;
  203. }
  204. //==========================================
  205. // Init all share memory
  206. //==========================================
  207. int InitShareMemory() {
  208. int result = PASS;
  209. int MeterSMId;
  210. //creat ShmSysConfigAndInfo
  211. if ((MeterSMId = shmget(ShmSysConfigAndInfoKey,
  212. sizeof(struct SysConfigAndInfo), 0777)) < 0) {
  213. printf("%s\n","InitShareMemory Error");
  214. #ifdef SystemLogMessage
  215. DEBUG_ERROR("shmget ShmSysConfigAndInfo NG\n");
  216. #endif
  217. result = FAIL;
  218. } else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0))
  219. == (void *) -1) {
  220. #ifdef SystemLogMessage
  221. DEBUG_ERROR("shmat ShmSysConfigAndInfo NG\n");
  222. #endif
  223. result = FAIL;
  224. } else {
  225. }
  226. //creat ShmStatusCodeData
  227. if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),
  228. 0777)) < 0) {
  229. #ifdef SystemLogMessage
  230. DEBUG_ERROR("shmget ShmStatusCodeData NG\n");
  231. #endif
  232. result = FAIL;
  233. } else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  234. #ifdef SystemLogMessage
  235. DEBUG_ERROR("shmat ShmStatusCodeData NG\n");
  236. #endif
  237. result = FAIL;
  238. } else {
  239. }
  240. //creat ShmPsuData
  241. if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData),
  242. 0777)) < 0) {
  243. #ifdef SystemLogMessage
  244. DEBUG_ERROR("shmget ShmPsuData NG\n");
  245. #endif
  246. result = FAIL;
  247. } else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  248. #ifdef SystemLogMessage
  249. DEBUG_ERROR("shmat ShmPsuData NG\n");
  250. #endif
  251. result = FAIL;
  252. } else {
  253. }
  254. //creat ShmPrimaryMcuData
  255. if ((MeterSMId = shmget(ShmPrimaryMcuKey, sizeof(struct PrimaryMcuData),
  256. 0777)) < 0) {
  257. #ifdef SystemLogMessage
  258. DEBUG_ERROR("shmget ShmPrimaryMcuData NG\n");
  259. #endif
  260. result = FAIL;
  261. } else if ((ShmPrimaryMcuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
  262. #ifdef SystemLogMessage
  263. DEBUG_ERROR("shmat ShmPrimaryMcuData NG\n");
  264. #endif
  265. result = FAIL;
  266. } else {
  267. }
  268. return result;
  269. }
  270. int StoreUsrConfigData(struct SysConfigData *UsrData)
  271. {
  272. int result = PASS;
  273. int fd,wrd;
  274. unsigned int i,Chk;
  275. unsigned char *ptr, *BufTmp;
  276. Chk=0;
  277. ptr=(unsigned char *)UsrData;
  278. if((BufTmp=malloc(MtdBlockSize))!=NULL)
  279. {
  280. memset(BufTmp,0,MtdBlockSize);
  281. memcpy(BufTmp,ptr,sizeof(struct SysConfigData));
  282. for(i=ARRAY_SIZE(UsrData->CsuBootLoadFwRev);i<MtdBlockSize-4;i++)
  283. Chk+=*(BufTmp+i);
  284. memcpy(BufTmp+MtdBlockSize-4, &Chk, 4);
  285. // Output configuration to file.
  286. fd = open("/mnt/EvseConfig.bin", O_RDWR|O_CREAT);
  287. if (fd < 0)
  288. {
  289. DEBUG_ERROR("open /mnt/EvseConfig.bin NG\n");
  290. free(BufTmp);
  291. return 0;
  292. }
  293. wrd=write(fd, BufTmp, MtdBlockSize);
  294. close(fd);
  295. if(wrd<MtdBlockSize)
  296. {
  297. DEBUG_ERROR("write /mnt/EvseConfig.bin NG\n");
  298. free(BufTmp);
  299. return 0;
  300. }
  301. DEBUG_INFO("EvseConfig write to file in /mnt OK.\n");
  302. DEBUG_INFO("Erase /dev/mtd10.\n");
  303. runShellCmd("flash_erase /dev/mtd10 0 0");
  304. DEBUG_INFO("Write /dev/mtd10.\n");
  305. runShellCmd("nandwrite -p /dev/mtd10 /mnt/EvseConfig.bin");
  306. DEBUG_INFO("Erase /dev/mtd11.\n");
  307. runShellCmd("flash_erase /dev/mtd11 0 0");
  308. DEBUG_INFO("Write /dev/mtd11.\n");
  309. runShellCmd("nandwrite -p /dev/mtd11 /mnt/EvseConfig.bin");
  310. system("rm -f /mnt/EvseConfig.bin");
  311. DEBUG_INFO("EvseConfig write to flash OK\n");
  312. }
  313. else
  314. {
  315. DEBUG_ERROR("alloc BlockSize NG\r\n");
  316. result = FAIL;
  317. }
  318. if(BufTmp!=NULL)
  319. free(BufTmp);
  320. return result;
  321. }
  322. //================================================
  323. // Main process
  324. //================================================
  325. int main(int argc, char *argv[]) {
  326. //int InitShMry = 1;
  327. if (InitShareMemory() == FAIL) {
  328. //InitShMry = 0;
  329. #ifdef SystemLogMessage
  330. DEBUG_ERROR("InitShareMemory NG\n");
  331. #endif
  332. if (ShmStatusCodeData != NULL) {
  333. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
  334. }
  335. sleep(5);
  336. return 0;
  337. }
  338. //web page submit
  339. if ((argc == 3) & (strlen(argv[1]) == 1)) {
  340. //web page submit system
  341. if (strcmp(argv[1], "1") == 0) {
  342. struct json_object *jobj = json_tokener_parse(argv[2]);
  343. json_object *val_obj = NULL;
  344. char *SystemId=NULL;
  345. char *SystemDateTime = NULL;
  346. int PhaseLossPolicy = 0;
  347. int FactoryConfiguration = 0;
  348. int AuthorisationMode = 0;
  349. int RfidCardNumEndian = 0;
  350. int PsuAcInputType = 0;
  351. char isAPP = 0;
  352. char isQRCode = 0;
  353. char isRFID = 0;
  354. char QRCodeMadeMode = 0;
  355. char *QRCodeContent = NULL;
  356. char Intensity = 0;
  357. char isAuthrizeByEVCCID = 0;
  358. char *DDSystemId1=NULL;
  359. int DDFactoryConfiguration1 = 0;
  360. int DDAuthorisationMode1 = 0;
  361. int DDRfidCardNumEndian1 = 0;
  362. char DDisAPP1 = 0;
  363. char DDisQRCode1 = 0;
  364. char DDisRFID1 = 0;
  365. char DDQRCodeMadeMode1 = 0;
  366. char *DDQRCodeContent1 = NULL;
  367. char DDIntensity1 = 0;
  368. char *DDSystemId2=NULL;
  369. int DDFactoryConfiguration2 = 0;
  370. int DDAuthorisationMode2 = 0;
  371. int DDRfidCardNumEndian2 = 0;
  372. char DDisAPP2 = 0;
  373. char DDisQRCode2 = 0;
  374. char DDisRFID2 = 0;
  375. char DDQRCodeMadeMode2 = 0;
  376. char *DDQRCodeContent2 = NULL;
  377. char DDIntensity2 = 0;
  378. char *DDSystemId3=NULL;
  379. int DDFactoryConfiguration3 = 0;
  380. int DDAuthorisationMode3 = 0;
  381. int DDRfidCardNumEndian3 = 0;
  382. char DDisAPP3 = 0;
  383. char DDisQRCode3 = 0;
  384. char DDisRFID3 = 0;
  385. char DDQRCodeMadeMode3 = 0;
  386. char *DDQRCodeContent3 = NULL;
  387. char DDIntensity3 = 0;
  388. char *DDSystemId4=NULL;
  389. int DDFactoryConfiguration4 = 0;
  390. int DDAuthorisationMode4 = 0;
  391. int DDRfidCardNumEndian4 = 0;
  392. char DDisAPP4 = 0;
  393. char DDisQRCode4 = 0;
  394. char DDisRFID4 = 0;
  395. char DDQRCodeMadeMode4 = 0;
  396. char *DDQRCodeContent4 = NULL;
  397. char DDIntensity4 = 0;
  398. if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
  399. SystemId = (char*)json_object_get_string(val_obj);
  400. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
  401. }
  402. if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
  403. SystemDateTime = (char*)json_object_get_string(val_obj);
  404. if(strlen(SystemDateTime)>0){
  405. char cmd[100];
  406. sprintf(cmd,"date -s '%s'",SystemDateTime);
  407. if(system(cmd)==0){
  408. system("hwclock -w");
  409. }
  410. }
  411. }
  412. if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
  413. PhaseLossPolicy = json_object_get_int(val_obj);
  414. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
  415. }
  416. if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
  417. FactoryConfiguration = json_object_get_int(val_obj);
  418. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
  419. }
  420. if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
  421. AuthorisationMode = json_object_get_int(val_obj);
  422. ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
  423. }
  424. if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
  425. RfidCardNumEndian = json_object_get_int(val_obj);
  426. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
  427. }
  428. if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
  429. PsuAcInputType = json_object_get_int(val_obj);
  430. ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
  431. }
  432. if( json_object_object_get_ex(jobj, "isAPP", &val_obj) ) {
  433. isAPP = json_object_get_int(val_obj);
  434. ShmSysConfigAndInfo->SysConfig.isAPP = isAPP;
  435. }
  436. if( json_object_object_get_ex(jobj, "isQRCode", &val_obj) ) {
  437. isQRCode = json_object_get_int(val_obj);
  438. ShmSysConfigAndInfo->SysConfig.isQRCode = isQRCode;
  439. }
  440. if( json_object_object_get_ex(jobj, "isRFID", &val_obj) ) {
  441. isRFID = json_object_get_int(val_obj);
  442. ShmSysConfigAndInfo->SysConfig.isRFID = isRFID;
  443. }
  444. if( json_object_object_get_ex(jobj, "QRCodeMadeMode", &val_obj) ) {
  445. QRCodeMadeMode = json_object_get_int(val_obj);
  446. ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
  447. }
  448. if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
  449. QRCodeContent = (char*)json_object_get_string(val_obj);
  450. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
  451. }
  452. if( json_object_object_get_ex(jobj, "Intensity", &val_obj) ) {
  453. Intensity = json_object_get_int(val_obj);
  454. ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity = Intensity;
  455. }
  456. if( json_object_object_get_ex(jobj, "isAuthrizeByEVCCID", &val_obj) ) {
  457. isAuthrizeByEVCCID = json_object_get_int(val_obj);
  458. ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID = isAuthrizeByEVCCID;
  459. }
  460. if( json_object_object_get_ex(jobj, "DDSystemId1", &val_obj) ) {
  461. DDSystemId1 = (char*)json_object_get_string(val_obj);
  462. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].SystemId,DDSystemId1);
  463. }
  464. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration1", &val_obj) ) {
  465. DDFactoryConfiguration1 = json_object_get_int(val_obj);
  466. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].FactoryConfiguration = DDFactoryConfiguration1;
  467. }
  468. if( json_object_object_get_ex(jobj, "DDAuthorisationMode1", &val_obj) ) {
  469. DDAuthorisationMode1 = json_object_get_int(val_obj);
  470. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].AuthorisationMode = DDAuthorisationMode1;
  471. }
  472. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian1", &val_obj) ) {
  473. DDRfidCardNumEndian1 = json_object_get_int(val_obj);
  474. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].RfidCardNumEndian = DDRfidCardNumEndian1;
  475. }
  476. if( json_object_object_get_ex(jobj, "DDisAPP1", &val_obj) ) {
  477. DDisAPP1 = json_object_get_int(val_obj);
  478. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isAPP = DDisAPP1;
  479. }
  480. if( json_object_object_get_ex(jobj, "DDisQRCode1", &val_obj) ) {
  481. DDisQRCode1 = json_object_get_int(val_obj);
  482. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isQRCode = DDisQRCode1;
  483. }
  484. if( json_object_object_get_ex(jobj, "DDisRFID1", &val_obj) ) {
  485. DDisRFID1 = json_object_get_int(val_obj);
  486. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isRFID = DDisRFID1;
  487. }
  488. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode1", &val_obj) ) {
  489. DDQRCodeMadeMode1 = json_object_get_int(val_obj);
  490. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeMadeMode = DDQRCodeMadeMode1;
  491. }
  492. if( json_object_object_get_ex(jobj, "DDQRCodeContent1", &val_obj) ) {
  493. DDQRCodeContent1 = (char*)json_object_get_string(val_obj);
  494. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeContent,DDQRCodeContent1);
  495. }
  496. if( json_object_object_get_ex(jobj, "DDIntensity1", &val_obj) ) {
  497. DDIntensity1 = json_object_get_int(val_obj);
  498. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].LedInfo.Intensity = DDIntensity1;
  499. }
  500. if( json_object_object_get_ex(jobj, "DDSystemId2", &val_obj) ) {
  501. DDSystemId2 = (char*)json_object_get_string(val_obj);
  502. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].SystemId,DDSystemId2);
  503. }
  504. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration2", &val_obj) ) {
  505. DDFactoryConfiguration2 = json_object_get_int(val_obj);
  506. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].FactoryConfiguration = DDFactoryConfiguration2;
  507. }
  508. if( json_object_object_get_ex(jobj, "DDAuthorisationMode2", &val_obj) ) {
  509. DDAuthorisationMode2 = json_object_get_int(val_obj);
  510. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].AuthorisationMode = DDAuthorisationMode2;
  511. }
  512. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian2", &val_obj) ) {
  513. DDRfidCardNumEndian2 = json_object_get_int(val_obj);
  514. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].RfidCardNumEndian = DDRfidCardNumEndian2;
  515. }
  516. if( json_object_object_get_ex(jobj, "DDisAPP2", &val_obj) ) {
  517. DDisAPP2 = json_object_get_int(val_obj);
  518. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isAPP = DDisAPP2;
  519. }
  520. if( json_object_object_get_ex(jobj, "DDisQRCode2", &val_obj) ) {
  521. DDisQRCode2 = json_object_get_int(val_obj);
  522. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isQRCode = DDisQRCode2;
  523. }
  524. if( json_object_object_get_ex(jobj, "DDisRFID2", &val_obj) ) {
  525. DDisRFID2 = json_object_get_int(val_obj);
  526. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isRFID = DDisRFID2;
  527. }
  528. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode2", &val_obj) ) {
  529. DDQRCodeMadeMode2 = json_object_get_int(val_obj);
  530. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeMadeMode = DDQRCodeMadeMode2;
  531. }
  532. if( json_object_object_get_ex(jobj, "DDQRCodeContent2", &val_obj) ) {
  533. DDQRCodeContent2 = (char*)json_object_get_string(val_obj);
  534. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeContent,DDQRCodeContent2);
  535. }
  536. if( json_object_object_get_ex(jobj, "DDIntensity2", &val_obj) ) {
  537. DDIntensity2 = json_object_get_int(val_obj);
  538. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].LedInfo.Intensity = DDIntensity2;
  539. }
  540. if( json_object_object_get_ex(jobj, "DDSystemId3", &val_obj) ) {
  541. DDSystemId3 = (char*)json_object_get_string(val_obj);
  542. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].SystemId,DDSystemId3);
  543. }
  544. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration3", &val_obj) ) {
  545. DDFactoryConfiguration3 = json_object_get_int(val_obj);
  546. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].FactoryConfiguration = DDFactoryConfiguration3;
  547. }
  548. if( json_object_object_get_ex(jobj, "DDAuthorisationMode3", &val_obj) ) {
  549. DDAuthorisationMode3 = json_object_get_int(val_obj);
  550. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].AuthorisationMode = DDAuthorisationMode3;
  551. }
  552. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian3", &val_obj) ) {
  553. DDRfidCardNumEndian3 = json_object_get_int(val_obj);
  554. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].RfidCardNumEndian = DDRfidCardNumEndian3;
  555. }
  556. if( json_object_object_get_ex(jobj, "DDisAPP3", &val_obj) ) {
  557. DDisAPP3 = json_object_get_int(val_obj);
  558. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isAPP = DDisAPP3;
  559. }
  560. if( json_object_object_get_ex(jobj, "DDisQRCode3", &val_obj) ) {
  561. DDisQRCode3 = json_object_get_int(val_obj);
  562. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isQRCode = DDisQRCode3;
  563. }
  564. if( json_object_object_get_ex(jobj, "DDisRFID3", &val_obj) ) {
  565. DDisRFID3 = json_object_get_int(val_obj);
  566. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isRFID = DDisRFID3;
  567. }
  568. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode3", &val_obj) ) {
  569. DDQRCodeMadeMode3 = json_object_get_int(val_obj);
  570. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeMadeMode = DDQRCodeMadeMode3;
  571. }
  572. if( json_object_object_get_ex(jobj, "DDQRCodeContent3", &val_obj) ) {
  573. DDQRCodeContent3 = (char*)json_object_get_string(val_obj);
  574. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeContent,DDQRCodeContent3);
  575. }
  576. if( json_object_object_get_ex(jobj, "DDIntensity3", &val_obj) ) {
  577. DDIntensity3 = json_object_get_int(val_obj);
  578. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].LedInfo.Intensity = DDIntensity3;
  579. }
  580. if( json_object_object_get_ex(jobj, "DDSystemId4", &val_obj) ) {
  581. DDSystemId4 = (char*)json_object_get_string(val_obj);
  582. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].SystemId,DDSystemId4);
  583. }
  584. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration4", &val_obj) ) {
  585. DDFactoryConfiguration4 = json_object_get_int(val_obj);
  586. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].FactoryConfiguration = DDFactoryConfiguration4;
  587. }
  588. if( json_object_object_get_ex(jobj, "DDAuthorisationMode4", &val_obj) ) {
  589. DDAuthorisationMode4 = json_object_get_int(val_obj);
  590. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].AuthorisationMode = DDAuthorisationMode4;
  591. }
  592. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian4", &val_obj) ) {
  593. DDRfidCardNumEndian4 = json_object_get_int(val_obj);
  594. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].RfidCardNumEndian = DDRfidCardNumEndian4;
  595. }
  596. if( json_object_object_get_ex(jobj, "DDisAPP4", &val_obj) ) {
  597. DDisAPP4 = json_object_get_int(val_obj);
  598. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isAPP = DDisAPP4;
  599. }
  600. if( json_object_object_get_ex(jobj, "DDisQRCode4", &val_obj) ) {
  601. DDisQRCode4 = json_object_get_int(val_obj);
  602. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isQRCode = DDisQRCode4;
  603. }
  604. if( json_object_object_get_ex(jobj, "DDisRFID4", &val_obj) ) {
  605. DDisRFID4 = json_object_get_int(val_obj);
  606. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isRFID = DDisRFID4;
  607. }
  608. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode4", &val_obj) ) {
  609. DDQRCodeMadeMode4 = json_object_get_int(val_obj);
  610. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeMadeMode = DDQRCodeMadeMode4;
  611. }
  612. if( json_object_object_get_ex(jobj, "DDQRCodeContent4", &val_obj) ) {
  613. DDQRCodeContent4 = (char*)json_object_get_string(val_obj);
  614. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeContent,DDQRCodeContent4);
  615. }
  616. if( json_object_object_get_ex(jobj, "DDIntensity4", &val_obj) ) {
  617. DDIntensity4 = json_object_get_int(val_obj);
  618. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].LedInfo.Intensity = DDIntensity4;
  619. }
  620. }
  621. if (strcmp(argv[1], "2") == 0) {
  622. struct json_object *jobj = json_tokener_parse(argv[2]);
  623. json_object *val_obj = NULL;
  624. int MaxChargingEnergy= 0;
  625. int MaxChargingPower = 0;
  626. int MaxChargingCurrent = 0;
  627. int AcMaxChargingCurrent = 0;
  628. int MaxChargingDuration = 0;
  629. int StopChargingByButton = 0;
  630. char *LocalWhiteCard0 = NULL;
  631. char *LocalWhiteCard1 = NULL;
  632. char *LocalWhiteCard2 = NULL;
  633. char *LocalWhiteCard3 = NULL;
  634. char *LocalWhiteCard4 = NULL;
  635. char *LocalWhiteCard5 = NULL;
  636. char *LocalWhiteCard6 = NULL;
  637. char *LocalWhiteCard7 = NULL;
  638. char *LocalWhiteCard8 = NULL;
  639. char *LocalWhiteCard9 = NULL;
  640. char isBilling = 0;
  641. char Currency = 0;
  642. float Fee0 = 0;
  643. float Fee1 = 0;
  644. float Fee2 = 0;
  645. float Fee3 = 0;
  646. float Fee4 = 0;
  647. float Fee5 = 0;
  648. float Fee6 = 0;
  649. float Fee7 = 0;
  650. float Fee8 = 0;
  651. float Fee9 = 0;
  652. float Fee10 = 0;
  653. float Fee11 = 0;
  654. float Fee12 = 0;
  655. float Fee13 = 0;
  656. float Fee14 = 0;
  657. float Fee15 = 0;
  658. float Fee16 = 0;
  659. float Fee17 = 0;
  660. float Fee18 = 0;
  661. float Fee19 = 0;
  662. float Fee20 = 0;
  663. float Fee21 = 0;
  664. float Fee22 = 0;
  665. float Fee23 = 0;
  666. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  667. MaxChargingEnergy = json_object_get_int(val_obj);
  668. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  669. }
  670. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  671. MaxChargingPower = json_object_get_int(val_obj);
  672. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  673. }
  674. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  675. MaxChargingCurrent = json_object_get_int(val_obj);
  676. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  677. }
  678. if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
  679. AcMaxChargingCurrent = json_object_get_int(val_obj);
  680. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
  681. }
  682. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  683. MaxChargingDuration = json_object_get_int(val_obj);
  684. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  685. }
  686. if( json_object_object_get_ex(jobj, "StopChargingByButton", &val_obj) ) {
  687. StopChargingByButton = json_object_get_int(val_obj);
  688. ShmSysConfigAndInfo->SysConfig.StopChargingByButton = StopChargingByButton;
  689. }
  690. if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
  691. LocalWhiteCard0 = (char*)json_object_get_string(val_obj);
  692. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
  693. }
  694. if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
  695. LocalWhiteCard1 = (char*)json_object_get_string(val_obj);
  696. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
  697. }
  698. if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
  699. LocalWhiteCard2 = (char*)json_object_get_string(val_obj);
  700. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
  701. }
  702. if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
  703. LocalWhiteCard3 = (char*)json_object_get_string(val_obj);
  704. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
  705. }
  706. if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
  707. LocalWhiteCard4 = (char*)json_object_get_string(val_obj);
  708. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
  709. }
  710. if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
  711. LocalWhiteCard5 = (char*)json_object_get_string(val_obj);
  712. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
  713. }
  714. if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
  715. LocalWhiteCard6 = (char*)json_object_get_string(val_obj);
  716. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
  717. }
  718. if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
  719. LocalWhiteCard7 = (char*)json_object_get_string(val_obj);
  720. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
  721. }
  722. if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
  723. LocalWhiteCard8 = (char*)json_object_get_string(val_obj);
  724. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
  725. }
  726. if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
  727. LocalWhiteCard9 = (char*)json_object_get_string(val_obj);
  728. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
  729. }
  730. if( json_object_object_get_ex(jobj, "isBilling", &val_obj) ) {
  731. isBilling = json_object_get_int(val_obj);
  732. ShmSysConfigAndInfo->SysConfig.BillingData.isBilling = isBilling;
  733. }
  734. if( json_object_object_get_ex(jobj, "Currency", &val_obj) ) {
  735. Currency = json_object_get_int(val_obj);
  736. ShmSysConfigAndInfo->SysConfig.BillingData.Currency = Currency;
  737. }
  738. if( json_object_object_get_ex(jobj, "Fee0", &val_obj) ) {
  739. Fee0 = json_object_get_double(val_obj);
  740. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0] = rounding(Fee0);
  741. }
  742. if( json_object_object_get_ex(jobj, "Fee1", &val_obj) ) {
  743. Fee1 = json_object_get_double(val_obj);
  744. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1] = rounding(Fee1);
  745. }
  746. if( json_object_object_get_ex(jobj, "Fee2", &val_obj) ) {
  747. Fee2 = json_object_get_double(val_obj);
  748. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2] = rounding(Fee2);
  749. }
  750. if( json_object_object_get_ex(jobj, "Fee3", &val_obj) ) {
  751. Fee3 = json_object_get_double(val_obj);
  752. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3] = rounding(Fee3);
  753. }
  754. if( json_object_object_get_ex(jobj, "Fee4", &val_obj) ) {
  755. Fee4 = json_object_get_double(val_obj);
  756. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4] = rounding(Fee4);
  757. }
  758. if( json_object_object_get_ex(jobj, "Fee5", &val_obj) ) {
  759. Fee5 = json_object_get_double(val_obj);
  760. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5] = rounding(Fee5);
  761. }
  762. if( json_object_object_get_ex(jobj, "Fee6", &val_obj) ) {
  763. Fee6 = json_object_get_double(val_obj);
  764. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6] = rounding(Fee6);
  765. }
  766. if( json_object_object_get_ex(jobj, "Fee7", &val_obj) ) {
  767. Fee7 = json_object_get_double(val_obj);
  768. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7] = rounding(Fee7);
  769. }
  770. if( json_object_object_get_ex(jobj, "Fee8", &val_obj) ) {
  771. Fee8 = json_object_get_double(val_obj);
  772. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8] = rounding(Fee8);
  773. }
  774. if( json_object_object_get_ex(jobj, "Fee9", &val_obj) ) {
  775. Fee9 = json_object_get_double(val_obj);
  776. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9] = rounding(Fee9);
  777. }
  778. if( json_object_object_get_ex(jobj, "Fee10", &val_obj) ) {
  779. Fee10 = json_object_get_double(val_obj);
  780. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10] = rounding(Fee10);
  781. }
  782. if( json_object_object_get_ex(jobj, "Fee11", &val_obj) ) {
  783. Fee11 = json_object_get_double(val_obj);
  784. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11] = rounding(Fee11);
  785. }
  786. if( json_object_object_get_ex(jobj, "Fee12", &val_obj) ) {
  787. Fee12 = json_object_get_double(val_obj);
  788. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12] = rounding(Fee12);
  789. }
  790. if( json_object_object_get_ex(jobj, "Fee13", &val_obj) ) {
  791. Fee13 = json_object_get_double(val_obj);
  792. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13] = rounding(Fee13);
  793. }
  794. if( json_object_object_get_ex(jobj, "Fee14", &val_obj) ) {
  795. Fee14 = json_object_get_double(val_obj);
  796. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14] = rounding(Fee14);
  797. }
  798. if( json_object_object_get_ex(jobj, "Fee15", &val_obj) ) {
  799. Fee15 = json_object_get_double(val_obj);
  800. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15] = rounding(Fee15);
  801. }
  802. if( json_object_object_get_ex(jobj, "Fee16", &val_obj) ) {
  803. Fee16 = json_object_get_double(val_obj);
  804. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16] = rounding(Fee16);
  805. }
  806. if( json_object_object_get_ex(jobj, "Fee17", &val_obj) ) {
  807. Fee17 = json_object_get_double(val_obj);
  808. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17] = rounding(Fee17);
  809. }
  810. if( json_object_object_get_ex(jobj, "Fee18", &val_obj) ) {
  811. Fee18 = json_object_get_double(val_obj);
  812. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18] = rounding(Fee18);
  813. }
  814. if( json_object_object_get_ex(jobj, "Fee19", &val_obj) ) {
  815. Fee19 = json_object_get_double(val_obj);
  816. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19] = rounding(Fee19);
  817. }
  818. if( json_object_object_get_ex(jobj, "Fee20", &val_obj) ) {
  819. Fee20 = json_object_get_double(val_obj);
  820. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20] = rounding(Fee20);
  821. }
  822. if( json_object_object_get_ex(jobj, "Fee21", &val_obj) ) {
  823. Fee21 = json_object_get_double(val_obj);
  824. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21] = rounding(Fee21);
  825. }
  826. if( json_object_object_get_ex(jobj, "Fee22", &val_obj) ) {
  827. Fee22 = json_object_get_double(val_obj);
  828. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22] = rounding(Fee22);
  829. }
  830. if( json_object_object_get_ex(jobj, "Fee23", &val_obj) ) {
  831. Fee23 = json_object_get_double(val_obj);
  832. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23] = rounding(Fee23);
  833. }
  834. }
  835. if (strcmp(argv[1], "3") == 0) {
  836. struct json_object *jobj = json_tokener_parse(argv[2]);
  837. json_object *val_obj = NULL;
  838. int Eth0DhcpClient=0;
  839. char *Eth0IpAddress=NULL;
  840. char *Eth0SubmaskAddress=NULL;
  841. char *Eth0GatewayAddress=NULL;
  842. int WifiMode=0;
  843. char *WifiSsid=NULL;
  844. char *WifiPassword=NULL;
  845. int WifiDhcpServer=0;
  846. int WifiDhcpClient=0;
  847. char *WifiIpAddress=NULL;
  848. char *WifiSubmaskAddress=NULL;
  849. char *WifiGatewayAddress=NULL;
  850. char *TelcomApn=NULL;
  851. char *TelcomChapPapId=NULL;
  852. char *TelcomChapPapPwd=NULL;
  853. char *TelcomIpAddress=NULL;
  854. char TelcomEnabled=0;
  855. char Wcnt=0;
  856. char Tcnt=0;
  857. if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
  858. Eth0DhcpClient = json_object_get_int(val_obj);
  859. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=Eth0DhcpClient;
  860. }
  861. if( json_object_object_get_ex(jobj, "Eth0IpAddress", &val_obj) ) {
  862. Eth0IpAddress = (char*)json_object_get_string(val_obj);
  863. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,Eth0IpAddress);
  864. }
  865. if( json_object_object_get_ex(jobj, "Eth0SubmaskAddress", &val_obj) ) {
  866. Eth0SubmaskAddress = (char*)json_object_get_string(val_obj);
  867. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,Eth0SubmaskAddress);
  868. }
  869. if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
  870. Eth0GatewayAddress = (char*)json_object_get_string(val_obj);
  871. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,Eth0GatewayAddress);
  872. }
  873. if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
  874. WifiMode = json_object_get_int(val_obj);
  875. if(WifiMode!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode) Wcnt++;
  876. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
  877. }
  878. if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
  879. WifiSsid = (char*)json_object_get_string(val_obj);
  880. if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
  881. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
  882. }
  883. if( json_object_object_get_ex(jobj, "WifiPassword", &val_obj) ) {
  884. WifiPassword = (char*)json_object_get_string(val_obj);
  885. if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
  886. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
  887. }
  888. if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
  889. WifiDhcpServer = json_object_get_int(val_obj);
  890. if(WifiDhcpServer!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer) Wcnt++;
  891. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=WifiDhcpServer;
  892. }
  893. if( json_object_object_get_ex(jobj, "WifiDhcpClient", &val_obj) ) {
  894. WifiDhcpClient = json_object_get_int(val_obj);
  895. if(WifiDhcpClient!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient) Wcnt++;
  896. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=WifiDhcpClient;
  897. }
  898. if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
  899. WifiIpAddress = (char*)json_object_get_string(val_obj);
  900. if (strcmp(WifiIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress) != 0) Wcnt++;
  901. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,WifiIpAddress);
  902. }
  903. if( json_object_object_get_ex(jobj, "WifiSubmaskAddress", &val_obj) ) {
  904. WifiSubmaskAddress = (char*)json_object_get_string(val_obj);
  905. if (strcmp(WifiSubmaskAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress) != 0) Wcnt++;
  906. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,WifiSubmaskAddress);
  907. }
  908. if( json_object_object_get_ex(jobj, "WifiGatewayAddress", &val_obj) ) {
  909. WifiGatewayAddress = (char*)json_object_get_string(val_obj);
  910. if (strcmp(WifiGatewayAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress) != 0) Wcnt++;
  911. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,WifiGatewayAddress);
  912. }
  913. if( json_object_object_get_ex(jobj, "TelcomApn", &val_obj) ) {
  914. TelcomApn = (char*)json_object_get_string(val_obj);
  915. if (strcmp(TelcomApn, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn) != 0) Tcnt++;
  916. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,TelcomApn);
  917. }
  918. if( json_object_object_get_ex(jobj, "TelcomChapPapId", &val_obj) ) {
  919. TelcomChapPapId = (char*)json_object_get_string(val_obj);
  920. if (strcmp(TelcomChapPapId, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId) != 0) Tcnt++;
  921. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,TelcomChapPapId);
  922. }
  923. if( json_object_object_get_ex(jobj, "TelcomChapPapPwd", &val_obj) ) {
  924. TelcomChapPapPwd = (char*)json_object_get_string(val_obj);
  925. if (strcmp(TelcomChapPapPwd, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd) != 0) Tcnt++;
  926. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,TelcomChapPapPwd);
  927. }
  928. if( json_object_object_get_ex(jobj, "TelcomIpAddress", &val_obj) ) {
  929. TelcomIpAddress = (char*)json_object_get_string(val_obj);
  930. if (strcmp(TelcomIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress) != 0) Tcnt++;
  931. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
  932. }
  933. if( json_object_object_get_ex(jobj, "TelcomEnabled", &val_obj) ) {
  934. TelcomEnabled = json_object_get_int(val_obj);
  935. if(TelcomEnabled!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled) Tcnt++;
  936. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled=TelcomEnabled;
  937. }
  938. if(Wcnt>0){
  939. system ("pkill Module_Wifi");
  940. }
  941. if(Tcnt>0){
  942. system ("pkill Module_4g");
  943. }
  944. }
  945. if (strcmp(argv[1], "4") == 0) {
  946. struct json_object *jobj = json_tokener_parse(argv[2]);
  947. json_object *val_obj = NULL;
  948. int BackendConnTimeout=0;
  949. int OfflinePolicy=0;
  950. int OfflineMaxChargeEnergy=0;
  951. int OfflineMaxChargeDuration=0;
  952. char *OcppServerURL=NULL;
  953. char *ChargeBoxId=NULL;
  954. char *chargePointVendor=NULL;
  955. int OcppSecurityProfile=0;
  956. int MaintainServerSecurityProfile=0;
  957. char *OcppSecurityPassword=NULL;
  958. char *MaintainServerSecurityPassword=NULL;
  959. int isEnableLocalPowerSharging=0;
  960. char *OcppReceiptrURL=NULL;
  961. char *MaintainServerURL=NULL;
  962. /*for TTIA*/
  963. char isEnableTTIA=0;
  964. char *server_addr=NULL;
  965. int server_port=0;
  966. int busVenderId=0;
  967. char *EquipmentProvider=NULL;
  968. char TransportationCompanyNo=0;
  969. char TTIAChargeBoxId=0;
  970. char *evseStation=NULL;
  971. if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
  972. BackendConnTimeout = json_object_get_int(val_obj);
  973. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
  974. }
  975. if( json_object_object_get_ex(jobj, "OfflinePolicy", &val_obj) ) {
  976. OfflinePolicy = json_object_get_int(val_obj);
  977. ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
  978. }
  979. if( json_object_object_get_ex(jobj, "OfflineMaxChargeEnergy", &val_obj) ) {
  980. OfflineMaxChargeEnergy = json_object_get_int(val_obj);
  981. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
  982. }
  983. if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
  984. OfflineMaxChargeDuration = json_object_get_int(val_obj);
  985. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
  986. }
  987. if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
  988. OcppServerURL = (char*)json_object_get_string(val_obj);
  989. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
  990. }
  991. if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
  992. ChargeBoxId = (char*)json_object_get_string(val_obj);
  993. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
  994. }
  995. if( json_object_object_get_ex(jobj, "chargePointVendor", &val_obj) ) {
  996. chargePointVendor = (char*)json_object_get_string(val_obj);
  997. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,chargePointVendor);
  998. }
  999. if( json_object_object_get_ex(jobj, "OcppSecurityProfile", &val_obj) ) {
  1000. OcppSecurityProfile = json_object_get_int(val_obj);
  1001. ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile = OcppSecurityProfile;
  1002. }
  1003. if( json_object_object_get_ex(jobj, "OcppSecurityPassword", &val_obj) ) {
  1004. OcppSecurityPassword = (char*)json_object_get_string(val_obj);
  1005. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword,OcppSecurityPassword);
  1006. }
  1007. if( json_object_object_get_ex(jobj, "MaintainServerSecurityProfile", &val_obj) ) {
  1008. MaintainServerSecurityProfile = json_object_get_int(val_obj);
  1009. ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile = MaintainServerSecurityProfile;
  1010. }
  1011. if( json_object_object_get_ex(jobj, "MaintainServerSecurityPassword", &val_obj) ) {
  1012. MaintainServerSecurityPassword = (char*)json_object_get_string(val_obj);
  1013. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword,MaintainServerSecurityPassword);
  1014. }
  1015. if( json_object_object_get_ex(jobj, "isEnableLocalPowerSharging", &val_obj) ) {
  1016. isEnableLocalPowerSharging = json_object_get_int(val_obj);
  1017. ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging = isEnableLocalPowerSharging;
  1018. }
  1019. if( json_object_object_get_ex(jobj, "OcppReceiptrURL", &val_obj) ) {
  1020. OcppReceiptrURL = (char*)json_object_get_string(val_obj);
  1021. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL,OcppReceiptrURL);
  1022. }
  1023. if( json_object_object_get_ex(jobj, "MaintainServerURL", &val_obj) ) {
  1024. MaintainServerURL = (char*)json_object_get_string(val_obj);
  1025. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL,MaintainServerURL);
  1026. }
  1027. /*for TTIA*/
  1028. if( json_object_object_get_ex(jobj, "isEnableTTIA", &val_obj) ) {
  1029. isEnableTTIA = json_object_get_int(val_obj);
  1030. ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA = isEnableTTIA;
  1031. }
  1032. if( json_object_object_get_ex(jobj, "server_addr", &val_obj) ) {
  1033. server_addr = (char*)json_object_get_string(val_obj);
  1034. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr,server_addr);
  1035. }
  1036. if( json_object_object_get_ex(jobj, "server_port", &val_obj) ) {
  1037. server_port = json_object_get_int(val_obj);
  1038. ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port = server_port;
  1039. }
  1040. if( json_object_object_get_ex(jobj, "busVenderId", &val_obj) ) {
  1041. busVenderId = json_object_get_int(val_obj);
  1042. ShmSysConfigAndInfo->SysConfig.TTIA_Info.busVenderId = busVenderId;
  1043. }
  1044. if( json_object_object_get_ex(jobj, "EquipmentProvider", &val_obj) ) {
  1045. EquipmentProvider = (char*)json_object_get_string(val_obj);
  1046. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.EquipmentProvider,EquipmentProvider);
  1047. }
  1048. if( json_object_object_get_ex(jobj, "TransportationCompanyNo", &val_obj) ) {
  1049. TransportationCompanyNo = json_object_get_int(val_obj);
  1050. ShmSysConfigAndInfo->SysConfig.TTIA_Info.TransportationCompanyNo = TransportationCompanyNo;
  1051. }
  1052. if( json_object_object_get_ex(jobj, "TTIAChargeBoxId", &val_obj) ) {
  1053. TTIAChargeBoxId = json_object_get_int(val_obj);
  1054. ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId = TTIAChargeBoxId;
  1055. }
  1056. if( json_object_object_get_ex(jobj, "evseStation", &val_obj) ) {
  1057. evseStation = (char*)json_object_get_string(val_obj);
  1058. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation,evseStation);
  1059. }
  1060. }
  1061. struct SysConfigData SysConfig;
  1062. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  1063. int result = StoreUsrConfigData(&SysConfig);
  1064. if(result != 1){
  1065. #ifdef SystemLogMessage
  1066. StoreLogMsg("[WebService]StoreUsrConfigData: normal NG");
  1067. #endif
  1068. }
  1069. else{
  1070. #ifdef SystemLogMessage
  1071. StoreLogMsg("[WebService]StoreUsrConfigData: normal OK");
  1072. #endif
  1073. }
  1074. #ifdef SystemLogMessage
  1075. DEBUG_INFO("WebServiceConfig update OK");
  1076. #endif
  1077. }
  1078. if (argc == 2)
  1079. { //init share memory for test
  1080. if (strcmp(argv[1], "aaa") == 0)
  1081. {
  1082. //struct SysConfigData SysConfig;
  1083. //system
  1084. ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=1;
  1085. ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=1;
  1086. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DO0E362001D1P0D");
  1087. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber, "SerialNumber");
  1088. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId, "1234567890");
  1089. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemDateTime, "2019-12-31 23:59:59");
  1090. ShmSysConfigAndInfo->SysConfig.AcPhaseCount=1;
  1091. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy=0;
  1092. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration=0;
  1093. ShmSysConfigAndInfo->SysConfig.AuthorisationMode=0;
  1094. ShmSysConfigAndInfo->SysConfig.DefaultLanguage=0;
  1095. ShmSysConfigAndInfo->SysInfo.InputVoltageR=0;
  1096. ShmSysConfigAndInfo->SysInfo.InputVoltageS=0;
  1097. ShmSysConfigAndInfo->SysInfo.InputVoltageT=0;
  1098. ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed=0;
  1099. ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed=0;
  1100. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian=0;
  1101. ShmSysConfigAndInfo->SysConfig.RatingCurrent=100;
  1102. ShmSysConfigAndInfo->SysConfig.PsuAcInputType=0;
  1103. ShmSysConfigAndInfo->SysInfo.AuxPower5V=0;
  1104. ShmSysConfigAndInfo->SysInfo.AuxPower12V=0;
  1105. ShmSysConfigAndInfo->SysInfo.AuxPower24V=0;
  1106. ShmSysConfigAndInfo->SysInfo.AuxPower48V=0;
  1107. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev, "");
  1108. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev, "");
  1109. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev, "");
  1110. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "");
  1111. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, "");
  1112. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev, "");
  1113. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev, "");
  1114. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev, "");
  1115. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev, "");
  1116. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev, "");
  1117. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev, "");
  1118. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev, "");
  1119. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev, "");
  1120. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev, "");
  1121. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev, "");
  1122. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev, "");
  1123. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev, "");
  1124. ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp=0;
  1125. ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp=0;
  1126. ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp=0;
  1127. ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp=0;
  1128. ShmSysConfigAndInfo->SysConfig.AcPlugInTimes=0;
  1129. ShmSysConfigAndInfo->SysConfig.GbPlugInTimes=0;
  1130. ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime=0;
  1131. ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes=0;
  1132. ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes=0;
  1133. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwPrimaryVersion, "DC 9.01");
  1134. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwPrimaryVersion, "DC 9.02");
  1135. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwSecondVersion, "PFC 9.02");
  1136. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwSecondVersion, "PFC 9.03");
  1137. //charging
  1138. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=0;
  1139. ShmSysConfigAndInfo->SysConfig.MaxChargingPower=0;
  1140. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent= 0;
  1141. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent= 0;
  1142. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=0;
  1143. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0], "111");
  1144. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1], "222");
  1145. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2], "333");
  1146. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3], "444");
  1147. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4], "555");
  1148. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5], "666");
  1149. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6], "777");
  1150. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7], "888");
  1151. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8], "999");
  1152. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9], "aaa");
  1153. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.UserId, "UserId");
  1154. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingVoltage=0;
  1155. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingCurrent=0;
  1156. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingPower=0;
  1157. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedEnergy=0;
  1158. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedDuration=0;
  1159. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].RemainChargingDuration=0;
  1160. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatteryMaxVoltage=0;
  1161. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetVoltage=0;
  1162. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterySoc=0;
  1163. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].SystemStatus=1;
  1164. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetCurrent=1;
  1165. //network
  1166. ShmSysConfigAndInfo->SysInfo.InternetConn=0;
  1167. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer,"");
  1168. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=1;
  1169. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress,"");
  1170. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,"192.168.1.10");
  1171. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
  1172. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,"192.168.1.1");
  1173. ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=1;
  1174. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress,"");
  1175. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,"192.168.0.10");
  1176. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
  1177. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,"192.168.0.1");
  1178. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=1;
  1179. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,"");
  1180. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,"");
  1181. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi=0;
  1182. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=0;
  1183. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=0;
  1184. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress,"");
  1185. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,"");
  1186. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,"");
  1187. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,"");
  1188. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn=1;
  1189. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,"");
  1190. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=0;
  1191. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,"");
  1192. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,"");
  1193. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei,"");
  1194. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi,"");
  1195. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid,"");
  1196. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
  1197. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=0;
  1198. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,"");
  1199. //backend
  1200. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout=300;
  1201. ShmSysConfigAndInfo->SysConfig.OfflinePolicy=0;
  1202. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy=0;
  1203. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration=0;
  1204. ShmSysConfigAndInfo->SysInfo.OcppConnStatus=0;
  1205. ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus=0;
  1206. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"");
  1207. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,"");
  1208. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,"Phihong");
  1209. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=0;
  1210. struct SysConfigData SysConfig;
  1211. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  1212. StoreUsrConfigData(&SysConfig);
  1213. // struct PsuModuleVer PsuData;
  1214. // memcpy(&PsuData, &ShmPsuData->PsuVersion, sizeof(struct PsuModuleVer));
  1215. // StoreUsrConfigData(&PsuData);
  1216. #ifdef SystemLogMessage
  1217. DEBUG_INFO("WebService initial OK");
  1218. #endif
  1219. }
  1220. if (strcmp(argv[1], "button") == 0)
  1221. {
  1222. unsigned char Button1;
  1223. unsigned char Button2;
  1224. unsigned char EmergencyButton;
  1225. Button1=ShmPrimaryMcuData->InputDet.bits.Button1;
  1226. Button2=ShmPrimaryMcuData->InputDet.bits.Button2;
  1227. EmergencyButton=ShmPrimaryMcuData->InputDet.bits.EmergencyButton;
  1228. struct json_object *jobj;
  1229. struct json_object *sButton1;
  1230. struct json_object *sButton2;
  1231. struct json_object *sEmergencyButton;
  1232. sButton1 = json_object_new_int(Button1);
  1233. sButton2 = json_object_new_int(Button2);
  1234. sEmergencyButton = json_object_new_int(EmergencyButton);
  1235. jobj=json_object_new_object();
  1236. json_object_object_add(jobj,"Button1",sButton1);
  1237. json_object_object_add(jobj,"Button2",sButton2);
  1238. json_object_object_add(jobj,"EmergencyButton",sEmergencyButton);
  1239. printf("%s\n", json_object_to_json_string(jobj));
  1240. }
  1241. if (strcmp(argv[1], "restart") == 0)
  1242. {
  1243. system("exec /usr/bin/run_evse_restart.sh");
  1244. }
  1245. }
  1246. if(strcmp(argv[1], "log") == 0)
  1247. {
  1248. char cmd[512];
  1249. if((argc == 3) && isdigit(*argv[2]))
  1250. {
  1251. sprintf(cmd, "exec /root/logPackTools 'log' %s", argv[2]);
  1252. }
  1253. else
  1254. {
  1255. sprintf(cmd, "exec /root/logPackTools 'log'");
  1256. }
  1257. if(system(cmd) == 0)
  1258. {
  1259. DEBUG_INFO("Log pack success.\n");
  1260. }
  1261. else
  1262. {
  1263. DEBUG_INFO("Log pack fail.\n");
  1264. }
  1265. }
  1266. //upgrade firmware
  1267. if ((argc == 3) & (strcmp(argv[1], "upgrade") == 0))
  1268. {
  1269. struct json_object *jobj;
  1270. struct json_object *Result;
  1271. struct json_object *Message;
  1272. //char cmd[100];
  1273. jobj=json_object_new_object();
  1274. //system
  1275. //if((char)ShmSysConfigAndInfo->SysInfo.FirmwareUpdate == '0'){
  1276. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=1;
  1277. Result = json_object_new_string("success");
  1278. Message = json_object_new_string("File is uploaded, please wait a moment to upgrade");
  1279. //}
  1280. /*else{
  1281. sprintf(cmd,"rm /mnt/%s",argv[2]);
  1282. system(cmd);
  1283. Result = json_object_new_string("error");
  1284. Message = json_object_new_string("machine is busy");
  1285. }*/
  1286. json_object_object_add(jobj,"Result",Result);
  1287. json_object_object_add(jobj,"Message",Message);
  1288. printf("%s\n", json_object_to_json_string(jobj));
  1289. }
  1290. //web page query all
  1291. if ((argc == 2) & (strcmp(argv[1], "query") == 0)) {
  1292. char *IsAcDc[2];
  1293. char *SafetyRegulation[2];
  1294. char *IsDO[3];
  1295. char *Connector1[2];
  1296. char *Connector2[2];
  1297. char *Connector3[2];
  1298. char *Network[2];
  1299. //unsigned char connector1FwVer[32];
  1300. //unsigned char connector2FwVer[32];
  1301. short gunQty;
  1302. char *RatedPower1[2];
  1303. char *RatedPower2[2];
  1304. char *RatedPower3[2];
  1305. short RatedPower;
  1306. short PsuQuantity = 0;
  1307. substr((char *)IsAcDc,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,1);
  1308. substr((char *)SafetyRegulation,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,3,1);
  1309. substr((char *)IsDO,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,2);
  1310. substr((char *)Connector1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,7,1);
  1311. substr((char *)Connector2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
  1312. substr((char *)Connector3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
  1313. substr((char *)Network,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,10,1);
  1314. int connectorType1,connectorType2,connectorType3;
  1315. connectorType1=ConnectorType((char *)Connector1);
  1316. connectorType2=ConnectorType((char *)Connector2);
  1317. connectorType3=ConnectorType((char *)Connector3);
  1318. if(connectorType1 == connectorType2){
  1319. gunQty = 1;
  1320. }
  1321. else{
  1322. gunQty = 0;
  1323. }
  1324. if(connectorType1 != 0){
  1325. if(connectorType1 == 1){
  1326. // strcpy((char *)&connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  1327. // memcpy(connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  1328. }
  1329. else if(connectorType1 == 2){
  1330. // strcpy((char *)&connector1FwVer,ShmGBTData->evse[0].version);
  1331. // memcpy(connector1FwVer,ShmGBTData->evse[0].version,ARRAY_SIZE(ShmGBTData->evse[0].version));
  1332. }
  1333. else if(connectorType1 == 3){
  1334. // strcpy((char *)&connector1FwVer,ShmCHAdeMOData->evse[0].version);
  1335. // memcpy(connector1FwVer,ShmCHAdeMOData->evse[0].version,ARRAY_SIZE(ShmCHAdeMOData->evse[0].version));
  1336. }
  1337. }
  1338. if(connectorType2 != 0){
  1339. if(connectorType2 == 1){
  1340. // strcpy((char *)&connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  1341. // memcpy(connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  1342. }
  1343. else if(connectorType2 == 2){
  1344. // strcpy((char *)&connector2FwVer,ShmGBTData->evse[gunQty].version);
  1345. // memcpy(connector2FwVer,ShmGBTData->evse[gunQty].version,ARRAY_SIZE(ShmGBTData->evse[gunQty].version));
  1346. }
  1347. else if(connectorType2 == 3){
  1348. // strcpy((char *)&connector2FwVer,ShmCHAdeMOData->evse[gunQty].version);
  1349. // memcpy(connector2FwVer,ShmCHAdeMOData->evse[gunQty].version,ARRAY_SIZE(ShmCHAdeMOData->evse[gunQty].version));
  1350. }
  1351. }
  1352. substr((char *)RatedPower1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,4,1);
  1353. substr((char *)RatedPower2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,5,1);
  1354. substr((char *)RatedPower3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,6,1);
  1355. int p1=atoi((char *)RatedPower1);
  1356. int p2=atoi((char *)RatedPower2);
  1357. int p3=atoi((char *)RatedPower3);
  1358. if(strcmp(IsAcDc, "D") == 0){
  1359. RatedPower=(p1*10+p2)*pow(10,p3-1);
  1360. if(RatedPower>=30){
  1361. PsuQuantity = RatedPower/30;
  1362. }
  1363. }
  1364. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
  1365. }
  1366. struct json_object *jobj1;
  1367. struct json_object *jobj2;
  1368. struct json_object *jobj3;
  1369. struct json_object *jobj4;
  1370. //system
  1371. struct json_object *ModelName;
  1372. struct json_object *AcModelName;
  1373. struct json_object *SerialNumber;
  1374. struct json_object *SystemId;
  1375. struct json_object *AcPhaseCount;
  1376. struct json_object *PhaseLossPolicy;
  1377. struct json_object *FactoryConfiguration;
  1378. struct json_object *AuthorisationMode;
  1379. struct json_object *DefaultLanguage;
  1380. struct json_object *InputVoltageR;
  1381. struct json_object *InputVoltageS;
  1382. struct json_object *InputVoltageT;
  1383. struct json_object *InputVoltageDc;
  1384. struct json_object *SystemFanRotaSpeed;
  1385. struct json_object *PsuFanRotaSpeed;
  1386. struct json_object *RfidCardNumEndian;
  1387. struct json_object *PsuAcInputType;
  1388. struct json_object *RatingCurrent;
  1389. struct json_object *AcRatingCurrent;
  1390. struct json_object *isAPP;
  1391. struct json_object *isQRCode;
  1392. struct json_object *isRFID;
  1393. struct json_object *QRCodeMadeMode;
  1394. struct json_object *QRCodeContent;
  1395. struct json_object *Intensity;
  1396. struct json_object *isAuthrizeByEVCCID;
  1397. struct json_object *AuxPower5V;
  1398. struct json_object *AuxPower12V;
  1399. struct json_object *AuxPower24V;
  1400. struct json_object *AuxPower48V;
  1401. struct json_object *CsuHwRev;
  1402. struct json_object *CsuBootLoadFwRev;
  1403. struct json_object *CsuKernelFwRev;
  1404. struct json_object *CsuRootFsFwRev;
  1405. struct json_object *CsuPrimFwRev;
  1406. struct json_object *LcmHwRev;
  1407. struct json_object *LcmFwRev;
  1408. struct json_object *PsuHwRev;
  1409. struct json_object *PsuPrimFwRev;
  1410. struct json_object *PsuSecFwRev;
  1411. struct json_object *AuxPwrHwRev;
  1412. struct json_object *AuxPwrFwRev;
  1413. struct json_object *FanModuleHwRev;
  1414. struct json_object *FanModuleFwRev;
  1415. struct json_object *RelayModuleHwRev;
  1416. struct json_object *RelayModuleFwRev;
  1417. struct json_object *TelcomModemFwRev;
  1418. struct json_object *Connector1FwRev;
  1419. struct json_object *Connector2FwRev;
  1420. struct json_object *LedModuleFwRev;
  1421. struct json_object *SystemAmbientTemp;
  1422. struct json_object *SystemCriticalTemp;
  1423. struct json_object *CcsConnectorTemp;
  1424. struct json_object *PsuAmbientTemp;
  1425. struct json_object *AcPlugInTimes;
  1426. struct json_object *GbPlugInTimes;
  1427. struct json_object *Ccs1PlugInTime;
  1428. struct json_object *Ccs2PlugInTimes;
  1429. struct json_object *ChademoPlugInTimes;
  1430. struct json_object *FirmwareUpdate;
  1431. struct json_object *FwPrimaryVersion[PsuQuantity];
  1432. struct json_object *FwPrimaryVersionArr= json_object_new_array();
  1433. struct json_object *FwSecondVersion[PsuQuantity];
  1434. struct json_object *FwSecondVersionArr= json_object_new_array();
  1435. /* for DO & DD*/
  1436. struct json_object *DispenserQuantity;
  1437. struct json_object *TotalConnectorQuantity;
  1438. struct json_object *DDModelName[4];
  1439. struct json_object *DDModelNameArr= json_object_new_array();
  1440. struct json_object *DDSerialNumber[4];
  1441. struct json_object *DDSerialNumberArr= json_object_new_array();
  1442. struct json_object *DDSystemId[4];
  1443. struct json_object *DDSystemIdArr= json_object_new_array();
  1444. struct json_object *DDAuthorisationMode[4];
  1445. struct json_object *DDAuthorisationModeArr= json_object_new_array();
  1446. struct json_object *DDRfidCardNumEndian[4];
  1447. struct json_object *DDRfidCardNumEndianArr= json_object_new_array();
  1448. struct json_object *DDisAPP[4];
  1449. struct json_object *DDisAPPArr= json_object_new_array();
  1450. struct json_object *DDisQRCode[4];
  1451. struct json_object *DDisQRCodeArr= json_object_new_array();
  1452. struct json_object *DDisRFID[4];
  1453. struct json_object *DDisRFIDArr= json_object_new_array();
  1454. struct json_object *DDQRCodeMadeMode[4];
  1455. struct json_object *DDQRCodeMadeModeArr= json_object_new_array();
  1456. struct json_object *DDQRCodeContent[4];
  1457. struct json_object *DDQRCodeContentArr= json_object_new_array();
  1458. struct json_object *DDFactoryConfiguration[4];
  1459. struct json_object *DDFactoryConfigurationArr= json_object_new_array();
  1460. struct json_object *DDCsuBootLoadFwRev[4];
  1461. struct json_object *DDCsuBootLoadFwRevArr= json_object_new_array();
  1462. struct json_object *DDCsuKernelFwRev[4];
  1463. struct json_object *DDCsuKernelFwRevArr= json_object_new_array();
  1464. struct json_object *DDCsuRootFsFwRev[4];
  1465. struct json_object *DDCsuRootFsFwRevArr= json_object_new_array();
  1466. struct json_object *DDCsuPrimFwRev[4];
  1467. struct json_object *DDCsuPrimFwRevArr= json_object_new_array();
  1468. struct json_object *DDLcmFwRev[4];
  1469. struct json_object *DDLcmFwRevArr= json_object_new_array();
  1470. struct json_object *DDPsuPrimFwRev[4];
  1471. struct json_object *DDPsuPrimFwRevArr= json_object_new_array();
  1472. struct json_object *DDPsuSecFwRev[4];
  1473. struct json_object *DDPsuSecFwRevArr= json_object_new_array();
  1474. struct json_object *DDFanModuleFwRev[4];
  1475. struct json_object *DDFanModuleFwRevArr= json_object_new_array();
  1476. struct json_object *DDRelayModuleFwRev[4];
  1477. struct json_object *DDRelayModuleFwRevArr= json_object_new_array();
  1478. struct json_object *DDTelcomModemFwRev[4];
  1479. struct json_object *DDTelcomModemFwRevArr= json_object_new_array();
  1480. struct json_object *DDLedModuleFwRev[4];
  1481. struct json_object *DDLedModuleFwRevArr= json_object_new_array();
  1482. struct json_object *DDConnector1FwRev[4];
  1483. struct json_object *DDConnector1FwRevArr= json_object_new_array();
  1484. struct json_object *DDConnector2FwRev[4];
  1485. struct json_object *DDConnector2FwRevArr= json_object_new_array();
  1486. struct json_object *DDIntensity[4];
  1487. struct json_object *DDIntensityArr= json_object_new_array();
  1488. struct json_object *Relay2ModuleFwRev;
  1489. //charging
  1490. struct json_object *MaxChargingEnergy;
  1491. struct json_object *MaxChargingPower;
  1492. struct json_object *MaxChargingCurrent;
  1493. struct json_object *AcMaxChargingCurrent;
  1494. struct json_object *MaxChargingDuration;
  1495. struct json_object *StopChargingByButton;
  1496. struct json_object *LocalWhiteCard[10];
  1497. struct json_object *LocalWhiteCardArr= json_object_new_array();
  1498. struct json_object *isBilling;
  1499. struct json_object *Currency;
  1500. struct json_object *Fee[24];
  1501. struct json_object *FeeArr= json_object_new_array();
  1502. struct json_object *ChargingInfo1;
  1503. struct json_object *ChargingInfo2;
  1504. struct json_object *ChargingInfo3;
  1505. struct json_object *StartUserId[3];
  1506. struct json_object *StartDateTime[3];
  1507. struct json_object *StopDateTime[3];
  1508. struct json_object *StartMethod[3];
  1509. struct json_object *ConnectorTemp[3];
  1510. struct json_object *ChillerTemp[3];
  1511. struct json_object *PresentChargingVoltage[3];
  1512. struct json_object *PresentChargingCurrent[3];
  1513. struct json_object *PresentChargingPower[3];
  1514. struct json_object *PresentChargedEnergy[3];
  1515. struct json_object *PresentChargedDuration[3];
  1516. struct json_object *RemainChargingDuration[3];
  1517. struct json_object *EvBatteryMaxVoltage[3];
  1518. struct json_object *EvBatterytargetVoltage[3];
  1519. struct json_object *EvBatterySoc[3];
  1520. struct json_object *SystemStatus[3];
  1521. struct json_object *EvBatterytargetCurrent[3];
  1522. struct json_object *PowerConsumption[3];
  1523. struct json_object *isCalibratedVaGain[3];
  1524. struct json_object *isCalibratedVbGain[3];
  1525. struct json_object *isCalibratedVcGain[3];
  1526. struct json_object *isCalibratedVaOffset[3];
  1527. struct json_object *isCalibratedVbOffset[3];
  1528. struct json_object *isCalibratedVcOffset[3];
  1529. struct json_object *isCalibratedCaGain[3];
  1530. struct json_object *isCalibratedCbGain[3];
  1531. struct json_object *isCalibratedCcGain[3];
  1532. struct json_object *isCalibratedCaOffset[3];
  1533. struct json_object *isCalibratedCbOffset[3];
  1534. struct json_object *isCalibratedCcOffset[3];
  1535. struct json_object *isCalibratedPa[3];
  1536. struct json_object *isCalibratedPb[3];
  1537. struct json_object *isCalibratedPc[3];
  1538. /* for DO & DD*/
  1539. struct json_object *DDChargingInfo1;
  1540. struct json_object *DDChargingInfo2;
  1541. struct json_object *DDChargingInfo3;
  1542. struct json_object *DDChargingInfo4;
  1543. struct json_object *DDStartUserId[4];
  1544. struct json_object *DDStartDateTime[4];
  1545. struct json_object *DDStopDateTime[4];
  1546. struct json_object *DDStartMethod[4];
  1547. struct json_object *DDConnectorTemp[4];
  1548. struct json_object *DDChillerTemp[4];
  1549. struct json_object *DDPresentChargingVoltage[4];
  1550. struct json_object *DDPresentChargingCurrent[4];
  1551. struct json_object *DDPresentChargingPower[4];
  1552. struct json_object *DDPresentChargedEnergy[4];
  1553. struct json_object *DDPresentChargedDuration[4];
  1554. struct json_object *DDRemainChargingDuration[4];
  1555. struct json_object *DDEvBatteryMaxVoltage[4];
  1556. struct json_object *DDEvBatterytargetVoltage[4];
  1557. struct json_object *DDEvBatterySoc[4];
  1558. struct json_object *DDSystemStatus[4];
  1559. struct json_object *DDEvBatterytargetCurrent[4];
  1560. struct json_object *DDPowerConsumption[4];
  1561. //network
  1562. struct json_object *InternetConn;
  1563. struct json_object *FtpServer;
  1564. struct json_object *Eth0DhcpClient;
  1565. struct json_object *Eth0MacAddress;
  1566. struct json_object *Eth0IpAddress;
  1567. struct json_object *Eth0SubmaskAddress;
  1568. struct json_object *Eth0GatewayAddress;
  1569. struct json_object *Eth1DhcpClient;
  1570. struct json_object *Eth1MacAddress;
  1571. struct json_object *Eth1IpAddress;
  1572. struct json_object *Eth1SubmaskAddress;
  1573. struct json_object *Eth1GatewayAddress;
  1574. struct json_object *WifiMode;
  1575. struct json_object *WifiSsid;
  1576. struct json_object *WifiPassword;
  1577. struct json_object *WifiRssi;
  1578. struct json_object *WifiDhcpServer;
  1579. struct json_object *WifiDhcpClient;
  1580. struct json_object *WifiMacAddress;
  1581. struct json_object *WifiIpAddress;
  1582. struct json_object *WifiSubmaskAddress;
  1583. struct json_object *WifiGatewayAddress;
  1584. struct json_object *WifiNetworkConn;
  1585. struct json_object *TelcomApn;
  1586. struct json_object *TelcomRssi;
  1587. struct json_object *TelcomChapPapId;
  1588. struct json_object *TelcomChapPapPwd;
  1589. struct json_object *TelcomModemImei;
  1590. struct json_object *TelcomSimImsi;
  1591. struct json_object *TelcomSimIccid;
  1592. struct json_object *TelcomSimStatus;
  1593. struct json_object *TelcomModemMode;
  1594. struct json_object *TelcomIpAddress;
  1595. struct json_object *TelcomNetworkConn;
  1596. struct json_object *TelcomEnabled;
  1597. //backend
  1598. struct json_object *BackendConnTimeout;
  1599. struct json_object *OfflinePolicy;
  1600. struct json_object *OfflineMaxChargeEnergy;
  1601. struct json_object *OfflineMaxChargeDuration;
  1602. struct json_object *OcppConnStatus;
  1603. struct json_object *MaintainServerConnStatus;
  1604. struct json_object *OcppServerURL;
  1605. struct json_object *ChargeBoxId;
  1606. struct json_object *chargePointVendor;
  1607. struct json_object *OcppSecurityProfile;
  1608. struct json_object *OcppSecurityPassword;
  1609. struct json_object *MaintainServerSecurityProfile;
  1610. struct json_object *MaintainServerSecurityPassword;
  1611. struct json_object *isEnableLocalPowerSharging;
  1612. struct json_object *OcppReceiptrURL;
  1613. struct json_object *MaintainServerURL;
  1614. /*for TTIA*/
  1615. struct json_object *isEnableTTIA;
  1616. struct json_object *server_addr;
  1617. struct json_object *server_port;
  1618. struct json_object *busVenderId;
  1619. struct json_object *EquipmentProvider;
  1620. struct json_object *TransportationCompanyNo;
  1621. struct json_object *TTIAChargeBoxId;
  1622. struct json_object *evseStation;
  1623. jobj1=json_object_new_object();
  1624. jobj2=json_object_new_object();
  1625. jobj3=json_object_new_object();
  1626. jobj4=json_object_new_object();
  1627. //system
  1628. ModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ModelName);
  1629. AcModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AcModelName);
  1630. SerialNumber = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber);
  1631. SystemId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SystemId);
  1632. AcPhaseCount = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPhaseCount);
  1633. PhaseLossPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy);
  1634. FactoryConfiguration = json_object_new_int(ShmSysConfigAndInfo->SysInfo.FactoryConfiguration);
  1635. AuthorisationMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
  1636. DefaultLanguage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.DefaultLanguage);
  1637. InputVoltageR = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageR);
  1638. InputVoltageS = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageS);
  1639. InputVoltageT = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageT);
  1640. InputVoltageDc = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageDc);
  1641. SystemFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed);
  1642. PsuFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed);
  1643. RfidCardNumEndian = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
  1644. PsuAcInputType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PsuAcInputType);
  1645. RatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RatingCurrent);
  1646. AcRatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcRatingCurrent);
  1647. isAPP = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAPP);
  1648. isQRCode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isQRCode);
  1649. isRFID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isRFID);
  1650. QRCodeMadeMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
  1651. QRCodeContent = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent);
  1652. Intensity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity);
  1653. isAuthrizeByEVCCID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID);
  1654. AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
  1655. AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
  1656. AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
  1657. AuxPower48V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower48V);
  1658. CsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
  1659. CsuBootLoadFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
  1660. CsuKernelFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
  1661. CsuRootFsFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
  1662. CsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
  1663. LcmHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
  1664. LcmFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
  1665. PsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
  1666. PsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
  1667. PsuSecFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
  1668. AuxPwrHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
  1669. AuxPwrFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
  1670. FanModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
  1671. FanModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
  1672. RelayModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
  1673. RelayModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
  1674. TelcomModemFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
  1675. Connector1FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector1FwRev);
  1676. Connector2FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector2FwRev);
  1677. LedModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LedModuleFwRev);
  1678. SystemAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
  1679. SystemCriticalTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
  1680. CcsConnectorTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
  1681. PsuAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp);
  1682. AcPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPlugInTimes);
  1683. GbPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.GbPlugInTimes);
  1684. Ccs1PlugInTime = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime);
  1685. Ccs2PlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes);
  1686. ChademoPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes);
  1687. FirmwareUpdate = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
  1688. if(strcmp(IsAcDc, "D") == 0){
  1689. for(int i=0;i<PsuQuantity;i++){
  1690. FwPrimaryVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwPrimaryVersion);
  1691. FwSecondVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwSecondVersion);
  1692. json_object_array_add(FwPrimaryVersionArr,FwPrimaryVersion[i]);
  1693. json_object_array_add(FwSecondVersionArr,FwSecondVersion[i]);
  1694. }
  1695. }
  1696. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
  1697. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=0;
  1698. DispenserQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity);
  1699. TotalConnectorQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity);
  1700. int DDDispenserQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity;
  1701. for(int i=0;i<DDDispenserQuantity;i++){
  1702. DDModelName[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ModelName);
  1703. DDSerialNumber[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].SerialNumber);
  1704. DDSystemId[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].SystemId);
  1705. DDAuthorisationMode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].AuthorisationMode);
  1706. DDRfidCardNumEndian[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].RfidCardNumEndian);
  1707. DDisAPP[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isAPP);
  1708. DDisQRCode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isQRCode);
  1709. DDisRFID[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isRFID);
  1710. DDQRCodeMadeMode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].QRCodeMadeMode);
  1711. DDQRCodeContent[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].QRCodeContent);
  1712. DDFactoryConfiguration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].FactoryConfiguration);
  1713. DDCsuBootLoadFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuBootLoadFwRev);
  1714. DDCsuKernelFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuKernelFwRev);
  1715. DDCsuRootFsFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuRootFsFwRev);
  1716. DDCsuPrimFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuPrimFwRev);
  1717. DDLcmFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LcmFwRev);
  1718. DDPsuPrimFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].PsuPrimFwRev);
  1719. DDPsuSecFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].PsuSecFwRev);
  1720. DDFanModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].FanModuleFwRev);
  1721. DDRelayModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].RelayModuleFwRev);
  1722. DDTelcomModemFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].TelcomModemFwRev);
  1723. DDLedModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LedModuleFwRev);
  1724. DDConnector1FwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].Connector1FwRev);
  1725. DDConnector2FwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].Connector2FwRev);
  1726. DDIntensity[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LedInfo.Intensity);
  1727. json_object_array_add(DDModelNameArr,DDModelName[i]);
  1728. json_object_array_add(DDSerialNumberArr,DDSerialNumber[i]);
  1729. json_object_array_add(DDSystemIdArr,DDSystemId[i]);
  1730. json_object_array_add(DDAuthorisationModeArr,DDAuthorisationMode[i]);
  1731. json_object_array_add(DDRfidCardNumEndianArr,DDRfidCardNumEndian[i]);
  1732. json_object_array_add(DDisAPPArr,DDisAPP[i]);
  1733. json_object_array_add(DDisQRCodeArr,DDisQRCode[i]);
  1734. json_object_array_add(DDisRFIDArr,DDisRFID[i]);
  1735. json_object_array_add(DDQRCodeMadeModeArr,DDQRCodeMadeMode[i]);
  1736. json_object_array_add(DDQRCodeContentArr,DDQRCodeContent[i]);
  1737. json_object_array_add(DDFactoryConfigurationArr,DDFactoryConfiguration[i]);
  1738. json_object_array_add(DDCsuBootLoadFwRevArr,DDCsuBootLoadFwRev[i]);
  1739. json_object_array_add(DDCsuKernelFwRevArr,DDCsuKernelFwRev[i]);
  1740. json_object_array_add(DDCsuRootFsFwRevArr,DDCsuRootFsFwRev[i]);
  1741. json_object_array_add(DDCsuPrimFwRevArr,DDCsuPrimFwRev[i]);
  1742. json_object_array_add(DDLcmFwRevArr,DDLcmFwRev[i]);
  1743. json_object_array_add(DDPsuPrimFwRevArr,DDPsuPrimFwRev[i]);
  1744. json_object_array_add(DDPsuSecFwRevArr,DDPsuSecFwRev[i]);
  1745. json_object_array_add(DDFanModuleFwRevArr,DDFanModuleFwRev[i]);
  1746. json_object_array_add(DDRelayModuleFwRevArr,DDRelayModuleFwRev[i]);
  1747. json_object_array_add(DDTelcomModemFwRevArr,DDTelcomModemFwRev[i]);
  1748. json_object_array_add(DDLedModuleFwRevArr,DDLedModuleFwRev[i]);
  1749. json_object_array_add(DDConnector1FwRevArr,DDConnector1FwRev[i]);
  1750. json_object_array_add(DDConnector2FwRevArr,DDConnector2FwRev[i]);
  1751. json_object_array_add(DDIntensityArr,DDIntensity[i]);
  1752. }
  1753. Relay2ModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Relay2ModuleFwRev);
  1754. }
  1755. //charging
  1756. int CcsGunQty=0;
  1757. int GbGunQty=0;
  1758. int CHAdeMOGunQty=0;
  1759. int AcGunQty=0;
  1760. ChargingInfo1=json_object_new_object();
  1761. ChargingInfo2=json_object_new_object();
  1762. ChargingInfo3=json_object_new_object();
  1763. MaxChargingEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
  1764. MaxChargingPower = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
  1765. MaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
  1766. AcMaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent);
  1767. MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
  1768. StopChargingByButton = json_object_new_int(ShmSysConfigAndInfo->SysConfig.StopChargingByButton);
  1769. LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
  1770. LocalWhiteCard[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
  1771. LocalWhiteCard[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
  1772. LocalWhiteCard[3] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
  1773. LocalWhiteCard[4] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
  1774. LocalWhiteCard[5] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
  1775. LocalWhiteCard[6] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
  1776. LocalWhiteCard[7] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
  1777. LocalWhiteCard[8] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
  1778. LocalWhiteCard[9] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
  1779. isBilling = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling);
  1780. Currency = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.Currency);
  1781. Fee[0] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0]);
  1782. Fee[1] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1]);
  1783. Fee[2] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2]);
  1784. Fee[3] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3]);
  1785. Fee[4] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4]);
  1786. Fee[5] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5]);
  1787. Fee[6] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6]);
  1788. Fee[7] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7]);
  1789. Fee[8] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8]);
  1790. Fee[9] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9]);
  1791. Fee[10] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10]);
  1792. Fee[11] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11]);
  1793. Fee[12] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12]);
  1794. Fee[13] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13]);
  1795. Fee[14] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14]);
  1796. Fee[15] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15]);
  1797. Fee[16] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16]);
  1798. Fee[17] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17]);
  1799. Fee[18] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18]);
  1800. Fee[19] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19]);
  1801. Fee[20] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20]);
  1802. Fee[21] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21]);
  1803. Fee[22] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22]);
  1804. Fee[23] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23]);
  1805. if(connectorType1 != 0){
  1806. if(connectorType1 == 1){//CCS
  1807. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1808. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1809. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1810. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1811. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1812. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1813. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1814. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1815. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1816. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1817. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1818. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1819. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1820. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1821. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1822. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  1823. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1824. }
  1825. else{
  1826. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  1827. }
  1828. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  1829. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  1830. }
  1831. else{
  1832. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  1833. }
  1834. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  1835. CcsGunQty++;
  1836. }
  1837. else if(connectorType1 == 2){//GB
  1838. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1839. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1840. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1841. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1842. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1843. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1844. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1845. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1846. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1847. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1848. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1849. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1850. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1851. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1852. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1853. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  1854. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1855. }
  1856. else{
  1857. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  1858. }
  1859. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  1860. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  1861. }
  1862. else{
  1863. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  1864. }
  1865. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  1866. GbGunQty++;
  1867. }
  1868. else if(connectorType1 == 3){//CHAdeMO
  1869. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  1870. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  1871. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  1872. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  1873. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  1874. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  1875. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  1876. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  1877. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  1878. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  1879. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  1880. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  1881. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  1882. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  1883. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  1884. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  1885. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  1886. }
  1887. else{
  1888. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  1889. }
  1890. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  1891. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  1892. }
  1893. else{
  1894. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  1895. }
  1896. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  1897. CHAdeMOGunQty++;
  1898. }
  1899. else if(connectorType1 == 4){//AC
  1900. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  1901. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  1902. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  1903. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  1904. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  1905. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  1906. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  1907. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  1908. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  1909. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  1910. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  1911. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  1912. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  1913. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  1914. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  1915. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  1916. ChillerTemp[0] = json_object_new_int(255);
  1917. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  1918. if(strcmp(IsDO, "AX") == 0){
  1919. isCalibratedVaGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  1920. isCalibratedVbGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  1921. isCalibratedVcGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  1922. isCalibratedVaOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  1923. isCalibratedVbOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  1924. isCalibratedVcOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  1925. isCalibratedCaGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  1926. isCalibratedCbGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  1927. isCalibratedCcGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  1928. isCalibratedCaOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  1929. isCalibratedCbOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  1930. isCalibratedCcOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  1931. isCalibratedPa[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  1932. isCalibratedPb[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  1933. isCalibratedPc[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  1934. }
  1935. AcGunQty++;
  1936. }
  1937. }
  1938. if(connectorType2 != 0){
  1939. if(connectorType2 == 1){//CCS
  1940. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  1941. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  1942. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  1943. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  1944. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  1945. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  1946. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  1947. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  1948. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  1949. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  1950. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  1951. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  1952. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  1953. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  1954. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  1955. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  1956. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  1957. }
  1958. else{
  1959. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  1960. }
  1961. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  1962. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  1963. }
  1964. else{
  1965. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  1966. }
  1967. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  1968. CcsGunQty++;
  1969. }
  1970. else if(connectorType2 == 2){//GB
  1971. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  1972. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  1973. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  1974. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  1975. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  1976. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  1977. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  1978. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  1979. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  1980. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  1981. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  1982. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  1983. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  1984. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  1985. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  1986. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  1987. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  1988. }
  1989. else{
  1990. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  1991. }
  1992. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  1993. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  1994. }
  1995. else{
  1996. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  1997. }
  1998. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  1999. GbGunQty++;
  2000. }
  2001. else if(connectorType2 == 3){//CHAdeMO
  2002. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2003. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2004. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2005. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2006. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2007. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2008. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2009. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2010. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2011. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2012. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2013. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2014. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2015. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2016. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2017. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2018. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2019. }
  2020. else{
  2021. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2022. }
  2023. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2024. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2025. }
  2026. else{
  2027. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2028. }
  2029. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2030. CHAdeMOGunQty++;
  2031. }
  2032. else if(connectorType2 == 4){//AC
  2033. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2034. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2035. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2036. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2037. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2038. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2039. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2040. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2041. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2042. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2043. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2044. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2045. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2046. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2047. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2048. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2049. ChillerTemp[1] = json_object_new_int(255);
  2050. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2051. if(strcmp(IsDO, "AX") == 0){
  2052. isCalibratedVaGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2053. isCalibratedVbGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2054. isCalibratedVcGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2055. isCalibratedVaOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2056. isCalibratedVbOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2057. isCalibratedVcOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2058. isCalibratedCaGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2059. isCalibratedCbGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2060. isCalibratedCcGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2061. isCalibratedCaOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2062. isCalibratedCbOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2063. isCalibratedCcOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2064. isCalibratedPa[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2065. isCalibratedPb[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2066. isCalibratedPc[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2067. }
  2068. AcGunQty++;
  2069. }
  2070. }
  2071. if(connectorType3 != 0){
  2072. if(connectorType3 == 1){//CCS
  2073. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  2074. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  2075. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  2076. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  2077. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  2078. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  2079. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  2080. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  2081. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  2082. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  2083. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  2084. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  2085. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  2086. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  2087. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  2088. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  2089. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  2090. }
  2091. else{
  2092. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  2093. }
  2094. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  2095. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  2096. }
  2097. else{
  2098. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  2099. }
  2100. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  2101. CcsGunQty++;
  2102. }
  2103. else if(connectorType3 == 2){//GB
  2104. PresentChargingVoltage[2]= json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  2105. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  2106. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  2107. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  2108. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  2109. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  2110. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  2111. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  2112. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  2113. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  2114. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  2115. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  2116. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  2117. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  2118. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  2119. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  2120. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  2121. }
  2122. else{
  2123. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  2124. }
  2125. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  2126. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  2127. }
  2128. else{
  2129. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  2130. }
  2131. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  2132. GbGunQty++;
  2133. }
  2134. else if(connectorType3 == 3){//CHAdeMO
  2135. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2136. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2137. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2138. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2139. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2140. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2141. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2142. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2143. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2144. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2145. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2146. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2147. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2148. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2149. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2150. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2151. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2152. }
  2153. else{
  2154. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2155. }
  2156. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2157. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2158. }
  2159. else{
  2160. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2161. }
  2162. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2163. CHAdeMOGunQty++;
  2164. }
  2165. else if(connectorType3 == 4){//AC
  2166. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2167. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2168. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2169. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2170. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2171. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2172. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2173. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2174. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2175. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2176. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2177. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2178. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2179. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2180. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2181. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2182. ChillerTemp[2] = json_object_new_int(255);
  2183. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2184. if(strcmp(IsDO, "AX") == 0){
  2185. isCalibratedVaGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2186. isCalibratedVbGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2187. isCalibratedVcGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2188. isCalibratedVaOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2189. isCalibratedVbOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2190. isCalibratedVcOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2191. isCalibratedCaGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2192. isCalibratedCbGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2193. isCalibratedCcGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2194. isCalibratedCaOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2195. isCalibratedCbOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2196. isCalibratedCcOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2197. isCalibratedPa[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2198. isCalibratedPb[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2199. isCalibratedPc[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2200. }
  2201. AcGunQty++;
  2202. }
  2203. }
  2204. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
  2205. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
  2206. int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
  2207. for(int i=0;i<DDTotalConnectorQuantity;i++){
  2208. DDPresentChargingVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingVoltage);
  2209. DDPresentChargingCurrent[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingCurrent);
  2210. DDPresentChargingPower[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingPower);
  2211. DDPresentChargedEnergy[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargedEnergy);
  2212. DDPresentChargedDuration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargedDuration);
  2213. DDRemainChargingDuration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.RemainChargingDuration);
  2214. DDEvBatteryMaxVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatteryMaxVoltage);
  2215. DDEvBatterytargetVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterytargetVoltage);
  2216. DDEvBatterySoc[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterySoc);
  2217. DDSystemStatus[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.SystemStatus);
  2218. DDEvBatterytargetCurrent[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterytargetCurrent);
  2219. DDStartUserId[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartUserId);
  2220. DDStartDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartDateTime);
  2221. DDStopDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StopDateTime);
  2222. DDStartMethod[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartMethod);
  2223. if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 255){
  2224. DDConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp);
  2225. }
  2226. else{
  2227. DDConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp-60);
  2228. }
  2229. if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 255){
  2230. DDChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp);
  2231. }
  2232. else{
  2233. DDChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp-60);
  2234. }
  2235. DDPowerConsumption[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PowerConsumption);
  2236. }
  2237. }
  2238. //network
  2239. InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
  2240. FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
  2241. Eth0DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient);
  2242. Eth0MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
  2243. Eth0IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
  2244. Eth0SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
  2245. Eth0GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
  2246. Eth1DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient);
  2247. Eth1MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
  2248. Eth1IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
  2249. Eth1SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
  2250. Eth1GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
  2251. WifiMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
  2252. WifiSsid = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
  2253. WifiPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
  2254. WifiRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
  2255. WifiDhcpServer = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer);
  2256. WifiDhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient);
  2257. WifiMacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
  2258. WifiIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
  2259. WifiSubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
  2260. WifiGatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
  2261. WifiNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn);
  2262. TelcomApn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
  2263. TelcomRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
  2264. TelcomChapPapId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
  2265. TelcomChapPapPwd = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
  2266. TelcomModemImei = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
  2267. TelcomSimImsi = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
  2268. TelcomSimIccid = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid);
  2269. TelcomSimStatus = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus);
  2270. TelcomModemMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode);
  2271. TelcomIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
  2272. TelcomNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn);
  2273. TelcomEnabled = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled);
  2274. //backend
  2275. BackendConnTimeout = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
  2276. OfflinePolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
  2277. OfflineMaxChargeEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
  2278. OfflineMaxChargeDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
  2279. OcppConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.OcppConnStatus);
  2280. MaintainServerConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus);
  2281. OcppServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL);
  2282. ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
  2283. OcppSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile);
  2284. OcppSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword);
  2285. MaintainServerSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile);
  2286. MaintainServerSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword);
  2287. chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
  2288. MaintainServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
  2289. if(strcmp(IsDO, "AX") == 0){
  2290. isEnableLocalPowerSharging = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging);
  2291. OcppReceiptrURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL);
  2292. }
  2293. /*for TTIA*/
  2294. if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){
  2295. isEnableTTIA = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA);
  2296. server_addr = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr);
  2297. server_port = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port);
  2298. busVenderId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.busVenderId);
  2299. EquipmentProvider = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.EquipmentProvider);
  2300. TransportationCompanyNo = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.TransportationCompanyNo);
  2301. TTIAChargeBoxId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId);
  2302. evseStation = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation);
  2303. }
  2304. //system
  2305. json_object_object_add(jobj1,"ModelName",ModelName);
  2306. json_object_object_add(jobj1,"AcModelName",AcModelName);
  2307. json_object_object_add(jobj1,"SerialNumber",SerialNumber);
  2308. json_object_object_add(jobj1,"SystemId",SystemId);
  2309. json_object_object_add(jobj1,"AcPhaseCount",AcPhaseCount);
  2310. json_object_object_add(jobj1,"PhaseLossPolicy",PhaseLossPolicy);
  2311. json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
  2312. json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
  2313. json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
  2314. json_object_object_add(jobj1,"InputVoltageR",InputVoltageR);
  2315. json_object_object_add(jobj1,"InputVoltageS",InputVoltageS);
  2316. json_object_object_add(jobj1,"InputVoltageT",InputVoltageT);
  2317. json_object_object_add(jobj1,"InputVoltageDc",InputVoltageDc);
  2318. json_object_object_add(jobj1,"SystemFanRotaSpeed",SystemFanRotaSpeed);
  2319. json_object_object_add(jobj1,"PsuFanRotaSpeed",PsuFanRotaSpeed);
  2320. json_object_object_add(jobj1,"RfidCardNumEndian",RfidCardNumEndian);
  2321. json_object_object_add(jobj1,"PsuAcInputType",PsuAcInputType);
  2322. json_object_object_add(jobj1,"RatingCurrent",RatingCurrent);
  2323. json_object_object_add(jobj1,"AcRatingCurrent",AcRatingCurrent);
  2324. json_object_object_add(jobj1,"isAPP",isAPP);
  2325. json_object_object_add(jobj1,"isQRCode",isQRCode);
  2326. json_object_object_add(jobj1,"isRFID",isRFID);
  2327. json_object_object_add(jobj1,"QRCodeMadeMode",QRCodeMadeMode);
  2328. json_object_object_add(jobj1,"QRCodeContent",QRCodeContent);
  2329. json_object_object_add(jobj1,"Intensity",Intensity);
  2330. json_object_object_add(jobj1,"isAuthrizeByEVCCID",isAuthrizeByEVCCID);
  2331. json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
  2332. json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
  2333. json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
  2334. json_object_object_add(jobj1,"AuxPower48V",AuxPower48V);
  2335. json_object_object_add(jobj1,"CsuHwRev",CsuHwRev);
  2336. json_object_object_add(jobj1,"CsuBootLoadFwRev",CsuBootLoadFwRev);
  2337. json_object_object_add(jobj1,"CsuKernelFwRev",CsuKernelFwRev);
  2338. json_object_object_add(jobj1,"CsuRootFsFwRev",CsuRootFsFwRev);
  2339. json_object_object_add(jobj1,"CsuPrimFwRev",CsuPrimFwRev);
  2340. json_object_object_add(jobj1,"LcmHwRev",LcmHwRev);
  2341. json_object_object_add(jobj1,"LcmFwRev",LcmFwRev);
  2342. json_object_object_add(jobj1,"PsuHwRev",PsuHwRev);
  2343. json_object_object_add(jobj1,"PsuPrimFwRev",PsuPrimFwRev);
  2344. json_object_object_add(jobj1,"PsuSecFwRev",PsuSecFwRev);
  2345. json_object_object_add(jobj1,"AuxPwrHwRev",AuxPwrHwRev);
  2346. json_object_object_add(jobj1,"AuxPwrFwRev",AuxPwrFwRev);
  2347. json_object_object_add(jobj1,"FanModuleHwRev",FanModuleHwRev);
  2348. json_object_object_add(jobj1,"FanModuleFwRev",FanModuleFwRev);
  2349. json_object_object_add(jobj1,"RelayModuleHwRev",RelayModuleHwRev);
  2350. json_object_object_add(jobj1,"RelayModuleFwRev",RelayModuleFwRev);
  2351. json_object_object_add(jobj1,"TelcomModemFwRev",TelcomModemFwRev);
  2352. json_object_object_add(jobj1,"Connector1FwRev",Connector1FwRev);
  2353. json_object_object_add(jobj1,"Connector2FwRev",Connector2FwRev);
  2354. json_object_object_add(jobj1,"LedModuleFwRev",LedModuleFwRev);
  2355. json_object_object_add(jobj1,"SystemAmbientTemp",SystemAmbientTemp);
  2356. json_object_object_add(jobj1,"SystemCriticalTemp",SystemCriticalTemp);
  2357. json_object_object_add(jobj1,"CcsConnectorTemp",CcsConnectorTemp);
  2358. json_object_object_add(jobj1,"PsuAmbientTemp",PsuAmbientTemp);
  2359. json_object_object_add(jobj1,"AcPlugInTimes",AcPlugInTimes);
  2360. json_object_object_add(jobj1,"GbPlugInTimes",GbPlugInTimes);
  2361. json_object_object_add(jobj1,"Ccs1PlugInTimes",Ccs1PlugInTime);
  2362. json_object_object_add(jobj1,"Ccs2PlugInTimes",Ccs2PlugInTimes);
  2363. json_object_object_add(jobj1,"ChademoPlugInTimes",ChademoPlugInTimes);
  2364. json_object_object_add(jobj1,"FirmwareUpdate",FirmwareUpdate);
  2365. if(strcmp(IsAcDc, "D") == 0){
  2366. json_object_object_add(jobj1,"FwPrimaryVersion",FwPrimaryVersionArr);
  2367. json_object_object_add(jobj1,"FwSecondVersion",FwSecondVersionArr);
  2368. }
  2369. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
  2370. json_object_object_add(jobj1,"DispenserQuantity",DispenserQuantity);
  2371. json_object_object_add(jobj1,"TotalConnectorQuantity",TotalConnectorQuantity);
  2372. json_object_object_add(jobj1,"DDModelName",DDModelNameArr);
  2373. json_object_object_add(jobj1,"DDSerialNumber",DDSerialNumberArr);
  2374. json_object_object_add(jobj1,"DDSystemId",DDSystemIdArr);
  2375. json_object_object_add(jobj1,"DDAuthorisationMode",DDAuthorisationModeArr);
  2376. json_object_object_add(jobj1,"DDRfidCardNumEndian",DDRfidCardNumEndianArr);
  2377. json_object_object_add(jobj1,"DDisAPP",DDisAPPArr);
  2378. json_object_object_add(jobj1,"DDisQRCode",DDisQRCodeArr);
  2379. json_object_object_add(jobj1,"DDisRFID",DDisRFIDArr);
  2380. json_object_object_add(jobj1,"DDQRCodeMadeMode",DDQRCodeMadeModeArr);
  2381. json_object_object_add(jobj1,"DDQRCodeContent",DDQRCodeContentArr);
  2382. json_object_object_add(jobj1,"DDFactoryConfiguration",DDFactoryConfigurationArr);
  2383. json_object_object_add(jobj1,"DDCsuBootLoadFwRev",DDCsuBootLoadFwRevArr);
  2384. json_object_object_add(jobj1,"DDCsuKernelFwRev",DDCsuKernelFwRevArr);
  2385. json_object_object_add(jobj1,"DDCsuRootFsFwRev",DDCsuRootFsFwRevArr);
  2386. json_object_object_add(jobj1,"DDCsuPrimFwRev",DDCsuPrimFwRevArr);
  2387. json_object_object_add(jobj1,"DDLcmFwRev",DDLcmFwRevArr);
  2388. json_object_object_add(jobj1,"DDPsuPrimFwRev",DDPsuPrimFwRevArr);
  2389. json_object_object_add(jobj1,"DDPsuSecFwRev",DDPsuSecFwRevArr);
  2390. json_object_object_add(jobj1,"DDFanModuleFwRev",DDFanModuleFwRevArr);
  2391. json_object_object_add(jobj1,"DDRelayModuleFwRev",DDRelayModuleFwRevArr);
  2392. json_object_object_add(jobj1,"DDTelcomModemFwRev",DDTelcomModemFwRevArr);
  2393. json_object_object_add(jobj1,"DDLedModuleFwRev",DDLedModuleFwRevArr);
  2394. json_object_object_add(jobj1,"DDConnector1FwRev",DDConnector1FwRevArr);
  2395. json_object_object_add(jobj1,"DDConnector2FwRev",DDConnector2FwRevArr);
  2396. json_object_object_add(jobj1,"DDIntensity",DDIntensityArr);
  2397. json_object_object_add(jobj1,"Relay2ModuleFwRev",Relay2ModuleFwRev);
  2398. }
  2399. printf("%s\n", json_object_to_json_string(jobj1));
  2400. json_object_put(jobj1);
  2401. //charging
  2402. json_object_object_add(jobj2,"MaxChargingEnergy",MaxChargingEnergy);
  2403. json_object_object_add(jobj2,"MaxChargingPower",MaxChargingPower);
  2404. json_object_object_add(jobj2,"MaxChargingCurrent",MaxChargingCurrent);
  2405. json_object_object_add(jobj2,"AcMaxChargingCurrent",AcMaxChargingCurrent);
  2406. json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
  2407. json_object_object_add(jobj2,"StopChargingByButton",StopChargingByButton);
  2408. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
  2409. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
  2410. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);
  2411. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[3]);
  2412. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[4]);
  2413. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[5]);
  2414. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[6]);
  2415. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[7]);
  2416. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[8]);
  2417. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[9]);
  2418. json_object_object_add(jobj2,"LocalWhiteCard",LocalWhiteCardArr);
  2419. json_object_object_add(jobj2,"isBilling",isBilling);
  2420. json_object_object_add(jobj2,"Currency",Currency);
  2421. json_object_array_add(FeeArr,Fee[0]);
  2422. json_object_array_add(FeeArr,Fee[1]);
  2423. json_object_array_add(FeeArr,Fee[2]);
  2424. json_object_array_add(FeeArr,Fee[3]);
  2425. json_object_array_add(FeeArr,Fee[4]);
  2426. json_object_array_add(FeeArr,Fee[5]);
  2427. json_object_array_add(FeeArr,Fee[6]);
  2428. json_object_array_add(FeeArr,Fee[7]);
  2429. json_object_array_add(FeeArr,Fee[8]);
  2430. json_object_array_add(FeeArr,Fee[9]);
  2431. json_object_array_add(FeeArr,Fee[10]);
  2432. json_object_array_add(FeeArr,Fee[11]);
  2433. json_object_array_add(FeeArr,Fee[12]);
  2434. json_object_array_add(FeeArr,Fee[13]);
  2435. json_object_array_add(FeeArr,Fee[14]);
  2436. json_object_array_add(FeeArr,Fee[15]);
  2437. json_object_array_add(FeeArr,Fee[16]);
  2438. json_object_array_add(FeeArr,Fee[17]);
  2439. json_object_array_add(FeeArr,Fee[18]);
  2440. json_object_array_add(FeeArr,Fee[19]);
  2441. json_object_array_add(FeeArr,Fee[20]);
  2442. json_object_array_add(FeeArr,Fee[21]);
  2443. json_object_array_add(FeeArr,Fee[22]);
  2444. json_object_array_add(FeeArr,Fee[23]);
  2445. json_object_object_add(jobj2,"Fee",FeeArr);
  2446. if(connectorType1 != 0){
  2447. json_object_object_add(ChargingInfo1,"StartUserId",StartUserId[0]);
  2448. json_object_object_add(ChargingInfo1,"StartDateTime",StartDateTime[0]);
  2449. json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
  2450. json_object_object_add(ChargingInfo1,"StartMethod",StartMethod[0]);
  2451. json_object_object_add(ChargingInfo1,"ConnectorTemp",ConnectorTemp[0]);
  2452. json_object_object_add(ChargingInfo1,"ChillerTemp",ChillerTemp[0]);
  2453. json_object_object_add(ChargingInfo1,"PresentChargingVoltage",PresentChargingVoltage[0]);
  2454. json_object_object_add(ChargingInfo1,"PresentChargingCurrent",PresentChargingCurrent[0]);
  2455. json_object_object_add(ChargingInfo1,"PresentChargingPower",PresentChargingPower[0]);
  2456. json_object_object_add(ChargingInfo1,"PresentChargedEnergy",PresentChargedEnergy[0]);
  2457. json_object_object_add(ChargingInfo1,"PresentChargedDuration",PresentChargedDuration[0]);
  2458. json_object_object_add(ChargingInfo1,"RemainChargingDuration",RemainChargingDuration[0]);
  2459. json_object_object_add(ChargingInfo1,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[0]);
  2460. json_object_object_add(ChargingInfo1,"EvBatterytargetVoltage",EvBatterytargetVoltage[0]);
  2461. json_object_object_add(ChargingInfo1,"EvBatterySoc",EvBatterySoc[0]);
  2462. json_object_object_add(ChargingInfo1,"SystemStatus",SystemStatus[0]);
  2463. json_object_object_add(ChargingInfo1,"EvBatterytargetCurrent",EvBatterytargetCurrent[0]);
  2464. json_object_object_add(ChargingInfo1,"PowerConsumption",PowerConsumption[0]);
  2465. if(strcmp(IsDO, "AX") == 0){
  2466. json_object_object_add(ChargingInfo1,"isCalibratedVaGain",isCalibratedVaGain[0]);
  2467. json_object_object_add(ChargingInfo1,"isCalibratedVbGain",isCalibratedVbGain[0]);
  2468. json_object_object_add(ChargingInfo1,"isCalibratedVcGain",isCalibratedVcGain[0]);
  2469. json_object_object_add(ChargingInfo1,"isCalibratedVaOffset",isCalibratedVaOffset[0]);
  2470. json_object_object_add(ChargingInfo1,"isCalibratedVbOffset",isCalibratedVbOffset[0]);
  2471. json_object_object_add(ChargingInfo1,"isCalibratedVcOffset",isCalibratedVcOffset[0]);
  2472. json_object_object_add(ChargingInfo1,"isCalibratedCaGain",isCalibratedCaGain[0]);
  2473. json_object_object_add(ChargingInfo1,"isCalibratedCbGain",isCalibratedCbGain[0]);
  2474. json_object_object_add(ChargingInfo1,"isCalibratedCcGain",isCalibratedCcGain[0]);
  2475. json_object_object_add(ChargingInfo1,"isCalibratedCaOffset",isCalibratedCaOffset[0]);
  2476. json_object_object_add(ChargingInfo1,"isCalibratedCbOffset",isCalibratedCbOffset[0]);
  2477. json_object_object_add(ChargingInfo1,"isCalibratedCcOffset",isCalibratedCcOffset[0]);
  2478. json_object_object_add(ChargingInfo1,"isCalibratedPa",isCalibratedPa[0]);
  2479. json_object_object_add(ChargingInfo1,"isCalibratedPb",isCalibratedPb[0]);
  2480. json_object_object_add(ChargingInfo1,"isCalibratedPc",isCalibratedPc[0]);
  2481. }
  2482. json_object_object_add(jobj2,"ChargingInfo1",ChargingInfo1);
  2483. }
  2484. if(connectorType2 != 0){
  2485. json_object_object_add(ChargingInfo2,"StartUserId",StartUserId[1]);
  2486. json_object_object_add(ChargingInfo2,"StartDateTime",StartDateTime[1]);
  2487. json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
  2488. json_object_object_add(ChargingInfo2,"StartMethod",StartMethod[1]);
  2489. json_object_object_add(ChargingInfo2,"ConnectorTemp",ConnectorTemp[1]);
  2490. json_object_object_add(ChargingInfo2,"ChillerTemp",ChillerTemp[1]);
  2491. json_object_object_add(ChargingInfo2,"PresentChargingVoltage",PresentChargingVoltage[1]);
  2492. json_object_object_add(ChargingInfo2,"PresentChargingCurrent",PresentChargingCurrent[1]);
  2493. json_object_object_add(ChargingInfo2,"PresentChargingPower",PresentChargingPower[1]);
  2494. json_object_object_add(ChargingInfo2,"PresentChargedEnergy",PresentChargedEnergy[1]);
  2495. json_object_object_add(ChargingInfo2,"PresentChargedDuration",PresentChargedDuration[1]);
  2496. json_object_object_add(ChargingInfo2,"RemainChargingDuration",RemainChargingDuration[1]);
  2497. json_object_object_add(ChargingInfo2,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[1]);
  2498. json_object_object_add(ChargingInfo2,"EvBatterytargetVoltage",EvBatterytargetVoltage[1]);
  2499. json_object_object_add(ChargingInfo2,"EvBatterySoc",EvBatterySoc[1]);
  2500. json_object_object_add(ChargingInfo2,"SystemStatus",SystemStatus[1]);
  2501. json_object_object_add(ChargingInfo2,"EvBatterytargetCurrent",EvBatterytargetCurrent[1]);
  2502. json_object_object_add(ChargingInfo2,"PowerConsumption",PowerConsumption[1]);
  2503. if(strcmp(IsDO, "AX") == 0){
  2504. json_object_object_add(ChargingInfo2,"isCalibratedVaGain",isCalibratedVaGain[1]);
  2505. json_object_object_add(ChargingInfo2,"isCalibratedVbGain",isCalibratedVbGain[1]);
  2506. json_object_object_add(ChargingInfo2,"isCalibratedVcGain",isCalibratedVcGain[1]);
  2507. json_object_object_add(ChargingInfo2,"isCalibratedVaOffset",isCalibratedVaOffset[1]);
  2508. json_object_object_add(ChargingInfo2,"isCalibratedVbOffset",isCalibratedVbOffset[1]);
  2509. json_object_object_add(ChargingInfo2,"isCalibratedVcOffset",isCalibratedVcOffset[1]);
  2510. json_object_object_add(ChargingInfo2,"isCalibratedCaGain",isCalibratedCaGain[1]);
  2511. json_object_object_add(ChargingInfo2,"isCalibratedCbGain",isCalibratedCbGain[1]);
  2512. json_object_object_add(ChargingInfo2,"isCalibratedCcGain",isCalibratedCcGain[1]);
  2513. json_object_object_add(ChargingInfo2,"isCalibratedCaOffset",isCalibratedCaOffset[1]);
  2514. json_object_object_add(ChargingInfo2,"isCalibratedCbOffset",isCalibratedCbOffset[1]);
  2515. json_object_object_add(ChargingInfo2,"isCalibratedCcOffset",isCalibratedCcOffset[1]);
  2516. json_object_object_add(ChargingInfo2,"isCalibratedPa",isCalibratedPa[1]);
  2517. json_object_object_add(ChargingInfo2,"isCalibratedPb",isCalibratedPb[1]);
  2518. json_object_object_add(ChargingInfo2,"isCalibratedPc",isCalibratedPc[1]);
  2519. }
  2520. json_object_object_add(jobj2,"ChargingInfo2",ChargingInfo2);
  2521. }
  2522. if(connectorType3 != 0){
  2523. json_object_object_add(ChargingInfo3,"StartUserId",StartUserId[2]);
  2524. json_object_object_add(ChargingInfo3,"StartDateTime",StartDateTime[2]);
  2525. json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);
  2526. json_object_object_add(ChargingInfo3,"StartMethod",StartMethod[2]);
  2527. json_object_object_add(ChargingInfo3,"ConnectorTemp",ConnectorTemp[2]);
  2528. json_object_object_add(ChargingInfo3,"ChillerTemp",ChillerTemp[2]);
  2529. json_object_object_add(ChargingInfo3,"PresentChargingVoltage",PresentChargingVoltage[2]);
  2530. json_object_object_add(ChargingInfo3,"PresentChargingCurrent",PresentChargingCurrent[2]);
  2531. json_object_object_add(ChargingInfo3,"PresentChargingPower",PresentChargingPower[2]);
  2532. json_object_object_add(ChargingInfo3,"PresentChargedEnergy",PresentChargedEnergy[2]);
  2533. json_object_object_add(ChargingInfo3,"PresentChargedDuration",PresentChargedDuration[2]);
  2534. json_object_object_add(ChargingInfo3,"RemainChargingDuration",RemainChargingDuration[2]);
  2535. json_object_object_add(ChargingInfo3,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[2]);
  2536. json_object_object_add(ChargingInfo3,"EvBatterytargetVoltage",EvBatterytargetVoltage[2]);
  2537. json_object_object_add(ChargingInfo3,"EvBatterySoc",EvBatterySoc[2]);
  2538. json_object_object_add(ChargingInfo3,"SystemStatus",SystemStatus[2]);
  2539. json_object_object_add(ChargingInfo3,"EvBatterytargetCurrent",EvBatterytargetCurrent[2]);
  2540. json_object_object_add(ChargingInfo3,"PowerConsumption",PowerConsumption[2]);
  2541. if(strcmp(IsDO, "AX") == 0){
  2542. json_object_object_add(ChargingInfo3,"isCalibratedVaGain",isCalibratedVaGain[2]);
  2543. json_object_object_add(ChargingInfo3,"isCalibratedVbGain",isCalibratedVbGain[2]);
  2544. json_object_object_add(ChargingInfo3,"isCalibratedVcGain",isCalibratedVcGain[2]);
  2545. json_object_object_add(ChargingInfo3,"isCalibratedVaOffset",isCalibratedVaOffset[2]);
  2546. json_object_object_add(ChargingInfo3,"isCalibratedVbOffset",isCalibratedVbOffset[2]);
  2547. json_object_object_add(ChargingInfo3,"isCalibratedVcOffset",isCalibratedVcOffset[2]);
  2548. json_object_object_add(ChargingInfo3,"isCalibratedCaGain",isCalibratedCaGain[2]);
  2549. json_object_object_add(ChargingInfo3,"isCalibratedCbGain",isCalibratedCbGain[2]);
  2550. json_object_object_add(ChargingInfo3,"isCalibratedCcGain",isCalibratedCcGain[2]);
  2551. json_object_object_add(ChargingInfo3,"isCalibratedCaOffset",isCalibratedCaOffset[2]);
  2552. json_object_object_add(ChargingInfo3,"isCalibratedCbOffset",isCalibratedCbOffset[2]);
  2553. json_object_object_add(ChargingInfo3,"isCalibratedCcOffset",isCalibratedCcOffset[2]);
  2554. json_object_object_add(ChargingInfo3,"isCalibratedPa",isCalibratedPa[2]);
  2555. json_object_object_add(ChargingInfo3,"isCalibratedPb",isCalibratedPb[2]);
  2556. json_object_object_add(ChargingInfo3,"isCalibratedPc",isCalibratedPc[2]);
  2557. }
  2558. json_object_object_add(jobj2,"ChargingInfo3",ChargingInfo3);
  2559. }
  2560. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
  2561. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4|| ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
  2562. int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
  2563. DDChargingInfo1=json_object_new_object();
  2564. DDChargingInfo2=json_object_new_object();
  2565. DDChargingInfo3=json_object_new_object();
  2566. DDChargingInfo4=json_object_new_object();
  2567. if(DDTotalConnectorQuantity>0){
  2568. json_object_object_add(DDChargingInfo1,"StartUserId",DDStartUserId[0]);
  2569. json_object_object_add(DDChargingInfo1,"StartDateTime",DDStartDateTime[0]);
  2570. json_object_object_add(DDChargingInfo1,"StopDateTime",DDStopDateTime[0]);
  2571. json_object_object_add(DDChargingInfo1,"StartMethod",DDStartMethod[0]);
  2572. json_object_object_add(DDChargingInfo1,"ConnectorTemp",DDConnectorTemp[0]);
  2573. json_object_object_add(DDChargingInfo1,"ChillerTemp",DDChillerTemp[0]);
  2574. json_object_object_add(DDChargingInfo1,"PresentChargingVoltage",DDPresentChargingVoltage[0]);
  2575. json_object_object_add(DDChargingInfo1,"PresentChargingCurrent",DDPresentChargingCurrent[0]);
  2576. json_object_object_add(DDChargingInfo1,"PresentChargingPower",DDPresentChargingPower[0]);
  2577. json_object_object_add(DDChargingInfo1,"PresentChargedEnergy",DDPresentChargedEnergy[0]);
  2578. json_object_object_add(DDChargingInfo1,"PresentChargedDuration",DDPresentChargedDuration[0]);
  2579. json_object_object_add(DDChargingInfo1,"RemainChargingDuration",DDRemainChargingDuration[0]);
  2580. json_object_object_add(DDChargingInfo1,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[0]);
  2581. json_object_object_add(DDChargingInfo1,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[0]);
  2582. json_object_object_add(DDChargingInfo1,"EvBatterySoc",DDEvBatterySoc[0]);
  2583. json_object_object_add(DDChargingInfo1,"SystemStatus",DDSystemStatus[0]);
  2584. json_object_object_add(DDChargingInfo1,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[0]);
  2585. json_object_object_add(DDChargingInfo1,"PowerConsumption",DDPowerConsumption[0]);
  2586. json_object_object_add(jobj2,"DDChargingInfo1",DDChargingInfo1);
  2587. }
  2588. if(DDTotalConnectorQuantity>1){
  2589. json_object_object_add(DDChargingInfo2,"StartUserId",DDStartUserId[1]);
  2590. json_object_object_add(DDChargingInfo2,"StartDateTime",DDStartDateTime[1]);
  2591. json_object_object_add(DDChargingInfo2,"StopDateTime",DDStopDateTime[1]);
  2592. json_object_object_add(DDChargingInfo2,"StartMethod",DDStartMethod[1]);
  2593. json_object_object_add(DDChargingInfo2,"ConnectorTemp",DDConnectorTemp[1]);
  2594. json_object_object_add(DDChargingInfo2,"ChillerTemp",DDChillerTemp[1]);
  2595. json_object_object_add(DDChargingInfo2,"PresentChargingVoltage",DDPresentChargingVoltage[1]);
  2596. json_object_object_add(DDChargingInfo2,"PresentChargingCurrent",DDPresentChargingCurrent[1]);
  2597. json_object_object_add(DDChargingInfo2,"PresentChargingPower",DDPresentChargingPower[1]);
  2598. json_object_object_add(DDChargingInfo2,"PresentChargedEnergy",DDPresentChargedEnergy[1]);
  2599. json_object_object_add(DDChargingInfo2,"PresentChargedDuration",DDPresentChargedDuration[1]);
  2600. json_object_object_add(DDChargingInfo2,"RemainChargingDuration",DDRemainChargingDuration[1]);
  2601. json_object_object_add(DDChargingInfo2,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[1]);
  2602. json_object_object_add(DDChargingInfo2,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[1]);
  2603. json_object_object_add(DDChargingInfo2,"EvBatterySoc",DDEvBatterySoc[1]);
  2604. json_object_object_add(DDChargingInfo2,"SystemStatus",DDSystemStatus[1]);
  2605. json_object_object_add(DDChargingInfo2,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[1]);
  2606. json_object_object_add(DDChargingInfo2,"PowerConsumption",DDPowerConsumption[1]);
  2607. json_object_object_add(jobj2,"DDChargingInfo2",DDChargingInfo2);
  2608. }
  2609. if(DDTotalConnectorQuantity>2){
  2610. json_object_object_add(DDChargingInfo3,"StartUserId",DDStartUserId[2]);
  2611. json_object_object_add(DDChargingInfo3,"StartDateTime",DDStartDateTime[2]);
  2612. json_object_object_add(DDChargingInfo3,"StopDateTime",DDStopDateTime[2]);
  2613. json_object_object_add(DDChargingInfo3,"StartMethod",DDStartMethod[2]);
  2614. json_object_object_add(DDChargingInfo3,"ConnectorTemp",DDConnectorTemp[2]);
  2615. json_object_object_add(DDChargingInfo3,"ChillerTemp",DDChillerTemp[2]);
  2616. json_object_object_add(DDChargingInfo3,"PresentChargingVoltage",DDPresentChargingVoltage[2]);
  2617. json_object_object_add(DDChargingInfo3,"PresentChargingCurrent",DDPresentChargingCurrent[2]);
  2618. json_object_object_add(DDChargingInfo3,"PresentChargingPower",DDPresentChargingPower[2]);
  2619. json_object_object_add(DDChargingInfo3,"PresentChargedEnergy",DDPresentChargedEnergy[2]);
  2620. json_object_object_add(DDChargingInfo3,"PresentChargedDuration",DDPresentChargedDuration[2]);
  2621. json_object_object_add(DDChargingInfo3,"RemainChargingDuration",DDRemainChargingDuration[2]);
  2622. json_object_object_add(DDChargingInfo3,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[2]);
  2623. json_object_object_add(DDChargingInfo3,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[2]);
  2624. json_object_object_add(DDChargingInfo3,"EvBatterySoc",DDEvBatterySoc[2]);
  2625. json_object_object_add(DDChargingInfo3,"SystemStatus",DDSystemStatus[2]);
  2626. json_object_object_add(DDChargingInfo3,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[2]);
  2627. json_object_object_add(DDChargingInfo3,"PowerConsumption",DDPowerConsumption[2]);
  2628. json_object_object_add(jobj2,"DDChargingInfo3",DDChargingInfo3);
  2629. }
  2630. if(DDTotalConnectorQuantity>3){
  2631. json_object_object_add(DDChargingInfo4,"StartUserId",DDStartUserId[3]);
  2632. json_object_object_add(DDChargingInfo4,"StartDateTime",DDStartDateTime[3]);
  2633. json_object_object_add(DDChargingInfo4,"StopDateTime",DDStopDateTime[3]);
  2634. json_object_object_add(DDChargingInfo4,"StartMethod",DDStartMethod[3]);
  2635. json_object_object_add(DDChargingInfo4,"ConnectorTemp",DDConnectorTemp[3]);
  2636. json_object_object_add(DDChargingInfo4,"ChillerTemp",DDChillerTemp[3]);
  2637. json_object_object_add(DDChargingInfo4,"PresentChargingVoltage",DDPresentChargingVoltage[3]);
  2638. json_object_object_add(DDChargingInfo4,"PresentChargingCurrent",DDPresentChargingCurrent[3]);
  2639. json_object_object_add(DDChargingInfo4,"PresentChargingPower",DDPresentChargingPower[3]);
  2640. json_object_object_add(DDChargingInfo4,"PresentChargedEnergy",DDPresentChargedEnergy[3]);
  2641. json_object_object_add(DDChargingInfo4,"PresentChargedDuration",DDPresentChargedDuration[3]);
  2642. json_object_object_add(DDChargingInfo4,"RemainChargingDuration",DDRemainChargingDuration[3]);
  2643. json_object_object_add(DDChargingInfo4,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[3]);
  2644. json_object_object_add(DDChargingInfo4,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[3]);
  2645. json_object_object_add(DDChargingInfo4,"EvBatterySoc",DDEvBatterySoc[3]);
  2646. json_object_object_add(DDChargingInfo4,"SystemStatus",DDSystemStatus[3]);
  2647. json_object_object_add(DDChargingInfo4,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[3]);
  2648. json_object_object_add(DDChargingInfo4,"PowerConsumption",DDPowerConsumption[3]);
  2649. json_object_object_add(jobj2,"DDChargingInfo4",DDChargingInfo4);
  2650. }
  2651. }
  2652. printf("%s\n", json_object_to_json_string(jobj2));
  2653. json_object_put(jobj2);
  2654. //network
  2655. json_object_object_add(jobj3,"InternetConn",InternetConn);
  2656. json_object_object_add(jobj3,"FtpServer",FtpServer);
  2657. json_object_object_add(jobj3,"Eth0DhcpClient",Eth0DhcpClient);
  2658. json_object_object_add(jobj3,"Eth0MacAddress",Eth0MacAddress);
  2659. json_object_object_add(jobj3,"Eth0IpAddress",Eth0IpAddress);
  2660. json_object_object_add(jobj3,"Eth0SubmaskAddress",Eth0SubmaskAddress);
  2661. json_object_object_add(jobj3,"Eth0GatewayAddress",Eth0GatewayAddress);
  2662. json_object_object_add(jobj3,"Eth1DhcpClient",Eth1DhcpClient);
  2663. json_object_object_add(jobj3,"Eth1MacAddress",Eth1MacAddress);
  2664. json_object_object_add(jobj3,"Eth1IpAddress",Eth1IpAddress);
  2665. json_object_object_add(jobj3,"Eth1SubmaskAddress",Eth1SubmaskAddress);
  2666. json_object_object_add(jobj3,"Eth1GatewayAddress",Eth1GatewayAddress);
  2667. json_object_object_add(jobj3,"WifiMode",WifiMode);
  2668. json_object_object_add(jobj3,"WifiSsid",WifiSsid);
  2669. json_object_object_add(jobj3,"WifiPassword",WifiPassword);
  2670. json_object_object_add(jobj3,"WifiRssi",WifiRssi);
  2671. json_object_object_add(jobj3,"WifiDhcpServer",WifiDhcpServer);
  2672. json_object_object_add(jobj3,"WifiDhcpClient",WifiDhcpClient);
  2673. json_object_object_add(jobj3,"WifiMacAddress",WifiMacAddress);
  2674. json_object_object_add(jobj3,"WifiIpAddress",WifiIpAddress);
  2675. json_object_object_add(jobj3,"WifiSubmaskAddress",WifiSubmaskAddress);
  2676. json_object_object_add(jobj3,"WifiGatewayAddress",WifiGatewayAddress);
  2677. json_object_object_add(jobj3,"WifiNetworkConn",WifiNetworkConn);
  2678. json_object_object_add(jobj3,"TelcomApn",TelcomApn);
  2679. json_object_object_add(jobj3,"TelcomRssi",TelcomRssi);
  2680. json_object_object_add(jobj3,"TelcomChapPapId",TelcomChapPapId);
  2681. json_object_object_add(jobj3,"TelcomChapPapPwd",TelcomChapPapPwd);
  2682. json_object_object_add(jobj3,"TelcomModemImei",TelcomModemImei);
  2683. json_object_object_add(jobj3,"TelcomSimImsi",TelcomSimImsi);
  2684. json_object_object_add(jobj3,"TelcomSimIccid",TelcomSimIccid);
  2685. json_object_object_add(jobj3,"TelcomSimStatus",TelcomSimStatus);
  2686. json_object_object_add(jobj3,"TelcomModemMode",TelcomModemMode);
  2687. json_object_object_add(jobj3,"TelcomIpAddress",TelcomIpAddress);
  2688. json_object_object_add(jobj3,"TelcomNetworkConn",TelcomNetworkConn);
  2689. json_object_object_add(jobj3,"TelcomEnabled",TelcomEnabled);
  2690. printf("%s\n", json_object_to_json_string(jobj3));
  2691. json_object_put(jobj3);
  2692. //backend
  2693. json_object_object_add(jobj4,"BackendConnTimeout",BackendConnTimeout);
  2694. json_object_object_add(jobj4,"OfflinePolicy",OfflinePolicy);
  2695. json_object_object_add(jobj4,"OfflineMaxChargeEnergy",OfflineMaxChargeEnergy);
  2696. json_object_object_add(jobj4,"OfflineMaxChargeDuration",OfflineMaxChargeDuration);
  2697. json_object_object_add(jobj4,"OcppConnStatus",OcppConnStatus);
  2698. json_object_object_add(jobj4,"MaintainServerConnStatus",MaintainServerConnStatus);
  2699. json_object_object_add(jobj4,"OcppServerURL",OcppServerURL);
  2700. json_object_object_add(jobj4,"ChargeBoxId",ChargeBoxId);
  2701. json_object_object_add(jobj4,"chargePointVendor",chargePointVendor);
  2702. json_object_object_add(jobj4,"OcppSecurityProfile",OcppSecurityProfile);
  2703. json_object_object_add(jobj4,"OcppSecurityPassword",OcppSecurityPassword);
  2704. json_object_object_add(jobj4,"MaintainServerSecurityProfile",MaintainServerSecurityProfile);
  2705. json_object_object_add(jobj4,"MaintainServerSecurityPassword",MaintainServerSecurityPassword);
  2706. json_object_object_add(jobj4,"MaintainServerURL",MaintainServerURL);
  2707. if(strcmp(IsDO, "AX") == 0){
  2708. json_object_object_add(jobj4,"isEnableLocalPowerSharging",isEnableLocalPowerSharging);
  2709. json_object_object_add(jobj4,"OcppReceiptrURL",OcppReceiptrURL);
  2710. }
  2711. /*for TTIA*/
  2712. if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){
  2713. json_object_object_add(jobj4,"isEnableTTIA",isEnableTTIA);
  2714. json_object_object_add(jobj4,"server_addr",server_addr);
  2715. json_object_object_add(jobj4,"server_port",server_port);
  2716. json_object_object_add(jobj4,"busVenderId",busVenderId);
  2717. json_object_object_add(jobj4,"EquipmentProvider",EquipmentProvider);
  2718. json_object_object_add(jobj4,"TransportationCompanyNo",TransportationCompanyNo);
  2719. json_object_object_add(jobj4,"TTIAChargeBoxId",TTIAChargeBoxId);
  2720. json_object_object_add(jobj4,"evseStation",evseStation);
  2721. }
  2722. printf("%s\n", json_object_to_json_string(jobj4));
  2723. json_object_put(jobj4);
  2724. }
  2725. // for(;;)
  2726. // {
  2727. // }
  2728. return FAIL;
  2729. }