Skip to content

Commit

Permalink
generate ivim asn1c with raw defs from syntax_check.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
lreiher committed Dec 11, 2023
1 parent de0d5f2 commit aff73da
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 889 deletions.
35 changes: 32 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,16 @@
"request": "launch",
"program": "utils/codegen/asn1ToC.py",
"args": [
"asn1/reduced/ivim/IVIM-PDU-Descriptions.asn",
"asn1/reduced/ivim/ITS-Container.asn",
"asn1/reduced/ivim/ISO19321IVIv2.asn",
"asn1/raw/is_ts103301/IVIM-PDU-Descriptions.asn",
"asn1/raw/is_ts103301/cdd/ITS-Container.asn",
"asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14823-missing.asn",
"asn1/raw/TS17419_2014_CITSapplMgmtIDs.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcGenericv7-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcApplicationv6-patched.asn",
"asn1/patched/ISO-TS-19091-addgrp-C-2018.asn",
"asn1/raw/ISO14816_AVIAEINumberingAndDataStructures.asn",
"asn1/raw/ISO19321IVIv2.asn",
"-o", "etsi_its_coding/etsi_its_ivim_coding"
],
"console": "integratedTerminal",
Expand Down Expand Up @@ -225,6 +232,28 @@
"justMyCode": true
},

{
"name": "IVIM asn1ToRosMsg",
"type": "python",
"request": "launch",
"program": "utils/codegen/asn1ToRosMsg.py",
"args": [
"asn1/raw/is_ts103301/IVIM-PDU-Descriptions.asn",
"asn1/raw/is_ts103301/cdd/ITS-Container.asn",
"asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14823-missing.asn",
"asn1/raw/TS17419_2014_CITSapplMgmtIDs.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcGenericv7-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcApplicationv6-patched.asn",
"asn1/patched/ISO-TS-19091-addgrp-C-2018.asn",
"asn1/raw/ISO14816_AVIAEINumberingAndDataStructures.asn",
"asn1/raw/ISO19321IVIv2.asn",
"-o", "etsi_its_msgs/etsi_its_ivim_msgs/msg"
],
"console": "integratedTerminal",
"justMyCode": true
},

{
"name": "CAM asn1ToConversionHeader",
"type": "python",
Expand Down
130 changes: 130 additions & 0 deletions asn1/raw/ISO14816_AVIAEINumberingAndDataStructures.asn
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
--<OSS.PDU>--

-- ISO 14816:2005 Amd.1:2015


AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)}
DEFINITIONS AUTOMATIC TAGS::= BEGIN

CS1::= SEQUENCE {
countryCode CountryCode,
issuerIdentifier IssuerIdentifier,
serviceNumber ServiceNumber
}

CS2::= SEQUENCE {
manufacturerIdentifier ManufacturerIdentifier,
serviceNumber ServiceNumber
}

CS3::= SEQUENCE {
startTime StartTime,
stopTime StopTime,
geographLimit GeoGraphicalLimit,
serviceAppLimit ServiceApplicationLimit
}


/*
CS4::= SEQUENCE {
countryCode CountryCode,
alphabetIndicator AlphabetIndicator,
licPlateNumber LicPlateNumber
}
*/

CS4::= SEQUENCE {
countryCode CountryCode,
alphabetIndicator AlphabetIndicator,
licPlateNumber LicPlateNumber
} (WITH COMPONENTS {..., licPlateNumber (SIZE(14))})

CS5::= SEQUENCE{
vin VisibleString, -- 17 characters VIN
fill BIT STRING (SIZE(9)) -- set to '000000000'
}

CS7::= FreightContainerData

