virtual-vehicle / vehicle_captain_its_lib_c_cxx Goto Github PK
View Code? Open in Web Editor NEWLibrary for ETSI V2X messages
Home Page: https://github.com/virtual-vehicle/vehicle_captain
License: BSD 3-Clause "New" or "Revised" License
Library for ETSI V2X messages
Home Page: https://github.com/virtual-vehicle/vehicle_captain
License: BSD 3-Clause "New" or "Revised" License
A defintion of SEQUENCESIZE(1..128, ...) can not be decoded/encoded (see CPM v2.1.1)[https://github.com/virtual-vehicle/vehicle_captain_its_asn1_specifications/blob/master/experimental/CPM-PDU-Descriptions.asn].
Generator: https://github.com/brchiu/asn1c.git (velichkov_s1ap_plus_option_group_plus_adding_trailing_ull)
Encoding of such a datatype leads into a bitshift of one to the left of the first decoded value after the start of the sequence (when compared to Wireshark as reference decoder).
Decoding of a valid CPM results into a bitshift to the right of the first decoded value after the start of the sequence (when compared to Wireshark as reference decoder).
The additional "..." seems to be important and needs to be respected by the decoder/encoder. But this seems not be implemented into the Generator
none
If you want to use specifications of that type, we suggest to use another Generator for the messages. Thank you though for trying to opt for this FOSS!
This is only an observation. No issue has been detected yet.
./command.sh uses a file as dependency that is not loaded. Instead of loading the file, another file is checked twice.
This is also the case with original ETSI sources
Not necessary, it is in the source files.
Copied mistake from original sources in syntax_check.bash from ETSI forge
One file is loaded twice.
if [ ! -f "$ETSI_ITS_BUILD_ROOT_DIR"/asn1/"ISO14906(2018)EfcDsrcGenericv7.asn" ]; then
wget -P "$ETSI_ITS_BUILD_ROOT_DIR"/asn1 'https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn'
fi
if [ ! -f "$ETSI_ITS_BUILD_ROOT_DIR"/asn1/TS17419_2014_CITSapplMgmtIDs.asn ]; then
wget -P "$ETSI_ITS_BUILD_ROOT_DIR"/asn1 'https://standards.iso.org/iso/ts/17419/TS%2017419%20ASN.1%20repository/TS17419_2014_CITSapplMgmtIDs.asn'
fi
if [ ! -f "$ETSI_ITS_BUILD_ROOT_DIR"/asn1/"ISO14906(2018)EfcDsrcGenericv7.asn" ]; then
wget -P "$ETSI_ITS_BUILD_ROOT_DIR"/asn1 'https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn'
fi
ISO14823-missing.asn will not be present
function compile_IVIM() {
install -d "$VC_ITS_LIB_ROOT_DIR"/ivim
asn1c -D "$VC_ITS_LIB_ROOT_DIR"/ivim -R -no-gen-example -fcompound-names -fno-include-deps -pdu=IVIM \
"$VC_ITS_ASN1_SPECS_DIR"/"$IVIM_SPEC" \
"$VC_ITS_ASN1_SPECS_DIR"/"$CDD_SPEC_v2" \
"$IS_TS_ISO_DIR"/'ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn' \
"$IS_TS_ISO_DIR"/'ISO14823-missing.asn' \
"$ADDITIONAL_MODULES_DIR"/'TS17419_2014_CITSapplMgmtIDs.asn' \
"$IS_TS_ISO_DIR"/'ISO14906(2018)EfcDsrcGenericv7-patched.asn' \
"$IS_TS_ISO_DIR"/'ISO14906(2018)EfcDsrcApplicationv6-patched.asn' \
"$ADDITIONAL_MODULES_DIR"/'ISO-TS-19091-addgrp-C-2018-patched.asn' \
"$ADDITIONAL_MODULES_DIR"/'ISO14816_AVIAEINumberingAndDataStructures.asn' \
"$ADDITIONAL_MODULES_DIR"/'ISO19321IVIv2.asn'
install -d "$VC_ITS_LIB_ROOT_DIR"/ivim/src
mv "$VC_ITS_LIB_ROOT_DIR"/ivim/*.c "$VC_ITS_LIB_ROOT_DIR"/ivim/src/
echo "Compiled PDU: IVIM"
}
One file is loaded twice.
if [ ! -f 'build/asn1/ISO14906(2018)EfcDsrcGenericv7.asn' ]; then
wget -P build/asn1 'https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn'
fi
if [ ! -f 'build/asn1/TS17419_2014_CITSapplMgmtIDs.asn' ]; then
wget -P build/asn1 'https://standards.iso.org/iso/ts/17419/TS%2017419%20ASN.1%20repository/TS17419_2014_CITSapplMgmtIDs.asn'
fi
if [ ! -f 'build/asn1/ISO14906(2018)EfcDsrcGenericv7.asn' ]; then
wget -P build/asn1 'https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn'
fi
ISO14823-missing.asn will not be present
install -d build/ivim
asn1c -D build/ivim -R -no-gen-example -fcompound-names \
'IVIM-PDU-Descriptions.asn' \
'cdd/ITS-Container.asn' \
'iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn' \
'iso-patched/ISO14823-missing.asn' \
'build/asn1/TS17419_2014_CITSapplMgmtIDs.asn' \
'iso-patched/ISO14906(2018)EfcDsrcGenericv7-patched.asn' \
'iso-patched/ISO14906(2018)EfcDsrcApplicationv6-patched.asn' \
'build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn' \
'build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn' \
'build/asn1/ISO19321IVIv2.asn' \
The missing file does not seem to affect the library. However, there might be elements missing.
These might be the correct files.
More information needed. There was not yet an issue. This is only an observation.
avc, mlc, rsc containers will lead to failed decoding.
Generator: https://github.com/brchiu/asn1c.git (velichkov_s1ap_plus_option_group_plus_adding_trailing_ull)
Encoded Content
value1 IVIM ::= {
header {
protocolVersion 2,
messageID ivim,
stationID 0
},
ivi {
mandatory {
serviceProviderId {
countryCode '1100000001'B,
providerIdentifier 1
},
iviIdentificationNumber 1,
timeStamp utcStartOf2004,
iviStatus new
},
optional {
avc : {
{
relevanceZoneIds {
1
},
automatedVehicleRules {
{
priority 0,
allowedSaeAutomationLevels {
0
}
}
}
}
}
}
}
}
020600000000A3010004000000000000000100100640000200010280
The avc is decoded normally, but right after, a mlc is expected.
ASN_DEBUG output
Decoded AutomatedVehicleContainer as SET OF (.../vcits/asn1c/src/constr_SET_OF.c:995)
Decoding member "mlc" in ext1 (.../vcits/asn1c/src/constr_SEQUENCE.c:1170)
The ISO19321IVIv2.asn specifies
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 ]]
}
This should be interpreted as a CHOICE between eight containers (glc, giv, rcc, tc, lac, avc, mlc, rsc). This can be verified with Wireshark. However, the generator can not handle "[[ ... ]]" within CHOICE objects. The generated C-code in IviContainer.h and IviContainer.c expects the extension (ext1: avc, mlc, rsc) to be one element, with three mandatory containers. In other words, the decoder then decodes the avc perfectly, but expects an mlc.
General Remark from developer perspective: The ETSI files look clean and are easy to parse. However, the ISO standards, especially DSRC and ISO19321IVIv2 are a mess. The standards use specification elements that are niche and not necessary (RegionalExtension and "[[ ]]"). Both of them make the standard hard to parse with existing FOSS. The entry barrier is really high.
We adapted the decoder to fit for one specific use case. As CDD 2.3 will be released soon, we will wait for that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.