WebService.c 192 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402
  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 || strcmp(connector, "Y") == 0 || strcmp(connector, "Z") == 0 || strcmp(connector, "I") == 0 || strcmp(connector, "Q") == 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 || strcmp(connector, "L") == 0 || strcmp(connector, "S") == 0 || strcmp(connector, "O") == 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. //creat ShmOCPP20Data
  289. if ((MeterSMId = shmget(ShmOcpp20ModuleKey, sizeof(struct OCPP20Data), 0777)) < 0)
  290. {
  291. DEBUG_ERROR("shmget OCPP20Data NG\n");
  292. result = FAIL;
  293. }
  294. else if ((ShmOCPP20Data = shmat(MeterSMId, NULL, 0)) == (void *) -1)
  295. {
  296. DEBUG_ERROR("shmat OCPP20Data NG\n");
  297. result = FAIL;
  298. }
  299. #ifdef DO360
  300. //creat ShmChargerInfo
  301. if ((MeterSMId = shmget(SM_ChargerInfoKey, sizeof(ChargerInfoData), IPC_CREAT | 0777)) < 0)
  302. {
  303. #ifdef SystemLogMessage
  304. DEBUG_ERROR("[main]CreatShareMemory:shmget ChargerInfoData NG");
  305. #endif
  306. return 0;
  307. }
  308. else if ((ShmChargerInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1)
  309. {
  310. #ifdef SystemLogMessage
  311. DEBUG_ERROR("[WebService]CreatShareMemory:shmat ChargerInfoData NG");
  312. #endif
  313. return 0;
  314. } else {
  315. }
  316. // memset(ShmChargerInfo, 0, sizeof(ChargerInfoData));
  317. #endif
  318. return result;
  319. }
  320. int StoreUsrConfigData(struct SysConfigData *UsrData)
  321. {
  322. int result = PASS;
  323. int fd,wrd;
  324. unsigned int i,Chk;
  325. unsigned char *ptr, *BufTmp;
  326. Chk=0;
  327. ptr=(unsigned char *)UsrData;
  328. if((BufTmp=malloc(MtdBlockSize))!=NULL)
  329. {
  330. memset(BufTmp,0,MtdBlockSize);
  331. memcpy(BufTmp,ptr,sizeof(struct SysConfigData));
  332. for(i=ARRAY_SIZE(UsrData->CsuBootLoadFwRev);i<MtdBlockSize-4;i++)
  333. Chk+=*(BufTmp+i);
  334. memcpy(BufTmp+MtdBlockSize-4, &Chk, 4);
  335. // Output configuration to file.
  336. fd = open("/mnt/EvseConfig.bin", O_RDWR|O_CREAT);
  337. if (fd < 0)
  338. {
  339. DEBUG_ERROR("open /mnt/EvseConfig.bin NG\n");
  340. free(BufTmp);
  341. return 0;
  342. }
  343. wrd=write(fd, BufTmp, MtdBlockSize);
  344. close(fd);
  345. if(wrd<MtdBlockSize)
  346. {
  347. DEBUG_ERROR("write /mnt/EvseConfig.bin NG\n");
  348. free(BufTmp);
  349. return 0;
  350. }
  351. DEBUG_INFO("EvseConfig write to file in /mnt OK.\n");
  352. DEBUG_INFO("Erase /dev/mtd10.\n");
  353. runShellCmd("flash_erase /dev/mtd10 0 0");
  354. DEBUG_INFO("Write /dev/mtd10.\n");
  355. runShellCmd("nandwrite -p /dev/mtd10 /mnt/EvseConfig.bin");
  356. DEBUG_INFO("Erase /dev/mtd11.\n");
  357. runShellCmd("flash_erase /dev/mtd11 0 0");
  358. DEBUG_INFO("Write /dev/mtd11.\n");
  359. runShellCmd("nandwrite -p /dev/mtd11 /mnt/EvseConfig.bin");
  360. system("rm -f /mnt/EvseConfig.bin");
  361. DEBUG_INFO("EvseConfig write to flash OK\n");
  362. }
  363. else
  364. {
  365. DEBUG_ERROR("alloc BlockSize NG\r\n");
  366. result = FAIL;
  367. }
  368. if(BufTmp!=NULL)
  369. free(BufTmp);
  370. return result;
  371. }
  372. //================================================
  373. // Main process
  374. //================================================
  375. int main(int argc, char *argv[]) {
  376. //int InitShMry = 1;
  377. if (InitShareMemory() == FAIL) {
  378. //InitShMry = 0;
  379. #ifdef SystemLogMessage
  380. DEBUG_ERROR("InitShareMemory NG\n");
  381. #endif
  382. if (ShmStatusCodeData != NULL) {
  383. ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
  384. }
  385. sleep(5);
  386. return 0;
  387. }
  388. //web page submit
  389. if ((argc == 3) & (strlen(argv[1]) == 1)) {
  390. //web page submit system
  391. if (strcmp(argv[1], "1") == 0) {
  392. struct json_object *jobj = json_tokener_parse(argv[2]);
  393. json_object *val_obj = NULL;
  394. char *SystemId=NULL;
  395. char *SystemDateTime = NULL;
  396. int PhaseLossPolicy = 0;
  397. int FactoryConfiguration = 0;
  398. int AuthorisationMode = 0;
  399. int RfidCardNumEndian = 0;
  400. int PsuAcInputType = 0;
  401. char isAPP = 0;
  402. char isQRCode = 0;
  403. char isRFID = 0;
  404. char QRCodeMadeMode = 0;
  405. char *QRCodeContent = NULL;
  406. char Intensity = 0;
  407. char isAuthrizeByEVCCID = 0;
  408. char *DDSystemId1=NULL;
  409. int DDFactoryConfiguration1 = 0;
  410. int DDAuthorisationMode1 = 0;
  411. int DDRfidCardNumEndian1 = 0;
  412. char DDisAPP1 = 0;
  413. char DDisQRCode1 = 0;
  414. char DDisRFID1 = 0;
  415. char DDQRCodeMadeMode1 = 0;
  416. char *DDQRCodeContent1 = NULL;
  417. char DDIntensity1 = 0;
  418. char *DDSystemId2=NULL;
  419. int DDFactoryConfiguration2 = 0;
  420. int DDAuthorisationMode2 = 0;
  421. int DDRfidCardNumEndian2 = 0;
  422. char DDisAPP2 = 0;
  423. char DDisQRCode2 = 0;
  424. char DDisRFID2 = 0;
  425. char DDQRCodeMadeMode2 = 0;
  426. char *DDQRCodeContent2 = NULL;
  427. char DDIntensity2 = 0;
  428. char *DDSystemId3=NULL;
  429. int DDFactoryConfiguration3 = 0;
  430. int DDAuthorisationMode3 = 0;
  431. int DDRfidCardNumEndian3 = 0;
  432. char DDisAPP3 = 0;
  433. char DDisQRCode3 = 0;
  434. char DDisRFID3 = 0;
  435. char DDQRCodeMadeMode3 = 0;
  436. char *DDQRCodeContent3 = NULL;
  437. char DDIntensity3 = 0;
  438. char *DDSystemId4=NULL;
  439. int DDFactoryConfiguration4 = 0;
  440. int DDAuthorisationMode4 = 0;
  441. int DDRfidCardNumEndian4 = 0;
  442. char DDisAPP4 = 0;
  443. char DDisQRCode4 = 0;
  444. char DDisRFID4 = 0;
  445. char DDQRCodeMadeMode4 = 0;
  446. char *DDQRCodeContent4 = NULL;
  447. char DDIntensity4 = 0;
  448. if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
  449. SystemId = (char*)json_object_get_string(val_obj);
  450. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
  451. }
  452. if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
  453. SystemDateTime = (char*)json_object_get_string(val_obj);
  454. if(strlen(SystemDateTime)>0){
  455. char cmd[100];
  456. sprintf(cmd,"date -s '%s'",SystemDateTime);
  457. if(system(cmd)==0){
  458. system("hwclock -w");
  459. }
  460. }
  461. }
  462. if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
  463. PhaseLossPolicy = json_object_get_int(val_obj);
  464. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
  465. }
  466. if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
  467. FactoryConfiguration = json_object_get_int(val_obj);
  468. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
  469. }
  470. if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
  471. AuthorisationMode = json_object_get_int(val_obj);
  472. ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
  473. }
  474. if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
  475. RfidCardNumEndian = json_object_get_int(val_obj);
  476. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
  477. }
  478. if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
  479. PsuAcInputType = json_object_get_int(val_obj);
  480. ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
  481. }
  482. if( json_object_object_get_ex(jobj, "isAPP", &val_obj) ) {
  483. isAPP = json_object_get_int(val_obj);
  484. ShmSysConfigAndInfo->SysConfig.isAPP = isAPP;
  485. }
  486. if( json_object_object_get_ex(jobj, "isQRCode", &val_obj) ) {
  487. isQRCode = json_object_get_int(val_obj);
  488. ShmSysConfigAndInfo->SysConfig.isQRCode = isQRCode;
  489. }
  490. if( json_object_object_get_ex(jobj, "isRFID", &val_obj) ) {
  491. isRFID = json_object_get_int(val_obj);
  492. ShmSysConfigAndInfo->SysConfig.isRFID = isRFID;
  493. }
  494. if( json_object_object_get_ex(jobj, "QRCodeMadeMode", &val_obj) ) {
  495. QRCodeMadeMode = json_object_get_int(val_obj);
  496. ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
  497. }
  498. if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
  499. QRCodeContent = (char*)json_object_get_string(val_obj);
  500. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
  501. }
  502. if( json_object_object_get_ex(jobj, "Intensity", &val_obj) ) {
  503. Intensity = json_object_get_int(val_obj);
  504. ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity = Intensity;
  505. }
  506. if( json_object_object_get_ex(jobj, "isAuthrizeByEVCCID", &val_obj) ) {
  507. isAuthrizeByEVCCID = json_object_get_int(val_obj);
  508. ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID = isAuthrizeByEVCCID;
  509. }
  510. if( json_object_object_get_ex(jobj, "DDSystemId1", &val_obj) ) {
  511. DDSystemId1 = (char*)json_object_get_string(val_obj);
  512. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].SystemId,DDSystemId1);
  513. }
  514. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration1", &val_obj) ) {
  515. DDFactoryConfiguration1 = json_object_get_int(val_obj);
  516. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].FactoryConfiguration = DDFactoryConfiguration1;
  517. }
  518. if( json_object_object_get_ex(jobj, "DDAuthorisationMode1", &val_obj) ) {
  519. DDAuthorisationMode1 = json_object_get_int(val_obj);
  520. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].AuthorisationMode = DDAuthorisationMode1;
  521. }
  522. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian1", &val_obj) ) {
  523. DDRfidCardNumEndian1 = json_object_get_int(val_obj);
  524. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].RfidCardNumEndian = DDRfidCardNumEndian1;
  525. }
  526. if( json_object_object_get_ex(jobj, "DDisAPP1", &val_obj) ) {
  527. DDisAPP1 = json_object_get_int(val_obj);
  528. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isAPP = DDisAPP1;
  529. }
  530. if( json_object_object_get_ex(jobj, "DDisQRCode1", &val_obj) ) {
  531. DDisQRCode1 = json_object_get_int(val_obj);
  532. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isQRCode = DDisQRCode1;
  533. }
  534. if( json_object_object_get_ex(jobj, "DDisRFID1", &val_obj) ) {
  535. DDisRFID1 = json_object_get_int(val_obj);
  536. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].isRFID = DDisRFID1;
  537. }
  538. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode1", &val_obj) ) {
  539. DDQRCodeMadeMode1 = json_object_get_int(val_obj);
  540. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeMadeMode = DDQRCodeMadeMode1;
  541. }
  542. if( json_object_object_get_ex(jobj, "DDQRCodeContent1", &val_obj) ) {
  543. DDQRCodeContent1 = (char*)json_object_get_string(val_obj);
  544. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeContent,DDQRCodeContent1);
  545. }
  546. if( json_object_object_get_ex(jobj, "DDIntensity1", &val_obj) ) {
  547. DDIntensity1 = json_object_get_int(val_obj);
  548. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].LedInfo.Intensity = DDIntensity1;
  549. }
  550. if( json_object_object_get_ex(jobj, "DDSystemId2", &val_obj) ) {
  551. DDSystemId2 = (char*)json_object_get_string(val_obj);
  552. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].SystemId,DDSystemId2);
  553. }
  554. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration2", &val_obj) ) {
  555. DDFactoryConfiguration2 = json_object_get_int(val_obj);
  556. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].FactoryConfiguration = DDFactoryConfiguration2;
  557. }
  558. if( json_object_object_get_ex(jobj, "DDAuthorisationMode2", &val_obj) ) {
  559. DDAuthorisationMode2 = json_object_get_int(val_obj);
  560. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].AuthorisationMode = DDAuthorisationMode2;
  561. }
  562. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian2", &val_obj) ) {
  563. DDRfidCardNumEndian2 = json_object_get_int(val_obj);
  564. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].RfidCardNumEndian = DDRfidCardNumEndian2;
  565. }
  566. if( json_object_object_get_ex(jobj, "DDisAPP2", &val_obj) ) {
  567. DDisAPP2 = json_object_get_int(val_obj);
  568. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isAPP = DDisAPP2;
  569. }
  570. if( json_object_object_get_ex(jobj, "DDisQRCode2", &val_obj) ) {
  571. DDisQRCode2 = json_object_get_int(val_obj);
  572. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isQRCode = DDisQRCode2;
  573. }
  574. if( json_object_object_get_ex(jobj, "DDisRFID2", &val_obj) ) {
  575. DDisRFID2 = json_object_get_int(val_obj);
  576. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].isRFID = DDisRFID2;
  577. }
  578. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode2", &val_obj) ) {
  579. DDQRCodeMadeMode2 = json_object_get_int(val_obj);
  580. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeMadeMode = DDQRCodeMadeMode2;
  581. }
  582. if( json_object_object_get_ex(jobj, "DDQRCodeContent2", &val_obj) ) {
  583. DDQRCodeContent2 = (char*)json_object_get_string(val_obj);
  584. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeContent,DDQRCodeContent2);
  585. }
  586. if( json_object_object_get_ex(jobj, "DDIntensity2", &val_obj) ) {
  587. DDIntensity2 = json_object_get_int(val_obj);
  588. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].LedInfo.Intensity = DDIntensity2;
  589. }
  590. if( json_object_object_get_ex(jobj, "DDSystemId3", &val_obj) ) {
  591. DDSystemId3 = (char*)json_object_get_string(val_obj);
  592. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].SystemId,DDSystemId3);
  593. }
  594. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration3", &val_obj) ) {
  595. DDFactoryConfiguration3 = json_object_get_int(val_obj);
  596. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].FactoryConfiguration = DDFactoryConfiguration3;
  597. }
  598. if( json_object_object_get_ex(jobj, "DDAuthorisationMode3", &val_obj) ) {
  599. DDAuthorisationMode3 = json_object_get_int(val_obj);
  600. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].AuthorisationMode = DDAuthorisationMode3;
  601. }
  602. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian3", &val_obj) ) {
  603. DDRfidCardNumEndian3 = json_object_get_int(val_obj);
  604. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].RfidCardNumEndian = DDRfidCardNumEndian3;
  605. }
  606. if( json_object_object_get_ex(jobj, "DDisAPP3", &val_obj) ) {
  607. DDisAPP3 = json_object_get_int(val_obj);
  608. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isAPP = DDisAPP3;
  609. }
  610. if( json_object_object_get_ex(jobj, "DDisQRCode3", &val_obj) ) {
  611. DDisQRCode3 = json_object_get_int(val_obj);
  612. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isQRCode = DDisQRCode3;
  613. }
  614. if( json_object_object_get_ex(jobj, "DDisRFID3", &val_obj) ) {
  615. DDisRFID3 = json_object_get_int(val_obj);
  616. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].isRFID = DDisRFID3;
  617. }
  618. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode3", &val_obj) ) {
  619. DDQRCodeMadeMode3 = json_object_get_int(val_obj);
  620. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeMadeMode = DDQRCodeMadeMode3;
  621. }
  622. if( json_object_object_get_ex(jobj, "DDQRCodeContent3", &val_obj) ) {
  623. DDQRCodeContent3 = (char*)json_object_get_string(val_obj);
  624. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeContent,DDQRCodeContent3);
  625. }
  626. if( json_object_object_get_ex(jobj, "DDIntensity3", &val_obj) ) {
  627. DDIntensity3 = json_object_get_int(val_obj);
  628. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].LedInfo.Intensity = DDIntensity3;
  629. }
  630. if( json_object_object_get_ex(jobj, "DDSystemId4", &val_obj) ) {
  631. DDSystemId4 = (char*)json_object_get_string(val_obj);
  632. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].SystemId,DDSystemId4);
  633. }
  634. if( json_object_object_get_ex(jobj, "DDFactoryConfiguration4", &val_obj) ) {
  635. DDFactoryConfiguration4 = json_object_get_int(val_obj);
  636. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].FactoryConfiguration = DDFactoryConfiguration4;
  637. }
  638. if( json_object_object_get_ex(jobj, "DDAuthorisationMode4", &val_obj) ) {
  639. DDAuthorisationMode4 = json_object_get_int(val_obj);
  640. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].AuthorisationMode = DDAuthorisationMode4;
  641. }
  642. if( json_object_object_get_ex(jobj, "DDRfidCardNumEndian4", &val_obj) ) {
  643. DDRfidCardNumEndian4 = json_object_get_int(val_obj);
  644. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].RfidCardNumEndian = DDRfidCardNumEndian4;
  645. }
  646. if( json_object_object_get_ex(jobj, "DDisAPP4", &val_obj) ) {
  647. DDisAPP4 = json_object_get_int(val_obj);
  648. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isAPP = DDisAPP4;
  649. }
  650. if( json_object_object_get_ex(jobj, "DDisQRCode4", &val_obj) ) {
  651. DDisQRCode4 = json_object_get_int(val_obj);
  652. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isQRCode = DDisQRCode4;
  653. }
  654. if( json_object_object_get_ex(jobj, "DDisRFID4", &val_obj) ) {
  655. DDisRFID4 = json_object_get_int(val_obj);
  656. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].isRFID = DDisRFID4;
  657. }
  658. if( json_object_object_get_ex(jobj, "DDQRCodeMadeMode4", &val_obj) ) {
  659. DDQRCodeMadeMode4 = json_object_get_int(val_obj);
  660. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeMadeMode = DDQRCodeMadeMode4;
  661. }
  662. if( json_object_object_get_ex(jobj, "DDQRCodeContent4", &val_obj) ) {
  663. DDQRCodeContent4 = (char*)json_object_get_string(val_obj);
  664. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeContent,DDQRCodeContent4);
  665. }
  666. if( json_object_object_get_ex(jobj, "DDIntensity4", &val_obj) ) {
  667. DDIntensity4 = json_object_get_int(val_obj);
  668. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].LedInfo.Intensity = DDIntensity4;
  669. }
  670. }
  671. if (strcmp(argv[1], "2") == 0) {
  672. struct json_object *jobj = json_tokener_parse(argv[2]);
  673. json_object *val_obj = NULL;
  674. int MaxChargingEnergy= 0;
  675. int MaxChargingPower = 0;
  676. int MaxChargingCurrent = 0;
  677. int MaxChargingVoltage = 0;
  678. int AcMaxChargingCurrent = 0;
  679. int MaxChargingDuration = 0;
  680. int MaxChargingSoc = 0;
  681. int StopChargingByButton = 0;
  682. int FanControlPolicy = 0;
  683. char *LocalWhiteCard0 = NULL;
  684. char *LocalWhiteCard1 = NULL;
  685. char *LocalWhiteCard2 = NULL;
  686. char *LocalWhiteCard3 = NULL;
  687. char *LocalWhiteCard4 = NULL;
  688. char *LocalWhiteCard5 = NULL;
  689. char *LocalWhiteCard6 = NULL;
  690. char *LocalWhiteCard7 = NULL;
  691. char *LocalWhiteCard8 = NULL;
  692. char *LocalWhiteCard9 = NULL;
  693. char isBilling = 0;
  694. char Currency = 0;
  695. float Fee0 = 0;
  696. float Fee1 = 0;
  697. float Fee2 = 0;
  698. float Fee3 = 0;
  699. float Fee4 = 0;
  700. float Fee5 = 0;
  701. float Fee6 = 0;
  702. float Fee7 = 0;
  703. float Fee8 = 0;
  704. float Fee9 = 0;
  705. float Fee10 = 0;
  706. float Fee11 = 0;
  707. float Fee12 = 0;
  708. float Fee13 = 0;
  709. float Fee14 = 0;
  710. float Fee15 = 0;
  711. float Fee16 = 0;
  712. float Fee17 = 0;
  713. float Fee18 = 0;
  714. float Fee19 = 0;
  715. float Fee20 = 0;
  716. float Fee21 = 0;
  717. float Fee22 = 0;
  718. float Fee23 = 0;
  719. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  720. MaxChargingEnergy = json_object_get_int(val_obj);
  721. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  722. }
  723. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  724. MaxChargingPower = json_object_get_int(val_obj);
  725. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  726. }
  727. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  728. MaxChargingCurrent = json_object_get_int(val_obj);
  729. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  730. }
  731. if( json_object_object_get_ex(jobj, "MaxChargingVoltage", &val_obj) ) {
  732. MaxChargingVoltage = json_object_get_int(val_obj);
  733. ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage = MaxChargingVoltage;
  734. }
  735. if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
  736. AcMaxChargingCurrent = json_object_get_int(val_obj);
  737. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
  738. }
  739. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  740. MaxChargingDuration = json_object_get_int(val_obj);
  741. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  742. }
  743. if( json_object_object_get_ex(jobj, "MaxChargingSoc", &val_obj) ) {
  744. MaxChargingSoc = json_object_get_int(val_obj);
  745. ShmSysConfigAndInfo->SysConfig.MaxChargingSoc = MaxChargingSoc;
  746. }
  747. if( json_object_object_get_ex(jobj, "StopChargingByButton", &val_obj) ) {
  748. StopChargingByButton = json_object_get_int(val_obj);
  749. ShmSysConfigAndInfo->SysConfig.StopChargingByButton = StopChargingByButton;
  750. }
  751. if( json_object_object_get_ex(jobj, "FanControlPolicy", &val_obj) ) {
  752. FanControlPolicy = json_object_get_int(val_obj);
  753. ShmSysConfigAndInfo->SysConfig.FanControlPolicy = FanControlPolicy;
  754. }
  755. if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
  756. LocalWhiteCard0 = (char*)json_object_get_string(val_obj);
  757. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
  758. }
  759. if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
  760. LocalWhiteCard1 = (char*)json_object_get_string(val_obj);
  761. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
  762. }
  763. if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
  764. LocalWhiteCard2 = (char*)json_object_get_string(val_obj);
  765. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
  766. }
  767. if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
  768. LocalWhiteCard3 = (char*)json_object_get_string(val_obj);
  769. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
  770. }
  771. if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
  772. LocalWhiteCard4 = (char*)json_object_get_string(val_obj);
  773. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
  774. }
  775. if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
  776. LocalWhiteCard5 = (char*)json_object_get_string(val_obj);
  777. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
  778. }
  779. if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
  780. LocalWhiteCard6 = (char*)json_object_get_string(val_obj);
  781. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
  782. }
  783. if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
  784. LocalWhiteCard7 = (char*)json_object_get_string(val_obj);
  785. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
  786. }
  787. if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
  788. LocalWhiteCard8 = (char*)json_object_get_string(val_obj);
  789. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
  790. }
  791. if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
  792. LocalWhiteCard9 = (char*)json_object_get_string(val_obj);
  793. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
  794. }
  795. if( json_object_object_get_ex(jobj, "isBilling", &val_obj) ) {
  796. isBilling = json_object_get_int(val_obj);
  797. ShmSysConfigAndInfo->SysConfig.BillingData.isBilling = isBilling;
  798. }
  799. if( json_object_object_get_ex(jobj, "Currency", &val_obj) ) {
  800. Currency = json_object_get_int(val_obj);
  801. ShmSysConfigAndInfo->SysConfig.BillingData.Currency = Currency;
  802. }
  803. if( json_object_object_get_ex(jobj, "Fee0", &val_obj) ) {
  804. Fee0 = json_object_get_double(val_obj);
  805. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0] = rounding(Fee0);
  806. }
  807. if( json_object_object_get_ex(jobj, "Fee1", &val_obj) ) {
  808. Fee1 = json_object_get_double(val_obj);
  809. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1] = rounding(Fee1);
  810. }
  811. if( json_object_object_get_ex(jobj, "Fee2", &val_obj) ) {
  812. Fee2 = json_object_get_double(val_obj);
  813. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2] = rounding(Fee2);
  814. }
  815. if( json_object_object_get_ex(jobj, "Fee3", &val_obj) ) {
  816. Fee3 = json_object_get_double(val_obj);
  817. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3] = rounding(Fee3);
  818. }
  819. if( json_object_object_get_ex(jobj, "Fee4", &val_obj) ) {
  820. Fee4 = json_object_get_double(val_obj);
  821. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4] = rounding(Fee4);
  822. }
  823. if( json_object_object_get_ex(jobj, "Fee5", &val_obj) ) {
  824. Fee5 = json_object_get_double(val_obj);
  825. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5] = rounding(Fee5);
  826. }
  827. if( json_object_object_get_ex(jobj, "Fee6", &val_obj) ) {
  828. Fee6 = json_object_get_double(val_obj);
  829. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6] = rounding(Fee6);
  830. }
  831. if( json_object_object_get_ex(jobj, "Fee7", &val_obj) ) {
  832. Fee7 = json_object_get_double(val_obj);
  833. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7] = rounding(Fee7);
  834. }
  835. if( json_object_object_get_ex(jobj, "Fee8", &val_obj) ) {
  836. Fee8 = json_object_get_double(val_obj);
  837. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8] = rounding(Fee8);
  838. }
  839. if( json_object_object_get_ex(jobj, "Fee9", &val_obj) ) {
  840. Fee9 = json_object_get_double(val_obj);
  841. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9] = rounding(Fee9);
  842. }
  843. if( json_object_object_get_ex(jobj, "Fee10", &val_obj) ) {
  844. Fee10 = json_object_get_double(val_obj);
  845. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10] = rounding(Fee10);
  846. }
  847. if( json_object_object_get_ex(jobj, "Fee11", &val_obj) ) {
  848. Fee11 = json_object_get_double(val_obj);
  849. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11] = rounding(Fee11);
  850. }
  851. if( json_object_object_get_ex(jobj, "Fee12", &val_obj) ) {
  852. Fee12 = json_object_get_double(val_obj);
  853. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12] = rounding(Fee12);
  854. }
  855. if( json_object_object_get_ex(jobj, "Fee13", &val_obj) ) {
  856. Fee13 = json_object_get_double(val_obj);
  857. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13] = rounding(Fee13);
  858. }
  859. if( json_object_object_get_ex(jobj, "Fee14", &val_obj) ) {
  860. Fee14 = json_object_get_double(val_obj);
  861. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14] = rounding(Fee14);
  862. }
  863. if( json_object_object_get_ex(jobj, "Fee15", &val_obj) ) {
  864. Fee15 = json_object_get_double(val_obj);
  865. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15] = rounding(Fee15);
  866. }
  867. if( json_object_object_get_ex(jobj, "Fee16", &val_obj) ) {
  868. Fee16 = json_object_get_double(val_obj);
  869. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16] = rounding(Fee16);
  870. }
  871. if( json_object_object_get_ex(jobj, "Fee17", &val_obj) ) {
  872. Fee17 = json_object_get_double(val_obj);
  873. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17] = rounding(Fee17);
  874. }
  875. if( json_object_object_get_ex(jobj, "Fee18", &val_obj) ) {
  876. Fee18 = json_object_get_double(val_obj);
  877. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18] = rounding(Fee18);
  878. }
  879. if( json_object_object_get_ex(jobj, "Fee19", &val_obj) ) {
  880. Fee19 = json_object_get_double(val_obj);
  881. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19] = rounding(Fee19);
  882. }
  883. if( json_object_object_get_ex(jobj, "Fee20", &val_obj) ) {
  884. Fee20 = json_object_get_double(val_obj);
  885. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20] = rounding(Fee20);
  886. }
  887. if( json_object_object_get_ex(jobj, "Fee21", &val_obj) ) {
  888. Fee21 = json_object_get_double(val_obj);
  889. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21] = rounding(Fee21);
  890. }
  891. if( json_object_object_get_ex(jobj, "Fee22", &val_obj) ) {
  892. Fee22 = json_object_get_double(val_obj);
  893. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22] = rounding(Fee22);
  894. }
  895. if( json_object_object_get_ex(jobj, "Fee23", &val_obj) ) {
  896. Fee23 = json_object_get_double(val_obj);
  897. ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23] = rounding(Fee23);
  898. }
  899. }
  900. if (strcmp(argv[1], "3") == 0) {
  901. struct json_object *jobj = json_tokener_parse(argv[2]);
  902. json_object *val_obj = NULL;
  903. int Eth0DhcpClient=0;
  904. char *Eth0IpAddress=NULL;
  905. char *Eth0SubmaskAddress=NULL;
  906. char *Eth0GatewayAddress=NULL;
  907. int WifiMode=0;
  908. char *WifiSsid=NULL;
  909. char *WifiPassword=NULL;
  910. int WifiBroadcastSsid=0;
  911. char *WifiTargetBssidMac=NULL;
  912. int WifiDhcpServer=0;
  913. int WifiDhcpClient=0;
  914. char *WifiIpAddress=NULL;
  915. char *WifiSubmaskAddress=NULL;
  916. char *WifiGatewayAddress=NULL;
  917. char *TelcomApn=NULL;
  918. char *TelcomChapPapId=NULL;
  919. char *TelcomChapPapPwd=NULL;
  920. char *TelcomIpAddress=NULL;
  921. char TelcomEnabled=0;
  922. char TelcomNetworkType=0;
  923. char Wcnt=0;
  924. char Tcnt=0;
  925. char isEnalbleFirewall=0;
  926. char *FirewallAcceptAddr0=NULL;
  927. char *FirewallAcceptAddr1=NULL;
  928. char *FirewallAcceptAddr2=NULL;
  929. char *FirewallAcceptAddr3=NULL;
  930. char *FirewallAcceptAddr4=NULL;
  931. char *FirewallAcceptAddr5=NULL;
  932. char *FirewallAcceptAddr6=NULL;
  933. char *FirewallAcceptAddr7=NULL;
  934. char *FirewallAcceptAddr8=NULL;
  935. char *FirewallAcceptAddr9=NULL;
  936. if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
  937. Eth0DhcpClient = json_object_get_int(val_obj);
  938. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=Eth0DhcpClient;
  939. }
  940. if( json_object_object_get_ex(jobj, "Eth0IpAddress", &val_obj) ) {
  941. Eth0IpAddress = (char*)json_object_get_string(val_obj);
  942. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,Eth0IpAddress);
  943. }
  944. if( json_object_object_get_ex(jobj, "Eth0SubmaskAddress", &val_obj) ) {
  945. Eth0SubmaskAddress = (char*)json_object_get_string(val_obj);
  946. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,Eth0SubmaskAddress);
  947. }
  948. if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
  949. Eth0GatewayAddress = (char*)json_object_get_string(val_obj);
  950. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,Eth0GatewayAddress);
  951. }
  952. if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
  953. WifiMode = json_object_get_int(val_obj);
  954. if(WifiMode!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode) Wcnt++;
  955. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
  956. }
  957. if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
  958. WifiSsid = (char*)json_object_get_string(val_obj);
  959. if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
  960. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
  961. }
  962. if( json_object_object_get_ex(jobj, "WifiPassword", &val_obj) ) {
  963. WifiPassword = (char*)json_object_get_string(val_obj);
  964. if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
  965. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
  966. }
  967. if( json_object_object_get_ex(jobj, "WifiBroadcastSsid", &val_obj) ) {
  968. WifiBroadcastSsid = json_object_get_int(val_obj);
  969. if(WifiBroadcastSsid!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid) Wcnt++;
  970. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid=WifiBroadcastSsid;
  971. }
  972. if( json_object_object_get_ex(jobj, "WifiTargetBssidMac", &val_obj) ) {
  973. WifiTargetBssidMac = (char*)json_object_get_string(val_obj);
  974. if (strcmp(WifiTargetBssidMac, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac) != 0) Wcnt++;
  975. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac,WifiTargetBssidMac);
  976. }
  977. if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
  978. WifiDhcpServer = json_object_get_int(val_obj);
  979. if(WifiDhcpServer!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer) Wcnt++;
  980. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=WifiDhcpServer;
  981. }
  982. if( json_object_object_get_ex(jobj, "WifiDhcpClient", &val_obj) ) {
  983. WifiDhcpClient = json_object_get_int(val_obj);
  984. if(WifiDhcpClient!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient) Wcnt++;
  985. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=WifiDhcpClient;
  986. }
  987. if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
  988. WifiIpAddress = (char*)json_object_get_string(val_obj);
  989. if (strcmp(WifiIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress) != 0) Wcnt++;
  990. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,WifiIpAddress);
  991. }
  992. if( json_object_object_get_ex(jobj, "WifiSubmaskAddress", &val_obj) ) {
  993. WifiSubmaskAddress = (char*)json_object_get_string(val_obj);
  994. if (strcmp(WifiSubmaskAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress) != 0) Wcnt++;
  995. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,WifiSubmaskAddress);
  996. }
  997. if( json_object_object_get_ex(jobj, "WifiGatewayAddress", &val_obj) ) {
  998. WifiGatewayAddress = (char*)json_object_get_string(val_obj);
  999. if (strcmp(WifiGatewayAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress) != 0) Wcnt++;
  1000. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,WifiGatewayAddress);
  1001. }
  1002. if( json_object_object_get_ex(jobj, "TelcomApn", &val_obj) ) {
  1003. TelcomApn = (char*)json_object_get_string(val_obj);
  1004. if (strcmp(TelcomApn, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn) != 0) Tcnt++;
  1005. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,TelcomApn);
  1006. }
  1007. if( json_object_object_get_ex(jobj, "TelcomChapPapId", &val_obj) ) {
  1008. TelcomChapPapId = (char*)json_object_get_string(val_obj);
  1009. if (strcmp(TelcomChapPapId, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId) != 0) Tcnt++;
  1010. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,TelcomChapPapId);
  1011. }
  1012. if( json_object_object_get_ex(jobj, "TelcomChapPapPwd", &val_obj) ) {
  1013. TelcomChapPapPwd = (char*)json_object_get_string(val_obj);
  1014. if (strcmp(TelcomChapPapPwd, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd) != 0) Tcnt++;
  1015. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,TelcomChapPapPwd);
  1016. }
  1017. if( json_object_object_get_ex(jobj, "TelcomIpAddress", &val_obj) ) {
  1018. TelcomIpAddress = (char*)json_object_get_string(val_obj);
  1019. if (strcmp(TelcomIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress) != 0) Tcnt++;
  1020. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
  1021. }
  1022. if( json_object_object_get_ex(jobj, "TelcomEnabled", &val_obj) ) {
  1023. TelcomEnabled = json_object_get_int(val_obj);
  1024. if(TelcomEnabled!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled) Tcnt++;
  1025. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled=TelcomEnabled;
  1026. }
  1027. if( json_object_object_get_ex(jobj, "TelcomNetworkType", &val_obj) ) {
  1028. TelcomNetworkType = json_object_get_int(val_obj);
  1029. if(TelcomNetworkType!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType) Tcnt++;
  1030. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType=TelcomNetworkType;
  1031. }
  1032. if( json_object_object_get_ex(jobj, "isEnalbleFirewall", &val_obj) ) {
  1033. isEnalbleFirewall = json_object_get_int(val_obj);
  1034. ShmSysConfigAndInfo->SysConfig.isEnalbleFirewall=isEnalbleFirewall;
  1035. }
  1036. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr0", &val_obj) ) {
  1037. FirewallAcceptAddr0 = (char*)json_object_get_string(val_obj);
  1038. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[0],FirewallAcceptAddr0);
  1039. }
  1040. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr1", &val_obj) ) {
  1041. FirewallAcceptAddr1 = (char*)json_object_get_string(val_obj);
  1042. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[1],FirewallAcceptAddr1);
  1043. }
  1044. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr2", &val_obj) ) {
  1045. FirewallAcceptAddr2 = (char*)json_object_get_string(val_obj);
  1046. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[2],FirewallAcceptAddr2);
  1047. }
  1048. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr3", &val_obj) ) {
  1049. FirewallAcceptAddr3 = (char*)json_object_get_string(val_obj);
  1050. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[3],FirewallAcceptAddr3);
  1051. }
  1052. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr4", &val_obj) ) {
  1053. FirewallAcceptAddr4 = (char*)json_object_get_string(val_obj);
  1054. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[4],FirewallAcceptAddr4);
  1055. }
  1056. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr5", &val_obj) ) {
  1057. FirewallAcceptAddr5 = (char*)json_object_get_string(val_obj);
  1058. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[5],FirewallAcceptAddr5);
  1059. }
  1060. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr6", &val_obj) ) {
  1061. FirewallAcceptAddr6 = (char*)json_object_get_string(val_obj);
  1062. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[6],FirewallAcceptAddr6);
  1063. }
  1064. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr7", &val_obj) ) {
  1065. FirewallAcceptAddr7 = (char*)json_object_get_string(val_obj);
  1066. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[7],FirewallAcceptAddr7);
  1067. }
  1068. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr8", &val_obj) ) {
  1069. FirewallAcceptAddr8 = (char*)json_object_get_string(val_obj);
  1070. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[8],FirewallAcceptAddr8);
  1071. }
  1072. if( json_object_object_get_ex(jobj, "FirewallAcceptAddr9", &val_obj) ) {
  1073. FirewallAcceptAddr9 = (char*)json_object_get_string(val_obj);
  1074. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[9],FirewallAcceptAddr9);
  1075. }
  1076. if(Wcnt>0){
  1077. system ("pkill Module_Wifi");
  1078. }
  1079. if(Tcnt>0){
  1080. system ("pkill Module_4g");
  1081. system ("killall 4GDetection");
  1082. system ("killall pppd");
  1083. }
  1084. }
  1085. if (strcmp(argv[1], "4") == 0) {
  1086. struct json_object *jobj = json_tokener_parse(argv[2]);
  1087. json_object *val_obj = NULL;
  1088. int BackendConnTimeout=0;
  1089. int OfflinePolicy=0;
  1090. int OfflineMaxChargeEnergy=0;
  1091. int OfflineMaxChargeDuration=0;
  1092. char *OcppServerURL=NULL;
  1093. char *ChargeBoxId=NULL;
  1094. char *chargePointVendor=NULL;
  1095. int OcppSecurityProfile=0;
  1096. int MaintainServerSecurityProfile=0;
  1097. char *OcppSecurityPassword=NULL;
  1098. char *MaintainServerSecurityPassword=NULL;
  1099. int isEnableLocalPowerSharging=0;
  1100. int PowerSharingCapacity=0;
  1101. char *PowerSharingServerIP=NULL;
  1102. char *OcppReceiptrURL=NULL;
  1103. char *MaintainServerURL=NULL;
  1104. /*for TTIA*/
  1105. char isEnableTTIA=0;
  1106. char *server_addr=NULL;
  1107. int server_port=0;
  1108. int busVenderId=0;
  1109. char *EquipmentProvider=NULL;
  1110. char TransportationCompanyNo=0;
  1111. char TTIAChargeBoxId=0;
  1112. char *evseStation=NULL;
  1113. if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
  1114. BackendConnTimeout = json_object_get_int(val_obj);
  1115. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
  1116. }
  1117. if( json_object_object_get_ex(jobj, "OfflinePolicy", &val_obj) ) {
  1118. OfflinePolicy = json_object_get_int(val_obj);
  1119. ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
  1120. }
  1121. if( json_object_object_get_ex(jobj, "OfflineMaxChargeEnergy", &val_obj) ) {
  1122. OfflineMaxChargeEnergy = json_object_get_int(val_obj);
  1123. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
  1124. }
  1125. if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
  1126. OfflineMaxChargeDuration = json_object_get_int(val_obj);
  1127. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
  1128. }
  1129. if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
  1130. OcppServerURL = (char*)json_object_get_string(val_obj);
  1131. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
  1132. }
  1133. if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
  1134. ChargeBoxId = (char*)json_object_get_string(val_obj);
  1135. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
  1136. }
  1137. if( json_object_object_get_ex(jobj, "chargePointVendor", &val_obj) ) {
  1138. chargePointVendor = (char*)json_object_get_string(val_obj);
  1139. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,chargePointVendor);
  1140. }
  1141. if( json_object_object_get_ex(jobj, "OcppSecurityProfile", &val_obj) ) {
  1142. OcppSecurityProfile = json_object_get_int(val_obj);
  1143. ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile = OcppSecurityProfile;
  1144. }
  1145. if( json_object_object_get_ex(jobj, "OcppSecurityPassword", &val_obj) ) {
  1146. OcppSecurityPassword = (char*)json_object_get_string(val_obj);
  1147. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword,OcppSecurityPassword);
  1148. }
  1149. if( json_object_object_get_ex(jobj, "MaintainServerSecurityProfile", &val_obj) ) {
  1150. MaintainServerSecurityProfile = json_object_get_int(val_obj);
  1151. ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile = MaintainServerSecurityProfile;
  1152. }
  1153. if( json_object_object_get_ex(jobj, "MaintainServerSecurityPassword", &val_obj) ) {
  1154. MaintainServerSecurityPassword = (char*)json_object_get_string(val_obj);
  1155. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword,MaintainServerSecurityPassword);
  1156. }
  1157. if( json_object_object_get_ex(jobj, "isEnableLocalPowerSharging", &val_obj) ) {
  1158. isEnableLocalPowerSharging = json_object_get_int(val_obj);
  1159. ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing = isEnableLocalPowerSharging;
  1160. }
  1161. if( json_object_object_get_ex(jobj, "PowerSharingCapacity", &val_obj) ) {
  1162. PowerSharingCapacity = json_object_get_int(val_obj);
  1163. ShmSysConfigAndInfo->SysConfig.PowerSharingCapacityPower = PowerSharingCapacity;
  1164. }
  1165. if( json_object_object_get_ex(jobj, "PowerSharingServerIP", &val_obj) ) {
  1166. PowerSharingServerIP = (char*)json_object_get_string(val_obj);
  1167. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP,PowerSharingServerIP);
  1168. }
  1169. if( json_object_object_get_ex(jobj, "OcppReceiptrURL", &val_obj) ) {
  1170. OcppReceiptrURL = (char*)json_object_get_string(val_obj);
  1171. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL,OcppReceiptrURL);
  1172. }
  1173. if( json_object_object_get_ex(jobj, "MaintainServerURL", &val_obj) ) {
  1174. MaintainServerURL = (char*)json_object_get_string(val_obj);
  1175. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL,MaintainServerURL);
  1176. }
  1177. /*for TTIA*/
  1178. if( json_object_object_get_ex(jobj, "isEnableTTIA", &val_obj) ) {
  1179. isEnableTTIA = json_object_get_int(val_obj);
  1180. ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA = isEnableTTIA;
  1181. }
  1182. if( json_object_object_get_ex(jobj, "server_addr", &val_obj) ) {
  1183. server_addr = (char*)json_object_get_string(val_obj);
  1184. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr,server_addr);
  1185. }
  1186. if( json_object_object_get_ex(jobj, "server_port", &val_obj) ) {
  1187. server_port = json_object_get_int(val_obj);
  1188. ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port = server_port;
  1189. }
  1190. if( json_object_object_get_ex(jobj, "busVenderId", &val_obj) ) {
  1191. busVenderId = json_object_get_int(val_obj);
  1192. ShmSysConfigAndInfo->SysConfig.TTIA_Info.busVenderId = busVenderId;
  1193. }
  1194. if( json_object_object_get_ex(jobj, "EquipmentProvider", &val_obj) ) {
  1195. EquipmentProvider = (char*)json_object_get_string(val_obj);
  1196. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.EquipmentProvider,EquipmentProvider);
  1197. }
  1198. if( json_object_object_get_ex(jobj, "TransportationCompanyNo", &val_obj) ) {
  1199. TransportationCompanyNo = json_object_get_int(val_obj);
  1200. ShmSysConfigAndInfo->SysConfig.TTIA_Info.TransportationCompanyNo = TransportationCompanyNo;
  1201. }
  1202. if( json_object_object_get_ex(jobj, "TTIAChargeBoxId", &val_obj) ) {
  1203. TTIAChargeBoxId = json_object_get_int(val_obj);
  1204. ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId = TTIAChargeBoxId;
  1205. }
  1206. if( json_object_object_get_ex(jobj, "evseStation", &val_obj) ) {
  1207. evseStation = (char*)json_object_get_string(val_obj);
  1208. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation,evseStation);
  1209. }
  1210. }
  1211. struct SysConfigData SysConfig;
  1212. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  1213. int result = StoreUsrConfigData(&SysConfig);
  1214. if(result != 1){
  1215. #ifdef SystemLogMessage
  1216. StoreLogMsg("[WebService]StoreUsrConfigData: normal NG");
  1217. #endif
  1218. }
  1219. else{
  1220. #ifdef SystemLogMessage
  1221. StoreLogMsg("[WebService]StoreUsrConfigData: normal OK");
  1222. #endif
  1223. }
  1224. #ifdef SystemLogMessage
  1225. DEBUG_INFO("WebServiceConfig update OK");
  1226. #endif
  1227. }
  1228. //web api
  1229. if ((argc == 3) & (strlen(argv[1]) == 2)) {
  1230. if (strcmp(argv[1], "21") == 0) {
  1231. struct json_object *jobj = json_tokener_parse(argv[2]);
  1232. json_object *val_obj = NULL;
  1233. int MaxChargingEnergy= 0;
  1234. int MaxChargingPower = 0;
  1235. int MaxChargingCurrent = 0;
  1236. int MaxChargingVoltage = 0;
  1237. int AcMaxChargingCurrent = 0;
  1238. int MaxChargingDuration = 0;
  1239. int MaxChargingSoc = 0;
  1240. if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
  1241. MaxChargingEnergy = json_object_get_int(val_obj);
  1242. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
  1243. }
  1244. if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
  1245. MaxChargingPower = json_object_get_int(val_obj);
  1246. ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
  1247. }
  1248. if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
  1249. MaxChargingCurrent = json_object_get_int(val_obj);
  1250. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
  1251. }
  1252. if( json_object_object_get_ex(jobj, "MaxChargingVoltage", &val_obj) ) {
  1253. MaxChargingVoltage = json_object_get_int(val_obj);
  1254. ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage = MaxChargingVoltage;
  1255. }
  1256. if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
  1257. AcMaxChargingCurrent = json_object_get_int(val_obj);
  1258. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
  1259. }
  1260. if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
  1261. MaxChargingDuration = json_object_get_int(val_obj);
  1262. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
  1263. }
  1264. if( json_object_object_get_ex(jobj, "MaxChargingSoc", &val_obj) ) {
  1265. MaxChargingSoc = json_object_get_int(val_obj);
  1266. ShmSysConfigAndInfo->SysConfig.MaxChargingSoc = MaxChargingSoc;
  1267. }
  1268. DEBUG_INFO("WebService Remote Api update OK");
  1269. }
  1270. }
  1271. if (argc == 2)
  1272. { //init share memory for test
  1273. if (strcmp(argv[1], "aaa") == 0)
  1274. {
  1275. //struct SysConfigData SysConfig;
  1276. //system
  1277. ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=1;
  1278. ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=1;
  1279. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DO0E362001D1P0D");
  1280. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber, "SerialNumber");
  1281. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId, "1234567890");
  1282. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemDateTime, "2019-12-31 23:59:59");
  1283. ShmSysConfigAndInfo->SysConfig.AcPhaseCount=1;
  1284. ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy=0;
  1285. ShmSysConfigAndInfo->SysInfo.FactoryConfiguration=0;
  1286. ShmSysConfigAndInfo->SysConfig.AuthorisationMode=0;
  1287. ShmSysConfigAndInfo->SysConfig.DefaultLanguage=0;
  1288. ShmSysConfigAndInfo->SysInfo.InputVoltageR=0;
  1289. ShmSysConfigAndInfo->SysInfo.InputVoltageS=0;
  1290. ShmSysConfigAndInfo->SysInfo.InputVoltageT=0;
  1291. ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed=0;
  1292. ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed=0;
  1293. ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian=0;
  1294. ShmSysConfigAndInfo->SysConfig.RatingCurrent=100;
  1295. ShmSysConfigAndInfo->SysConfig.PsuAcInputType=0;
  1296. ShmSysConfigAndInfo->SysInfo.AuxPower5V=0;
  1297. ShmSysConfigAndInfo->SysInfo.AuxPower12V=0;
  1298. ShmSysConfigAndInfo->SysInfo.AuxPower24V=0;
  1299. ShmSysConfigAndInfo->SysInfo.AuxPower48V=0;
  1300. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev, "");
  1301. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev, "");
  1302. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev, "");
  1303. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "");
  1304. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, "");
  1305. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev, "");
  1306. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev, "");
  1307. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev, "");
  1308. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev, "");
  1309. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev, "");
  1310. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev, "");
  1311. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev, "");
  1312. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev, "");
  1313. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev, "");
  1314. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev, "");
  1315. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev, "");
  1316. strcpy((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev, "");
  1317. ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp=0;
  1318. ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp=0;
  1319. ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp=0;
  1320. ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp=0;
  1321. ShmSysConfigAndInfo->SysConfig.AcPlugInTimes=0;
  1322. ShmSysConfigAndInfo->SysConfig.GbPlugInTimes=0;
  1323. ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime=0;
  1324. ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes=0;
  1325. ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes=0;
  1326. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwPrimaryVersion, "DC 9.01");
  1327. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwPrimaryVersion, "DC 9.02");
  1328. // strcpy((char *)&ShmPsuData->PsuVersion[0].FwSecondVersion, "PFC 9.02");
  1329. // strcpy((char *)&ShmPsuData->PsuVersion[1].FwSecondVersion, "PFC 9.03");
  1330. ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=4;
  1331. ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=2;
  1332. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].ConnectorQuantity=2;
  1333. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].ConnectorQuantity=2;
  1334. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].LocalStatus=0;
  1335. ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].LocalStatus=0;
  1336. //charging
  1337. ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=0;
  1338. ShmSysConfigAndInfo->SysConfig.MaxChargingPower=0;
  1339. ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent= 0;
  1340. ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage= 0;
  1341. ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent= 0;
  1342. ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=0;
  1343. ShmSysConfigAndInfo->SysConfig.MaxChargingSoc=0;
  1344. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0], "111");
  1345. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1], "222");
  1346. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2], "333");
  1347. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3], "444");
  1348. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4], "555");
  1349. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5], "666");
  1350. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6], "777");
  1351. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7], "888");
  1352. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8], "999");
  1353. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9], "aaa");
  1354. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.UserId, "UserId");
  1355. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingVoltage=0;
  1356. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingCurrent=0;
  1357. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargingPower=0;
  1358. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedEnergy=0;
  1359. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].PresentChargedDuration=0;
  1360. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].RemainChargingDuration=0;
  1361. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatteryMaxVoltage=0;
  1362. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetVoltage=0;
  1363. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterySoc=0;
  1364. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].SystemStatus=1;
  1365. ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].EvBatterytargetCurrent=1;
  1366. //network
  1367. ShmSysConfigAndInfo->SysInfo.InternetConn=0;
  1368. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer,"");
  1369. ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=1;
  1370. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress,"");
  1371. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,"192.168.1.10");
  1372. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
  1373. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,"192.168.1.1");
  1374. ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=1;
  1375. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress,"");
  1376. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,"192.168.0.10");
  1377. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
  1378. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,"192.168.0.1");
  1379. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=1;
  1380. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,"");
  1381. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,"");
  1382. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi=0;
  1383. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=0;
  1384. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=0;
  1385. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress,"");
  1386. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,"");
  1387. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,"");
  1388. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,"");
  1389. ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn=1;
  1390. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,"");
  1391. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=0;
  1392. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,"");
  1393. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,"");
  1394. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei,"");
  1395. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi,"");
  1396. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid,"");
  1397. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
  1398. ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=0;
  1399. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,"");
  1400. //backend
  1401. ShmSysConfigAndInfo->SysConfig.BackendConnTimeout=300;
  1402. ShmSysConfigAndInfo->SysConfig.OfflinePolicy=0;
  1403. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy=0;
  1404. ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration=0;
  1405. ShmSysConfigAndInfo->SysInfo.OcppConnStatus=0;
  1406. ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus=0;
  1407. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"");
  1408. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,"");
  1409. strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,"Phihong");
  1410. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=0;
  1411. struct SysConfigData SysConfig;
  1412. memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
  1413. StoreUsrConfigData(&SysConfig);
  1414. // struct PsuModuleVer PsuData;
  1415. // memcpy(&PsuData, &ShmPsuData->PsuVersion, sizeof(struct PsuModuleVer));
  1416. // StoreUsrConfigData(&PsuData);
  1417. #ifdef SystemLogMessage
  1418. DEBUG_INFO("WebService initial OK");
  1419. #endif
  1420. }
  1421. if (strcmp(argv[1], "button") == 0)
  1422. {
  1423. unsigned char Button1;
  1424. unsigned char Button2;
  1425. unsigned char EmergencyButton;
  1426. Button1=ShmPrimaryMcuData->InputDet.bits.Button1;
  1427. Button2=ShmPrimaryMcuData->InputDet.bits.Button2;
  1428. EmergencyButton=ShmPrimaryMcuData->InputDet.bits.EmergencyButton;
  1429. struct json_object *jobj;
  1430. struct json_object *sButton1;
  1431. struct json_object *sButton2;
  1432. struct json_object *sEmergencyButton;
  1433. sButton1 = json_object_new_int(Button1);
  1434. sButton2 = json_object_new_int(Button2);
  1435. sEmergencyButton = json_object_new_int(EmergencyButton);
  1436. jobj=json_object_new_object();
  1437. json_object_object_add(jobj,"Button1",sButton1);
  1438. json_object_object_add(jobj,"Button2",sButton2);
  1439. json_object_object_add(jobj,"EmergencyButton",sEmergencyButton);
  1440. printf("%s\n", json_object_to_json_string(jobj));
  1441. }
  1442. if (strcmp(argv[1], "restart") == 0)
  1443. {
  1444. if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16) && (system("pidof -s OcppBackend > /dev/null") == 0))
  1445. {
  1446. sprintf((char*)ShmOCPP16Data->Reset.Type, "Soft");
  1447. ShmOCPP16Data->MsMsg.bits.ResetReq = 1;
  1448. DEBUG_INFO("Soft reset by OCPP1.6 form web page.\n");
  1449. }
  1450. else if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20) && (system("pidof -s OcppBackend20 > /dev/null") == 0))
  1451. {
  1452. sprintf((char*)ShmOCPP20Data->Reset.type, "OnIdle");
  1453. ShmOCPP20Data->MsMsg.bits.ResetReq = 1;
  1454. DEBUG_INFO("Soft reset by OCPP2.0.1 form web page.\n");
  1455. }
  1456. else
  1457. {
  1458. system("exec /usr/bin/run_evse_restart.sh");
  1459. DEBUG_INFO("Soft reset directly form web page.\n");
  1460. }
  1461. }
  1462. }
  1463. if(strcmp(argv[1], "log") == 0)
  1464. {
  1465. char cmd[512];
  1466. if((argc == 3) && isdigit(*argv[2]))
  1467. {
  1468. sprintf(cmd, "exec /root/logPackTools 'log' %s", argv[2]);
  1469. }
  1470. else
  1471. {
  1472. sprintf(cmd, "exec /root/logPackTools 'log'");
  1473. }
  1474. if(system(cmd) == 0)
  1475. {
  1476. DEBUG_INFO("Log pack success.\n");
  1477. }
  1478. else
  1479. {
  1480. DEBUG_INFO("Log pack fail.\n");
  1481. }
  1482. }
  1483. //upgrade firmware
  1484. if ((argc == 3) & (strcmp(argv[1], "upgrade") == 0))
  1485. {
  1486. struct json_object *jobj;
  1487. struct json_object *Result;
  1488. struct json_object *Message;
  1489. //char cmd[100];
  1490. jobj=json_object_new_object();
  1491. //system
  1492. //if((char)ShmSysConfigAndInfo->SysInfo.FirmwareUpdate == '0'){
  1493. ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=1;
  1494. Result = json_object_new_string("success");
  1495. Message = json_object_new_string("File is uploaded, please wait a moment to upgrade");
  1496. //}
  1497. /*else{
  1498. sprintf(cmd,"rm /mnt/%s",argv[2]);
  1499. system(cmd);
  1500. Result = json_object_new_string("error");
  1501. Message = json_object_new_string("machine is busy");
  1502. }*/
  1503. json_object_object_add(jobj,"Result",Result);
  1504. json_object_object_add(jobj,"Message",Message);
  1505. printf("%s\n", json_object_to_json_string(jobj));
  1506. }
  1507. #ifdef DO360
  1508. //set power cabinet
  1509. // ./WebService "PowerCabinet" Cmd "{'FTargetVoltage': val,'FTargetCurrent': val, 'Gun': val}"
  1510. if ((strcmp(argv[1], "PowerCabinet") == 0)) {
  1511. char *IsDO[3];
  1512. substr((char *)IsDO,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,2);
  1513. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  1514. struct json_object *jobj2;
  1515. jobj2=json_object_new_object();
  1516. int Gun = 0;
  1517. //force charging
  1518. if (strcmp(argv[2], "1") == 0) {
  1519. json_object_object_add(jobj2,"Cmd",json_object_new_string("1"));
  1520. int FTargetVoltage = 0;
  1521. int FTargetCurrent = 0;
  1522. if(strlen(argv[3]) >0){
  1523. struct json_object *jobj = json_tokener_parse(argv[3]);
  1524. json_object *val_obj = NULL;
  1525. if( json_object_object_get_ex(jobj, "Gun", &val_obj) ) {
  1526. Gun = json_object_get_int(val_obj);
  1527. if( json_object_object_get_ex(jobj, "FTargetVoltage", &val_obj) ) {
  1528. FTargetVoltage = json_object_get_int(val_obj);
  1529. ShmChargerInfo->Control.FCharging[Gun].FTargetVoltage = FTargetVoltage * 10;
  1530. json_object_object_add(jobj2,"FTargetVoltage",json_object_new_int(FTargetVoltage));
  1531. }
  1532. if( json_object_object_get_ex(jobj, "FTargetCurrent", &val_obj) ) {
  1533. FTargetCurrent = json_object_get_int(val_obj);
  1534. ShmChargerInfo->Control.FCharging[Gun].FTargetCurrent = FTargetCurrent * 10;
  1535. json_object_object_add(jobj2,"FTargetCurrent",json_object_new_int(FTargetCurrent));
  1536. }
  1537. ShmChargerInfo->Control.FCharging[Gun].FCtrl.bits.EnableForceCharging=1;
  1538. ShmChargerInfo->Control.FCharging[Gun].FCtrl.bits.StartForceCharging=1;
  1539. ShmChargerInfo->Control.FCharging[Gun].FCtrl.bits.WebApiTrigger=1;
  1540. }
  1541. }
  1542. printf("%s\n", json_object_to_json_string(jobj2));
  1543. }
  1544. //remote stop
  1545. if (strcmp(argv[2], "2") == 0) {
  1546. if(strlen(argv[3]) >0){
  1547. struct json_object *jobj = json_tokener_parse(argv[3]);
  1548. json_object *val_obj = NULL;
  1549. if( json_object_object_get_ex(jobj, "Gun", &val_obj) ) {
  1550. Gun = json_object_get_int(val_obj);
  1551. json_object_object_add(jobj2,"Cmd",json_object_new_string("2"));
  1552. ShmSysConfigAndInfo->SysInfo.ConnectorInfo[Gun].GeneralChargingData.ChargingStopFlag.bits.ManualStop=1;
  1553. printf("%s\n", json_object_to_json_string(jobj2));
  1554. }
  1555. }
  1556. }
  1557. if (strcmp(argv[2], "0") == 0) {
  1558. struct json_object *jobj;
  1559. jobj=json_object_new_object();
  1560. struct json_object *FTargetVoltage;
  1561. struct json_object *FTargetCurrent;
  1562. struct json_object *EnableForceCharging;
  1563. struct json_object *StartForceCharging;
  1564. struct json_object *WebApiTrigger;
  1565. struct json_object *ManualStop;
  1566. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FTargetVoltage);
  1567. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FTargetCurrent);
  1568. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FCtrl.bits.EnableForceCharging);
  1569. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FCtrl.bits.StartForceCharging);
  1570. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[0].FCtrl.bits.WebApiTrigger);
  1571. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[0].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1572. json_object_object_add(jobj,"FTargetVoltage0",FTargetVoltage);
  1573. json_object_object_add(jobj,"FTargetCurrent0",FTargetCurrent);
  1574. json_object_object_add(jobj,"EnableForceCharging0",EnableForceCharging);
  1575. json_object_object_add(jobj,"StartForceCharging0",StartForceCharging);
  1576. json_object_object_add(jobj,"WebApiTrigger0",WebApiTrigger);
  1577. json_object_object_add(jobj,"ManualStop0",ManualStop);
  1578. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FTargetVoltage);
  1579. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FTargetCurrent);
  1580. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FCtrl.bits.EnableForceCharging);
  1581. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FCtrl.bits.StartForceCharging);
  1582. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[1].FCtrl.bits.WebApiTrigger);
  1583. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[1].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1584. json_object_object_add(jobj,"FTargetVoltage1",FTargetVoltage);
  1585. json_object_object_add(jobj,"FTargetCurrent1",FTargetCurrent);
  1586. json_object_object_add(jobj,"EnableForceCharging1",EnableForceCharging);
  1587. json_object_object_add(jobj,"StartForceCharging1",StartForceCharging);
  1588. json_object_object_add(jobj,"WebApiTrigger1",WebApiTrigger);
  1589. json_object_object_add(jobj,"ManualStop1",ManualStop);
  1590. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FTargetVoltage);
  1591. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FTargetCurrent);
  1592. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FCtrl.bits.EnableForceCharging);
  1593. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FCtrl.bits.StartForceCharging);
  1594. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[2].FCtrl.bits.WebApiTrigger);
  1595. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[2].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1596. json_object_object_add(jobj,"FTargetVoltage2",FTargetVoltage);
  1597. json_object_object_add(jobj,"FTargetCurrent2",FTargetCurrent);
  1598. json_object_object_add(jobj,"EnableForceCharging2",EnableForceCharging);
  1599. json_object_object_add(jobj,"StartForceCharging2",StartForceCharging);
  1600. json_object_object_add(jobj,"WebApiTrigger2",WebApiTrigger);
  1601. json_object_object_add(jobj,"ManualStop2",ManualStop);
  1602. FTargetVoltage = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FTargetVoltage);
  1603. FTargetCurrent = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FTargetCurrent);
  1604. EnableForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FCtrl.bits.EnableForceCharging);
  1605. StartForceCharging = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FCtrl.bits.StartForceCharging);
  1606. WebApiTrigger = json_object_new_int(ShmChargerInfo->Control.FCharging[3].FCtrl.bits.WebApiTrigger);
  1607. ManualStop = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[3].GeneralChargingData.ChargingStopFlag.bits.ManualStop);
  1608. json_object_object_add(jobj,"FTargetVoltage3",FTargetVoltage);
  1609. json_object_object_add(jobj,"FTargetCurrent3",FTargetCurrent);
  1610. json_object_object_add(jobj,"EnableForceCharging3",EnableForceCharging);
  1611. json_object_object_add(jobj,"StartForceCharging3",StartForceCharging);
  1612. json_object_object_add(jobj,"WebApiTrigger3",WebApiTrigger);
  1613. json_object_object_add(jobj,"ManualStop3",ManualStop);
  1614. printf("%s\n", json_object_to_json_string(jobj));
  1615. json_object_put(jobj);
  1616. }
  1617. }
  1618. }
  1619. #endif
  1620. //web page query all
  1621. if ((argc == 2) & (strcmp(argv[1], "query") == 0)) {
  1622. char *IsAcDc[2];
  1623. char *SafetyRegulation[2];
  1624. char *IsDO[3];
  1625. char *Connector1[2];
  1626. char *Connector2[2];
  1627. char *Connector3[2];
  1628. char *Network[2];
  1629. //unsigned char connector1FwVer[32];
  1630. //unsigned char connector2FwVer[32];
  1631. short gunQty;
  1632. char *RatedPower1[2];
  1633. char *RatedPower2[2];
  1634. char *RatedPower3[2];
  1635. short RatedPower;
  1636. short PsuQuantity = 0;
  1637. substr((char *)IsAcDc,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,1);
  1638. substr((char *)SafetyRegulation,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,3,1);
  1639. substr((char *)IsDO,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,2);
  1640. substr((char *)Connector1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,7,1);
  1641. substr((char *)Connector2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
  1642. substr((char *)Connector3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
  1643. substr((char *)Network,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,10,1);
  1644. int connectorType1,connectorType2,connectorType3;
  1645. connectorType1=ConnectorType((char *)Connector1);
  1646. connectorType2=ConnectorType((char *)Connector2);
  1647. connectorType3=ConnectorType((char *)Connector3);
  1648. if(connectorType1 == connectorType2){
  1649. gunQty = 1;
  1650. }
  1651. else{
  1652. gunQty = 0;
  1653. }
  1654. if(connectorType1 != 0){
  1655. if(connectorType1 == 1){
  1656. // strcpy((char *)&connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  1657. // memcpy(connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  1658. }
  1659. else if(connectorType1 == 2){
  1660. // strcpy((char *)&connector1FwVer,ShmGBTData->evse[0].version);
  1661. // memcpy(connector1FwVer,ShmGBTData->evse[0].version,ARRAY_SIZE(ShmGBTData->evse[0].version));
  1662. }
  1663. else if(connectorType1 == 3){
  1664. // strcpy((char *)&connector1FwVer,ShmCHAdeMOData->evse[0].version);
  1665. // memcpy(connector1FwVer,ShmCHAdeMOData->evse[0].version,ARRAY_SIZE(ShmCHAdeMOData->evse[0].version));
  1666. }
  1667. }
  1668. if(connectorType2 != 0){
  1669. if(connectorType2 == 1){
  1670. // strcpy((char *)&connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version);
  1671. // memcpy(connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
  1672. }
  1673. else if(connectorType2 == 2){
  1674. // strcpy((char *)&connector2FwVer,ShmGBTData->evse[gunQty].version);
  1675. // memcpy(connector2FwVer,ShmGBTData->evse[gunQty].version,ARRAY_SIZE(ShmGBTData->evse[gunQty].version));
  1676. }
  1677. else if(connectorType2 == 3){
  1678. // strcpy((char *)&connector2FwVer,ShmCHAdeMOData->evse[gunQty].version);
  1679. // memcpy(connector2FwVer,ShmCHAdeMOData->evse[gunQty].version,ARRAY_SIZE(ShmCHAdeMOData->evse[gunQty].version));
  1680. }
  1681. }
  1682. substr((char *)RatedPower1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,4,1);
  1683. substr((char *)RatedPower2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,5,1);
  1684. substr((char *)RatedPower3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,6,1);
  1685. int p1=atoi((char *)RatedPower1);
  1686. int p2=atoi((char *)RatedPower2);
  1687. int p3=atoi((char *)RatedPower3);
  1688. if(strcmp(IsAcDc, "D") == 0){
  1689. RatedPower=(p1*10+p2)*pow(10,p3-1);
  1690. if(RatedPower==50){
  1691. PsuQuantity = 3;
  1692. }
  1693. else{
  1694. // if(RatedPower>=30){
  1695. PsuQuantity = RatedPower/30;
  1696. // }
  1697. }
  1698. }
  1699. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  1700. }
  1701. struct json_object *jobj1;
  1702. struct json_object *jobj2;
  1703. struct json_object *jobj3;
  1704. struct json_object *jobj4;
  1705. //system
  1706. struct json_object *ModelName;
  1707. struct json_object *AcModelName;
  1708. struct json_object *SerialNumber;
  1709. struct json_object *SystemId;
  1710. struct json_object *AcPhaseCount;
  1711. struct json_object *PhaseLossPolicy;
  1712. struct json_object *FactoryConfiguration;
  1713. struct json_object *AuthorisationMode;
  1714. struct json_object *DefaultLanguage;
  1715. struct json_object *InputVoltageR;
  1716. struct json_object *InputVoltageS;
  1717. struct json_object *InputVoltageT;
  1718. struct json_object *InputVoltageDc;
  1719. struct json_object *SystemFanRotaSpeed;
  1720. struct json_object *PsuFanRotaSpeed;
  1721. struct json_object *RfidCardNumEndian;
  1722. struct json_object *PsuAcInputType;
  1723. struct json_object *RatingCurrent;
  1724. struct json_object *AcRatingCurrent;
  1725. struct json_object *isAPP;
  1726. struct json_object *isQRCode;
  1727. struct json_object *isRFID;
  1728. struct json_object *QRCodeMadeMode;
  1729. struct json_object *QRCodeContent;
  1730. struct json_object *Intensity;
  1731. struct json_object *isAuthrizeByEVCCID;
  1732. struct json_object *AuxPower5V;
  1733. struct json_object *AuxPower12V;
  1734. struct json_object *AuxPower24V;
  1735. struct json_object *AuxPower48V;
  1736. struct json_object *CsuHwRev;
  1737. struct json_object *CsuBootLoadFwRev;
  1738. struct json_object *CsuKernelFwRev;
  1739. struct json_object *CsuRootFsFwRev;
  1740. struct json_object *CsuPrimFwRev;
  1741. struct json_object *LcmHwRev;
  1742. struct json_object *LcmFwRev;
  1743. struct json_object *PsuHwRev;
  1744. struct json_object *PsuPrimFwRev;
  1745. struct json_object *PsuSecFwRev;
  1746. struct json_object *AuxPwrHwRev;
  1747. struct json_object *AuxPwrFwRev;
  1748. struct json_object *FanModuleHwRev;
  1749. struct json_object *FanModuleFwRev;
  1750. struct json_object *RelayModuleHwRev;
  1751. struct json_object *RelayModuleFwRev;
  1752. struct json_object *TelcomModemFwRev;
  1753. struct json_object *Connector1FwRev;
  1754. struct json_object *Connector2FwRev;
  1755. struct json_object *PsuLostQuantity;
  1756. /* for DC+AC*/
  1757. struct json_object *Connector3FwRev;
  1758. struct json_object *LedModuleFwRev;
  1759. struct json_object *SystemAmbientTemp;
  1760. struct json_object *SystemCriticalTemp;
  1761. struct json_object *CcsConnectorTemp;
  1762. struct json_object *PsuAmbientTemp;
  1763. struct json_object *AcPlugInTimes;
  1764. struct json_object *GbPlugInTimes;
  1765. struct json_object *Ccs1PlugInTime;
  1766. struct json_object *Ccs2PlugInTimes;
  1767. struct json_object *ChademoPlugInTimes;
  1768. struct json_object *FirmwareUpdate;
  1769. struct json_object *FwPrimaryVersion[PsuQuantity];
  1770. struct json_object *FwPrimaryVersionArr= json_object_new_array();
  1771. struct json_object *FwSecondVersion[PsuQuantity];
  1772. struct json_object *FwSecondVersionArr= json_object_new_array();
  1773. /* for DO & DD*/
  1774. struct json_object *DispenserQuantity;
  1775. struct json_object *TotalConnectorQuantity;
  1776. struct json_object *DDLocalStatus[4];
  1777. struct json_object *DDLocalStatusArr= json_object_new_array();
  1778. struct json_object *DDModelName[4];
  1779. struct json_object *DDModelNameArr= json_object_new_array();
  1780. struct json_object *DDSerialNumber[4];
  1781. struct json_object *DDSerialNumberArr= json_object_new_array();
  1782. struct json_object *DDSystemId[4];
  1783. struct json_object *DDSystemIdArr= json_object_new_array();
  1784. struct json_object *DDAuthorisationMode[4];
  1785. struct json_object *DDAuthorisationModeArr= json_object_new_array();
  1786. struct json_object *DDRfidCardNumEndian[4];
  1787. struct json_object *DDRfidCardNumEndianArr= json_object_new_array();
  1788. struct json_object *DDisAPP[4];
  1789. struct json_object *DDisAPPArr= json_object_new_array();
  1790. struct json_object *DDisQRCode[4];
  1791. struct json_object *DDisQRCodeArr= json_object_new_array();
  1792. struct json_object *DDisRFID[4];
  1793. struct json_object *DDisRFIDArr= json_object_new_array();
  1794. struct json_object *DDQRCodeMadeMode[4];
  1795. struct json_object *DDQRCodeMadeModeArr= json_object_new_array();
  1796. struct json_object *DDQRCodeContent[4];
  1797. struct json_object *DDQRCodeContentArr= json_object_new_array();
  1798. struct json_object *DDFactoryConfiguration[4];
  1799. struct json_object *DDFactoryConfigurationArr= json_object_new_array();
  1800. struct json_object *DDCsuBootLoadFwRev[4];
  1801. struct json_object *DDCsuBootLoadFwRevArr= json_object_new_array();
  1802. struct json_object *DDCsuKernelFwRev[4];
  1803. struct json_object *DDCsuKernelFwRevArr= json_object_new_array();
  1804. struct json_object *DDCsuRootFsFwRev[4];
  1805. struct json_object *DDCsuRootFsFwRevArr= json_object_new_array();
  1806. struct json_object *DDCsuPrimFwRev[4];
  1807. struct json_object *DDCsuPrimFwRevArr= json_object_new_array();
  1808. struct json_object *DDLcmFwRev[4];
  1809. struct json_object *DDLcmFwRevArr= json_object_new_array();
  1810. struct json_object *DDPsuPrimFwRev[4];
  1811. struct json_object *DDPsuPrimFwRevArr= json_object_new_array();
  1812. struct json_object *DDPsuSecFwRev[4];
  1813. struct json_object *DDPsuSecFwRevArr= json_object_new_array();
  1814. struct json_object *DDFanModuleFwRev[4];
  1815. struct json_object *DDFanModuleFwRevArr= json_object_new_array();
  1816. struct json_object *DDRelayModuleFwRev[4];
  1817. struct json_object *DDRelayModuleFwRevArr= json_object_new_array();
  1818. struct json_object *DDTelcomModemFwRev[4];
  1819. struct json_object *DDTelcomModemFwRevArr= json_object_new_array();
  1820. struct json_object *DDLedModuleFwRev[4];
  1821. struct json_object *DDLedModuleFwRevArr= json_object_new_array();
  1822. struct json_object *DDConnector1FwRev[4];
  1823. struct json_object *DDConnector1FwRevArr= json_object_new_array();
  1824. struct json_object *DDConnector2FwRev[4];
  1825. struct json_object *DDConnector2FwRevArr= json_object_new_array();
  1826. struct json_object *DDIntensity[4];
  1827. struct json_object *DDIntensityArr= json_object_new_array();
  1828. struct json_object *Relay2ModuleFwRev;
  1829. //charging
  1830. struct json_object *MaxChargingEnergy;
  1831. struct json_object *MaxChargingPower;
  1832. struct json_object *MaxChargingCurrent;
  1833. struct json_object *MaxChargingVoltage;
  1834. struct json_object *AcMaxChargingCurrent;
  1835. struct json_object *MaxChargingDuration;
  1836. struct json_object *MaxChargingSoc;
  1837. struct json_object *StopChargingByButton;
  1838. struct json_object *FanControlPolicy;
  1839. struct json_object *LocalWhiteCard[10];
  1840. struct json_object *LocalWhiteCardArr= json_object_new_array();
  1841. struct json_object *isBilling;
  1842. struct json_object *Currency;
  1843. struct json_object *Fee[24];
  1844. struct json_object *FeeArr= json_object_new_array();
  1845. struct json_object *ChargingInfo1;
  1846. struct json_object *ChargingInfo2;
  1847. struct json_object *ChargingInfo3;
  1848. struct json_object *StartUserId[3];
  1849. struct json_object *StartDateTime[3];
  1850. struct json_object *StopDateTime[3];
  1851. struct json_object *StartMethod[3];
  1852. struct json_object *ConnectorTemp[3];
  1853. struct json_object *ChillerTemp[3];
  1854. struct json_object *PresentChargingVoltage[3];
  1855. struct json_object *PresentChargingCurrent[3];
  1856. struct json_object *PresentChargingPower[3];
  1857. struct json_object *PresentChargedEnergy[3];
  1858. struct json_object *PresentChargedDuration[3];
  1859. struct json_object *RemainChargingDuration[3];
  1860. struct json_object *EvBatteryMaxVoltage[3];
  1861. struct json_object *EvBatterytargetVoltage[3];
  1862. struct json_object *EvBatterySoc[3];
  1863. struct json_object *PilotVoltage[3];
  1864. struct json_object *SystemStatus[3];
  1865. struct json_object *EvBatterytargetCurrent[3];
  1866. struct json_object *PowerConsumption[3];
  1867. struct json_object *isCalibratedVaGain[3];
  1868. struct json_object *isCalibratedVbGain[3];
  1869. struct json_object *isCalibratedVcGain[3];
  1870. struct json_object *isCalibratedVaOffset[3];
  1871. struct json_object *isCalibratedVbOffset[3];
  1872. struct json_object *isCalibratedVcOffset[3];
  1873. struct json_object *isCalibratedCaGain[3];
  1874. struct json_object *isCalibratedCbGain[3];
  1875. struct json_object *isCalibratedCcGain[3];
  1876. struct json_object *isCalibratedCaOffset[3];
  1877. struct json_object *isCalibratedCbOffset[3];
  1878. struct json_object *isCalibratedCcOffset[3];
  1879. struct json_object *isCalibratedPa[3];
  1880. struct json_object *isCalibratedPb[3];
  1881. struct json_object *isCalibratedPc[3];
  1882. /* for DO & DD*/
  1883. struct json_object *DDChargingInfo1;
  1884. struct json_object *DDChargingInfo2;
  1885. struct json_object *DDChargingInfo3;
  1886. struct json_object *DDChargingInfo4;
  1887. struct json_object *DDStartUserId[4];
  1888. struct json_object *DDStartDateTime[4];
  1889. struct json_object *DDStopDateTime[4];
  1890. struct json_object *DDStartMethod[4];
  1891. struct json_object *DDConnectorTemp[4];
  1892. struct json_object *DDChillerTemp[4];
  1893. struct json_object *DDPresentChargingVoltage[4];
  1894. struct json_object *DDPresentChargingCurrent[4];
  1895. struct json_object *DDPresentChargingPower[4];
  1896. struct json_object *DDPresentChargedEnergy[4];
  1897. struct json_object *DDPresentChargedDuration[4];
  1898. struct json_object *DDRemainChargingDuration[4];
  1899. struct json_object *DDEvBatteryMaxVoltage[4];
  1900. struct json_object *DDEvBatterytargetVoltage[4];
  1901. struct json_object *DDEvBatterySoc[4];
  1902. struct json_object *DDSystemStatus[4];
  1903. struct json_object *DDEvBatterytargetCurrent[4];
  1904. struct json_object *DDPowerConsumption[4];
  1905. //network
  1906. struct json_object *InternetConn;
  1907. struct json_object *FtpServer;
  1908. struct json_object *Eth0DhcpClient;
  1909. struct json_object *Eth0MacAddress;
  1910. struct json_object *Eth0IpAddress;
  1911. struct json_object *Eth0SubmaskAddress;
  1912. struct json_object *Eth0GatewayAddress;
  1913. struct json_object *Eth1DhcpClient;
  1914. struct json_object *Eth1MacAddress;
  1915. struct json_object *Eth1IpAddress;
  1916. struct json_object *Eth1SubmaskAddress;
  1917. struct json_object *Eth1GatewayAddress;
  1918. struct json_object *WifiMode;
  1919. struct json_object *WifiSsid;
  1920. struct json_object *WifiPassword;
  1921. struct json_object *WifiBroadcastSsid;
  1922. struct json_object *WifiTargetBssidMac;
  1923. struct json_object *WifiRssi;
  1924. struct json_object *WifiDhcpServer;
  1925. struct json_object *WifiDhcpClient;
  1926. struct json_object *WifiMacAddress;
  1927. struct json_object *WifiIpAddress;
  1928. struct json_object *WifiSubmaskAddress;
  1929. struct json_object *WifiGatewayAddress;
  1930. struct json_object *WifiNetworkConn;
  1931. struct json_object *TelcomApn;
  1932. struct json_object *TelcomRssi;
  1933. struct json_object *TelcomChapPapId;
  1934. struct json_object *TelcomChapPapPwd;
  1935. struct json_object *TelcomModemImei;
  1936. struct json_object *TelcomSimImsi;
  1937. struct json_object *TelcomSimIccid;
  1938. struct json_object *TelcomSimStatus;
  1939. struct json_object *TelcomModemMode;
  1940. struct json_object *TelcomIpAddress;
  1941. struct json_object *TelcomNetworkConn;
  1942. struct json_object *TelcomEnabled;
  1943. struct json_object *TelcomNetworkType;
  1944. struct json_object *isEnalbleFirewall;
  1945. struct json_object *FirewallAcceptAddr[10];
  1946. struct json_object *FirewallAcceptAddrArr= json_object_new_array();
  1947. //backend
  1948. struct json_object *BackendConnTimeout;
  1949. struct json_object *OfflinePolicy;
  1950. struct json_object *OfflineMaxChargeEnergy;
  1951. struct json_object *OfflineMaxChargeDuration;
  1952. struct json_object *OcppConnStatus;
  1953. struct json_object *MaintainServerConnStatus;
  1954. struct json_object *OcppServerURL;
  1955. struct json_object *ChargeBoxId;
  1956. struct json_object *chargePointVendor;
  1957. struct json_object *OcppSecurityProfile;
  1958. struct json_object *OcppSecurityPassword;
  1959. struct json_object *MaintainServerSecurityProfile;
  1960. struct json_object *MaintainServerSecurityPassword;
  1961. struct json_object *isEnableLocalPowerSharging;
  1962. struct json_object *PowerSharingCapacity;
  1963. struct json_object *PowerSharingServerIP;
  1964. struct json_object *OcppReceiptrURL;
  1965. struct json_object *MaintainServerURL;
  1966. struct json_object *ChargePointPrivateKey;
  1967. struct json_object *ChargePointCertificate;
  1968. struct json_object *V2GPrivateKey;
  1969. struct json_object *V2GRootCertificate;
  1970. struct json_object *V2GCertificateChain;
  1971. struct json_object *MORootCertificate;
  1972. struct json_object *CSRootCertificate;
  1973. struct json_object *ManufacturerRootCertificate;
  1974. /*for TTIA*/
  1975. struct json_object *isEnableTTIA;
  1976. struct json_object *server_addr;
  1977. struct json_object *server_port;
  1978. struct json_object *busVenderId;
  1979. struct json_object *EquipmentProvider;
  1980. struct json_object *TransportationCompanyNo;
  1981. struct json_object *TTIAChargeBoxId;
  1982. struct json_object *evseStation;
  1983. jobj1=json_object_new_object();
  1984. jobj2=json_object_new_object();
  1985. jobj3=json_object_new_object();
  1986. jobj4=json_object_new_object();
  1987. //system
  1988. ModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ModelName);
  1989. AcModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AcModelName);
  1990. SerialNumber = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber);
  1991. SystemId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SystemId);
  1992. AcPhaseCount = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPhaseCount);
  1993. PhaseLossPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy);
  1994. FactoryConfiguration = json_object_new_int(ShmSysConfigAndInfo->SysInfo.FactoryConfiguration);
  1995. AuthorisationMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
  1996. DefaultLanguage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.DefaultLanguage);
  1997. InputVoltageR = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageR);
  1998. InputVoltageS = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageS);
  1999. InputVoltageT = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageT);
  2000. InputVoltageDc = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageDc);
  2001. SystemFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed);
  2002. PsuFanRotaSpeed = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed);
  2003. RfidCardNumEndian = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
  2004. PsuAcInputType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PsuAcInputType);
  2005. RatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RatingCurrent);
  2006. AcRatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcRatingCurrent);
  2007. isAPP = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAPP);
  2008. isQRCode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isQRCode);
  2009. isRFID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isRFID);
  2010. QRCodeMadeMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
  2011. QRCodeContent = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent);
  2012. Intensity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity);
  2013. isAuthrizeByEVCCID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID);
  2014. AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
  2015. AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
  2016. AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
  2017. AuxPower48V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower48V);
  2018. CsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
  2019. CsuBootLoadFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
  2020. CsuKernelFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
  2021. CsuRootFsFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
  2022. CsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
  2023. LcmHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
  2024. LcmFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
  2025. PsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
  2026. PsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
  2027. PsuSecFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
  2028. AuxPwrHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
  2029. AuxPwrFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
  2030. FanModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
  2031. FanModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
  2032. RelayModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
  2033. RelayModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
  2034. TelcomModemFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
  2035. Connector1FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector1FwRev);
  2036. Connector2FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Connector2FwRev);
  2037. PsuLostQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuLostQuantity);
  2038. /* for DC+AC*/
  2039. if(connectorType3==4){
  2040. Connector3FwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[0].version);
  2041. }
  2042. LedModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LedModuleFwRev);
  2043. SystemAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
  2044. SystemCriticalTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
  2045. CcsConnectorTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
  2046. PsuAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.PsuAmbientTemp);
  2047. AcPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPlugInTimes);
  2048. GbPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.GbPlugInTimes);
  2049. Ccs1PlugInTime = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime);
  2050. Ccs2PlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes);
  2051. ChademoPlugInTimes = json_object_new_int(ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes);
  2052. FirmwareUpdate = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
  2053. if(strcmp(IsAcDc, "D") == 0){
  2054. for(int i=0;i<PsuQuantity;i++){
  2055. FwPrimaryVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwPrimaryVersion);
  2056. FwSecondVersion[i] = json_object_new_string((char *)&ShmPsuData->PsuVersion[i].FwSecondVersion);
  2057. json_object_array_add(FwPrimaryVersionArr,FwPrimaryVersion[i]);
  2058. json_object_array_add(FwSecondVersionArr,FwSecondVersion[i]);
  2059. }
  2060. }
  2061. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  2062. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=0;
  2063. DispenserQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity);
  2064. TotalConnectorQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity);
  2065. int DDDispenserQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity;
  2066. for(int i=0;i<DDDispenserQuantity;i++){
  2067. DDLocalStatus[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LocalStatus);
  2068. DDModelName[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ModelName);
  2069. DDSerialNumber[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].SerialNumber);
  2070. DDSystemId[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].SystemId);
  2071. DDAuthorisationMode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].AuthorisationMode);
  2072. DDRfidCardNumEndian[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].RfidCardNumEndian);
  2073. DDisAPP[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isAPP);
  2074. DDisQRCode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isQRCode);
  2075. DDisRFID[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].isRFID);
  2076. DDQRCodeMadeMode[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].QRCodeMadeMode);
  2077. DDQRCodeContent[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].QRCodeContent);
  2078. DDFactoryConfiguration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].FactoryConfiguration);
  2079. DDCsuBootLoadFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuBootLoadFwRev);
  2080. DDCsuKernelFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuKernelFwRev);
  2081. DDCsuRootFsFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuRootFsFwRev);
  2082. DDCsuPrimFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].CsuPrimFwRev);
  2083. DDLcmFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LcmFwRev);
  2084. DDPsuPrimFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].PsuPrimFwRev);
  2085. DDPsuSecFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].PsuSecFwRev);
  2086. DDFanModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].FanModuleFwRev);
  2087. DDRelayModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].RelayModuleFwRev);
  2088. DDTelcomModemFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].TelcomModemFwRev);
  2089. DDLedModuleFwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LedModuleFwRev);
  2090. DDConnector1FwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].Connector1FwRev);
  2091. DDConnector2FwRev[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].Connector2FwRev);
  2092. DDIntensity[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].LedInfo.Intensity);
  2093. json_object_array_add(DDLocalStatusArr,DDLocalStatus[i]);
  2094. json_object_array_add(DDModelNameArr,DDModelName[i]);
  2095. json_object_array_add(DDSerialNumberArr,DDSerialNumber[i]);
  2096. json_object_array_add(DDSystemIdArr,DDSystemId[i]);
  2097. json_object_array_add(DDAuthorisationModeArr,DDAuthorisationMode[i]);
  2098. json_object_array_add(DDRfidCardNumEndianArr,DDRfidCardNumEndian[i]);
  2099. json_object_array_add(DDisAPPArr,DDisAPP[i]);
  2100. json_object_array_add(DDisQRCodeArr,DDisQRCode[i]);
  2101. json_object_array_add(DDisRFIDArr,DDisRFID[i]);
  2102. json_object_array_add(DDQRCodeMadeModeArr,DDQRCodeMadeMode[i]);
  2103. json_object_array_add(DDQRCodeContentArr,DDQRCodeContent[i]);
  2104. json_object_array_add(DDFactoryConfigurationArr,DDFactoryConfiguration[i]);
  2105. json_object_array_add(DDCsuBootLoadFwRevArr,DDCsuBootLoadFwRev[i]);
  2106. json_object_array_add(DDCsuKernelFwRevArr,DDCsuKernelFwRev[i]);
  2107. json_object_array_add(DDCsuRootFsFwRevArr,DDCsuRootFsFwRev[i]);
  2108. json_object_array_add(DDCsuPrimFwRevArr,DDCsuPrimFwRev[i]);
  2109. json_object_array_add(DDLcmFwRevArr,DDLcmFwRev[i]);
  2110. json_object_array_add(DDPsuPrimFwRevArr,DDPsuPrimFwRev[i]);
  2111. json_object_array_add(DDPsuSecFwRevArr,DDPsuSecFwRev[i]);
  2112. json_object_array_add(DDFanModuleFwRevArr,DDFanModuleFwRev[i]);
  2113. json_object_array_add(DDRelayModuleFwRevArr,DDRelayModuleFwRev[i]);
  2114. json_object_array_add(DDTelcomModemFwRevArr,DDTelcomModemFwRev[i]);
  2115. json_object_array_add(DDLedModuleFwRevArr,DDLedModuleFwRev[i]);
  2116. json_object_array_add(DDConnector1FwRevArr,DDConnector1FwRev[i]);
  2117. json_object_array_add(DDConnector2FwRevArr,DDConnector2FwRev[i]);
  2118. json_object_array_add(DDIntensityArr,DDIntensity[i]);
  2119. }
  2120. Relay2ModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.Relay2ModuleFwRev);
  2121. }
  2122. //charging
  2123. int CcsGunQty=0;
  2124. int GbGunQty=0;
  2125. int CHAdeMOGunQty=0;
  2126. int AcGunQty=0;
  2127. ChargingInfo1=json_object_new_object();
  2128. ChargingInfo2=json_object_new_object();
  2129. ChargingInfo3=json_object_new_object();
  2130. MaxChargingEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
  2131. MaxChargingPower = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
  2132. MaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
  2133. MaxChargingVoltage = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingVoltage);
  2134. AcMaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent);
  2135. MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
  2136. MaxChargingSoc = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingSoc);
  2137. StopChargingByButton = json_object_new_int(ShmSysConfigAndInfo->SysConfig.StopChargingByButton);
  2138. FanControlPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.FanControlPolicy);
  2139. LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
  2140. LocalWhiteCard[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
  2141. LocalWhiteCard[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
  2142. LocalWhiteCard[3] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
  2143. LocalWhiteCard[4] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
  2144. LocalWhiteCard[5] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
  2145. LocalWhiteCard[6] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
  2146. LocalWhiteCard[7] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
  2147. LocalWhiteCard[8] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
  2148. LocalWhiteCard[9] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
  2149. isBilling = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling);
  2150. Currency = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.Currency);
  2151. Fee[0] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0]);
  2152. Fee[1] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1]);
  2153. Fee[2] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2]);
  2154. Fee[3] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3]);
  2155. Fee[4] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4]);
  2156. Fee[5] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5]);
  2157. Fee[6] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6]);
  2158. Fee[7] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7]);
  2159. Fee[8] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8]);
  2160. Fee[9] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9]);
  2161. Fee[10] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10]);
  2162. Fee[11] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11]);
  2163. Fee[12] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12]);
  2164. Fee[13] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13]);
  2165. Fee[14] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14]);
  2166. Fee[15] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15]);
  2167. Fee[16] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16]);
  2168. Fee[17] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17]);
  2169. Fee[18] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18]);
  2170. Fee[19] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19]);
  2171. Fee[20] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20]);
  2172. Fee[21] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21]);
  2173. Fee[22] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22]);
  2174. Fee[23] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23]);
  2175. if(connectorType1 != 0){
  2176. if(connectorType1 == 1){//CCS
  2177. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  2178. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  2179. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  2180. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  2181. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  2182. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  2183. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  2184. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  2185. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  2186. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PilotVoltage);
  2187. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  2188. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  2189. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  2190. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  2191. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  2192. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  2193. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  2194. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  2195. }
  2196. else{
  2197. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  2198. }
  2199. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  2200. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  2201. }
  2202. else{
  2203. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  2204. }
  2205. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  2206. CcsGunQty++;
  2207. }
  2208. else if(connectorType1 == 2){//GB
  2209. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  2210. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  2211. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  2212. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  2213. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  2214. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  2215. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  2216. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  2217. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  2218. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PilotVoltage);
  2219. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  2220. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  2221. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  2222. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  2223. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  2224. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  2225. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  2226. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  2227. }
  2228. else{
  2229. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  2230. }
  2231. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  2232. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  2233. }
  2234. else{
  2235. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  2236. }
  2237. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  2238. GbGunQty++;
  2239. }
  2240. else if(connectorType1 == 3){//CHAdeMO
  2241. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2242. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2243. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2244. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2245. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2246. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2247. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2248. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2249. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2250. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PilotVoltage);
  2251. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2252. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2253. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2254. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2255. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2256. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2257. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2258. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2259. }
  2260. else{
  2261. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2262. }
  2263. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2264. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2265. }
  2266. else{
  2267. ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2268. }
  2269. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2270. CHAdeMOGunQty++;
  2271. }
  2272. else if(connectorType1 == 4){//AC
  2273. PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2274. PresentChargingCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2275. PresentChargingPower[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2276. PresentChargedEnergy[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2277. PresentChargedDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2278. RemainChargingDuration[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2279. EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2280. EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2281. EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2282. PilotVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PilotVoltage);
  2283. SystemStatus[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2284. EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2285. StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2286. StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2287. StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2288. StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2289. ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2290. ChillerTemp[0] = json_object_new_int(255);
  2291. PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2292. if(strcmp(IsDO, "AX") == 0){
  2293. isCalibratedVaGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2294. isCalibratedVbGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2295. isCalibratedVcGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2296. isCalibratedVaOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2297. isCalibratedVbOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2298. isCalibratedVcOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2299. isCalibratedCaGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2300. isCalibratedCbGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2301. isCalibratedCcGain[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2302. isCalibratedCaOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2303. isCalibratedCbOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2304. isCalibratedCcOffset[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2305. isCalibratedPa[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2306. isCalibratedPb[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2307. isCalibratedPc[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2308. }
  2309. AcGunQty++;
  2310. }
  2311. }
  2312. if(connectorType2 != 0){
  2313. if(connectorType2 == 1){//CCS
  2314. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  2315. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  2316. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  2317. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  2318. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  2319. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  2320. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  2321. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  2322. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  2323. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PilotVoltage);
  2324. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  2325. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  2326. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  2327. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  2328. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  2329. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  2330. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  2331. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  2332. }
  2333. else{
  2334. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  2335. }
  2336. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  2337. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  2338. }
  2339. else{
  2340. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  2341. }
  2342. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  2343. CcsGunQty++;
  2344. }
  2345. else if(connectorType2 == 2){//GB
  2346. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  2347. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  2348. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  2349. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  2350. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  2351. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  2352. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  2353. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  2354. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  2355. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PilotVoltage);
  2356. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  2357. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  2358. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  2359. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  2360. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  2361. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  2362. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  2363. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  2364. }
  2365. else{
  2366. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  2367. }
  2368. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  2369. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  2370. }
  2371. else{
  2372. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  2373. }
  2374. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  2375. GbGunQty++;
  2376. }
  2377. else if(connectorType2 == 3){//CHAdeMO
  2378. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2379. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2380. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2381. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2382. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2383. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2384. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2385. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2386. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2387. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PilotVoltage);
  2388. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2389. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2390. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2391. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2392. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2393. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2394. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2395. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2396. }
  2397. else{
  2398. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2399. }
  2400. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2401. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2402. }
  2403. else{
  2404. ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2405. }
  2406. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2407. CHAdeMOGunQty++;
  2408. }
  2409. else if(connectorType2 == 4){//AC
  2410. PresentChargingVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2411. PresentChargingCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2412. PresentChargingPower[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2413. PresentChargedEnergy[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2414. PresentChargedDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2415. RemainChargingDuration[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2416. EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2417. EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2418. EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2419. PilotVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PilotVoltage);
  2420. SystemStatus[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2421. EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2422. StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2423. StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2424. StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2425. StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2426. ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2427. ChillerTemp[1] = json_object_new_int(255);
  2428. PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2429. if(strcmp(IsDO, "AX") == 0){
  2430. isCalibratedVaGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2431. isCalibratedVbGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2432. isCalibratedVcGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2433. isCalibratedVaOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2434. isCalibratedVbOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2435. isCalibratedVcOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2436. isCalibratedCaGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2437. isCalibratedCbGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2438. isCalibratedCcGain[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2439. isCalibratedCaOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2440. isCalibratedCbOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2441. isCalibratedCcOffset[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2442. isCalibratedPa[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2443. isCalibratedPb[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2444. isCalibratedPc[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2445. }
  2446. AcGunQty++;
  2447. }
  2448. }
  2449. if(connectorType3 != 0){
  2450. if(connectorType3 == 1){//CCS
  2451. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
  2452. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingCurrent);
  2453. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingPower);
  2454. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedEnergy);
  2455. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargedDuration);
  2456. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].RemainChargingDuration);
  2457. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
  2458. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
  2459. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
  2460. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PilotVoltage);
  2461. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus);
  2462. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
  2463. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
  2464. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
  2465. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
  2466. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
  2467. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
  2468. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
  2469. }
  2470. else{
  2471. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
  2472. }
  2473. if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
  2474. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
  2475. }
  2476. else{
  2477. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
  2478. }
  2479. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
  2480. CcsGunQty++;
  2481. }
  2482. else if(connectorType3 == 2){//GB
  2483. PresentChargingVoltage[2]= json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingVoltage);
  2484. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingCurrent);
  2485. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargingPower);
  2486. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedEnergy);
  2487. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PresentChargedDuration);
  2488. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].RemainChargingDuration);
  2489. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
  2490. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
  2491. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
  2492. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PilotVoltage);
  2493. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].SystemStatus);
  2494. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
  2495. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
  2496. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
  2497. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
  2498. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
  2499. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
  2500. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
  2501. }
  2502. else{
  2503. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
  2504. }
  2505. if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
  2506. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
  2507. }
  2508. else{
  2509. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
  2510. }
  2511. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
  2512. GbGunQty++;
  2513. }
  2514. else if(connectorType3 == 3){//CHAdeMO
  2515. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingVoltage);
  2516. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingCurrent);
  2517. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargingPower);
  2518. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedEnergy);
  2519. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PresentChargedDuration);
  2520. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].RemainChargingDuration);
  2521. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
  2522. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
  2523. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
  2524. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PilotVoltage);
  2525. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].SystemStatus);
  2526. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
  2527. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
  2528. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
  2529. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
  2530. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
  2531. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
  2532. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
  2533. }
  2534. else{
  2535. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
  2536. }
  2537. if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
  2538. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
  2539. }
  2540. else{
  2541. ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
  2542. }
  2543. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
  2544. CHAdeMOGunQty++;
  2545. }
  2546. else if(connectorType3 == 4){//AC
  2547. PresentChargingVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingVoltage);
  2548. PresentChargingCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingCurrent);
  2549. PresentChargingPower[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargingPower);
  2550. PresentChargedEnergy[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedEnergy);
  2551. PresentChargedDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PresentChargedDuration);
  2552. RemainChargingDuration[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].RemainChargingDuration);
  2553. EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatteryMaxVoltage);
  2554. EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetVoltage);
  2555. EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterySoc);
  2556. PilotVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PilotVoltage);
  2557. SystemStatus[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].SystemStatus);
  2558. EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
  2559. StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
  2560. StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
  2561. StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
  2562. StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartMethod);
  2563. ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].ConnectorTemp);
  2564. ChillerTemp[2] = json_object_new_int(255);
  2565. PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].PowerConsumption);
  2566. if(strcmp(IsDO, "AX") == 0){
  2567. isCalibratedVaGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaGain);
  2568. isCalibratedVbGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbGain);
  2569. isCalibratedVcGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcGain);
  2570. isCalibratedVaOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVaOffset);
  2571. isCalibratedVbOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVbOffset);
  2572. isCalibratedVcOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedVcOffset);
  2573. isCalibratedCaGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaGain);
  2574. isCalibratedCbGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbGain);
  2575. isCalibratedCcGain[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcGain);
  2576. isCalibratedCaOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCaOffset);
  2577. isCalibratedCbOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCbOffset);
  2578. isCalibratedCcOffset[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedCcOffset);
  2579. isCalibratedPa[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPa);
  2580. isCalibratedPb[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPb);
  2581. isCalibratedPc[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].meterIcCalInfo.isCalibratedPc);
  2582. }
  2583. AcGunQty++;
  2584. }
  2585. }
  2586. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  2587. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
  2588. int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
  2589. for(int i=0;i<DDTotalConnectorQuantity;i++){
  2590. DDPresentChargingVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingVoltage);
  2591. DDPresentChargingCurrent[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingCurrent);
  2592. DDPresentChargingPower[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargingPower);
  2593. DDPresentChargedEnergy[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargedEnergy);
  2594. DDPresentChargedDuration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PresentChargedDuration);
  2595. DDRemainChargingDuration[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.RemainChargingDuration);
  2596. DDEvBatteryMaxVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatteryMaxVoltage);
  2597. DDEvBatterytargetVoltage[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterytargetVoltage);
  2598. DDEvBatterySoc[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterySoc);
  2599. DDSystemStatus[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.SystemStatus);
  2600. DDEvBatterytargetCurrent[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.EvBatterytargetCurrent);
  2601. DDStartUserId[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartUserId);
  2602. DDStartDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartDateTime);
  2603. DDStopDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StopDateTime);
  2604. DDStartMethod[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartMethod);
  2605. if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 255){
  2606. DDConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp);
  2607. }
  2608. else{
  2609. DDConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp-60);
  2610. }
  2611. if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 255){
  2612. DDChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp);
  2613. }
  2614. else{
  2615. DDChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp-60);
  2616. }
  2617. DDPowerConsumption[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PowerConsumption);
  2618. }
  2619. }
  2620. //network
  2621. InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
  2622. FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
  2623. Eth0DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient);
  2624. Eth0MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
  2625. Eth0IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
  2626. Eth0SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
  2627. Eth0GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
  2628. Eth1DhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient);
  2629. Eth1MacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
  2630. Eth1IpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
  2631. Eth1SubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
  2632. Eth1GatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
  2633. WifiMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
  2634. WifiSsid = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
  2635. WifiPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
  2636. WifiBroadcastSsid = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid);
  2637. WifiTargetBssidMac = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac);
  2638. WifiRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
  2639. WifiDhcpServer = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer);
  2640. WifiDhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient);
  2641. WifiMacAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
  2642. WifiIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
  2643. WifiSubmaskAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
  2644. WifiGatewayAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
  2645. WifiNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn);
  2646. TelcomApn = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
  2647. TelcomRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
  2648. TelcomChapPapId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
  2649. TelcomChapPapPwd = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
  2650. TelcomModemImei = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
  2651. TelcomSimImsi = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
  2652. TelcomSimIccid = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid);
  2653. TelcomSimStatus = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus);
  2654. TelcomModemMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode);
  2655. TelcomIpAddress = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
  2656. TelcomNetworkConn = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn);
  2657. TelcomEnabled = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled);
  2658. TelcomNetworkType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkType);
  2659. isEnalbleFirewall = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnalbleFirewall);
  2660. FirewallAcceptAddr[0] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[0]);
  2661. FirewallAcceptAddr[1] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[1]);
  2662. FirewallAcceptAddr[2] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[2]);
  2663. FirewallAcceptAddr[3] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[3]);
  2664. FirewallAcceptAddr[4] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[4]);
  2665. FirewallAcceptAddr[5] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[5]);
  2666. FirewallAcceptAddr[6] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[6]);
  2667. FirewallAcceptAddr[7] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[7]);
  2668. FirewallAcceptAddr[8] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[8]);
  2669. FirewallAcceptAddr[9] = json_object_new_string((char*)&ShmSysConfigAndInfo->SysConfig.FirewallAcceptAddr[9]);
  2670. //backend
  2671. BackendConnTimeout = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
  2672. OfflinePolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
  2673. OfflineMaxChargeEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
  2674. OfflineMaxChargeDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
  2675. OcppConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.OcppConnStatus);
  2676. MaintainServerConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus);
  2677. OcppServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL);
  2678. ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
  2679. OcppSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile);
  2680. OcppSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword);
  2681. MaintainServerSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile);
  2682. MaintainServerSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword);
  2683. chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
  2684. MaintainServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
  2685. FILE *file;
  2686. char line[0];
  2687. ChargePointPrivateKey = json_object_new_string("");
  2688. file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
  2689. if (NULL != file)
  2690. {
  2691. int i=0;
  2692. while (fgets(line, 65, file) != NULL)
  2693. {
  2694. if(i==0){
  2695. ChargePointPrivateKey = json_object_new_string(line);
  2696. }
  2697. i++;
  2698. }
  2699. }
  2700. pclose(file);
  2701. ChargePointCertificate = json_object_new_string("");
  2702. file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
  2703. if (NULL != file)
  2704. {
  2705. int i=0;
  2706. while (fgets(line, 65, file) != NULL)
  2707. {
  2708. if(i==0){
  2709. ChargePointCertificate = json_object_new_string(line);
  2710. }
  2711. i++;
  2712. }
  2713. }
  2714. pclose(file);
  2715. V2GPrivateKey = json_object_new_string("");
  2716. file = popen("sha256sum /Storage/certV2G.key", "r");
  2717. if (NULL != file)
  2718. {
  2719. int i=0;
  2720. while (fgets(line, 65, file) != NULL)
  2721. {
  2722. if(i==0){
  2723. V2GPrivateKey = json_object_new_string(line);
  2724. }
  2725. i++;
  2726. }
  2727. }
  2728. pclose(file);
  2729. V2GRootCertificate = json_object_new_string("");
  2730. file = popen("sha256sum /Storage/rootCaV2g.pem", "r");
  2731. if (NULL != file)
  2732. {
  2733. int i=0;
  2734. while (fgets(line, 65, file) != NULL)
  2735. {
  2736. if(i==0){
  2737. V2GRootCertificate = json_object_new_string(line);
  2738. }
  2739. i++;
  2740. }
  2741. }
  2742. pclose(file);
  2743. V2GCertificateChain = json_object_new_string("");
  2744. file = popen("sha256sum /Storage/certV2g.pem", "r");
  2745. if (NULL != file)
  2746. {
  2747. int i=0;
  2748. while (fgets(line, 65, file) != NULL)
  2749. {
  2750. if(i==0){
  2751. V2GCertificateChain = json_object_new_string(line);
  2752. }
  2753. i++;
  2754. }
  2755. }
  2756. pclose(file);
  2757. MORootCertificate = json_object_new_string("");
  2758. file = popen("sha256sum /Storage/rootCaMo.pem", "r");
  2759. if (NULL != file)
  2760. {
  2761. int i=0;
  2762. while (fgets(line, 65, file) != NULL)
  2763. {
  2764. if(i==0){
  2765. MORootCertificate = json_object_new_string(line);
  2766. }
  2767. i++;
  2768. }
  2769. }
  2770. pclose(file);
  2771. CSRootCertificate = json_object_new_string("");
  2772. file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
  2773. if (NULL != file)
  2774. {
  2775. int i=0;
  2776. while (fgets(line, 65, file) != NULL)
  2777. {
  2778. if(i==0){
  2779. CSRootCertificate = json_object_new_string(line);
  2780. }
  2781. i++;
  2782. }
  2783. }
  2784. pclose(file);
  2785. ManufacturerRootCertificate = json_object_new_string("");
  2786. file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
  2787. if (NULL != file)
  2788. {
  2789. int i=0;
  2790. while (fgets(line, 65, file) != NULL)
  2791. {
  2792. if(i==0){
  2793. ManufacturerRootCertificate = json_object_new_string(line);
  2794. }
  2795. i++;
  2796. }
  2797. }
  2798. pclose(file);
  2799. if(strcmp(IsDO, "AX") == 0 || strcmp(IsDO, "AW") == 0 || strcmp(IsAcDc, "D") == 0){
  2800. isEnableLocalPowerSharging = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing);
  2801. PowerSharingCapacity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PowerSharingCapacityPower);
  2802. PowerSharingServerIP = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP);
  2803. OcppReceiptrURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL);
  2804. }
  2805. /*for TTIA*/
  2806. if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){
  2807. isEnableTTIA = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.isEnableTTIA);
  2808. server_addr = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr);
  2809. server_port = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port);
  2810. busVenderId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.busVenderId);
  2811. EquipmentProvider = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.EquipmentProvider);
  2812. TransportationCompanyNo = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.TransportationCompanyNo);
  2813. TTIAChargeBoxId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId);
  2814. evseStation = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation);
  2815. }
  2816. //system
  2817. json_object_object_add(jobj1,"ModelName",ModelName);
  2818. json_object_object_add(jobj1,"AcModelName",AcModelName);
  2819. json_object_object_add(jobj1,"SerialNumber",SerialNumber);
  2820. json_object_object_add(jobj1,"SystemId",SystemId);
  2821. json_object_object_add(jobj1,"AcPhaseCount",AcPhaseCount);
  2822. json_object_object_add(jobj1,"PhaseLossPolicy",PhaseLossPolicy);
  2823. json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
  2824. json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
  2825. json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
  2826. json_object_object_add(jobj1,"InputVoltageR",InputVoltageR);
  2827. json_object_object_add(jobj1,"InputVoltageS",InputVoltageS);
  2828. json_object_object_add(jobj1,"InputVoltageT",InputVoltageT);
  2829. json_object_object_add(jobj1,"InputVoltageDc",InputVoltageDc);
  2830. json_object_object_add(jobj1,"SystemFanRotaSpeed",SystemFanRotaSpeed);
  2831. json_object_object_add(jobj1,"PsuFanRotaSpeed",PsuFanRotaSpeed);
  2832. json_object_object_add(jobj1,"RfidCardNumEndian",RfidCardNumEndian);
  2833. json_object_object_add(jobj1,"PsuAcInputType",PsuAcInputType);
  2834. json_object_object_add(jobj1,"RatingCurrent",RatingCurrent);
  2835. json_object_object_add(jobj1,"AcRatingCurrent",AcRatingCurrent);
  2836. json_object_object_add(jobj1,"isAPP",isAPP);
  2837. json_object_object_add(jobj1,"isQRCode",isQRCode);
  2838. json_object_object_add(jobj1,"isRFID",isRFID);
  2839. json_object_object_add(jobj1,"QRCodeMadeMode",QRCodeMadeMode);
  2840. json_object_object_add(jobj1,"QRCodeContent",QRCodeContent);
  2841. json_object_object_add(jobj1,"Intensity",Intensity);
  2842. json_object_object_add(jobj1,"isAuthrizeByEVCCID",isAuthrizeByEVCCID);
  2843. json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
  2844. json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
  2845. json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
  2846. json_object_object_add(jobj1,"AuxPower48V",AuxPower48V);
  2847. json_object_object_add(jobj1,"CsuHwRev",CsuHwRev);
  2848. json_object_object_add(jobj1,"CsuBootLoadFwRev",CsuBootLoadFwRev);
  2849. json_object_object_add(jobj1,"CsuKernelFwRev",CsuKernelFwRev);
  2850. json_object_object_add(jobj1,"CsuRootFsFwRev",CsuRootFsFwRev);
  2851. json_object_object_add(jobj1,"CsuPrimFwRev",CsuPrimFwRev);
  2852. json_object_object_add(jobj1,"LcmHwRev",LcmHwRev);
  2853. json_object_object_add(jobj1,"LcmFwRev",LcmFwRev);
  2854. json_object_object_add(jobj1,"PsuHwRev",PsuHwRev);
  2855. json_object_object_add(jobj1,"PsuPrimFwRev",PsuPrimFwRev);
  2856. json_object_object_add(jobj1,"PsuSecFwRev",PsuSecFwRev);
  2857. json_object_object_add(jobj1,"AuxPwrHwRev",AuxPwrHwRev);
  2858. json_object_object_add(jobj1,"AuxPwrFwRev",AuxPwrFwRev);
  2859. json_object_object_add(jobj1,"FanModuleHwRev",FanModuleHwRev);
  2860. json_object_object_add(jobj1,"FanModuleFwRev",FanModuleFwRev);
  2861. json_object_object_add(jobj1,"RelayModuleHwRev",RelayModuleHwRev);
  2862. json_object_object_add(jobj1,"RelayModuleFwRev",RelayModuleFwRev);
  2863. json_object_object_add(jobj1,"TelcomModemFwRev",TelcomModemFwRev);
  2864. json_object_object_add(jobj1,"Connector1FwRev",Connector1FwRev);
  2865. json_object_object_add(jobj1,"Connector2FwRev",Connector2FwRev);
  2866. json_object_object_add(jobj1,"PsuLostQuantity",PsuLostQuantity);
  2867. /* for DC+AC*/
  2868. if(connectorType3==4){
  2869. json_object_object_add(jobj1,"Connector3FwRev",Connector3FwRev);
  2870. }
  2871. json_object_object_add(jobj1,"LedModuleFwRev",LedModuleFwRev);
  2872. json_object_object_add(jobj1,"SystemAmbientTemp",SystemAmbientTemp);
  2873. json_object_object_add(jobj1,"SystemCriticalTemp",SystemCriticalTemp);
  2874. json_object_object_add(jobj1,"CcsConnectorTemp",CcsConnectorTemp);
  2875. json_object_object_add(jobj1,"PsuAmbientTemp",PsuAmbientTemp);
  2876. json_object_object_add(jobj1,"AcPlugInTimes",AcPlugInTimes);
  2877. json_object_object_add(jobj1,"GbPlugInTimes",GbPlugInTimes);
  2878. json_object_object_add(jobj1,"Ccs1PlugInTimes",Ccs1PlugInTime);
  2879. json_object_object_add(jobj1,"Ccs2PlugInTimes",Ccs2PlugInTimes);
  2880. json_object_object_add(jobj1,"ChademoPlugInTimes",ChademoPlugInTimes);
  2881. json_object_object_add(jobj1,"FirmwareUpdate",FirmwareUpdate);
  2882. if(strcmp(IsAcDc, "D") == 0){
  2883. json_object_object_add(jobj1,"FwPrimaryVersion",FwPrimaryVersionArr);
  2884. json_object_object_add(jobj1,"FwSecondVersion",FwSecondVersionArr);
  2885. }
  2886. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0|| strcmp(IsDO, "DB") == 0|| strcmp(IsDO, "DL") == 0){
  2887. json_object_object_add(jobj1,"DispenserQuantity",DispenserQuantity);
  2888. json_object_object_add(jobj1,"TotalConnectorQuantity",TotalConnectorQuantity);
  2889. json_object_object_add(jobj1,"DDLocalStatus",DDLocalStatusArr);
  2890. json_object_object_add(jobj1,"DDModelName",DDModelNameArr);
  2891. json_object_object_add(jobj1,"DDSerialNumber",DDSerialNumberArr);
  2892. json_object_object_add(jobj1,"DDSystemId",DDSystemIdArr);
  2893. json_object_object_add(jobj1,"DDAuthorisationMode",DDAuthorisationModeArr);
  2894. json_object_object_add(jobj1,"DDRfidCardNumEndian",DDRfidCardNumEndianArr);
  2895. json_object_object_add(jobj1,"DDisAPP",DDisAPPArr);
  2896. json_object_object_add(jobj1,"DDisQRCode",DDisQRCodeArr);
  2897. json_object_object_add(jobj1,"DDisRFID",DDisRFIDArr);
  2898. json_object_object_add(jobj1,"DDQRCodeMadeMode",DDQRCodeMadeModeArr);
  2899. json_object_object_add(jobj1,"DDQRCodeContent",DDQRCodeContentArr);
  2900. json_object_object_add(jobj1,"DDFactoryConfiguration",DDFactoryConfigurationArr);
  2901. json_object_object_add(jobj1,"DDCsuBootLoadFwRev",DDCsuBootLoadFwRevArr);
  2902. json_object_object_add(jobj1,"DDCsuKernelFwRev",DDCsuKernelFwRevArr);
  2903. json_object_object_add(jobj1,"DDCsuRootFsFwRev",DDCsuRootFsFwRevArr);
  2904. json_object_object_add(jobj1,"DDCsuPrimFwRev",DDCsuPrimFwRevArr);
  2905. json_object_object_add(jobj1,"DDLcmFwRev",DDLcmFwRevArr);
  2906. json_object_object_add(jobj1,"DDPsuPrimFwRev",DDPsuPrimFwRevArr);
  2907. json_object_object_add(jobj1,"DDPsuSecFwRev",DDPsuSecFwRevArr);
  2908. json_object_object_add(jobj1,"DDFanModuleFwRev",DDFanModuleFwRevArr);
  2909. json_object_object_add(jobj1,"DDRelayModuleFwRev",DDRelayModuleFwRevArr);
  2910. json_object_object_add(jobj1,"DDTelcomModemFwRev",DDTelcomModemFwRevArr);
  2911. json_object_object_add(jobj1,"DDLedModuleFwRev",DDLedModuleFwRevArr);
  2912. json_object_object_add(jobj1,"DDConnector1FwRev",DDConnector1FwRevArr);
  2913. json_object_object_add(jobj1,"DDConnector2FwRev",DDConnector2FwRevArr);
  2914. json_object_object_add(jobj1,"DDIntensity",DDIntensityArr);
  2915. json_object_object_add(jobj1,"Relay2ModuleFwRev",Relay2ModuleFwRev);
  2916. }
  2917. printf("%s\n", json_object_to_json_string(jobj1));
  2918. json_object_put(jobj1);
  2919. //charging
  2920. json_object_object_add(jobj2,"MaxChargingEnergy",MaxChargingEnergy);
  2921. json_object_object_add(jobj2,"MaxChargingPower",MaxChargingPower);
  2922. json_object_object_add(jobj2,"MaxChargingCurrent",MaxChargingCurrent);
  2923. json_object_object_add(jobj2,"MaxChargingVoltage",MaxChargingVoltage);
  2924. json_object_object_add(jobj2,"AcMaxChargingCurrent",AcMaxChargingCurrent);
  2925. json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
  2926. json_object_object_add(jobj2,"MaxChargingSoc",MaxChargingSoc);
  2927. json_object_object_add(jobj2,"StopChargingByButton",StopChargingByButton);
  2928. json_object_object_add(jobj2,"FanControlPolicy",FanControlPolicy);
  2929. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
  2930. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
  2931. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);
  2932. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[3]);
  2933. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[4]);
  2934. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[5]);
  2935. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[6]);
  2936. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[7]);
  2937. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[8]);
  2938. json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[9]);
  2939. json_object_object_add(jobj2,"LocalWhiteCard",LocalWhiteCardArr);
  2940. json_object_object_add(jobj2,"isBilling",isBilling);
  2941. json_object_object_add(jobj2,"Currency",Currency);
  2942. json_object_array_add(FeeArr,Fee[0]);
  2943. json_object_array_add(FeeArr,Fee[1]);
  2944. json_object_array_add(FeeArr,Fee[2]);
  2945. json_object_array_add(FeeArr,Fee[3]);
  2946. json_object_array_add(FeeArr,Fee[4]);
  2947. json_object_array_add(FeeArr,Fee[5]);
  2948. json_object_array_add(FeeArr,Fee[6]);
  2949. json_object_array_add(FeeArr,Fee[7]);
  2950. json_object_array_add(FeeArr,Fee[8]);
  2951. json_object_array_add(FeeArr,Fee[9]);
  2952. json_object_array_add(FeeArr,Fee[10]);
  2953. json_object_array_add(FeeArr,Fee[11]);
  2954. json_object_array_add(FeeArr,Fee[12]);
  2955. json_object_array_add(FeeArr,Fee[13]);
  2956. json_object_array_add(FeeArr,Fee[14]);
  2957. json_object_array_add(FeeArr,Fee[15]);
  2958. json_object_array_add(FeeArr,Fee[16]);
  2959. json_object_array_add(FeeArr,Fee[17]);
  2960. json_object_array_add(FeeArr,Fee[18]);
  2961. json_object_array_add(FeeArr,Fee[19]);
  2962. json_object_array_add(FeeArr,Fee[20]);
  2963. json_object_array_add(FeeArr,Fee[21]);
  2964. json_object_array_add(FeeArr,Fee[22]);
  2965. json_object_array_add(FeeArr,Fee[23]);
  2966. json_object_object_add(jobj2,"Fee",FeeArr);
  2967. if(connectorType1 != 0){
  2968. json_object_object_add(ChargingInfo1,"StartUserId",StartUserId[0]);
  2969. json_object_object_add(ChargingInfo1,"StartDateTime",StartDateTime[0]);
  2970. json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
  2971. json_object_object_add(ChargingInfo1,"StartMethod",StartMethod[0]);
  2972. json_object_object_add(ChargingInfo1,"ConnectorTemp",ConnectorTemp[0]);
  2973. json_object_object_add(ChargingInfo1,"ChillerTemp",ChillerTemp[0]);
  2974. json_object_object_add(ChargingInfo1,"PresentChargingVoltage",PresentChargingVoltage[0]);
  2975. json_object_object_add(ChargingInfo1,"PresentChargingCurrent",PresentChargingCurrent[0]);
  2976. json_object_object_add(ChargingInfo1,"PresentChargingPower",PresentChargingPower[0]);
  2977. json_object_object_add(ChargingInfo1,"PresentChargedEnergy",PresentChargedEnergy[0]);
  2978. json_object_object_add(ChargingInfo1,"PresentChargedDuration",PresentChargedDuration[0]);
  2979. json_object_object_add(ChargingInfo1,"RemainChargingDuration",RemainChargingDuration[0]);
  2980. json_object_object_add(ChargingInfo1,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[0]);
  2981. json_object_object_add(ChargingInfo1,"EvBatterytargetVoltage",EvBatterytargetVoltage[0]);
  2982. json_object_object_add(ChargingInfo1,"EvBatterySoc",EvBatterySoc[0]);
  2983. json_object_object_add(ChargingInfo1,"PilotVoltage",PilotVoltage[0]);
  2984. json_object_object_add(ChargingInfo1,"SystemStatus",SystemStatus[0]);
  2985. json_object_object_add(ChargingInfo1,"EvBatterytargetCurrent",EvBatterytargetCurrent[0]);
  2986. json_object_object_add(ChargingInfo1,"PowerConsumption",PowerConsumption[0]);
  2987. if(strcmp(IsDO, "AX") == 0){
  2988. json_object_object_add(ChargingInfo1,"isCalibratedVaGain",isCalibratedVaGain[0]);
  2989. json_object_object_add(ChargingInfo1,"isCalibratedVbGain",isCalibratedVbGain[0]);
  2990. json_object_object_add(ChargingInfo1,"isCalibratedVcGain",isCalibratedVcGain[0]);
  2991. json_object_object_add(ChargingInfo1,"isCalibratedVaOffset",isCalibratedVaOffset[0]);
  2992. json_object_object_add(ChargingInfo1,"isCalibratedVbOffset",isCalibratedVbOffset[0]);
  2993. json_object_object_add(ChargingInfo1,"isCalibratedVcOffset",isCalibratedVcOffset[0]);
  2994. json_object_object_add(ChargingInfo1,"isCalibratedCaGain",isCalibratedCaGain[0]);
  2995. json_object_object_add(ChargingInfo1,"isCalibratedCbGain",isCalibratedCbGain[0]);
  2996. json_object_object_add(ChargingInfo1,"isCalibratedCcGain",isCalibratedCcGain[0]);
  2997. json_object_object_add(ChargingInfo1,"isCalibratedCaOffset",isCalibratedCaOffset[0]);
  2998. json_object_object_add(ChargingInfo1,"isCalibratedCbOffset",isCalibratedCbOffset[0]);
  2999. json_object_object_add(ChargingInfo1,"isCalibratedCcOffset",isCalibratedCcOffset[0]);
  3000. json_object_object_add(ChargingInfo1,"isCalibratedPa",isCalibratedPa[0]);
  3001. json_object_object_add(ChargingInfo1,"isCalibratedPb",isCalibratedPb[0]);
  3002. json_object_object_add(ChargingInfo1,"isCalibratedPc",isCalibratedPc[0]);
  3003. }
  3004. json_object_object_add(jobj2,"ChargingInfo1",ChargingInfo1);
  3005. }
  3006. if(connectorType2 != 0){
  3007. json_object_object_add(ChargingInfo2,"StartUserId",StartUserId[1]);
  3008. json_object_object_add(ChargingInfo2,"StartDateTime",StartDateTime[1]);
  3009. json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
  3010. json_object_object_add(ChargingInfo2,"StartMethod",StartMethod[1]);
  3011. json_object_object_add(ChargingInfo2,"ConnectorTemp",ConnectorTemp[1]);
  3012. json_object_object_add(ChargingInfo2,"ChillerTemp",ChillerTemp[1]);
  3013. json_object_object_add(ChargingInfo2,"PresentChargingVoltage",PresentChargingVoltage[1]);
  3014. json_object_object_add(ChargingInfo2,"PresentChargingCurrent",PresentChargingCurrent[1]);
  3015. json_object_object_add(ChargingInfo2,"PresentChargingPower",PresentChargingPower[1]);
  3016. json_object_object_add(ChargingInfo2,"PresentChargedEnergy",PresentChargedEnergy[1]);
  3017. json_object_object_add(ChargingInfo2,"PresentChargedDuration",PresentChargedDuration[1]);
  3018. json_object_object_add(ChargingInfo2,"RemainChargingDuration",RemainChargingDuration[1]);
  3019. json_object_object_add(ChargingInfo2,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[1]);
  3020. json_object_object_add(ChargingInfo2,"EvBatterytargetVoltage",EvBatterytargetVoltage[1]);
  3021. json_object_object_add(ChargingInfo2,"EvBatterySoc",EvBatterySoc[1]);
  3022. json_object_object_add(ChargingInfo2,"PilotVoltage",PilotVoltage[1]);
  3023. json_object_object_add(ChargingInfo2,"SystemStatus",SystemStatus[1]);
  3024. json_object_object_add(ChargingInfo2,"EvBatterytargetCurrent",EvBatterytargetCurrent[1]);
  3025. json_object_object_add(ChargingInfo2,"PowerConsumption",PowerConsumption[1]);
  3026. if(strcmp(IsDO, "AX") == 0){
  3027. json_object_object_add(ChargingInfo2,"isCalibratedVaGain",isCalibratedVaGain[1]);
  3028. json_object_object_add(ChargingInfo2,"isCalibratedVbGain",isCalibratedVbGain[1]);
  3029. json_object_object_add(ChargingInfo2,"isCalibratedVcGain",isCalibratedVcGain[1]);
  3030. json_object_object_add(ChargingInfo2,"isCalibratedVaOffset",isCalibratedVaOffset[1]);
  3031. json_object_object_add(ChargingInfo2,"isCalibratedVbOffset",isCalibratedVbOffset[1]);
  3032. json_object_object_add(ChargingInfo2,"isCalibratedVcOffset",isCalibratedVcOffset[1]);
  3033. json_object_object_add(ChargingInfo2,"isCalibratedCaGain",isCalibratedCaGain[1]);
  3034. json_object_object_add(ChargingInfo2,"isCalibratedCbGain",isCalibratedCbGain[1]);
  3035. json_object_object_add(ChargingInfo2,"isCalibratedCcGain",isCalibratedCcGain[1]);
  3036. json_object_object_add(ChargingInfo2,"isCalibratedCaOffset",isCalibratedCaOffset[1]);
  3037. json_object_object_add(ChargingInfo2,"isCalibratedCbOffset",isCalibratedCbOffset[1]);
  3038. json_object_object_add(ChargingInfo2,"isCalibratedCcOffset",isCalibratedCcOffset[1]);
  3039. json_object_object_add(ChargingInfo2,"isCalibratedPa",isCalibratedPa[1]);
  3040. json_object_object_add(ChargingInfo2,"isCalibratedPb",isCalibratedPb[1]);
  3041. json_object_object_add(ChargingInfo2,"isCalibratedPc",isCalibratedPc[1]);
  3042. }
  3043. json_object_object_add(jobj2,"ChargingInfo2",ChargingInfo2);
  3044. }
  3045. if(connectorType3 != 0){
  3046. json_object_object_add(ChargingInfo3,"StartUserId",StartUserId[2]);
  3047. json_object_object_add(ChargingInfo3,"StartDateTime",StartDateTime[2]);
  3048. json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);
  3049. json_object_object_add(ChargingInfo3,"StartMethod",StartMethod[2]);
  3050. json_object_object_add(ChargingInfo3,"ConnectorTemp",ConnectorTemp[2]);
  3051. json_object_object_add(ChargingInfo3,"ChillerTemp",ChillerTemp[2]);
  3052. json_object_object_add(ChargingInfo3,"PresentChargingVoltage",PresentChargingVoltage[2]);
  3053. json_object_object_add(ChargingInfo3,"PresentChargingCurrent",PresentChargingCurrent[2]);
  3054. json_object_object_add(ChargingInfo3,"PresentChargingPower",PresentChargingPower[2]);
  3055. json_object_object_add(ChargingInfo3,"PresentChargedEnergy",PresentChargedEnergy[2]);
  3056. json_object_object_add(ChargingInfo3,"PresentChargedDuration",PresentChargedDuration[2]);
  3057. json_object_object_add(ChargingInfo3,"RemainChargingDuration",RemainChargingDuration[2]);
  3058. json_object_object_add(ChargingInfo3,"EvBatteryMaxVoltage",EvBatteryMaxVoltage[2]);
  3059. json_object_object_add(ChargingInfo3,"EvBatterytargetVoltage",EvBatterytargetVoltage[2]);
  3060. json_object_object_add(ChargingInfo3,"EvBatterySoc",EvBatterySoc[2]);
  3061. json_object_object_add(ChargingInfo3,"PilotVoltage",PilotVoltage[2]);
  3062. json_object_object_add(ChargingInfo3,"SystemStatus",SystemStatus[2]);
  3063. json_object_object_add(ChargingInfo3,"EvBatterytargetCurrent",EvBatterytargetCurrent[2]);
  3064. json_object_object_add(ChargingInfo3,"PowerConsumption",PowerConsumption[2]);
  3065. if(strcmp(IsDO, "AX") == 0){
  3066. json_object_object_add(ChargingInfo3,"isCalibratedVaGain",isCalibratedVaGain[2]);
  3067. json_object_object_add(ChargingInfo3,"isCalibratedVbGain",isCalibratedVbGain[2]);
  3068. json_object_object_add(ChargingInfo3,"isCalibratedVcGain",isCalibratedVcGain[2]);
  3069. json_object_object_add(ChargingInfo3,"isCalibratedVaOffset",isCalibratedVaOffset[2]);
  3070. json_object_object_add(ChargingInfo3,"isCalibratedVbOffset",isCalibratedVbOffset[2]);
  3071. json_object_object_add(ChargingInfo3,"isCalibratedVcOffset",isCalibratedVcOffset[2]);
  3072. json_object_object_add(ChargingInfo3,"isCalibratedCaGain",isCalibratedCaGain[2]);
  3073. json_object_object_add(ChargingInfo3,"isCalibratedCbGain",isCalibratedCbGain[2]);
  3074. json_object_object_add(ChargingInfo3,"isCalibratedCcGain",isCalibratedCcGain[2]);
  3075. json_object_object_add(ChargingInfo3,"isCalibratedCaOffset",isCalibratedCaOffset[2]);
  3076. json_object_object_add(ChargingInfo3,"isCalibratedCbOffset",isCalibratedCbOffset[2]);
  3077. json_object_object_add(ChargingInfo3,"isCalibratedCcOffset",isCalibratedCcOffset[2]);
  3078. json_object_object_add(ChargingInfo3,"isCalibratedPa",isCalibratedPa[2]);
  3079. json_object_object_add(ChargingInfo3,"isCalibratedPb",isCalibratedPb[2]);
  3080. json_object_object_add(ChargingInfo3,"isCalibratedPc",isCalibratedPc[2]);
  3081. }
  3082. json_object_object_add(jobj2,"ChargingInfo3",ChargingInfo3);
  3083. }
  3084. if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0 || strcmp(IsDO, "DL") == 0){
  3085. if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4|| ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
  3086. int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
  3087. DDChargingInfo1=json_object_new_object();
  3088. DDChargingInfo2=json_object_new_object();
  3089. DDChargingInfo3=json_object_new_object();
  3090. DDChargingInfo4=json_object_new_object();
  3091. if(DDTotalConnectorQuantity>0){
  3092. json_object_object_add(DDChargingInfo1,"StartUserId",DDStartUserId[0]);
  3093. json_object_object_add(DDChargingInfo1,"StartDateTime",DDStartDateTime[0]);
  3094. json_object_object_add(DDChargingInfo1,"StopDateTime",DDStopDateTime[0]);
  3095. json_object_object_add(DDChargingInfo1,"StartMethod",DDStartMethod[0]);
  3096. json_object_object_add(DDChargingInfo1,"ConnectorTemp",DDConnectorTemp[0]);
  3097. json_object_object_add(DDChargingInfo1,"ChillerTemp",DDChillerTemp[0]);
  3098. json_object_object_add(DDChargingInfo1,"PresentChargingVoltage",DDPresentChargingVoltage[0]);
  3099. json_object_object_add(DDChargingInfo1,"PresentChargingCurrent",DDPresentChargingCurrent[0]);
  3100. json_object_object_add(DDChargingInfo1,"PresentChargingPower",DDPresentChargingPower[0]);
  3101. json_object_object_add(DDChargingInfo1,"PresentChargedEnergy",DDPresentChargedEnergy[0]);
  3102. json_object_object_add(DDChargingInfo1,"PresentChargedDuration",DDPresentChargedDuration[0]);
  3103. json_object_object_add(DDChargingInfo1,"RemainChargingDuration",DDRemainChargingDuration[0]);
  3104. json_object_object_add(DDChargingInfo1,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[0]);
  3105. json_object_object_add(DDChargingInfo1,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[0]);
  3106. json_object_object_add(DDChargingInfo1,"EvBatterySoc",DDEvBatterySoc[0]);
  3107. json_object_object_add(DDChargingInfo1,"SystemStatus",DDSystemStatus[0]);
  3108. json_object_object_add(DDChargingInfo1,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[0]);
  3109. json_object_object_add(DDChargingInfo1,"PowerConsumption",DDPowerConsumption[0]);
  3110. json_object_object_add(jobj2,"DDChargingInfo1",DDChargingInfo1);
  3111. }
  3112. if(DDTotalConnectorQuantity>1){
  3113. json_object_object_add(DDChargingInfo2,"StartUserId",DDStartUserId[1]);
  3114. json_object_object_add(DDChargingInfo2,"StartDateTime",DDStartDateTime[1]);
  3115. json_object_object_add(DDChargingInfo2,"StopDateTime",DDStopDateTime[1]);
  3116. json_object_object_add(DDChargingInfo2,"StartMethod",DDStartMethod[1]);
  3117. json_object_object_add(DDChargingInfo2,"ConnectorTemp",DDConnectorTemp[1]);
  3118. json_object_object_add(DDChargingInfo2,"ChillerTemp",DDChillerTemp[1]);
  3119. json_object_object_add(DDChargingInfo2,"PresentChargingVoltage",DDPresentChargingVoltage[1]);
  3120. json_object_object_add(DDChargingInfo2,"PresentChargingCurrent",DDPresentChargingCurrent[1]);
  3121. json_object_object_add(DDChargingInfo2,"PresentChargingPower",DDPresentChargingPower[1]);
  3122. json_object_object_add(DDChargingInfo2,"PresentChargedEnergy",DDPresentChargedEnergy[1]);
  3123. json_object_object_add(DDChargingInfo2,"PresentChargedDuration",DDPresentChargedDuration[1]);
  3124. json_object_object_add(DDChargingInfo2,"RemainChargingDuration",DDRemainChargingDuration[1]);
  3125. json_object_object_add(DDChargingInfo2,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[1]);
  3126. json_object_object_add(DDChargingInfo2,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[1]);
  3127. json_object_object_add(DDChargingInfo2,"EvBatterySoc",DDEvBatterySoc[1]);
  3128. json_object_object_add(DDChargingInfo2,"SystemStatus",DDSystemStatus[1]);
  3129. json_object_object_add(DDChargingInfo2,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[1]);
  3130. json_object_object_add(DDChargingInfo2,"PowerConsumption",DDPowerConsumption[1]);
  3131. json_object_object_add(jobj2,"DDChargingInfo2",DDChargingInfo2);
  3132. }
  3133. if(DDTotalConnectorQuantity>2){
  3134. json_object_object_add(DDChargingInfo3,"StartUserId",DDStartUserId[2]);
  3135. json_object_object_add(DDChargingInfo3,"StartDateTime",DDStartDateTime[2]);
  3136. json_object_object_add(DDChargingInfo3,"StopDateTime",DDStopDateTime[2]);
  3137. json_object_object_add(DDChargingInfo3,"StartMethod",DDStartMethod[2]);
  3138. json_object_object_add(DDChargingInfo3,"ConnectorTemp",DDConnectorTemp[2]);
  3139. json_object_object_add(DDChargingInfo3,"ChillerTemp",DDChillerTemp[2]);
  3140. json_object_object_add(DDChargingInfo3,"PresentChargingVoltage",DDPresentChargingVoltage[2]);
  3141. json_object_object_add(DDChargingInfo3,"PresentChargingCurrent",DDPresentChargingCurrent[2]);
  3142. json_object_object_add(DDChargingInfo3,"PresentChargingPower",DDPresentChargingPower[2]);
  3143. json_object_object_add(DDChargingInfo3,"PresentChargedEnergy",DDPresentChargedEnergy[2]);
  3144. json_object_object_add(DDChargingInfo3,"PresentChargedDuration",DDPresentChargedDuration[2]);
  3145. json_object_object_add(DDChargingInfo3,"RemainChargingDuration",DDRemainChargingDuration[2]);
  3146. json_object_object_add(DDChargingInfo3,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[2]);
  3147. json_object_object_add(DDChargingInfo3,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[2]);
  3148. json_object_object_add(DDChargingInfo3,"EvBatterySoc",DDEvBatterySoc[2]);
  3149. json_object_object_add(DDChargingInfo3,"SystemStatus",DDSystemStatus[2]);
  3150. json_object_object_add(DDChargingInfo3,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[2]);
  3151. json_object_object_add(DDChargingInfo3,"PowerConsumption",DDPowerConsumption[2]);
  3152. json_object_object_add(jobj2,"DDChargingInfo3",DDChargingInfo3);
  3153. }
  3154. if(DDTotalConnectorQuantity>3){
  3155. json_object_object_add(DDChargingInfo4,"StartUserId",DDStartUserId[3]);
  3156. json_object_object_add(DDChargingInfo4,"StartDateTime",DDStartDateTime[3]);
  3157. json_object_object_add(DDChargingInfo4,"StopDateTime",DDStopDateTime[3]);
  3158. json_object_object_add(DDChargingInfo4,"StartMethod",DDStartMethod[3]);
  3159. json_object_object_add(DDChargingInfo4,"ConnectorTemp",DDConnectorTemp[3]);
  3160. json_object_object_add(DDChargingInfo4,"ChillerTemp",DDChillerTemp[3]);
  3161. json_object_object_add(DDChargingInfo4,"PresentChargingVoltage",DDPresentChargingVoltage[3]);
  3162. json_object_object_add(DDChargingInfo4,"PresentChargingCurrent",DDPresentChargingCurrent[3]);
  3163. json_object_object_add(DDChargingInfo4,"PresentChargingPower",DDPresentChargingPower[3]);
  3164. json_object_object_add(DDChargingInfo4,"PresentChargedEnergy",DDPresentChargedEnergy[3]);
  3165. json_object_object_add(DDChargingInfo4,"PresentChargedDuration",DDPresentChargedDuration[3]);
  3166. json_object_object_add(DDChargingInfo4,"RemainChargingDuration",DDRemainChargingDuration[3]);
  3167. json_object_object_add(DDChargingInfo4,"EvBatteryMaxVoltage",DDEvBatteryMaxVoltage[3]);
  3168. json_object_object_add(DDChargingInfo4,"EvBatterytargetVoltage",DDEvBatterytargetVoltage[3]);
  3169. json_object_object_add(DDChargingInfo4,"EvBatterySoc",DDEvBatterySoc[3]);
  3170. json_object_object_add(DDChargingInfo4,"SystemStatus",DDSystemStatus[3]);
  3171. json_object_object_add(DDChargingInfo4,"EvBatterytargetCurrent",DDEvBatterytargetCurrent[3]);
  3172. json_object_object_add(DDChargingInfo4,"PowerConsumption",DDPowerConsumption[3]);
  3173. json_object_object_add(jobj2,"DDChargingInfo4",DDChargingInfo4);
  3174. }
  3175. }
  3176. printf("%s\n", json_object_to_json_string(jobj2));
  3177. json_object_put(jobj2);
  3178. //network
  3179. json_object_object_add(jobj3,"InternetConn",InternetConn);
  3180. json_object_object_add(jobj3,"FtpServer",FtpServer);
  3181. json_object_object_add(jobj3,"Eth0DhcpClient",Eth0DhcpClient);
  3182. json_object_object_add(jobj3,"Eth0MacAddress",Eth0MacAddress);
  3183. json_object_object_add(jobj3,"Eth0IpAddress",Eth0IpAddress);
  3184. json_object_object_add(jobj3,"Eth0SubmaskAddress",Eth0SubmaskAddress);
  3185. json_object_object_add(jobj3,"Eth0GatewayAddress",Eth0GatewayAddress);
  3186. json_object_object_add(jobj3,"Eth1DhcpClient",Eth1DhcpClient);
  3187. json_object_object_add(jobj3,"Eth1MacAddress",Eth1MacAddress);
  3188. json_object_object_add(jobj3,"Eth1IpAddress",Eth1IpAddress);
  3189. json_object_object_add(jobj3,"Eth1SubmaskAddress",Eth1SubmaskAddress);
  3190. json_object_object_add(jobj3,"Eth1GatewayAddress",Eth1GatewayAddress);
  3191. json_object_object_add(jobj3,"WifiMode",WifiMode);
  3192. json_object_object_add(jobj3,"WifiSsid",WifiSsid);
  3193. json_object_object_add(jobj3,"WifiPassword",WifiPassword);
  3194. json_object_object_add(jobj3,"WifiBroadcastSsid",WifiBroadcastSsid);
  3195. json_object_object_add(jobj3,"WifiTargetBssidMac",WifiTargetBssidMac);
  3196. json_object_object_add(jobj3,"WifiRssi",WifiRssi);
  3197. json_object_object_add(jobj3,"WifiDhcpServer",WifiDhcpServer);
  3198. json_object_object_add(jobj3,"WifiDhcpClient",WifiDhcpClient);
  3199. json_object_object_add(jobj3,"WifiMacAddress",WifiMacAddress);
  3200. json_object_object_add(jobj3,"WifiIpAddress",WifiIpAddress);
  3201. json_object_object_add(jobj3,"WifiSubmaskAddress",WifiSubmaskAddress);
  3202. json_object_object_add(jobj3,"WifiGatewayAddress",WifiGatewayAddress);
  3203. json_object_object_add(jobj3,"WifiNetworkConn",WifiNetworkConn);
  3204. json_object_object_add(jobj3,"TelcomApn",TelcomApn);
  3205. json_object_object_add(jobj3,"TelcomRssi",TelcomRssi);
  3206. json_object_object_add(jobj3,"TelcomChapPapId",TelcomChapPapId);
  3207. json_object_object_add(jobj3,"TelcomChapPapPwd",TelcomChapPapPwd);
  3208. json_object_object_add(jobj3,"TelcomModemImei",TelcomModemImei);
  3209. json_object_object_add(jobj3,"TelcomSimImsi",TelcomSimImsi);
  3210. json_object_object_add(jobj3,"TelcomSimIccid",TelcomSimIccid);
  3211. json_object_object_add(jobj3,"TelcomSimStatus",TelcomSimStatus);
  3212. json_object_object_add(jobj3,"TelcomModemMode",TelcomModemMode);
  3213. json_object_object_add(jobj3,"TelcomIpAddress",TelcomIpAddress);
  3214. json_object_object_add(jobj3,"TelcomNetworkConn",TelcomNetworkConn);
  3215. json_object_object_add(jobj3,"TelcomEnabled",TelcomEnabled);
  3216. json_object_object_add(jobj3,"TelcomNetworkType",TelcomNetworkType);
  3217. json_object_object_add(jobj3,"isEnalbleFirewall",isEnalbleFirewall);
  3218. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[0]);
  3219. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[1]);
  3220. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[2]);
  3221. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[3]);
  3222. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[4]);
  3223. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[5]);
  3224. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[6]);
  3225. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[7]);
  3226. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[8]);
  3227. json_object_array_add(FirewallAcceptAddrArr,FirewallAcceptAddr[9]);
  3228. json_object_object_add(jobj3,"FirewallAcceptAddr",FirewallAcceptAddrArr);
  3229. printf("%s\n", json_object_to_json_string(jobj3));
  3230. json_object_put(jobj3);
  3231. //backend
  3232. json_object_object_add(jobj4,"BackendConnTimeout",BackendConnTimeout);
  3233. json_object_object_add(jobj4,"OfflinePolicy",OfflinePolicy);
  3234. json_object_object_add(jobj4,"OfflineMaxChargeEnergy",OfflineMaxChargeEnergy);
  3235. json_object_object_add(jobj4,"OfflineMaxChargeDuration",OfflineMaxChargeDuration);
  3236. json_object_object_add(jobj4,"OcppConnStatus",OcppConnStatus);
  3237. json_object_object_add(jobj4,"MaintainServerConnStatus",MaintainServerConnStatus);
  3238. json_object_object_add(jobj4,"OcppServerURL",OcppServerURL);
  3239. json_object_object_add(jobj4,"ChargeBoxId",ChargeBoxId);
  3240. json_object_object_add(jobj4,"chargePointVendor",chargePointVendor);
  3241. json_object_object_add(jobj4,"OcppSecurityProfile",OcppSecurityProfile);
  3242. json_object_object_add(jobj4,"OcppSecurityPassword",OcppSecurityPassword);
  3243. json_object_object_add(jobj4,"MaintainServerSecurityProfile",MaintainServerSecurityProfile);
  3244. json_object_object_add(jobj4,"MaintainServerSecurityPassword",MaintainServerSecurityPassword);
  3245. json_object_object_add(jobj4,"MaintainServerURL",MaintainServerURL);
  3246. json_object_object_add(jobj4,"ChargePointPrivateKey",ChargePointPrivateKey);
  3247. json_object_object_add(jobj4,"ChargePointCertificate",ChargePointCertificate);
  3248. json_object_object_add(jobj4,"V2GPrivateKey",V2GPrivateKey);
  3249. json_object_object_add(jobj4,"V2GRootCertificate",V2GRootCertificate);
  3250. json_object_object_add(jobj4,"V2GCertificateChain",V2GCertificateChain);
  3251. json_object_object_add(jobj4,"MORootCertificate",MORootCertificate);
  3252. json_object_object_add(jobj4,"CSRootCertificate",CSRootCertificate);
  3253. json_object_object_add(jobj4,"ManufacturerRootCertificate",ManufacturerRootCertificate);
  3254. if(strcmp(IsDO, "AX") == 0 || strcmp(IsDO, "AW") == 0 || strcmp(IsAcDc, "D") == 0){
  3255. json_object_object_add(jobj4,"isEnableLocalPowerSharging",isEnableLocalPowerSharging);
  3256. json_object_object_add(jobj4,"PowerSharingCapacity",PowerSharingCapacity);
  3257. json_object_object_add(jobj4,"PowerSharingServerIP",PowerSharingServerIP);
  3258. json_object_object_add(jobj4,"OcppReceiptrURL",OcppReceiptrURL);
  3259. }
  3260. /*for TTIA*/
  3261. if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){
  3262. json_object_object_add(jobj4,"isEnableTTIA",isEnableTTIA);
  3263. json_object_object_add(jobj4,"server_addr",server_addr);
  3264. json_object_object_add(jobj4,"server_port",server_port);
  3265. json_object_object_add(jobj4,"busVenderId",busVenderId);
  3266. json_object_object_add(jobj4,"EquipmentProvider",EquipmentProvider);
  3267. json_object_object_add(jobj4,"TransportationCompanyNo",TransportationCompanyNo);
  3268. json_object_object_add(jobj4,"TTIAChargeBoxId",TTIAChargeBoxId);
  3269. json_object_object_add(jobj4,"evseStation",evseStation);
  3270. }
  3271. printf("%s\n", json_object_to_json_string(jobj4));
  3272. json_object_put(jobj4);
  3273. }
  3274. // get status code
  3275. if(strcmp(argv[1], "StatusCode") == 0)
  3276. {
  3277. int type = atoi(argv[2]);
  3278. int bytes = atoi(argv[3]);
  3279. int bits = atoi(argv[4]);
  3280. struct json_object *jobj1;
  3281. //FaultCode
  3282. struct json_object *FaultCode;
  3283. //AlarmCode
  3284. struct json_object *AlarmCode;
  3285. //InfoCode
  3286. struct json_object *InfoCode;
  3287. jobj1=json_object_new_object();
  3288. //FaultCode
  3289. if(type==1){
  3290. FaultCode = json_object_new_int(((ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[bytes]) >> bits) & 1);//(num >> n) & 1
  3291. json_object_object_add(jobj1,"FaultCode",FaultCode);
  3292. }
  3293. //AlarmCode
  3294. if(type==2){
  3295. AlarmCode = json_object_new_int(((ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[bytes]) >> bits) & 1);//(num >> n) & 1
  3296. json_object_object_add(jobj1,"AlarmCode",AlarmCode);
  3297. }
  3298. //InfoCode
  3299. if(type==3){
  3300. InfoCode = json_object_new_int(((ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[bytes]) >> bits) & 1);//(num >> n) & 1
  3301. json_object_object_add(jobj1,"InfoCode",InfoCode);
  3302. }
  3303. printf("%s\n", json_object_to_json_string(jobj1));
  3304. json_object_put(jobj1);
  3305. }
  3306. // for(;;)
  3307. // {
  3308. // }
  3309. return FAIL;
  3310. }