WebService.c 170 KB

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