refactor: add tag 0.9..6
refactor: iso90
docs: update docs for version 0.9.6
fix: overflow when decoding large integer numbers
docs: update
Hi, The code uses ANSI-C and should run an almost any platform. Anyhow, I think it is best to just try it out. wr.t. IDE you are free to choose your prefered IDE. We provide makefiles also. -- Daniel
You can use your prefered IDE. There is a make file also.
Compiler or IDE required to compile and run the code
Hi Daniel, Thanks for making this work open source. I have download this code. but will you please mentioned which IDE or Compilrer required to compile this code? On which platform this code is written for?
The XSDs we used for ISO2 version in OpenV2G where an intermediary version on the way to -20. It was used for TestFests only (as far as I know). Hence, I don't know whether this kind of schema can be acquired at ISO. The final version ISO 15118-20:2022 can be acquired at ISO, as usual. Note: openV2G implementation for ISO 15118-20:2022 will not be available as Open Source.
Daniel, thanks for the information. How would I go about acquiring the XSD file?
Hi, Sorry, we are not allowed to share XSDs that are part of the standard and need to be acquired. Unfortunately, there is no easy way to get the XSDs out of the source code (at least not in a 100% manner) -- Daniel
duplicate of https://sourceforge.net/p/openv2g/tickets/26/
OpenV2G uses static memory allocation (no malloc is used) with a fixed set of entries for arrays etc. Everyone using the library (source code) can configure it according to the needs, see #define XYZ_ARRAY_SIZE 5 entries in https://sourceforge.net/p/openv2g/code/HEAD/tree/trunk/src/iso1/iso1EXIDatatypes.h Defining the possible maximum for each would result in a huge static memory allocation. I hope this helps to understand the rational. -- Daniel
Hi, I am working with Vector to develop a charging simulator based on their Emobility Charging System. The system works with ISO15118-20 and ISO15118-2:2013. It does not work with the 2018 draft for ISO15118-2. In order to develop the simulator, they need the XDS files for the draft version. Unfortunately, our latest EV offering was developed using the open V2G platform; we must be able to test this but cannot since the charging simulator does not support openV2G. Would it be possible to get the...
XSD Schema Files for Draft 2018 ISO15118-2
ChargeParameterDiscoveryRes - Schedule array size greater than 5
Hi Daniel, I am using iso1 codec. The issue is not encoding/decoding directly but on computing the signature. The payload is encoded and received by a server using exificient. When receiving the request, the server decodes successfully the request. Then it has to encode the payload (without the signature) to check if the signature is correct. So it encodes back the content to compute a hash. That is when we face the issue because the payload is different (1 byte more for each root certificate) so...
Hi Daniel, I am using iso1 codec. The issue is not encoding/decoding directly but on computing the signature. The payload is encoded and received by a server using exificient. When receiving the request, the server decodes successfully the request. Then it has to encode the payload (without the signature) to check if the signature is correct. So it encodes back the content to compute a hash. That is when we face the issue because the payload is different (1 byte more for each root certificate) so...
Do you have an example XML (or EXI) message that you would like to encode and can point us to to where something goes wrong. Honestly I doubt that there is a problem since it is used for a very long time now without any issues. Note: please also let us know what codec you are using (e.g. iso1) etc Thanks!
Hello, We have found an issue in the encoding. It indeed adds a byte because of the encoding on 7 bits and 1 bit more to indicate if the encoding is done or not. For example, if the serial number is 9: This is 0b00001001 in binary. So we need 4 bits to encode it. Then openv2g considers that we need a byte, then 8 bits. As the bits are encoded 7 by 7, openv2g considers that we need 2 bytes to encode this number. We have patched this and tested it sucessfully. We might share a fix proposal for this...
Hi, Is there any protocol version after urn:iso:15118:2? As mentioned on our homepage the most recent versions will not be available as Open Source anymore. see https://openv2g.sourceforge.net/ -- Daniel
Questions About the ISO15118 Protocol
Invalid test data used in main_example.c?
fixed with https://sourceforge.net/p/openv2g/code/121/
fix: use minimum length of 7
Yes, it's in src/test/main_example.c. Not to worry though because I'm not using it for production purposes, I'm merely debugging my own dynamic EXI encoder by comparing outputs. Comparing the I/O for the example code seemed like a nice starting point and thusly I'm running into bugs in the example code.
Your statements are correct. The struct is not properly initialized. Having said that, the code you are referring to is from the "test" folder which is meant to provide a simple overview and examples how to use the code... As such main_example.c illustrates both sides EV and charging side. This is NO code you should/can ever use in production! Anyhow, it should be fixed. Thanks for reporting.
Uninitialized data in main_example.c
I hadn't even considered a fix because I wasn't 100% sure it was wrong or if I had missed something. I think a simple string like "abcdefg" would suffice. However, if what meant to ask if I was going to provide a patch for input validation, I'm not.
I hadn't even considered a fix because I wasn't 100% sure it was wrong or if I had missed something. I think a simple string like "abcdefg" would suffice.
You are correct, the test example is simply wrong. Note: I think this limitation evolved over time and the example did not reflect it accordingly. FYI: the EXI codec does not check for min/max character lengths. Do you plan to provide a fix (increasing size to min 3 and add proper characters)?
Invalid test data used in main_example.c?
encode_iso1PGPDataType always fails
I think you should be able to close it yourself but I can do it for you.
Oops.... spoke too soon. I see it now. Just close this ticket.
encode_iso1PGPDataType always fails
Do you miss anything? OpenV2G supports ISO IEC 15118 (Edition 1). Note: the V2G implementation for ISO 15118-20:2022 will not be available as Open Source. If you are interested in a commercial license solution, please contact us via exi.ct@siemens.com.
XML schema attributes are optional by default.
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: ``` <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> ``` but in the c file, openv2g define iso1CertificateChainType as below: ``` struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
i have an question, that is openv2g is fully meet iso15118-2014 ?
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: ``` <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> ``` but in the c file, openv2g define iso1CertificateChainType as below: ``` struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: ``` <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> ``` but in the c file, openv2g define iso1CertificateChainType as below: ``` struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> but in the c file, openv2g define iso1CertificateChainType as below: struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: ``` <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> ``` but in the c file, openv2g define iso1CertificateChainType as below: ` struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: ` <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> ` but in the c file, openv2g define iso1CertificateChainType as below: ` struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: ` <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> ` but in the c file, openv2g define iso1CertificateChainType as below: ``` struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> but in the c file, openv2g define iso1CertificateChainType as below: struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> but in the c file, openv2g define iso1CertificateChainType as below: struct iso1CertificateChainType { struct { exi_string_character_t characters[iso1CertificateChainType_Id_CHARACTERS_SIZE];...
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> but in the c file, openv2g define iso1CertificateChainType as below: struct iso1CertificateChainType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct...
i have an question, that is openv2g is fully meet iso15118-2015 ?
Hi, In V2G_CI_MsgDataTypes.xsd define CertificateChainType as below: xsd <xs:complexType name="CertificateChainType"> <xs:sequence> <xs:element name="Certificate" type="certificateType" /> <xs:element name="SubCertificates" type="SubCertificatesType" minOccurs="0" /> </xs:sequence> <xs:attribute name="Id" type="xs:ID" /> </xs:complexType> but in the c file, openv2g define iso1CertificateChainType as below: c struct iso1CertificateChainType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID}...
Hi, Correct, I think you "found" the answer. The data exchange uses the EXI [1] format. Since we use the schema-informed EXI mode you need to understand the way EXI grammars are created and work. Anyhow, the OpenV2G project is exactly about that. Using the C structs you do not need to understand the internals. -- Daniel [1] https://www.w3.org/TR/exi/
Hi, I may have fix this issue from https://www.w3.org/TR/exi-primer/#encoding: Note that AT(category) is accepted before AT(date) even though their order is reversed in the schema. This is because attributes in schema-informed grammars must be sorted lexicographically, first by local name and then by namespace URI. Attribute sorting reduces the number of options which, in turn, greatly simplifies grammar creation and improves compactness. Since this automaton does not include transitions on AT()...
Hi, I may have fix this issue from https://www.w3.org/TR/exi-primer/#encoding: Note that AT(category) is accepted before AT(date) even though their order is reversed in the schema. This is because attributes in schema-informed grammars must be sorted lexicographically, first by local name and then by namespace URI. Attribute sorting reduces the number of options which, in turn, greatly simplifies grammar creation and improves compactness. Since this automaton does not include transitions on AT(*)...
Hi, In the function encode_iso1ExiDocument ```c int encode_iso1ExiDocument(bitstream_t stream, struct iso1EXIDocument exiDoc) { errn = writeEXIHeader(stream); if(errn == 0) { /* DocContent[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes),...
Resource exhaustion code paths in genated code.
Hi, There is the possibility to encode EXI messages in byte-aligned mode (see https://sourceforge.net/p/openv2g/code/HEAD/tree/trunk/src/codec/EXIOptions.h#l57) as described by the EXI specification (see https://www.w3.org/TR/exi/#key-bytealignment) Anyhow, this is NOT following the rules for ISO 15118 which require bit-aligned encoding. Hence, this might be of interest for debugging purposes only. -- Daniel
I'm working toward making an MCU-based solution to communicate ISO 15118-2 messages (TCP included) and one hurdle to this making compact code for EXI messages (your generated code is built for speed not reduced size). The EXI spec seems to indicate that there is the option for byte-alignment for certain parts. My question is if the generated code is utilizing this byte-alignment (I'm not an EXI expert) and if not, does the spec allow for it (I couldn't find anything definitive)?
Thank you. This explains a lot of things.
Hi, The iso2 was an intermediary step to iso dash 20 ( aka "-20"). Hence they have never been part of of an official specification an were completely replaced by -20. The XDS files are usually part of the ISO specification. The ones for version: 15118-20-ed-1 can be found here: https://standards.iso.org/iso/15118/-20/ed-1/en/ -- Daniel
So I have an interest in the updated ISO 15118-2 from 2016 (aka Iso2) and have been unable to locate the xsd files. If someone could point me in the right direction, that would be great.
Hi, I ask you to investigate a bit yourself. I assume you are writing to a byte array that is not large enough. I guess somehow here https://sourceforge.net/p/openv2g/code/HEAD/tree/trunk/src/test/main_databinder.c#l61 or similar code. This is the last time I answer questions were you just share some error codes. Please try to understand that is just guessing. -- Daniel
error comming from writeBits() api as error code EXI_ERROR_OUTPUT_STREAM_EOF -11 file name : OpenV2G_0.9.5/src/codec/BitOutputStream.c
error comming from writeBits() api as error code EXI_ERROR_OUTPUT_STREAM_EOF -11 file name : OpenV2G_0.9.5/src/codec/BitOutputStream.c
This means that the encode was asked to encode something that is not valid. OpenV2G allows for encoding only valid XML portions. In most of the cases the C structs take care that the content is valid but there are still situation where this is not possible. e.g., the codec expects element a, b or c. IF none is given.. the codec will fail with -109. There are many more such cases. I suggest you to use the debugger and see what causes the issue.
I got error code as "#define EXI_ERROR_UNKOWN_EVENT -109" from "encode_iso1ExiDocument()" api file name : OpenV2G_0.9.5/src/iso1/iso1EXIDatatypesEncoder.c
Hi, I guess you need to share more details. * Source Code as images, grrr * What is the error code.. the number tells you the reason, see https://sourceforge.net/p/openv2g/code/HEAD/tree/trunk/src/codec/ErrorCodes.h * Which file are you using? * .... -- Daniel
Hi , I am doing the encoding and decoding few request and response using https://sourceforge.net/projects/openv2g/files/ here I have to encode CertificateUpdateReq and I am using "serialize1EXI2Stream()" API, but I am getting error. here I have attached the method which I have doing for encode.
Note: If you are interested in a commercial license, please contact us via exi.ct@siemens.com. To facilitate communication please use your company email address for requesting a quotation.
Hello liu We are trying best to contact. But no reply and little progress got. Can you tell me which V2G project for 15118-20 you are using? Regards Godfrey
Hello Godfrey, Had you got info from exi.ct@siemens.com? I had not got any reply that i had sent 5 emails to exi.ct during the past 2 months. It is a disaster if no persons works for exi.ct@siemens.com. I still hope this opeV2G project is active even though i still switch to another V2G project for 15118-2.0.
Hi, This aspect relates to the EXI specification. If you want to know/understand all the details I urge you to read the spec. see https://www.w3.org/TR/exi/ The openV2G library is exactly about not knowing all the details and simply using the provided interfaces. To put it simple. The document grammar is about encoding valid XML/EXI documents. Not all elements are valid root elements. SessionSetupReq is a valid element while ChargingComplete is apparently not. The fragment grammar is the entry point...
Hi Daniel Thank you for your reply. I take two examples in ISO15118-2 and OpenV2G code to express my puzzlement. 1. SessionSetupReq only appear once in the xsd file, but this field exist in the document and fragment struct both. 2. ChargingComplete appeared twice in the xsd file, this field only exist in fragment struct. I can't see the difference between this field and other fields. Can you give me some more help, thank you! Regards Godfrey
Hi Daniel Thank you, I've recieved your message. Can you tell me the product name of the EXI solution for ISO15118-20. Is it also called OpenV2G? I'll let the buyer of our company to contact Siemens. Regards Godfrey
Hi, EXI differs between "documents" and "fragments". see https://www.w3.org/TR/exi/#streams [Definition:] EXI documents are EXI bodies with a single root element that conform to the Built-in Document Grammar (See 8.4.1 Built-in Document Grammar) or Schema-informed Document Grammar (See 8.5.1 Schema-informed Document Grammar). [Definition:] EXI fragments are EXI bodies with zero or more root elements that conform to the Built-in Fragment Grammar (See 8.4.2 Built-in Fragment Grammar) or Schema-informed...
Hi Godfrey, I sent you a private message. -- Daniel
Hello Tom Have you got touch with Siemens? Is there a solution for you from Siemens? I have sent my request to exi.ct@siemens.com, but no reply. Regards Godfrey
Dear Daniel I would like to convert the XML schemas to the C file-structure with the XSD files which provided by ISO. I can see that in OpenV2G project, there are documents and fragments structure in the EXI codes. But when I use the tools to do the convert, I found that the fragment structure is not generated. I see into the XSD file, there are no the 'fragment' field in the XSD files. But there are generated fragment structure in OpenV2G. Can you explain how to get the fragment information from...
Dear Daniel I would like to convert the XML schemas to the C file-structure with the XSD files which provided by ISO. I can see that in OpenV2G project, there are document and fragment structure in the EXI codes. But when I use the tools to generate the C files, I find the fragment structure was not generated. I see into the XSD file, there are not the 'fragment' fields inthe XSD file. But there are generated fragment structure in OpenV2G. Can you explain how to get the fragment information from...
Hi, Once again, openV2G handshake implementation exists to setup up-front which data exchange version is supported by both (car & charger).. based on the outcome you can for example pick the data exchange for DIN, ISO, ISO2 etc . I don't think there is more I can add this... -- Daniel
Hi Daniel Peintner, I think major/minor versions have something to do with XML schema namespaces. You can please confirm which namespaces does OpenV2G 0.9.4 support
Hi, OpenV2G lets you use the handshake protocol to "agree" on a given version up-front to be sure that both speak the "same" language. I think you may need to look into the dedicated specifications which major/minor version means what. We don't have a full list handy we can share.. -- Daniel
Hi folks, I'm trying to use OpenV2G, it works really good.. but encountered a hurdle in appHandshake request. The Major Version and Minor Version numbers. So currently I believe that Major version 1 and Minor Version 0 is for iso:11518-2-2010 which is DIN specification and Major version 2 and Minor Version 0 is for iso:11518-2-2013 which is iso1 specification. I also believe that Minor Version can vary. Therefore could you please throw some light on how these versions are decided and how many exist.....
Thank you very much for your reply, following your method does work, thanks again!
EXI stream. Note, you need to set the XSD schema in the GUI!
EXI stream
Hi, I seem to have managed to delete (instead of download) your exi file. I might have mentioned the wrong option.. please set exiFactory.setValuePartitionCapacity(0); // no string table GUI see attached image File see attachemend also. -- Daniel
Hi, I seem to have managed to delete (instead of download) your exi file. I might have mentioned the wrong option.. please set exiFactory.setValuePartitionCapacity(0); // no string table GUI see attached image File see attachemend also. -- Daniel
Thank you very much for your patient answer. For the error code number I already know the relevant h file. But as a developer who is new to V2G, I still don't quite understand many parts of it. I have done the response configuration in EXIficient java GUI as you said, and generated a new .exi file (the exi data did change), and when I decode it by OpenV2G, it still returns EXI_ERROR_STRINGVALUES_NOT_SUPPORTED error at the same position. This makes me confused, is there something wrong with the content...
Hi, I pointed you already to the error codes https://sourceforge.net/p/openv2g/code/HEAD/tree/trunk/src/codec/ErrorCodes.h #define EXI_ERROR_STRINGVALUES_NOT_SUPPORTED -160 In the ISO 15118 specification specific EXI options are used. One of the setting is not to use string tables. By default any EXI implementation uses them to get better performance. see https://github.com/EXIficient/exificient#command-line-interface --> "-noLocalValuePartitions" You also need to set maximumNumberOfBuiltInProductions...
Thank you very much for your reply and it was very helpful to me. We used EXIficient to encoder the XML (see fu for details), then used OpenV2G to parse it and found that it reported a -160 error. Tracing to the location of the error return, the code hint is: iso1TransformType->Algorithm.charactersLen = 0, which does not meet the condition of iso1TransformType->Algorithm.charactersLen >= 2, how can we solve the problem? Also I would like to know if EXIficient java GUI is compatible with OpenV2G?
Hi, Do you have any good tools for XML and EXI conversion, and if so, I hope you can recommend them? There are some publicly available, see https://www.w3.org/XML/EXI/#implementations e.g, EXIficient provides a command line tool and a GUI if needed. http://exificient.github.io/java/ Disclaimer: I am the author of EXIficient. I hope this helps, -- Daniel
Thanks a lot for your reply! Do you have any good tools for XML and EXI conversion, and if so, I hope you can recommend them?
OpenV2G allows one to encode/decode valid XML data. Deviant data is possible in EXI, but not implemented in OpenV2G. In the case you are describing <signaturevalue> expects base64 data. In your case there is no data and some EXI encoders may choose to encode the sequence as follows: 1. StartElement("SignatureValue") 2. EndElement // Note: this is not the expected EndElement but the EndElement for deviant data</signaturevalue> The proper EXI sequence would be: 1. StartElement("SignatureValue") 2....