FreightContainerData::= SEQUENCE { -- octet aligned by means of 3 fill bits at the end
ownerCode BIT STRING(SIZE(19)), -- 19bits
serialNumber INTEGER(0 .. 1000000), -- 20bits
checkDigit INTEGER(0 .. 10), -- 4bits
length INTEGER(1 .. 2000), -- 11bits
height INTEGER(1 .. 500), -- 9bits
width INTEGER(200 .. 300), -- 7bits
containerTypeCode INTEGER(0 .. 127), -- 7bits
maximumGrossMass INTEGER(19 .. 500), -- 9bits
tareMass INTEGER(0 .. 99), -- 7bits
fill BIT STRING (SIZE(3)) -- set to '000'
} -- 12 octets

CS8::= SEQUENCE { -- octet aligned by means of 6 fill bits at the beginning
fill BIT STRING (SIZE(6)), -- set to '000000'
countryCode CountryCode, -- 10 bits
taxCode TaxCode
}

CountryCode::= BIT STRING(SIZE(10))

IssuerIdentifier::= INTEGER(0 .. 16383)

ManufacturerIdentifier::= INTEGER(0 .. 65535)

LicPlateNumber::= OCTET STRING

--ServiceNumber::= BIT STRING(SIZE(32))
ServiceNumber::= BIT STRING (SIZE(32))(CONTAINING INTEGER (0..4294967295))

TaxCode::= OCTET STRING

AlphabetIndicator::= INTEGER {
latinAlphabetNo1 (0), -- encoded as 00 00 00達
latinAlphabetNo2 (1), -- encoded as 00 00 01達 etc
latinAlphabetNo3 (2),
latinAlphabetNo4 (3),
latinCyrillicAlphabet (4),
latinArabicAlphabet (5),
latinGreekAlphabet (6),
latinHebrewAlphabet (7),
latinAlphabetNo5 (8),
latinAlphabetNo6 (9),
twoOctetBMP (10),
fourOctetCanonical (11)
} (0..63) -- 6 bits, latinAlphabetNo1 recommended

AviEriDateTime ::= OCTET STRING (SIZE(10)) -- YYMMDDhhmm

StartTime::= AviEriDateTime

StopTime::= AviEriDateTime

GeoGraphicalLimit::= BIT STRING {
globalRestriction (0),
regionalRestriction (1),
nationalRestriction (2),
district (3),
issuerCoverageRestriction (4),
reservedForCEN1 (5),
reservedForCEN2 (6),
issuerSpecificRestriction (7)
} (SIZE(8))

ServiceApplicationLimit::= BIT STRING {
notForPostpayment (0),
notForPrepayment (1),
notForVehicleaccess (2),
notForFleetcontrol (3),
issuerSpecificRestriction1 (4),
issuerSpecificRestriction2 (5),
issuerSpecificRestriction3 (6),
issuerSpecificRestriction4 (7)
} (SIZE(8))

version INTEGER(0..255)::= 1 -- version of this ASN.1 module

END
/*
The ASN.1 specification has been checked for conformance to the ASN.1
standards by OSS ASN.1 Studio
*/
47 changes: 47 additions & 0 deletions asn1/raw/TS17419_2014_CITSapplMgmtIDs.asn
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)}
DEFINITIONS AUTOMATIC TAGS::=BEGIN

IMPORTS

;

-- End of IMPORTS

-- Types

-- Variable length data types

VarLengthNumber::=CHOICE{
content [0] INTEGER(0..127), -- one octet length
extension [1] Ext1
}

Ext1::=CHOICE{
content [0] INTEGER(128..16511), -- two octets length
extension [1] Ext2
}

Ext2::=CHOICE{
content [0] INTEGER(16512..2113663), -- three octets length
extension [1] Ext3
}

Ext3::=INTEGER(2113664..270549119,...) -- four and more octets length


VarLengthNumber2::=CHOICE{
shortNo [0] INTEGER(0..127),
longNo [1] INTEGER(0..32767)
}


-- Values

version INTEGER(0..255)::=1 -- version of this module

/*
The ASN.1 specification has been checked for conformance to the ASN.1
standards by OSS ASN.1 Syntax Checker, and by OSS ASN-1STEP
*/

END
Loading

0 comments on commit aff73da

Please sign in to comment.