WebService.c 158 KB

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