v2g_serviceDataSerialization.c 104 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080
  1. /*
  2. * Copyright (C) 2007-2010 Siemens AG
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*******************************************************************
  18. *
  19. * @author Sebastian.Kaebisch.EXT@siemens.com
  20. * @version 0.2
  21. * @contact Joerg.Heuer@siemens.com
  22. *
  23. ********************************************************************/
  24. #include "v2g_service.h"
  25. #include "v2g_serviceDataTypes.h"
  26. #include "v2g_serviceDataSerializiation.h"
  27. #include "../codec/EXITypes.h"
  28. #include "../codec/EXIEncoder.h"
  29. static int serialize_SessionInformationType(struct SessionInformationType* type, struct v2gService* service)
  30. {
  31. /* element ID assignment of SessionID*/
  32. service->eqn.namespaceURI=5;
  33. service->eqn.localPart=35;
  34. /* encode start element SessionID */
  35. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  36. {
  37. return -1;
  38. }
  39. service->val.type = BINARY_HEX;
  40. service->val.binary.len = type->SessionID.arraylen.data;
  41. memcpy(service->val.binary.data, type->SessionID.data, service->val.binary.len);
  42. /* encode character SessionID */
  43. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  44. {
  45. return -1;
  46. }
  47. /* element ID assignment of SessionID*/
  48. service->eqn.namespaceURI=5;
  49. service->eqn.localPart=35;
  50. /* encode end element of SessionID */
  51. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  52. {
  53. return -1;
  54. }if(type->isused.ServiceSessionID)
  55. {
  56. /* element ID assignment of ServiceSessionID*/
  57. service->eqn.namespaceURI=5;
  58. service->eqn.localPart=33;
  59. /* encode start element ServiceSessionID */
  60. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  61. {
  62. return -1;
  63. }
  64. service->val.type = BINARY_HEX;
  65. service->val.binary.len = type->ServiceSessionID.arraylen.data;
  66. memcpy(service->val.binary.data, type->ServiceSessionID.data, service->val.binary.len);
  67. /* encode character ServiceSessionID */
  68. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  69. {
  70. return -1;
  71. }
  72. /* element ID assignment of ServiceSessionID*/
  73. service->eqn.namespaceURI=5;
  74. service->eqn.localPart=33;
  75. /* encode end element of ServiceSessionID */
  76. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  77. {
  78. return -1;
  79. }}
  80. if(type->isused.ProtocolVersion)
  81. {
  82. /* element ID assignment of ProtocolVersion*/
  83. service->eqn.namespaceURI=5;
  84. service->eqn.localPart=25;
  85. /* encode start element ProtocolVersion */
  86. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  87. {
  88. return -1;
  89. }
  90. service->val.type = STRING;
  91. service->val.string.len = type->ProtocolVersion.arraylen.data;
  92. memcpy(service->val.string.codepoints, type->ProtocolVersion.data, service->val.string.len);
  93. /* encode character ProtocolVersion */
  94. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  95. {
  96. return -1;
  97. }
  98. /* element ID assignment of ProtocolVersion*/
  99. service->eqn.namespaceURI=5;
  100. service->eqn.localPart=25;
  101. /* encode end element of ProtocolVersion */
  102. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  103. {
  104. return -1;
  105. }}
  106. return 0;
  107. }
  108. static int serialize_EventListType(struct EventListType* type, struct v2gService* service)
  109. {
  110. /* element ID assignment of Event*/
  111. service->eqn.namespaceURI=5;
  112. service->eqn.localPart=9;
  113. /* encode start element Event */
  114. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  115. {
  116. return -1;
  117. }
  118. service->val.type = ENUMERATION;
  119. service->val.enumeration=service->v2gMsg.Header.Notification.EventList.Event;
  120. /* encode character Event */
  121. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  122. {
  123. return -1;
  124. }
  125. /* element ID assignment of Event*/
  126. service->eqn.namespaceURI=5;
  127. service->eqn.localPart=9;
  128. /* encode end element of Event */
  129. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  130. {
  131. return -1;
  132. }
  133. return 0;
  134. }
  135. static int serialize_NotificationType(struct NotificationType* type, struct v2gService* service)
  136. {if(type->isused.FaultCode)
  137. {
  138. /* element ID assignment of FaultCode*/
  139. service->eqn.namespaceURI=5;
  140. service->eqn.localPart=13;
  141. /* encode start element FaultCode */
  142. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  143. {
  144. return -1;
  145. }
  146. service->val.type = ENUMERATION;
  147. service->val.enumeration=service->v2gMsg.Header.Notification.FaultCode;
  148. /* encode character FaultCode */
  149. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  150. {
  151. return -1;
  152. }
  153. /* element ID assignment of FaultCode*/
  154. service->eqn.namespaceURI=5;
  155. service->eqn.localPart=13;
  156. /* encode end element of FaultCode */
  157. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  158. {
  159. return -1;
  160. }}
  161. if(type->isused.FaultMsg)
  162. {
  163. /* element ID assignment of FaultMsg*/
  164. service->eqn.namespaceURI=5;
  165. service->eqn.localPart=14;
  166. /* encode start element FaultMsg */
  167. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  168. {
  169. return -1;
  170. }
  171. service->val.type = STRING;
  172. service->val.string.len = type->FaultMsg.arraylen.data;
  173. memcpy(service->val.string.codepoints, type->FaultMsg.data, service->val.string.len);
  174. /* encode character FaultMsg */
  175. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  176. {
  177. return -1;
  178. }
  179. /* element ID assignment of FaultMsg*/
  180. service->eqn.namespaceURI=5;
  181. service->eqn.localPart=14;
  182. /* encode end element of FaultMsg */
  183. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  184. {
  185. return -1;
  186. }}
  187. if(type->isused.EventList)
  188. {
  189. /* element ID assignment of EventList*/
  190. service->eqn.namespaceURI=5;
  191. service->eqn.localPart=10;
  192. /* encode start element EventList */
  193. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  194. {
  195. return -1;
  196. }
  197. /* encode children of EventList */
  198. if(serialize_EventListType(&(type->EventList),service)<0)
  199. {
  200. return -1;
  201. }
  202. /* element ID assignment of EventList*/
  203. service->eqn.namespaceURI=5;
  204. service->eqn.localPart=10;
  205. /* encode end element of EventList */
  206. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  207. {
  208. return -1;
  209. }}
  210. return 0;
  211. }
  212. static int serialize_HeaderType(struct HeaderType* type, struct v2gService* service)
  213. {
  214. /* element ID assignment of SessionInformation*/
  215. service->eqn.namespaceURI=6;
  216. service->eqn.localPart=7;
  217. /* encode start element SessionInformation */
  218. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  219. {
  220. return -1;
  221. }
  222. /* encode children of SessionInformation */
  223. if(serialize_SessionInformationType(&(type->SessionInformation),service)<0)
  224. {
  225. return -1;
  226. }
  227. /* element ID assignment of SessionInformation*/
  228. service->eqn.namespaceURI=6;
  229. service->eqn.localPart=7;
  230. /* encode end element of SessionInformation */
  231. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  232. {
  233. return -1;
  234. }if(type->isused.Notification)
  235. {
  236. /* element ID assignment of Notification*/
  237. service->eqn.namespaceURI=6;
  238. service->eqn.localPart=6;
  239. /* encode start element Notification */
  240. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  241. {
  242. return -1;
  243. }
  244. /* encode children of Notification */
  245. if(serialize_NotificationType(&(type->Notification),service)<0)
  246. {
  247. return -1;
  248. }
  249. /* element ID assignment of Notification*/
  250. service->eqn.namespaceURI=6;
  251. service->eqn.localPart=6;
  252. /* encode end element of Notification */
  253. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  254. {
  255. return -1;
  256. }}
  257. return 0;
  258. }
  259. static int serialize_PEVStatusType(struct PEVStatusType* type, struct v2gService* service)
  260. {
  261. /* element ID assignment of ConnectorLocked*/
  262. service->eqn.namespaceURI=5;
  263. service->eqn.localPart=4;
  264. /* encode start element ConnectorLocked */
  265. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  266. {
  267. return -1;
  268. }
  269. service->val.type = BOOLEAN;
  270. service->val.boolean=service->v2gMsg.Body.SessionSetupReq.PEVStatus.ConnectorLocked;
  271. /* encode character ConnectorLocked */
  272. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  273. {
  274. return -1;
  275. }
  276. /* element ID assignment of ConnectorLocked*/
  277. service->eqn.namespaceURI=5;
  278. service->eqn.localPart=4;
  279. /* encode end element of ConnectorLocked */
  280. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  281. {
  282. return -1;
  283. }
  284. /* element ID assignment of ChargerStandby*/
  285. service->eqn.namespaceURI=5;
  286. service->eqn.localPart=0;
  287. /* encode start element ChargerStandby */
  288. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  289. {
  290. return -1;
  291. }
  292. service->val.type = BOOLEAN;
  293. service->val.boolean=service->v2gMsg.Body.SessionSetupReq.PEVStatus.ChargerStandby;
  294. /* encode character ChargerStandby */
  295. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  296. {
  297. return -1;
  298. }
  299. /* element ID assignment of ChargerStandby*/
  300. service->eqn.namespaceURI=5;
  301. service->eqn.localPart=0;
  302. /* encode end element of ChargerStandby */
  303. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  304. {
  305. return -1;
  306. }
  307. return 0;
  308. }
  309. static int serialize_SessionSetupReqType(struct SessionSetupReqType* type, struct v2gService* service)
  310. {if(type->isused.PEVID)
  311. {
  312. /* element ID assignment of PEVID*/
  313. service->eqn.namespaceURI=4;
  314. service->eqn.localPart=26;
  315. /* encode start element PEVID */
  316. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  317. {
  318. return -1;
  319. }
  320. service->val.type = STRING;
  321. service->val.string.len = type->PEVID.arraylen.data;
  322. memcpy(service->val.string.codepoints, type->PEVID.data, service->val.string.len);
  323. /* encode character PEVID */
  324. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  325. {
  326. return -1;
  327. }
  328. /* element ID assignment of PEVID*/
  329. service->eqn.namespaceURI=4;
  330. service->eqn.localPart=26;
  331. /* encode end element of PEVID */
  332. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  333. {
  334. return -1;
  335. }}
  336. /* element ID assignment of PEVStatus*/
  337. service->eqn.namespaceURI=4;
  338. service->eqn.localPart=32;
  339. /* encode start element PEVStatus */
  340. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  341. {
  342. return -1;
  343. }
  344. /* encode children of PEVStatus */
  345. if(serialize_PEVStatusType(&(type->PEVStatus),service)<0)
  346. {
  347. return -1;
  348. }
  349. /* element ID assignment of PEVStatus*/
  350. service->eqn.namespaceURI=4;
  351. service->eqn.localPart=32;
  352. /* encode end element of PEVStatus */
  353. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  354. {
  355. return -1;
  356. }
  357. return 0;
  358. }
  359. static int serialize_EVSEStatusType(struct EVSEStatusType* type, struct v2gService* service)
  360. {
  361. /* element ID assignment of FatalError*/
  362. service->eqn.namespaceURI=5;
  363. service->eqn.localPart=12;
  364. /* encode start element FatalError */
  365. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  366. {
  367. return -1;
  368. }
  369. service->val.type = BOOLEAN;
  370. service->val.boolean=service->v2gMsg.Body.SessionSetupRes.EVSEStatus.FatalError;
  371. /* encode character FatalError */
  372. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  373. {
  374. return -1;
  375. }
  376. /* element ID assignment of FatalError*/
  377. service->eqn.namespaceURI=5;
  378. service->eqn.localPart=12;
  379. /* encode end element of FatalError */
  380. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  381. {
  382. return -1;
  383. }
  384. /* element ID assignment of EVSEStandby*/
  385. service->eqn.namespaceURI=5;
  386. service->eqn.localPart=7;
  387. /* encode start element EVSEStandby */
  388. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  389. {
  390. return -1;
  391. }
  392. service->val.type = BOOLEAN;
  393. service->val.boolean=service->v2gMsg.Body.SessionSetupRes.EVSEStatus.EVSEStandby;
  394. /* encode character EVSEStandby */
  395. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  396. {
  397. return -1;
  398. }
  399. /* element ID assignment of EVSEStandby*/
  400. service->eqn.namespaceURI=5;
  401. service->eqn.localPart=7;
  402. /* encode end element of EVSEStandby */
  403. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  404. {
  405. return -1;
  406. }
  407. /* element ID assignment of ConnectorLocked*/
  408. service->eqn.namespaceURI=5;
  409. service->eqn.localPart=4;
  410. /* encode start element ConnectorLocked */
  411. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  412. {
  413. return -1;
  414. }
  415. service->val.type = BOOLEAN;
  416. service->val.boolean=service->v2gMsg.Body.SessionSetupRes.EVSEStatus.ConnectorLocked;
  417. /* encode character ConnectorLocked */
  418. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  419. {
  420. return -1;
  421. }
  422. /* element ID assignment of ConnectorLocked*/
  423. service->eqn.namespaceURI=5;
  424. service->eqn.localPart=4;
  425. /* encode end element of ConnectorLocked */
  426. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  427. {
  428. return -1;
  429. }
  430. /* element ID assignment of PowerSwitchClosed*/
  431. service->eqn.namespaceURI=5;
  432. service->eqn.localPart=24;
  433. /* encode start element PowerSwitchClosed */
  434. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  435. {
  436. return -1;
  437. }
  438. service->val.type = BOOLEAN;
  439. service->val.boolean=service->v2gMsg.Body.SessionSetupRes.EVSEStatus.PowerSwitchClosed;
  440. /* encode character PowerSwitchClosed */
  441. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  442. {
  443. return -1;
  444. }
  445. /* element ID assignment of PowerSwitchClosed*/
  446. service->eqn.namespaceURI=5;
  447. service->eqn.localPart=24;
  448. /* encode end element of PowerSwitchClosed */
  449. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  450. {
  451. return -1;
  452. }
  453. /* element ID assignment of RCD*/
  454. service->eqn.namespaceURI=5;
  455. service->eqn.localPart=26;
  456. /* encode start element RCD */
  457. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  458. {
  459. return -1;
  460. }
  461. service->val.type = BOOLEAN;
  462. service->val.boolean=service->v2gMsg.Body.SessionSetupRes.EVSEStatus.RCD;
  463. /* encode character RCD */
  464. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  465. {
  466. return -1;
  467. }
  468. /* element ID assignment of RCD*/
  469. service->eqn.namespaceURI=5;
  470. service->eqn.localPart=26;
  471. /* encode end element of RCD */
  472. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  473. {
  474. return -1;
  475. }
  476. /* element ID assignment of ShutDownTime*/
  477. service->eqn.namespaceURI=5;
  478. service->eqn.localPart=37;
  479. /* encode start element ShutDownTime */
  480. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  481. {
  482. return -1;
  483. }
  484. service->val.type = INTEGER_64;
  485. service->val.int64=service->v2gMsg.Body.SessionSetupRes.EVSEStatus.ShutDownTime;
  486. /* encode character ShutDownTime */
  487. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  488. {
  489. return -1;
  490. }
  491. /* element ID assignment of ShutDownTime*/
  492. service->eqn.namespaceURI=5;
  493. service->eqn.localPart=37;
  494. /* encode end element of ShutDownTime */
  495. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  496. {
  497. return -1;
  498. }
  499. return 0;
  500. }
  501. static int serialize_SessionSetupResType(struct SessionSetupResType* type, struct v2gService* service)
  502. {
  503. /* element ID assignment of ResponseCode*/
  504. service->eqn.namespaceURI=4;
  505. service->eqn.localPart=47;
  506. /* encode start element ResponseCode */
  507. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  508. {
  509. return -1;
  510. }
  511. service->val.type = ENUMERATION;
  512. service->val.enumeration=service->v2gMsg.Body.SessionSetupRes.ResponseCode;
  513. /* encode character ResponseCode */
  514. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  515. {
  516. return -1;
  517. }
  518. /* element ID assignment of ResponseCode*/
  519. service->eqn.namespaceURI=4;
  520. service->eqn.localPart=47;
  521. /* encode end element of ResponseCode */
  522. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  523. {
  524. return -1;
  525. }
  526. /* element ID assignment of EVSEID*/
  527. service->eqn.namespaceURI=4;
  528. service->eqn.localPart=3;
  529. /* encode start element EVSEID */
  530. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  531. {
  532. return -1;
  533. }
  534. service->val.type = BINARY_HEX;
  535. service->val.binary.len = type->EVSEID.arraylen.data;
  536. memcpy(service->val.binary.data, type->EVSEID.data, service->val.binary.len);
  537. /* encode character EVSEID */
  538. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  539. {
  540. return -1;
  541. }
  542. /* element ID assignment of EVSEID*/
  543. service->eqn.namespaceURI=4;
  544. service->eqn.localPart=3;
  545. /* encode end element of EVSEID */
  546. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  547. {
  548. return -1;
  549. }
  550. /* element ID assignment of EVSEStatus*/
  551. service->eqn.namespaceURI=4;
  552. service->eqn.localPart=7;
  553. /* encode start element EVSEStatus */
  554. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  555. {
  556. return -1;
  557. }
  558. /* encode children of EVSEStatus */
  559. if(serialize_EVSEStatusType(&(type->EVSEStatus),service)<0)
  560. {
  561. return -1;
  562. }
  563. /* element ID assignment of EVSEStatus*/
  564. service->eqn.namespaceURI=4;
  565. service->eqn.localPart=7;
  566. /* encode end element of EVSEStatus */
  567. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  568. {
  569. return -1;
  570. }
  571. /* element ID assignment of TCurrent*/
  572. service->eqn.namespaceURI=4;
  573. service->eqn.localPart=63;
  574. /* encode start element TCurrent */
  575. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  576. {
  577. return -1;
  578. }
  579. service->val.type = INTEGER_64;
  580. service->val.int64=service->v2gMsg.Body.SessionSetupRes.TCurrent;
  581. /* encode character TCurrent */
  582. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  583. {
  584. return -1;
  585. }
  586. /* element ID assignment of TCurrent*/
  587. service->eqn.namespaceURI=4;
  588. service->eqn.localPart=63;
  589. /* encode end element of TCurrent */
  590. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  591. {
  592. return -1;
  593. }
  594. return 0;
  595. }
  596. static int serialize_ServiceDiscoveryReqType(struct ServiceDiscoveryReqType* type, struct v2gService* service)
  597. {if(type->isused.ServiceType)
  598. {
  599. /* element ID assignment of ServiceType*/
  600. service->eqn.namespaceURI=4;
  601. service->eqn.localPart=58;
  602. /* encode start element ServiceType */
  603. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  604. {
  605. return -1;
  606. }
  607. service->val.type = ENUMERATION;
  608. service->val.enumeration=service->v2gMsg.Body.ServiceDiscoveryReq.ServiceType;
  609. /* encode character ServiceType */
  610. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  611. {
  612. return -1;
  613. }
  614. /* element ID assignment of ServiceType*/
  615. service->eqn.namespaceURI=4;
  616. service->eqn.localPart=58;
  617. /* encode end element of ServiceType */
  618. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  619. {
  620. return -1;
  621. }}
  622. if(type->isused.ServiceScope)
  623. {
  624. /* element ID assignment of ServiceScope*/
  625. service->eqn.namespaceURI=4;
  626. service->eqn.localPart=57;
  627. /* encode start element ServiceScope */
  628. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  629. {
  630. return -1;
  631. }
  632. service->val.type = STRING;
  633. service->val.string.len = type->ServiceScope.arraylen.data;
  634. memcpy(service->val.string.codepoints, type->ServiceScope.data, service->val.string.len);
  635. /* encode character ServiceScope */
  636. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  637. {
  638. return -1;
  639. }
  640. /* element ID assignment of ServiceScope*/
  641. service->eqn.namespaceURI=4;
  642. service->eqn.localPart=57;
  643. /* encode end element of ServiceScope */
  644. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  645. {
  646. return -1;
  647. }}
  648. return 0;
  649. }
  650. static int serialize_ServiceDescriptionType(struct ServiceDescriptionType* type, struct v2gService* service)
  651. {
  652. /* element ID assignment of ServiceID*/
  653. service->eqn.namespaceURI=5;
  654. service->eqn.localPart=29;
  655. /* encode start element ServiceID */
  656. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  657. {
  658. return -1;
  659. }
  660. service->val.type = BINARY_HEX;
  661. service->val.binary.len = type->ServiceID.arraylen.data;
  662. memcpy(service->val.binary.data, type->ServiceID.data, service->val.binary.len);
  663. /* encode character ServiceID */
  664. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  665. {
  666. return -1;
  667. }
  668. /* element ID assignment of ServiceID*/
  669. service->eqn.namespaceURI=5;
  670. service->eqn.localPart=29;
  671. /* encode end element of ServiceID */
  672. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  673. {
  674. return -1;
  675. }if(type->isused.ServiceName)
  676. {
  677. /* element ID assignment of ServiceName*/
  678. service->eqn.namespaceURI=5;
  679. service->eqn.localPart=31;
  680. /* encode start element ServiceName */
  681. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  682. {
  683. return -1;
  684. }
  685. service->val.type = STRING;
  686. service->val.string.len = type->ServiceName.arraylen.data;
  687. memcpy(service->val.string.codepoints, type->ServiceName.data, service->val.string.len);
  688. /* encode character ServiceName */
  689. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  690. {
  691. return -1;
  692. }
  693. /* element ID assignment of ServiceName*/
  694. service->eqn.namespaceURI=5;
  695. service->eqn.localPart=31;
  696. /* encode end element of ServiceName */
  697. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  698. {
  699. return -1;
  700. }}
  701. if(type->isused.ServiceType)
  702. {
  703. /* element ID assignment of ServiceType*/
  704. service->eqn.namespaceURI=5;
  705. service->eqn.localPart=34;
  706. /* encode start element ServiceType */
  707. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  708. {
  709. return -1;
  710. }
  711. service->val.type = ENUMERATION;
  712. service->val.enumeration=service->v2gMsg.Body.ServiceDiscoveryRes.ServiceList.Service[service->v2gMsg.Body.ServiceDiscoveryRes.ServiceList.arraylen.Service].ServiceType;
  713. /* encode character ServiceType */
  714. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  715. {
  716. return -1;
  717. }
  718. /* element ID assignment of ServiceType*/
  719. service->eqn.namespaceURI=5;
  720. service->eqn.localPart=34;
  721. /* encode end element of ServiceType */
  722. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  723. {
  724. return -1;
  725. }}
  726. if(type->isused.ServiceScope)
  727. {
  728. /* element ID assignment of ServiceScope*/
  729. service->eqn.namespaceURI=5;
  730. service->eqn.localPart=32;
  731. /* encode start element ServiceScope */
  732. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  733. {
  734. return -1;
  735. }
  736. service->val.type = STRING;
  737. service->val.string.len = type->ServiceScope.arraylen.data;
  738. memcpy(service->val.string.codepoints, type->ServiceScope.data, service->val.string.len);
  739. /* encode character ServiceScope */
  740. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  741. {
  742. return -1;
  743. }
  744. /* element ID assignment of ServiceScope*/
  745. service->eqn.namespaceURI=5;
  746. service->eqn.localPart=32;
  747. /* encode end element of ServiceScope */
  748. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  749. {
  750. return -1;
  751. }}
  752. return 0;
  753. }
  754. static int serialize_ServiceListType(struct ServiceListType* type, struct v2gService* service)
  755. {
  756. /* element ID assignment of Service*/
  757. service->eqn.namespaceURI=5;
  758. service->eqn.localPart=27;
  759. /* encode start element Service */
  760. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  761. {
  762. return -1;
  763. }
  764. /* encode children of Service */
  765. if(serialize_ServiceDescriptionType(&(type->Service),service)<0)
  766. {
  767. return -1;
  768. }
  769. /* element ID assignment of Service*/
  770. service->eqn.namespaceURI=5;
  771. service->eqn.localPart=27;
  772. /* encode end element of Service */
  773. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  774. {
  775. return -1;
  776. }
  777. return 0;
  778. }
  779. static int serialize_ServiceDiscoveryResType(struct ServiceDiscoveryResType* type, struct v2gService* service)
  780. {
  781. /* element ID assignment of ResponseCode*/
  782. service->eqn.namespaceURI=4;
  783. service->eqn.localPart=47;
  784. /* encode start element ResponseCode */
  785. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  786. {
  787. return -1;
  788. }
  789. service->val.type = ENUMERATION;
  790. service->val.enumeration=service->v2gMsg.Body.ServiceDiscoveryRes.ResponseCode;
  791. /* encode character ResponseCode */
  792. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  793. {
  794. return -1;
  795. }
  796. /* element ID assignment of ResponseCode*/
  797. service->eqn.namespaceURI=4;
  798. service->eqn.localPart=47;
  799. /* encode end element of ResponseCode */
  800. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  801. {
  802. return -1;
  803. }if(type->isused.ServiceList)
  804. {
  805. /* element ID assignment of ServiceList*/
  806. service->eqn.namespaceURI=4;
  807. service->eqn.localPart=52;
  808. /* encode start element ServiceList */
  809. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  810. {
  811. return -1;
  812. }
  813. /* encode children of ServiceList */
  814. if(serialize_ServiceListType(&(type->ServiceList),service)<0)
  815. {
  816. return -1;
  817. }
  818. /* element ID assignment of ServiceList*/
  819. service->eqn.namespaceURI=4;
  820. service->eqn.localPart=52;
  821. /* encode end element of ServiceList */
  822. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  823. {
  824. return -1;
  825. }}
  826. return 0;
  827. }
  828. static int serialize_ServicePaymentSelectionReqType(struct ServicePaymentSelectionReqType* type, struct v2gService* service)
  829. {
  830. /* element ID assignment of ServiceList*/
  831. service->eqn.namespaceURI=4;
  832. service->eqn.localPart=52;
  833. /* encode start element ServiceList */
  834. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  835. {
  836. return -1;
  837. }
  838. /* encode children of ServiceList */
  839. if(serialize_ServiceListType(&(type->ServiceList),service)<0)
  840. {
  841. return -1;
  842. }
  843. /* element ID assignment of ServiceList*/
  844. service->eqn.namespaceURI=4;
  845. service->eqn.localPart=52;
  846. /* encode end element of ServiceList */
  847. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  848. {
  849. return -1;
  850. }
  851. /* element ID assignment of PEVPubKey*/
  852. service->eqn.namespaceURI=4;
  853. service->eqn.localPart=31;
  854. /* encode start element PEVPubKey */
  855. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  856. {
  857. return -1;
  858. }
  859. service->val.type = BINARY_HEX;
  860. service->val.binary.len = type->PEVPubKey.arraylen.data;
  861. memcpy(service->val.binary.data, type->PEVPubKey.data, service->val.binary.len);
  862. /* encode character PEVPubKey */
  863. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  864. {
  865. return -1;
  866. }
  867. /* element ID assignment of PEVPubKey*/
  868. service->eqn.namespaceURI=4;
  869. service->eqn.localPart=31;
  870. /* encode end element of PEVPubKey */
  871. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  872. {
  873. return -1;
  874. }
  875. return 0;
  876. }
  877. static int serialize_ServicePaymentSelectionResType(struct ServicePaymentSelectionResType* type, struct v2gService* service)
  878. {
  879. /* element ID assignment of ResponseCode*/
  880. service->eqn.namespaceURI=4;
  881. service->eqn.localPart=47;
  882. /* encode start element ResponseCode */
  883. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  884. {
  885. return -1;
  886. }
  887. service->val.type = ENUMERATION;
  888. service->val.enumeration=service->v2gMsg.Body.ServicePaymentSelectionRes.ResponseCode;
  889. /* encode character ResponseCode */
  890. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  891. {
  892. return -1;
  893. }
  894. /* element ID assignment of ResponseCode*/
  895. service->eqn.namespaceURI=4;
  896. service->eqn.localPart=47;
  897. /* encode end element of ResponseCode */
  898. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  899. {
  900. return -1;
  901. }if(type->isused.MeteringAuthPubKey)
  902. {
  903. /* element ID assignment of MeteringAuthPubKey*/
  904. service->eqn.namespaceURI=4;
  905. service->eqn.localPart=16;
  906. /* encode start element MeteringAuthPubKey */
  907. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  908. {
  909. return -1;
  910. }
  911. service->val.type = BINARY_HEX;
  912. service->val.binary.len = type->MeteringAuthPubKey.arraylen.data;
  913. memcpy(service->val.binary.data, type->MeteringAuthPubKey.data, service->val.binary.len);
  914. /* encode character MeteringAuthPubKey */
  915. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  916. {
  917. return -1;
  918. }
  919. /* element ID assignment of MeteringAuthPubKey*/
  920. service->eqn.namespaceURI=4;
  921. service->eqn.localPart=16;
  922. /* encode end element of MeteringAuthPubKey */
  923. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  924. {
  925. return -1;
  926. }}
  927. return 0;
  928. }
  929. static int serialize_PaymentDetailsReqType(struct PaymentDetailsReqType* type, struct v2gService* service)
  930. {
  931. /* element ID assignment of ContractID*/
  932. service->eqn.namespaceURI=4;
  933. service->eqn.localPart=1;
  934. /* encode start element ContractID */
  935. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  936. {
  937. return -1;
  938. }
  939. service->val.type = STRING;
  940. service->val.string.len = type->ContractID.arraylen.data;
  941. memcpy(service->val.string.codepoints, type->ContractID.data, service->val.string.len);
  942. /* encode character ContractID */
  943. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  944. {
  945. return -1;
  946. }
  947. /* element ID assignment of ContractID*/
  948. service->eqn.namespaceURI=4;
  949. service->eqn.localPart=1;
  950. /* encode end element of ContractID */
  951. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  952. {
  953. return -1;
  954. }
  955. return 0;
  956. }
  957. static int serialize_PaymentDetailsResType(struct PaymentDetailsResType* type, struct v2gService* service)
  958. {
  959. /* element ID assignment of ResponseCode*/
  960. service->eqn.namespaceURI=4;
  961. service->eqn.localPart=47;
  962. /* encode start element ResponseCode */
  963. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  964. {
  965. return -1;
  966. }
  967. service->val.type = ENUMERATION;
  968. service->val.enumeration=service->v2gMsg.Body.PaymentDetailsRes.ResponseCode;
  969. /* encode character ResponseCode */
  970. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  971. {
  972. return -1;
  973. }
  974. /* element ID assignment of ResponseCode*/
  975. service->eqn.namespaceURI=4;
  976. service->eqn.localPart=47;
  977. /* encode end element of ResponseCode */
  978. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  979. {
  980. return -1;
  981. }
  982. return 0;
  983. }
  984. static int serialize_FloatingValueType(struct FloatingValueType* type, struct v2gService* service)
  985. {
  986. /* element ID assignment of Multiplier*/
  987. service->eqn.namespaceURI=5;
  988. service->eqn.localPart=21;
  989. /* encode start element Multiplier */
  990. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  991. {
  992. return -1;
  993. }
  994. service->val.type = ENUMERATION;
  995. service->val.enumeration=service->v2gMsg.Body.PowerDiscoveryReq.EAmount.Multiplier;
  996. /* encode character Multiplier */
  997. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  998. {
  999. return -1;
  1000. }
  1001. /* element ID assignment of Multiplier*/
  1002. service->eqn.namespaceURI=5;
  1003. service->eqn.localPart=21;
  1004. /* encode end element of Multiplier */
  1005. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1006. {
  1007. return -1;
  1008. }
  1009. /* element ID assignment of Unit*/
  1010. service->eqn.namespaceURI=5;
  1011. service->eqn.localPart=50;
  1012. /* encode start element Unit */
  1013. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1014. {
  1015. return -1;
  1016. }
  1017. service->val.type = ENUMERATION;
  1018. service->val.enumeration=service->v2gMsg.Body.PowerDiscoveryReq.EAmount.Unit;
  1019. /* encode character Unit */
  1020. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1021. {
  1022. return -1;
  1023. }
  1024. /* element ID assignment of Unit*/
  1025. service->eqn.namespaceURI=5;
  1026. service->eqn.localPart=50;
  1027. /* encode end element of Unit */
  1028. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1029. {
  1030. return -1;
  1031. }
  1032. /* element ID assignment of Value*/
  1033. service->eqn.namespaceURI=5;
  1034. service->eqn.localPart=51;
  1035. /* encode start element Value */
  1036. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1037. {
  1038. return -1;
  1039. }
  1040. service->val.type = INTEGER_16;
  1041. service->val.int32=service->v2gMsg.Body.PowerDiscoveryReq.EAmount.Value;
  1042. /* encode character Value */
  1043. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1044. {
  1045. return -1;
  1046. }
  1047. /* element ID assignment of Value*/
  1048. service->eqn.namespaceURI=5;
  1049. service->eqn.localPart=51;
  1050. /* encode end element of Value */
  1051. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1052. {
  1053. return -1;
  1054. }
  1055. return 0;
  1056. }
  1057. static int serialize_PowerDiscoveryReqType(struct PowerDiscoveryReqType* type, struct v2gService* service)
  1058. {
  1059. /* element ID assignment of PEVStatus*/
  1060. service->eqn.namespaceURI=4;
  1061. service->eqn.localPart=32;
  1062. /* encode start element PEVStatus */
  1063. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1064. {
  1065. return -1;
  1066. }
  1067. /* encode children of PEVStatus */
  1068. if(serialize_PEVStatusType(&(type->PEVStatus),service)<0)
  1069. {
  1070. return -1;
  1071. }
  1072. /* element ID assignment of PEVStatus*/
  1073. service->eqn.namespaceURI=4;
  1074. service->eqn.localPart=32;
  1075. /* encode end element of PEVStatus */
  1076. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1077. {
  1078. return -1;
  1079. }
  1080. /* element ID assignment of EoC*/
  1081. service->eqn.namespaceURI=4;
  1082. service->eqn.localPart=10;
  1083. /* encode start element EoC */
  1084. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1085. {
  1086. return -1;
  1087. }
  1088. service->val.type = INTEGER_64;
  1089. service->val.int64=service->v2gMsg.Body.PowerDiscoveryReq.EoC;
  1090. /* encode character EoC */
  1091. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1092. {
  1093. return -1;
  1094. }
  1095. /* element ID assignment of EoC*/
  1096. service->eqn.namespaceURI=4;
  1097. service->eqn.localPart=10;
  1098. /* encode end element of EoC */
  1099. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1100. {
  1101. return -1;
  1102. }
  1103. /* element ID assignment of EAmount*/
  1104. service->eqn.namespaceURI=4;
  1105. service->eqn.localPart=2;
  1106. /* encode start element EAmount */
  1107. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1108. {
  1109. return -1;
  1110. }
  1111. /* encode children of EAmount */
  1112. if(serialize_FloatingValueType(&(type->EAmount),service)<0)
  1113. {
  1114. return -1;
  1115. }
  1116. /* element ID assignment of EAmount*/
  1117. service->eqn.namespaceURI=4;
  1118. service->eqn.localPart=2;
  1119. /* encode end element of EAmount */
  1120. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1121. {
  1122. return -1;
  1123. }
  1124. /* element ID assignment of PEVMaxPower*/
  1125. service->eqn.namespaceURI=4;
  1126. service->eqn.localPart=28;
  1127. /* encode start element PEVMaxPower */
  1128. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1129. {
  1130. return -1;
  1131. }
  1132. /* encode children of PEVMaxPower */
  1133. if(serialize_FloatingValueType(&(type->PEVMaxPower),service)<0)
  1134. {
  1135. return -1;
  1136. }
  1137. /* element ID assignment of PEVMaxPower*/
  1138. service->eqn.namespaceURI=4;
  1139. service->eqn.localPart=28;
  1140. /* encode end element of PEVMaxPower */
  1141. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1142. {
  1143. return -1;
  1144. }
  1145. /* element ID assignment of PEVMaxPhases*/
  1146. service->eqn.namespaceURI=4;
  1147. service->eqn.localPart=27;
  1148. /* encode start element PEVMaxPhases */
  1149. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1150. {
  1151. return -1;
  1152. }
  1153. service->val.type = INTEGER_16;
  1154. service->val.int32=service->v2gMsg.Body.PowerDiscoveryReq.PEVMaxPhases;
  1155. /* encode character PEVMaxPhases */
  1156. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1157. {
  1158. return -1;
  1159. }
  1160. /* element ID assignment of PEVMaxPhases*/
  1161. service->eqn.namespaceURI=4;
  1162. service->eqn.localPart=27;
  1163. /* encode end element of PEVMaxPhases */
  1164. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1165. {
  1166. return -1;
  1167. }
  1168. /* element ID assignment of PEVMaxVoltage*/
  1169. service->eqn.namespaceURI=4;
  1170. service->eqn.localPart=29;
  1171. /* encode start element PEVMaxVoltage */
  1172. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1173. {
  1174. return -1;
  1175. }
  1176. /* encode children of PEVMaxVoltage */
  1177. if(serialize_FloatingValueType(&(type->PEVMaxVoltage),service)<0)
  1178. {
  1179. return -1;
  1180. }
  1181. /* element ID assignment of PEVMaxVoltage*/
  1182. service->eqn.namespaceURI=4;
  1183. service->eqn.localPart=29;
  1184. /* encode end element of PEVMaxVoltage */
  1185. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1186. {
  1187. return -1;
  1188. }
  1189. /* element ID assignment of PEVMinVoltage*/
  1190. service->eqn.namespaceURI=4;
  1191. service->eqn.localPart=30;
  1192. /* encode start element PEVMinVoltage */
  1193. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1194. {
  1195. return -1;
  1196. }
  1197. /* encode children of PEVMinVoltage */
  1198. if(serialize_FloatingValueType(&(type->PEVMinVoltage),service)<0)
  1199. {
  1200. return -1;
  1201. }
  1202. /* element ID assignment of PEVMinVoltage*/
  1203. service->eqn.namespaceURI=4;
  1204. service->eqn.localPart=30;
  1205. /* encode end element of PEVMinVoltage */
  1206. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1207. {
  1208. return -1;
  1209. }
  1210. return 0;
  1211. }
  1212. static int serialize_TariffEntryType(struct TariffEntryType* type, struct v2gService* service)
  1213. {
  1214. /* element ID assignment of TariffStart*/
  1215. service->eqn.namespaceURI=5;
  1216. service->eqn.localPart=48;
  1217. /* encode start element TariffStart */
  1218. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1219. {
  1220. return -1;
  1221. }
  1222. service->val.type = UNSIGNED_INTEGER_32;
  1223. service->val.uint32=service->v2gMsg.Body.PowerDiscoveryRes.TariffTable.Tariff[service->v2gMsg.Body.PowerDiscoveryRes.TariffTable.arraylen.Tariff].TariffEntries.TariffEntry[service->v2gMsg.Body.PowerDiscoveryRes.TariffTable.Tariff[service->v2gMsg.Body.PowerDiscoveryRes.TariffTable.arraylen.Tariff].TariffEntries.arraylen.TariffEntry].TariffStart;
  1224. /* encode character TariffStart */
  1225. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1226. {
  1227. return -1;
  1228. }
  1229. /* element ID assignment of TariffStart*/
  1230. service->eqn.namespaceURI=5;
  1231. service->eqn.localPart=48;
  1232. /* encode end element of TariffStart */
  1233. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1234. {
  1235. return -1;
  1236. }
  1237. /* element ID assignment of TariffPMax*/
  1238. service->eqn.namespaceURI=5;
  1239. service->eqn.localPart=47;
  1240. /* encode start element TariffPMax */
  1241. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1242. {
  1243. return -1;
  1244. }
  1245. /* encode children of TariffPMax */
  1246. if(serialize_FloatingValueType(&(type->TariffPMax),service)<0)
  1247. {
  1248. return -1;
  1249. }
  1250. /* element ID assignment of TariffPMax*/
  1251. service->eqn.namespaceURI=5;
  1252. service->eqn.localPart=47;
  1253. /* encode end element of TariffPMax */
  1254. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1255. {
  1256. return -1;
  1257. }if(type->isused.EPrice)
  1258. {
  1259. /* element ID assignment of EPrice*/
  1260. service->eqn.namespaceURI=5;
  1261. service->eqn.localPart=6;
  1262. /* encode start element EPrice */
  1263. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1264. {
  1265. return -1;
  1266. }
  1267. /* encode children of EPrice */
  1268. if(serialize_FloatingValueType(&(type->EPrice),service)<0)
  1269. {
  1270. return -1;
  1271. }
  1272. /* element ID assignment of EPrice*/
  1273. service->eqn.namespaceURI=5;
  1274. service->eqn.localPart=6;
  1275. /* encode end element of EPrice */
  1276. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1277. {
  1278. return -1;
  1279. }}
  1280. return 0;
  1281. }
  1282. static int serialize_TariffEntriesType(struct TariffEntriesType* type, struct v2gService* service)
  1283. {
  1284. /* element ID assignment of TariffEntry*/
  1285. service->eqn.namespaceURI=5;
  1286. service->eqn.localPart=44;
  1287. /* encode start element TariffEntry */
  1288. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1289. {
  1290. return -1;
  1291. }
  1292. /* encode children of TariffEntry */
  1293. if(serialize_TariffEntryType(&(type->TariffEntry),service)<0)
  1294. {
  1295. return -1;
  1296. }
  1297. /* element ID assignment of TariffEntry*/
  1298. service->eqn.namespaceURI=5;
  1299. service->eqn.localPart=44;
  1300. /* encode end element of TariffEntry */
  1301. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1302. {
  1303. return -1;
  1304. }
  1305. return 0;
  1306. }
  1307. static int serialize_TariffDescrType(struct TariffDescrType* type, struct v2gService* service)
  1308. {
  1309. /* element ID assignment of TariffID*/
  1310. service->eqn.namespaceURI=5;
  1311. service->eqn.localPart=46;
  1312. /* encode start element TariffID */
  1313. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1314. {
  1315. return -1;
  1316. }
  1317. service->val.type = ENUMERATION;
  1318. service->val.enumeration=service->v2gMsg.Body.PowerDiscoveryRes.TariffTable.Tariff[service->v2gMsg.Body.PowerDiscoveryRes.TariffTable.arraylen.Tariff].TariffID;
  1319. /* encode character TariffID */
  1320. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1321. {
  1322. return -1;
  1323. }
  1324. /* element ID assignment of TariffID*/
  1325. service->eqn.namespaceURI=5;
  1326. service->eqn.localPart=46;
  1327. /* encode end element of TariffID */
  1328. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1329. {
  1330. return -1;
  1331. }if(type->isused.TariffDescription)
  1332. {
  1333. /* element ID assignment of TariffDescription*/
  1334. service->eqn.namespaceURI=5;
  1335. service->eqn.localPart=41;
  1336. /* encode start element TariffDescription */
  1337. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1338. {
  1339. return -1;
  1340. }
  1341. service->val.type = STRING;
  1342. service->val.string.len = type->TariffDescription.arraylen.data;
  1343. memcpy(service->val.string.codepoints, type->TariffDescription.data, service->val.string.len);
  1344. /* encode character TariffDescription */
  1345. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1346. {
  1347. return -1;
  1348. }
  1349. /* element ID assignment of TariffDescription*/
  1350. service->eqn.namespaceURI=5;
  1351. service->eqn.localPart=41;
  1352. /* encode end element of TariffDescription */
  1353. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1354. {
  1355. return -1;
  1356. }}
  1357. /* element ID assignment of TariffEntries*/
  1358. service->eqn.namespaceURI=5;
  1359. service->eqn.localPart=42;
  1360. /* encode start element TariffEntries */
  1361. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1362. {
  1363. return -1;
  1364. }
  1365. /* encode children of TariffEntries */
  1366. if(serialize_TariffEntriesType(&(type->TariffEntries),service)<0)
  1367. {
  1368. return -1;
  1369. }
  1370. /* element ID assignment of TariffEntries*/
  1371. service->eqn.namespaceURI=5;
  1372. service->eqn.localPart=42;
  1373. /* encode end element of TariffEntries */
  1374. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1375. {
  1376. return -1;
  1377. }
  1378. return 0;
  1379. }
  1380. static int serialize_TariffTableType(struct TariffTableType* type, struct v2gService* service)
  1381. {
  1382. /* element ID assignment of Currency*/
  1383. service->eqn.namespaceURI=5;
  1384. service->eqn.localPart=5;
  1385. /* encode start element Currency */
  1386. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1387. {
  1388. return -1;
  1389. }
  1390. service->val.type = STRING;
  1391. service->val.string.len = type->Currency.arraylen.data;
  1392. memcpy(service->val.string.codepoints, type->Currency.data, service->val.string.len);
  1393. /* encode character Currency */
  1394. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1395. {
  1396. return -1;
  1397. }
  1398. /* element ID assignment of Currency*/
  1399. service->eqn.namespaceURI=5;
  1400. service->eqn.localPart=5;
  1401. /* encode end element of Currency */
  1402. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1403. {
  1404. return -1;
  1405. }
  1406. /* element ID assignment of Tariff*/
  1407. service->eqn.namespaceURI=5;
  1408. service->eqn.localPart=39;
  1409. /* encode start element Tariff */
  1410. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1411. {
  1412. return -1;
  1413. }
  1414. /* encode children of Tariff */
  1415. if(serialize_TariffDescrType(&(type->Tariff),service)<0)
  1416. {
  1417. return -1;
  1418. }
  1419. /* element ID assignment of Tariff*/
  1420. service->eqn.namespaceURI=5;
  1421. service->eqn.localPart=39;
  1422. /* encode end element of Tariff */
  1423. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1424. {
  1425. return -1;
  1426. }
  1427. return 0;
  1428. }
  1429. static int serialize_PowerDiscoveryResType(struct PowerDiscoveryResType* type, struct v2gService* service)
  1430. {
  1431. /* element ID assignment of ResponseCode*/
  1432. service->eqn.namespaceURI=4;
  1433. service->eqn.localPart=47;
  1434. /* encode start element ResponseCode */
  1435. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1436. {
  1437. return -1;
  1438. }
  1439. service->val.type = ENUMERATION;
  1440. service->val.enumeration=service->v2gMsg.Body.PowerDiscoveryRes.ResponseCode;
  1441. /* encode character ResponseCode */
  1442. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1443. {
  1444. return -1;
  1445. }
  1446. /* element ID assignment of ResponseCode*/
  1447. service->eqn.namespaceURI=4;
  1448. service->eqn.localPart=47;
  1449. /* encode end element of ResponseCode */
  1450. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1451. {
  1452. return -1;
  1453. }
  1454. /* element ID assignment of EVSEStatus*/
  1455. service->eqn.namespaceURI=4;
  1456. service->eqn.localPart=7;
  1457. /* encode start element EVSEStatus */
  1458. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1459. {
  1460. return -1;
  1461. }
  1462. /* encode children of EVSEStatus */
  1463. if(serialize_EVSEStatusType(&(type->EVSEStatus),service)<0)
  1464. {
  1465. return -1;
  1466. }
  1467. /* element ID assignment of EVSEStatus*/
  1468. service->eqn.namespaceURI=4;
  1469. service->eqn.localPart=7;
  1470. /* encode end element of EVSEStatus */
  1471. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1472. {
  1473. return -1;
  1474. }
  1475. /* element ID assignment of EVSEVoltage*/
  1476. service->eqn.namespaceURI=4;
  1477. service->eqn.localPart=8;
  1478. /* encode start element EVSEVoltage */
  1479. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1480. {
  1481. return -1;
  1482. }
  1483. /* encode children of EVSEVoltage */
  1484. if(serialize_FloatingValueType(&(type->EVSEVoltage),service)<0)
  1485. {
  1486. return -1;
  1487. }
  1488. /* element ID assignment of EVSEVoltage*/
  1489. service->eqn.namespaceURI=4;
  1490. service->eqn.localPart=8;
  1491. /* encode end element of EVSEVoltage */
  1492. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1493. {
  1494. return -1;
  1495. }
  1496. /* element ID assignment of EVSEIMax*/
  1497. service->eqn.namespaceURI=4;
  1498. service->eqn.localPart=4;
  1499. /* encode start element EVSEIMax */
  1500. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1501. {
  1502. return -1;
  1503. }
  1504. /* encode children of EVSEIMax */
  1505. if(serialize_FloatingValueType(&(type->EVSEIMax),service)<0)
  1506. {
  1507. return -1;
  1508. }
  1509. /* element ID assignment of EVSEIMax*/
  1510. service->eqn.namespaceURI=4;
  1511. service->eqn.localPart=4;
  1512. /* encode end element of EVSEIMax */
  1513. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1514. {
  1515. return -1;
  1516. }
  1517. /* element ID assignment of EVSEMaxPhases*/
  1518. service->eqn.namespaceURI=4;
  1519. service->eqn.localPart=5;
  1520. /* encode start element EVSEMaxPhases */
  1521. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1522. {
  1523. return -1;
  1524. }
  1525. service->val.type = INTEGER_16;
  1526. service->val.int32=service->v2gMsg.Body.PowerDiscoveryRes.EVSEMaxPhases;
  1527. /* encode character EVSEMaxPhases */
  1528. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1529. {
  1530. return -1;
  1531. }
  1532. /* element ID assignment of EVSEMaxPhases*/
  1533. service->eqn.namespaceURI=4;
  1534. service->eqn.localPart=5;
  1535. /* encode end element of EVSEMaxPhases */
  1536. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1537. {
  1538. return -1;
  1539. }if(type->isused.EnergyProvider)
  1540. {
  1541. /* element ID assignment of EnergyProvider*/
  1542. service->eqn.namespaceURI=4;
  1543. service->eqn.localPart=9;
  1544. /* encode start element EnergyProvider */
  1545. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1546. {
  1547. return -1;
  1548. }
  1549. service->val.type = STRING;
  1550. service->val.string.len = type->EnergyProvider.arraylen.data;
  1551. memcpy(service->val.string.codepoints, type->EnergyProvider.data, service->val.string.len);
  1552. /* encode character EnergyProvider */
  1553. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1554. {
  1555. return -1;
  1556. }
  1557. /* element ID assignment of EnergyProvider*/
  1558. service->eqn.namespaceURI=4;
  1559. service->eqn.localPart=9;
  1560. /* encode end element of EnergyProvider */
  1561. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1562. {
  1563. return -1;
  1564. }}
  1565. if(type->isused.TariffTable)
  1566. {
  1567. /* element ID assignment of TariffTable*/
  1568. service->eqn.namespaceURI=4;
  1569. service->eqn.localPart=65;
  1570. /* encode start element TariffTable */
  1571. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1572. {
  1573. return -1;
  1574. }
  1575. /* encode children of TariffTable */
  1576. if(serialize_TariffTableType(&(type->TariffTable),service)<0)
  1577. {
  1578. return -1;
  1579. }
  1580. /* element ID assignment of TariffTable*/
  1581. service->eqn.namespaceURI=4;
  1582. service->eqn.localPart=65;
  1583. /* encode end element of TariffTable */
  1584. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1585. {
  1586. return -1;
  1587. }}
  1588. return 0;
  1589. }
  1590. static int serialize_LineLockReqType(struct LineLockReqType* type, struct v2gService* service)
  1591. {
  1592. /* element ID assignment of PEVStatus*/
  1593. service->eqn.namespaceURI=4;
  1594. service->eqn.localPart=32;
  1595. /* encode start element PEVStatus */
  1596. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1597. {
  1598. return -1;
  1599. }
  1600. /* encode children of PEVStatus */
  1601. if(serialize_PEVStatusType(&(type->PEVStatus),service)<0)
  1602. {
  1603. return -1;
  1604. }
  1605. /* element ID assignment of PEVStatus*/
  1606. service->eqn.namespaceURI=4;
  1607. service->eqn.localPart=32;
  1608. /* encode end element of PEVStatus */
  1609. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1610. {
  1611. return -1;
  1612. }
  1613. /* element ID assignment of ReqLockStatus*/
  1614. service->eqn.namespaceURI=4;
  1615. service->eqn.localPart=45;
  1616. /* encode start element ReqLockStatus */
  1617. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1618. {
  1619. return -1;
  1620. }
  1621. service->val.type = BOOLEAN;
  1622. service->val.boolean=service->v2gMsg.Body.LineLockReq.ReqLockStatus;
  1623. /* encode character ReqLockStatus */
  1624. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1625. {
  1626. return -1;
  1627. }
  1628. /* element ID assignment of ReqLockStatus*/
  1629. service->eqn.namespaceURI=4;
  1630. service->eqn.localPart=45;
  1631. /* encode end element of ReqLockStatus */
  1632. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1633. {
  1634. return -1;
  1635. }
  1636. return 0;
  1637. }
  1638. static int serialize_LineLockResType(struct LineLockResType* type, struct v2gService* service)
  1639. {
  1640. /* element ID assignment of ResponseCode*/
  1641. service->eqn.namespaceURI=4;
  1642. service->eqn.localPart=47;
  1643. /* encode start element ResponseCode */
  1644. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1645. {
  1646. return -1;
  1647. }
  1648. service->val.type = ENUMERATION;
  1649. service->val.enumeration=service->v2gMsg.Body.LineLockRes.ResponseCode;
  1650. /* encode character ResponseCode */
  1651. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1652. {
  1653. return -1;
  1654. }
  1655. /* element ID assignment of ResponseCode*/
  1656. service->eqn.namespaceURI=4;
  1657. service->eqn.localPart=47;
  1658. /* encode end element of ResponseCode */
  1659. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1660. {
  1661. return -1;
  1662. }
  1663. /* element ID assignment of EVSEStatus*/
  1664. service->eqn.namespaceURI=4;
  1665. service->eqn.localPart=7;
  1666. /* encode start element EVSEStatus */
  1667. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1668. {
  1669. return -1;
  1670. }
  1671. /* encode children of EVSEStatus */
  1672. if(serialize_EVSEStatusType(&(type->EVSEStatus),service)<0)
  1673. {
  1674. return -1;
  1675. }
  1676. /* element ID assignment of EVSEStatus*/
  1677. service->eqn.namespaceURI=4;
  1678. service->eqn.localPart=7;
  1679. /* encode end element of EVSEStatus */
  1680. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1681. {
  1682. return -1;
  1683. }
  1684. return 0;
  1685. }
  1686. static int serialize_ChargingProfileType(struct ChargingProfileType* type, struct v2gService* service)
  1687. {
  1688. /* element ID assignment of ChargingProfileEntryStart*/
  1689. service->eqn.namespaceURI=5;
  1690. service->eqn.localPart=2;
  1691. /* encode start element ChargingProfileEntryStart */
  1692. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1693. {
  1694. return -1;
  1695. }
  1696. service->val.type = INTEGER_64;
  1697. service->val.int64=service->v2gMsg.Body.PowerDeliveryReq.ChargingProfile.ChargingProfileEntryStart;
  1698. /* encode character ChargingProfileEntryStart */
  1699. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1700. {
  1701. return -1;
  1702. }
  1703. /* element ID assignment of ChargingProfileEntryStart*/
  1704. service->eqn.namespaceURI=5;
  1705. service->eqn.localPart=2;
  1706. /* encode end element of ChargingProfileEntryStart */
  1707. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1708. {
  1709. return -1;
  1710. }
  1711. /* element ID assignment of ChargingProfileEntryMaxPower*/
  1712. service->eqn.namespaceURI=5;
  1713. service->eqn.localPart=1;
  1714. /* encode start element ChargingProfileEntryMaxPower */
  1715. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1716. {
  1717. return -1;
  1718. }
  1719. /* encode children of ChargingProfileEntryMaxPower */
  1720. if(serialize_FloatingValueType(&(type->ChargingProfileEntryMaxPower),service)<0)
  1721. {
  1722. return -1;
  1723. }
  1724. /* element ID assignment of ChargingProfileEntryMaxPower*/
  1725. service->eqn.namespaceURI=5;
  1726. service->eqn.localPart=1;
  1727. /* encode end element of ChargingProfileEntryMaxPower */
  1728. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1729. {
  1730. return -1;
  1731. }
  1732. return 0;
  1733. }
  1734. static int serialize_PowerDeliveryReqType(struct PowerDeliveryReqType* type, struct v2gService* service)
  1735. {
  1736. /* element ID assignment of PEVStatus*/
  1737. service->eqn.namespaceURI=4;
  1738. service->eqn.localPart=32;
  1739. /* encode start element PEVStatus */
  1740. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1741. {
  1742. return -1;
  1743. }
  1744. /* encode children of PEVStatus */
  1745. if(serialize_PEVStatusType(&(type->PEVStatus),service)<0)
  1746. {
  1747. return -1;
  1748. }
  1749. /* element ID assignment of PEVStatus*/
  1750. service->eqn.namespaceURI=4;
  1751. service->eqn.localPart=32;
  1752. /* encode end element of PEVStatus */
  1753. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1754. {
  1755. return -1;
  1756. }
  1757. /* element ID assignment of ReqSwitchStatus*/
  1758. service->eqn.namespaceURI=4;
  1759. service->eqn.localPart=46;
  1760. /* encode start element ReqSwitchStatus */
  1761. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1762. {
  1763. return -1;
  1764. }
  1765. service->val.type = BOOLEAN;
  1766. service->val.boolean=service->v2gMsg.Body.PowerDeliveryReq.ReqSwitchStatus;
  1767. /* encode character ReqSwitchStatus */
  1768. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1769. {
  1770. return -1;
  1771. }
  1772. /* element ID assignment of ReqSwitchStatus*/
  1773. service->eqn.namespaceURI=4;
  1774. service->eqn.localPart=46;
  1775. /* encode end element of ReqSwitchStatus */
  1776. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1777. {
  1778. return -1;
  1779. }if(type->isused.Tariff)
  1780. {
  1781. /* element ID assignment of Tariff*/
  1782. service->eqn.namespaceURI=4;
  1783. service->eqn.localPart=64;
  1784. /* encode start element Tariff */
  1785. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1786. {
  1787. return -1;
  1788. }
  1789. service->val.type = ENUMERATION;
  1790. service->val.enumeration=service->v2gMsg.Body.PowerDeliveryReq.Tariff;
  1791. /* encode character Tariff */
  1792. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1793. {
  1794. return -1;
  1795. }
  1796. /* element ID assignment of Tariff*/
  1797. service->eqn.namespaceURI=4;
  1798. service->eqn.localPart=64;
  1799. /* encode end element of Tariff */
  1800. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1801. {
  1802. return -1;
  1803. }}
  1804. if(type->isused.ChargingProfile)
  1805. {
  1806. /* element ID assignment of ChargingProfile*/
  1807. service->eqn.namespaceURI=4;
  1808. service->eqn.localPart=0;
  1809. /* encode start element ChargingProfile */
  1810. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1811. {
  1812. return -1;
  1813. }
  1814. /* encode children of ChargingProfile */
  1815. if(serialize_ChargingProfileType(&(type->ChargingProfile),service)<0)
  1816. {
  1817. return -1;
  1818. }
  1819. /* element ID assignment of ChargingProfile*/
  1820. service->eqn.namespaceURI=4;
  1821. service->eqn.localPart=0;
  1822. /* encode end element of ChargingProfile */
  1823. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1824. {
  1825. return -1;
  1826. }}
  1827. return 0;
  1828. }
  1829. static int serialize_PowerDeliveryResType(struct PowerDeliveryResType* type, struct v2gService* service)
  1830. {
  1831. /* element ID assignment of ResponseCode*/
  1832. service->eqn.namespaceURI=4;
  1833. service->eqn.localPart=47;
  1834. /* encode start element ResponseCode */
  1835. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1836. {
  1837. return -1;
  1838. }
  1839. service->val.type = ENUMERATION;
  1840. service->val.enumeration=service->v2gMsg.Body.PowerDeliveryRes.ResponseCode;
  1841. /* encode character ResponseCode */
  1842. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1843. {
  1844. return -1;
  1845. }
  1846. /* element ID assignment of ResponseCode*/
  1847. service->eqn.namespaceURI=4;
  1848. service->eqn.localPart=47;
  1849. /* encode end element of ResponseCode */
  1850. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1851. {
  1852. return -1;
  1853. }
  1854. return 0;
  1855. }
  1856. static int serialize_MeteringStatusReqType(struct MeteringStatusReqType* type, struct v2gService* service)
  1857. {
  1858. return 0;
  1859. }
  1860. static int serialize_MeterInfoType(struct MeterInfoType* type, struct v2gService* service)
  1861. {if(type->isused.MeterID)
  1862. {
  1863. /* element ID assignment of MeterID*/
  1864. service->eqn.namespaceURI=5;
  1865. service->eqn.localPart=16;
  1866. /* encode start element MeterID */
  1867. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1868. {
  1869. return -1;
  1870. }
  1871. service->val.type = STRING;
  1872. service->val.string.len = type->MeterID.arraylen.data;
  1873. memcpy(service->val.string.codepoints, type->MeterID.data, service->val.string.len);
  1874. /* encode character MeterID */
  1875. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1876. {
  1877. return -1;
  1878. }
  1879. /* element ID assignment of MeterID*/
  1880. service->eqn.namespaceURI=5;
  1881. service->eqn.localPart=16;
  1882. /* encode end element of MeterID */
  1883. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1884. {
  1885. return -1;
  1886. }}
  1887. if(type->isused.MeterPubKey)
  1888. {
  1889. /* element ID assignment of MeterPubKey*/
  1890. service->eqn.namespaceURI=5;
  1891. service->eqn.localPart=18;
  1892. /* encode start element MeterPubKey */
  1893. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1894. {
  1895. return -1;
  1896. }
  1897. service->val.type = BINARY_HEX;
  1898. service->val.binary.len = type->MeterPubKey.arraylen.data;
  1899. memcpy(service->val.binary.data, type->MeterPubKey.data, service->val.binary.len);
  1900. /* encode character MeterPubKey */
  1901. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1902. {
  1903. return -1;
  1904. }
  1905. /* element ID assignment of MeterPubKey*/
  1906. service->eqn.namespaceURI=5;
  1907. service->eqn.localPart=18;
  1908. /* encode end element of MeterPubKey */
  1909. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1910. {
  1911. return -1;
  1912. }}
  1913. if(type->isused.MeterReading)
  1914. {
  1915. /* element ID assignment of MeterReading*/
  1916. service->eqn.namespaceURI=5;
  1917. service->eqn.localPart=19;
  1918. /* encode start element MeterReading */
  1919. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1920. {
  1921. return -1;
  1922. }
  1923. /* encode children of MeterReading */
  1924. if(serialize_FloatingValueType(&(type->MeterReading),service)<0)
  1925. {
  1926. return -1;
  1927. }
  1928. /* element ID assignment of MeterReading*/
  1929. service->eqn.namespaceURI=5;
  1930. service->eqn.localPart=19;
  1931. /* encode end element of MeterReading */
  1932. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1933. {
  1934. return -1;
  1935. }}
  1936. if(type->isused.MeterStatus)
  1937. {
  1938. /* element ID assignment of MeterStatus*/
  1939. service->eqn.namespaceURI=5;
  1940. service->eqn.localPart=20;
  1941. /* encode start element MeterStatus */
  1942. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1943. {
  1944. return -1;
  1945. }
  1946. service->val.type = INTEGER_16;
  1947. service->val.int32=service->v2gMsg.Body.MeteringStatusRes.MeterInfo.MeterStatus;
  1948. /* encode character MeterStatus */
  1949. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1950. {
  1951. return -1;
  1952. }
  1953. /* element ID assignment of MeterStatus*/
  1954. service->eqn.namespaceURI=5;
  1955. service->eqn.localPart=20;
  1956. /* encode end element of MeterStatus */
  1957. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1958. {
  1959. return -1;
  1960. }}
  1961. if(type->isused.TMeter)
  1962. {
  1963. /* element ID assignment of TMeter*/
  1964. service->eqn.namespaceURI=5;
  1965. service->eqn.localPart=38;
  1966. /* encode start element TMeter */
  1967. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1968. {
  1969. return -1;
  1970. }
  1971. service->val.type = INTEGER_64;
  1972. service->val.int64=service->v2gMsg.Body.MeteringStatusRes.MeterInfo.TMeter;
  1973. /* encode character TMeter */
  1974. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  1975. {
  1976. return -1;
  1977. }
  1978. /* element ID assignment of TMeter*/
  1979. service->eqn.namespaceURI=5;
  1980. service->eqn.localPart=38;
  1981. /* encode end element of TMeter */
  1982. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1983. {
  1984. return -1;
  1985. }}
  1986. return 0;
  1987. }
  1988. static int serialize_MeteringStatusResType(struct MeteringStatusResType* type, struct v2gService* service)
  1989. {
  1990. /* element ID assignment of ResponseCode*/
  1991. service->eqn.namespaceURI=4;
  1992. service->eqn.localPart=47;
  1993. /* encode start element ResponseCode */
  1994. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  1995. {
  1996. return -1;
  1997. }
  1998. service->val.type = ENUMERATION;
  1999. service->val.enumeration=service->v2gMsg.Body.MeteringStatusRes.ResponseCode;
  2000. /* encode character ResponseCode */
  2001. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  2002. {
  2003. return -1;
  2004. }
  2005. /* element ID assignment of ResponseCode*/
  2006. service->eqn.namespaceURI=4;
  2007. service->eqn.localPart=47;
  2008. /* encode end element of ResponseCode */
  2009. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2010. {
  2011. return -1;
  2012. }
  2013. /* element ID assignment of EVSEID*/
  2014. service->eqn.namespaceURI=4;
  2015. service->eqn.localPart=3;
  2016. /* encode start element EVSEID */
  2017. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2018. {
  2019. return -1;
  2020. }
  2021. service->val.type = BINARY_HEX;
  2022. service->val.binary.len = type->EVSEID.arraylen.data;
  2023. memcpy(service->val.binary.data, type->EVSEID.data, service->val.binary.len);
  2024. /* encode character EVSEID */
  2025. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  2026. {
  2027. return -1;
  2028. }
  2029. /* element ID assignment of EVSEID*/
  2030. service->eqn.namespaceURI=4;
  2031. service->eqn.localPart=3;
  2032. /* encode end element of EVSEID */
  2033. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2034. {
  2035. return -1;
  2036. }
  2037. /* element ID assignment of EVSEStatus*/
  2038. service->eqn.namespaceURI=4;
  2039. service->eqn.localPart=7;
  2040. /* encode start element EVSEStatus */
  2041. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2042. {
  2043. return -1;
  2044. }
  2045. /* encode children of EVSEStatus */
  2046. if(serialize_EVSEStatusType(&(type->EVSEStatus),service)<0)
  2047. {
  2048. return -1;
  2049. }
  2050. /* element ID assignment of EVSEStatus*/
  2051. service->eqn.namespaceURI=4;
  2052. service->eqn.localPart=7;
  2053. /* encode end element of EVSEStatus */
  2054. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2055. {
  2056. return -1;
  2057. }
  2058. /* element ID assignment of TCurrent*/
  2059. service->eqn.namespaceURI=4;
  2060. service->eqn.localPart=63;
  2061. /* encode start element TCurrent */
  2062. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2063. {
  2064. return -1;
  2065. }
  2066. service->val.type = INTEGER_64;
  2067. service->val.int64=service->v2gMsg.Body.MeteringStatusRes.TCurrent;
  2068. /* encode character TCurrent */
  2069. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  2070. {
  2071. return -1;
  2072. }
  2073. /* element ID assignment of TCurrent*/
  2074. service->eqn.namespaceURI=4;
  2075. service->eqn.localPart=63;
  2076. /* encode end element of TCurrent */
  2077. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2078. {
  2079. return -1;
  2080. }
  2081. /* element ID assignment of EVSEMaxPower*/
  2082. service->eqn.namespaceURI=4;
  2083. service->eqn.localPart=6;
  2084. /* encode start element EVSEMaxPower */
  2085. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2086. {
  2087. return -1;
  2088. }
  2089. /* encode children of EVSEMaxPower */
  2090. if(serialize_FloatingValueType(&(type->EVSEMaxPower),service)<0)
  2091. {
  2092. return -1;
  2093. }
  2094. /* element ID assignment of EVSEMaxPower*/
  2095. service->eqn.namespaceURI=4;
  2096. service->eqn.localPart=6;
  2097. /* encode end element of EVSEMaxPower */
  2098. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2099. {
  2100. return -1;
  2101. }if(type->isused.PCurrent)
  2102. {
  2103. /* element ID assignment of PCurrent*/
  2104. service->eqn.namespaceURI=4;
  2105. service->eqn.localPart=25;
  2106. /* encode start element PCurrent */
  2107. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2108. {
  2109. return -1;
  2110. }
  2111. /* encode children of PCurrent */
  2112. if(serialize_FloatingValueType(&(type->PCurrent),service)<0)
  2113. {
  2114. return -1;
  2115. }
  2116. /* element ID assignment of PCurrent*/
  2117. service->eqn.namespaceURI=4;
  2118. service->eqn.localPart=25;
  2119. /* encode end element of PCurrent */
  2120. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2121. {
  2122. return -1;
  2123. }}
  2124. if(type->isused.MeterInfo)
  2125. {
  2126. /* element ID assignment of MeterInfo*/
  2127. service->eqn.namespaceURI=4;
  2128. service->eqn.localPart=15;
  2129. /* encode start element MeterInfo */
  2130. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2131. {
  2132. return -1;
  2133. }
  2134. /* encode children of MeterInfo */
  2135. if(serialize_MeterInfoType(&(type->MeterInfo),service)<0)
  2136. {
  2137. return -1;
  2138. }
  2139. /* element ID assignment of MeterInfo*/
  2140. service->eqn.namespaceURI=4;
  2141. service->eqn.localPart=15;
  2142. /* encode end element of MeterInfo */
  2143. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2144. {
  2145. return -1;
  2146. }}
  2147. return 0;
  2148. }
  2149. static int serialize_MeteringReceiptReqType(struct MeteringReceiptReqType* type, struct v2gService* service)
  2150. {if(type->isused.PEVID)
  2151. {
  2152. /* element ID assignment of PEVID*/
  2153. service->eqn.namespaceURI=4;
  2154. service->eqn.localPart=26;
  2155. /* encode start element PEVID */
  2156. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2157. {
  2158. return -1;
  2159. }
  2160. service->val.type = STRING;
  2161. service->val.string.len = type->PEVID.arraylen.data;
  2162. memcpy(service->val.string.codepoints, type->PEVID.data, service->val.string.len);
  2163. /* encode character PEVID */
  2164. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  2165. {
  2166. return -1;
  2167. }
  2168. /* element ID assignment of PEVID*/
  2169. service->eqn.namespaceURI=4;
  2170. service->eqn.localPart=26;
  2171. /* encode end element of PEVID */
  2172. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2173. {
  2174. return -1;
  2175. }}
  2176. /* element ID assignment of PEVStatus*/
  2177. service->eqn.namespaceURI=4;
  2178. service->eqn.localPart=32;
  2179. /* encode start element PEVStatus */
  2180. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2181. {
  2182. return -1;
  2183. }
  2184. /* encode children of PEVStatus */
  2185. if(serialize_PEVStatusType(&(type->PEVStatus),service)<0)
  2186. {
  2187. return -1;
  2188. }
  2189. /* element ID assignment of PEVStatus*/
  2190. service->eqn.namespaceURI=4;
  2191. service->eqn.localPart=32;
  2192. /* encode end element of PEVStatus */
  2193. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2194. {
  2195. return -1;
  2196. }if(type->isused.TCurrent)
  2197. {
  2198. /* element ID assignment of TCurrent*/
  2199. service->eqn.namespaceURI=4;
  2200. service->eqn.localPart=63;
  2201. /* encode start element TCurrent */
  2202. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2203. {
  2204. return -1;
  2205. }
  2206. service->val.type = INTEGER_64;
  2207. service->val.int64=service->v2gMsg.Body.MeteringReceiptReq.TCurrent;
  2208. /* encode character TCurrent */
  2209. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  2210. {
  2211. return -1;
  2212. }
  2213. /* element ID assignment of TCurrent*/
  2214. service->eqn.namespaceURI=4;
  2215. service->eqn.localPart=63;
  2216. /* encode end element of TCurrent */
  2217. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2218. {
  2219. return -1;
  2220. }}
  2221. /* element ID assignment of Tariff*/
  2222. service->eqn.namespaceURI=4;
  2223. service->eqn.localPart=64;
  2224. /* encode start element Tariff */
  2225. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2226. {
  2227. return -1;
  2228. }
  2229. service->val.type = ENUMERATION;
  2230. service->val.enumeration=service->v2gMsg.Body.MeteringReceiptReq.Tariff;
  2231. /* encode character Tariff */
  2232. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  2233. {
  2234. return -1;
  2235. }
  2236. /* element ID assignment of Tariff*/
  2237. service->eqn.namespaceURI=4;
  2238. service->eqn.localPart=64;
  2239. /* encode end element of Tariff */
  2240. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2241. {
  2242. return -1;
  2243. }
  2244. /* element ID assignment of MeterInfo*/
  2245. service->eqn.namespaceURI=4;
  2246. service->eqn.localPart=15;
  2247. /* encode start element MeterInfo */
  2248. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2249. {
  2250. return -1;
  2251. }
  2252. /* encode children of MeterInfo */
  2253. if(serialize_MeterInfoType(&(type->MeterInfo),service)<0)
  2254. {
  2255. return -1;
  2256. }
  2257. /* element ID assignment of MeterInfo*/
  2258. service->eqn.namespaceURI=4;
  2259. service->eqn.localPart=15;
  2260. /* encode end element of MeterInfo */
  2261. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2262. {
  2263. return -1;
  2264. }
  2265. return 0;
  2266. }
  2267. static int serialize_MeteringReceiptResType(struct MeteringReceiptResType* type, struct v2gService* service)
  2268. {
  2269. /* element ID assignment of ResponseCode*/
  2270. service->eqn.namespaceURI=4;
  2271. service->eqn.localPart=47;
  2272. /* encode start element ResponseCode */
  2273. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2274. {
  2275. return -1;
  2276. }
  2277. service->val.type = ENUMERATION;
  2278. service->val.enumeration=service->v2gMsg.Body.MeteringReceiptRes.ResponseCode;
  2279. /* encode character ResponseCode */
  2280. if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)) < 0)
  2281. {
  2282. return -1;
  2283. }
  2284. /* element ID assignment of ResponseCode*/
  2285. service->eqn.namespaceURI=4;
  2286. service->eqn.localPart=47;
  2287. /* encode end element of ResponseCode */
  2288. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2289. {
  2290. return -1;
  2291. }
  2292. return 0;
  2293. }
  2294. static int serialize_BodyType(struct BodyType* type, struct v2gService* service)
  2295. {if(type->isused.SessionSetupReq)
  2296. {
  2297. /* element ID assignment of SessionSetupReq*/
  2298. service->eqn.namespaceURI=4;
  2299. service->eqn.localPart=59;
  2300. /* encode start element SessionSetupReq */
  2301. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2302. {
  2303. return -1;
  2304. }
  2305. /* encode children of SessionSetupReq */
  2306. if(serialize_SessionSetupReqType(&(type->SessionSetupReq),service)<0)
  2307. {
  2308. return -1;
  2309. }
  2310. /* element ID assignment of SessionSetupReq*/
  2311. service->eqn.namespaceURI=4;
  2312. service->eqn.localPart=59;
  2313. /* encode end element of SessionSetupReq */
  2314. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2315. {
  2316. return -1;
  2317. }}
  2318. if(type->isused.SessionSetupRes)
  2319. {
  2320. /* element ID assignment of SessionSetupRes*/
  2321. service->eqn.namespaceURI=4;
  2322. service->eqn.localPart=61;
  2323. /* encode start element SessionSetupRes */
  2324. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2325. {
  2326. return -1;
  2327. }
  2328. /* encode children of SessionSetupRes */
  2329. if(serialize_SessionSetupResType(&(type->SessionSetupRes),service)<0)
  2330. {
  2331. return -1;
  2332. }
  2333. /* element ID assignment of SessionSetupRes*/
  2334. service->eqn.namespaceURI=4;
  2335. service->eqn.localPart=61;
  2336. /* encode end element of SessionSetupRes */
  2337. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2338. {
  2339. return -1;
  2340. }}
  2341. if(type->isused.ServiceDiscoveryReq)
  2342. {
  2343. /* element ID assignment of ServiceDiscoveryReq*/
  2344. service->eqn.namespaceURI=4;
  2345. service->eqn.localPart=48;
  2346. /* encode start element ServiceDiscoveryReq */
  2347. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2348. {
  2349. return -1;
  2350. }
  2351. /* encode children of ServiceDiscoveryReq */
  2352. if(serialize_ServiceDiscoveryReqType(&(type->ServiceDiscoveryReq),service)<0)
  2353. {
  2354. return -1;
  2355. }
  2356. /* element ID assignment of ServiceDiscoveryReq*/
  2357. service->eqn.namespaceURI=4;
  2358. service->eqn.localPart=48;
  2359. /* encode end element of ServiceDiscoveryReq */
  2360. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2361. {
  2362. return -1;
  2363. }}
  2364. if(type->isused.ServiceDiscoveryRes)
  2365. {
  2366. /* element ID assignment of ServiceDiscoveryRes*/
  2367. service->eqn.namespaceURI=4;
  2368. service->eqn.localPart=50;
  2369. /* encode start element ServiceDiscoveryRes */
  2370. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2371. {
  2372. return -1;
  2373. }
  2374. /* encode children of ServiceDiscoveryRes */
  2375. if(serialize_ServiceDiscoveryResType(&(type->ServiceDiscoveryRes),service)<0)
  2376. {
  2377. return -1;
  2378. }
  2379. /* element ID assignment of ServiceDiscoveryRes*/
  2380. service->eqn.namespaceURI=4;
  2381. service->eqn.localPart=50;
  2382. /* encode end element of ServiceDiscoveryRes */
  2383. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2384. {
  2385. return -1;
  2386. }}
  2387. if(type->isused.ServicePaymentSelectionReq)
  2388. {
  2389. /* element ID assignment of ServicePaymentSelectionReq*/
  2390. service->eqn.namespaceURI=4;
  2391. service->eqn.localPart=53;
  2392. /* encode start element ServicePaymentSelectionReq */
  2393. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2394. {
  2395. return -1;
  2396. }
  2397. /* encode children of ServicePaymentSelectionReq */
  2398. if(serialize_ServicePaymentSelectionReqType(&(type->ServicePaymentSelectionReq),service)<0)
  2399. {
  2400. return -1;
  2401. }
  2402. /* element ID assignment of ServicePaymentSelectionReq*/
  2403. service->eqn.namespaceURI=4;
  2404. service->eqn.localPart=53;
  2405. /* encode end element of ServicePaymentSelectionReq */
  2406. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2407. {
  2408. return -1;
  2409. }}
  2410. if(type->isused.ServicePaymentSelectionRes)
  2411. {
  2412. /* element ID assignment of ServicePaymentSelectionRes*/
  2413. service->eqn.namespaceURI=4;
  2414. service->eqn.localPart=55;
  2415. /* encode start element ServicePaymentSelectionRes */
  2416. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2417. {
  2418. return -1;
  2419. }
  2420. /* encode children of ServicePaymentSelectionRes */
  2421. if(serialize_ServicePaymentSelectionResType(&(type->ServicePaymentSelectionRes),service)<0)
  2422. {
  2423. return -1;
  2424. }
  2425. /* element ID assignment of ServicePaymentSelectionRes*/
  2426. service->eqn.namespaceURI=4;
  2427. service->eqn.localPart=55;
  2428. /* encode end element of ServicePaymentSelectionRes */
  2429. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2430. {
  2431. return -1;
  2432. }}
  2433. if(type->isused.PaymentDetailsReq)
  2434. {
  2435. /* element ID assignment of PaymentDetailsReq*/
  2436. service->eqn.namespaceURI=4;
  2437. service->eqn.localPart=33;
  2438. /* encode start element PaymentDetailsReq */
  2439. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2440. {
  2441. return -1;
  2442. }
  2443. /* encode children of PaymentDetailsReq */
  2444. if(serialize_PaymentDetailsReqType(&(type->PaymentDetailsReq),service)<0)
  2445. {
  2446. return -1;
  2447. }
  2448. /* element ID assignment of PaymentDetailsReq*/
  2449. service->eqn.namespaceURI=4;
  2450. service->eqn.localPart=33;
  2451. /* encode end element of PaymentDetailsReq */
  2452. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2453. {
  2454. return -1;
  2455. }}
  2456. if(type->isused.PaymentDetailsRes)
  2457. {
  2458. /* element ID assignment of PaymentDetailsRes*/
  2459. service->eqn.namespaceURI=4;
  2460. service->eqn.localPart=35;
  2461. /* encode start element PaymentDetailsRes */
  2462. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2463. {
  2464. return -1;
  2465. }
  2466. /* encode children of PaymentDetailsRes */
  2467. if(serialize_PaymentDetailsResType(&(type->PaymentDetailsRes),service)<0)
  2468. {
  2469. return -1;
  2470. }
  2471. /* element ID assignment of PaymentDetailsRes*/
  2472. service->eqn.namespaceURI=4;
  2473. service->eqn.localPart=35;
  2474. /* encode end element of PaymentDetailsRes */
  2475. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2476. {
  2477. return -1;
  2478. }}
  2479. if(type->isused.PowerDiscoveryReq)
  2480. {
  2481. /* element ID assignment of PowerDiscoveryReq*/
  2482. service->eqn.namespaceURI=4;
  2483. service->eqn.localPart=41;
  2484. /* encode start element PowerDiscoveryReq */
  2485. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2486. {
  2487. return -1;
  2488. }
  2489. /* encode children of PowerDiscoveryReq */
  2490. if(serialize_PowerDiscoveryReqType(&(type->PowerDiscoveryReq),service)<0)
  2491. {
  2492. return -1;
  2493. }
  2494. /* element ID assignment of PowerDiscoveryReq*/
  2495. service->eqn.namespaceURI=4;
  2496. service->eqn.localPart=41;
  2497. /* encode end element of PowerDiscoveryReq */
  2498. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2499. {
  2500. return -1;
  2501. }}
  2502. if(type->isused.PowerDiscoveryRes)
  2503. {
  2504. /* element ID assignment of PowerDiscoveryRes*/
  2505. service->eqn.namespaceURI=4;
  2506. service->eqn.localPart=43;
  2507. /* encode start element PowerDiscoveryRes */
  2508. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2509. {
  2510. return -1;
  2511. }
  2512. /* encode children of PowerDiscoveryRes */
  2513. if(serialize_PowerDiscoveryResType(&(type->PowerDiscoveryRes),service)<0)
  2514. {
  2515. return -1;
  2516. }
  2517. /* element ID assignment of PowerDiscoveryRes*/
  2518. service->eqn.namespaceURI=4;
  2519. service->eqn.localPart=43;
  2520. /* encode end element of PowerDiscoveryRes */
  2521. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2522. {
  2523. return -1;
  2524. }}
  2525. if(type->isused.LineLockReq)
  2526. {
  2527. /* element ID assignment of LineLockReq*/
  2528. service->eqn.namespaceURI=4;
  2529. service->eqn.localPart=11;
  2530. /* encode start element LineLockReq */
  2531. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2532. {
  2533. return -1;
  2534. }
  2535. /* encode children of LineLockReq */
  2536. if(serialize_LineLockReqType(&(type->LineLockReq),service)<0)
  2537. {
  2538. return -1;
  2539. }
  2540. /* element ID assignment of LineLockReq*/
  2541. service->eqn.namespaceURI=4;
  2542. service->eqn.localPart=11;
  2543. /* encode end element of LineLockReq */
  2544. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2545. {
  2546. return -1;
  2547. }}
  2548. if(type->isused.LineLockRes)
  2549. {
  2550. /* element ID assignment of LineLockRes*/
  2551. service->eqn.namespaceURI=4;
  2552. service->eqn.localPart=13;
  2553. /* encode start element LineLockRes */
  2554. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2555. {
  2556. return -1;
  2557. }
  2558. /* encode children of LineLockRes */
  2559. if(serialize_LineLockResType(&(type->LineLockRes),service)<0)
  2560. {
  2561. return -1;
  2562. }
  2563. /* element ID assignment of LineLockRes*/
  2564. service->eqn.namespaceURI=4;
  2565. service->eqn.localPart=13;
  2566. /* encode end element of LineLockRes */
  2567. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2568. {
  2569. return -1;
  2570. }}
  2571. if(type->isused.PowerDeliveryReq)
  2572. {
  2573. /* element ID assignment of PowerDeliveryReq*/
  2574. service->eqn.namespaceURI=4;
  2575. service->eqn.localPart=37;
  2576. /* encode start element PowerDeliveryReq */
  2577. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2578. {
  2579. return -1;
  2580. }
  2581. /* encode children of PowerDeliveryReq */
  2582. if(serialize_PowerDeliveryReqType(&(type->PowerDeliveryReq),service)<0)
  2583. {
  2584. return -1;
  2585. }
  2586. /* element ID assignment of PowerDeliveryReq*/
  2587. service->eqn.namespaceURI=4;
  2588. service->eqn.localPart=37;
  2589. /* encode end element of PowerDeliveryReq */
  2590. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2591. {
  2592. return -1;
  2593. }}
  2594. if(type->isused.PowerDeliveryRes)
  2595. {
  2596. /* element ID assignment of PowerDeliveryRes*/
  2597. service->eqn.namespaceURI=4;
  2598. service->eqn.localPart=39;
  2599. /* encode start element PowerDeliveryRes */
  2600. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2601. {
  2602. return -1;
  2603. }
  2604. /* encode children of PowerDeliveryRes */
  2605. if(serialize_PowerDeliveryResType(&(type->PowerDeliveryRes),service)<0)
  2606. {
  2607. return -1;
  2608. }
  2609. /* element ID assignment of PowerDeliveryRes*/
  2610. service->eqn.namespaceURI=4;
  2611. service->eqn.localPart=39;
  2612. /* encode end element of PowerDeliveryRes */
  2613. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2614. {
  2615. return -1;
  2616. }}
  2617. if(type->isused.MeteringStatusReq)
  2618. {
  2619. /* element ID assignment of MeteringStatusReq*/
  2620. service->eqn.namespaceURI=4;
  2621. service->eqn.localPart=21;
  2622. /* encode start element MeteringStatusReq */
  2623. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2624. {
  2625. return -1;
  2626. }
  2627. /* encode children of MeteringStatusReq */
  2628. if(serialize_MeteringStatusReqType(&(type->MeteringStatusReq),service)<0)
  2629. {
  2630. return -1;
  2631. }
  2632. /* element ID assignment of MeteringStatusReq*/
  2633. service->eqn.namespaceURI=4;
  2634. service->eqn.localPart=21;
  2635. /* encode end element of MeteringStatusReq */
  2636. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2637. {
  2638. return -1;
  2639. }}
  2640. if(type->isused.MeteringStatusRes)
  2641. {
  2642. /* element ID assignment of MeteringStatusRes*/
  2643. service->eqn.namespaceURI=4;
  2644. service->eqn.localPart=23;
  2645. /* encode start element MeteringStatusRes */
  2646. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2647. {
  2648. return -1;
  2649. }
  2650. /* encode children of MeteringStatusRes */
  2651. if(serialize_MeteringStatusResType(&(type->MeteringStatusRes),service)<0)
  2652. {
  2653. return -1;
  2654. }
  2655. /* element ID assignment of MeteringStatusRes*/
  2656. service->eqn.namespaceURI=4;
  2657. service->eqn.localPart=23;
  2658. /* encode end element of MeteringStatusRes */
  2659. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2660. {
  2661. return -1;
  2662. }}
  2663. if(type->isused.MeteringReceiptReq)
  2664. {
  2665. /* element ID assignment of MeteringReceiptReq*/
  2666. service->eqn.namespaceURI=4;
  2667. service->eqn.localPart=17;
  2668. /* encode start element MeteringReceiptReq */
  2669. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2670. {
  2671. return -1;
  2672. }
  2673. /* encode children of MeteringReceiptReq */
  2674. if(serialize_MeteringReceiptReqType(&(type->MeteringReceiptReq),service)<0)
  2675. {
  2676. return -1;
  2677. }
  2678. /* element ID assignment of MeteringReceiptReq*/
  2679. service->eqn.namespaceURI=4;
  2680. service->eqn.localPart=17;
  2681. /* encode end element of MeteringReceiptReq */
  2682. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2683. {
  2684. return -1;
  2685. }}
  2686. if(type->isused.MeteringReceiptRes)
  2687. {
  2688. /* element ID assignment of MeteringReceiptRes*/
  2689. service->eqn.namespaceURI=4;
  2690. service->eqn.localPart=19;
  2691. /* encode start element MeteringReceiptRes */
  2692. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2693. {
  2694. return -1;
  2695. }
  2696. /* encode children of MeteringReceiptRes */
  2697. if(serialize_MeteringReceiptResType(&(type->MeteringReceiptRes),service)<0)
  2698. {
  2699. return -1;
  2700. }
  2701. /* element ID assignment of MeteringReceiptRes*/
  2702. service->eqn.namespaceURI=4;
  2703. service->eqn.localPart=19;
  2704. /* encode end element of MeteringReceiptRes */
  2705. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2706. {
  2707. return -1;
  2708. }}
  2709. return 0;
  2710. }
  2711. static int serialize_AnonType_V2G_Message(struct AnonType_V2G_Message* type, struct v2gService* service)
  2712. {
  2713. /* element ID assignment of Header*/
  2714. service->eqn.namespaceURI=6;
  2715. service->eqn.localPart=4;
  2716. /* encode start element Header */
  2717. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2718. {
  2719. return -1;
  2720. }
  2721. /* encode children of Header */
  2722. if(serialize_HeaderType(&(type->Header),service)<0)
  2723. {
  2724. return -1;
  2725. }
  2726. /* element ID assignment of Header*/
  2727. service->eqn.namespaceURI=6;
  2728. service->eqn.localPart=4;
  2729. /* encode end element of Header */
  2730. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2731. {
  2732. return -1;
  2733. }
  2734. /* element ID assignment of Body*/
  2735. service->eqn.namespaceURI=6;
  2736. service->eqn.localPart=0;
  2737. /* encode start element Body */
  2738. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2739. {
  2740. return -1;
  2741. }
  2742. /* encode children of Body */
  2743. if(serialize_BodyType(&(type->Body),service)<0)
  2744. {
  2745. return -1;
  2746. }
  2747. /* element ID assignment of Body*/
  2748. service->eqn.namespaceURI=6;
  2749. service->eqn.localPart=0;
  2750. /* encode end element of Body */
  2751. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2752. {
  2753. return -1;
  2754. }
  2755. return 0;
  2756. }
  2757. /* marshal data to EXI stream */
  2758. int serialize_message(struct v2gService* service)
  2759. {
  2760. /* encode start document */
  2761. if (exiEncodeStartDocument(&(service->outStream), &(service->stateEncode)) < 0)
  2762. {
  2763. return -1;
  2764. }
  2765. /* element ID assignment of V2G_Message*/
  2766. service->eqn.namespaceURI=6;
  2767. service->eqn.localPart=8;
  2768. /* encode start element V2G_Message */
  2769. if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2770. {
  2771. return -1;
  2772. }
  2773. serialize_AnonType_V2G_Message(&(service->v2gMsg), service);
  2774. /* encode end element of V2G_Message */
  2775. if (exiEncodeEndElement(&(service->outStream), &(service->stateEncode), &(service->eqn)) < 0)
  2776. {
  2777. return -1;
  2778. }
  2779. /* encode end document */
  2780. if (exiEncodeEndDocument(&(service->outStream), &(service->stateEncode)) < 0) {
  2781. return -1;
  2782. }
  2783. return 0;
  2784. }