WebService.c 170 KB

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