vanetza
vanetza copied to clipboard
Adding IVIM messages - asn1c problem
Hi,
I wanted to add some new messages to Vanetza. I succeeded with SREM and SSEM messages (see https://github.com/riebl/vanetza/pull/161), but I cannot do IVIM messages. When to trying to compile the ISO19321 asn1 file, there is a following error:
karel@ThinkPad> make generate_asn1c
[ 0%] Built target clean_asn1c
[ 0%] Copying generic asn1c support code
[ 0%] Generating code from ITS application ASN.1 modules (CDD, CA, DEN)
ASN.1 grammar parse error near /media/karel/KINSGTON/vanetza-fork-ivim/vanetza/build.asn1/iso/ISO19321.asn:43 (token "[["): syntax error, unexpected TOK_VBracketLeft
Cannot parse "/media/karel/KINSGTON/vanetza-fork-ivim/vanetza/build.asn1/iso/ISO19321.asn"
make[3]: *** [vanetza/asn1/CMakeFiles/generate_asn1c.dir/build.make:91: ../vanetza/asn1/its] Error 65
make[2]: *** [CMakeFiles/Makefile2:526: vanetza/asn1/CMakeFiles/generate_asn1c.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:533: vanetza/asn1/CMakeFiles/generate_asn1c.dir/rule] Error 2
make: *** [Makefile:255: generate_asn1c] Error 2
Apparently, the asn1c compiler does not like the extension fields added in v2 of ISO19321. Problem is in this structure:
IviContainer::= CHOICE {
glc GeographicLocationContainer,
giv GeneralIviContainer,
rcc RoadConfigurationContainer,
tc TextContainer,
lac LayoutContainer,
..., -- original extension indicator of V1
[[ -- Extension in V2
avc AutomatedVehicleContainer,
mlc MapLocationContainer,
rsc RoadSurfaceContainer ]]
}
I tried asn1c from riebl/asn1c/integer_uper as Mr. Riebl suggests. I also tried mouse07410/asn1c and finally with vlm/asn1c. All have the same error. I know that this is not a bug in Vanetza, but I am writing here to ask how do you think it would be appropriate to fix this. Do you think we could remove the extensions from the asn file, until the compiler supports it? When I manually remove the extension fields from the ASN file, it is working (there are some missing files and name clashes, but I think I will be able to solve those on my own).
Thank you, Karel
I tried manually removing the "[[" and "]]" characters and it seems to work ok. So I will add it to the SSEM & SREM pull request to see what you think about it.
This suggests it fixes the problem, but just applying this commit as a patch and rebuilding riebl/asn1c/integer_uper did not help: https://github.com/brchiu/asn1c/commit/3d76a0399b065c722db814082f0ddd4dae060a22 Unfortunately, I am not experienced enough for fixing the asn1c.
FYI: I need some more time to dig deeper into this problem.
asn1c version ebed0802c (https://github.com/mouse07410/asn1c/commit/ebed802c88b3049cfe67326e4df780cefc6da49e) (I noticed @riebl uses it) seems to work correctly, so I am closing this issue.