code src/test/main_example.c
, function sessionSetup1
, line 1507
exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[0] = 0;
exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[1] = 20;
exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.charactersLen = 2;
The specification for EVSEID
is of type evseIDType
, a restricted string which has a minimum length of 7. Also, if it's a string then why make the initial character null?
Reference: V2G_CI_MsgDataTypes.xsd
<xs:simpleType name="evseIDType">
<xs:restriction base="xs:string">
<xs:minLength value="7"/>
<xs:maxLength value="37"/>
</xs:restriction>
</xs:simpleType>
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)?
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.
Last edit: Gravis 2024-01-08
fixed with https://sourceforge.net/p/openv2g/code/121/