From a8499f97d2c023fd1d0b2585d244e60b8fdb44f9 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 19 May 2025 15:36:08 +0200 Subject: [PATCH 01/32] Allow a numbered list in an integer next to constraints --- BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index 76be35e..a454eec 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -613,8 +613,8 @@ external_type returns [Object obj] integer_type returns [Object obj] {AsnInteger intgr = new AsnInteger(); AsnNamedNumberList numlst; AsnConstraint cnstrnt; obj=null;} - : ( INTEGER_KW (numlst = namedNumber_list {intgr.namedNumberList = numlst;} - | cnstrnt = constraint {intgr.constraint = cnstrnt;})? ) + : ( INTEGER_KW (numlst = namedNumber_list {intgr.namedNumberList = numlst;})? + (cnstrnt = constraint {intgr.constraint = cnstrnt;})? ) {obj = intgr ; numlst = null ; cnstrnt = null; intgr = null; } ; From cf656c00778c4dac00436a769c24d3c8332be23c Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 19 May 2025 15:39:18 +0200 Subject: [PATCH 02/32] Allow size word between parenthesis --- BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index a454eec..77d4bfb 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -661,7 +661,9 @@ sequenceof_type returns [Object obj] {AsnSequenceOf seqof = new AsnSequenceOf(); AsnConstraint cns; obj = null; Object obj1 ; String s ;} : ( SEQUENCE_KW {seqof.isSequenceOf = true;} - (SIZE_KW {seqof.isSizeConstraint=true;}(cns = constraint {seqof.constraint = cns ;}))? OF_KW + ( (SIZE_KW {seqof.isSizeConstraint=true;}(cns = constraint {seqof.constraint = cns ;}))? | + (L_PAREN SIZE_KW {seqof.isSizeConstraint=true;}(cns = constraint {seqof.constraint = cns ;}) R_PAREN)? ) + OF_KW ( obj1 = type { if((AsnDefinedType.class).isInstance(obj1)){ seqof.isDefinedType=true; From a2afa83020a2804c7842301611f3daed1d573a52 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 19 May 2025 16:42:26 +0200 Subject: [PATCH 03/32] Correctly parse the extensibiltity of elements --- .../main/antlr/org/bn/compiler/parser/ASN1.g | 12 +++++++++-- .../parser/model/AsnElementTypeList.java | 1 + .../parser/model/AsnNamedNumberList.java | 1 + .../modules/cs/includes/choiceDecl.xsl | 20 +++++++++--------- .../resources/modules/cs/includes/enum.xsl | 18 ++++++++-------- .../modules/cs/includes/sequence.xsl | 21 +++++++++---------- .../modules/cs/includes/sequenceOfDecl.xsl | 18 ++++++++-------- 7 files changed, 50 insertions(+), 41 deletions(-) diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index 77d4bfb..3e31465 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -601,7 +601,7 @@ embedded_type returns [Object obj] enum_type returns [Object obj] {AsnEnum enumtyp = new AsnEnum() ; AsnNamedNumberList nnlst; obj = null;} - : ( ENUMERATED_KW (nnlst = namedNumber_list { enumtyp.namedNumberList = nnlst;}) ) + : ( ENUMERATED_KW (nnlst = namedNumberExtensible_list { enumtyp.namedNumberList = nnlst;}) ) {obj = enumtyp ; enumtyp=null;} ; @@ -863,6 +863,7 @@ elementType_list returns [AsnElementTypeList elelist] {elelist = new AsnElementTypeList(); AsnElementType eletyp; } : (eletyp = elementType {elelist.elements.add(eletyp); } (COMMA (eletyp = elementType {elelist.elements.add(eletyp);}))*) + (COMMA ELLIPSIS {elelist.isExtensible=true;})? ; elementType returns [AsnElementType eletyp] @@ -884,7 +885,14 @@ Object obj; AsnTag tg; String s;} } } ; - + +namedNumberExtensible_list returns [AsnNamedNumberList nnlist] +{nnlist = new AsnNamedNumberList();AsnNamedNumber nnum ; } + : ( L_BRACE (nnum= namedNumber {nnlist.namedNumbers.add(nnum); }) + (COMMA ((nnum = namedNumber {nnlist.namedNumbers.add(nnum); }) | (ELLIPSIS {nnlist.isExtensible=true;}) ) )* + R_BRACE ) + ; + namedNumber_list returns [AsnNamedNumberList nnlist] {nnlist = new AsnNamedNumberList();AsnNamedNumber nnum ; } : ( L_BRACE (nnum= namedNumber {nnlist.namedNumbers.add(nnum); }) diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java index 5ea0719..f337d35 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java @@ -5,6 +5,7 @@ public class AsnElementTypeList { public ArrayList elements; + public boolean isExtensible; public AsnElementTypeList() { elements = new ArrayList<>(); diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java index 1350e03..e2a0efb 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java @@ -5,6 +5,7 @@ public class AsnNamedNumberList { public ArrayList namedNumbers; + public boolean isExtensible; public AsnNamedNumberList() { namedNumbers = new ArrayList<>(); diff --git a/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl b/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl index e3e2143..6b3d578 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl @@ -30,20 +30,20 @@ - [ASN1PreparedElement] - [ASN1Choice ( Name = "" )] + [ASN1PreparedElement] + [ASN1Choice ( Name = "", IsExtensible = "" )] public class : IASN1PreparedElement { - true - + true + - public void initWithDefaults() - { - } + public void initWithDefaults() + { + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof()); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof()); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } } diff --git a/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl b/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl index 3c407db..993c64c 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl @@ -37,7 +37,7 @@ [ASN1PreparedElement] - [ASN1Enum ( Name = "")] + [ASN1Enum ( Name = "", IsExtensible = "")] public class : IASN1PreparedElement { public enum EnumType { @@ -49,19 +49,19 @@ { get { return val; } set { val = value; } - } + } - public void initWithDefaults() - { - } + public void initWithDefaults() + { + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof()); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof()); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } + - } diff --git a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl index f0e8b26..495be3f 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl @@ -40,24 +40,23 @@ [ASN1PreparedElement] - [ASN1Sequence ( Name = "", IsSet = truefalse )] + [ASN1Sequence ( Name = "", IsExtensible = "", IsSet = truefalse )] public class : IASN1PreparedElement { - - + + public void initWithDefaults() { - - - - } + + + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof()); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof()); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } diff --git a/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl b/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl index d90eb93..ccca1b4 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl @@ -26,17 +26,17 @@ - - - - - - - + + + + + + + - + -[ASN1SequenceOf( Name = "", IsSetOf = truefalse )] +[ASN1SequenceOf( Name = "", IsExtensible = "", IsSetOf = truefalse )] From 0ecc30702ca71e5b2a8953845a66b9ed0878b017 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 19 May 2025 16:49:47 +0200 Subject: [PATCH 04/32] Add some corner cases to the test --- .../org/bn/compiler/parser/ASNParserTest.java | 136 +++++++++--------- BNCompiler/src/test/resources/test.asn | 17 ++- 2 files changed, 83 insertions(+), 70 deletions(-) diff --git a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java index 11262c0..c9ef65b 100644 --- a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java +++ b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java @@ -1,68 +1,68 @@ -/* - Copyright 2006-2011 Abdulla Abdurakhmanov (abdulla@latestbit.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -package org.bn.compiler.parser; - -import java.io.File; -import java.io.InputStream; -import jakarta.xml.bind.JAXBContext; -import jakarta.xml.bind.Marshaller; -import org.bn.compiler.parser.model.ASN1Model; -import org.bn.compiler.parser.model.ASNModule; -import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.Test; - -public class ASNParserTest { - - private ASN1Model createFromStream() throws Exception { - InputStream stream = getClass().getResourceAsStream("/test.asn"); - ASNLexer lexer = new ASNLexer(stream); - ASNParser parser = new ASNParser(lexer); - ASNModule module = new ASNModule(); - - parser.module_definition(module); - - ASN1Model model = new ASN1Model(); - model.module = module; - return model; - } - - @Test - public void testJaxb() throws Exception { - ASN1Model model = createFromStream(); - model.outputDirectory = "testworkdir" + File.separator + "output"; - model.moduleNS = "test_asn"; - - Marshaller marshaller = JAXBContext.newInstance("org.bn.compiler.parser.model").createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - marshaller.marshal(model, System.out); - //marshaller.marshal(model, new FileOutputStream("temp.xml")); - } - - /** - * @see ASNParser#module_definition(ASNModule) - */ - @Test - public void testModule_definition() throws Exception { - ASN1Model model = createFromStream(); - - assertEquals("TEST_ASN", model.module.moduleIdentifier.name); - assertEquals(20, model.module.asnTypes.sequenceSets.size()); - assertEquals(2, model.module.asnTypes.enums.size()); - assertEquals(8, model.module.asnTypes.characterStrings.size()); - assertEquals(1, model.module.asnTypes.octetStrings.size()); - assertEquals(8, model.module.asnTypes.sequenceSetsOf.size()); - } -} +/* + Copyright 2006-2011 Abdulla Abdurakhmanov (abdulla@latestbit.com) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ +package org.bn.compiler.parser; + +import java.io.File; +import java.io.InputStream; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Marshaller; +import org.bn.compiler.parser.model.ASN1Model; +import org.bn.compiler.parser.model.ASNModule; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + +public class ASNParserTest { + + private ASN1Model createFromStream() throws Exception { + InputStream stream = getClass().getResourceAsStream("/test.asn"); + ASNLexer lexer = new ASNLexer(stream); + ASNParser parser = new ASNParser(lexer); + ASNModule module = new ASNModule(); + + parser.module_definition(module); + + ASN1Model model = new ASN1Model(); + model.module = module; + return model; + } + + @Test + public void testJaxb() throws Exception { + ASN1Model model = createFromStream(); + model.outputDirectory = "testworkdir" + File.separator + "output"; + model.moduleNS = "test_asn"; + + Marshaller marshaller = JAXBContext.newInstance("org.bn.compiler.parser.model").createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + marshaller.marshal(model, System.out); + //marshaller.marshal(model, new FileOutputStream("temp.xml")); + } + + /** + * @see ASNParser#module_definition(ASNModule) + */ + @Test + public void testModule_definition() throws Exception { + ASN1Model model = createFromStream(); + + assertEquals("TEST_ASN", model.module.moduleIdentifier.name); + assertEquals(20, model.module.asnTypes.sequenceSets.size()); + assertEquals(2, model.module.asnTypes.enums.size()); + assertEquals(8, model.module.asnTypes.characterStrings.size()); + assertEquals(1, model.module.asnTypes.octetStrings.size()); + assertEquals(9, model.module.asnTypes.sequenceSetsOf.size()); + } +} diff --git a/BNCompiler/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index c67f262..c84f45e 100644 --- a/BNCompiler/src/test/resources/test.asn +++ b/BNCompiler/src/test/resources/test.asn @@ -6,6 +6,11 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara TestIR ::= INTEGER (1 .. 5) TestI8 ::= INTEGER (0 .. 255) + TestI8named ::= INTEGER { + a(1), + b(2), + d(5) + } (0 .. 253) TestI14 ::= INTEGER (0 .. 16384) TestI16 ::= INTEGER (0 .. 65535) TestI32 ::= INTEGER (0 .. 4294967295) @@ -41,7 +46,8 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara intBndType [7] INTEGER (0 .. 255), stringArray [8] SEQUENCE OF PrintableString, dataArray [9] SEQUENCE OF Data, - extension ANY OPTIONAL + extension ANY OPTIONAL, + ... } DataSeqMO ::= SEQUENCE { @@ -136,6 +142,7 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara video_avi (402), -- extension *.avi video_quicktime (403), -- extension *.qt;*.mov video_x_msvideo (404), -- extension *.avi + ..., application_smil (500) -- SMIL } @@ -292,7 +299,11 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara field1 [0] INTEGER, field2 [1] OCTET STRING OPTIONAL, field3 [2] UTF8String DEFAULT field3Default, - field4 [3] INTEGER + field4 [3] INTEGER, + field5 INTEGER { + c(16), + e(31) + } (-4..251) } TestTParent ::= TestParent @@ -330,6 +341,8 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara field3 [2] INTEGER } + TestSeqSize ::= SEQUENCE (SIZE(0..40)) OF INTEGER + FQDN ::= VisibleString( FROM ( "a".."z" | "A".."Z" |"0".."9"| ".-" ) From 4160bb2200cd35860be364712ea6fa4e83fec0da Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Tue, 20 May 2025 19:56:41 +0200 Subject: [PATCH 05/32] Move project to .NET9 --- BinaryNotes.NET/BinaryNotes.sln | 27 +- .../BinaryNotes/BinaryNotes.csproj | 263 +----------------- .../BinaryNotesTests/BinaryNotesTests.csproj | 211 ++------------ .../org/bn/coders/DecoderTest.cs | 55 ++-- 4 files changed, 71 insertions(+), 485 deletions(-) diff --git a/BinaryNotes.NET/BinaryNotes.sln b/BinaryNotes.NET/BinaryNotes.sln index 51213c2..99b114c 100644 --- a/BinaryNotes.NET/BinaryNotes.sln +++ b/BinaryNotes.NET/BinaryNotes.sln @@ -1,9 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinaryNotes", "BinaryNotes\BinaryNotes.csproj", "{7BB91554-CA9A-4F6E-91CB-E34410F215A7}" +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinaryNotes", "BinaryNotes\BinaryNotes.csproj", "{C837127F-8A68-4261-ACE6-BC7E4B9D3B80}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinaryNotesTests", "BinaryNotesTests\BinaryNotesTests.csproj", "{8776B434-A39C-445E-B989-CCC9E09F9E73}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinaryNotesTests", "BinaryNotesTests\BinaryNotesTests.csproj", "{124F6E46-207D-4D9E-9EDB-EEC964A81796}" + ProjectSection(ProjectDependencies) = postProject + {C837127F-8A68-4261-ACE6-BC7E4B9D3B80} = {C837127F-8A68-4261-ACE6-BC7E4B9D3B80} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,14 +16,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7BB91554-CA9A-4F6E-91CB-E34410F215A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7BB91554-CA9A-4F6E-91CB-E34410F215A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7BB91554-CA9A-4F6E-91CB-E34410F215A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7BB91554-CA9A-4F6E-91CB-E34410F215A7}.Release|Any CPU.Build.0 = Release|Any CPU - {8776B434-A39C-445E-B989-CCC9E09F9E73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8776B434-A39C-445E-B989-CCC9E09F9E73}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8776B434-A39C-445E-B989-CCC9E09F9E73}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8776B434-A39C-445E-B989-CCC9E09F9E73}.Release|Any CPU.Build.0 = Release|Any CPU + {C837127F-8A68-4261-ACE6-BC7E4B9D3B80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C837127F-8A68-4261-ACE6-BC7E4B9D3B80}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C837127F-8A68-4261-ACE6-BC7E4B9D3B80}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C837127F-8A68-4261-ACE6-BC7E4B9D3B80}.Release|Any CPU.Build.0 = Release|Any CPU + {124F6E46-207D-4D9E-9EDB-EEC964A81796}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {124F6E46-207D-4D9E-9EDB-EEC964A81796}.Debug|Any CPU.Build.0 = Debug|Any CPU + {124F6E46-207D-4D9E-9EDB-EEC964A81796}.Release|Any CPU.ActiveCfg = Release|Any CPU + {124F6E46-207D-4D9E-9EDB-EEC964A81796}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BinaryNotes.NET/BinaryNotes/BinaryNotes.csproj b/BinaryNotes.NET/BinaryNotes/BinaryNotes.csproj index 5a7dc3f..cdc91ea 100644 --- a/BinaryNotes.NET/BinaryNotes/BinaryNotes.csproj +++ b/BinaryNotes.NET/BinaryNotes/BinaryNotes.csproj @@ -1,258 +1,9 @@ - - + + - Local - 2.0 - Debug - AnyCPU - - - - - BinaryNotes - - - JScript - Grid - IE50 - false - Library - BinaryNotes - false - OnBuildSuccess - - - - - {7BB91554-CA9A-4F6E-91CB-E34410F215A7} - v4.0 - - - 2.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - Client + net9.0 + enable + enable - - bin\debug\ - false - 285212672 - false - - - TRACE;DEBUG - - - true - 4096 - false - - - false - false - false - 4 - full - prompt - AllRules.ruleset - - - bin\release\ - false - 285212672 - false - - - - - bin\release\BinaryNotes.xml - true - 4096 - false - - - false - false - false - 4 - full - prompt - true - AllRules.ruleset - - - - - - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - - Code - - - - - Code - - - Code - - - Code - - - - - - - - - - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - \ No newline at end of file + + diff --git a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj index 2d688f0..50c4f44 100644 --- a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj +++ b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj @@ -1,199 +1,28 @@ - - + + - Debug - AnyCPU - {8776B434-A39C-445E-B989-CCC9E09F9E73} - Library - Properties - BinaryNotesTests - BinaryNotesTests - v4.0 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + net9.0 + latest + enable + enable + - - - 3.5 - + + + + - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - {7bb91554-ca9a-4f6e-91cb-e34410f215a7} - BinaryNotes - + + - - - - - False - - - False - - - False - - - False - - - - - - - - \ No newline at end of file + + + diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs index e0e33f6..e814813 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs @@ -17,9 +17,10 @@ limitations under the License. using Microsoft.VisualStudio.TestTools.UnitTesting; using org.bn.coders.test_asn; -using org.bn.types; +using org.bn; using org.bn.utils; using System.Collections.Generic; +using org.bn.types; namespace org.bn.coders { @@ -87,7 +88,7 @@ protected void checkDataArray(ICollection dec, ICollection std) [TestMethod] public virtual void testDecode() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream( (coderTestUtils.createDataSeqBytes())); DataSeq seq = decoder.decode(stream); @@ -109,7 +110,7 @@ protected internal virtual void checkDataSeq(DataSeq decoded, DataSeq standard) [TestMethod] public virtual void testITUDeDecode() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createITUSeqBytes())); ITUSequence seq = decoder.decode(stream); checkITUSeq(seq, coderTestUtils.createITUSeq()); @@ -129,7 +130,7 @@ private void checkITUSeq(ITUSequence decoded, ITUSequence standard) [TestMethod] public virtual void testNullDecode() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createNullSeqBytes())); NullSequence seq = decoder.decode(stream); Assert.IsNotNull(seq); @@ -138,7 +139,7 @@ public virtual void testNullDecode() [TestMethod] public virtual void testTaggedNullDecode() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createTaggedNullSeqBytes())); TaggedNullSequence seq = decoder.decode(stream); Assert.IsNotNull(seq); @@ -147,7 +148,7 @@ public virtual void testTaggedNullDecode() [TestMethod] public virtual void testSequenceWithNullDecode() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createSeqWithNullBytes())); SequenceWithNull seq = decoder.decode(stream); Assert.IsNotNull(seq); @@ -156,7 +157,7 @@ public virtual void testSequenceWithNullDecode() [TestMethod] public virtual void testEnum() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createEnumBytes())); ContentSchema enm = decoder.decode(stream); Assert.IsNotNull(enm); @@ -171,7 +172,7 @@ private void checkContentSchema(ContentSchema decoded, ContentSchema standard) [TestMethod] public virtual void testSequenceWithEnum() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createSequenceWithEnumBytes())); SequenceWithEnum seq = decoder.decode(stream); Assert.IsNotNull(seq); @@ -180,7 +181,7 @@ public virtual void testSequenceWithEnum() [TestMethod] public virtual void testRecursiveDefinition() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createTestRecursiveDefinitionBytes())); TestRecursiveDefinetion seq = decoder.decode(stream); Assert.IsNotNull(seq); @@ -200,7 +201,7 @@ private void checkRecursiveDefinition(TestRecursiveDefinetion decoded, TestRecur [TestMethod] public virtual void testDecodeInteger() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createTestInteger4Bytes())); TestI32 val = decoder.decode(stream); @@ -236,7 +237,7 @@ public virtual void testDecodeInteger() [TestMethod] public virtual void testDecodeString() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createTestPRNBytes())); TestPRN val = decoder.decode(stream); Assert.IsNotNull(val); @@ -256,7 +257,7 @@ public virtual void testDecodeString() [TestMethod] public virtual void testDecodeStringArray() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createStringArrayBytes())); StringArray val = decoder.decode(stream); Assert.IsNotNull(val); @@ -266,7 +267,7 @@ public virtual void testDecodeStringArray() [TestMethod] public virtual void testDecodeChoice() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createDataChoicePlainBytes())); Data choice = new Data(); Data val = decoder.decode(stream); @@ -302,7 +303,7 @@ public virtual void testDecodeChoice() [TestMethod] public virtual void testDecodeNegativeInteger() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestNIBytes()); TestNI val = decoder.decode(stream); Assert.AreEqual(val.Value, coderTestUtils.createTestNI().Value); @@ -315,7 +316,7 @@ public virtual void testDecodeNegativeInteger() [TestMethod] public virtual void testDecodeSet() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createSetBytes()); SetWithDefault val = decoder.decode(stream); Assert.AreEqual(val.Nodefault, coderTestUtils.createSet().Nodefault); @@ -326,7 +327,7 @@ public virtual void testDecodeSet() [TestMethod] public virtual void testDecodeBitStr() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestBitStrBytes()); TestBitStr val = decoder.decode(stream); Assert.AreEqual(val.Value.TrailBitsCnt, coderTestUtils.createTestBitStr().Value.TrailBitsCnt); @@ -336,7 +337,7 @@ public virtual void testDecodeBitStr() [TestMethod] public virtual void testDecodeUnicodeStr() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createUnicodeStrBytes()); TestUnicodeStr val = decoder.decode(stream); Assert.AreEqual(val.Value, coderTestUtils.createUnicodeStr().Value); @@ -351,7 +352,7 @@ protected void checkBitString(BitString decoded, BitString standard) [TestMethod] public void testDecodeVersion1_2() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestSequenceV12Bytes()); TestSequenceV12 val = decoder.decode(stream); Assert.AreEqual(val.AttrStr, coderTestUtils.createTestSequenceV12().AttrStr); @@ -367,7 +368,7 @@ public void testDecodeVersion1_2() [TestMethod] public void testDecodeChoiceInChoice() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createChoiceInChoiceBytes()); BugValueType val = decoder.decode(stream); Assert.AreEqual(val.isBugPrimitiveSelected(), coderTestUtils.createChoiceInChoice().isBugPrimitiveSelected()); @@ -378,7 +379,7 @@ public void testDecodeChoiceInChoice() [TestMethod] public void testDecodeTaggedSeqInSeq() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTaggedSeqInSeqBytes()); TaggedSeqInSeq val = decoder.decode(stream); Assert.AreEqual(val.Value.Field.Param_name, coderTestUtils.createTaggedSeqInSeq().Value.Field.Param_name); @@ -388,7 +389,7 @@ public void testDecodeTaggedSeqInSeq() [TestMethod] public void testDecodeReal() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestReal1_5Bytes()); TestReal val = decoder.decode(stream); Assert.AreEqual(val.Value, coderTestUtils.createTestReal1_5().Value); @@ -421,7 +422,7 @@ public void testDecodeReal() [TestMethod] public void testDecodeLongTag() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestLongTagBytes()); TestLongTag val = decoder.decode(stream); Assert.AreEqual(val.Value, coderTestUtils.createTestLongTag().Value); @@ -434,7 +435,7 @@ public void testDecodeLongTag() [TestMethod] public void testDecodeLongTag2() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestLongTag2Bytes()); TestLongTag2 val = decoder.decode(stream); Assert.IsTrue(val.isTestaSelected()); @@ -444,7 +445,7 @@ public void testDecodeLongTag2() [TestMethod] public void testDecodeCSEnum() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createCSEnumBytes()); CoderTestUtilities.TestCSEnum val = decoder.decode(stream); Assert.AreEqual(val, coderTestUtils.createCSEnum()); @@ -453,7 +454,7 @@ public void testDecodeCSEnum() [TestMethod] public virtual void testDecodeOID() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); Assert.IsNotNull(decoder); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestOID1Bytes()); @@ -489,7 +490,7 @@ public void testDecodeCSSpecific() [TestMethod] public void testDecodeTaggedSet() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); Assert.IsNotNull(decoder); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTaggedSetBytes()); @@ -500,7 +501,7 @@ public void testDecodeTaggedSet() [TestMethod] public void testDecodeTaggedSetInSet() { - IDecoder decoder = newDecoder(); + var decoder = newDecoder(); Assert.IsNotNull(decoder); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTaggedSetInSetBytes()); From decaedb59f829a126bfadf84f67b337643486e2d Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Thu, 22 May 2025 10:34:28 +0200 Subject: [PATCH 06/32] Add a script to generate ASN output for C# testing --- .../BinaryNotesTests/test_asn_convert.py | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py diff --git a/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py new file mode 100644 index 0000000..1386405 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py @@ -0,0 +1,48 @@ +import zipfile +import os +import subprocess + +zip_path = '../../BNCompiler/target/bncompiler-1.6-dist.zip' +test_asn_path = '../../BNCompiler/src/test/resources/test.asn' +extract_to = 'bncompiler' + +os.makedirs(extract_to, exist_ok=True) + +path = os.path.dirname(os.path.abspath(__file__)); + +print(path) + +with zipfile.ZipFile(os.path.join(path, zip_path), 'r') as zip_ref: + zip_ref.extractall(os.path.join(path,extract_to)) + +java = "java" +if os.environ.get('JAVA_HOME') != None : + java = os.path.join(os.environ.get('JAVA_HOME'),java) + +jar_path = os.path.join(path, extract_to, 'bncompiler-1.6.jar') +namespace = "org.bn.coders.test_asn" + +# works with JAVA 20 +java_options = ['-Dsun.misc.URLClassPath.disableJarChecking=true', + '--add-opens', 'jdk.naming.rmi/com.sun.jndi.rmi.registry=ALL-UNNAMED', + '--add-opens', 'java.base/java.lang=ALL-UNNAMED', + '--add-opens', 'java.base/sun.security.action=ALL-UNNAMED', + '--add-opens', 'java.base/sun.net=ALL-UNNAMED'] + +cmd = [java] +cmd.extend(java_options) + +# add the specific options for the bncompiler +bn_compiler_args = [ + '-classpath', jar_path, + 'org.bn.compiler.Main', + '-m', 'cs', + '-ns', namespace, + '-o', os.path.join(path, 'org/bn/coders/test_asn'), + "-f", os.path.join(path, test_asn_path) +] +cmd.extend(bn_compiler_args) + +result = subprocess.run(cmd, capture_output=True, text=True) +print(result.stdout) +print(result.stderr) From b504fe7e2af8c4a9df2e614df7ad3c89a9da56ea Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Thu, 22 May 2025 10:34:51 +0200 Subject: [PATCH 07/32] Add the isextension option --- .../BinaryNotes/org/bn/attributes/ASN1Choice.cs | 7 +++++++ BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs | 7 +++++++ .../BinaryNotes/org/bn/attributes/ASN1Sequence.cs | 7 +++++++ .../BinaryNotes/org/bn/attributes/ASN1SequenceOf.cs | 6 ++++++ 4 files changed, 27 insertions(+) diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Choice.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Choice.cs index 333ab25..2a19c82 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Choice.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Choice.cs @@ -29,5 +29,12 @@ public string Name set { name = value; } } + private bool isExtensible = false; + + public bool IsExtensible + { + get { return isExtensible; } + set { isExtensible = value; } + } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs index 38ee612..8eca4f5 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs @@ -29,5 +29,12 @@ public string Name set { name = value; } } + private bool isExtensible = false; + + public bool IsExtensible + { + get { return isExtensible; } + set { isExtensible = value; } + } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs index 1551e09..91091d2 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs @@ -36,5 +36,12 @@ public bool IsSet set { isSet = value; } } + private bool isExtensible = false; + + public bool IsExtensible + { + get { return isExtensible; } + set { isExtensible = value; } + } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1SequenceOf.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1SequenceOf.cs index 83a1c75..ba69353 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1SequenceOf.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1SequenceOf.cs @@ -36,6 +36,12 @@ public bool IsSetOf set { isSetOf = value; } } + private bool isExtensible = false; + public bool IsExtensible + { + get { return isExtensible; } + set { isExtensible = value; } + } } } From 8ca7d7acb81ac4436cece846bd466a859a9dc069 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Thu, 22 May 2025 10:35:58 +0200 Subject: [PATCH 08/32] Update ignore .history .vscode and the unpacked bncompiler --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 7ba402c..8a18326 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ /BinaryNotes.NET/BinaryNotesTests/bin /BinaryNotes.NET/BinaryNotesTests/obj /BinaryNotes.NET/TestResults +/BinaryNotes.NET/BinaryNotesTests/bncompiler/* /Dist/target/ nbactions.xml nb-configuration.xml +/.history/* +/.vscode/* From 92f9543f07b3d42d11e1942f6c3b34f9003564fe Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Thu, 22 May 2025 10:37:28 +0200 Subject: [PATCH 09/32] Avoid duplicate file names --- BNCompiler/src/test/resources/test.asn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BNCompiler/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index c84f45e..c2d89a7 100644 --- a/BNCompiler/src/test/resources/test.asn +++ b/BNCompiler/src/test/resources/test.asn @@ -310,9 +310,9 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara TestChild3 ::= SEQUENCE { COMPONENTS OF TestTParent, - field5 [4] UTF8String, + field6 [4] UTF8String, COMPONENTS OF SEQUENCE { - field6 [5] INTEGER DEFAULT 0 + field7 [5] INTEGER DEFAULT 0 } } From 08c31782eda2b198f4e67ee293f594435e3e30b4 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Thu, 22 May 2025 10:38:43 +0200 Subject: [PATCH 10/32] Correctly write the isextension option --- .../src/main/resources/modules/cs/includes/choiceDecl.xsl | 2 +- BNCompiler/src/main/resources/modules/cs/includes/enum.xsl | 2 +- BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl | 2 +- .../src/main/resources/modules/cs/includes/sequenceOfDecl.xsl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl b/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl index 6b3d578..b48c88d 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl @@ -31,7 +31,7 @@ [ASN1PreparedElement] - [ASN1Choice ( Name = "", IsExtensible = "" )] + [ASN1Choice ( Name = "", IsExtensible = truefalse )] public class : IASN1PreparedElement { true diff --git a/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl b/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl index 993c64c..56109e1 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl @@ -37,7 +37,7 @@ [ASN1PreparedElement] - [ASN1Enum ( Name = "", IsExtensible = "")] + [ASN1Enum ( Name = "", IsExtensible = truefalse)] public class : IASN1PreparedElement { public enum EnumType { diff --git a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl index 495be3f..7f4f0d9 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl @@ -40,7 +40,7 @@ [ASN1PreparedElement] - [ASN1Sequence ( Name = "", IsExtensible = "", IsSet = truefalse )] + [ASN1Sequence ( Name = "", IsExtensible = truefalse, IsSet = truefalse )] public class : IASN1PreparedElement { diff --git a/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl b/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl index ccca1b4..8102fa8 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/sequenceOfDecl.xsl @@ -36,7 +36,7 @@ -[ASN1SequenceOf( Name = "", IsExtensible = "", IsSetOf = truefalse )] +[ASN1SequenceOf( Name = "", IsExtensible = truefalse, IsSetOf = truefalse )] From 39d49479a6ab09f90b6cfb5456b2f881ba3fb7ec Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Thu, 22 May 2025 16:37:10 +0200 Subject: [PATCH 11/32] Ordering in encoding of enums --- .../src/main/antlr/org/bn/compiler/parser/ASN1.g | 10 +++++----- .../bn/compiler/parser/model/AsnNamedNumber.java | 13 +++++++++++++ .../compiler/parser/model/AsnNamedNumberList.java | 14 ++++++++++++++ .../modules/cs/includes/valueRangeConstraint.xsl | 9 +-------- .../java/org/bn/compiler/parser/ASNParserTest.java | 2 +- BNCompiler/src/test/resources/test.asn | 10 +++++++--- .../org/bn/coders/CoderTestUtilities.cs | 13 ++++++++++--- .../BinaryNotesTests/org/bn/coders/EncoderTest.cs | 10 ++++++++++ .../org/bn/coders/ber/BERCoderTestUtils.cs | 10 +++++++--- .../org/bn/coders/per/PERAlignedCoderTestUtils.cs | 9 +++++++-- .../bn/coders/per/PERUnalignedCoderTestUtils.cs | 9 +++++++-- 11 files changed, 82 insertions(+), 27 deletions(-) diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index 3e31465..79e8ace 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -887,16 +887,16 @@ Object obj; AsnTag tg; String s;} ; namedNumberExtensible_list returns [AsnNamedNumberList nnlist] -{nnlist = new AsnNamedNumberList();AsnNamedNumber nnum ; } - : ( L_BRACE (nnum= namedNumber {nnlist.namedNumbers.add(nnum); }) - (COMMA ((nnum = namedNumber {nnlist.namedNumbers.add(nnum); }) | (ELLIPSIS {nnlist.isExtensible=true;}) ) )* +{nnlist = new AsnNamedNumberList(true);AsnNamedNumber nnum ; } + : ( L_BRACE (nnum= namedNumber {nnlist.addNamedNumber(nnum); }) + (COMMA ((nnum = namedNumber {nnlist.addNamedNumber(nnum); }) | (ELLIPSIS {nnlist.isExtensible=true;}) ) )* R_BRACE ) ; namedNumber_list returns [AsnNamedNumberList nnlist] {nnlist = new AsnNamedNumberList();AsnNamedNumber nnum ; } - : ( L_BRACE (nnum= namedNumber {nnlist.namedNumbers.add(nnum); }) - (COMMA (nnum = namedNumber {nnlist.namedNumbers.add(nnum); }) )* R_BRACE ) + : ( L_BRACE (nnum= namedNumber {nnlist.addNamedNumber(nnum); }) + (COMMA (nnum = namedNumber {nnlist.addNamedNumber(nnum); }) )* R_BRACE ) ; namedNumber returns [AsnNamedNumber nnum] diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumber.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumber.java index 7b13bb7..2d62879 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumber.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumber.java @@ -1,5 +1,7 @@ package org.bn.compiler.parser.model; +import java.math.BigInteger; + public class AsnNamedNumber { public AsnDefinedValue definedValue; @@ -7,6 +9,17 @@ public class AsnNamedNumber { public String name; public AsnSignedNumber signedNumber; + public BigInteger value() { + if (signedNumber == null) { + return null; + } + if (signedNumber.positive) { + return signedNumber.num; + } else { + return signedNumber.num.negate(); + } + } + public AsnNamedNumber() { name = ""; } diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java index e2a0efb..83d2257 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java @@ -6,11 +6,25 @@ public class AsnNamedNumberList { public ArrayList namedNumbers; public boolean isExtensible; + public boolean sortOnAddition = false; public AsnNamedNumberList() { namedNumbers = new ArrayList<>(); } + public AsnNamedNumberList(boolean sortOnAddition) { + namedNumbers = new ArrayList<>(); + this.sortOnAddition = sortOnAddition; + } + + // sort by value when adding a new named number + public void addNamedNumber(AsnNamedNumber namedNumber) { + namedNumbers.add(namedNumber); + if (sortOnAddition) { + namedNumbers.sort((a, b) -> a.value().compareTo(b.value())); + } + } + /** Returns the total number of elements in the list */ public int count() { return namedNumbers.size(); diff --git a/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl b/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl index 93ce3c3..e8dd5e1 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl @@ -29,14 +29,7 @@ - [ASN1ValueRangeConstraint ( - - Min = L, - - - Max = L - - ) ] + [ASN1ValueRangeConstraint ( Min = L, Max = L ) ] diff --git a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java index c9ef65b..67f717b 100644 --- a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java +++ b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java @@ -60,7 +60,7 @@ public void testModule_definition() throws Exception { assertEquals("TEST_ASN", model.module.moduleIdentifier.name); assertEquals(20, model.module.asnTypes.sequenceSets.size()); - assertEquals(2, model.module.asnTypes.enums.size()); + assertEquals(3, model.module.asnTypes.enums.size()); assertEquals(8, model.module.asnTypes.characterStrings.size()); assertEquals(1, model.module.asnTypes.octetStrings.size()); assertEquals(9, model.module.asnTypes.sequenceSetsOf.size()); diff --git a/BNCompiler/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index c2d89a7..a2e1858 100644 --- a/BNCompiler/src/test/resources/test.asn +++ b/BNCompiler/src/test/resources/test.asn @@ -46,8 +46,7 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara intBndType [7] INTEGER (0 .. 255), stringArray [8] SEQUENCE OF PrintableString, dataArray [9] SEQUENCE OF Data, - extension ANY OPTIONAL, - ... + extension ANY OPTIONAL } DataSeqMO ::= SEQUENCE { @@ -142,10 +141,15 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara video_avi (402), -- extension *.avi video_quicktime (403), -- extension *.qt;*.mov video_x_msvideo (404), -- extension *.avi - ..., application_smil (500) -- SMIL } + MixedEnumType ::= ENUMERATED { + high (101), + low (3), + mid (8) + } + ContentSchema ::= ENUMERATED { multipart_any (110), multipart_mixed (111), diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs index 6487813..b136f2c 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs @@ -46,9 +46,16 @@ public virtual ContentSchema createEnum() return schema; } public abstract byte[] createEnumBytes(); - - - public virtual ITUSequence createITUSeq() + + public virtual MixedEnumType createMixedEnum() + { + MixedEnumType schema = new MixedEnumType(); + schema.Value = (MixedEnumType.EnumType.high); + return schema; + } + public abstract byte[] createMixedEnumBytes(); + + public virtual ITUSequence createITUSeq() { ITUSequence seq = new ITUSequence(); seq.Type1 = "aaaaa"; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs index 5ec3d97..5acfb8d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs @@ -145,6 +145,16 @@ public virtual void testEnum() checkEncoded(encoder, coderTestUtils.createEnum(), coderTestUtils.createEnumBytes()); } + [TestMethod] + public virtual void testMixedEnum() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + printEncoded("Mixed Enum test", encoder, coderTestUtils.createMixedEnum()); + checkEncoded(encoder, coderTestUtils.createMixedEnum(), coderTestUtils.createMixedEnumBytes()); + } + + [TestMethod] public virtual void testSequenceWithEnum() { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs index c3d32ed..eecc69c 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs @@ -60,9 +60,13 @@ public override byte[] createEnumBytes() { return new byte[]{(byte) (0x0A), (byte) (0x01), (byte) (0x6F)}; } - - - public override byte[] createSequenceWithEnumBytes() + + public override byte[] createMixedEnumBytes() + { + return new byte[] { (byte)(0x0A), (byte)(0x01), (byte)(0x65) }; + } + + public override byte[] createSequenceWithEnumBytes() { return new byte[]{(byte) (0x30), (byte) (0x0D), (byte) (0x13), (byte) (0x05), (byte) (0x61), (byte) (0x61), (byte) (0x61), (byte) (0x61), (byte) (0x61), (byte) (0x0A), (byte) (0x01), (byte) (0x6F), (byte) (0x81), (byte) (0x01), (byte) (0x6F)}; } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs index 13d7c8d..bec6769 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs @@ -38,8 +38,13 @@ public override byte[] createEnumBytes() { return new byte[]{(byte) (0x20)}; } - - public override byte[] createITUSeqBytes() + + public override byte[] createMixedEnumBytes() + { + return new byte[] { (byte)(0x80) }; + } + + public override byte[] createITUSeqBytes() { return new byte[]{(byte) (0x80), (byte) (0x05), (byte) (0x61), (byte) (0x61), (byte) (0x61), (byte) (0x61), (byte) (0x61), (byte) (0x05), (byte) (0x62), (byte) (0x62), (byte) (0x62), (byte) (0x62), (byte) (0x62), (byte) (0x05), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x05), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x05), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x63), (byte) (0x05), (byte) (0x64), (byte) (0x64), (byte) (0x64), (byte) (0x64), (byte) (0x64), (byte) (0x05), (byte) (0x65), (byte) (0x65), (byte) (0x65), (byte) (0x65), (byte) (0x65)}; } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index 5d034db..d2b192b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -38,8 +38,13 @@ public override byte[] createEnumBytes() { return new byte[]{(byte) (0x20)}; } - - public override byte[] createITUSeqBytes() + + public override byte[] createMixedEnumBytes() + { + return new byte[] { (byte)(0x80) }; + } + + public override byte[] createITUSeqBytes() { return new byte[]{(byte) (0x82), (byte) (0xE1), (byte) (0xC3), (byte) (0x87), (byte) (0x0E), (byte) (0x10), (byte) (0x5C), (byte) (0x58), (byte) (0xB1), (byte) (0x62), (byte) (0xC4), (byte) (0x0B), (byte) (0x8F), (byte) (0x1E), (byte) (0x3C), (byte) (0x78), (byte) (0xC1), (byte) (0x71), (byte) (0xE3), (byte) (0xC7), (byte) (0x8F), (byte) (0x18), (byte) (0x2E), (byte) (0x3C), (byte) (0x78), (byte) (0xF1), (byte) (0xE3), (byte) (0x05), (byte) (0xC9), (byte) (0x93), (byte) (0x26), (byte) (0x4C), (byte) (0x80), (byte) (0xB9), (byte) (0x72), (byte) (0xE5), (byte) (0xCB), (byte) (0x94)}; } From a6d9b8424210ffd8780074321d46a9efc83cf1dc Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Fri, 23 May 2025 11:49:03 +0200 Subject: [PATCH 12/32] Make encoding and decoding of enums with extension marker work --- .../main/antlr/org/bn/compiler/parser/ASN1.g | 10 ++-- .../parser/model/AsnNamedNumberList.java | 29 ++++++++-- .../resources/modules/cs/includes/enum.xsl | 2 +- .../org/bn/compiler/parser/ASNParserTest.java | 4 +- BNCompiler/src/test/resources/test.asn | 12 +++++ .../BinaryNotes/org/bn/attributes/ASN1Enum.cs | 8 +++ .../org/bn/coders/per/PERAlignedDecoder.cs | 21 +++++++- .../org/bn/coders/per/PERAlignedEncoder.cs | 53 +++++++++++++------ .../org/bn/metadata/ASN1EnumMetadata.cs | 15 ++++++ .../org/bn/coders/CoderTestUtilities.cs | 21 ++++++++ .../org/bn/coders/DecoderTest.cs | 24 +++++++++ .../org/bn/coders/EncoderTest.cs | 26 +++++++++ .../org/bn/coders/ber/BERCoderTestUtils.cs | 11 +++- .../bn/coders/per/PERAlignedCoderTestUtils.cs | 11 +++- .../coders/per/PERUnalignedCoderTestUtils.cs | 11 +++- 15 files changed, 228 insertions(+), 30 deletions(-) diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index 79e8ace..26bbb5a 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -888,15 +888,17 @@ Object obj; AsnTag tg; String s;} namedNumberExtensible_list returns [AsnNamedNumberList nnlist] {nnlist = new AsnNamedNumberList(true);AsnNamedNumber nnum ; } - : ( L_BRACE (nnum= namedNumber {nnlist.addNamedNumber(nnum); }) - (COMMA ((nnum = namedNumber {nnlist.addNamedNumber(nnum); }) | (ELLIPSIS {nnlist.isExtensible=true;}) ) )* + : ( L_BRACE (nnum= namedNumber {nnlist.addNamedNumber(nnum, false); }) // first element + (COMMA (nnum = namedNumber {nnlist.addNamedNumber(nnum, false); }))* // more elements + ((COMMA (ELLIPSIS {nnlist.isExtensible=true;}) ) // extension marker + (COMMA (nnum = namedNumber {nnlist.addNamedNumber(nnum, true); }))*)? // extended elements R_BRACE ) ; namedNumber_list returns [AsnNamedNumberList nnlist] {nnlist = new AsnNamedNumberList();AsnNamedNumber nnum ; } - : ( L_BRACE (nnum= namedNumber {nnlist.addNamedNumber(nnum); }) - (COMMA (nnum = namedNumber {nnlist.addNamedNumber(nnum); }) )* R_BRACE ) + : ( L_BRACE (nnum= namedNumber {nnlist.addNamedNumber(nnum, false); }) + (COMMA (nnum = namedNumber {nnlist.addNamedNumber(nnum, false); }) )* R_BRACE ) ; namedNumber returns [AsnNamedNumber nnum] diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java index 83d2257..e5eb3b2 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnNamedNumberList.java @@ -1,15 +1,18 @@ package org.bn.compiler.parser.model; import java.util.ArrayList; +import java.math.BigInteger; public class AsnNamedNumberList { public ArrayList namedNumbers; public boolean isExtensible; public boolean sortOnAddition = false; + public int numRootElements = 0; public AsnNamedNumberList() { namedNumbers = new ArrayList<>(); + numRootElements = 0; } public AsnNamedNumberList(boolean sortOnAddition) { @@ -18,10 +21,28 @@ public AsnNamedNumberList(boolean sortOnAddition) { } // sort by value when adding a new named number - public void addNamedNumber(AsnNamedNumber namedNumber) { - namedNumbers.add(namedNumber); - if (sortOnAddition) { - namedNumbers.sort((a, b) -> a.value().compareTo(b.value())); + public void addNamedNumber(AsnNamedNumber namedNumber, boolean extendedElement) { + + if (!extendedElement) { + numRootElements++; + namedNumbers.add(namedNumber); + if (sortOnAddition) { + namedNumbers.sort((a, b) -> a.value().compareTo(b.value())); + } + } else { + if (sortOnAddition) { + // find the maximum value in the namedNumbers list by value + BigInteger maxValue = namedNumbers.stream() + .map(AsnNamedNumber::value) + .max(BigInteger::compareTo) + .orElse(BigInteger.valueOf(Integer.MIN_VALUE)); + + if (namedNumber.value().compareTo(maxValue) > 0) { + namedNumbers.add(namedNumber); + } else { + throw new IllegalArgumentException("The new named number's value must be greater than all existing values in the list."); + } + } } } diff --git a/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl b/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl index 56109e1..edf4431 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl @@ -37,7 +37,7 @@ [ASN1PreparedElement] - [ASN1Enum ( Name = "", IsExtensible = truefalse)] + [ASN1Enum ( Name = "", IsExtensible = truefalse, NumRootElements = )] public class : IASN1PreparedElement { public enum EnumType { diff --git a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java index 67f717b..943ff16 100644 --- a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java +++ b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java @@ -59,8 +59,8 @@ public void testModule_definition() throws Exception { ASN1Model model = createFromStream(); assertEquals("TEST_ASN", model.module.moduleIdentifier.name); - assertEquals(20, model.module.asnTypes.sequenceSets.size()); - assertEquals(3, model.module.asnTypes.enums.size()); + assertEquals(21, model.module.asnTypes.sequenceSets.size()); + assertEquals(4, model.module.asnTypes.enums.size()); assertEquals(8, model.module.asnTypes.characterStrings.size()); assertEquals(1, model.module.asnTypes.octetStrings.size()); assertEquals(9, model.module.asnTypes.sequenceSetsOf.size()); diff --git a/BNCompiler/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index a2e1858..759fa9d 100644 --- a/BNCompiler/src/test/resources/test.asn +++ b/BNCompiler/src/test/resources/test.asn @@ -400,4 +400,16 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara Set7 ::= [APPLICATION 90] IMPLICIT SET { set6 Set6 } + + ProtectedZoneType ::= ENUMERATED { + permanentCenDsrcTolling(0), + ..., + temporaryCenDsrcTolling(1) + } + + ExtendedEnumSeq ::= SEQUENCE { + prot ProtectedZoneType, + tail INTEGER (0..255) + } + END diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs index 8eca4f5..c0ed791 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs @@ -36,5 +36,13 @@ public bool IsExtensible get { return isExtensible; } set { isExtensible = value; } } + + private int numRootElements; + + public int NumRootElements + { + get { return numRootElements; } + set { numRootElements = value; } + } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs index f367bc2..363b0e2 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs @@ -416,7 +416,26 @@ public override DecodedObject decodeEnumItem(DecodedObject decod if (max <= 0) throw new Exception("Unable to present any enum item!"); - int enumItemIdx = (int)decodeConstraintNumber(min, max - 1, (BitArrayInputStream) stream); + var enumMeta = (ASN1EnumMetadata)(((IASN1PreparedElement)(elementInfo.PreparedInstance)).PreparedData.TypeMetadata); + int enumItemIdx; + if (enumMeta.IsExtensible) + { + // read the extension bit + int isExtended = ((BitArrayInputStream)stream).readBit(); + if (isExtended == 0) + { + // not extend, read the remainder as a constraint number + enumItemIdx = (int)decodeConstraintNumber(min, enumMeta.NumRootElements-1, (BitArrayInputStream)stream); + } else + { + // extend, read the remainder as a normal small number + enumItemIdx = (int)decodeNormallySmallNumber((BitArrayInputStream)stream) + enumMeta.NumRootElements; + } + } + else + { + enumItemIdx = (int)decodeConstraintNumber(min, max - 1, (BitArrayInputStream)stream); + } DecodedObject result = new DecodedObject(); int idx = 0; foreach (FieldInfo enumItem in enumClass.GetFields()) diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs index 3a80b92..0d205eb 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs @@ -199,7 +199,7 @@ protected virtual int encodeSemiConstraintNumber(int val, int min, BitArrayOutpu protected virtual int encodeNormallySmallNumber(int val, BitArrayOutputStream stream) { int result = 0; - if (val > 0 && val < 64) + if (val >= 0 && val < 64) { /* 10.6.1 If the non-negative whole number, "n", is less than * or equal to 63, then a single-bit bit-field shall be appended @@ -513,25 +513,48 @@ public override int encodeChoice(object obj, System.IO.Stream stream, ElementInf } public override int encodeEnumItem(object enumConstant, System.Type enumClass, System.IO.Stream stream, ElementInfo elementInfo) - { - ASN1EnumItem enumObj = elementInfo.getAttribute(); - //int min = 0, max = enumClass.GetFields().Length, val = 0; + { + ASN1EnumItem enumObj = elementInfo.getAttribute(); + int result = 0; int min = 0, max = 0, val = 0; + foreach (FieldInfo enumItem in enumClass.GetFields()) - { + { if (CoderUtils.isAttributePresent(enumItem)) - { - ASN1EnumItem enumItemObj = CoderUtils.getAttribute(enumItem); - if (enumItemObj.Tag == enumObj.Tag) + { + ASN1EnumItem enumItemObj = CoderUtils.getAttribute(enumItem); + if (enumItemObj.Tag == enumObj.Tag) val = max; - max++; //val++; - } - } - if (max > 0) - return encodeConstraintNumber(val, min, max, (BitArrayOutputStream) stream); - else + max++; + } + } + + if (max < 0) + { throw new Exception("Unable to present any enum item!"); - } + } + + var enumMeta = (ASN1EnumMetadata)(((IASN1PreparedElement)(elementInfo.PreparedInstance)).PreparedData.TypeMetadata); + + if (enumMeta.IsExtensible) + { + result = 1; + if (val >= enumMeta.NumRootElements) + { + ((BitArrayOutputStream)stream).writeBit(true); + return result + encodeNormallySmallNumber(val - enumMeta.NumRootElements, (BitArrayOutputStream)stream); + } + else + { + ((BitArrayOutputStream)stream).writeBit(false); + return result + encodeConstraintNumber(val, min, enumMeta.NumRootElements-1, (BitArrayOutputStream)stream); + } + } + else + { + return encodeConstraintNumber(val, min, max, (BitArrayOutputStream)stream); + } + } public override int encodeBoolean(object obj, System.IO.Stream stream, ElementInfo elementInfo) { diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1EnumMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1EnumMetadata.cs index cf80fff..175aaf8 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1EnumMetadata.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1EnumMetadata.cs @@ -25,6 +25,9 @@ namespace org.bn.metadata { public class ASN1EnumMetadata : ASN1TypeMetadata { + bool isExtensible = false; + int numRootElements = 0; + public ASN1EnumMetadata(String name): base(name) { } @@ -32,6 +35,18 @@ public ASN1EnumMetadata(String name): base(name) public ASN1EnumMetadata(ASN1Enum annotation) : this(annotation.Name) { + isExtensible = annotation.IsExtensible; + numRootElements = annotation.NumRootElements; + } + + public bool IsExtensible + { + get { return isExtensible; } + } + + public int NumRootElements + { + get { return numRootElements; } } public override int encode(IASN1TypesEncoder encoder, object obj, Stream stream, ElementInfo elementInfo) diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs index b136f2c..47c9a22 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs @@ -631,5 +631,26 @@ public Test128Tag createTest128Tag() public abstract byte[] createTest128TagBytes(); + public ExtendedEnumSeq createTestExtendedEnum1() + { + ExtendedEnumSeq seq = new ExtendedEnumSeq(); + seq.Prot = new(); + seq.Prot.Value = ProtectedZoneType.EnumType.permanentCenDsrcTolling; + seq.Tail = 0x19; + return seq; + } + + public abstract byte[] createTestExtendedEnum1Bytes(); + + public ExtendedEnumSeq createTestExtendedEnum2() + { + ExtendedEnumSeq seq = new ExtendedEnumSeq(); + seq.Prot = new(); + seq.Prot.Value = ProtectedZoneType.EnumType.temporaryCenDsrcTolling; + seq.Tail = 0x19; + return seq; + } + + public abstract byte[] createTestExtendedEnum2Bytes(); } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs index e814813..4976fa0 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs @@ -510,5 +510,29 @@ public void testDecodeTaggedSetInSet() stream = new System.IO.MemoryStream(coderTestUtils.createSet7Bytes()); Set7 set7 = decoder.decode(stream); } + + [TestMethod] + public void testEncodeExtendedEnum1() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedEnum1Bytes()); + ExtendedEnumSeq extendedEnumSeq = decoder.decode(stream); + Assert.AreEqual(extendedEnumSeq.Prot.Value, coderTestUtils.createTestExtendedEnum1().Prot.Value); + Assert.AreEqual(extendedEnumSeq.Tail, coderTestUtils.createTestExtendedEnum1().Tail); + } + + [TestMethod] + public void testEncodeExtendedEnum2() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedEnum2Bytes()); + ExtendedEnumSeq extendedEnumSeq = decoder.decode(stream); + Assert.AreEqual(extendedEnumSeq.Prot.Value, coderTestUtils.createTestExtendedEnum2().Prot.Value); + Assert.AreEqual(extendedEnumSeq.Tail, coderTestUtils.createTestExtendedEnum2().Tail); + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs index 5acfb8d..00c6ed1 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs @@ -293,6 +293,14 @@ public virtual void testEncodeBitStringSmall() { checkEncoded(encoder, coderTestUtils.createTestBitStrSmall(), coderTestUtils.createTestBitStrSmallBytes()); } + //public virtual void testEncodeBitStringNamed() + //{ + // IEncoder encoder = newEncoder(); + // Assert.IsNotNull(encoder); + // printEncoded("TestBitStrNamed test", encoder, coderTestUtils.createTestBitStrNamed()); + // checkEncoded(encoder, coderTestUtils.createTestBitStrNamed(), coderTestUtils.createTestBitStrNamedBytes()); + //} + [TestMethod] public virtual void testEncodeUnicodeString() { IEncoder encoder = newEncoder(); @@ -445,5 +453,23 @@ public void testEncodeTaggedSetInSet() { printEncoded("Set7", encoder, set7); checkEncoded(encoder, coderTestUtils.createSet7(), coderTestUtils.createSet7Bytes()); } + + [TestMethod] + public virtual void testEncodeExtendedEnum1() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + printEncoded("TestExtendedEnum test", encoder, coderTestUtils.createTestExtendedEnum1()); + checkEncoded(encoder, coderTestUtils.createTestExtendedEnum1(), coderTestUtils.createTestExtendedEnum1Bytes()); + } + + [TestMethod] + public virtual void testEncodeExtendedEnum2() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + printEncoded("TestExtendedEnum test", encoder, coderTestUtils.createTestExtendedEnum2()); + checkEncoded(encoder, coderTestUtils.createTestExtendedEnum2(), coderTestUtils.createTestExtendedEnum2Bytes()); + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs index eecc69c..af4f5fb 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs @@ -339,5 +339,14 @@ public override byte[] createTest128TagBytes() return new byte[] { 0x5F,0x81,0x00,0x01,0x0A }; } - } + public override byte[] createTestExtendedEnum1Bytes() + { + return new byte[] { 0x30, 0x06, 0x0a, 0x01, 0x00, 0x02, 0x01, 0x19 }; + } + + public override byte[] createTestExtendedEnum2Bytes() + { + return new byte[] { 0x30, 0x06, 0x0a, 0x01, 0x01, 0x02, 0x01, 0x19 }; + } + } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs index bec6769..ab73960 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs @@ -317,5 +317,14 @@ public override byte[] createTest128TagBytes() return new byte[] { 0x01, 0x0A }; } - } + public override byte[] createTestExtendedEnum1Bytes() + { + return new byte[] { 0x00, 0x19 }; + } + + public override byte[] createTestExtendedEnum2Bytes() + { + return new byte[] { 0x80, 0x19 }; + } + } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index d2b192b..023af03 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -317,5 +317,14 @@ public override byte[] createTest128TagBytes() return new byte[] { 0x01, 0x0A }; } - } + public override byte[] createTestExtendedEnum1Bytes() + { + return new byte[] { 0x0C, 0x80 }; + } + + public override byte[] createTestExtendedEnum2Bytes() + { + return new byte[] { 0x80, 0x19 }; + } + } } From febee12763f192782af967dbb2dd36f91e95150a Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Fri, 23 May 2025 16:15:43 +0200 Subject: [PATCH 13/32] Add sequence with extension encoding and decoding --- .../main/antlr/org/bn/compiler/parser/ASN1.g | 7 +- .../parser/model/AsnElementTypeList.java | 8 ++ .../modules/cs/includes/sequence.xsl | 2 +- .../org/bn/compiler/parser/ASNParserTest.java | 2 +- BNCompiler/src/test/resources/test.asn | 22 +++ .../org/bn/attributes/ASN1Sequence.cs | 8 ++ .../BinaryNotes/org/bn/coders/Encoder.cs | 24 +++- .../org/bn/coders/per/PERAlignedDecoder.cs | 91 ++++++++++-- .../org/bn/coders/per/PERAlignedEncoder.cs | 131 +++++++++++++++--- .../org/bn/metadata/ASN1SequenceMetadata.cs | 14 ++ .../BinaryNotesTests/asn1tool_test.py | 79 +++++++++++ .../org/bn/coders/CoderTestUtilities.cs | 28 ++++ .../org/bn/coders/DecoderTest.cs | 37 +++++ .../org/bn/coders/EncoderTest.cs | 24 ++++ .../org/bn/coders/ber/BERCoderTestUtils.cs | 10 ++ .../bn/coders/per/PERAlignedCoderTestUtils.cs | 10 ++ .../coders/per/PERUnalignedCoderTestUtils.cs | 18 +++ 17 files changed, 473 insertions(+), 42 deletions(-) create mode 100644 BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index 26bbb5a..2a26f15 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -861,9 +861,10 @@ typeorvalue returns [Object obj] elementType_list returns [AsnElementTypeList elelist] {elelist = new AsnElementTypeList(); AsnElementType eletyp; } - : (eletyp = elementType {elelist.elements.add(eletyp); } - (COMMA (eletyp = elementType {elelist.elements.add(eletyp);}))*) - (COMMA ELLIPSIS {elelist.isExtensible=true;})? + : (eletyp = elementType {elelist.addElement(eletyp, false); } + (COMMA (eletyp = elementType {elelist.addElement(eletyp, false);}))* + (COMMA ELLIPSIS {elelist.isExtensible=true;} + (COMMA (eletyp = elementType {eletyp.isOptional=true; elelist.addElement(eletyp, true);}))* )? ) ; elementType returns [AsnElementType eletyp] diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java index f337d35..dcfa06a 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java @@ -6,11 +6,19 @@ public class AsnElementTypeList { public ArrayList elements; public boolean isExtensible; + public int numOfRootElements; public AsnElementTypeList() { elements = new ArrayList<>(); } + public void addElement(AsnElementType element, boolean extendedElement) { + if (!extendedElement) { + numOfRootElements++; + } + elements.add(element); + } + @Override public String toString() { return ""; diff --git a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl index 7f4f0d9..bd2cbaf 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl @@ -40,7 +40,7 @@ [ASN1PreparedElement] - [ASN1Sequence ( Name = "", IsExtensible = truefalse, IsSet = truefalse )] + [ASN1Sequence ( Name = "", IsExtensible = truefalse, IsSet = truefalse, NumRootElements = )] public class : IASN1PreparedElement { diff --git a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java index 943ff16..6b71474 100644 --- a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java +++ b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java @@ -59,7 +59,7 @@ public void testModule_definition() throws Exception { ASN1Model model = createFromStream(); assertEquals("TEST_ASN", model.module.moduleIdentifier.name); - assertEquals(21, model.module.asnTypes.sequenceSets.size()); + assertEquals(23, model.module.asnTypes.sequenceSets.size()); assertEquals(4, model.module.asnTypes.enums.size()); assertEquals(8, model.module.asnTypes.characterStrings.size()); assertEquals(1, model.module.asnTypes.octetStrings.size()); diff --git a/BNCompiler/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index 759fa9d..dce3d1d 100644 --- a/BNCompiler/src/test/resources/test.asn +++ b/BNCompiler/src/test/resources/test.asn @@ -412,4 +412,26 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara tail INTEGER (0..255) } + DataSeqExtensible ::= SEQUENCE { + simpleInt [0] INTEGER (0 .. 255), + simpleBool [1] BOOLEAN, + optBool [2] BOOLEAN OPTIONAL, + ..., + extendedInt1 [3] INTEGER (0..63), + extendedInt2 [4] INTEGER (0..100000) + } + + ChoiceType ::= CHOICE { + field10 [0] INTEGER, + field20 [1] OCTET STRING, + ..., + field30 [2] UTF8String, + field40 [3] INTEGER + } + + ExtendedChoiceSeq ::= SEQUENCE { + choi ChoiceType, + tail INTEGER (0..255) + } + END diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs index 91091d2..e922a07 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs @@ -43,5 +43,13 @@ public bool IsExtensible get { return isExtensible; } set { isExtensible = value; } } + + private int numRootElements; + + public int NumRootElements + { + get { return numRootElements; } + set { numRootElements = value; } + } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs index ea661ab..4807067 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs @@ -251,16 +251,26 @@ public virtual bool invokeSelectedMethodForField(PropertyInfo field, object obj, return (bool)method.Invoke(obj, null); } } - - public virtual int encodeSequence(object obj, System.IO.Stream stream, ElementInfo elementInfo) + + public virtual int encodeSequence(object obj, System.IO.Stream stream, ElementInfo elementInfo) + { + return encodeSequenceLimited(obj, stream, 0, elementInfo.getProperties(obj.GetType()).Length - 1, elementInfo, false); + } + + public virtual int encodeSequenceLimited(object obj, System.IO.Stream stream, int minIdx, int maxIdx, ElementInfo elementInfo, bool extended) { int resultSize = 0; PropertyInfo[] fields = elementInfo.getProperties(obj.GetType()); int fieldIdx = 0; foreach (PropertyInfo field in fields) { - resultSize += encodeSequenceField(obj, fieldIdx++, field, stream, elementInfo); - } + if ((fieldIdx >= minIdx) && (fieldIdx <= maxIdx)) + { + resultSize += encodeSequenceField(obj, fieldIdx, field, stream, elementInfo); + } + fieldIdx++; + + } return resultSize; } @@ -356,7 +366,7 @@ public virtual int encodeEnum(object obj, System.IO.Stream stream, ElementInfo e PropertyInfo field = obj.GetType().GetProperty("Value"); object result = invokeGetterMethodForField(field, obj, null); Type enumClass = null; - + foreach(MemberInfo member in obj.GetType().GetMembers()) { if (member is System.Type) @@ -377,8 +387,8 @@ public virtual int encodeEnum(object obj, System.IO.Stream stream, ElementInfo e } break; } - } - } + } + } resultSize += encodeEnumItem(result, enumClass, stream, elementInfo); return resultSize; } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs index 363b0e2..3b05b53 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs @@ -328,34 +328,60 @@ public override DecodedObject decodeChoice(DecodedObject decoded else return new DecodedObject(choice); } - - - protected virtual int getSequencePreambleBitLen(Type objectClass, ElementInfo elementInfo) + + public class ASN1SequenceFieldParsingInfo + { + public int PreambleLen = 0; + public bool IsExtensible = false; + public int NumRootElements = 0; + } + + protected virtual ASN1SequenceFieldParsingInfo getSequencePreambleBitLen(Type objectClass, ElementInfo elementInfo) { - int preambleLen = 0; ElementInfo info = new ElementInfo(); int fieldIdx = 0; - foreach (PropertyInfo field in elementInfo.getProperties(objectClass)) + + var parsingInfo = new ASN1SequenceFieldParsingInfo(); + + var fields = elementInfo.getProperties(objectClass); + + var seqMeta = (ASN1SequenceMetadata)(((IASN1PreparedElement)(elementInfo.PreparedInstance)).PreparedData.TypeMetadata); + parsingInfo.NumRootElements = fields.Length; + if ((seqMeta != null) && (seqMeta.IsExtensible)) + { + parsingInfo.NumRootElements = seqMeta.NumRootElements; + parsingInfo.IsExtensible = seqMeta.IsExtensible; + } + + foreach (PropertyInfo field in fields) { if (elementInfo.hasPreparedInfo()) info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); - if (CoderUtils.isOptionalField(field,info)) + bool isExtendeField = ((parsingInfo.NumRootElements >= 0) && (fieldIdx >= parsingInfo.NumRootElements)); + + if ((!isExtendeField) && CoderUtils.isOptionalField(field,info)) { - preambleLen++; + parsingInfo.PreambleLen++; } fieldIdx++; } - return preambleLen; + return parsingInfo; } public override DecodedObject decodeSequence(DecodedObject decodedTag, System.Type objectClass, ElementInfo elementInfo, System.IO.Stream stream) { BitArrayInputStream bitStream = (BitArrayInputStream)stream; - int preambleLen = getSequencePreambleBitLen(objectClass, elementInfo); - int preamble = bitStream.readBits(preambleLen); - int preambleCurrentBit = 32 - preambleLen; + var parsingInfo = getSequencePreambleBitLen(objectClass, elementInfo); + bool isExtended = false; + if (parsingInfo.IsExtensible) + { + isExtended = bitStream.readBit() == 1; + } + + int preamble = bitStream.readBits(parsingInfo.PreambleLen); + int preambleCurrentBit = 32 - parsingInfo.PreambleLen; skipAlignedBits(stream); object sequence = createInstanceForElement(objectClass, elementInfo); CoderUtils.initDefaultValues(sequence); @@ -393,7 +419,50 @@ public override DecodedObject decodeSequence(DecodedObject decod decodeSequenceField(null, sequence, idx, field, stream, elementInfo, true); } idx++; + + // stop when the decoder reaches the exended part of the sequence + if (parsingInfo.IsExtensible && (idx >= parsingInfo.NumRootElements)) + { + break; + } + } + + if (parsingInfo.IsExtensible && isExtended) + { + // read the extension length + var extensionLength = decodeNormallySmallNumber(bitStream) + 1; + + // read the extension bitmask + int extBitMask = bitStream.readBits(extensionLength); + + for (int extIdx = 0; extIdx < extensionLength; extIdx++) + { + int bitMask = 0x1 << (extensionLength - extIdx - 1); + if ((extBitMask & bitMask) != 0) + { + // decoded length field + int fieldLength = decodeLengthDeterminant(bitStream); + // read the corresponding data + var sequenceBuffer = new byte[fieldLength]; + bitStream.ReadExactly(sequenceBuffer, 0, fieldLength); + + int fieldIdx = extIdx + parsingInfo.NumRootElements; + // try to fined the corresponding field, if so decode it + if (fieldIdx < fields.Length) + { + PropertyInfo field = fields[fieldIdx]; + if (elementInfo.hasPreparedInfo()) + { + info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); + } + + BitArrayInputStream sequenceStream = new BitArrayInputStream(new MemoryStream(sequenceBuffer)); + decodeSequenceField(null, sequence, fieldIdx, field, sequenceStream, elementInfo, true); + } + } + } } + return new DecodedObject(sequence); /* } else diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs index 0d205eb..3d7ebc2 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs @@ -207,9 +207,9 @@ protected virtual int encodeNormallySmallNumber(int val, BitArrayOutputStream st * encoded as a non-negative-binary-integer into a 6-bit bit-field. */ stream.writeBit(0); - for (int i = 0; i < 6; i++) + for (int i = 5; i >= 0; i--) { - int bitValue = (val >> 6 - i) & 0x1; + int bitValue = (val >> i) & 0x1; stream.writeBit(bitValue); } result = 1; @@ -403,11 +403,28 @@ protected int encodeLength(int val, ElementInfo elementInfo, System.IO.Stream st return resultSize; } - public virtual int encodeSequencePreamble(object obj, PropertyInfo[] fields, System.IO.Stream stream, ElementInfo elementInfo) - { - int resultBitSize = 0; - ElementInfo info = new ElementInfo(); + public class ASN1SequenceFieldPresence { + public List PreampleVector = new(); + public List ExtensionVector = new(); + public bool IsExtensible = false; + public int MaxExtensionLength = 0; + public int NumRootElements = 0; + } + + public ASN1SequenceFieldPresence estimateFieldPresense(object obj, PropertyInfo[] fields, ElementInfo elementInfo) + { int fieldIdx = 0; + ElementInfo info = new ElementInfo(); + ASN1SequenceFieldPresence presence = new(); + + var seqMeta = (ASN1SequenceMetadata)(((IASN1PreparedElement)(elementInfo.PreparedInstance)).PreparedData.TypeMetadata); + presence.NumRootElements = fields.Length; + if ((seqMeta != null) && (seqMeta.IsExtensible)) + { + presence.NumRootElements = seqMeta.NumRootElements; + presence.IsExtensible = seqMeta.IsExtensible; + } + foreach (PropertyInfo field in fields) { if (elementInfo.hasPreparedInfo()) @@ -415,39 +432,113 @@ public virtual int encodeSequencePreamble(object obj, PropertyInfo[] fields, Sys info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); } - if(CoderUtils.isOptionalField(field,info)) - { - object invokeObjResult = invokeGetterMethodForField(field, obj, info); + bool isExtendeField = ((presence.NumRootElements >= 0) && (fieldIdx >= presence.NumRootElements)); + + if (CoderUtils.isOptionalField(field, info) || isExtendeField) + { + bool fieldResult = false; + object invokeObjResult = invokeGetterMethodForField(field, obj, info); if (invokeObjResult == null) { - ((BitArrayOutputStream)stream).writeBit(false); + fieldResult = false; } else if (CoderUtils.isDefaultField(field, info)) { object newSequenceInstance = Activator.CreateInstance(obj.GetType()); CoderUtils.initDefaultValues(newSequenceInstance); object defaultFieldValue = invokeGetterMethodForField(field, newSequenceInstance, info); - ((BitArrayOutputStream)stream).writeBit(!CoderUtils.AreEqual(defaultFieldValue, invokeObjResult)); + fieldResult = !CoderUtils.AreEqual(defaultFieldValue, invokeObjResult); } else { - ((BitArrayOutputStream)stream).writeBit(true); + fieldResult = true; } - resultBitSize += 1; - } + + // store the results + if (isExtendeField) + { + presence.ExtensionVector.Add(fieldResult); + if (fieldResult) + { + presence.MaxExtensionLength = (fieldIdx - presence.NumRootElements + 1); + } + } + else + { + presence.PreampleVector.Add(fieldResult); + } + } fieldIdx++; - } + } + return presence; + } + + public virtual int encodeSequencePreamble(ASN1SequenceFieldPresence presence, System.IO.Stream stream) + { + int resultBitSize = 0; + + foreach (var bit in presence.PreampleVector) + { + ((BitArrayOutputStream)stream).writeBit(bit); + resultBitSize += 1; + } doAlign(stream); return (resultBitSize / 8) + (resultBitSize % 8 > 0?1:0); } + public override int encodeSequenceLimited(object obj, System.IO.Stream stream, int minIdx, int maxIdx, ElementInfo elementInfo, bool extended) + { + int resultSize = 0; + PropertyInfo[] fields = elementInfo.getProperties(obj.GetType()); + int fieldIdx = 0; + foreach (PropertyInfo field in fields) + { + if ((fieldIdx >= minIdx) && (fieldIdx <= maxIdx)) + { + if (extended) { + BitArrayOutputStream extendedStream = new(); + resultSize += encodeSequenceField(obj, fieldIdx, field, extendedStream, elementInfo); + if (extendedStream.Length > 0) + { + resultSize += encodeLengthDeterminant((int)extendedStream.Length, (BitArrayOutputStream)stream); + stream.Write(extendedStream.ToArray(), 0, (int)extendedStream.Length); + } + } else + { + resultSize += encodeSequenceField(obj, fieldIdx, field, stream, elementInfo); + } + + } + fieldIdx++; + + } + return resultSize; + } + public override int encodeSequence(object obj, System.IO.Stream stream, ElementInfo elementInfo) { int resultSize = 0; if(!CoderUtils.isSequenceSet(elementInfo)) { - resultSize += encodeSequencePreamble(obj, elementInfo.getProperties(obj.GetType()), stream, elementInfo); - resultSize += base.encodeSequence(obj, stream, elementInfo); + var presence = estimateFieldPresense(obj, elementInfo.getProperties(obj.GetType()), elementInfo); + if (presence.IsExtensible) + { + ((BitArrayOutputStream)stream).writeBit((presence.MaxExtensionLength > 0)); + } + + resultSize += encodeSequencePreamble(presence, stream); + resultSize += encodeSequenceLimited(obj, stream, 0, presence.NumRootElements-1, elementInfo, false); + + if ((presence.IsExtensible) && (presence.MaxExtensionLength > 0)) + { + resultSize += encodeNormallySmallNumber(presence.MaxExtensionLength-1, (BitArrayOutputStream)stream); + // write the extension preamble + for (int extIdx=0; extIdx(stream); + var exp = coderTestUtils.createTestExtendedSeq1(); + Assert.AreEqual(got.SimpleInt, exp.SimpleInt); + Assert.AreEqual(got.SimpleBool, exp.SimpleBool); + Assert.AreEqual(got.OptBool, exp.OptBool); + Assert.AreEqual(got.ExtendedInt1, exp.ExtendedInt1); + Assert.AreEqual(got.ExtendedInt2, exp.ExtendedInt2); + } + } + + [TestMethod] + public void testEncodeExtendedSeq2() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + + if (decoder is org.bn.coders.per.PERUnalignedDecoder) + { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedSeq2Bytes()); + var got = decoder.decode(stream); + var exp = coderTestUtils.createTestExtendedSeq2(); + Assert.AreEqual(got.SimpleInt, exp.SimpleInt); + Assert.AreEqual(got.SimpleBool, exp.SimpleBool); + Assert.AreEqual(got.OptBool, exp.OptBool); + Assert.AreEqual(got.ExtendedInt1, exp.ExtendedInt1); + Assert.AreEqual(got.ExtendedInt2, exp.ExtendedInt2); + } + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs index 00c6ed1..fd6a35d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs @@ -471,5 +471,29 @@ public virtual void testEncodeExtendedEnum2() printEncoded("TestExtendedEnum test", encoder, coderTestUtils.createTestExtendedEnum2()); checkEncoded(encoder, coderTestUtils.createTestExtendedEnum2(), coderTestUtils.createTestExtendedEnum2Bytes()); } + + [TestMethod] + public virtual void testEncodeExtendedSeq1() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if ((encoder is org.bn.coders.per.PERUnalignedEncoder) || (encoder is org.bn.coders.per.PERAlignedEncoder)) + { + printEncoded("TestExtendedSeq test1", encoder, coderTestUtils.createTestExtendedSeq1()); + checkEncoded(encoder, coderTestUtils.createTestExtendedSeq1(), coderTestUtils.createTestExtendedSeq1Bytes()); + } + } + + [TestMethod] + public virtual void testEncodeExtendedSeq2() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if ((encoder is org.bn.coders.per.PERUnalignedEncoder) || (encoder is org.bn.coders.per.PERAlignedEncoder)) + { + printEncoded("TestExtendedSeq test2", encoder, coderTestUtils.createTestExtendedSeq2()); + checkEncoded(encoder, coderTestUtils.createTestExtendedSeq2(), coderTestUtils.createTestExtendedSeq2Bytes()); + } + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs index af4f5fb..321e16e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs @@ -348,5 +348,15 @@ public override byte[] createTestExtendedEnum2Bytes() { return new byte[] { 0x30, 0x06, 0x0a, 0x01, 0x01, 0x02, 0x01, 0x19 }; } + + public override byte[] createTestExtendedSeq1Bytes() + { + return new byte[] { }; + } + + public override byte[] createTestExtendedSeq2Bytes() + { + return new byte[] { }; + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs index ab73960..c96ed86 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs @@ -326,5 +326,15 @@ public override byte[] createTestExtendedEnum2Bytes() { return new byte[] { 0x80, 0x19 }; } + + public override byte[] createTestExtendedSeq1Bytes() + { + return new byte[] { 0x80, 0x45, 0x81, 0x40, 0x02, 0x00, 0x2d }; + } + + public override byte[] createTestExtendedSeq2Bytes() + { + return new byte[] { 0xc0, 0x45, 0xc0, 0xe0, 0x01, 0x44, 0x02, 0x00, 0x2d }; + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index 023af03..d511c4a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -326,5 +326,23 @@ public override byte[] createTestExtendedEnum2Bytes() { return new byte[] { 0x80, 0x19 }; } + + public override byte[] createTestExtendedSeq1Bytes() + { + // 1 1 8 1 7 2 8 6 = 34 bits + return new byte[] { 0x91, 0x60, 0x50, 0x30, 0x01, 0x68, 0x00 }; + } + + public override byte[] createTestExtendedSeq2Bytes() + { + //SimpleInt = 0x45, + //SimpleBool = true, + //OptBool = true, + //ExtendedInt1 = 0x11, + //ExtendedInt2 = 0x2D + + // 1 1 8 1 1 7 2 8 6 8 6 = 49 bits + return new byte[] { 0xd1, 0x70, 0x38, 0x0a, 0x20, 0x18, 0x00, 0xb4, 0x00 }; + } } } From b0e1033268f67dc493e8a71d5662c8af74cea274 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Sun, 25 May 2025 08:00:58 +0200 Subject: [PATCH 14/32] Allow extended elements in the middle of a sequence --- .../main/antlr/org/bn/compiler/parser/ASN1.g | 8 ++- .../compiler/parser/model/AsnElementType.java | 1 + .../parser/model/AsnElementTypeList.java | 5 +- .../modules/cs/includes/elementDecl.xsl | 2 +- .../modules/cs/includes/sequence.xsl | 2 +- BNCompiler/src/test/resources/test.asn | 2 +- .../org/bn/attributes/ASN1Element.cs | 9 +++ .../org/bn/attributes/ASN1Sequence.cs | 8 --- .../BinaryNotes/org/bn/coders/CoderUtils.cs | 16 +++++ .../BinaryNotes/org/bn/coders/Encoder.cs | 10 +-- .../org/bn/coders/per/PERAlignedDecoder.cs | 62 +++++++++---------- .../org/bn/coders/per/PERAlignedEncoder.cs | 39 +++++++----- .../org/bn/metadata/ASN1BoxedTypeMetadata.cs | 2 + .../org/bn/metadata/ASN1ElementMetadata.cs | 8 +++ .../org/bn/metadata/ASN1SequenceMetadata.cs | 13 +--- .../BinaryNotesTests/asn1tool_test.py | 37 +++++++++-- 16 files changed, 139 insertions(+), 85 deletions(-) diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index 2a26f15..ebe9206 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -863,8 +863,12 @@ elementType_list returns [AsnElementTypeList elelist] {elelist = new AsnElementTypeList(); AsnElementType eletyp; } : (eletyp = elementType {elelist.addElement(eletyp, false); } (COMMA (eletyp = elementType {elelist.addElement(eletyp, false);}))* - (COMMA ELLIPSIS {elelist.isExtensible=true;} - (COMMA (eletyp = elementType {eletyp.isOptional=true; elelist.addElement(eletyp, true);}))* )? ) + ( + (COMMA ELLIPSIS {elelist.isExtensible=true;} + (COMMA (eletyp = elementType {elelist.addElement(eletyp, true);}))* )? + (COMMA ELLIPSIS {elelist.isExtensible=true;} + (COMMA (eletyp = elementType {elelist.addElement(eletyp, false);}))*)? + ) ) ; elementType returns [AsnElementType eletyp] diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementType.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementType.java index a3305f8..11f6652 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementType.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementType.java @@ -6,6 +6,7 @@ public class AsnElementType { public boolean isDefault; public boolean isDefinedType; // Element type is defined Type public boolean isOptional; + public boolean isExtended; public boolean isTag; public boolean isTagDefault; public String name; // type diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java index dcfa06a..01d9fc6 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementTypeList.java @@ -6,16 +6,13 @@ public class AsnElementTypeList { public ArrayList elements; public boolean isExtensible; - public int numOfRootElements; public AsnElementTypeList() { elements = new ArrayList<>(); } public void addElement(AsnElementType element, boolean extendedElement) { - if (!extendedElement) { - numOfRootElements++; - } + element.isExtended = extendedElement; elements.add(element); } diff --git a/BNCompiler/src/main/resources/modules/cs/includes/elementDecl.xsl b/BNCompiler/src/main/resources/modules/cs/includes/elementDecl.xsl index 2cd28d9..2a8d38c 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/elementDecl.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/elementDecl.xsl @@ -26,6 +26,6 @@ - [ASN1Element ( Name = "", IsOptional = true false , HasTag = true, Tag = false , IsImplicitTag = false , , HasDefaultValue = true false ) ] + [ASN1Element ( Name = "", IsOptional = true false , IsExtended = true false , HasTag = true, Tag = false , IsImplicitTag = false , , HasDefaultValue = true false ) ] diff --git a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl index bd2cbaf..0e49866 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl @@ -40,7 +40,7 @@ [ASN1PreparedElement] - [ASN1Sequence ( Name = "", IsExtensible = truefalse, IsSet = truefalse, NumRootElements = )] + [ASN1Sequence ( Name = "", IsExtensible = truefalse, IsSet = truefalse)] public class : IASN1PreparedElement { diff --git a/BNCompiler/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index dce3d1d..f17c56e 100644 --- a/BNCompiler/src/test/resources/test.asn +++ b/BNCompiler/src/test/resources/test.asn @@ -417,7 +417,7 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara simpleBool [1] BOOLEAN, optBool [2] BOOLEAN OPTIONAL, ..., - extendedInt1 [3] INTEGER (0..63), + extendedInt1 [3] INTEGER (0..63) OPTIONAL, extendedInt2 [4] INTEGER (0..100000) } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Element.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Element.cs index c9d1480..720ae26 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Element.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Element.cs @@ -37,6 +37,15 @@ public bool IsOptional get { return isOptional; } set { isOptional = value; } } + + private bool isExtended = false; + + public bool IsExtended + { + get { return isExtended; } + set { isExtended = value; } + } + bool hasTag = false; public bool HasTag diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs index e922a07..91091d2 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs @@ -43,13 +43,5 @@ public bool IsExtensible get { return isExtensible; } set { isExtensible = value; } } - - private int numRootElements; - - public int NumRootElements - { - get { return numRootElements; } - set { numRootElements = value; } - } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs index 1e50e5b..b138761 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs @@ -347,6 +347,22 @@ public static bool isDefaultField(ICustomAttributeProvider field, ElementInfo el } } + public static bool isExtendedField(ICustomAttributeProvider field, ElementInfo elementInfo) + { + if (elementInfo.hasPreparedInfo()) + { + return elementInfo.hasPreparedASN1ElementInfo() && elementInfo.PreparedASN1ElementInfo.IsExtended; + } + else if (isAttributePresent(field)) + { + return getAttribute(field).IsExtended; + } + else + { + return false; + } + } + public static bool isOptional(ElementInfo elementInfo) { bool result = false; diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs index 4807067..de83821 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs @@ -254,22 +254,18 @@ public virtual bool invokeSelectedMethodForField(PropertyInfo field, object obj, public virtual int encodeSequence(object obj, System.IO.Stream stream, ElementInfo elementInfo) { - return encodeSequenceLimited(obj, stream, 0, elementInfo.getProperties(obj.GetType()).Length - 1, elementInfo, false); + return encodeSequenceLimited(obj, stream, elementInfo, false); } - public virtual int encodeSequenceLimited(object obj, System.IO.Stream stream, int minIdx, int maxIdx, ElementInfo elementInfo, bool extended) + public virtual int encodeSequenceLimited(object obj, System.IO.Stream stream, ElementInfo elementInfo, bool extended) { int resultSize = 0; PropertyInfo[] fields = elementInfo.getProperties(obj.GetType()); int fieldIdx = 0; foreach (PropertyInfo field in fields) { - if ((fieldIdx >= minIdx) && (fieldIdx <= maxIdx)) - { - resultSize += encodeSequenceField(obj, fieldIdx, field, stream, elementInfo); - } + resultSize += encodeSequenceField(obj, fieldIdx, field, stream, elementInfo); fieldIdx++; - } return resultSize; } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs index 3b05b53..e1af89b 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs @@ -332,8 +332,8 @@ public override DecodedObject decodeChoice(DecodedObject decoded public class ASN1SequenceFieldParsingInfo { public int PreambleLen = 0; - public bool IsExtensible = false; - public int NumRootElements = 0; + public bool IsExtensible = false; + public List ExtendedFields = new List(); } protected virtual ASN1SequenceFieldParsingInfo getSequencePreambleBitLen(Type objectClass, ElementInfo elementInfo) @@ -346,10 +346,8 @@ protected virtual ASN1SequenceFieldParsingInfo getSequencePreambleBitLen(Type ob var fields = elementInfo.getProperties(objectClass); var seqMeta = (ASN1SequenceMetadata)(((IASN1PreparedElement)(elementInfo.PreparedInstance)).PreparedData.TypeMetadata); - parsingInfo.NumRootElements = fields.Length; if ((seqMeta != null) && (seqMeta.IsExtensible)) { - parsingInfo.NumRootElements = seqMeta.NumRootElements; parsingInfo.IsExtensible = seqMeta.IsExtensible; } @@ -358,12 +356,17 @@ protected virtual ASN1SequenceFieldParsingInfo getSequencePreambleBitLen(Type ob if (elementInfo.hasPreparedInfo()) info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); - bool isExtendeField = ((parsingInfo.NumRootElements >= 0) && (fieldIdx >= parsingInfo.NumRootElements)); + bool isExtendeField = CoderUtils.isExtendedField(field, info); + bool isOptionalField = CoderUtils.isOptionalField(field, info); - if ((!isExtendeField) && CoderUtils.isOptionalField(field,info)) + if (isExtendeField) + { + parsingInfo.ExtendedFields.Add(fieldIdx); + } + else if (isOptionalField) { parsingInfo.PreambleLen++; - } + } fieldIdx++; } @@ -406,24 +409,22 @@ public override DecodedObject decodeSequence(DecodedObject decod { info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(idx); } - if(CoderUtils.isOptionalField(field, info)) - { - if ((preamble & (0x80000000 >> preambleCurrentBit)) != 0) - { - decodeSequenceField(null, sequence, idx, field, stream, elementInfo, true); - } - preambleCurrentBit++; - } - else - { - decodeSequenceField(null, sequence, idx, field, stream, elementInfo, true); - } - idx++; - - // stop when the decoder reaches the exended part of the sequence - if (parsingInfo.IsExtensible && (idx >= parsingInfo.NumRootElements)) + // only parse root fields, skip extended fields + if (!CoderUtils.isExtendedField(field, info)) { - break; + if (CoderUtils.isOptionalField(field, info)) + { + if ((preamble & (0x80000000 >> preambleCurrentBit)) != 0) + { + decodeSequenceField(null, sequence, idx, field, stream, elementInfo, true); + } + preambleCurrentBit++; + } + else + { + decodeSequenceField(null, sequence, idx, field, stream, elementInfo, true); + } + idx++; } } @@ -446,18 +447,17 @@ public override DecodedObject decodeSequence(DecodedObject decod var sequenceBuffer = new byte[fieldLength]; bitStream.ReadExactly(sequenceBuffer, 0, fieldLength); - int fieldIdx = extIdx + parsingInfo.NumRootElements; - // try to fined the corresponding field, if so decode it - if (fieldIdx < fields.Length) + if (extIdx < parsingInfo.ExtendedFields.Count) { - PropertyInfo field = fields[fieldIdx]; + // decode the extended field + int extFieldIdx = parsingInfo.ExtendedFields[extIdx]; + PropertyInfo extField = fields[extFieldIdx]; if (elementInfo.hasPreparedInfo()) { - info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); + info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(extFieldIdx); } - BitArrayInputStream sequenceStream = new BitArrayInputStream(new MemoryStream(sequenceBuffer)); - decodeSequenceField(null, sequence, fieldIdx, field, sequenceStream, elementInfo, true); + decodeSequenceField(null, sequence, extFieldIdx, extField, sequenceStream, elementInfo, true); } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs index 3d7ebc2..f51aa24 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs @@ -408,7 +408,6 @@ public class ASN1SequenceFieldPresence { public List ExtensionVector = new(); public bool IsExtensible = false; public int MaxExtensionLength = 0; - public int NumRootElements = 0; } public ASN1SequenceFieldPresence estimateFieldPresense(object obj, PropertyInfo[] fields, ElementInfo elementInfo) @@ -418,10 +417,8 @@ public ASN1SequenceFieldPresence estimateFieldPresense(object obj, PropertyInfo[ ASN1SequenceFieldPresence presence = new(); var seqMeta = (ASN1SequenceMetadata)(((IASN1PreparedElement)(elementInfo.PreparedInstance)).PreparedData.TypeMetadata); - presence.NumRootElements = fields.Length; - if ((seqMeta != null) && (seqMeta.IsExtensible)) - { - presence.NumRootElements = seqMeta.NumRootElements; + if (seqMeta != null) + { presence.IsExtensible = seqMeta.IsExtensible; } @@ -432,11 +429,12 @@ public ASN1SequenceFieldPresence estimateFieldPresense(object obj, PropertyInfo[ info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); } - bool isExtendeField = ((presence.NumRootElements >= 0) && (fieldIdx >= presence.NumRootElements)); + bool isExtendeField = CoderUtils.isExtendedField(field, info); - if (CoderUtils.isOptionalField(field, info) || isExtendeField) + bool isOptionalField = CoderUtils.isOptionalField(field, info); + if (isOptionalField || isExtendeField) { - bool fieldResult = false; + bool fieldResult = !isOptionalField; object invokeObjResult = invokeGetterMethodForField(field, obj, info); if (invokeObjResult == null) { @@ -460,7 +458,7 @@ public ASN1SequenceFieldPresence estimateFieldPresense(object obj, PropertyInfo[ presence.ExtensionVector.Add(fieldResult); if (fieldResult) { - presence.MaxExtensionLength = (fieldIdx - presence.NumRootElements + 1); + presence.MaxExtensionLength = presence.ExtensionVector.Count; } } else @@ -486,16 +484,22 @@ public virtual int encodeSequencePreamble(ASN1SequenceFieldPresence presence, Sy return (resultBitSize / 8) + (resultBitSize % 8 > 0?1:0); } - public override int encodeSequenceLimited(object obj, System.IO.Stream stream, int minIdx, int maxIdx, ElementInfo elementInfo, bool extended) + public override int encodeSequenceLimited(object obj, System.IO.Stream stream, ElementInfo elementInfo, bool extended) { int resultSize = 0; PropertyInfo[] fields = elementInfo.getProperties(obj.GetType()); int fieldIdx = 0; + ElementInfo info = new ElementInfo(); foreach (PropertyInfo field in fields) { - if ((fieldIdx >= minIdx) && (fieldIdx <= maxIdx)) + if (elementInfo.hasPreparedInfo()) { - if (extended) { + info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); + } + bool isExtendedField = CoderUtils.isExtendedField(field, info); + if (extended) { + if (isExtendedField) + { BitArrayOutputStream extendedStream = new(); resultSize += encodeSequenceField(obj, fieldIdx, field, extendedStream, elementInfo); if (extendedStream.Length > 0) @@ -503,11 +507,14 @@ public override int encodeSequenceLimited(object obj, System.IO.Stream stream, i resultSize += encodeLengthDeterminant((int)extendedStream.Length, (BitArrayOutputStream)stream); stream.Write(extendedStream.ToArray(), 0, (int)extendedStream.Length); } - } else + } + } else + { + if (!isExtendedField) { + // first encode the non-optional fields, later the optional ones resultSize += encodeSequenceField(obj, fieldIdx, field, stream, elementInfo); } - } fieldIdx++; @@ -527,7 +534,7 @@ public override int encodeSequence(object obj, System.IO.Stream stream, ElementI } resultSize += encodeSequencePreamble(presence, stream); - resultSize += encodeSequenceLimited(obj, stream, 0, presence.NumRootElements-1, elementInfo, false); + resultSize += encodeSequenceLimited(obj, stream, elementInfo, false); if ((presence.IsExtensible) && (presence.MaxExtensionLength > 0)) { @@ -537,7 +544,7 @@ public override int encodeSequence(object obj, System.IO.Stream stream, ElementI { ((BitArrayOutputStream)stream).writeBit(presence.ExtensionVector[extIdx]); } - resultSize += encodeSequenceLimited(obj, stream, presence.NumRootElements, presence.MaxExtensionLength + presence.NumRootElements-1, elementInfo, true); + resultSize += encodeSequenceLimited(obj, stream, elementInfo, true); } } else diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1BoxedTypeMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1BoxedTypeMetadata.cs index 5a56dbd..46b6954 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1BoxedTypeMetadata.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1BoxedTypeMetadata.cs @@ -63,6 +63,7 @@ public override int encode(IASN1TypesEncoder encoder, object obj, Stream stream, ASN1ElementMetadata elData = new ASN1ElementMetadata( saveInfo.Name, saveInfo.IsOptional, + saveInfo.IsExtended, elementInfo.PreparedASN1ElementInfo.HasTag, elementInfo.PreparedASN1ElementInfo.IsImplicitTag, elementInfo.PreparedASN1ElementInfo.TagClass, @@ -92,6 +93,7 @@ public override DecodedObject decode(IASN1TypesDecoder decoder, DecodedO ASN1ElementMetadata elData = new ASN1ElementMetadata( saveElemInfo.Name, saveElemInfo.IsOptional, + saveElemInfo.IsExtended, elementInfo.PreparedASN1ElementInfo.HasTag, elementInfo.PreparedASN1ElementInfo.IsImplicitTag, elementInfo.PreparedASN1ElementInfo.TagClass, diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ElementMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ElementMetadata.cs index 1cb2d93..9ca6989 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ElementMetadata.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ElementMetadata.cs @@ -32,6 +32,11 @@ public bool IsOptional get { return isOptional; } } + private bool isExtended = true; + public bool IsExtended + { + get { return isExtended; } + } private bool hasTag = false; @@ -68,6 +73,7 @@ public ASN1ElementMetadata(ASN1Element annotation) : this( annotation.Name, annotation.IsOptional, + annotation.IsExtended, annotation.HasTag, annotation.IsImplicitTag, annotation.TagClass, @@ -79,6 +85,7 @@ public ASN1ElementMetadata(ASN1Element annotation) : public ASN1ElementMetadata(String name, bool isOptional, + bool isExtended, bool hasTag, bool isImplicitTag, int tagClass, @@ -87,6 +94,7 @@ public ASN1ElementMetadata(String name, : base(name) { this.isOptional = isOptional; + this.isExtended = isExtended; this.hasTag = hasTag; this.isImplicitTag = isImplicitTag; this.tagClass = tagClass; diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs index 6268a85..4f9ea85 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs @@ -26,19 +26,17 @@ public class ASN1SequenceMetadata: ASN1TypeMetadata { private bool isSet; bool isExtensible = false; - int numRootElements = 0; public ASN1SequenceMetadata(ASN1Sequence annotation) - : this(annotation.Name, annotation.IsSet) + : this(annotation.Name, annotation.IsSet, annotation.IsExtensible) { - isExtensible = annotation.IsExtensible; - numRootElements = annotation.NumRootElements; } public ASN1SequenceMetadata(String name, - bool isSet): base(name) + bool isSet, bool isExtensible): base(name) { this.isSet = isSet; + this.isExtensible = isExtensible; } public bool IsSet @@ -51,11 +49,6 @@ public bool IsExtensible get { return isExtensible; } } - public int NumRootElements - { - get { return numRootElements; } - } - public override int encode(IASN1TypesEncoder encoder, object obj, Stream stream, ElementInfo elementInfo) { return encoder.encodeSequence(obj, stream, elementInfo); diff --git a/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py index ea7619d..ef87994 100644 --- a/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py +++ b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py @@ -23,9 +23,22 @@ simpleBool [1] BOOLEAN, optBool [2] BOOLEAN OPTIONAL, ..., - extendedInt1 [3] INTEGER (0..63), - extendedInt2 [4] INTEGER (0..63) - } + extendedInt1 [3] INTEGER (0..63) OPTIONAL, + extendedInt2 [4] INTEGER (0..100000) + } + +ChoiceType ::= CHOICE { + field10 [0] INTEGER, + field20 [1] OCTET STRING, + ..., + field30 [2] UTF8String, + field40 [3] INTEGER +} + +ExtendedChoiceSeq ::= SEQUENCE { + choi ChoiceType, + tail INTEGER (0..255) +} END """ @@ -40,7 +53,9 @@ def __init__(self, asn1_spec): def compile(self, entry, data): # Compile the ASN.1 specification print(f"{entry}: {data}") - print("UPER: " + self.uper_compiler.encode(entry, data).hex()) + uper_encoded = self.uper_compiler.encode(entry, data) + print("UPER: " + uper_encoded.hex()) + print("UPER decoded" + self.uper_compiler.decode(entry, uper_encoded).__str__()) print("PER: " + self.per_compiler.encode(entry, data).hex()) print("BER: " + self.ber_compiler.encode(entry, data).hex()) @@ -77,3 +92,17 @@ def compile(self, entry, data): compiler.compile('DataSeqExtensible', data3) compiler.compile('DataSeqExtensible', data4) + +data5 = { + "choi" : ('field10', 0x12 ), + 'tail': 0x19 +} +# encoding 1 + 1 + 8 + 8 = 18 bits + +data6 = { + "choi" : ('field40', 0x12 ), + 'tail': 0x19 +} + +compiler.compile('ExtendedChoiceSeq', data5) +compiler.compile('ExtendedChoiceSeq', data6) From 9b44fd4b854d7e5fc4dc1b4720098f86afa3e0b6 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 08:41:23 +0200 Subject: [PATCH 15/32] Implement extensible choice encoding --- .../resources/modules/cs/includes/choice.xsl | 2 +- .../modules/cs/includes/choiceDecl.xsl | 2 +- .../BinaryNotes/Properties/AssemblyInfo.cs | 55 -------- .../org/bn/coders/per/PERAlignedDecoder.cs | 122 ++++++++++++++---- .../org/bn/coders/per/PERAlignedEncoder.cs | 79 ++++++++++-- .../org/bn/metadata/ASN1ChoiceMetadata.cs | 11 +- .../org/bn/coders/CoderTestUtilities.cs | 23 ++++ .../org/bn/coders/DecoderTest.cs | 41 +++++- .../org/bn/coders/EncoderTest.cs | 25 ++++ .../org/bn/coders/ber/BERCoderTestUtils.cs | 10 ++ .../bn/coders/per/PERAlignedCoderTestUtils.cs | 11 ++ .../coders/per/PERUnalignedCoderTestUtils.cs | 10 ++ 12 files changed, 290 insertions(+), 101 deletions(-) delete mode 100644 BinaryNotes.NET/BinaryNotes/Properties/AssemblyInfo.cs diff --git a/BNCompiler/src/main/resources/modules/cs/includes/choice.xsl b/BNCompiler/src/main/resources/modules/cs/includes/choice.xsl index 7d3e9da..18de0cb 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/choice.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/choice.xsl @@ -38,7 +38,7 @@ [ASN1PreparedElement] - [ASN1Choice ( Name = "") ] + [ASN1Choice ( Name = "", IsExtensible = truefalse) ] public class : IASN1PreparedElement { true diff --git a/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl b/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl index b48c88d..832f56c 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/choiceDecl.xsl @@ -31,7 +31,7 @@ [ASN1PreparedElement] - [ASN1Choice ( Name = "", IsExtensible = truefalse )] + [ASN1Choice ( Name = "", IsExtensible = truefalse )] public class : IASN1PreparedElement { true diff --git a/BinaryNotes.NET/BinaryNotes/Properties/AssemblyInfo.cs b/BinaryNotes.NET/BinaryNotes/Properties/AssemblyInfo.cs deleted file mode 100644 index 1540341..0000000 --- a/BinaryNotes.NET/BinaryNotes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BinaryNotes ASN.1 Library")] -[assembly: AssemblyDescription("ASN.1 encoding/decoding library, supporting the BER, DER and PER encodings.")] -[assembly: AssemblyCompany("Abdulla G. Abdurakhmanov, Pavel Drasil")] -[assembly: AssemblyProduct("BinaryNotes")] -[assembly: AssemblyCopyright("© 2006-2015 Abdulla G. Abdurakhmanov, Pavel Drasil")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Revision -// Build Number -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.0")] -[assembly: AssemblyFileVersion("1.6.0")] - -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\..\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// - -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs index e1af89b..45faec3 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs @@ -20,13 +20,11 @@ limitations under the License. using org.bn.metadata.constraints; using org.bn.types; using org.bn.utils; -using System; -using System.Collections.Generic; using System.Reflection; namespace org.bn.coders.per { - public class PERAlignedDecoder:Decoder + public class PERAlignedDecoder:Decoder { public override T decode(System.IO.Stream stream) { @@ -295,32 +293,108 @@ protected virtual int decodeLength(ElementInfo elementInfo, System.IO.Stream str return result; } + public class ASN1ChoiseFieldParsingInfo + { + public int PreambleLen = 0; + public bool IsExtensible = false; + public List RootFields = new List(); + public List ExtendedFields = new List(); + } + + protected virtual ASN1ChoiseFieldParsingInfo getChoiseParsingInfo(Type objectClass, ElementInfo elementInfo) + { + ElementInfo info = new ElementInfo(); + int fieldIdx = 0; + + var parsingInfo = new ASN1ChoiseFieldParsingInfo(); + + var fields = elementInfo.getProperties(objectClass); + + var choiceMeta = (ASN1ChoiceMetadata)(((ASN1PreparedElementData)elementInfo.PreparedInfo).TypeMetadata); + if (choiceMeta != null) + { + parsingInfo.IsExtensible = choiceMeta.IsExtensible; + } + + foreach (PropertyInfo field in fields) + { + if (elementInfo.hasPreparedInfo()) + info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); + + bool isExtendeField = CoderUtils.isExtendedField(field, info); + + if (isExtendeField) + { + parsingInfo.ExtendedFields.Add(fieldIdx); + } + else + { + parsingInfo.RootFields.Add(fieldIdx); + } + fieldIdx++; + } + + return parsingInfo; + } + public override DecodedObject decodeChoice(DecodedObject decodedTag, System.Type objectClass, ElementInfo elementInfo, System.IO.Stream stream) { object choice = createInstanceForElement(objectClass, elementInfo); skipAlignedBits(stream); - PropertyInfo[] fields = elementInfo.getProperties(objectClass); - int elementIndex = (int)decodeConstraintNumber(1, fields.Length, (BitArrayInputStream) stream); - DecodedObject val = null; - for (int i = 0; i < elementIndex && i < fields.Length; i++) + + bool isExtended = false; + var parsingInfo = getChoiseParsingInfo(objectClass, elementInfo); + + if (parsingInfo.IsExtensible) + { + isExtended = ((BitArrayInputStream)stream).readBit() == 1; + } + + int fieldIdx = -1; + PropertyInfo[] fields = elementInfo.getProperties(objectClass); + var bitStream = (BitArrayInputStream)stream; + if (isExtended && parsingInfo.IsExtensible) { - if (i + 1 == elementIndex) - { - System.Reflection.PropertyInfo field = fields[i]; - ElementInfo info = new ElementInfo(); - info.AnnotatedClass = field; - if(elementInfo.hasPreparedInfo()) { - info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(i); - } - else - info.ASN1ElementInfo = CoderUtils.getAttribute(field); - val = decodeClassType(decodedTag, field.PropertyType, info, stream); - if(val != null) - invokeSelectMethodForField(field, choice, val.Value, info); - break; - } - ; - } + int extendedIndex = (int)decodeNormallySmallNumber(bitStream); + if (extendedIndex < parsingInfo.ExtendedFields.Count) + { + fieldIdx = parsingInfo.ExtendedFields[extendedIndex]; + } + // decoded length field + int fieldLength = decodeLengthDeterminant(bitStream); + // read the corresponding data + var choiceBuffer = new byte[fieldLength]; + bitStream.ReadExactly(choiceBuffer, 0, fieldLength); + + // point to the newly aquired bitstream + bitStream = new BitArrayInputStream(new MemoryStream(choiceBuffer)); + + } else { + int rootIndex = (int)decodeConstraintNumber(0, parsingInfo.RootFields.Count-1, (BitArrayInputStream)stream); + if (rootIndex < parsingInfo.RootFields.Count) + { + fieldIdx = parsingInfo.RootFields[rootIndex]; + } + } + + DecodedObject? val = null; + if (fieldIdx >= 0) + { + System.Reflection.PropertyInfo field = fields[fieldIdx]; + ElementInfo info = new ElementInfo(); + info.AnnotatedClass = field; + if (elementInfo.hasPreparedInfo()) + { + info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); + } + else + info.ASN1ElementInfo = CoderUtils.getAttribute(field); + val = decodeClassType(decodedTag, field.PropertyType, info, bitStream); + if (val != null) + invokeSelectMethodForField(field, choice, val.Value, info); + + } + if (val == null && !CoderUtils.isOptional(elementInfo)) { throw new System.ArgumentException("The choice '" + objectClass.ToString() + "' does not have a selected item!"); diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs index f51aa24..5e2a003 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs @@ -554,9 +554,9 @@ public override int encodeSequence(object obj, System.IO.Stream stream, ElementI return resultSize; } - public virtual int encodeChoicePreamble(object obj, System.IO.Stream stream, int elementIndex, ElementInfo elementInfo) + public virtual int encodeChoicePreamble(object obj, System.IO.Stream stream, int elementIndex, int numOfRootElements, ElementInfo elementInfo) { - return encodeConstraintNumber(elementIndex, 1, elementInfo.getProperties(obj.GetType()).Length, (BitArrayOutputStream)stream); + return encodeConstraintNumber(elementIndex, 0, numOfRootElements-1, (BitArrayOutputStream)stream); } /// Encoding of the choice structure @@ -577,16 +577,29 @@ public override int encodeChoice(object obj, System.IO.Stream stream, ElementInf { int resultSize = 0; doAlign(stream); - ElementInfo info = null; + bool isExtensible = false; - int elementIndex = 0; + var choiceMeta = (ASN1ChoiceMetadata)( ((ASN1PreparedElementData)elementInfo.PreparedInfo) .TypeMetadata); + if (choiceMeta != null) + { + isExtensible = choiceMeta.IsExtensible; + } + + bool isExtended = false; + int rootIndex = 0; + int extendedIndex = 0; + ElementInfo? foundInfo = null; + int foundIndex = -1; + int foundEncodingIndex = -1; int fieldIdx = 0; - foreach(PropertyInfo field in elementInfo.getProperties(obj.GetType())) + int numOfRootElements = 0; + var fields = elementInfo.getProperties(obj.GetType()); + int[] relIndex = new int[fields.Length]; + foreach (PropertyInfo field in fields) { - info = new ElementInfo(); + var info = new ElementInfo(); info.AnnotatedClass = field; - elementIndex++; if (elementInfo.hasPreparedInfo()) info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(fieldIdx); else @@ -594,19 +607,57 @@ public override int encodeChoice(object obj, System.IO.Stream stream, ElementInf if (invokeSelectedMethodForField(field, obj, info)) { - break; + // the right index is found, log it + foundIndex = fieldIdx; + foundInfo = info; + if (CoderUtils.isExtendedField(field, info)) + { + foundEncodingIndex = extendedIndex; + } else + { + foundEncodingIndex = rootIndex; + } } - else - info = null; + + if (CoderUtils.isExtendedField(field, info)) + { + extendedIndex++; + } else { + rootIndex++; + numOfRootElements++; + } + fieldIdx++; } - if (info == null) + if (foundInfo == null) { throw new System.ArgumentException("The choice '" + obj.ToString() + "' does not have a selected item!"); } - object invokeObjResult = invokeGetterMethodForField((System.Reflection.PropertyInfo)info.AnnotatedClass, obj,info); - resultSize += encodeChoicePreamble(obj, stream, elementIndex, elementInfo); - resultSize += encodeClassType(invokeObjResult, stream, info); + object invokeObjResult = invokeGetterMethodForField((System.Reflection.PropertyInfo)foundInfo.AnnotatedClass, obj, foundInfo); + + if (isExtensible) + { + isExtended = CoderUtils.isExtendedField(fields[foundIndex], foundInfo); + ((BitArrayOutputStream)stream).writeBit(isExtended); + } + + if (isExtensible && isExtended) + { + // encode a number for the index + resultSize += encodeNormallySmallNumber(foundEncodingIndex, (BitArrayOutputStream)stream); + + BitArrayOutputStream extendedStream = new(); + resultSize += encodeClassType(invokeObjResult, extendedStream, foundInfo); + // encode the length of the stream + resultSize += encodeLengthDeterminant((int)extendedStream.Length, (BitArrayOutputStream)stream); + // ad the encoding to the stream itself + stream.Write(extendedStream.ToArray(), 0, (int)extendedStream.Length); + } + else + { + resultSize += encodeChoicePreamble(obj, stream, foundIndex, numOfRootElements, elementInfo); + resultSize += encodeClassType(invokeObjResult, stream, foundInfo); + } return resultSize; } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ChoiceMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ChoiceMetadata.cs index 3c82639..324a789 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ChoiceMetadata.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ChoiceMetadata.cs @@ -26,13 +26,20 @@ namespace org.bn.metadata public class ASN1ChoiceMetadata : ASN1TypeMetadata { - public ASN1ChoiceMetadata(String name) : base(name) + bool isExtensible = false; + + public ASN1ChoiceMetadata(String name, bool isExtensible) : base(name) { + this.isExtensible = isExtensible; } public ASN1ChoiceMetadata(ASN1Choice annotation) - : this(annotation.Name) + : this(annotation.Name, annotation.IsExtensible) + { + } + public bool IsExtensible { + get { return isExtensible; } } public override int encode(IASN1TypesEncoder encoder, object obj, Stream stream, ElementInfo elementInfo) diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs index f2855af..7de5927 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs @@ -680,5 +680,28 @@ public DataSeqExtensible createTestExtendedSeq2() } public abstract byte[] createTestExtendedSeq2Bytes(); + + public ExtendedChoiceSeq createTestExtendedChoiceSeq1() + { + ExtendedChoiceSeq seq = new(); + seq.Choi = new ChoiceType(); + seq.Choi.Field10 = 0x12; + seq.Tail = 0x19; + + return seq; + } + + public abstract byte[] createTestExtendedChoiceSeq1Bytes(); + + public ExtendedChoiceSeq createTestExtendedChoiceSeq2() + { + ExtendedChoiceSeq seq = new(); + seq.Choi = new ChoiceType(); + seq.Choi.Field40 = 0x12; + seq.Tail = 0x19; + + return seq; + } + public abstract byte[] createTestExtendedChoiceSeq2Bytes(); } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs index faddb47..9018cd4 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs @@ -512,7 +512,7 @@ public void testDecodeTaggedSetInSet() } [TestMethod] - public void testEncodeExtendedEnum1() + public void testDecodeExtendedEnum1() { var decoder = newDecoder(); Assert.IsNotNull(decoder); @@ -524,7 +524,7 @@ public void testEncodeExtendedEnum1() } [TestMethod] - public void testEncodeExtendedEnum2() + public void testDecodeExtendedEnum2() { var decoder = newDecoder(); Assert.IsNotNull(decoder); @@ -536,7 +536,7 @@ public void testEncodeExtendedEnum2() } [TestMethod] - public void testEncodeExtendedSeq1() + public void testDecodeExtendedSeq1() { var decoder = newDecoder(); Assert.IsNotNull(decoder); @@ -554,7 +554,7 @@ public void testEncodeExtendedSeq1() } [TestMethod] - public void testEncodeExtendedSeq2() + public void testDecodeExtendedSeq2() { var decoder = newDecoder(); Assert.IsNotNull(decoder); @@ -571,5 +571,38 @@ public void testEncodeExtendedSeq2() Assert.AreEqual(got.ExtendedInt2, exp.ExtendedInt2); } } + + [TestMethod] + public virtual void testDecodeExtendedChoice1() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + if (decoder is org.bn.coders.per.PERUnalignedDecoder) + { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedChoiceSeq1Bytes()); + var got = decoder.decode(stream); + var exp = coderTestUtils.createTestExtendedChoiceSeq1(); + + Assert.AreEqual(got.Choi.Field10, exp.Choi.Field10); + Assert.AreEqual(got.Tail, exp.Tail); + } + } + + [TestMethod] + public virtual void testDecodeExtendedChoice2() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + + if (decoder is not org.bn.coders.ber.BERDecoder) + { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedChoiceSeq2Bytes()); + var got = decoder.decode(stream); + var exp = coderTestUtils.createTestExtendedChoiceSeq2(); + + Assert.AreEqual(got.Choi.Field40, exp.Choi.Field40); + Assert.AreEqual(got.Tail, exp.Tail); + } + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs index fd6a35d..82e2d12 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs @@ -495,5 +495,30 @@ public virtual void testEncodeExtendedSeq2() checkEncoded(encoder, coderTestUtils.createTestExtendedSeq2(), coderTestUtils.createTestExtendedSeq2Bytes()); } } + + [TestMethod] + public virtual void testEncodeExtendedChoice1() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + //if ((encoder is org.bn.coders.per.PERUnalignedEncoder) || (encoder is org.bn.coders.per.PERAlignedEncoder)) + if (encoder is org.bn.coders.per.PERUnalignedEncoder) + { + printEncoded("TestExtendedChoice test1", encoder, coderTestUtils.createTestExtendedChoiceSeq1()); + checkEncoded(encoder, coderTestUtils.createTestExtendedChoiceSeq1(), coderTestUtils.createTestExtendedChoiceSeq1Bytes()); + } + } + + [TestMethod] + public virtual void testEncodeExtendedChoice2() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if ((encoder is org.bn.coders.per.PERUnalignedEncoder) || (encoder is org.bn.coders.per.PERAlignedEncoder)) + { + printEncoded("TestExtendedChoice test2", encoder, coderTestUtils.createTestExtendedChoiceSeq2()); + checkEncoded(encoder, coderTestUtils.createTestExtendedChoiceSeq2(), coderTestUtils.createTestExtendedChoiceSeq2Bytes()); + } + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs index 321e16e..a9ac496 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs @@ -358,5 +358,15 @@ public override byte[] createTestExtendedSeq2Bytes() { return new byte[] { }; } + + public override byte[] createTestExtendedChoiceSeq1Bytes() + { + return new byte[] { 0x30, 0x08, 0xa0, 0x03, 0x80, 0x01, 0x12, 0x81, 0x01, 0x19 }; + } + + public override byte[] createTestExtendedChoiceSeq2Bytes() + { + return new byte[] { 0x30, 0x08, 0xa0, 0x03, 0x83, 0x01, 0x12, 0x81, 0x01, 0x19 }; + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs index c96ed86..21acb92 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs @@ -336,5 +336,16 @@ public override byte[] createTestExtendedSeq2Bytes() { return new byte[] { 0xc0, 0x45, 0xc0, 0xe0, 0x01, 0x44, 0x02, 0x00, 0x2d }; } + + public override byte[] createTestExtendedChoiceSeq1Bytes() + { + // might be wrong + return new byte[] { 0x00, 0x01, 0x12, 0x19 }; + } + + public override byte[] createTestExtendedChoiceSeq2Bytes() + { + return new byte[] { 0x81, 0x02, 0x01, 0x12, 0x19 }; + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index d511c4a..4abe9be 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -344,5 +344,15 @@ public override byte[] createTestExtendedSeq2Bytes() // 1 1 8 1 1 7 2 8 6 8 6 = 49 bits return new byte[] { 0xd1, 0x70, 0x38, 0x0a, 0x20, 0x18, 0x00, 0xb4, 0x00 }; } + + public override byte[] createTestExtendedChoiceSeq1Bytes() + { + return new byte[] { 0x00, 0x44, 0x86, 0x40 }; + } + + public override byte[] createTestExtendedChoiceSeq2Bytes() + { + return new byte[] { 0x81, 0x02, 0x01, 0x12, 0x19 }; + } } } From 063fba6f73c42a58f6a91f93b961a3239a772bc8 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 10:29:41 +0200 Subject: [PATCH 16/32] Support extensible integers and size --- .../main/antlr/org/bn/compiler/parser/ASN1.g | 2 +- .../compiler/parser/model/AsnConstraint.java | 2 +- .../cs/includes/valueRangeConstraint.xsl | 2 +- .../org/bn/compiler/parser/ASNParserTest.java | 2 +- BNCompiler/src/test/resources/test.asn | 4 + .../constraints/ASN1ValueRangeConstraint.cs | 7 ++ .../BinaryNotes/org/bn/coders/CoderUtils.cs | 3 +- .../org/bn/coders/per/PERAlignedDecoder.cs | 48 ++++++++--- .../org/bn/coders/per/PERAlignedEncoder.cs | 83 ++++++++++++++----- .../ASN1ValueRangeConstraintMetadata.cs | 18 +++- .../BinaryNotesTests/asn1tool_test.py | 10 +++ .../org/bn/coders/CoderTestUtilities.cs | 18 ++++ .../org/bn/coders/DecoderTest.cs | 72 ++++++++++++++++ .../org/bn/coders/EncoderTest.cs | 48 +++++++++++ .../org/bn/coders/ber/BERCoderTestUtils.cs | 20 +++++ .../bn/coders/per/PERAlignedCoderTestUtils.cs | 20 +++++ .../coders/per/PERUnalignedCoderTestUtils.cs | 20 +++++ 17 files changed, 337 insertions(+), 42 deletions(-) diff --git a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index ebe9206..8a6dbf3 100644 --- a/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g +++ b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g @@ -939,7 +939,7 @@ element_set_specs[AsnConstraint cnstrnt] : (elemspec=element_set_spec { cnstrnt.elemSetSpec=elemspec; // TODO - need list.add() func } - (COMMA ELLIPSIS {cnstrnt.isCommaDotDot=true;})? + (COMMA ELLIPSIS {cnstrnt.isExtensible=true;})? (COMMA elemspec=element_set_spec {cnstrnt.addElemSetSpec=elemspec;cnstrnt.isAdditionalElementSpec=true;})?) ; diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnConstraint.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnConstraint.java index 791944a..6ec8c49 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnConstraint.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnConstraint.java @@ -7,7 +7,7 @@ public class AsnConstraint { public ElementSetSpec elemSetSpec; public boolean isAdditionalElementSpec; public boolean isColonValue; - public boolean isCommaDotDot; + public boolean isExtensible; public boolean isDefinedValue; public boolean isElementSetSpecs; public boolean isExceptionSpec; diff --git a/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl b/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl index e8dd5e1..61d8e4d 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl @@ -29,7 +29,7 @@ - [ASN1ValueRangeConstraint ( Min = L, Max = L ) ] + [ASN1ValueRangeConstraint ( Min = L, Max = L, IsExtensible = truefalse) ] diff --git a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java index 6b71474..5ce3654 100644 --- a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java +++ b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java @@ -63,6 +63,6 @@ public void testModule_definition() throws Exception { assertEquals(4, model.module.asnTypes.enums.size()); assertEquals(8, model.module.asnTypes.characterStrings.size()); assertEquals(1, model.module.asnTypes.octetStrings.size()); - assertEquals(9, model.module.asnTypes.sequenceSetsOf.size()); + assertEquals(10, model.module.asnTypes.sequenceSetsOf.size()); } } diff --git a/BNCompiler/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index f17c56e..86b51dc 100644 --- a/BNCompiler/src/test/resources/test.asn +++ b/BNCompiler/src/test/resources/test.asn @@ -434,4 +434,8 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara tail INTEGER (0..255) } + SubInteger ::= INTEGER (0..63) + + ExtensibleSize ::= SEQUENCE (SIZE(1..3,...)) OF SubInteger + ExtensibleInteger ::= INTEGER(0..63,...) END diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/constraints/ASN1ValueRangeConstraint.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/constraints/ASN1ValueRangeConstraint.cs index 7bf381e..fef2806 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/constraints/ASN1ValueRangeConstraint.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/constraints/ASN1ValueRangeConstraint.cs @@ -21,6 +21,7 @@ namespace org.bn.attributes.constraints public class ASN1ValueRangeConstraint : Attribute { private long min, max; + private bool isExtensible = false; public long Max { @@ -33,5 +34,11 @@ public long Min get { return min; } set { min = value; } } + + public bool IsExtensible + { + get { return isExtensible; } + set { isExtensible = value; } + } } } \ No newline at end of file diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs index b138761..d6ca53c 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/CoderUtils.cs @@ -18,6 +18,7 @@ limitations under the License. using org.bn.attributes; using org.bn.attributes.constraints; using org.bn.metadata; +using org.bn.metadata.constraints; using org.bn.types; using System; using System.Collections; @@ -262,7 +263,7 @@ public static void checkConstraints(long val, ElementInfo elementInfo) if (elementInfo.isAttributePresent()) { ASN1ValueRangeConstraint constraint = elementInfo.getAttribute(); - if (val > constraint.Max || val < constraint.Min) + if ((new ASN1ValueRangeConstraintMetadata(constraint)).checkValue(val)) throw new Exception("Length of '" + elementInfo.AnnotatedClass.ToString() + "' out of bound"); } else diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs index 45faec3..e62eecf 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs @@ -72,9 +72,19 @@ protected virtual long decodeIntegerValueAsBytes(int intLen, System.IO.Stream st /// ITU-T X.691. 10.9. General rules for encoding a length determinant /// /// - protected virtual int decodeConstraintLengthDeterminant(int min, int max, BitArrayInputStream stream) + protected virtual int decodeConstraintLengthDeterminant(ASN1ValueRangeConstraintMetadata constraint, BitArrayInputStream stream) { - if (max <= 0xFFFF) + + int min = (int)constraint.Min; + int max = (int)constraint.Max; + bool isExtended = false; + + if (constraint.IsExtensible) + { + isExtended = stream.readBit() == 1; + } + + if (((max-min) <= 0xFFFF) && !isExtended) { // 10.9. NOTE 2 – (Tutorial) In the case of the ALIGNED variant // if the length count is bounded above by an upper bound that is @@ -161,7 +171,7 @@ protected virtual long decodeConstraintNumber(long min, long max, BitArrayInputS } else { - /* + /* * 4. Where the range is greater than 64K, the range is ignored * and the value encodes into an octet-aligned bit-field * which is the minimum number of octets for the value. @@ -171,7 +181,14 @@ protected virtual long decodeConstraintNumber(long min, long max, BitArrayInputS * of the encoding is independent of the value being encoded, * and is not explicitly encoded. */ - int intLen = decodeConstraintLengthDeterminant(1, CoderUtils.getPositiveIntegerLength(valueRange), stream); + ASN1ValueRangeConstraint valueRangeConstraint = new() + { + Min = 1, + Max = CoderUtils.getPositiveIntegerLength(valueRange), + IsExtensible = false + }; + + int intLen = decodeConstraintLengthDeterminant(new ASN1ValueRangeConstraintMetadata(valueRangeConstraint), stream); skipAlignedBits(stream); result = (int)decodeIntegerValueAsBytes(intLen, stream); result += min; @@ -262,8 +279,7 @@ protected virtual int decodeLength(ElementInfo elementInfo, System.IO.Stream str IASN1ConstraintMetadata constraint = elementInfo.PreparedInfo.Constraint; if(constraint is ASN1ValueRangeConstraintMetadata) { result = decodeConstraintLengthDeterminant( - (int)((ASN1ValueRangeConstraintMetadata)constraint).Min, - (int)((ASN1ValueRangeConstraintMetadata)constraint).Max, + (ASN1ValueRangeConstraintMetadata)constraint, bitStream ); } @@ -279,7 +295,7 @@ protected virtual int decodeLength(ElementInfo elementInfo, System.IO.Stream str if (elementInfo.isAttributePresent()) { ASN1ValueRangeConstraint constraint = elementInfo.getAttribute(); - result = decodeConstraintLengthDeterminant((int)constraint.Min, (int)constraint.Max, bitStream); + result = decodeConstraintLengthDeterminant(new ASN1ValueRangeConstraintMetadata(constraint), bitStream); } else if (elementInfo.isAttributePresent()) @@ -618,8 +634,10 @@ public override DecodedObject decodeInteger(DecodedObject decode { bool hasConstraint = false; long min = 0, max = 0; + bool isExtensible = false; + bool isExtended = false; - if(elementInfo.hasPreparedInfo()) + if (elementInfo.hasPreparedInfo()) { if(elementInfo.PreparedInfo.hasConstraint() && elementInfo.PreparedInfo.Constraint is ASN1ValueRangeConstraintMetadata) @@ -628,6 +646,7 @@ public override DecodedObject decodeInteger(DecodedObject decode hasConstraint = true; min = ((ASN1ValueRangeConstraintMetadata)constraint).Min; max = ((ASN1ValueRangeConstraintMetadata)constraint).Max; + isExtensible = ((ASN1ValueRangeConstraintMetadata)constraint).IsExtensible; } } else @@ -637,12 +656,19 @@ public override DecodedObject decodeInteger(DecodedObject decode ASN1ValueRangeConstraint constraint = elementInfo.getAttribute(); min = constraint.Min; max = constraint.Max; + isExtensible = constraint.IsExtensible; } - DecodedObject result = new DecodedObject(); + // read the extension marker bit when present + if (isExtensible) + { + isExtended = ((BitArrayInputStream)stream).readBit() == 1; + } + + DecodedObject result = new DecodedObject(); BitArrayInputStream bitStream = (BitArrayInputStream) stream; int val = 0; - if (hasConstraint) + if (hasConstraint && !isExtended) { ASN1ValueRangeConstraint constraint = elementInfo.getAttribute(); val = (int)decodeConstraintNumber(min, max, bitStream); @@ -755,7 +781,7 @@ protected virtual int decodeStringLength2(ElementInfo elementInfo, System.IO.Str if (elementInfo.isAttributePresent()) { ASN1ValueRangeConstraint constraint = elementInfo.getAttribute(); - resultSize = decodeConstraintLengthDeterminant((int)constraint.Min, (int)constraint.Max, bitStream); + resultSize = decodeConstraintLengthDeterminant(new ASN1ValueRangeConstraintMetadata(constraint), bitStream); } else resultSize = decodeLengthDeterminant(bitStream); diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs index 5e2a003..e4477b2 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs @@ -50,23 +50,38 @@ protected virtual int encodeIntegerValueAsBytes(long val, System.IO.Stream strea return integerSize; } - /// Encoding constraint length determinant procedure. - /// ITU-T X.691. 10.9. General rules for encoding a length determinant - /// - /// - protected virtual int encodeConstraintLengthDeterminant(int length, int min, int max, BitArrayOutputStream stream) - { - if (max <= 0xFFFF) - { - // 10.9. NOTE 2 – (Tutorial) In the case of the ALIGNED variant - // if the length count is bounded above by an upper bound that is - // less than 64K, then the constrained whole number encoding - // is used for the length. - return encodeConstraintNumber(length, min, max, stream); // encoding as constraint integer - } - else - return encodeLengthDeterminant(length, stream); - } + /// Encoding constraint length determinant procedure. + /// ITU-T X.691. 10.9. General rules for encoding a length determinant + /// + /// + protected virtual int encodeConstraintLengthDeterminant(int length, ASN1ValueRangeConstraintMetadata constraint, BitArrayOutputStream stream) + { + int min = (int)constraint.Min; + int max = (int)constraint.Max; + bool isExtensible = constraint.IsExtensible; + bool isExtended = constraint.checkIsExtended(length); + + if (!isExtensible && isExtended) + { + throw new ArgumentOutOfRangeException($"Length {length} is out of the allowed range [{min}, {max}] and the field is not extensible."); + } + + if (isExtensible) + { + stream.writeBit(isExtended); + } + + if (((max-min) <= 0xFFFF) && !(isExtensible && isExtended)) + { + // 10.9. NOTE 2 – (Tutorial) In the case of the ALIGNED variant + // if the length count is bounded above by an upper bound that is + // less than 64K, then the constrained whole number encoding + // is used for the length. + return encodeConstraintNumber(length, min, max, stream); // encoding as constraint integer + } + else + return encodeLengthDeterminant(length, stream); + } /// Encoding length determinant procedure. /// ITU-T X.691. 10.9. General rules for encoding a length determinant @@ -151,7 +166,7 @@ protected virtual int encodeConstraintNumber(long val, long min, long max, BitAr } else { - /* + /* * 4. Where the range is greater than 64K, the range is ignored * and the value encodes into an octet-aligned bit-field * which is the minimum number of octets for the value. @@ -161,7 +176,16 @@ protected virtual int encodeConstraintNumber(long val, long min, long max, BitAr * of the encoding is independent of the value being encoded, * and is not explicitly encoded. */ - result = encodeConstraintLengthDeterminant(CoderUtils.getIntegerLength(narrowedVal), 1, CoderUtils.getPositiveIntegerLength(valueRange), stream); + ASN1ValueRangeConstraint valueRangeConstraint = new() + { + Max = CoderUtils.getPositiveIntegerLength(valueRange), + Min = 1, + IsExtensible = false + }; + + ASN1ValueRangeConstraintMetadata metaConstraint = new(valueRangeConstraint); + + result = encodeConstraintLengthDeterminant(CoderUtils.getIntegerLength(narrowedVal), metaConstraint, stream); doAlign(stream); result += encodeIntegerValueAsBytes(narrowedVal, stream); } @@ -253,6 +277,7 @@ public override int encodeInteger(object obj, System.IO.Stream stream, ElementIn int result = 0; bool hasConstraint = false; long min = 0, max = 0; + bool isExtensible = false; if (elementInfo.hasPreparedInfo()) { @@ -263,6 +288,7 @@ public override int encodeInteger(object obj, System.IO.Stream stream, ElementIn hasConstraint = true; min = ((ASN1ValueRangeConstraintMetadata)constraint).Min; max = ((ASN1ValueRangeConstraintMetadata)constraint).Max; + isExtensible = ((ASN1ValueRangeConstraintMetadata)constraint).IsExtensible; } } else @@ -272,13 +298,25 @@ public override int encodeInteger(object obj, System.IO.Stream stream, ElementIn ASN1ValueRangeConstraint constraint = elementInfo.getAttribute(); min = constraint.Min; max = constraint.Max; + isExtensible = constraint.IsExtensible; } if (obj.GetType().Equals(typeof(int))) { int val = (int)obj; BitArrayOutputStream bitStream = (BitArrayOutputStream)stream; - if (hasConstraint) + bool isExtended = (val < min) || (val > max); + if (isExtensible) + { + bitStream.writeBit(isExtended); + } + + if (hasConstraint && isExtended && !isExtensible) + { + throw new ArgumentOutOfRangeException($"Value {val} is out of the allowed range [{min}, {max}] and the field is not extensible."); + } + + if (hasConstraint && !isExtended) { result += encodeConstraintNumber(val, min, max, bitStream); } @@ -372,8 +410,7 @@ protected int encodeLength(int val, ElementInfo elementInfo, System.IO.Stream st { resultSize += encodeConstraintLengthDeterminant( val, - (int)((ASN1ValueRangeConstraintMetadata)constraint).Min, - (int)((ASN1ValueRangeConstraintMetadata)constraint).Max, + (ASN1ValueRangeConstraintMetadata)constraint, bitStream ); } @@ -390,7 +427,7 @@ protected int encodeLength(int val, ElementInfo elementInfo, System.IO.Stream st if (elementInfo.isAttributePresent()) { ASN1ValueRangeConstraint constraint = elementInfo.getAttribute(); - resultSize += encodeConstraintLengthDeterminant(val, (int)constraint.Min, (int)constraint.Max, bitStream); + resultSize += encodeConstraintLengthDeterminant(val, new ASN1ValueRangeConstraintMetadata(constraint), bitStream); } else if (elementInfo.isAttributePresent()) diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/constraints/ASN1ValueRangeConstraintMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/constraints/ASN1ValueRangeConstraintMetadata.cs index 4fd6fcd..f0eed82 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/constraints/ASN1ValueRangeConstraintMetadata.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/constraints/ASN1ValueRangeConstraintMetadata.cs @@ -27,11 +27,13 @@ namespace org.bn.metadata.constraints public class ASN1ValueRangeConstraintMetadata : IASN1ConstraintMetadata { private long minValue, maxValue; - + private bool isExtensible = false; + public ASN1ValueRangeConstraintMetadata(ASN1ValueRangeConstraint annotation) { this.minValue = annotation.Min; this.maxValue = annotation.Max; + this.isExtensible = annotation.IsExtensible; } public long Min { @@ -41,10 +43,20 @@ public long Min { public long Max { get { return maxValue; } } - + + public bool IsExtensible + { + get { return isExtensible; } + } + + public bool checkIsExtended(long value) + { + return (value > maxValue || value < minValue); + } + public bool checkValue(long value) { - return value<= maxValue && value>= minValue; + return isExtensible || !checkIsExtended(value); } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py index ef87994..1f40c31 100644 --- a/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py +++ b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py @@ -40,6 +40,9 @@ tail INTEGER (0..255) } +ExtensibleSize ::= SEQUENCE (SIZE(1..3,...)) OF INTEGER(0..63) +ExtensibleInteger ::= INTEGER(0..63,...) + END """ @@ -106,3 +109,10 @@ def compile(self, entry, data): compiler.compile('ExtendedChoiceSeq', data5) compiler.compile('ExtendedChoiceSeq', data6) + +data7 = 0x23 + +data8 = 0x73 + +compiler.compile('ExtensibleInteger', data7) +compiler.compile('ExtensibleInteger', data8) \ No newline at end of file diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs index 7de5927..e5fd824 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs @@ -703,5 +703,23 @@ public ExtendedChoiceSeq createTestExtendedChoiceSeq2() return seq; } public abstract byte[] createTestExtendedChoiceSeq2Bytes(); + + public ExtensibleInteger createTestExtendedInteger1() + { + ExtensibleInteger extInt = new(); + extInt.Value = 0x23; + return extInt; + } + + public abstract byte[] createTestExtendedInteger1Bytes(); + + public ExtensibleInteger createTestExtendedInteger2() + { + ExtensibleInteger extInt = new(); + extInt.Value = 0x73; + return extInt; + } + + public abstract byte[] createTestExtendedInteger2Bytes(); } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs index 9018cd4..5fb8f4a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs @@ -604,5 +604,77 @@ public virtual void testDecodeExtendedChoice2() Assert.AreEqual(got.Tail, exp.Tail); } } + + [TestMethod] + public virtual void testDecodeExtendedInteger1() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + if (decoder is org.bn.coders.per.PERUnalignedDecoder) + { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedInteger1Bytes()); + var got = decoder.decode(stream); + var exp = coderTestUtils.createTestExtendedInteger1(); + + Assert.AreEqual(got.Value, exp.Value); + } + } + + [TestMethod] + public virtual void testDecodeExtendedInteger2() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + if (decoder is not org.bn.coders.ber.BERDecoder) + { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedInteger2Bytes()); + var got = decoder.decode(stream); + var exp = coderTestUtils.createTestExtendedInteger2(); + + Assert.AreEqual(got.Value, exp.Value); + } + } + + [TestMethod] + public virtual void testDecodeExtensibleSize1() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + if (decoder is org.bn.coders.per.PERUnalignedDecoder) + { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtensibleSize1Bytes()); + var got = decoder.decode(stream); + var exp = coderTestUtils.createTestExtensibleSize1(); + + Assert.AreEqual(got.Value.Count, exp.Value.Count); + var gotArray = got.Value.ToArray(); + var expArray = exp.Value.ToArray(); + for (int i= 0; i < got.Value.Count; i++) + { + Assert.AreEqual(gotArray[i].Value, expArray[i].Value); + } + } + } + + [TestMethod] + public virtual void testDecodeExtensibleSize2() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + if (decoder is org.bn.coders.per.PERUnalignedDecoder) + { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtensibleSize2Bytes()); + var got = decoder.decode(stream); + var exp = coderTestUtils.createTestExtensibleSize2(); + + Assert.AreEqual(got.Value.Count, exp.Value.Count); + var gotArray = got.Value.ToArray(); + var expArray = exp.Value.ToArray(); + for (int i = 0; i < got.Value.Count; i++) + { + Assert.AreEqual(gotArray[i].Value, expArray[i].Value); + } + } + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs index 82e2d12..080aee2 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/EncoderTest.cs @@ -520,5 +520,53 @@ public virtual void testEncodeExtendedChoice2() checkEncoded(encoder, coderTestUtils.createTestExtendedChoiceSeq2(), coderTestUtils.createTestExtendedChoiceSeq2Bytes()); } } + + [TestMethod] + public virtual void testEncodeExtendedInteger1() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if (encoder is org.bn.coders.per.PERUnalignedEncoder) + { + printEncoded("TestExtendedInteger test1", encoder, coderTestUtils.createTestExtendedInteger1()); + checkEncoded(encoder, coderTestUtils.createTestExtendedInteger1(), coderTestUtils.createTestExtendedInteger1Bytes()); + } + } + + [TestMethod] + public virtual void testEncodeExtendedInteger2() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if ((encoder is org.bn.coders.per.PERUnalignedEncoder) || (encoder is org.bn.coders.per.PERAlignedEncoder)) + { + printEncoded("TestExtendedInteger test2", encoder, coderTestUtils.createTestExtendedInteger2()); + checkEncoded(encoder, coderTestUtils.createTestExtendedInteger2(), coderTestUtils.createTestExtendedInteger2Bytes()); + } + } + + [TestMethod] + public virtual void testEncodeExtensibleSize1() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if (encoder is org.bn.coders.per.PERUnalignedEncoder) + { + printEncoded("TestExtendedInteger test1", encoder, coderTestUtils.createTestExtensibleSize1()); + checkEncoded(encoder, coderTestUtils.createTestExtensibleSize1(), coderTestUtils.createTestExtensibleSize1Bytes()); + } + } + + [TestMethod] + public virtual void testEncodeExtensibleSize2() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if (encoder is org.bn.coders.per.PERUnalignedEncoder) + { + printEncoded("TestExtendedInteger test1", encoder, coderTestUtils.createTestExtensibleSize2()); + checkEncoded(encoder, coderTestUtils.createTestExtensibleSize2(), coderTestUtils.createTestExtensibleSize2Bytes()); + } + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs index a9ac496..6fcfe3e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/ber/BERCoderTestUtils.cs @@ -368,5 +368,25 @@ public override byte[] createTestExtendedChoiceSeq2Bytes() { return new byte[] { 0x30, 0x08, 0xa0, 0x03, 0x83, 0x01, 0x12, 0x81, 0x01, 0x19 }; } + + public override byte[] createTestExtendedInteger1Bytes() + { + return new byte[] { 0x02, 0x01, 0x23 }; + } + + public override byte[] createTestExtendedInteger2Bytes() + { + return new byte[] { 0x02, 0x01, 0x73 }; + } + + public override byte[] createTestExtensibleSize1Bytes() + { + return new byte[] { 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x01, 0x45 }; + } + + public override byte[] createTestExtensibleSize2Bytes() + { + return new byte[] { 0x30, 0x0c, 0x02, 0x01, 0x23, 0x02, 0x01, 0x35, 0x02, 0x01, 0x11, 0x02, 0x01, 0x05 }; + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs index 21acb92..d724678 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs @@ -347,5 +347,25 @@ public override byte[] createTestExtendedChoiceSeq2Bytes() { return new byte[] { 0x81, 0x02, 0x01, 0x12, 0x19 }; } + + public override byte[] createTestExtendedInteger1Bytes() + { + return new byte[] { 0x46 }; + } + + public override byte[] createTestExtendedInteger2Bytes() + { + return new byte[] { 0x80, 0x01, 0x73 }; + } + + public override byte[] createTestExtensibleSize1Bytes() + { + return new byte[] { 0x31, 0xea }; + } + + public override byte[] createTestExtensibleSize2Bytes() + { + return new byte[] { 0x82, 0x47, 0xaa, 0x22, 0x80 }; + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index 4abe9be..e28e152 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -354,5 +354,25 @@ public override byte[] createTestExtendedChoiceSeq2Bytes() { return new byte[] { 0x81, 0x02, 0x01, 0x12, 0x19 }; } + + public override byte[] createTestExtendedInteger1Bytes() + { + return new byte[] { 0x46 }; + } + + public override byte[] createTestExtendedInteger2Bytes() + { + return new byte[] { 0x80, 0xb9, 0x80 }; + } + + public override byte[] createTestExtensibleSize1Bytes() + { + return new byte[] { 0x31, 0xea }; + } + + public override byte[] createTestExtensibleSize2Bytes() + { + return new byte[] { 0x82, 0x47, 0xaa, 0x22, 0x80 }; + } } } From e09749a4c8e622f2edf10565bce1db1498329c74 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 13:13:50 +0200 Subject: [PATCH 17/32] Do not generate assembly attributes in the project file --- .../BinaryNotesTests/BinaryNotesTests.csproj | 1 + .../BinaryNotesTests/org/bn/AllTests.cs | 47 ------------------- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/AllTests.cs diff --git a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj index 50c4f44..8c4c8eb 100644 --- a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj +++ b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj @@ -5,6 +5,7 @@ latest enable enable + false diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/AllTests.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/AllTests.cs deleted file mode 100644 index ee69834..0000000 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/AllTests.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright 2006-2011 Abdulla Abdurakhmanov (abdulla@latestbit.com) - Original sources are available at www.latestbit.com - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -using System; -//UPGRADE_TODO: The type 'junit.framework.Test' could not be found. If it was not included in the conversion, there may be compiler issues. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1262'" -using Test = junit.framework.Test; -//UPGRADE_TODO: The type 'junit.framework.TestSuite' could not be found. If it was not included in the conversion, there may be compiler issues. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1262'" -using TestSuite = junit.framework.TestSuite; -//UPGRADE_TODO: The type 'junit.swingui.TestRunner' could not be found. If it was not included in the conversion, there may be compiler issues. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1262'" -using TestRunner = junit.swingui.TestRunner; -using DecoderTest = test.org.bn.coders.DecoderTest; -using EncoderTest = test.org.bn.coders.EncoderTest; -namespace test.org.bn -{ - - public class AllTests - { - public static Test suite() - { - TestSuite suite; - suite = new TestSuite("AllTests"); - suite.addTestSuite(typeof(EncoderTest)); - suite.addTestSuite(typeof(DecoderTest)); - return suite; - } - - [STAThread] - public static void Main(System.String[] args) - { - System.String[] args2 = new System.String[]{"-noloading", "test.org.bn.AllTests"}; - TestRunner.main(args2); - } - } -} \ No newline at end of file From ecea8a19b06a59ea815b87a131194b0dcc0b5914 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 13:24:34 +0200 Subject: [PATCH 18/32] Update generated files --- .../org/bn/coders/test_asn/BugPrimitive.cs | 6 +- .../org/bn/coders/test_asn/BugSequenceType.cs | 19 +- .../org/bn/coders/test_asn/BugValueType.cs | 8 +- .../org/bn/coders/test_asn/ChoiceType.cs | 186 ++++++++++++++++++ .../org/bn/coders/test_asn/Config.cs | 6 +- .../org/bn/coders/test_asn/Config2.cs | 6 +- .../bn/coders/test_asn/ContentPartHeader.cs | 21 +- .../org/bn/coders/test_asn/ContentSchema.cs | 18 +- .../org/bn/coders/test_asn/ContentType.cs | 18 +- .../org/bn/coders/test_asn/Data.cs | 26 +-- .../org/bn/coders/test_asn/DataSeq.cs | 49 ++--- .../bn/coders/test_asn/DataSeqExtensible.cs | 115 +++++++++++ .../org/bn/coders/test_asn/DataSeqMO.cs | 81 ++++---- .../bn/coders/test_asn/ExtendedChoiceSeq.cs | 61 ++++++ .../org/bn/coders/test_asn/ExtendedEnumSeq.cs | 61 ++++++ .../bn/coders/test_asn/ExtensibleInteger.cs | 52 +++++ .../org/bn/coders/test_asn/ExtensibleSize.cs | 54 +++++ .../org/bn/coders/test_asn/FQDN.cs | 8 +- .../org/bn/coders/test_asn/ITUSequence.cs | 29 ++- .../org/bn/coders/test_asn/ITUType2.cs | 2 +- .../org/bn/coders/test_asn/ITUType3.cs | 2 +- .../org/bn/coders/test_asn/ITUType4.cs | 2 +- .../org/bn/coders/test_asn/ITUType5.cs | 2 +- .../org/bn/coders/test_asn/ITUType6.cs | 2 +- .../org/bn/coders/test_asn/LstVersion.cs | 4 +- .../org/bn/coders/test_asn/Major.cs | 2 +- .../org/bn/coders/test_asn/Minor.cs | 2 +- .../org/bn/coders/test_asn/MixedEnumType.cs | 52 +++++ .../org/bn/coders/test_asn/PlainParamsMap.cs | 19 +- .../bn/coders/test_asn/ProtectedZoneType.cs | 50 +++++ .../bn/coders/test_asn/SequenceWithDefault.cs | 45 +++-- .../bn/coders/test_asn/SequenceWithEnum.cs | 21 +- .../bn/coders/test_asn/SequenceWithNull.cs | 21 +- .../org/bn/coders/test_asn/Set1.cs | 4 +- .../org/bn/coders/test_asn/Set2.cs | 4 +- .../org/bn/coders/test_asn/Set3.cs | 4 +- .../org/bn/coders/test_asn/Set4.cs | 4 +- .../org/bn/coders/test_asn/Set5.cs | 4 +- .../org/bn/coders/test_asn/Set6.cs | 6 +- .../org/bn/coders/test_asn/Set7.cs | 4 +- .../org/bn/coders/test_asn/SetWithDefault.cs | 21 +- .../org/bn/coders/test_asn/SubInteger.cs | 52 +++++ .../bn/coders/test_asn/TaggedNullSequence.cs | 2 +- .../org/bn/coders/test_asn/TaggedSeqInSeq.cs | 4 +- .../org/bn/coders/test_asn/TaggedSequence.cs | 4 +- .../org/bn/coders/test_asn/Test128Tag.cs | 2 +- .../org/bn/coders/test_asn/TestBitStrBnd.cs | 8 +- .../org/bn/coders/test_asn/TestChild2.cs | 14 +- .../org/bn/coders/test_asn/TestChild3.cs | 61 +++--- .../org/bn/coders/test_asn/TestI14.cs | 8 +- .../org/bn/coders/test_asn/TestI16.cs | 8 +- .../org/bn/coders/test_asn/TestI32.cs | 8 +- .../org/bn/coders/test_asn/TestI8.cs | 8 +- .../org/bn/coders/test_asn/TestI8named.cs | 52 +++++ .../org/bn/coders/test_asn/TestIR.cs | 8 +- .../org/bn/coders/test_asn/TestLong.cs | 8 +- .../org/bn/coders/test_asn/TestLongTag.cs | 2 +- .../org/bn/coders/test_asn/TestLongTag2.cs | 4 +- .../bn/coders/test_asn/TestLongTag2Choice.cs | 17 +- .../org/bn/coders/test_asn/TestNI.cs | 8 +- .../org/bn/coders/test_asn/TestNI2.cs | 8 +- .../org/bn/coders/test_asn/TestParent.cs | 37 ++-- .../org/bn/coders/test_asn/TestParent2.cs | 10 +- .../test_asn/TestRecursiveDefinetion.cs | 19 +- .../org/bn/coders/test_asn/TestSeqOID.cs | 21 +- .../org/bn/coders/test_asn/TestSeqSize.cs | 55 ++++++ .../org/bn/coders/test_asn/TestSeqV13.cs | 31 ++- .../org/bn/coders/test_asn/TestSequenceV12.cs | 59 ++---- .../test_asn/TestSequenceWithNonames.cs | 49 +++-- .../bn/coders/test_asn/TestSimpleSequence.cs | 21 +- .../org/bn/coders/test_asn/TestTParent.cs | 2 +- .../org/bn/coders/test_asn/TestTParent2.cs | 2 +- .../bn/coders/test_asn/TestTaggedSetInSet.cs | 6 +- .../org/bn/coders/test_asn/ValueWithParams.cs | 21 +- .../org/bn/coders/test_asn/Version.cs | 6 +- .../BinaryNotesTests/test_asn_convert.py | 13 +- 76 files changed, 1223 insertions(+), 516 deletions(-) create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ChoiceType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqExtensible.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedChoiceSeq.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedEnumSeq.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleSize.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqSize.cs diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugPrimitive.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugPrimitive.cs index bb04190..6b89592 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugPrimitive.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugPrimitive.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Choice ( Name = "BugPrimitive") ] + [ASN1Choice ( Name = "BugPrimitive", IsExtensible = false) ] public class BugPrimitive : IASN1PreparedElement { @@ -26,7 +26,7 @@ public class BugPrimitive : IASN1PreparedElement { [ASN1Boolean( Name = "" )] - [ASN1Element ( Name = "bugBoolean", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "bugBoolean", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public bool BugBoolean { @@ -43,7 +43,7 @@ public bool BugBoolean [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "bugInteger", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "bugInteger", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public long BugInteger { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugSequenceType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugSequenceType.cs index 7f543c4..a09dd46 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugSequenceType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugSequenceType.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "BugSequenceType", IsSet = false )] + [ASN1Sequence ( Name = "BugSequenceType", IsExtensible = false, IsSet = false)] public class BugSequenceType : IASN1PreparedElement { - + private bool booleanField_ ; [ASN1Boolean( Name = "" )] - [ASN1Element ( Name = "booleanField", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "booleanField", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public bool BooleanField { @@ -35,7 +35,7 @@ public bool BooleanField private long integerField_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "integerField", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "integerField", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long IntegerField { @@ -47,16 +47,15 @@ public long IntegerField public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(BugSequenceType)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(BugSequenceType)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugValueType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugValueType.cs index 825f9c4..2a9cf41 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugValueType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugValueType.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Choice ( Name = "BugValueType") ] + [ASN1Choice ( Name = "BugValueType", IsExtensible = false) ] public class BugValueType : IASN1PreparedElement { @@ -25,7 +25,7 @@ public class BugValueType : IASN1PreparedElement { - [ASN1Element ( Name = "bugPrimitive", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "bugPrimitive", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public BugPrimitive BugPrimitive { @@ -41,7 +41,7 @@ public BugPrimitive BugPrimitive - [ASN1Element ( Name = "bugEnum", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "bugEnum", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public BugEnum BugEnum { @@ -57,7 +57,7 @@ public BugEnum BugEnum - [ASN1Element ( Name = "bugSequence", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "bugSequence", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public BugSequenceType BugSequence { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ChoiceType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ChoiceType.cs new file mode 100644 index 0000000..37355b2 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ChoiceType.cs @@ -0,0 +1,186 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1Choice ( Name = "ChoiceType", IsExtensible = true) ] + public class ChoiceType : IASN1PreparedElement { + + + private long field10_ ; + private bool field10_selected = false ; + + + [ASN1Integer( Name = "" )] + + [ASN1Element ( Name = "field10", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + + public long Field10 + { + get { return field10_; } + set { selectField10(value); } + } + + + + + private byte[] field20_ ; + private bool field20_selected = false ; + + + [ASN1OctetString( Name = "" )] + + [ASN1Element ( Name = "field20", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + + public byte[] Field20 + { + get { return field20_; } + set { selectField20(value); } + } + + + + + private string field30_ ; + private bool field30_selected = false ; + + + [ASN1String( Name = "", + StringType = UniversalTags.UTF8String , IsUCS = false )] + [ASN1Element ( Name = "field30", IsOptional = false , IsExtended = true , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + + public string Field30 + { + get { return field30_; } + set { selectField30(value); } + } + + + + + private long field40_ ; + private bool field40_selected = false ; + + + [ASN1Integer( Name = "" )] + + [ASN1Element ( Name = "field40", IsOptional = false , IsExtended = true , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + + public long Field40 + { + get { return field40_; } + set { selectField40(value); } + } + + + + public bool isField10Selected () { + return this.field10_selected ; + } + + + + + public void selectField10 (long val) { + this.field10_ = val; + this.field10_selected = true; + + + this.field20_selected = false; + + this.field30_selected = false; + + this.field40_selected = false; + + } + + + public bool isField20Selected () { + return this.field20_selected ; + } + + + + + public void selectField20 (byte[] val) { + this.field20_ = val; + this.field20_selected = true; + + + this.field10_selected = false; + + this.field30_selected = false; + + this.field40_selected = false; + + } + + + public bool isField30Selected () { + return this.field30_selected ; + } + + + + + public void selectField30 (string val) { + this.field30_ = val; + this.field30_selected = true; + + + this.field10_selected = false; + + this.field20_selected = false; + + this.field40_selected = false; + + } + + + public bool isField40Selected () { + return this.field40_selected ; + } + + + + + public void selectField40 (long val) { + this.field40_ = val; + this.field40_selected = true; + + + this.field10_selected = false; + + this.field20_selected = false; + + this.field30_selected = false; + + } + + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ChoiceType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config.cs index b7f39ce..208f302 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config.cs @@ -29,7 +29,7 @@ public class ConfigSequenceType : IASN1PreparedElement { private LstVersion lstVersion_ ; - [ASN1Element ( Name = "lstVersion", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "lstVersion", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public LstVersion LstVersion { @@ -41,7 +41,7 @@ public LstVersion LstVersion private Major major_config_ ; - [ASN1Element ( Name = "major_config", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "major_config", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Major Major_config { @@ -64,7 +64,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "Config", IsOptional = false , HasTag = true, Tag = 76, + [ASN1Element ( Name = "Config", IsOptional = false , IsExtended = false , HasTag = true, Tag = 76, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public ConfigSequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config2.cs index f196d53..c318e82 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Config2.cs @@ -29,7 +29,7 @@ public class Config2SequenceType : IASN1PreparedElement { private LstVersion lstVersion_ ; - [ASN1Element ( Name = "lstVersion", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "lstVersion", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public LstVersion LstVersion { @@ -41,7 +41,7 @@ public LstVersion LstVersion private Major major_config_ ; - [ASN1Element ( Name = "major_config", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "major_config", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Major Major_config { @@ -64,7 +64,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "Config2", IsOptional = false , HasTag = true, Tag = 79, + [ASN1Element ( Name = "Config2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 79, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public Config2SequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentPartHeader.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentPartHeader.cs index 9a2e23e..bcd715d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentPartHeader.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentPartHeader.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "ContentPartHeader", IsSet = false )] + [ASN1Sequence ( Name = "ContentPartHeader", IsExtensible = false, IsSet = false)] public class ContentPartHeader : IASN1PreparedElement { - + private string name_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "name", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "name", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public string Name { @@ -34,10 +34,10 @@ public string Name private System.Collections.Generic.ICollection values_ ; -[ASN1SequenceOf( Name = "values", IsSetOf = false )] +[ASN1SequenceOf( Name = "values", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "values", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "values", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection Values { @@ -49,16 +49,15 @@ public System.Collections.Generic.ICollection Values public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ContentPartHeader)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ContentPartHeader)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs index 8176953..773b875 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Enum ( Name = "ContentSchema")] + [ASN1Enum ( Name = "ContentSchema", IsExtensible = false, NumRootElements = 6)] public class ContentSchema : IASN1PreparedElement { public enum EnumType { @@ -40,19 +40,19 @@ public EnumType Value { get { return val; } set { val = value; } - } + } - public void initWithDefaults() - { - } + public void initWithDefaults() + { + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ContentSchema)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ContentSchema)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } + - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs index 78f2b8e..0f87a47 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Enum ( Name = "ContentType")] + [ASN1Enum ( Name = "ContentType", IsExtensible = false, NumRootElements = 10)] public class ContentType : IASN1PreparedElement { public enum EnumType { @@ -48,19 +48,19 @@ public EnumType Value { get { return val; } set { val = value; } - } + } - public void initWithDefaults() - { - } + public void initWithDefaults() + { + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ContentType)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ContentType)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } + - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Data.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Data.cs index a79738d..6ac35cf 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Data.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Data.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Choice ( Name = "Data") ] + [ASN1Choice ( Name = "Data", IsExtensible = false) ] public class Data : IASN1PreparedElement { @@ -25,7 +25,7 @@ public class Data : IASN1PreparedElement { - [ASN1Element ( Name = "plain", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "plain", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public TestPRN Plain { @@ -41,7 +41,7 @@ public TestPRN Plain - [ASN1Element ( Name = "unicode", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "unicode", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public TestOCT Unicode { @@ -57,7 +57,7 @@ public TestOCT Unicode - [ASN1Element ( Name = "binary", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "binary", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public TestOCT Binary { @@ -74,7 +74,7 @@ public TestOCT Binary [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "simpleType", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public string SimpleType { @@ -91,7 +91,7 @@ public string SimpleType [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "simpleOctType", IsOptional = false , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleOctType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] public byte[] SimpleOctType { @@ -108,7 +108,7 @@ public byte[] SimpleOctType [ASN1Boolean( Name = "" )] - [ASN1Element ( Name = "booleanType", IsOptional = false , HasTag = true, Tag = 5 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "booleanType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 5 , HasDefaultValue = false ) ] public bool BooleanType { @@ -125,7 +125,7 @@ public bool BooleanType [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "intType", IsOptional = false , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] public long IntType { @@ -141,15 +141,9 @@ public long IntType [ASN1Integer( Name = "" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 255L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] - [ASN1Element ( Name = "intBndType", IsOptional = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intBndType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] public int IntBndType { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeq.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeq.cs index 2d55aac..7a67f63 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeq.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeq.cs @@ -16,12 +16,12 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "DataSeq", IsSet = false )] + [ASN1Sequence ( Name = "DataSeq", IsExtensible = false, IsSet = false)] public class DataSeq : IASN1PreparedElement { - + private TestPRN plain_ ; - [ASN1Element ( Name = "plain", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "plain", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public TestPRN Plain { @@ -35,7 +35,7 @@ public TestPRN Plain private bool unicode_present = false ; - [ASN1Element ( Name = "unicode", IsOptional = true , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "unicode", IsOptional = true , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public TestOCT Unicode { @@ -47,7 +47,7 @@ public TestOCT Unicode private TestOCT binary_ ; - [ASN1Element ( Name = "binary", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "binary", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public TestOCT Binary { @@ -60,7 +60,7 @@ public TestOCT Binary private string simpleType_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "simpleType", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public string SimpleType { @@ -73,7 +73,7 @@ public string SimpleType private byte[] simpleOctType_ ; [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "simpleOctType", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleOctType", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public byte[] SimpleOctType { @@ -86,7 +86,7 @@ public byte[] SimpleOctType private bool booleanType_ ; [ASN1Boolean( Name = "" )] - [ASN1Element ( Name = "booleanType", IsOptional = false , HasTag = true, Tag = 5 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "booleanType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 5 , HasDefaultValue = false ) ] public bool BooleanType { @@ -99,7 +99,7 @@ public bool BooleanType private long intType_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "intType", IsOptional = false , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] public long IntType { @@ -111,15 +111,9 @@ public long IntType private int intBndType_ ; [ASN1Integer( Name = "" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 255L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] - [ASN1Element ( Name = "intBndType", IsOptional = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intBndType", IsOptional = false , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] public int IntBndType { @@ -132,10 +126,10 @@ public int IntBndType private System.Collections.Generic.ICollection stringArray_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] -[ASN1SequenceOf( Name = "stringArray", IsSetOf = false )] +[ASN1SequenceOf( Name = "stringArray", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "stringArray", IsOptional = false , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "stringArray", IsOptional = false , IsExtended = false , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection StringArray { @@ -147,10 +141,10 @@ public System.Collections.Generic.ICollection StringArray private System.Collections.Generic.ICollection dataArray_ ; -[ASN1SequenceOf( Name = "dataArray", IsSetOf = false )] +[ASN1SequenceOf( Name = "dataArray", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "dataArray", IsOptional = false , HasTag = true, Tag = 9 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "dataArray", IsOptional = false , IsExtended = false , HasTag = true, Tag = 9 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection DataArray { @@ -165,7 +159,7 @@ public System.Collections.Generic.ICollection DataArray private bool extension_present = false ; [ASN1Any( Name = "" )] - [ASN1Element ( Name = "extension", IsOptional = true , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "extension", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public byte[] Extension { @@ -185,16 +179,15 @@ public bool isExtensionPresent () { public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DataSeq)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DataSeq)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqExtensible.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqExtensible.cs new file mode 100644 index 0000000..d34c514 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqExtensible.cs @@ -0,0 +1,115 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "DataSeqExtensible", IsExtensible = true, IsSet = false)] + public class DataSeqExtensible : IASN1PreparedElement { + + private int simpleInt_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + [ASN1Element ( Name = "simpleInt", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + + public int SimpleInt + { + get { return simpleInt_; } + set { simpleInt_ = value; } + } + + + + private bool simpleBool_ ; + [ASN1Boolean( Name = "" )] + + [ASN1Element ( Name = "simpleBool", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + + public bool SimpleBool + { + get { return simpleBool_; } + set { simpleBool_ = value; } + } + + + + private bool optBool_ ; + + private bool optBool_present = false ; + [ASN1Boolean( Name = "" )] + + [ASN1Element ( Name = "optBool", IsOptional = true , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + + public bool OptBool + { + get { return optBool_; } + set { optBool_ = value; optBool_present = true; } + } + + + + private int extendedInt1_ ; + + private bool extendedInt1_present = false ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 63L, IsExtensible = false) ] + + [ASN1Element ( Name = "extendedInt1", IsOptional = true , IsExtended = true , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + + public int ExtendedInt1 + { + get { return extendedInt1_; } + set { extendedInt1_ = value; extendedInt1_present = true; } + } + + + + private int extendedInt2_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 100000L, IsExtensible = false) ] + + [ASN1Element ( Name = "extendedInt2", IsOptional = false , IsExtended = true , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] + + public int ExtendedInt2 + { + get { return extendedInt2_; } + set { extendedInt2_ = value; } + } + + + + public bool isOptBoolPresent () { + return this.optBool_present == true; + } + + public bool isExtendedInt1Present () { + return this.extendedInt1_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DataSeqExtensible)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqMO.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqMO.cs index 71237e6..68fc2e8 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqMO.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/DataSeqMO.cs @@ -16,12 +16,12 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "DataSeqMO", IsSet = false )] + [ASN1Sequence ( Name = "DataSeqMO", IsExtensible = false, IsSet = false)] public class DataSeqMO : IASN1PreparedElement { - + private TestPRN plain_ ; - [ASN1Element ( Name = "plain", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "plain", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public TestPRN Plain { @@ -35,7 +35,7 @@ public TestPRN Plain private bool unicode_present = false ; - [ASN1Element ( Name = "unicode", IsOptional = true , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "unicode", IsOptional = true , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public TestOCT Unicode { @@ -49,7 +49,7 @@ public TestOCT Unicode private bool binary_present = false ; - [ASN1Element ( Name = "binary", IsOptional = true , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "binary", IsOptional = true , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public TestOCT Binary { @@ -64,7 +64,7 @@ public TestOCT Binary private bool simpleType_present = false ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "simpleType", IsOptional = true , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleType", IsOptional = true , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public string SimpleType { @@ -77,7 +77,7 @@ public string SimpleType private byte[] simpleOctType_ ; [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "simpleOctType", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleOctType", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public byte[] SimpleOctType { @@ -92,7 +92,7 @@ public byte[] SimpleOctType private bool booleanType_present = false ; [ASN1Boolean( Name = "" )] - [ASN1Element ( Name = "booleanType", IsOptional = true , HasTag = true, Tag = 5 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "booleanType", IsOptional = true , IsExtended = false , HasTag = true, Tag = 5 , HasDefaultValue = false ) ] public bool BooleanType { @@ -107,7 +107,7 @@ public bool BooleanType private bool intType_present = false ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "intType", IsOptional = true , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intType", IsOptional = true , IsExtended = false , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] public long IntType { @@ -121,15 +121,9 @@ public long IntType private bool intBndType_present = false ; [ASN1Integer( Name = "" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 255L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] - [ASN1Element ( Name = "intBndType", IsOptional = true , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intBndType", IsOptional = true , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] public int IntBndType { @@ -144,10 +138,10 @@ public int IntBndType private bool stringArray_present = false ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] -[ASN1SequenceOf( Name = "stringArray", IsSetOf = false )] +[ASN1SequenceOf( Name = "stringArray", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "stringArray", IsOptional = true , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "stringArray", IsOptional = true , IsExtended = false , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection StringArray { @@ -161,10 +155,10 @@ public System.Collections.Generic.ICollection StringArray private bool dataArray_present = false ; -[ASN1SequenceOf( Name = "dataArray", IsSetOf = false )] +[ASN1SequenceOf( Name = "dataArray", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "dataArray", IsOptional = true , HasTag = true, Tag = 9 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "dataArray", IsOptional = true , IsExtended = false , HasTag = true, Tag = 9 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection DataArray { @@ -178,7 +172,7 @@ public System.Collections.Generic.ICollection DataArray private bool plain2_present = false ; - [ASN1Element ( Name = "plain2", IsOptional = true , HasTag = true, Tag = 10 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "plain2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 10 , HasDefaultValue = false ) ] public TestPRN Plain2 { @@ -192,7 +186,7 @@ public TestPRN Plain2 private bool unicode2_present = false ; - [ASN1Element ( Name = "unicode2", IsOptional = true , HasTag = true, Tag = 18 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "unicode2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 18 , HasDefaultValue = false ) ] public TestOCT Unicode2 { @@ -206,7 +200,7 @@ public TestOCT Unicode2 private bool binary2_present = false ; - [ASN1Element ( Name = "binary2", IsOptional = true , HasTag = true, Tag = 11 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "binary2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 11 , HasDefaultValue = false ) ] public TestOCT Binary2 { @@ -221,7 +215,7 @@ public TestOCT Binary2 private bool simpleType2_present = false ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "simpleType2", IsOptional = true , HasTag = true, Tag = 12 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleType2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 12 , HasDefaultValue = false ) ] public string SimpleType2 { @@ -236,7 +230,7 @@ public string SimpleType2 private bool simpleOctType2_present = false ; [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "simpleOctType2", IsOptional = true , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "simpleOctType2", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public byte[] SimpleOctType2 { @@ -251,7 +245,7 @@ public byte[] SimpleOctType2 private bool booleanType2_present = false ; [ASN1Boolean( Name = "" )] - [ASN1Element ( Name = "booleanType2", IsOptional = true , HasTag = true, Tag = 13 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "booleanType2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 13 , HasDefaultValue = false ) ] public bool BooleanType2 { @@ -266,7 +260,7 @@ public bool BooleanType2 private bool intType2_present = false ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "intType2", IsOptional = true , HasTag = true, Tag = 19 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intType2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 19 , HasDefaultValue = false ) ] public long IntType2 { @@ -280,15 +274,9 @@ public long IntType2 private bool intBndType2_present = false ; [ASN1Integer( Name = "" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 255L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] - [ASN1Element ( Name = "intBndType2", IsOptional = true , HasTag = true, Tag = 14 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "intBndType2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 14 , HasDefaultValue = false ) ] public int IntBndType2 { @@ -303,10 +291,10 @@ public int IntBndType2 private bool stringArray2_present = false ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] -[ASN1SequenceOf( Name = "stringArray2", IsSetOf = false )] +[ASN1SequenceOf( Name = "stringArray2", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "stringArray2", IsOptional = true , HasTag = true, Tag = 15 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "stringArray2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 15 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection StringArray2 { @@ -320,10 +308,10 @@ public System.Collections.Generic.ICollection StringArray2 private bool dataArray2_present = false ; -[ASN1SequenceOf( Name = "dataArray2", IsSetOf = false )] +[ASN1SequenceOf( Name = "dataArray2", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "dataArray2", IsOptional = true , HasTag = true, Tag = 16 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "dataArray2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 16 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection DataArray2 { @@ -337,7 +325,7 @@ public System.Collections.Generic.ICollection DataArray2 private bool plain3_present = false ; - [ASN1Element ( Name = "plain3", IsOptional = true , HasTag = true, Tag = 17 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "plain3", IsOptional = true , IsExtended = false , HasTag = true, Tag = 17 , HasDefaultValue = false ) ] public TestPRN Plain3 { @@ -425,16 +413,15 @@ public bool isPlain3Present () { public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DataSeqMO)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DataSeqMO)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedChoiceSeq.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedChoiceSeq.cs new file mode 100644 index 0000000..cd3ed08 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedChoiceSeq.cs @@ -0,0 +1,61 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "ExtendedChoiceSeq", IsExtensible = false, IsSet = false)] + public class ExtendedChoiceSeq : IASN1PreparedElement { + + private ChoiceType choi_ ; + + [ASN1Element ( Name = "choi", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ChoiceType Choi + { + get { return choi_; } + set { choi_ = value; } + } + + + + private int tail_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + [ASN1Element ( Name = "tail", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public int Tail + { + get { return tail_; } + set { tail_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ExtendedChoiceSeq)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedEnumSeq.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedEnumSeq.cs new file mode 100644 index 0000000..160ec99 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtendedEnumSeq.cs @@ -0,0 +1,61 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "ExtendedEnumSeq", IsExtensible = false, IsSet = false)] + public class ExtendedEnumSeq : IASN1PreparedElement { + + private ProtectedZoneType prot_ ; + + [ASN1Element ( Name = "prot", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ProtectedZoneType Prot + { + get { return prot_; } + set { prot_ = value; } + } + + + + private int tail_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + [ASN1Element ( Name = "tail", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public int Tail + { + get { return tail_; } + set { tail_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ExtendedEnumSeq)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs new file mode 100644 index 0000000..d8704b2 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ExtensibleInteger" )] + public class ExtensibleInteger: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "ExtensibleInteger" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 63L, IsExtensible = true) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public ExtensibleInteger() { + } + + public ExtensibleInteger(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ExtensibleInteger)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleSize.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleSize.cs new file mode 100644 index 0000000..6ab1c28 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleSize.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ExtensibleSize" ) ] + public class ExtensibleSize : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 1L, Max = 3L, IsExtensible = true) ] + + [ASN1SequenceOf( Name = "ExtensibleSize", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(SubInteger item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ExtensibleSize)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/FQDN.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/FQDN.cs index c3aa6e9..3545c3d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/FQDN.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/FQDN.cs @@ -23,13 +23,7 @@ public class FQDN: IASN1PreparedElement { [ASN1String( Name = "FQDN", StringType = UniversalTags.VisibleString , IsUCS = false) ] - [ASN1ValueRangeConstraint ( - - Min = 1L, - - Max = 255L - - ) ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 255L, IsExtensible = false) ] public String Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUSequence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUSequence.cs index af831a4..7979e3b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUSequence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUSequence.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "ITUSequence", IsSet = false )] + [ASN1Sequence ( Name = "ITUSequence", IsExtensible = false, IsSet = false)] public class ITUSequence : IASN1PreparedElement { - + private string type1_ ; [ASN1String( Name = "", StringType = UniversalTags.VisibleString , IsUCS = false )] - [ASN1Element ( Name = "type1", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "type1", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public string Type1 { @@ -34,7 +34,7 @@ public string Type1 private ITUType1 type2_ ; - [ASN1Element ( Name = "type2", IsOptional = false , HasTag = true, Tag = 3, + [ASN1Element ( Name = "type2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public ITUType1 Type2 @@ -47,7 +47,7 @@ public ITUType1 Type2 private ITUType2 type3_ ; - [ASN1Element ( Name = "type3", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "type3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public ITUType2 Type3 { @@ -59,7 +59,7 @@ public ITUType2 Type3 private ITUType3 type4_ ; - [ASN1Element ( Name = "type4", IsOptional = false , HasTag = true, Tag = 7, + [ASN1Element ( Name = "type4", IsOptional = false , IsExtended = false , HasTag = true, Tag = 7, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public ITUType3 Type4 @@ -74,7 +74,7 @@ public ITUType3 Type4 private bool type5_present = false ; - [ASN1Element ( Name = "type5", IsOptional = true , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "type5", IsOptional = true , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public ITUType2 Type5 { @@ -87,7 +87,7 @@ public ITUType2 Type5 private string type6_ ; [ASN1String( Name = "", StringType = UniversalTags.VisibleString , IsUCS = false )] - [ASN1Element ( Name = "type6", IsOptional = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "type6", IsOptional = false , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] public string Type6 { @@ -99,7 +99,7 @@ public string Type6 private ITUType6 type7_ ; - [ASN1Element ( Name = "type7", IsOptional = false , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "type7", IsOptional = false , IsExtended = false , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] public ITUType6 Type7 { @@ -115,16 +115,15 @@ public bool isType5Present () { public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ITUSequence)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ITUSequence)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType2.cs index 1348ff9..7c86a07 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType2.cs @@ -23,7 +23,7 @@ public class ITUType2: IASN1PreparedElement { private ITUType1 val; - [ASN1Element ( Name = "ITUType2", IsOptional = false , HasTag = true, Tag = 3, + [ASN1Element ( Name = "ITUType2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public ITUType1 Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType3.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType3.cs index b99239d..36e222a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType3.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType3.cs @@ -23,7 +23,7 @@ public class ITUType3: IASN1PreparedElement { private ITUType2 val; - [ASN1Element ( Name = "ITUType3", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "ITUType3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public ITUType2 Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType4.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType4.cs index dd3590e..5fe6444 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType4.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType4.cs @@ -23,7 +23,7 @@ public class ITUType4: IASN1PreparedElement { private ITUType3 val; - [ASN1Element ( Name = "ITUType4", IsOptional = false , HasTag = true, Tag = 7, + [ASN1Element ( Name = "ITUType4", IsOptional = false , IsExtended = false , HasTag = true, Tag = 7, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public ITUType3 Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType5.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType5.cs index d82c9f3..11db613 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType5.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType5.cs @@ -23,7 +23,7 @@ public class ITUType5: IASN1PreparedElement { private ITUType2 val; - [ASN1Element ( Name = "ITUType5", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "ITUType5", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public ITUType2 Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType6.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType6.cs index 7bd27ba..a83fc8f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType6.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ITUType6.cs @@ -24,7 +24,7 @@ public class ITUType6: IASN1PreparedElement { [ASN1String( Name = "", StringType = UniversalTags.VisibleString , IsUCS = false )] - [ASN1Element ( Name = "ITUType6", IsOptional = false , HasTag = true, Tag = 9 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "ITUType6", IsOptional = false , IsExtended = false , HasTag = true, Tag = 9 , HasDefaultValue = false ) ] public string Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/LstVersion.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/LstVersion.cs index 5b32920..c816d99 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/LstVersion.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/LstVersion.cs @@ -23,10 +23,10 @@ public class LstVersion: IASN1PreparedElement { private System.Collections.Generic.ICollection val; -[ASN1SequenceOf( Name = "LstVersion", IsSetOf = true )] +[ASN1SequenceOf( Name = "LstVersion", IsExtensible = false, IsSetOf = true )] - [ASN1Element ( Name = "LstVersion", IsOptional = false , HasTag = true, Tag = 75, + [ASN1Element ( Name = "LstVersion", IsOptional = false , IsExtended = false , HasTag = true, Tag = 75, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Major.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Major.cs index 32d231f..845de46 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Major.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Major.cs @@ -24,7 +24,7 @@ public class Major: IASN1PreparedElement { [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "Major", IsOptional = false , HasTag = true, Tag = 106, + [ASN1Element ( Name = "Major", IsOptional = false , IsExtended = false , HasTag = true, Tag = 106, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public long Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Minor.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Minor.cs index 73f02a6..0c3b12a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Minor.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Minor.cs @@ -24,7 +24,7 @@ public class Minor: IASN1PreparedElement { [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "Minor", IsOptional = false , HasTag = true, Tag = 105, + [ASN1Element ( Name = "Minor", IsOptional = false , IsExtended = false , HasTag = true, Tag = 105, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public long Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs new file mode 100644 index 0000000..3968ba3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "MixedEnumType", IsExtensible = false, NumRootElements = 3)] + public class MixedEnumType : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "low", HasTag = true , Tag = 3 )] + low , + [ASN1EnumItem ( Name = "mid", HasTag = true , Tag = 8 )] + mid , + [ASN1EnumItem ( Name = "high", HasTag = true , Tag = 101 )] + high , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(MixedEnumType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/PlainParamsMap.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/PlainParamsMap.cs index 6589772..0c69fb6 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/PlainParamsMap.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/PlainParamsMap.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "PlainParamsMap", IsSet = false )] + [ASN1Sequence ( Name = "PlainParamsMap", IsExtensible = false, IsSet = false)] public class PlainParamsMap : IASN1PreparedElement { - + private string param_name_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "param_name", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "param_name", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public string Param_name { @@ -35,7 +35,7 @@ public string Param_name private string param_value_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "param_value", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "param_value", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public string Param_value { @@ -47,16 +47,15 @@ public string Param_value public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PlainParamsMap)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PlainParamsMap)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs new file mode 100644 index 0000000..8f8b1b1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs @@ -0,0 +1,50 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "ProtectedZoneType", IsExtensible = true, NumRootElements = 1)] + public class ProtectedZoneType : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "permanentCenDsrcTolling", HasTag = true , Tag = 0 )] + permanentCenDsrcTolling , + [ASN1EnumItem ( Name = "temporaryCenDsrcTolling", HasTag = true , Tag = 1 )] + temporaryCenDsrcTolling , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ProtectedZoneType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs index ff73f10..cbec605 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "SequenceWithDefault", IsSet = false )] + [ASN1Sequence ( Name = "SequenceWithDefault", IsExtensible = false, IsSet = false)] public class SequenceWithDefault : IASN1PreparedElement { - + private long nodefault_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "nodefault", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "nodefault", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long Nodefault { @@ -35,7 +35,7 @@ public long Nodefault private string withDefault_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "withDefault", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withDefault", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = true ) ] public string WithDefault { @@ -48,7 +48,7 @@ public string WithDefault private long withIntDef_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "withIntDef", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withIntDef", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = true ) ] public long WithIntDef { @@ -67,7 +67,7 @@ public class WithSeqDefSequenceType : IASN1PreparedElement { private string name_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "name", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "name", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public string Name { @@ -80,7 +80,7 @@ public string Name private string email_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "email", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "email", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public string Email { @@ -103,7 +103,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "withSeqDef", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withSeqDef", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = true ) ] public WithSeqDefSequenceType WithSeqDef { @@ -115,7 +115,7 @@ public WithSeqDefSequenceType WithSeqDef private TestOCT withOctDef_ ; - [ASN1Element ( Name = "withOctDef", IsOptional = false , HasTag = true, Tag = 4 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withOctDef", IsOptional = false , IsExtended = false , HasTag = true, Tag = 4 , HasDefaultValue = true ) ] public TestOCT WithOctDef { @@ -128,7 +128,7 @@ public TestOCT WithOctDef private byte[] withOctDef2_ ; [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "withOctDef2", IsOptional = false , HasTag = true, Tag = 5 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withOctDef2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 5 , HasDefaultValue = true ) ] public byte[] WithOctDef2 { @@ -141,10 +141,10 @@ public byte[] WithOctDef2 private System.Collections.Generic.ICollection withSeqOf_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] -[ASN1SequenceOf( Name = "withSeqOf", IsSetOf = false )] +[ASN1SequenceOf( Name = "withSeqOf", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "withSeqOf", IsOptional = false , HasTag = true, Tag = 6 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withSeqOf", IsOptional = false , IsExtended = false , HasTag = true, Tag = 6 , HasDefaultValue = true ) ] public System.Collections.Generic.ICollection WithSeqOf { @@ -156,10 +156,10 @@ public System.Collections.Generic.ICollection WithSeqOf private System.Collections.Generic.ICollection withSeqOf2_ ; -[ASN1SequenceOf( Name = "withSeqOf2", IsSetOf = false )] +[ASN1SequenceOf( Name = "withSeqOf2", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "withSeqOf2", IsOptional = false , HasTag = true, Tag = 7 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withSeqOf2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = true ) ] public System.Collections.Generic.ICollection WithSeqOf2 { @@ -171,7 +171,7 @@ public System.Collections.Generic.ICollection WithSeqOf2 private StringArray withSeqOf3_ ; - [ASN1Element ( Name = "withSeqOf3", IsOptional = false , HasTag = true, Tag = 8 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withSeqOf3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 8 , HasDefaultValue = true ) ] public StringArray WithSeqOf3 { @@ -195,7 +195,7 @@ public enum EnumType { [ASN1EnumItem ( Name = "two", HasTag = true , Tag = 2 )] two , [ASN1EnumItem ( Name = "three", HasTag = true , Tag = 3 )] - three + three , } private EnumType val; @@ -220,7 +220,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "withEnumDef", IsOptional = false , HasTag = true, Tag = 9 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "withEnumDef", IsOptional = false , IsExtended = false , HasTag = true, Tag = 9 , HasDefaultValue = true ) ] public WithEnumDefEnumType WithEnumDef { @@ -232,7 +232,7 @@ public WithEnumDefEnumType WithEnumDef public void initWithDefaults() { - string param_WithDefault = + string param_WithDefault = "dd"; WithDefault = param_WithDefault; long param_WithIntDef = @@ -322,15 +322,14 @@ public void initWithDefaults() { param_WithEnumDef.Value = WithEnumDefEnumType.EnumType.two; WithEnumDef = param_WithEnumDef; - } + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SequenceWithDefault)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SequenceWithDefault)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithEnum.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithEnum.cs index 3fbeceb..4845693 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithEnum.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithEnum.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "SequenceWithEnum", IsSet = false )] + [ASN1Sequence ( Name = "SequenceWithEnum", IsExtensible = false, IsSet = false)] public class SequenceWithEnum : IASN1PreparedElement { - + private string item_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "item", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "item", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public string Item { @@ -34,7 +34,7 @@ public string Item private ContentSchema enval_ ; - [ASN1Element ( Name = "enval", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "enval", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public ContentSchema Enval { @@ -46,7 +46,7 @@ public ContentSchema Enval private ContentSchema taggedEnval_ ; - [ASN1Element ( Name = "taggedEnval", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "taggedEnval", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public ContentSchema TaggedEnval { @@ -58,16 +58,15 @@ public ContentSchema TaggedEnval public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SequenceWithEnum)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SequenceWithEnum)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithNull.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithNull.cs index 9295d1a..3c64e4d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithNull.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithNull.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "SequenceWithNull", IsSet = false )] + [ASN1Sequence ( Name = "SequenceWithNull", IsExtensible = false, IsSet = false)] public class SequenceWithNull : IASN1PreparedElement { - + private string test_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "test", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "test", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public string Test { @@ -36,7 +36,7 @@ public string Test [ASN1Null ( Name = "nullVal" )] - [ASN1Element ( Name = "nullVal", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "nullVal", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public NullObject NullVal { @@ -49,7 +49,7 @@ public NullObject NullVal private string test2_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "test2", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "test2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public string Test2 { @@ -61,16 +61,15 @@ public string Test2 public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SequenceWithNull)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SequenceWithNull)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set1.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set1.cs index f719057..5d84c7d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set1.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set1.cs @@ -30,7 +30,7 @@ public class Set1SequenceType : IASN1PreparedElement { private long set1ID_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "set1ID", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "set1ID", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public long Set1ID { @@ -53,7 +53,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "Set1", IsOptional = false , HasTag = true, Tag = 55, + [ASN1Element ( Name = "Set1", IsOptional = false , IsExtended = false , HasTag = true, Tag = 55, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public Set1SequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set2.cs index c7c6661..3e2ecb1 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set2.cs @@ -23,10 +23,10 @@ public class Set2: IASN1PreparedElement { private System.Collections.Generic.ICollection val; -[ASN1SequenceOf( Name = "Set2", IsSetOf = true )] +[ASN1SequenceOf( Name = "Set2", IsExtensible = false, IsSetOf = true )] - [ASN1Element ( Name = "Set2", IsOptional = false , HasTag = true, Tag = 128, + [ASN1Element ( Name = "Set2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 128, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set3.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set3.cs index ec4f76e..8d35753 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set3.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set3.cs @@ -29,7 +29,7 @@ public class Set3SequenceType : IASN1PreparedElement { private Set2 set2_ ; - [ASN1Element ( Name = "set2", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "set2", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Set2 Set2 { @@ -52,7 +52,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "Set3", IsOptional = false , HasTag = true, Tag = 124, + [ASN1Element ( Name = "Set3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 124, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public Set3SequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set4.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set4.cs index 207265e..b95d5d5 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set4.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set4.cs @@ -23,10 +23,10 @@ public class Set4: IASN1PreparedElement { private System.Collections.Generic.ICollection val; -[ASN1SequenceOf( Name = "Set4", IsSetOf = true )] +[ASN1SequenceOf( Name = "Set4", IsExtensible = false, IsSetOf = true )] - [ASN1Element ( Name = "Set4", IsOptional = false , HasTag = true, Tag = 61, + [ASN1Element ( Name = "Set4", IsOptional = false , IsExtended = false , HasTag = true, Tag = 61, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set5.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set5.cs index a571960..6519221 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set5.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set5.cs @@ -23,10 +23,10 @@ public class Set5: IASN1PreparedElement { private System.Collections.Generic.ICollection val; -[ASN1SequenceOf( Name = "Set5", IsSetOf = true )] +[ASN1SequenceOf( Name = "Set5", IsExtensible = false, IsSetOf = true )] - [ASN1Element ( Name = "Set5", IsOptional = false , HasTag = true, Tag = 127, + [ASN1Element ( Name = "Set5", IsOptional = false , IsExtended = false , HasTag = true, Tag = 127, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set6.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set6.cs index db3f72d..d575058 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set6.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set6.cs @@ -29,7 +29,7 @@ public class Set6SequenceType : IASN1PreparedElement { private Set4 set4_ ; - [ASN1Element ( Name = "set4", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "set4", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Set4 Set4 { @@ -41,7 +41,7 @@ public Set4 Set4 private Set5 set5_ ; - [ASN1Element ( Name = "set5", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "set5", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Set5 Set5 { @@ -64,7 +64,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "Set6", IsOptional = false , HasTag = true, Tag = 56, + [ASN1Element ( Name = "Set6", IsOptional = false , IsExtended = false , HasTag = true, Tag = 56, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public Set6SequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set7.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set7.cs index ccc1a17..cbac2ad 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set7.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Set7.cs @@ -29,7 +29,7 @@ public class Set7SequenceType : IASN1PreparedElement { private Set6 set6_ ; - [ASN1Element ( Name = "set6", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "set6", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Set6 Set6 { @@ -52,7 +52,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "Set7", IsOptional = false , HasTag = true, Tag = 90, + [ASN1Element ( Name = "Set7", IsOptional = false , IsExtended = false , HasTag = true, Tag = 90, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public Set7SequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SetWithDefault.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SetWithDefault.cs index b13af27..134fe99 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SetWithDefault.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SetWithDefault.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "SetWithDefault", IsSet = true )] + [ASN1Sequence ( Name = "SetWithDefault", IsExtensible = false, IsSet = true)] public class SetWithDefault : IASN1PreparedElement { - + private long nodefault_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "nodefault", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "nodefault", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public long Nodefault { @@ -34,7 +34,7 @@ public long Nodefault private TestPRN nodefault2_ ; - [ASN1Element ( Name = "nodefault2", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "nodefault2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public TestPRN Nodefault2 { @@ -47,7 +47,7 @@ public TestPRN Nodefault2 private string default3_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "default3", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "default3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = true ) ] public string Default3 { @@ -59,19 +59,18 @@ public string Default3 public void initWithDefaults() { - string param_Default3 = + string param_Default3 = "DDDdd"; Default3 = param_Default3; - } + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SetWithDefault)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SetWithDefault)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs new file mode 100644 index 0000000..b64ec57 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SubInteger" )] + public class SubInteger: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SubInteger" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 63L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SubInteger() { + } + + public SubInteger(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SubInteger)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedNullSequence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedNullSequence.cs index 55f1667..25aac94 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedNullSequence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedNullSequence.cs @@ -25,7 +25,7 @@ public class TaggedNullSequence: IASN1PreparedElement { [ASN1Null ( Name = "TaggedNullSequence" )] - [ASN1Element ( Name = "TaggedNullSequence", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "TaggedNullSequence", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public NullObject Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSeqInSeq.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSeqInSeq.cs index 136be16..afdcaa4 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSeqInSeq.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSeqInSeq.cs @@ -29,7 +29,7 @@ public class TaggedSeqInSeqSequenceType : IASN1PreparedElement { private PlainParamsMap field_ ; - [ASN1Element ( Name = "field", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public PlainParamsMap Field { @@ -52,7 +52,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "TaggedSeqInSeq", IsOptional = false , HasTag = true, Tag = 4, + [ASN1Element ( Name = "TaggedSeqInSeq", IsOptional = false , IsExtended = false , HasTag = true, Tag = 4, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public TaggedSeqInSeqSequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSequence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSequence.cs index 50664cf..a405e33 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSequence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TaggedSequence.cs @@ -32,7 +32,7 @@ public class TaggedSequenceSequenceType : IASN1PreparedElement { private bool type1_present = false ; [ASN1String( Name = "", StringType = UniversalTags.VisibleString , IsUCS = false )] - [ASN1Element ( Name = "type1", IsOptional = true , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "type1", IsOptional = true , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] public string Type1 { @@ -59,7 +59,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "TaggedSequence", IsOptional = false , HasTag = true, Tag = 8, + [ASN1Element ( Name = "TaggedSequence", IsOptional = false , IsExtended = false , HasTag = true, Tag = 8, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public TaggedSequenceSequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Test128Tag.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Test128Tag.cs index 26b0b59..3023134 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Test128Tag.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Test128Tag.cs @@ -24,7 +24,7 @@ public class Test128Tag: IASN1PreparedElement { [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "Test128Tag", IsOptional = false , HasTag = true, Tag = 128, + [ASN1Element ( Name = "Test128Tag", IsOptional = false , IsExtended = false , HasTag = true, Tag = 128, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public long Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestBitStrBnd.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestBitStrBnd.cs index 622856d..c38ac5f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestBitStrBnd.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestBitStrBnd.cs @@ -22,13 +22,7 @@ public class TestBitStrBnd : IASN1PreparedElement { private BitString val = null; [ASN1BitString( Name = "TestBitStrBnd") ] - [ASN1ValueRangeConstraint ( - - Min = 1L, - - Max = 16L - - ) ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 16L, IsExtensible = false) ] public BitString Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild2.cs index a9a5eae..c0c1468 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild2.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Choice ( Name = "TestChild2") ] + [ASN1Choice ( Name = "TestChild2", IsExtensible = false) ] public class TestChild2 : IASN1PreparedElement { @@ -26,7 +26,7 @@ public class TestChild2 : IASN1PreparedElement { [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field10", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field10", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long Field10 { @@ -43,7 +43,7 @@ public long Field10 [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "field20", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field20", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public byte[] Field20 { @@ -60,7 +60,7 @@ public byte[] Field20 [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field30", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field30", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public string Field30 { @@ -77,7 +77,7 @@ public string Field30 [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field40", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field40", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public long Field40 { @@ -178,7 +178,7 @@ public void selectField40 (long val) { [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field5", IsOptional = false , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field5", IsOptional = false , IsExtended = false , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] public string Field5 { @@ -195,7 +195,7 @@ public string Field5 [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field6", IsOptional = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field6", IsOptional = false , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] public string Field6 { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild3.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild3.cs index f3738c1..a811d86 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild3.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestChild3.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestChild3", IsSet = false )] + [ASN1Sequence ( Name = "TestChild3", IsExtensible = false, IsSet = false)] public class TestChild3 : IASN1PreparedElement { - + private long field1_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field1", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field1", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long Field1 { @@ -37,7 +37,7 @@ public long Field1 private bool field2_present = false ; [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "field2", IsOptional = true , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public byte[] Field2 { @@ -50,7 +50,7 @@ public byte[] Field2 private string field3_ ; [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field3", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "field3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = true ) ] public string Field3 { @@ -63,7 +63,7 @@ public string Field3 private long field4_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field4", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field4", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public long Field4 { @@ -72,55 +72,68 @@ public long Field4 } + + private int field5_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = -4L, Max = 251L, IsExtensible = false) ] + + [ASN1Element ( Name = "field5", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public int Field5 + { + get { return field5_; } + set { field5_ = value; } + } + + public bool isField2Present () { return this.field2_present == true; } - private string field5_ ; + private string field6_ ; [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field5", IsOptional = false , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field6", IsOptional = false , IsExtended = false , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] - public string Field5 + public string Field6 { - get { return field5_; } - set { field5_ = value; } + get { return field6_; } + set { field6_ = value; } } - private long field6_ ; + private long field7_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field6", IsOptional = false , HasTag = true, Tag = 5 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "field7", IsOptional = false , IsExtended = false , HasTag = true, Tag = 5 , HasDefaultValue = true ) ] - public long Field6 + public long Field7 { - get { return field6_; } - set { field6_ = value; } + get { return field7_; } + set { field7_ = value; } } public void initWithDefaults() { - string param_Field3 = + string param_Field3 = "Sssdsd"; Field3 = param_Field3; - long param_Field6 = + long param_Field7 = 0; - Field6 = param_Field6; + Field7 = param_Field7; - } + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestChild3)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestChild3)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs index 9d39e7e..1f5dede 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs @@ -22,13 +22,7 @@ public class TestI14: IASN1PreparedElement { private int val; [ASN1Integer( Name = "TestI14" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 16384L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 16384L, IsExtensible = false) ] public int Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs index 91a4d83..d9dcd0c 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs @@ -22,13 +22,7 @@ public class TestI16: IASN1PreparedElement { private int val; [ASN1Integer( Name = "TestI16" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 65535L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 65535L, IsExtensible = false) ] public int Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs index e69f87a..26ad694 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs @@ -22,13 +22,7 @@ public class TestI32: IASN1PreparedElement { private long val; [ASN1Integer( Name = "TestI32" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 4294967295L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 4294967295L, IsExtensible = false) ] public long Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs index fe72248..1933916 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs @@ -22,13 +22,7 @@ public class TestI8: IASN1PreparedElement { private int val; [ASN1Integer( Name = "TestI8" )] - [ASN1ValueRangeConstraint ( - - Min = 0L, - - Max = 255L - - ) ] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] public int Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs new file mode 100644 index 0000000..bcf9e04 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "TestI8named" )] + public class TestI8named: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "TestI8named" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 253L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public TestI8named() { + } + + public TestI8named(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestI8named)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs index 2bdc5f9..998f429 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs @@ -22,13 +22,7 @@ public class TestIR: IASN1PreparedElement { private int val; [ASN1Integer( Name = "TestIR" )] - [ASN1ValueRangeConstraint ( - - Min = 1L, - - Max = 5L - - ) ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 5L, IsExtensible = false) ] public int Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs index 7d1efc1..2c1dbdc 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs @@ -22,13 +22,7 @@ public class TestLong: IASN1PreparedElement { private long val; [ASN1Integer( Name = "TestLong" )] - [ASN1ValueRangeConstraint ( - - Min = 1L, - - Max = 2247483648L - - ) ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 2247483648L, IsExtensible = false) ] public long Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag.cs index a31222a..797698e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag.cs @@ -24,7 +24,7 @@ public class TestLongTag: IASN1PreparedElement { [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "TestLongTag", IsOptional = false , HasTag = true, Tag = 15123, + [ASN1Element ( Name = "TestLongTag", IsOptional = false , IsExtended = false , HasTag = true, Tag = 15123, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public long Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2.cs index 6dd4cef..e4aed2f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Choice ( Name = "TestLongTag2") ] + [ASN1Choice ( Name = "TestLongTag2", IsExtensible = false) ] public class TestLongTag2 : IASN1PreparedElement { @@ -25,7 +25,7 @@ public class TestLongTag2 : IASN1PreparedElement { - [ASN1Element ( Name = "testa", IsOptional = false , HasTag = true, Tag = 33 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "testa", IsOptional = false , IsExtended = false , HasTag = true, Tag = 33 , HasDefaultValue = false ) ] public TestLongTag2Choice Testa { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2Choice.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2Choice.cs index 23ae170..777ca82 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2Choice.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLongTag2Choice.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestLongTag2Choice", IsSet = false )] + [ASN1Sequence ( Name = "TestLongTag2Choice", IsExtensible = false, IsSet = false)] public class TestLongTag2Choice : IASN1PreparedElement { - + private long testb_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "testb", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "testb", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long Testb { @@ -34,16 +34,15 @@ public long Testb public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestLongTag2Choice)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestLongTag2Choice)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs index 2c31f81..1f20c7b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs @@ -22,13 +22,7 @@ public class TestNI: IASN1PreparedElement { private int val; [ASN1Integer( Name = "TestNI" )] - [ASN1ValueRangeConstraint ( - - Min = -128L, - - Max = 128L - - ) ] + [ASN1ValueRangeConstraint ( Min = -128L, Max = 128L, IsExtensible = false) ] public int Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs index 4023a02..44d15fb 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs @@ -22,13 +22,7 @@ public class TestNI2: IASN1PreparedElement { private int val; [ASN1Integer( Name = "TestNI2" )] - [ASN1ValueRangeConstraint ( - - Min = -2048L, - - Max = 2048L - - ) ] + [ASN1ValueRangeConstraint ( Min = -2048L, Max = 2048L, IsExtensible = false) ] public int Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent.cs index 70615e0..6b7f791 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestParent", IsSet = false )] + [ASN1Sequence ( Name = "TestParent", IsExtensible = false, IsSet = false)] public class TestParent : IASN1PreparedElement { - + private long field1_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field1", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field1", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long Field1 { @@ -37,7 +37,7 @@ public long Field1 private bool field2_present = false ; [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "field2", IsOptional = true , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public byte[] Field2 { @@ -50,7 +50,7 @@ public byte[] Field2 private string field3_ ; [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field3", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "field3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = true ) ] public string Field3 { @@ -63,7 +63,7 @@ public string Field3 private long field4_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field4", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field4", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public long Field4 { @@ -72,6 +72,20 @@ public long Field4 } + + private int field5_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = -4L, Max = 251L, IsExtensible = false) ] + + [ASN1Element ( Name = "field5", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public int Field5 + { + get { return field5_; } + set { field5_ = value; } + } + + public bool isField2Present () { return this.field2_present == true; @@ -79,19 +93,18 @@ public bool isField2Present () { public void initWithDefaults() { - string param_Field3 = + string param_Field3 = "Sssdsd"; Field3 = param_Field3; - } + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestParent)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestParent)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent2.cs index f2b9989..27a92a7 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestParent2.cs @@ -16,7 +16,7 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Choice ( Name = "TestParent2") ] + [ASN1Choice ( Name = "TestParent2", IsExtensible = false) ] public class TestParent2 : IASN1PreparedElement { @@ -26,7 +26,7 @@ public class TestParent2 : IASN1PreparedElement { [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field10", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field10", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long Field10 { @@ -43,7 +43,7 @@ public long Field10 [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "field20", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field20", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public byte[] Field20 { @@ -60,7 +60,7 @@ public byte[] Field20 [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field30", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field30", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public string Field30 { @@ -77,7 +77,7 @@ public string Field30 [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field40", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field40", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public long Field40 { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestRecursiveDefinetion.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestRecursiveDefinetion.cs index 950ac1b..15b8139 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestRecursiveDefinetion.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestRecursiveDefinetion.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestRecursiveDefinetion", IsSet = false )] + [ASN1Sequence ( Name = "TestRecursiveDefinetion", IsExtensible = false, IsSet = false)] public class TestRecursiveDefinetion : IASN1PreparedElement { - + private string name_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "name", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "name", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public string Name { @@ -36,7 +36,7 @@ public string Name private bool value_present = false ; - [ASN1Element ( Name = "value", IsOptional = true , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "value", IsOptional = true , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public TestRecursiveDefinetion Value { @@ -52,16 +52,15 @@ public bool isValuePresent () { public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestRecursiveDefinetion)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestRecursiveDefinetion)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqOID.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqOID.cs index c6c6abb..180a19d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqOID.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqOID.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestSeqOID", IsSet = false )] + [ASN1Sequence ( Name = "TestSeqOID", IsExtensible = false, IsSet = false)] public class TestSeqOID : IASN1PreparedElement { - + private ObjectIdentifier field1_ ; [ASN1ObjectIdentifier( Name = "" )] - [ASN1Element ( Name = "field1", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field1", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public ObjectIdentifier Field1 { @@ -37,7 +37,7 @@ public ObjectIdentifier Field1 private bool field2_present = false ; [ASN1ObjectIdentifier( Name = "" )] - [ASN1Element ( Name = "field2", IsOptional = true , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field2", IsOptional = true , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public ObjectIdentifier Field2 { @@ -50,7 +50,7 @@ public ObjectIdentifier Field2 private long field3_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field3", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public long Field3 { @@ -66,16 +66,15 @@ public bool isField2Present () { public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSeqOID)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSeqOID)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqSize.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqSize.cs new file mode 100644 index 0000000..85a89df --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqSize.cs @@ -0,0 +1,55 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "TestSeqSize" ) ] + public class TestSeqSize : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 40L, IsExtensible = false) ] + + [ASN1SequenceOf( Name = "TestSeqSize", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(long item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSeqSize)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqV13.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqV13.cs index 7a9cb68..0a4bf95 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqV13.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSeqV13.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestSeqV13", IsSet = false )] + [ASN1Sequence ( Name = "TestSeqV13", IsExtensible = false, IsSet = false)] public class TestSeqV13 : IASN1PreparedElement { - + private double field1_ ; [ASN1Real( Name = "" )] - [ASN1Element ( Name = "field1", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field1", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public double Field1 { @@ -35,7 +35,7 @@ public double Field1 private long fieldI_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "fieldI", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "fieldI", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public long FieldI { @@ -47,7 +47,7 @@ public long FieldI private TestReal field2_ ; - [ASN1Element ( Name = "field2", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field2", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public TestReal Field2 { @@ -62,7 +62,7 @@ public TestReal Field2 private bool field3_present = false ; [ASN1Real( Name = "" )] - [ASN1Element ( Name = "field3", IsOptional = true , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field3", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public double Field3 { @@ -75,7 +75,7 @@ public double Field3 private double field4_ ; [ASN1Real( Name = "" )] - [ASN1Element ( Name = "field4", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field4", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public double Field4 { @@ -88,7 +88,7 @@ public double Field4 private string field5_ ; [ASN1String( Name = "", StringType = UniversalTags.GeneralizedTime , IsUCS = false )] - [ASN1Element ( Name = "field5", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field5", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public string Field5 { @@ -101,7 +101,7 @@ public string Field5 private string field6_ ; [ASN1String( Name = "", StringType = UniversalTags.UTCTime , IsUCS = false )] - [ASN1Element ( Name = "field6", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field6", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public string Field6 { @@ -113,7 +113,7 @@ public string Field6 private TestLong field7_ ; - [ASN1Element ( Name = "field7", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field7", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public TestLong Field7 { @@ -129,16 +129,15 @@ public bool isField3Present () { public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSeqV13)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSeqV13)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceV12.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceV12.cs index bc4fe3c..da350f9 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceV12.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceV12.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestSequenceV12", IsSet = false )] + [ASN1Sequence ( Name = "TestSequenceV12", IsExtensible = false, IsSet = false)] public class TestSequenceV12 : IASN1PreparedElement { - + private string attrSimple_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "attrSimple", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrSimple", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public string AttrSimple { @@ -34,15 +34,9 @@ public string AttrSimple private string attrStr_ ; [ASN1String( Name = "", - StringType = UniversalTags.PrintableString , IsUCS = false )][ASN1ValueRangeConstraint ( - - Min = 1L, - - Max = 4L - - ) ] + StringType = UniversalTags.PrintableString , IsUCS = false )][ASN1ValueRangeConstraint ( Min = 1L, Max = 4L, IsExtensible = false) ] - [ASN1Element ( Name = "attrStr", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrStr", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public string AttrStr { @@ -54,7 +48,7 @@ public string AttrStr private TestPRN attrStr2_ ; - [ASN1Element ( Name = "attrStr2", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrStr2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public TestPRN AttrStr2 { @@ -67,17 +61,11 @@ public TestPRN AttrStr2 private System.Collections.Generic.ICollection attrArr_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] -[ASN1SequenceOf( Name = "attrArr", IsSetOf = false )] +[ASN1SequenceOf( Name = "attrArr", IsExtensible = false, IsSetOf = false )] - [ASN1ValueRangeConstraint ( - - Min = 1L, - - Max = 5L - - ) ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 5L, IsExtensible = false) ] - [ASN1Element ( Name = "attrArr", IsOptional = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrArr", IsOptional = false , IsExtended = false , HasTag = true, Tag = 3 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection AttrArr { @@ -92,7 +80,7 @@ public System.Collections.Generic.ICollection AttrArr private bool attrBitStr_present = false ; [ASN1BitString( Name = "" )] - [ASN1Element ( Name = "attrBitStr", IsOptional = true , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrBitStr", IsOptional = true , IsExtended = false , HasTag = true, Tag = 4 , HasDefaultValue = false ) ] public BitString AttrBitStr { @@ -105,7 +93,7 @@ public BitString AttrBitStr private BitString attrBitStrDef_ ; [ASN1BitString( Name = "" )] - [ASN1Element ( Name = "attrBitStrDef", IsOptional = false , HasTag = true, Tag = 5 , HasDefaultValue = true ) ] + [ASN1Element ( Name = "attrBitStrDef", IsOptional = false , IsExtended = false , HasTag = true, Tag = 5 , HasDefaultValue = true ) ] public BitString AttrBitStrDef { @@ -119,15 +107,9 @@ public BitString AttrBitStrDef private bool attrBitStrBnd_present = false ; [ASN1BitString( Name = "" )] - [ASN1ValueRangeConstraint ( - - Min = 1L, - - Max = 36L - - ) ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 36L, IsExtensible = false) ] - [ASN1Element ( Name = "attrBitStrBnd", IsOptional = true , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrBitStrBnd", IsOptional = true , IsExtended = false , HasTag = true, Tag = 6 , HasDefaultValue = false ) ] public BitString AttrBitStrBnd { @@ -141,7 +123,7 @@ public BitString AttrBitStrBnd private bool attrBoxBitStr_present = false ; - [ASN1Element ( Name = "attrBoxBitStr", IsOptional = true , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrBoxBitStr", IsOptional = true , IsExtended = false , HasTag = true, Tag = 7 , HasDefaultValue = false ) ] public TestBitStrBnd AttrBoxBitStr { @@ -156,7 +138,7 @@ public TestBitStrBnd AttrBoxBitStr [ASN1SizeConstraint ( Max = 4L )] - [ASN1Element ( Name = "attrStrict", IsOptional = false , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "attrStrict", IsOptional = false , IsExtended = false , HasTag = true, Tag = 8 , HasDefaultValue = false ) ] public byte[] AttrStrict { @@ -180,19 +162,18 @@ public bool isAttrBoxBitStrPresent () { public void initWithDefaults() { - BitString param_AttrBitStrDef = + BitString param_AttrBitStrDef = new BitString (CoderUtils.defStringToOctetString("'011'B")); AttrBitStrDef = param_AttrBitStrDef; - } + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSequenceV12)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSequenceV12)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceWithNonames.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceWithNonames.cs index 9570688..78d9b53 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceWithNonames.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSequenceWithNonames.cs @@ -16,9 +16,9 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestSequenceWithNonames", IsSet = false )] + [ASN1Sequence ( Name = "TestSequenceWithNonames", IsExtensible = false, IsSet = false)] public class TestSequenceWithNonames : IASN1PreparedElement { - + private SeqSequenceType seq_ ; [ASN1PreparedElement] @@ -30,7 +30,7 @@ public class SeqSequenceType : IASN1PreparedElement { private bool it1_present = false ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "it1", IsOptional = true , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "it1", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public long It1 { @@ -57,7 +57,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "seq", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "seq", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public SeqSequenceType Seq { @@ -70,10 +70,10 @@ public SeqSequenceType Seq private ChChoiceType ch_ ; - [ASN1PreparedElement] - [ASN1Choice ( Name = "ch" )] + [ASN1PreparedElement] + [ASN1Choice ( Name = "ch", IsExtensible = false )] public class ChChoiceType : IASN1PreparedElement { - + private long it1_ ; private bool it1_selected = false ; @@ -81,7 +81,7 @@ public class ChChoiceType : IASN1PreparedElement { [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "it1", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "it1", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long It1 { @@ -98,7 +98,7 @@ public long It1 [ASN1OctetString( Name = "" )] - [ASN1Element ( Name = "it2", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "it2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public byte[] It2 { @@ -143,18 +143,18 @@ public void selectIt2 (byte[] val) { - public void initWithDefaults() - { - } + public void initWithDefaults() + { + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ChChoiceType)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ChChoiceType)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } } - [ASN1Element ( Name = "ch", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "ch", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public ChChoiceType Ch { @@ -175,7 +175,7 @@ public class SeqfSequenceType : IASN1PreparedElement { private bool it1_present = false ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "it1", IsOptional = true , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "it1", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public long It1 { @@ -202,10 +202,10 @@ public IASN1PreparedElementData PreparedData { } -[ASN1SequenceOf( Name = "seqf", IsSetOf = false )] +[ASN1SequenceOf( Name = "seqf", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "seqf", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "seqf", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection Seqf { @@ -217,16 +217,15 @@ public System.Collections.Generic.ICollection Seqf public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSequenceWithNonames)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSequenceWithNonames)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSimpleSequence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSimpleSequence.cs index 37539d5..685d4f6 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSimpleSequence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestSimpleSequence.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "TestSimpleSequence", IsSet = false )] + [ASN1Sequence ( Name = "TestSimpleSequence", IsExtensible = false, IsSet = false)] public class TestSimpleSequence : IASN1PreparedElement { - + private long field1_ ; [ASN1Integer( Name = "" )] - [ASN1Element ( Name = "field1", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field1", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public long Field1 { @@ -35,7 +35,7 @@ public long Field1 private string field2_ ; [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field2", IsOptional = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field2", IsOptional = false , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public string Field2 { @@ -48,7 +48,7 @@ public string Field2 private string field3_ ; [ASN1String( Name = "", StringType = UniversalTags.UTF8String , IsUCS = false )] - [ASN1Element ( Name = "field3", IsOptional = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "field3", IsOptional = false , IsExtended = false , HasTag = true, Tag = 2 , HasDefaultValue = false ) ] public string Field3 { @@ -60,16 +60,15 @@ public string Field3 public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSimpleSequence)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TestSimpleSequence)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent.cs index d82d2c9..84bb44d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent.cs @@ -23,7 +23,7 @@ public class TestTParent: IASN1PreparedElement { private TestParent val; - [ASN1Element ( Name = "TestTParent", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "TestTParent", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public TestParent Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent2.cs index d0d5b20..053ffe0 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTParent2.cs @@ -23,7 +23,7 @@ public class TestTParent2: IASN1PreparedElement { private TestParent2 val; - [ASN1Element ( Name = "TestTParent2", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "TestTParent2", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public TestParent2 Value { diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTaggedSetInSet.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTaggedSetInSet.cs index a0fbf2f..88e4a90 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTaggedSetInSet.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestTaggedSetInSet.cs @@ -29,7 +29,7 @@ public class TestTaggedSetInSetSequenceType : IASN1PreparedElement { private Config config1_ ; - [ASN1Element ( Name = "config1", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "config1", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Config Config1 { @@ -41,7 +41,7 @@ public Config Config1 private Config2 config2_ ; - [ASN1Element ( Name = "config2", IsOptional = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "config2", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Config2 Config2 { @@ -64,7 +64,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "TestTaggedSetInSet", IsOptional = false , HasTag = true, Tag = 77, + [ASN1Element ( Name = "TestTaggedSetInSet", IsOptional = false , IsExtended = false , HasTag = true, Tag = 77, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public TestTaggedSetInSetSequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ValueWithParams.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ValueWithParams.cs index 9cbea89..ff455e1 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ValueWithParams.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ValueWithParams.cs @@ -16,13 +16,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Sequence ( Name = "ValueWithParams", IsSet = false )] + [ASN1Sequence ( Name = "ValueWithParams", IsExtensible = false, IsSet = false)] public class ValueWithParams : IASN1PreparedElement { - + private string value_ ; [ASN1String( Name = "", StringType = UniversalTags.PrintableString , IsUCS = false )] - [ASN1Element ( Name = "value", IsOptional = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "value", IsOptional = false , IsExtended = false , HasTag = true, Tag = 0 , HasDefaultValue = false ) ] public string Value { @@ -36,10 +36,10 @@ public string Value private bool params_present = false ; -[ASN1SequenceOf( Name = "params", IsSetOf = false )] +[ASN1SequenceOf( Name = "params", IsExtensible = false, IsSetOf = false )] - [ASN1Element ( Name = "params", IsOptional = true , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] + [ASN1Element ( Name = "params", IsOptional = true , IsExtended = false , HasTag = true, Tag = 1 , HasDefaultValue = false ) ] public System.Collections.Generic.ICollection Params { @@ -55,16 +55,15 @@ public bool isParamsPresent () { public void initWithDefaults() { - - } + + } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ValueWithParams)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ValueWithParams)); public IASN1PreparedElementData PreparedData { - get { return preparedData; } - } + get { return preparedData; } + } - } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Version.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Version.cs index f7e73ac..233061f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Version.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/Version.cs @@ -31,7 +31,7 @@ public class VersionSequenceType : IASN1PreparedElement { private bool minor_present = false ; - [ASN1Element ( Name = "minor", IsOptional = true , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "minor", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Minor Minor { @@ -45,7 +45,7 @@ public Minor Minor private bool major_present = false ; - [ASN1Element ( Name = "major", IsOptional = true , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "major", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] public Major Major { @@ -76,7 +76,7 @@ public IASN1PreparedElementData PreparedData { } - [ASN1Element ( Name = "Version", IsOptional = false , HasTag = true, Tag = 74, + [ASN1Element ( Name = "Version", IsOptional = false , IsExtended = false , HasTag = true, Tag = 74, TagClass = TagClasses.Application , HasDefaultValue = false ) ] public VersionSequenceType Value diff --git a/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py index 1386405..8d4b3f7 100644 --- a/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py +++ b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py @@ -32,13 +32,15 @@ cmd = [java] cmd.extend(java_options) +output_path = os.path.join(path, 'org/bn/coders/test_asn') + # add the specific options for the bncompiler bn_compiler_args = [ '-classpath', jar_path, 'org.bn.compiler.Main', '-m', 'cs', '-ns', namespace, - '-o', os.path.join(path, 'org/bn/coders/test_asn'), + '-o', output_path, "-f", os.path.join(path, test_asn_path) ] cmd.extend(bn_compiler_args) @@ -46,3 +48,12 @@ result = subprocess.run(cmd, capture_output=True, text=True) print(result.stdout) print(result.stderr) + +for root, _, files in os.walk(output_path): + for file in files: + file_path = os.path.join(root, file) + with open(file_path, 'rb') as f: + content = f.read() + content = content.replace(b'\r\n', b'\n') + with open(file_path, 'wb') as f: + f.write(content) From 9f08993269b0aeb46912073e7e2e5ad4c15034b5 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 13:24:57 +0200 Subject: [PATCH 19/32] Add unit test for extensible size --- BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py index 1f40c31..3395663 100644 --- a/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py +++ b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py @@ -115,4 +115,11 @@ def compile(self, entry, data): data8 = 0x73 compiler.compile('ExtensibleInteger', data7) -compiler.compile('ExtensibleInteger', data8) \ No newline at end of file +compiler.compile('ExtensibleInteger', data8) + +data9 = [ 0x23, 0x35 ] + +data10 = [ 0x23, 0x35, 0x11, 0x05 ] + +compiler.compile('ExtensibleSize', data9) +compiler.compile('ExtensibleSize', data10) \ No newline at end of file From f8860a9401ca9fc0349399f54c872585ee24bf92 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 17:29:01 +0200 Subject: [PATCH 20/32] Fix the range for encoding standard enums --- .../BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs index e4477b2..ff10991 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedEncoder.cs @@ -738,7 +738,7 @@ public override int encodeEnumItem(object enumConstant, System.Type enumClass, S } else { - return encodeConstraintNumber(val, min, max, (BitArrayOutputStream)stream); + return encodeConstraintNumber(val, min, max-1, (BitArrayOutputStream)stream); } } From ae5d84fde2ab6267ebfba9f2680400133c4a3eac Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 17:31:40 +0200 Subject: [PATCH 21/32] Throw an exception when the index decoding of an extension field provide a negatie index --- .../BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs index e62eecf..3378b4d 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/per/PERAlignedDecoder.cs @@ -372,6 +372,10 @@ public override DecodedObject decodeChoice(DecodedObject decoded if (isExtended && parsingInfo.IsExtensible) { int extendedIndex = (int)decodeNormallySmallNumber(bitStream); + if (extendedIndex < 0) + { + throw new System.ArgumentException("The extended index is negative: " + extendedIndex); + } if (extendedIndex < parsingInfo.ExtendedFields.Count) { fieldIdx = parsingInfo.ExtendedFields[extendedIndex]; From b052f35ec2c10ce38d984bf9a4708e1b3ebedd76 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 17:42:37 +0200 Subject: [PATCH 22/32] Add unit test for CAM messages --- .../src/test/resources/ITS_CAM_v1.3.2.asn | 1076 +++ BNCompiler/temp.xml | 7602 +++++++++++++++++ .../BinaryNotesTests/BinaryNotesTests.csproj | 7 + .../coders/cam_asn/AccelerationConfidence.cs | 52 + .../bn/coders/cam_asn/AccelerationControl.cs | 53 + .../bn/coders/cam_asn/AccidentSubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/ActionID.cs | 59 + ...seWeatherCondition_AdhesionSubCauseCode.cs | 52 + ...ion_ExtremeWeatherConditionSubCauseCode.cs | 52 + ...therCondition_PrecipitationSubCauseCode.cs | 52 + ...WeatherCondition_VisibilitySubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/Altitude.cs | 59 + .../bn/coders/cam_asn/AltitudeConfidence.cs | 78 + .../org/bn/coders/cam_asn/AltitudeValue.cs | 52 + .../org/bn/coders/cam_asn/BasicContainer.cs | 59 + .../BasicVehicleContainerHighFrequency.cs | 269 + .../BasicVehicleContainerLowFrequency.cs | 71 + .../org/bn/coders/cam_asn/CAM.cs | 59 + .../bn/coders/cam_asn/CAM_PDU_Descriptions.cs | 21 + .../org/bn/coders/cam_asn/CamParameters.cs | 95 + .../org/bn/coders/cam_asn/CauseCodeClass.cs | 57 + .../org/bn/coders/cam_asn/CauseCodeType.cs | 52 + .../bn/coders/cam_asn/CenDsrcTollingZone.cs | 77 + .../bn/coders/cam_asn/CenDsrcTollingZoneID.cs | 55 + .../org/bn/coders/cam_asn/ClosedLanes.cs | 65 + .../cam_asn/CollisionRiskSubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/CoopAwareness.cs | 59 + .../org/bn/coders/cam_asn/Curvature.cs | 59 + .../cam_asn/CurvatureCalculationMode.cs | 52 + .../bn/coders/cam_asn/CurvatureConfidence.cs | 62 + .../org/bn/coders/cam_asn/CurvatureValue.cs | 52 + .../DangerousEndOfQueueSubCauseCode.cs | 52 + .../bn/coders/cam_asn/DangerousGoodsBasic.cs | 86 + .../coders/cam_asn/DangerousGoodsContainer.cs | 47 + .../coders/cam_asn/DangerousGoodsExtended.cs | 160 + .../cam_asn/DangerousSituationSubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/DeltaAltitude.cs | 52 + .../org/bn/coders/cam_asn/DeltaLatitude.cs | 52 + .../org/bn/coders/cam_asn/DeltaLongitude.cs | 52 + .../coders/cam_asn/DeltaReferencePosition.cs | 71 + .../org/bn/coders/cam_asn/DriveDirection.cs | 52 + .../bn/coders/cam_asn/DrivingLaneStatus.cs | 52 + .../bn/coders/cam_asn/EmbarkationStatus.cs | 52 + .../bn/coders/cam_asn/EmergencyContainer.cs | 83 + .../bn/coders/cam_asn/EmergencyPriority.cs | 53 + ...EmergencyVehicleApproachingSubCauseCode.cs | 52 + .../bn/coders/cam_asn/EnergyStorageType.cs | 53 + .../org/bn/coders/cam_asn/EventHistory.cs | 54 + .../org/bn/coders/cam_asn/EventPoint.cs | 77 + .../org/bn/coders/cam_asn/ExteriorLights.cs | 53 + .../bn/coders/cam_asn/GenerationDeltaTime.cs | 52 + .../bn/coders/cam_asn/HardShoulderStatus.cs | 52 + ...ousLocation_AnimalOnTheRoadSubCauseCode.cs | 52 + ...dousLocation_DangerousCurveSubCauseCode.cs | 52 + ...sLocation_ObstacleOnTheRoadSubCauseCode.cs | 52 + ...usLocation_SurfaceConditionSubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/Heading.cs | 59 + .../bn/coders/cam_asn/HeadingConfidence.cs | 52 + .../org/bn/coders/cam_asn/HeadingValue.cs | 52 + .../org/bn/coders/cam_asn/HeightLonCarr.cs | 52 + .../coders/cam_asn/HighFrequencyContainer.cs | 100 + .../HumanPresenceOnTheRoadSubCauseCode.cs | 52 + .../cam_asn/HumanProblemSubCauseCode.cs | 52 + .../bn/coders/cam_asn/InformationQuality.cs | 52 + .../org/bn/coders/cam_asn/ItineraryPath.cs | 54 + .../org/bn/coders/cam_asn/ItsPduHeader.cs | 75 + .../org/bn/coders/cam_asn/LanePosition.cs | 52 + .../bn/coders/cam_asn/LateralAcceleration.cs | 59 + .../cam_asn/LateralAccelerationValue.cs | 52 + .../org/bn/coders/cam_asn/Latitude.cs | 52 + .../bn/coders/cam_asn/LightBarSirenInUse.cs | 53 + .../org/bn/coders/cam_asn/Longitude.cs | 52 + .../cam_asn/LongitudinalAcceleration.cs | 59 + .../cam_asn/LongitudinalAccelerationValue.cs | 52 + .../coders/cam_asn/LowFrequencyContainer.cs | 65 + .../bn/coders/cam_asn/NumberOfOccupants.cs | 52 + .../org/bn/coders/cam_asn/PathDeltaTime.cs | 52 + .../org/bn/coders/cam_asn/PathHistory.cs | 54 + .../org/bn/coders/cam_asn/PathPoint.cs | 65 + .../org/bn/coders/cam_asn/PerformanceClass.cs | 52 + .../org/bn/coders/cam_asn/PosCentMass.cs | 52 + .../bn/coders/cam_asn/PosConfidenceEllipse.cs | 71 + .../org/bn/coders/cam_asn/PosFrontAx.cs | 52 + .../org/bn/coders/cam_asn/PosLonCarr.cs | 52 + .../org/bn/coders/cam_asn/PosPillar.cs | 52 + .../bn/coders/cam_asn/PositionOfOccupants.cs | 53 + .../bn/coders/cam_asn/PositionOfPillars.cs | 54 + .../coders/cam_asn/PositioningSolutionType.cs | 58 + .../coders/cam_asn/PostCrashSubCauseCode.cs | 52 + .../cam_asn/ProtectedCommunicationZone.cs | 125 + .../cam_asn/ProtectedCommunicationZonesRSU.cs | 54 + .../org/bn/coders/cam_asn/ProtectedZoneID.cs | 52 + .../bn/coders/cam_asn/ProtectedZoneRadius.cs | 52 + .../bn/coders/cam_asn/ProtectedZoneType.cs | 48 + .../org/bn/coders/cam_asn/PtActivation.cs | 59 + .../org/bn/coders/cam_asn/PtActivationData.cs | 56 + .../org/bn/coders/cam_asn/PtActivationType.cs | 52 + .../cam_asn/PublicTransportContainer.cs | 65 + .../cam_asn/RSUContainerHighFrequency.cs | 53 + .../bn/coders/cam_asn/ReferencePosition.cs | 83 + .../bn/coders/cam_asn/RelevanceDistance.cs | 62 + .../cam_asn/RelevanceTrafficDirection.cs | 54 + .../cam_asn/RequestResponseIndication.cs | 50 + ...ueAndRecoveryWorkInProgressSubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/RescueContainer.cs | 47 + .../org/bn/coders/cam_asn/RestrictedTypes.cs | 54 + .../org/bn/coders/cam_asn/RoadType.cs | 54 + .../coders/cam_asn/RoadWorksContainerBasic.cs | 83 + .../coders/cam_asn/RoadworksSubCauseCode.cs | 52 + .../bn/coders/cam_asn/SafetyCarContainer.cs | 101 + .../org/bn/coders/cam_asn/SemiAxisLength.cs | 52 + .../org/bn/coders/cam_asn/SequenceNumber.cs | 52 + .../cam_asn/SignalViolationSubCauseCode.cs | 52 + .../coders/cam_asn/SlowVehicleSubCauseCode.cs | 52 + .../cam_asn/SpecialTransportContainer.cs | 59 + .../bn/coders/cam_asn/SpecialTransportType.cs | 53 + .../coders/cam_asn/SpecialVehicleContainer.cs | 335 + .../org/bn/coders/cam_asn/Speed.cs | 59 + .../org/bn/coders/cam_asn/SpeedConfidence.cs | 52 + .../org/bn/coders/cam_asn/SpeedLimit.cs | 52 + .../org/bn/coders/cam_asn/SpeedValue.cs | 52 + .../org/bn/coders/cam_asn/StationID.cs | 52 + .../org/bn/coders/cam_asn/StationType.cs | 52 + .../org/bn/coders/cam_asn/StationarySince.cs | 54 + .../cam_asn/StationaryVehicleSubCauseCode.cs | 52 + .../bn/coders/cam_asn/SteeringWheelAngle.cs | 59 + .../cam_asn/SteeringWheelAngleConfidence.cs | 52 + .../coders/cam_asn/SteeringWheelAngleValue.cs | 52 + .../org/bn/coders/cam_asn/SubCauseCodeType.cs | 52 + .../org/bn/coders/cam_asn/Temperature.cs | 52 + .../org/bn/coders/cam_asn/TimestampIts.cs | 52 + .../org/bn/coders/cam_asn/Traces.cs | 54 + .../cam_asn/TrafficConditionSubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/TrafficRule.cs | 54 + .../bn/coders/cam_asn/TransmissionInterval.cs | 52 + .../org/bn/coders/cam_asn/TurningRadius.cs | 52 + .../org/bn/coders/cam_asn/VDS.cs | 54 + .../org/bn/coders/cam_asn/ValidityDuration.cs | 52 + .../cam_asn/VehicleBreakdownSubCauseCode.cs | 52 + .../coders/cam_asn/VehicleIdentification.cs | 71 + .../org/bn/coders/cam_asn/VehicleLength.cs | 59 + .../VehicleLengthConfidenceIndication.cs | 56 + .../bn/coders/cam_asn/VehicleLengthValue.cs | 52 + .../org/bn/coders/cam_asn/VehicleMass.cs | 52 + .../org/bn/coders/cam_asn/VehicleRole.cs | 78 + .../org/bn/coders/cam_asn/VehicleWidth.cs | 52 + .../bn/coders/cam_asn/VerticalAcceleration.cs | 59 + .../cam_asn/VerticalAccelerationValue.cs | 52 + .../org/bn/coders/cam_asn/WMInumber.cs | 53 + .../org/bn/coders/cam_asn/WheelBaseVehicle.cs | 52 + .../cam_asn/WrongWayDrivingSubCauseCode.cs | 52 + .../org/bn/coders/cam_asn/YawRate.cs | 59 + .../bn/coders/cam_asn/YawRateConfidence.cs | 64 + .../org/bn/coders/cam_asn/YawRateValue.cs | 52 + .../org/bn/coders/cam_asn/main.cs | 17 + .../coders/per/PERUnalignedCoderTestUtils.cs | 94 + .../bn/coders/per/PERUnalignedDecoderTest.cs | 98 + .../bn/coders/per/PERUnalignedEncoderTest.cs | 12 + .../org/bn/coders/per/sample_cam.uper | Bin 0 -> 41 bytes .../BinaryNotesTests/test_asn_convert.py | 78 +- 160 files changed, 18152 insertions(+), 37 deletions(-) create mode 100644 BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn create mode 100644 BNCompiler/temp.xml create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationControl.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ActionID.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Altitude.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerHighFrequency.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerLowFrequency.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM_PDU_Descriptions.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CamParameters.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeClass.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZone.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZoneID.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ClosedLanes.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CoopAwareness.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Curvature.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsExtended.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaReferencePosition.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DrivingLaneStatus.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyPriority.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EnergyStorageType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventHistory.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventPoint.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ExteriorLights.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Heading.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HighFrequencyContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItineraryPath.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItsPduHeader.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAcceleration.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LightBarSirenInUse.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAcceleration.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LowFrequencyContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathHistory.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathPoint.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosConfidenceEllipse.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfOccupants.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfPillars.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZone.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZonesRSU.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivation.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationData.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PublicTransportContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RSUContainerHighFrequency.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ReferencePosition.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RestrictedTypes.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadWorksContainerBasic.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialVehicleContainer.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Speed.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngle.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Traces.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VDS.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleIdentification.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLength.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAcceleration.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WMInumber.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRate.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/main.cs create mode 100644 BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/sample_cam.uper diff --git a/BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn b/BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn new file mode 100644 index 0000000..a1fdcb4 --- /dev/null +++ b/BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn @@ -0,0 +1,1076 @@ +---- +---- +CAM-PDU-Descriptions {itu-t(0) identified-organization(4) etsi(0) itsDomain(5) + wg1(1) en(302637) cam(2) version(1)} +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + + IMPORTS + ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, + Curvature, CurvatureCalculationMode, Heading, LanePosition, + EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, + LongitudinalAcceleration, LateralAcceleration, + VerticalAcceleration, StationType, ExteriorLights, + DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, + VehicleRole, VehicleLength, VehicleWidth, PathHistory, + RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, + SteeringWheelAngle, PerformanceClass, YawRate, + ProtectedCommunicationZone, PtActivation, Latitude, Longitude, + ProtectedCommunicationZonesRSU, CenDsrcTollingZone + FROM ITS-Container {itu-t(0) identified-organization(4) etsi(0) + itsDomain(5) wg1(1) ts(102894) cdd(2) version(1)}; + + CAM ::= SEQUENCE { + header ItsPduHeader, + cam CoopAwareness + } + + CoopAwareness ::= SEQUENCE { + generationDeltaTime GenerationDeltaTime, + camParameters CamParameters + } + + CamParameters ::= SEQUENCE { + basicContainer BasicContainer, + highFrequencyContainer HighFrequencyContainer, + lowFrequencyContainer LowFrequencyContainer OPTIONAL, + specialVehicleContainer SpecialVehicleContainer OPTIONAL, + ... + } + + HighFrequencyContainer ::= CHOICE { + basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, + rsuContainerHighFrequency RSUContainerHighFrequency, + ... + } + + LowFrequencyContainer ::= CHOICE { + basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, + ... + } + + SpecialVehicleContainer ::= CHOICE { + publicTransportContainer PublicTransportContainer, + specialTransportContainer SpecialTransportContainer, + dangerousGoodsContainer DangerousGoodsContainer, + roadWorksContainerBasic RoadWorksContainerBasic, + rescueContainer RescueContainer, + emergencyContainer EmergencyContainer, + safetyCarContainer SafetyCarContainer, + ... + } + + BasicContainer ::= SEQUENCE { + stationType StationType, + referencePosition ReferencePosition, + ... + } + + BasicVehicleContainerHighFrequency ::= SEQUENCE { + heading Heading, + speed Speed, + driveDirection DriveDirection, + vehicleLength VehicleLength, + vehicleWidth VehicleWidth, + longitudinalAcceleration LongitudinalAcceleration, + curvature Curvature, + curvatureCalculationMode CurvatureCalculationMode, + yawRate YawRate, + accelerationControl AccelerationControl OPTIONAL, + lanePosition LanePosition OPTIONAL, + steeringWheelAngle SteeringWheelAngle OPTIONAL, + lateralAcceleration LateralAcceleration OPTIONAL, + verticalAcceleration VerticalAcceleration OPTIONAL, + performanceClass PerformanceClass OPTIONAL, + cenDsrcTollingZone CenDsrcTollingZone OPTIONAL + } + + BasicVehicleContainerLowFrequency ::= SEQUENCE { + vehicleRole VehicleRole, + exteriorLights ExteriorLights, + pathHistory PathHistory + } + + PublicTransportContainer ::= SEQUENCE { + embarkationStatus EmbarkationStatus, + ptActivation PtActivation OPTIONAL + } + + SpecialTransportContainer ::= SEQUENCE { + specialTransportType SpecialTransportType, + lightBarSirenInUse LightBarSirenInUse + } + + DangerousGoodsContainer ::= SEQUENCE { + dangerousGoodsBasic DangerousGoodsBasic + } + + RoadWorksContainerBasic ::= SEQUENCE { + roadworksSubCauseCode RoadworksSubCauseCode OPTIONAL, + lightBarSirenInUse LightBarSirenInUse, + closedLanes ClosedLanes OPTIONAL + } + + RescueContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse + } + + EmergencyContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + emergencyPriority EmergencyPriority OPTIONAL + } + + SafetyCarContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + trafficRule TrafficRule OPTIONAL, + speedLimit SpeedLimit OPTIONAL + } + + RSUContainerHighFrequency ::= SEQUENCE { + protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, + ... + } + + GenerationDeltaTime ::= INTEGER { + oneMilliSec(1) + } (0..65535) + + ItsPduHeader ::= SEQUENCE { + protocolVersion INTEGER { + currentVersion(1) + } (0..255), + messageID INTEGER { + denm(1), + cam(2), + poi(3), + spat(4), + map(5), + ivi(6), + ev-rsr(7) + } (0..255), + stationID StationID + } + + StationID ::= INTEGER (0..4294967295) + + ReferencePosition ::= SEQUENCE { + latitude Latitude, + longitude Longitude, + positionConfidenceEllipse PosConfidenceEllipse, + altitude Altitude + } + + DeltaReferencePosition ::= SEQUENCE { + deltaLatitude DeltaLatitude, + deltaLongitude DeltaLongitude, + deltaAltitude DeltaAltitude + } + + Longitude ::= INTEGER { + oneMicrodegreeEast(10), + oneMicrodegreeWest(-10), + unavailable(1800000001) + } (-1800000000..1800000001) + + Latitude ::= INTEGER { + oneMicrodegreeNorth(10), + oneMicrodegreeSouth(-10), + unavailable(900000001) + } (-900000000..900000001) + + Altitude ::= SEQUENCE { + altitudeValue AltitudeValue, + altitudeConfidence AltitudeConfidence + } + + AltitudeValue ::= INTEGER { + referenceEllipsoidSurface(0), + oneCentimeter(1), + unavailable(800001) + } (-100000..800001) + + AltitudeConfidence ::= ENUMERATED { + alt-000-01(0), + alt-000-02(1), + alt-000-05(2), + alt-000-10(3), + alt-000-20(4), + alt-000-50(5), + alt-001-00(6), + alt-002-00(7), + alt-005-00(8), + alt-010-00(9), + alt-020-00(10), + alt-050-00(11), + alt-100-00(12), + alt-200-00(13), + outOfRange(14), + unavailable(15) + } + + DeltaLongitude ::= INTEGER { + oneMicrodegreeEast(10), + oneMicrodegreeWest(-10), + unavailable(131072) + } (-131071..131072) + + DeltaLatitude ::= INTEGER { + oneMicrodegreeNorth(10), + oneMicrodegreeSouth(-10), + unavailable(131072) + } (-131071..131072) + + DeltaAltitude ::= INTEGER { + oneCentimeterUp(1), + oneCentimeterDown(-1), + unavailable(12800) + } (-12700..12800) + + PosConfidenceEllipse ::= SEQUENCE { + semiMajorConfidence SemiAxisLength, + semiMinorConfidence SemiAxisLength, + semiMajorOrientation HeadingValue + } + + PathPoint ::= SEQUENCE { + pathPosition DeltaReferencePosition, + pathDeltaTime PathDeltaTime OPTIONAL + } + + PathDeltaTime ::= INTEGER { + tenMilliSecondsInPast(1) + } (1..65535, ...) + + PtActivation ::= SEQUENCE { + ptActivationType PtActivationType, + ptActivationData PtActivationData + } + + PtActivationType ::= INTEGER { + undefinedCodingType(0), + r09-16CodingType(1), + vdv-50149CodingType(2) + } (0..255) + + PtActivationData ::= OCTET STRING (SIZE (1..20)) + + AccelerationControl ::= BIT STRING { + brakePedalEngaged(0), + gasPedalEngaged(1), + emergencyBrakeEngaged(2), + collisionWarningEngaged(3), + accEngaged(4), + cruiseControlEngaged(5), + speedLimiterEngaged(6) + } (SIZE (7)) + + SemiAxisLength ::= INTEGER { + oneCentimeter(1), + outOfRange(4094), + unavailable(4095) + } (0..4095) + + CauseCode ::= SEQUENCE { + causeCode CauseCodeType, + subCauseCode SubCauseCodeType + } + + CauseCodeType ::= INTEGER { + reserved(0), + trafficCondition(1), + accident(2), + roadworks(3), + adverseWeatherCondition-Adhesion(6), + hazardousLocation-SurfaceCondition(9), + hazardousLocation-ObstacleOnTheRoad(10), + hazardousLocation-AnimalOnTheRoad(11), + humanPresenceOnTheRoad(12), + wrongWayDriving(14), + rescueAndRecoveryWorkInProgress(15), + adverseWeatherCondition-ExtremeWeatherCondition(17), + adverseWeatherCondition-Visibility(18), + adverseWeatherCondition-Precipitation(19), + slowVehicle(26), + dangerousEndOfQueue(27), + vehicleBreakdown(91), + postCrash(92), + humanProblem(93), + stationaryVehicle(94), + emergencyVehicleApproaching(95), + hazardousLocation-DangerousCurve(96), + collisionRisk(97), + signalViolation(98), + dangerousSituation(99) + } (0..255) + + SubCauseCodeType ::= INTEGER (0..255) + + TrafficConditionSubCauseCode ::= INTEGER { + unavailable(0), + increasedVolumeOfTraffic(1), + trafficJamSlowlyIncreasing(2), + trafficJamIncreasing(3), + trafficJamStronglyIncreasing(4), + trafficStationary(5), + trafficJamSlightlyDecreasing(6), + trafficJamDecreasing(7), + trafficJamStronglyDecreasing(8) + } (0..255) + + AccidentSubCauseCode ::= INTEGER { + unavailable(0), + multiVehicleAccident(1), + heavyAccident(2), + accidentInvolvingLorry(3), + accidentInvolvingBus(4), + accidentInvolvingHazardousMaterials(5), + accidentOnOppositeLane(6), + unsecuredAccident(7), + assistanceRequested(8) + } (0..255) + + RoadworksSubCauseCode ::= INTEGER { + unavailable(0), + majorRoadworks(1), + roadMarkingWork(2), + slowMovingRoadMaintenance(3), + shortTermStationaryRoadworks(4), + streetCleaning(5), + winterService(6) + } (0..255) + + HumanPresenceOnTheRoadSubCauseCode ::= INTEGER { + unavailable(0), + childrenOnRoadway(1), + cyclistOnRoadway(2), + motorcyclistOnRoadway(3) + } (0..255) + + WrongWayDrivingSubCauseCode ::= INTEGER { + unavailable(0), + wrongLane(1), + wrongDirection(2) + } (0..255) + + AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode ::= INTEGER { + unavailable(0), + strongWinds(1), + damagingHail(2), + hurricane(3), + thunderstorm(4), + tornado(5), + blizzard(6) + } (0..255) + + AdverseWeatherCondition-AdhesionSubCauseCode ::= INTEGER { + unavailable(0), + heavyFrostOnRoad(1), + fuelOnRoad(2), + mudOnRoad(3), + snowOnRoad(4), + iceOnRoad(5), + blackIceOnRoad(6), + oilOnRoad(7), + looseChippings(8), + instantBlackIce(9), + roadsSalted(10) + } (0..255) + + AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER { + unavailable(0), + fog(1), + smoke(2), + heavySnowfall(3), + heavyRain(4), + heavyHail(5), + lowSunGlare(6), + sandstorms(7), + swarmsOfInsects(8) + } (0..255) + + AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER { + unavailable(0), + heavyRain(1), + heavySnowfall(2), + softHail(3) + } (0..255) + + SlowVehicleSubCauseCode ::= INTEGER { + unavailable(0), + maintenanceVehicle(1), + vehiclesSlowingToLookAtAccident(2), + abnormalLoad(3), + abnormalWideLoad(4), + convoy(5), + snowplough(6), + deicing(7), + saltingVehicles(8) + } (0..255) + + StationaryVehicleSubCauseCode ::= INTEGER { + unavailable(0), + humanProblem(1), + vehicleBreakdown(2), + postCrash(3), + publicTransportStop(4), + carryingDangerousGoods(5) + } (0..255) + + HumanProblemSubCauseCode ::= INTEGER { + unavailable(0), + glycemiaProblem(1), + heartProblem(2) + } (0..255) + + EmergencyVehicleApproachingSubCauseCode ::= INTEGER { + unavailable(0), + emergencyVehicleApproaching(1), + prioritizedVehicleApproaching(2) + } (0..255) + + HazardousLocation-DangerousCurveSubCauseCode ::= INTEGER { + unavailable(0), + dangerousLeftTurnCurve(1), + dangerousRightTurnCurve(2), + multipleCurvesStartingWithUnknownTurningDirection(3), + multipleCurvesStartingWithLeftTurn(4), + multipleCurvesStartingWithRightTurn(5) + } (0..255) + + HazardousLocation-SurfaceConditionSubCauseCode ::= INTEGER { + unavailable(0), + rockfalls(1), + earthquakeDamage(2), + sewerCollapse(3), + subsidence(4), + snowDrifts(5), + stormDamage(6), + burstPipe(7), + volcanoEruption(8), + fallingIce(9) + } (0..255) + + HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER { + unavailable(0), + shedLoad(1), + partsOfVehicles(2), + partsOfTyres(3), + bigObjects(4), + fallenTrees(5), + hubCaps(6), + waitingVehicles(7) + } (0..255) + + HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER { + unavailable(0), + wildAnimals(1), + herdOfAnimals(2), + smallAnimals(3), + largeAnimals(4) + } (0..255) + + CollisionRiskSubCauseCode ::= INTEGER { + unavailable(0), + longitudinalCollisionRisk(1), + crossingCollisionRisk(2), + lateralCollisionRisk(3), + vulnerableRoadUser(4) + } (0..255) + + SignalViolationSubCauseCode ::= INTEGER { + unavailable(0), + stopSignViolation(1), + trafficLightViolation(2), + turningRegulationViolation(3) + } (0..255) + + RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER { + unavailable(0), + emergencyVehicles(1), + rescueHelicopterLanding(2), + policeActivityOngoing(3), + medicalEmergencyOngoing(4), + childAbductionInProgress(5) + } (0..255) + + DangerousEndOfQueueSubCauseCode ::= INTEGER { + unavailable(0), + suddenEndOfQueue(1), + queueOverHill(2), + queueAroundBend(3), + queueInTunnel(4) + } (0..255) + + DangerousSituationSubCauseCode ::= INTEGER { + unavailable(0), + emergencyElectronicBrakeEngaged(1), + preCrashSystemEngaged(2), + espEngaged(3), + absEngaged(4), + aebEngaged(5), + brakeWarningEngaged(6), + collisionRiskWarningEngaged(7) + } (0..255) + + VehicleBreakdownSubCauseCode ::= INTEGER { + unavailable(0), + lackOfFuel(1), + lackOfBatteryPower(2), + engineProblem(3), + transmissionProblem(4), + engineCoolingProblem(5), + brakingSystemProblem(6), + steeringProblem(7), + tyrePuncture(8) + } (0..255) + + PostCrashSubCauseCode ::= INTEGER { + unavailable(0), + accidentWithoutECallTriggered(1), + accidentWithECallManuallyTriggered(2), + accidentWithECallAutomaticallyTriggered(3), + accidentWithECallTriggeredWithoutAccessToCellularNetwork(4) + } (0..255) + + Curvature ::= SEQUENCE { + curvatureValue CurvatureValue, + curvatureConfidence CurvatureConfidence + } + + CurvatureValue ::= INTEGER { + straight(0), + reciprocalOf1MeterRadiusToRight(-30000), + reciprocalOf1MeterRadiusToLeft(30000), + unavailable(30001) + } (-30000..30001) + + CurvatureConfidence ::= ENUMERATED { + onePerMeter-0-00002(0), + onePerMeter-0-0001(1), + onePerMeter-0-0005(2), + onePerMeter-0-002(3), + onePerMeter-0-01(4), + onePerMeter-0-1(5), + outOfRange(6), + unavailable(7) + } + + CurvatureCalculationMode ::= ENUMERATED { + yawRateUsed(0), + yawRateNotUsed(1), + unavailable(2), + ... + } + + Heading ::= SEQUENCE { + headingValue HeadingValue, + headingConfidence HeadingConfidence + } + + HeadingValue ::= INTEGER { + wgs84North(0), + wgs84East(900), + wgs84South(1800), + wgs84West(2700), + unavailable(3601) + } (0..3601) + + HeadingConfidence ::= INTEGER { + equalOrWithinZeroPointOneDegree(1), + equalOrWithinOneDegree(10), + outOfRange(126), + unavailable(127) + } (1..127) + + LanePosition ::= INTEGER { + offTheRoad(-1), + hardShoulder(0), + outermostDrivingLane(1), + secondLaneFromOutside(2) + } (-1..14) + + ClosedLanes ::= SEQUENCE { + hardShoulderStatus HardShoulderStatus OPTIONAL, + drivingLaneStatus DrivingLaneStatus, + ... + } + + HardShoulderStatus ::= ENUMERATED { + availableForStopping(0), + closed(1), + availableForDriving(2) + } + + DrivingLaneStatus ::= BIT STRING { + outermostLaneClosed(1), + secondLaneFromOutsideClosed(2) + } (SIZE (1..14)) + + PerformanceClass ::= INTEGER { + unavailable(0), + performanceClassA(1), + performanceClassB(2) + } (0..7) + + SpeedValue ::= INTEGER { + standstill(0), + oneCentimeterPerSec(1), + unavailable(16383) + } (0..16383) + + SpeedConfidence ::= INTEGER { + equalOrWithinOneCentimeterPerSec(1), + equalOrWithinOneMeterPerSec(100), + outOfRange(126), + unavailable(127) + } (1..127) + + VehicleMass ::= INTEGER { + hundredKg(1), + unavailable(1024) + } (1..1024) + + Speed ::= SEQUENCE { + speedValue SpeedValue, + speedConfidence SpeedConfidence + } + + DriveDirection ::= ENUMERATED { + forward(0), + backward(1), + unavailable(2) + } + + EmbarkationStatus ::= BOOLEAN + + LongitudinalAcceleration ::= SEQUENCE { + longitudinalAccelerationValue LongitudinalAccelerationValue, + longitudinalAccelerationConfidence AccelerationConfidence + } + + LongitudinalAccelerationValue ::= INTEGER { + pointOneMeterPerSecSquaredForward(1), + pointOneMeterPerSecSquaredBackward(-1), + unavailable(161) + } (-160..161) + + AccelerationConfidence ::= INTEGER { + pointOneMeterPerSecSquared(1), + outOfRange(101), + unavailable(102) + } (0..102) + + LateralAcceleration ::= SEQUENCE { + lateralAccelerationValue LateralAccelerationValue, + lateralAccelerationConfidence AccelerationConfidence + } + + LateralAccelerationValue ::= INTEGER { + pointOneMeterPerSecSquaredToRight(-1), + pointOneMeterPerSecSquaredToLeft(1), + unavailable(161) + } (-160..161) + + VerticalAcceleration ::= SEQUENCE { + verticalAccelerationValue VerticalAccelerationValue, + verticalAccelerationConfidence AccelerationConfidence + } + + VerticalAccelerationValue ::= INTEGER { + pointOneMeterPerSecSquaredUp(1), + pointOneMeterPerSecSquaredDown(-1), + unavailable(161) + } (-160..161) + + StationType ::= INTEGER { + unknown(0), + pedestrian(1), + cyclist(2), + moped(3), + motorcycle(4), + passengerCar(5), + bus(6), + lightTruck(7), + heavyTruck(8), + trailer(9), + specialVehicles(10), + tram(11), + roadSideUnit(15) + } (0..255) + + ExteriorLights ::= BIT STRING { + lowBeamHeadlightsOn(0), + highBeamHeadlightsOn(1), + leftTurnSignalOn(2), + rightTurnSignalOn(3), + daytimeRunningLightsOn(4), + reverseLightOn(5), + fogLightOn(6), + parkingLightsOn(7) + } (SIZE (8)) + + DangerousGoodsBasic ::= ENUMERATED { + explosives1(0), + explosives2(1), + explosives3(2), + explosives4(3), + explosives5(4), + explosives6(5), + flammableGases(6), + nonFlammableGases(7), + toxicGases(8), + flammableLiquids(9), + flammableSolids(10), + substancesLiableToSpontaneousCombustion(11), + substancesEmittingFlammableGasesUponContactWithWater(12), + oxidizingSubstances(13), + organicPeroxides(14), + toxicSubstances(15), + infectiousSubstances(16), + radioactiveMaterial(17), + corrosiveSubstances(18), + miscellaneousDangerousSubstances(19) + } + + DangerousGoodsExtended ::= SEQUENCE { + dangerousGoodsType DangerousGoodsBasic, + unNumber INTEGER (0..9999), + elevatedTemperature BOOLEAN, + tunnelsRestricted BOOLEAN, + limitedQuantity BOOLEAN, + emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, + phoneNumber IA5String (SIZE (1..24)) OPTIONAL, + companyName UTF8String (SIZE (1..24)) OPTIONAL + } + + SpecialTransportType ::= BIT STRING { + heavyLoad(0), + excessWidth(1), + excessLength(2), + excessHeight(3) + } (SIZE (4)) + + LightBarSirenInUse ::= BIT STRING { + lightBarActivated(0), + sirenActivated(1) + } (SIZE (2)) + + HeightLonCarr ::= INTEGER { + oneCentimeter(1), + unavailable(100) + } (1..100) + + PosLonCarr ::= INTEGER { + oneCentimeter(1), + unavailable(127) + } (1..127) + + PosPillar ::= INTEGER { + tenCentimeters(1), + unavailable(30) + } (1..30) + + PosCentMass ::= INTEGER { + tenCentimeters(1), + unavailable(63) + } (1..63) + + RequestResponseIndication ::= ENUMERATED { + request(0), + response(1) + } + + SpeedLimit ::= INTEGER { + oneKmPerHour(1) + } (1..255) + + StationarySince ::= ENUMERATED { + lessThan1Minute(0), + lessThan2Minutes(1), + lessThan15Minutes(2), + equalOrGreater15Minutes(3) + } + + Temperature ::= INTEGER { + equalOrSmallerThanMinus60Deg(-60), + oneDegreeCelsius(1), + equalOrGreaterThan67Deg(67) + } (-60..67) + + TrafficRule ::= ENUMERATED { + noPassing(0), + noPassingForTrucks(1), + passToRight(2), + passToLeft(3), + ... + } + + WheelBaseVehicle ::= INTEGER { + tenCentimeters(1), + unavailable(127) + } (1..127) + + TurningRadius ::= INTEGER { + point4Meters(1), + unavailable(255) + } (1..255) + + PosFrontAx ::= INTEGER { + tenCentimeters(1), + unavailable(20) + } (1..20) + + PositionOfOccupants ::= BIT STRING { + row1LeftOccupied(0), + row1RightOccupied(1), + row1MidOccupied(2), + row1NotDetectable(3), + row1NotPresent(4), + row2LeftOccupied(5), + row2RightOccupied(6), + row2MidOccupied(7), + row2NotDetectable(8), + row2NotPresent(9), + row3LeftOccupied(10), + row3RightOccupied(11), + row3MidOccupied(12), + row3NotDetectable(13), + row3NotPresent(14), + row4LeftOccupied(15), + row4RightOccupied(16), + row4MidOccupied(17), + row4NotDetectable(18), + row4NotPresent(19) + } (SIZE (20)) + + PositioningSolutionType ::= ENUMERATED { + noPositioningSolution(0), + sGNSS(1), + dGNSS(2), + sGNSSplusDR(3), + dGNSSplusDR(4), + dR(5), + ... + } + + VehicleIdentification ::= SEQUENCE { + wMInumber WMInumber OPTIONAL, + vDS VDS OPTIONAL, + ... + } + + WMInumber ::= IA5String (SIZE (1..3)) + + VDS ::= IA5String (SIZE (6)) + + EnergyStorageType ::= BIT STRING { + hydrogenStorage(0), + electricEnergyStorage(1), + liquidPropaneGas(2), + compressedNaturalGas(3), + diesel(4), + gasoline(5), + ammonia(6) + } (SIZE (7)) + + VehicleLength ::= SEQUENCE { + vehicleLengthValue VehicleLengthValue, + vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication + } + + VehicleLengthValue ::= INTEGER { + tenCentimeters(1), + outOfRange(1022), + unavailable(1023) + } (1..1023) + + VehicleLengthConfidenceIndication ::= ENUMERATED { + noTrailerPresent(0), + trailerPresentWithKnownLength(1), + trailerPresentWithUnknownLength(2), + trailerPresenceIsUnknown(3), + unavailable(4) + } + + VehicleWidth ::= INTEGER { + tenCentimeters(1), + outOfRange(61), + unavailable(62) + } (1..62) + + PathHistory ::= SEQUENCE SIZE (0..40) OF PathPoint + + EmergencyPriority ::= BIT STRING { + requestForRightOfWay(0), + requestForFreeCrossingAtATrafficLight(1) + } (SIZE (2)) + + InformationQuality ::= INTEGER { + unavailable(0), + lowest(1), + highest(7) + } (0..7) + + RoadType ::= ENUMERATED { + urban-NoStructuralSeparationToOppositeLanes(0), + urban-WithStructuralSeparationToOppositeLanes(1), + nonUrban-NoStructuralSeparationToOppositeLanes(2), + nonUrban-WithStructuralSeparationToOppositeLanes(3) + } + + SteeringWheelAngle ::= SEQUENCE { + steeringWheelAngleValue SteeringWheelAngleValue, + steeringWheelAngleConfidence SteeringWheelAngleConfidence + } + + SteeringWheelAngleValue ::= INTEGER { + straight(0), + onePointFiveDegreesToRight(-1), + onePointFiveDegreesToLeft(1), + unavailable(512) + } (-511..512) + + SteeringWheelAngleConfidence ::= INTEGER { + equalOrWithinOnePointFiveDegree(1), + outOfRange(126), + unavailable(127) + } (1..127) + + TimestampIts ::= INTEGER { + utcStartOf2004(0), + oneMillisecAfterUTCStartOf2004(1) + } (0..4398046511103) + + VehicleRole ::= ENUMERATED { + default(0), + publicTransport(1), + specialTransport(2), + dangerousGoods(3), + roadWork(4), + rescue(5), + emergency(6), + safetyCar(7), + agriculture(8), + commercial(9), + military(10), + roadOperator(11), + taxi(12), + reserved1(13), + reserved2(14), + reserved3(15) + } + + YawRate ::= SEQUENCE { + yawRateValue YawRateValue, + yawRateConfidence YawRateConfidence + } + + YawRateValue ::= INTEGER { + straight(0), + degSec-000-01ToRight(-1), + degSec-000-01ToLeft(1), + unavailable(32767) + } (-32766..32767) + + YawRateConfidence ::= ENUMERATED { + degSec-000-01(0), + degSec-000-05(1), + degSec-000-10(2), + degSec-001-00(3), + degSec-005-00(4), + degSec-010-00(5), + degSec-100-00(6), + outOfRange(7), + unavailable(8) + } + + ProtectedZoneType ::= ENUMERATED { + cenDsrcTolling(0), + ... + } + + RelevanceDistance ::= ENUMERATED { + lessThan50m(0), + lessThan100m(1), + lessThan200m(2), + lessThan500m(3), + lessThan1000m(4), + lessThan5km(5), + lessThan10km(6), + over10km(7) + } + + RelevanceTrafficDirection ::= ENUMERATED { + allTrafficDirections(0), + upstreamTraffic(1), + downstreamTraffic(2), + oppositeTraffic(3) + } + + TransmissionInterval ::= INTEGER { + oneMilliSecond(1), + tenSeconds(10000) + } (1..10000) + + ValidityDuration ::= INTEGER { + timeOfDetection(0), + oneSecondAfterDetection(1) + } (0..86400) + + ActionID ::= SEQUENCE { + originatingStationID StationID, + sequenceNumber SequenceNumber + } + + ItineraryPath ::= SEQUENCE SIZE (1..40) OF ReferencePosition + + ProtectedCommunicationZone ::= SEQUENCE { + protectedZoneType ProtectedZoneType, + expiryTime TimestampIts OPTIONAL, + protectedZoneLatitude Latitude, + protectedZoneLongitude Longitude, + protectedZoneRadius ProtectedZoneRadius OPTIONAL, + protectedZoneID ProtectedZoneID OPTIONAL + } + + Traces ::= SEQUENCE SIZE (1..7) OF PathHistory + + NumberOfOccupants ::= INTEGER { + oneOccupant(1), + unavailable(127) + } (0..127) + + SequenceNumber ::= INTEGER (0..65535) + + PositionOfPillars ::= SEQUENCE SIZE (1..3, ...) OF PosPillar + + RestrictedTypes ::= SEQUENCE SIZE (1..3, ...) OF StationType + + EventHistory ::= SEQUENCE SIZE (1..23) OF EventPoint + + EventPoint ::= SEQUENCE { + eventPosition DeltaReferencePosition, + eventDeltaTime PathDeltaTime OPTIONAL, + informationQuality InformationQuality + } + + ProtectedCommunicationZonesRSU ::= SEQUENCE SIZE (1..16) OF + ProtectedCommunicationZone + + CenDsrcTollingZone ::= SEQUENCE { + protectedZoneLatitude Latitude, + protectedZoneLongitude Longitude, + cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL + } + + ProtectedZoneRadius ::= INTEGER { + oneMeter(1) + } (1..255, ...) + + ProtectedZoneID ::= INTEGER (0..134217727) + + CenDsrcTollingZoneID ::= ProtectedZoneID + +END diff --git a/BNCompiler/temp.xml b/BNCompiler/temp.xml new file mode 100644 index 0000000..ffa72ef --- /dev/null +++ b/BNCompiler/temp.xml @@ -0,0 +1,7602 @@ + + + testworkdir\output + test_asn + + + + BIT STRING + + false + false + false + false + false + false + false + + TestBitStr + + + BIT STRING + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 1 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 16 + true + + + + false + false + + false + + false + false + false + false + true + false + false + +false +false +false +false +false +false +false +true +false +false +false +false +false +false + + false + false + + false + + false + false + false + false + true + false + false + + TestBitStrBnd + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + TestPRN + PrintableString + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + TestIA5 + IA5String + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + ITUType1 + VisibleString + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + TestUnicodeStr + UTF8String + + + CHARACTER STRING + + + + + + + + + false + false + false + false + false + false + false + false + false + false + true + false + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 12 + true + + + + false + false + + false + + false + false + false + false + true + false + false + +false +false +false +false +false +false +false +true +false +false +false +false +false +false + + false + false + + false + + false + false + false + false + true + false + false + + false + TestUnicodeStrBnd + UTF8String + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + TestGT + GeneralizedTime + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + TestUTC + UTCTime + + + CHARACTER STRING + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 1 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + + false + false + false + false + true + false + false + +false +false +false +false +false +false +false +true +false +false +false +false +false +false + + false + false + + false + + false + false + false + false + true + false + false + + false + FQDN + VisibleString + + + + + false + false + true + false + false + true + false + plain + + +0 + + + + TestPRN + + + false + false + true + false + false + true + false + unicode + + +1 + + + + TestOCT + + + false + false + true + false + false + true + false + binary + + +2 + + + + TestOCT + + + false + false + false + false + false + true + false + simpleType + + +3 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + false + false + true + false + simpleOctType + + +4 + + + + + OCTET STRING + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + booleanType + + +5 + + + + + BOOLEAN + + + + + false + false + false + false + false + true + false + intType + + +6 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + intBndType + + +7 + + + + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + false + + Data + true + + + + + false + false + false + false + false + true + false + bugBoolean + + +0 + + + + + BOOLEAN + + + + + false + false + false + false + false + true + false + bugInteger + + +1 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + false + + BugPrimitive + true + + + + + false + false + true + false + false + true + false + bugPrimitive + + +0 + + + + BugPrimitive + + + false + false + true + false + false + true + false + bugEnum + + +1 + + + + BugEnum + + + false + false + true + false + false + true + false + bugSequence + + +2 + + + + BugSequenceType + + false + + BugValueType + true + + + + + false + false + true + false + false + true + false + testa + + +33 + + + + TestLongTag2Choice + + false + + TestLongTag2 + true + + + + + false + false + false + false + false + true + false + field10 + + +0 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + field20 + + +1 + + + + + OCTET STRING + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + field30 + + +2 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTF8String + + + + false + false + false + false + false + true + false + field40 + + +3 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + false + + TestParent2 + true + + + + + true + false + true + false + false + false + false + TestTParent2 + + + false + false + false + false + false + true + false + field5 + + +4 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTF8String + + + + true + false + false + false + false + false + false + + + + false + false + false + false + false + true + false + field6 + + + 7 + + + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + + UTF8String + + +false + + + true + + + false + + TestChild2 + true + + + + + false + false + false + false + false + true + false + field10 + + +0 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + field20 + + +1 + + + + + OCTET STRING + +false +false +false +false +false +false +false + + + + + + false + false + false + false + true + true + false + field30 + + +2 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTF8String + + + + false + false + false + false + true + true + false + field40 + + +3 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + true + + ChoiceType + true + + + + false + false + false + false + false + false + false + + false + + TestTParent + TestParent + + + + false + false + false + false + false + false + false + + false + + TestTParent2 + TestParent2 + + + ContentType + + + true + text_any + + 100 + true + + + + true + text_html + + 101 + true + + + + true + text_plain + + 102 + true + + + + true + audio_x_midi + + 306 + true + + + + true + video_any + + 400 + true + + + + true + video_mpeg + + 401 + true + + + + true + video_avi + + 402 + true + + + + true + video_quicktime + + 403 + true + + + + true + video_x_msvideo + + 404 + true + + + + true + application_smil + + 500 + true + + + false + true + 10 + + + true + + + MixedEnumType + + + true + low + + 3 + true + + + + true + mid + + 8 + true + + + + true + high + + 101 + true + + + false + true + 3 + + + true + + + ContentSchema + + + true + multipart_any + + 110 + true + + + + true + multipart_mixed + + 111 + true + + + + true + multipart_form_data + + 112 + true + + + + true + multipart_byteranges + + 113 + true + + + + true + multipart_alternative + + 114 + true + + + + true + multipart_related + + 175 + true + + + false + true + 6 + + + true + + + ProtectedZoneType + + + true + permanentCenDsrcTolling + + 0 + true + + + + true + temporaryCenDsrcTolling + + 1 + true + + + true + true + 1 + + + true + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 1 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 5 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestIR + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestI8 + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 253 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestI8named + + + true + a + + 1 + true + + + + true + b + + 2 + true + + + + true + d + + 5 + true + + + false + false + 3 + + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 16384 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestI14 + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 65535 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestI16 + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 4294967295 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestI32 + + + INTEGER + + false + false + false + false + false + false + false + + TestI + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 128 + false + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 128 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestNI + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 2048 + false + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 2048 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestNI2 + + + INTEGER + + false + false + false + false + false + false + false + + BugEnum + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 1 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 2247483648 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + TestLong + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 63 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + SubInteger + + + INTEGER + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 63 + true + + + + false + false + + false + + false + false + true + false + true + false + false + + ExtensibleInteger + + + NullSequence + true + + + OBJECT IDENTIFIER + TestOID + + + OCTET STRING + + false + false + false + false + false + false + false + + TestOCT + + + REAL + TestReal + + + + + false + false + true + false + false + true + false + plain + + +0 + + + + TestPRN + + + false + false + true + true + false + true + false + unicode + + +1 + + + + TestOCT + + + false + false + true + false + false + true + false + binary + + +2 + + + + TestOCT + + + false + false + false + false + false + true + false + simpleType + + +3 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + false + false + false + false + simpleOctType + + OCTET STRING + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + booleanType + + +5 + + + + + BOOLEAN + + + + + false + false + false + false + false + true + false + intType + + +6 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + intBndType + + +7 + + + + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + + false + false + false + false + false + true + false + stringArray + + +8 + + + + + false + true + false + + + +CHARACTER STRING + + false + false + false + false + false + false + false + +false + +PrintableString + + + + + false + false + false + false + false + true + false + dataArray + + +9 + + + + + true + true + false + + Data + + + + false + false + false + true + false + false + false + extension + + ANY + + false + + + + false + + true + DataSeq + + + + + false + false + true + false + false + true + false + plain + + +0 + + + + TestPRN + + + false + false + true + true + false + true + false + unicode + + +1 + + + + TestOCT + + + false + false + true + true + false + true + false + binary + + +2 + + + + TestOCT + + + false + false + false + true + false + true + false + simpleType + + +3 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + false + false + false + false + simpleOctType + + OCTET STRING + +false +false +false +false +false +false +false + + + + + + false + false + false + true + false + true + false + booleanType + + +5 + + + + + BOOLEAN + + + + + false + false + false + true + false + true + false + intType + + +6 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + true + false + true + false + intBndType + + +7 + + + + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + + false + false + false + true + false + true + false + stringArray + + +8 + + + + + false + true + false + + + +CHARACTER STRING + + false + false + false + false + false + false + false + +false + +PrintableString + + + + + false + false + false + true + false + true + false + dataArray + + +9 + + + + + true + true + false + + Data + + + + false + false + true + true + false + true + false + plain2 + + +10 + + + + TestPRN + + + false + false + true + true + false + true + false + unicode2 + + +18 + + + + TestOCT + + + false + false + true + true + false + true + false + binary2 + + +11 + + + + TestOCT + + + false + false + false + true + false + true + false + simpleType2 + + +12 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + true + false + false + false + simpleOctType2 + + OCTET STRING + +false +false +false +false +false +false +false + + + + + + false + false + false + true + false + true + false + booleanType2 + + +13 + + + + + BOOLEAN + + + + + false + false + false + true + false + true + false + intType2 + + +19 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + true + false + true + false + intBndType2 + + +14 + + + + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + + false + false + false + true + false + true + false + stringArray2 + + +15 + + + + + false + true + false + + + +CHARACTER STRING + + false + false + false + false + false + false + false + +false + +PrintableString + + + + + false + false + false + true + false + true + false + dataArray2 + + +16 + + + + + true + true + false + + Data + + + + false + false + true + true + false + true + false + plain3 + + +17 + + + + TestPRN + + false + + true + DataSeqMO + + + + + false + false + false + false + false + false + false + type1 + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + VisibleString + + + + false + false + true + false + false + true + true + type2 + + +3 + + APPLICATION + + ITUType1 + IMPLICIT + + + false + false + true + false + false + true + false + type3 + + +2 + + + + ITUType2 + + + false + false + true + false + false + true + true + type4 + + +7 + + APPLICATION + + ITUType3 + IMPLICIT + + + false + false + true + true + false + true + true + type5 + + +2 + + + + ITUType2 + IMPLICIT + + + false + false + false + false + false + true + false + type6 + + +7 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + VisibleString + + + + false + false + true + false + false + true + false + type7 + + +8 + + + + ITUType6 + + false + + true + ITUSequence + + + + + false + false + false + false + false + false + false + test + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + false + false + false + false + nullVal + + + true + + + + false + false + false + false + false + true + false + test2 + + +1 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + false + + true + SequenceWithNull + + + + + false + false + false + false + false + true + false + value + + +0 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + true + false + true + false + params + + +1 + + + + + true + true + false + + PlainParamsMap + + + false + + true + ValueWithParams + + + + + false + false + false + false + false + true + false + param_name + + +1 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + false + false + true + false + param_value + + +2 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + false + + true + PlainParamsMap + + + + + false + false + false + false + false + true + false + name + + +0 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + false + false + true + false + values + + +1 + + + + + true + true + false + + ValueWithParams + + + false + + true + ContentPartHeader + + + + + false + false + false + false + false + false + false + item + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + true + false + false + false + false + enval + ContentSchema + + + false + false + true + false + false + true + false + taggedEnval + + +1 + + + + ContentSchema + + false + + true + SequenceWithEnum + + + + + false + false + false + false + false + true + false + name + + +1 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + true + true + false + true + false + value + + +2 + + + + TestRecursiveDefinetion + + false + + true + TestRecursiveDefinetion + + + + + false + false + false + false + false + true + false + nodefault + + +0 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + true + false + false + false + true + false + withDefault + + +1 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + "dd" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + + false + true + false + false + false + true + false + withIntDef + + +2 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + +120 +true + + + + + false + true + false + false + false + true + false + withSeqDef + + +3 + + + + + + + false + false + false + false + false + false + false + name + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + + PrintableString + + + + false + false + false + false + false + false + false + email + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + + PrintableString + + +false + + true + + + + false + false + false + false + false + false + false + false + false + false + true + false + false + +true + + name + + "Name" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + + email + + "Email" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + + + + + false + true + true + false + false + true + false + withOctDef + + +4 + + + + TestOCT + + +'01101100'B +true +false + + +false +false + + false + true + false + false + false + false + false + false + false + false + false + false + false + + + + false + true + false + false + false + true + false + withOctDef2 + + +5 + + + + + OCTET STRING + +false +false +false +false +false +false +false + + + + + +'FFEEAA'H +false +true + + +false +false + + false + true + false + false + false + false + false + false + false + false + false + false + false + + + + false + true + false + false + false + true + false + withSeqOf + + +6 + + + + + false + true + false + + + +CHARACTER STRING + + false + false + false + false + false + false + false + +false + +PrintableString + + + + false + false + false + false + false + false + false + false + false + true + false + false + false + + + "aa" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + "dd" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + + + + false + true + false + false + false + true + false + withSeqOf2 + + +7 + + + + + true + true + false + + TestPRN + + + false + false + false + false + false + false + false + false + false + true + false + false + false + + + "cc" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + "ee" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + + + + false + true + true + false + false + true + false + withSeqOf3 + + +8 + + + + StringArray + + false + false + false + false + false + false + false + false + false + true + false + false + false + + + "fff" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + "ggg" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + + + + false + true + false + false + false + true + false + withEnumDef + + +9 + + + + + + + + true + one + + 1 + true + + + + true + two + + 2 + true + + + + true + three + + 3 + true + + +false +true +3 + + + true + + + +false +two + + false + false + false + false + true + false + false + false + false + false + false + false + false + + + false + + true + SequenceWithDefault + + + + + false + false + false + false + false + true + false + nodefault + + +2 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + true + false + false + true + false + nodefault2 + + +1 + + + + TestPRN + + + false + true + false + false + false + true + false + default3 + + +3 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + "DDDdd" + false + false + true + false + false + false + false + false + false + false + false + false + false + + + false + + false + SetWithDefault + + + + + false + false + false + false + false + true + false + seq + + +0 + + + + + + + false + false + false + true + false + false + false + it1 + + INTEGER + + false + false + false + false + false + false + false + + + + +false + + true + + + + + false + false + false + false + false + true + false + ch + + +1 + + + + + + + false + false + false + false + false + true + false + it1 + + + 0 + + + + + INTEGER + + false + false + false + false + false + false + false + + + + + + false + false + false + false + false + true + false + it2 + + + 1 + + + + + OCTET STRING + + false + false + false + false + false + false + false + + + + +false + + + true + + + + false + false + false + false + false + true + false + seqf + + +2 + + + + + false + true + false + + + + + + false + false + false + true + false + false + false + it1 + + INTEGER + + false + false + false + false + false + false + false + + + + + false + +true + + + + + false + + true + TestSequenceWithNonames + + + + + false + false + false + false + false + true + false + attrSimple + + +0 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + PrintableString + + + + false + false + false + false + false + true + false + attrStr + + +1 + + + + + CHARACTER STRING + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + +false +false +false +false +false +false +false +false +false +false +false +true +false + + 1 + true + + + +false +false +false +false +false +false +false +false +false +false +false +true +false + + 4 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + true + false + false + false + false + false + false + + false + false + + false + +false +false +false +false +true +false +false + + false + + PrintableString + + + + false + false + true + false + false + true + false + attrStr2 + + +2 + + + + TestPRN + + + false + false + false + false + false + true + false + attrArr + + +3 + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 1 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 5 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + false + true + true + + + +CHARACTER STRING + + false + false + false + false + false + false + false + +false + +PrintableString + + + + + false + false + false + true + false + true + false + attrBitStr + + +4 + + + + + BIT STRING + +false +false +false +false +false +false +false + + + + + + false + true + false + false + false + true + false + attrBitStrDef + + +5 + + + + + BIT STRING + +false +false +false +false +false +false +false + + + + + +'011'B +true +false + + +false +false + + false + true + false + false + false + false + false + false + false + false + false + false + false + + + + false + false + false + true + false + true + false + attrBitStrBnd + + +6 + + + + + BIT STRING + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + +false +false +false +false +false +false +false +false +false +false +false +true +false + + 1 + true + + + +false +false +false +false +false +false +false +false +false +false +false +true +false + + 36 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + true + false + false + false + false + false + false + + false + false + + false + +false +false +false +false +true +false +false + + + + + + false + false + true + true + false + true + false + attrBoxBitStr + + +7 + + + + TestBitStrBnd + + + false + false + false + false + false + true + false + attrStrict + + +8 + + + + + OCTET STRING + + + + + + + + + false + false + false + false + false + false + false + false + false + false + true + false + false + false + +false +false +false +false +false +false +false +false +false +false +false +true +false + + 4 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + true + false + false + false + false + false + false + + false + false + + false + +false +false +false +false +true +false +false + + + + + false + + true + TestSequenceV12 + + + + + false + false + false + false + false + true + false + booleanField + + +0 + + + + + BOOLEAN + + + + + false + false + false + false + false + true + false + integerField + + +0 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + false + + true + BugSequenceType + + + + + false + false + false + false + false + true + false + field1 + + +0 + + + + + REAL + + + + + false + false + false + false + false + false + false + fieldI + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + true + false + false + false + false + field2 + TestReal + + + false + false + false + true + false + false + false + field3 + + REAL + + + + + false + false + false + false + false + true + false + field4 + + +1 + + + + + REAL + + + + + false + false + false + false + false + false + false + field5 + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + GeneralizedTime + + + + false + false + false + false + false + false + false + field6 + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTCTime + + + + false + false + true + false + false + false + false + field7 + TestLong + + false + + true + TestSeqV13 + + + + + false + false + false + false + false + true + false + field1 + + +0 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + true + false + field2 + + +1 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTF8String + + + + false + false + false + false + false + true + false + field3 + + +2 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTF8String + + + false + + true + TestSimpleSequence + + + + + false + false + false + false + false + true + false + testb + + +0 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + false + + true + TestLongTag2Choice + + + + + false + false + false + false + false + true + false + field1 + + +0 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + true + false + true + false + field2 + + +1 + + + + + OCTET STRING + +false +false +false +false +false +false +false + + + + + + false + true + false + false + false + true + false + field3 + + +2 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTF8String + + + +false +field3Default + + false + false + false + false + true + false + false + false + false + false + false + false + false + + + + false + false + false + false + false + true + false + field4 + + +3 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + + false + false + false + false + false + false + false + field5 + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 4 + false + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 251 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + true + c + + 16 + true + + + + true + e + + 31 + true + + +false +false +2 + + + + false + + true + TestParent + + + + + true + false + true + false + false + false + false + TestTParent + + + false + false + false + false + false + true + false + field6 + + +4 + + + + + CHARACTER STRING + +false +false +false +false +false +false +false + + false + + UTF8String + + + + true + false + false + false + false + false + false + + + + false + true + false + false + false + true + false + field7 + + + 5 + + + + + INTEGER + + false + false + false + false + false + false + false + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + +false + + true + + + + false + + true + TestChild3 + + + + + false + false + false + false + false + true + false + field1 + + +0 + + + + + OBJECT IDENTIFIER + + + + + false + false + false + true + false + true + false + field2 + + +1 + + + + + OBJECT IDENTIFIER + + + + + false + false + false + false + false + true + false + field3 + + +2 + + + + + INTEGER + +false +false +false +false +false +false +false + + + + + false + + true + TestSeqOID + + + + + false + false + true + false + false + false + false + prot + ProtectedZoneType + + + false + false + false + false + false + false + false + tail + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + false + + true + ExtendedEnumSeq + + + + + false + false + false + false + false + true + false + simpleInt + + +0 + + + + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + + false + false + false + false + false + true + false + simpleBool + + +1 + + + + + BOOLEAN + + + + + false + false + false + true + false + true + false + optBool + + +2 + + + + + BOOLEAN + + + + + false + false + false + true + true + true + false + extendedInt1 + + +3 + + + + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 63 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + + false + false + false + false + true + true + false + extendedInt2 + + +4 + + + + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 100000 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + true + + true + DataSeqExtensible + + + + + false + false + true + false + false + false + false + choi + ChoiceType + + + false + false + false + false + false + false + false + tail + + INTEGER + + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 255 + true + + + + false + false + + false + +false +false +false +false +true +false +false + + + + + false + + true + ExtendedChoiceSeq + + + true + true + false + DataArray + Data + + + true + true + false + DataSeqArray + DataSeq + + + false + true + false + StringArray + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + + PrintableString + + + + false + true + false + UTF8StringArray + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + + UTF8String + + + + false + true + false + OctetStringArray + + + OCTET STRING + + false + false + false + false + false + false + false + + + + + + true + true + false + ContentPartHeaders + ContentPartHeader + + + true + false + false + SetOfTest + Data + + + true + true + false + BugList + BugValueType + + + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 0 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 40 + true + + + + false + false + + false + + false + false + false + false + true + false + false + + false + true + true + TestSeqSize + + + INTEGER + + false + false + false + false + false + false + false + + + + + + + + + +false +false +false +false +false +false +false +false +false +false +false +true +false +false + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 1 + true + + + + false + false + false + false + false + false + false + false + false + false + false + true + false + + 3 + true + + + + false + false + + false + + false + false + true + false + true + false + false + + true + true + true + ExtensibleSize + SubInteger + + + true + ITUType2 + + + 3 + + APPLICATION + + IMPLICIT + ITUType1 + + + true + ITUType3 + + + 2 + + + + + ITUType2 + + + true + ITUType4 + + + 7 + + APPLICATION + + IMPLICIT + ITUType3 + + + true + ITUType5 + + + 2 + + + + IMPLICIT + ITUType2 + + + false + ITUType6 + + + 9 + + + + + + + CHARACTER STRING + + false + false + false + false + false + false + false + + false + + VisibleString + + + + false + TaggedNullSequence + + + 1 + + + + + + + + true + + + + false + TaggedSequence + + + 8 + + APPLICATION + + + + + + + false + false + false + true + false + true + false + type1 + + + 7 + + + + +CHARACTER STRING + + false + false + false + false + false + false + false + +false + +VisibleString + + + false + + true + + + + + false + TaggedSeqInSeq + + + 4 + + APPLICATION + + + + + + + false + false + true + false + false + true + false + field + + + 0 + + + + PlainParamsMap + + false + + true + + + + + false + TestLongTag + + + 15123 + + APPLICATION + + + + + INTEGER + + false + false + false + false + false + false + false + + + + + + false + Test128Tag + + + 128 + + APPLICATION + + + + + INTEGER + + false + false + false + false + false + false + false + + + + + + false + Minor + + + 105 + + APPLICATION + + IMPLICIT + + + INTEGER + + false + false + false + false + false + false + false + + + + + + false + Major + + + 106 + + APPLICATION + + IMPLICIT + + + INTEGER + + false + false + false + false + false + false + false + + + + + + false + Version + + + 74 + + APPLICATION + + IMPLICIT + + + + + false + false + true + true + false + false + false + minor + Minor + + + false + false + true + true + false + false + false + major + Major + + false + + false + + + + + false + LstVersion + + + 75 + + APPLICATION + + IMPLICIT + + + true + false + false + + Version + + + + false + Config + + + 76 + + APPLICATION + + IMPLICIT + + + + + false + false + true + false + false + false + false + lstVersion + LstVersion + + + false + false + true + false + false + false + false + major_config + Major + + false + + true + + + + + false + Config2 + + + 79 + + APPLICATION + + IMPLICIT + + + + + false + false + true + false + false + false + false + lstVersion + LstVersion + + + false + false + true + false + false + false + false + major_config + Major + + false + + true + + + + + false + TestTaggedSetInSet + + + 77 + + APPLICATION + + IMPLICIT + + + + + false + false + true + false + false + false + false + config1 + Config + + + false + false + true + false + false + false + false + config2 + Config2 + + false + + false + + + + + false + Set1 + + + 55 + + APPLICATION + + IMPLICIT + + + + + false + false + false + false + false + false + false + set1ID + +INTEGER + + false + false + false + false + false + false + false + + + + + false + + false + + + + + false + Set2 + + + 128 + + APPLICATION + + IMPLICIT + + + true + false + false + + Set1 + + + + false + Set3 + + + 124 + + APPLICATION + + IMPLICIT + + + + + false + false + true + false + false + false + false + set2 + Set2 + + false + + false + + + + + false + Set4 + + + 61 + + APPLICATION + + IMPLICIT + + + true + false + false + + Set3 + + + + false + Set5 + + + 127 + + APPLICATION + + IMPLICIT + + + true + false + false + + Set3 + + + + false + Set6 + + + 56 + + APPLICATION + + IMPLICIT + + + + + false + false + true + false + false + false + false + set4 + Set4 + + + false + false + true + false + false + false + false + set5 + Set5 + + false + + false + + + + + false + Set7 + + + 90 + + APPLICATION + + IMPLICIT + + + + + false + false + true + false + false + false + false + set6 + Set6 + + false + + false + + + + + + "Sssdsd" + false + false + true + false + false + false + false + false + false + false + false + false + false + field3Default + CHARACTER STRING + + TestOCT + TestPRN + TestIA5 + TestI32 + TestI16 + TestI8 + ContentType + ValueWithParams + PlainParamsMap + ContentPartHeaders + ContentPartHeader + ContentSchema + Data + DataArray + true + false + false + + + false + + TEST_ASN + + true + IMPLICIT + + diff --git a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj index 8c4c8eb..51e288e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj +++ b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj @@ -24,6 +24,13 @@ + + + + + PreserveNewest + + diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs new file mode 100644 index 0000000..095f73f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AccelerationConfidence" )] + public class AccelerationConfidence: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "AccelerationConfidence" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 102L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public AccelerationConfidence() { + } + + public AccelerationConfidence(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AccelerationConfidence)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationControl.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationControl.cs new file mode 100644 index 0000000..30818ed --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationControl.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AccelerationControl") ] + public class AccelerationControl : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "AccelerationControl") ] + + [ASN1SizeConstraint ( Max = 7L )] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public AccelerationControl() { + } + + public AccelerationControl(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AccelerationControl)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs new file mode 100644 index 0000000..f01c141 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AccidentSubCauseCode" )] + public class AccidentSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "AccidentSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public AccidentSubCauseCode() { + } + + public AccidentSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AccidentSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ActionID.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ActionID.cs new file mode 100644 index 0000000..d04c7fd --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ActionID.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "ActionID", IsExtensible = false, IsSet = false)] + public class ActionID : IASN1PreparedElement { + + private StationID originatingStationID_ ; + + [ASN1Element ( Name = "originatingStationID", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public StationID OriginatingStationID + { + get { return originatingStationID_; } + set { originatingStationID_ = value; } + } + + + + private SequenceNumber sequenceNumber_ ; + + [ASN1Element ( Name = "sequenceNumber", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SequenceNumber SequenceNumber + { + get { return sequenceNumber_; } + set { sequenceNumber_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ActionID)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs new file mode 100644 index 0000000..544a9d2 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AdverseWeatherCondition_AdhesionSubCauseCode" )] + public class AdverseWeatherCondition_AdhesionSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "AdverseWeatherCondition-AdhesionSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public AdverseWeatherCondition_AdhesionSubCauseCode() { + } + + public AdverseWeatherCondition_AdhesionSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AdverseWeatherCondition_AdhesionSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs new file mode 100644 index 0000000..fcd8e65 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode" )] + public class AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode() { + } + + public AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs new file mode 100644 index 0000000..607acc0 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AdverseWeatherCondition_PrecipitationSubCauseCode" )] + public class AdverseWeatherCondition_PrecipitationSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "AdverseWeatherCondition-PrecipitationSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public AdverseWeatherCondition_PrecipitationSubCauseCode() { + } + + public AdverseWeatherCondition_PrecipitationSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AdverseWeatherCondition_PrecipitationSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs new file mode 100644 index 0000000..bad1be8 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AdverseWeatherCondition_VisibilitySubCauseCode" )] + public class AdverseWeatherCondition_VisibilitySubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "AdverseWeatherCondition-VisibilitySubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public AdverseWeatherCondition_VisibilitySubCauseCode() { + } + + public AdverseWeatherCondition_VisibilitySubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AdverseWeatherCondition_VisibilitySubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Altitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Altitude.cs new file mode 100644 index 0000000..5f3b5b0 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Altitude.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "Altitude", IsExtensible = false, IsSet = false)] + public class Altitude : IASN1PreparedElement { + + private AltitudeValue altitudeValue_ ; + + [ASN1Element ( Name = "altitudeValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public AltitudeValue AltitudeValue + { + get { return altitudeValue_; } + set { altitudeValue_ = value; } + } + + + + private AltitudeConfidence altitudeConfidence_ ; + + [ASN1Element ( Name = "altitudeConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public AltitudeConfidence AltitudeConfidence + { + get { return altitudeConfidence_; } + set { altitudeConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Altitude)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs new file mode 100644 index 0000000..7965b94 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs @@ -0,0 +1,78 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "AltitudeConfidence", IsExtensible = false, NumRootElements = 16)] + public class AltitudeConfidence : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "alt-000-01", HasTag = true , Tag = 0 )] + alt_000_01 , + [ASN1EnumItem ( Name = "alt-000-02", HasTag = true , Tag = 1 )] + alt_000_02 , + [ASN1EnumItem ( Name = "alt-000-05", HasTag = true , Tag = 2 )] + alt_000_05 , + [ASN1EnumItem ( Name = "alt-000-10", HasTag = true , Tag = 3 )] + alt_000_10 , + [ASN1EnumItem ( Name = "alt-000-20", HasTag = true , Tag = 4 )] + alt_000_20 , + [ASN1EnumItem ( Name = "alt-000-50", HasTag = true , Tag = 5 )] + alt_000_50 , + [ASN1EnumItem ( Name = "alt-001-00", HasTag = true , Tag = 6 )] + alt_001_00 , + [ASN1EnumItem ( Name = "alt-002-00", HasTag = true , Tag = 7 )] + alt_002_00 , + [ASN1EnumItem ( Name = "alt-005-00", HasTag = true , Tag = 8 )] + alt_005_00 , + [ASN1EnumItem ( Name = "alt-010-00", HasTag = true , Tag = 9 )] + alt_010_00 , + [ASN1EnumItem ( Name = "alt-020-00", HasTag = true , Tag = 10 )] + alt_020_00 , + [ASN1EnumItem ( Name = "alt-050-00", HasTag = true , Tag = 11 )] + alt_050_00 , + [ASN1EnumItem ( Name = "alt-100-00", HasTag = true , Tag = 12 )] + alt_100_00 , + [ASN1EnumItem ( Name = "alt-200-00", HasTag = true , Tag = 13 )] + alt_200_00 , + [ASN1EnumItem ( Name = "outOfRange", HasTag = true , Tag = 14 )] + outOfRange , + [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 15 )] + unavailable , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AltitudeConfidence)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs new file mode 100644 index 0000000..df8577a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "AltitudeValue" )] + public class AltitudeValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "AltitudeValue" )] + [ASN1ValueRangeConstraint ( Min = -100000L, Max = 800001L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public AltitudeValue() { + } + + public AltitudeValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(AltitudeValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicContainer.cs new file mode 100644 index 0000000..3c83566 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicContainer.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "BasicContainer", IsExtensible = true, IsSet = false)] + public class BasicContainer : IASN1PreparedElement { + + private StationType stationType_ ; + + [ASN1Element ( Name = "stationType", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public StationType StationType + { + get { return stationType_; } + set { stationType_ = value; } + } + + + + private ReferencePosition referencePosition_ ; + + [ASN1Element ( Name = "referencePosition", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ReferencePosition ReferencePosition + { + get { return referencePosition_; } + set { referencePosition_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(BasicContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerHighFrequency.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerHighFrequency.cs new file mode 100644 index 0000000..7d166ab --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerHighFrequency.cs @@ -0,0 +1,269 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "BasicVehicleContainerHighFrequency", IsExtensible = false, IsSet = false)] + public class BasicVehicleContainerHighFrequency : IASN1PreparedElement { + + private Heading heading_ ; + + [ASN1Element ( Name = "heading", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Heading Heading + { + get { return heading_; } + set { heading_ = value; } + } + + + + private Speed speed_ ; + + [ASN1Element ( Name = "speed", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Speed Speed + { + get { return speed_; } + set { speed_ = value; } + } + + + + private DriveDirection driveDirection_ ; + + [ASN1Element ( Name = "driveDirection", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DriveDirection DriveDirection + { + get { return driveDirection_; } + set { driveDirection_ = value; } + } + + + + private VehicleLength vehicleLength_ ; + + [ASN1Element ( Name = "vehicleLength", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VehicleLength VehicleLength + { + get { return vehicleLength_; } + set { vehicleLength_ = value; } + } + + + + private VehicleWidth vehicleWidth_ ; + + [ASN1Element ( Name = "vehicleWidth", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VehicleWidth VehicleWidth + { + get { return vehicleWidth_; } + set { vehicleWidth_ = value; } + } + + + + private LongitudinalAcceleration longitudinalAcceleration_ ; + + [ASN1Element ( Name = "longitudinalAcceleration", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LongitudinalAcceleration LongitudinalAcceleration + { + get { return longitudinalAcceleration_; } + set { longitudinalAcceleration_ = value; } + } + + + + private Curvature curvature_ ; + + [ASN1Element ( Name = "curvature", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Curvature Curvature + { + get { return curvature_; } + set { curvature_ = value; } + } + + + + private CurvatureCalculationMode curvatureCalculationMode_ ; + + [ASN1Element ( Name = "curvatureCalculationMode", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CurvatureCalculationMode CurvatureCalculationMode + { + get { return curvatureCalculationMode_; } + set { curvatureCalculationMode_ = value; } + } + + + + private YawRate yawRate_ ; + + [ASN1Element ( Name = "yawRate", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public YawRate YawRate + { + get { return yawRate_; } + set { yawRate_ = value; } + } + + + + private AccelerationControl accelerationControl_ ; + + private bool accelerationControl_present = false ; + + [ASN1Element ( Name = "accelerationControl", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public AccelerationControl AccelerationControl + { + get { return accelerationControl_; } + set { accelerationControl_ = value; accelerationControl_present = true; } + } + + + + private LanePosition lanePosition_ ; + + private bool lanePosition_present = false ; + + [ASN1Element ( Name = "lanePosition", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LanePosition LanePosition + { + get { return lanePosition_; } + set { lanePosition_ = value; lanePosition_present = true; } + } + + + + private SteeringWheelAngle steeringWheelAngle_ ; + + private bool steeringWheelAngle_present = false ; + + [ASN1Element ( Name = "steeringWheelAngle", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SteeringWheelAngle SteeringWheelAngle + { + get { return steeringWheelAngle_; } + set { steeringWheelAngle_ = value; steeringWheelAngle_present = true; } + } + + + + private LateralAcceleration lateralAcceleration_ ; + + private bool lateralAcceleration_present = false ; + + [ASN1Element ( Name = "lateralAcceleration", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LateralAcceleration LateralAcceleration + { + get { return lateralAcceleration_; } + set { lateralAcceleration_ = value; lateralAcceleration_present = true; } + } + + + + private VerticalAcceleration verticalAcceleration_ ; + + private bool verticalAcceleration_present = false ; + + [ASN1Element ( Name = "verticalAcceleration", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VerticalAcceleration VerticalAcceleration + { + get { return verticalAcceleration_; } + set { verticalAcceleration_ = value; verticalAcceleration_present = true; } + } + + + + private PerformanceClass performanceClass_ ; + + private bool performanceClass_present = false ; + + [ASN1Element ( Name = "performanceClass", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PerformanceClass PerformanceClass + { + get { return performanceClass_; } + set { performanceClass_ = value; performanceClass_present = true; } + } + + + + private CenDsrcTollingZone cenDsrcTollingZone_ ; + + private bool cenDsrcTollingZone_present = false ; + + [ASN1Element ( Name = "cenDsrcTollingZone", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CenDsrcTollingZone CenDsrcTollingZone + { + get { return cenDsrcTollingZone_; } + set { cenDsrcTollingZone_ = value; cenDsrcTollingZone_present = true; } + } + + + + public bool isAccelerationControlPresent () { + return this.accelerationControl_present == true; + } + + public bool isLanePositionPresent () { + return this.lanePosition_present == true; + } + + public bool isSteeringWheelAnglePresent () { + return this.steeringWheelAngle_present == true; + } + + public bool isLateralAccelerationPresent () { + return this.lateralAcceleration_present == true; + } + + public bool isVerticalAccelerationPresent () { + return this.verticalAcceleration_present == true; + } + + public bool isPerformanceClassPresent () { + return this.performanceClass_present == true; + } + + public bool isCenDsrcTollingZonePresent () { + return this.cenDsrcTollingZone_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(BasicVehicleContainerHighFrequency)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerLowFrequency.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerLowFrequency.cs new file mode 100644 index 0000000..c0a35fd --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/BasicVehicleContainerLowFrequency.cs @@ -0,0 +1,71 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "BasicVehicleContainerLowFrequency", IsExtensible = false, IsSet = false)] + public class BasicVehicleContainerLowFrequency : IASN1PreparedElement { + + private VehicleRole vehicleRole_ ; + + [ASN1Element ( Name = "vehicleRole", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VehicleRole VehicleRole + { + get { return vehicleRole_; } + set { vehicleRole_ = value; } + } + + + + private ExteriorLights exteriorLights_ ; + + [ASN1Element ( Name = "exteriorLights", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ExteriorLights ExteriorLights + { + get { return exteriorLights_; } + set { exteriorLights_ = value; } + } + + + + private PathHistory pathHistory_ ; + + [ASN1Element ( Name = "pathHistory", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PathHistory PathHistory + { + get { return pathHistory_; } + set { pathHistory_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(BasicVehicleContainerLowFrequency)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM.cs new file mode 100644 index 0000000..45e006b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "CAM", IsExtensible = false, IsSet = false)] + public class CAM : IASN1PreparedElement { + + private ItsPduHeader header_ ; + + [ASN1Element ( Name = "header", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ItsPduHeader Header + { + get { return header_; } + set { header_ = value; } + } + + + + private CoopAwareness cam_ ; + + [ASN1Element ( Name = "cam", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CoopAwareness Cam + { + get { return cam_; } + set { cam_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CAM)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM_PDU_Descriptions.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM_PDU_Descriptions.cs new file mode 100644 index 0000000..e9fa20b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CAM_PDU_Descriptions.cs @@ -0,0 +1,21 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + [ASN1Module ( Name = "CAM_PDU_Descriptions", IsImplicitTags = false ) ] + public class CAM_PDU_Descriptions { + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CamParameters.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CamParameters.cs new file mode 100644 index 0000000..7f8077d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CamParameters.cs @@ -0,0 +1,95 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "CamParameters", IsExtensible = true, IsSet = false)] + public class CamParameters : IASN1PreparedElement { + + private BasicContainer basicContainer_ ; + + [ASN1Element ( Name = "basicContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public BasicContainer BasicContainer + { + get { return basicContainer_; } + set { basicContainer_ = value; } + } + + + + private HighFrequencyContainer highFrequencyContainer_ ; + + [ASN1Element ( Name = "highFrequencyContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public HighFrequencyContainer HighFrequencyContainer + { + get { return highFrequencyContainer_; } + set { highFrequencyContainer_ = value; } + } + + + + private LowFrequencyContainer lowFrequencyContainer_ ; + + private bool lowFrequencyContainer_present = false ; + + [ASN1Element ( Name = "lowFrequencyContainer", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LowFrequencyContainer LowFrequencyContainer + { + get { return lowFrequencyContainer_; } + set { lowFrequencyContainer_ = value; lowFrequencyContainer_present = true; } + } + + + + private SpecialVehicleContainer specialVehicleContainer_ ; + + private bool specialVehicleContainer_present = false ; + + [ASN1Element ( Name = "specialVehicleContainer", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SpecialVehicleContainer SpecialVehicleContainer + { + get { return specialVehicleContainer_; } + set { specialVehicleContainer_ = value; specialVehicleContainer_present = true; } + } + + + + public bool isLowFrequencyContainerPresent () { + return this.lowFrequencyContainer_present == true; + } + + public bool isSpecialVehicleContainerPresent () { + return this.specialVehicleContainer_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CamParameters)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeClass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeClass.cs new file mode 100644 index 0000000..3c37918 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeClass.cs @@ -0,0 +1,57 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "CauseCode", IsExtensible = false, IsSet = false)] + public class CauseCodeClass : IASN1PreparedElement { + + private CauseCodeType causeCode_ ; + + [ASN1Element ( Name = "causeCode", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CauseCodeType CauseCode + { + get { return causeCode_; } + set { causeCode_ = value; } + } + + private SubCauseCodeType subCauseCode_ ; + + [ASN1Element ( Name = "subCauseCode", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SubCauseCodeType SubCauseCode + { + get { return subCauseCode_; } + set { subCauseCode_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CauseCodeClass)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs new file mode 100644 index 0000000..00662a1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "CauseCodeType" )] + public class CauseCodeType: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "CauseCodeType" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public CauseCodeType() { + } + + public CauseCodeType(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CauseCodeType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZone.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZone.cs new file mode 100644 index 0000000..03d29bb --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZone.cs @@ -0,0 +1,77 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "CenDsrcTollingZone", IsExtensible = false, IsSet = false)] + public class CenDsrcTollingZone : IASN1PreparedElement { + + private Latitude protectedZoneLatitude_ ; + + [ASN1Element ( Name = "protectedZoneLatitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Latitude ProtectedZoneLatitude + { + get { return protectedZoneLatitude_; } + set { protectedZoneLatitude_ = value; } + } + + + + private Longitude protectedZoneLongitude_ ; + + [ASN1Element ( Name = "protectedZoneLongitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Longitude ProtectedZoneLongitude + { + get { return protectedZoneLongitude_; } + set { protectedZoneLongitude_ = value; } + } + + + + private CenDsrcTollingZoneID cenDsrcTollingZoneID_ ; + + private bool cenDsrcTollingZoneID_present = false ; + + [ASN1Element ( Name = "cenDsrcTollingZoneID", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CenDsrcTollingZoneID CenDsrcTollingZoneID + { + get { return cenDsrcTollingZoneID_; } + set { cenDsrcTollingZoneID_ = value; cenDsrcTollingZoneID_present = true; } + } + + + + public bool isCenDsrcTollingZoneIDPresent () { + return this.cenDsrcTollingZoneID_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CenDsrcTollingZone)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZoneID.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZoneID.cs new file mode 100644 index 0000000..e9dda3e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CenDsrcTollingZoneID.cs @@ -0,0 +1,55 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "CenDsrcTollingZoneID") ] + public class CenDsrcTollingZoneID: IASN1PreparedElement { + + + private ProtectedZoneID val; + + + [ASN1Element ( Name = "CenDsrcTollingZoneID", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ProtectedZoneID Value + { + get { return val; } + + set { val = value; } + + } + + + + public CenDsrcTollingZoneID () + { + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CenDsrcTollingZoneID)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ClosedLanes.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ClosedLanes.cs new file mode 100644 index 0000000..aaa9308 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ClosedLanes.cs @@ -0,0 +1,65 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "ClosedLanes", IsExtensible = true, IsSet = false)] + public class ClosedLanes : IASN1PreparedElement { + + private HardShoulderStatus hardShoulderStatus_ ; + + private bool hardShoulderStatus_present = false ; + + [ASN1Element ( Name = "hardShoulderStatus", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public HardShoulderStatus HardShoulderStatus + { + get { return hardShoulderStatus_; } + set { hardShoulderStatus_ = value; hardShoulderStatus_present = true; } + } + + + + private DrivingLaneStatus drivingLaneStatus_ ; + + [ASN1Element ( Name = "drivingLaneStatus", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DrivingLaneStatus DrivingLaneStatus + { + get { return drivingLaneStatus_; } + set { drivingLaneStatus_ = value; } + } + + + + public bool isHardShoulderStatusPresent () { + return this.hardShoulderStatus_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ClosedLanes)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs new file mode 100644 index 0000000..358edbf --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "CollisionRiskSubCauseCode" )] + public class CollisionRiskSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "CollisionRiskSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public CollisionRiskSubCauseCode() { + } + + public CollisionRiskSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CollisionRiskSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CoopAwareness.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CoopAwareness.cs new file mode 100644 index 0000000..1421f94 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CoopAwareness.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "CoopAwareness", IsExtensible = false, IsSet = false)] + public class CoopAwareness : IASN1PreparedElement { + + private GenerationDeltaTime generationDeltaTime_ ; + + [ASN1Element ( Name = "generationDeltaTime", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public GenerationDeltaTime GenerationDeltaTime + { + get { return generationDeltaTime_; } + set { generationDeltaTime_ = value; } + } + + + + private CamParameters camParameters_ ; + + [ASN1Element ( Name = "camParameters", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CamParameters CamParameters + { + get { return camParameters_; } + set { camParameters_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CoopAwareness)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Curvature.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Curvature.cs new file mode 100644 index 0000000..76c95c7 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Curvature.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "Curvature", IsExtensible = false, IsSet = false)] + public class Curvature : IASN1PreparedElement { + + private CurvatureValue curvatureValue_ ; + + [ASN1Element ( Name = "curvatureValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CurvatureValue CurvatureValue + { + get { return curvatureValue_; } + set { curvatureValue_ = value; } + } + + + + private CurvatureConfidence curvatureConfidence_ ; + + [ASN1Element ( Name = "curvatureConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CurvatureConfidence CurvatureConfidence + { + get { return curvatureConfidence_; } + set { curvatureConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Curvature)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs new file mode 100644 index 0000000..aa0d6b4 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "CurvatureCalculationMode", IsExtensible = true, NumRootElements = 3)] + public class CurvatureCalculationMode : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "yawRateUsed", HasTag = true , Tag = 0 )] + yawRateUsed , + [ASN1EnumItem ( Name = "yawRateNotUsed", HasTag = true , Tag = 1 )] + yawRateNotUsed , + [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 2 )] + unavailable , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CurvatureCalculationMode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs new file mode 100644 index 0000000..5f05aed --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs @@ -0,0 +1,62 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "CurvatureConfidence", IsExtensible = false, NumRootElements = 8)] + public class CurvatureConfidence : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "onePerMeter-0-00002", HasTag = true , Tag = 0 )] + onePerMeter_0_00002 , + [ASN1EnumItem ( Name = "onePerMeter-0-0001", HasTag = true , Tag = 1 )] + onePerMeter_0_0001 , + [ASN1EnumItem ( Name = "onePerMeter-0-0005", HasTag = true , Tag = 2 )] + onePerMeter_0_0005 , + [ASN1EnumItem ( Name = "onePerMeter-0-002", HasTag = true , Tag = 3 )] + onePerMeter_0_002 , + [ASN1EnumItem ( Name = "onePerMeter-0-01", HasTag = true , Tag = 4 )] + onePerMeter_0_01 , + [ASN1EnumItem ( Name = "onePerMeter-0-1", HasTag = true , Tag = 5 )] + onePerMeter_0_1 , + [ASN1EnumItem ( Name = "outOfRange", HasTag = true , Tag = 6 )] + outOfRange , + [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 7 )] + unavailable , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CurvatureConfidence)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs new file mode 100644 index 0000000..6d6e3e3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "CurvatureValue" )] + public class CurvatureValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "CurvatureValue" )] + [ASN1ValueRangeConstraint ( Min = -30000L, Max = 30001L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public CurvatureValue() { + } + + public CurvatureValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CurvatureValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs new file mode 100644 index 0000000..5ae2553 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "DangerousEndOfQueueSubCauseCode" )] + public class DangerousEndOfQueueSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "DangerousEndOfQueueSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public DangerousEndOfQueueSubCauseCode() { + } + + public DangerousEndOfQueueSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DangerousEndOfQueueSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs new file mode 100644 index 0000000..0dda795 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs @@ -0,0 +1,86 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "DangerousGoodsBasic", IsExtensible = false, NumRootElements = 20)] + public class DangerousGoodsBasic : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "explosives1", HasTag = true , Tag = 0 )] + explosives1 , + [ASN1EnumItem ( Name = "explosives2", HasTag = true , Tag = 1 )] + explosives2 , + [ASN1EnumItem ( Name = "explosives3", HasTag = true , Tag = 2 )] + explosives3 , + [ASN1EnumItem ( Name = "explosives4", HasTag = true , Tag = 3 )] + explosives4 , + [ASN1EnumItem ( Name = "explosives5", HasTag = true , Tag = 4 )] + explosives5 , + [ASN1EnumItem ( Name = "explosives6", HasTag = true , Tag = 5 )] + explosives6 , + [ASN1EnumItem ( Name = "flammableGases", HasTag = true , Tag = 6 )] + flammableGases , + [ASN1EnumItem ( Name = "nonFlammableGases", HasTag = true , Tag = 7 )] + nonFlammableGases , + [ASN1EnumItem ( Name = "toxicGases", HasTag = true , Tag = 8 )] + toxicGases , + [ASN1EnumItem ( Name = "flammableLiquids", HasTag = true , Tag = 9 )] + flammableLiquids , + [ASN1EnumItem ( Name = "flammableSolids", HasTag = true , Tag = 10 )] + flammableSolids , + [ASN1EnumItem ( Name = "substancesLiableToSpontaneousCombustion", HasTag = true , Tag = 11 )] + substancesLiableToSpontaneousCombustion , + [ASN1EnumItem ( Name = "substancesEmittingFlammableGasesUponContactWithWater", HasTag = true , Tag = 12 )] + substancesEmittingFlammableGasesUponContactWithWater , + [ASN1EnumItem ( Name = "oxidizingSubstances", HasTag = true , Tag = 13 )] + oxidizingSubstances , + [ASN1EnumItem ( Name = "organicPeroxides", HasTag = true , Tag = 14 )] + organicPeroxides , + [ASN1EnumItem ( Name = "toxicSubstances", HasTag = true , Tag = 15 )] + toxicSubstances , + [ASN1EnumItem ( Name = "infectiousSubstances", HasTag = true , Tag = 16 )] + infectiousSubstances , + [ASN1EnumItem ( Name = "radioactiveMaterial", HasTag = true , Tag = 17 )] + radioactiveMaterial , + [ASN1EnumItem ( Name = "corrosiveSubstances", HasTag = true , Tag = 18 )] + corrosiveSubstances , + [ASN1EnumItem ( Name = "miscellaneousDangerousSubstances", HasTag = true , Tag = 19 )] + miscellaneousDangerousSubstances , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DangerousGoodsBasic)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsContainer.cs new file mode 100644 index 0000000..3b0683f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsContainer.cs @@ -0,0 +1,47 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "DangerousGoodsContainer", IsExtensible = false, IsSet = false)] + public class DangerousGoodsContainer : IASN1PreparedElement { + + private DangerousGoodsBasic dangerousGoodsBasic_ ; + + [ASN1Element ( Name = "dangerousGoodsBasic", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DangerousGoodsBasic DangerousGoodsBasic + { + get { return dangerousGoodsBasic_; } + set { dangerousGoodsBasic_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DangerousGoodsContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsExtended.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsExtended.cs new file mode 100644 index 0000000..4447ca7 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsExtended.cs @@ -0,0 +1,160 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "DangerousGoodsExtended", IsExtensible = false, IsSet = false)] + public class DangerousGoodsExtended : IASN1PreparedElement { + + private DangerousGoodsBasic dangerousGoodsType_ ; + + [ASN1Element ( Name = "dangerousGoodsType", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DangerousGoodsBasic DangerousGoodsType + { + get { return dangerousGoodsType_; } + set { dangerousGoodsType_ = value; } + } + + + + private int unNumber_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 9999L, IsExtensible = false) ] + + [ASN1Element ( Name = "unNumber", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public int UnNumber + { + get { return unNumber_; } + set { unNumber_ = value; } + } + + + + private bool elevatedTemperature_ ; + [ASN1Boolean( Name = "" )] + + [ASN1Element ( Name = "elevatedTemperature", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public bool ElevatedTemperature + { + get { return elevatedTemperature_; } + set { elevatedTemperature_ = value; } + } + + + + private bool tunnelsRestricted_ ; + [ASN1Boolean( Name = "" )] + + [ASN1Element ( Name = "tunnelsRestricted", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public bool TunnelsRestricted + { + get { return tunnelsRestricted_; } + set { tunnelsRestricted_ = value; } + } + + + + private bool limitedQuantity_ ; + [ASN1Boolean( Name = "" )] + + [ASN1Element ( Name = "limitedQuantity", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public bool LimitedQuantity + { + get { return limitedQuantity_; } + set { limitedQuantity_ = value; } + } + + + + private string emergencyActionCode_ ; + + private bool emergencyActionCode_present = false ; + [ASN1String( Name = "", + StringType = UniversalTags.IA5String , IsUCS = false )][ASN1ValueRangeConstraint ( Min = 1L, Max = 24L, IsExtensible = false) ] + + [ASN1Element ( Name = "emergencyActionCode", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public string EmergencyActionCode + { + get { return emergencyActionCode_; } + set { emergencyActionCode_ = value; emergencyActionCode_present = true; } + } + + + + private string phoneNumber_ ; + + private bool phoneNumber_present = false ; + [ASN1String( Name = "", + StringType = UniversalTags.IA5String , IsUCS = false )][ASN1ValueRangeConstraint ( Min = 1L, Max = 24L, IsExtensible = false) ] + + [ASN1Element ( Name = "phoneNumber", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public string PhoneNumber + { + get { return phoneNumber_; } + set { phoneNumber_ = value; phoneNumber_present = true; } + } + + + + private string companyName_ ; + + private bool companyName_present = false ; + [ASN1String( Name = "", + StringType = UniversalTags.UTF8String , IsUCS = false )][ASN1ValueRangeConstraint ( Min = 1L, Max = 24L, IsExtensible = false) ] + + [ASN1Element ( Name = "companyName", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public string CompanyName + { + get { return companyName_; } + set { companyName_ = value; companyName_present = true; } + } + + + + public bool isEmergencyActionCodePresent () { + return this.emergencyActionCode_present == true; + } + + public bool isPhoneNumberPresent () { + return this.phoneNumber_present == true; + } + + public bool isCompanyNamePresent () { + return this.companyName_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DangerousGoodsExtended)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs new file mode 100644 index 0000000..e3972eb --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "DangerousSituationSubCauseCode" )] + public class DangerousSituationSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "DangerousSituationSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public DangerousSituationSubCauseCode() { + } + + public DangerousSituationSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DangerousSituationSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs new file mode 100644 index 0000000..63ce6d4 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "DeltaAltitude" )] + public class DeltaAltitude: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "DeltaAltitude" )] + [ASN1ValueRangeConstraint ( Min = -12700L, Max = 12800L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public DeltaAltitude() { + } + + public DeltaAltitude(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DeltaAltitude)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs new file mode 100644 index 0000000..39edff7 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "DeltaLatitude" )] + public class DeltaLatitude: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "DeltaLatitude" )] + [ASN1ValueRangeConstraint ( Min = -131071L, Max = 131072L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public DeltaLatitude() { + } + + public DeltaLatitude(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DeltaLatitude)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs new file mode 100644 index 0000000..2c5e6b0 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "DeltaLongitude" )] + public class DeltaLongitude: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "DeltaLongitude" )] + [ASN1ValueRangeConstraint ( Min = -131071L, Max = 131072L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public DeltaLongitude() { + } + + public DeltaLongitude(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DeltaLongitude)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaReferencePosition.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaReferencePosition.cs new file mode 100644 index 0000000..9ab0f56 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaReferencePosition.cs @@ -0,0 +1,71 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "DeltaReferencePosition", IsExtensible = false, IsSet = false)] + public class DeltaReferencePosition : IASN1PreparedElement { + + private DeltaLatitude deltaLatitude_ ; + + [ASN1Element ( Name = "deltaLatitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DeltaLatitude DeltaLatitude + { + get { return deltaLatitude_; } + set { deltaLatitude_ = value; } + } + + + + private DeltaLongitude deltaLongitude_ ; + + [ASN1Element ( Name = "deltaLongitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DeltaLongitude DeltaLongitude + { + get { return deltaLongitude_; } + set { deltaLongitude_ = value; } + } + + + + private DeltaAltitude deltaAltitude_ ; + + [ASN1Element ( Name = "deltaAltitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DeltaAltitude DeltaAltitude + { + get { return deltaAltitude_; } + set { deltaAltitude_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DeltaReferencePosition)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs new file mode 100644 index 0000000..dd68ae9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "DriveDirection", IsExtensible = false, NumRootElements = 3)] + public class DriveDirection : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "forward", HasTag = true , Tag = 0 )] + forward , + [ASN1EnumItem ( Name = "backward", HasTag = true , Tag = 1 )] + backward , + [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 2 )] + unavailable , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DriveDirection)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DrivingLaneStatus.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DrivingLaneStatus.cs new file mode 100644 index 0000000..3d01dc6 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DrivingLaneStatus.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "DrivingLaneStatus") ] + public class DrivingLaneStatus : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "DrivingLaneStatus") ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 14L, IsExtensible = false) ] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public DrivingLaneStatus() { + } + + public DrivingLaneStatus(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(DrivingLaneStatus)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs new file mode 100644 index 0000000..31a5681 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "EmbarkationStatus") ] + public class EmbarkationStatus: IASN1PreparedElement { + + private bool? val = null; + + [ASN1Boolean ( Name = "EmbarkationStatus") ] + + public bool? Value + { + get { return val; } + set { val = value; } + } + + public EmbarkationStatus() { + } + + public EmbarkationStatus(bool value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(EmbarkationStatus)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs new file mode 100644 index 0000000..e8b89cb --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs @@ -0,0 +1,83 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "EmergencyContainer", IsExtensible = false, IsSet = false)] + public class EmergencyContainer : IASN1PreparedElement { + + private LightBarSirenInUse lightBarSirenInUse_ ; + + [ASN1Element ( Name = "lightBarSirenInUse", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LightBarSirenInUse LightBarSirenInUse + { + get { return lightBarSirenInUse_; } + set { lightBarSirenInUse_ = value; } + } + + + + private CauseCodeClass incidentIndication_ ; + + private bool incidentIndication_present = false ; + + [ASN1Element ( Name = "incidentIndication", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CauseCodeClass IncidentIndication + { + get { return incidentIndication_; } + set { incidentIndication_ = value; incidentIndication_present = true; } + } + + + + private EmergencyPriority emergencyPriority_ ; + + private bool emergencyPriority_present = false ; + + [ASN1Element ( Name = "emergencyPriority", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public EmergencyPriority EmergencyPriority + { + get { return emergencyPriority_; } + set { emergencyPriority_ = value; emergencyPriority_present = true; } + } + + + + public bool isIncidentIndicationPresent () { + return this.incidentIndication_present == true; + } + + public bool isEmergencyPriorityPresent () { + return this.emergencyPriority_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(EmergencyContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyPriority.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyPriority.cs new file mode 100644 index 0000000..73d94f5 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyPriority.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "EmergencyPriority") ] + public class EmergencyPriority : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "EmergencyPriority") ] + + [ASN1SizeConstraint ( Max = 2L )] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public EmergencyPriority() { + } + + public EmergencyPriority(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(EmergencyPriority)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs new file mode 100644 index 0000000..90b89e1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "EmergencyVehicleApproachingSubCauseCode" )] + public class EmergencyVehicleApproachingSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "EmergencyVehicleApproachingSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public EmergencyVehicleApproachingSubCauseCode() { + } + + public EmergencyVehicleApproachingSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(EmergencyVehicleApproachingSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EnergyStorageType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EnergyStorageType.cs new file mode 100644 index 0000000..779b32f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EnergyStorageType.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "EnergyStorageType") ] + public class EnergyStorageType : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "EnergyStorageType") ] + + [ASN1SizeConstraint ( Max = 7L )] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public EnergyStorageType() { + } + + public EnergyStorageType(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(EnergyStorageType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventHistory.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventHistory.cs new file mode 100644 index 0000000..833abfd --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventHistory.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "EventHistory" ) ] + public class EventHistory : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 1L, Max = 23L, IsExtensible = false) ] + + [ASN1SequenceOf( Name = "EventHistory", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(EventPoint item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(EventHistory)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventPoint.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventPoint.cs new file mode 100644 index 0000000..a8cc689 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EventPoint.cs @@ -0,0 +1,77 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "EventPoint", IsExtensible = false, IsSet = false)] + public class EventPoint : IASN1PreparedElement { + + private DeltaReferencePosition eventPosition_ ; + + [ASN1Element ( Name = "eventPosition", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DeltaReferencePosition EventPosition + { + get { return eventPosition_; } + set { eventPosition_ = value; } + } + + + + private PathDeltaTime eventDeltaTime_ ; + + private bool eventDeltaTime_present = false ; + + [ASN1Element ( Name = "eventDeltaTime", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PathDeltaTime EventDeltaTime + { + get { return eventDeltaTime_; } + set { eventDeltaTime_ = value; eventDeltaTime_present = true; } + } + + + + private InformationQuality informationQuality_ ; + + [ASN1Element ( Name = "informationQuality", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public InformationQuality InformationQuality + { + get { return informationQuality_; } + set { informationQuality_ = value; } + } + + + + public bool isEventDeltaTimePresent () { + return this.eventDeltaTime_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(EventPoint)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ExteriorLights.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ExteriorLights.cs new file mode 100644 index 0000000..362fabf --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ExteriorLights.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ExteriorLights") ] + public class ExteriorLights : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "ExteriorLights") ] + + [ASN1SizeConstraint ( Max = 8L )] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public ExteriorLights() { + } + + public ExteriorLights(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ExteriorLights)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs new file mode 100644 index 0000000..350c069 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "GenerationDeltaTime" )] + public class GenerationDeltaTime: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "GenerationDeltaTime" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 65535L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public GenerationDeltaTime() { + } + + public GenerationDeltaTime(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(GenerationDeltaTime)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs new file mode 100644 index 0000000..661809d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "HardShoulderStatus", IsExtensible = false, NumRootElements = 3)] + public class HardShoulderStatus : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "availableForStopping", HasTag = true , Tag = 0 )] + availableForStopping , + [ASN1EnumItem ( Name = "closed", HasTag = true , Tag = 1 )] + closed , + [ASN1EnumItem ( Name = "availableForDriving", HasTag = true , Tag = 2 )] + availableForDriving , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HardShoulderStatus)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs new file mode 100644 index 0000000..d5b0dae --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HazardousLocation_AnimalOnTheRoadSubCauseCode" )] + public class HazardousLocation_AnimalOnTheRoadSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HazardousLocation-AnimalOnTheRoadSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HazardousLocation_AnimalOnTheRoadSubCauseCode() { + } + + public HazardousLocation_AnimalOnTheRoadSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HazardousLocation_AnimalOnTheRoadSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs new file mode 100644 index 0000000..1570eaf --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HazardousLocation_DangerousCurveSubCauseCode" )] + public class HazardousLocation_DangerousCurveSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HazardousLocation-DangerousCurveSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HazardousLocation_DangerousCurveSubCauseCode() { + } + + public HazardousLocation_DangerousCurveSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HazardousLocation_DangerousCurveSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs new file mode 100644 index 0000000..b6cf2c8 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HazardousLocation_ObstacleOnTheRoadSubCauseCode" )] + public class HazardousLocation_ObstacleOnTheRoadSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HazardousLocation-ObstacleOnTheRoadSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HazardousLocation_ObstacleOnTheRoadSubCauseCode() { + } + + public HazardousLocation_ObstacleOnTheRoadSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HazardousLocation_ObstacleOnTheRoadSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs new file mode 100644 index 0000000..7f99be3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HazardousLocation_SurfaceConditionSubCauseCode" )] + public class HazardousLocation_SurfaceConditionSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HazardousLocation-SurfaceConditionSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HazardousLocation_SurfaceConditionSubCauseCode() { + } + + public HazardousLocation_SurfaceConditionSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HazardousLocation_SurfaceConditionSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Heading.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Heading.cs new file mode 100644 index 0000000..049bdef --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Heading.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "Heading", IsExtensible = false, IsSet = false)] + public class Heading : IASN1PreparedElement { + + private HeadingValue headingValue_ ; + + [ASN1Element ( Name = "headingValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public HeadingValue HeadingValue + { + get { return headingValue_; } + set { headingValue_ = value; } + } + + + + private HeadingConfidence headingConfidence_ ; + + [ASN1Element ( Name = "headingConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public HeadingConfidence HeadingConfidence + { + get { return headingConfidence_; } + set { headingConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Heading)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs new file mode 100644 index 0000000..02bd2e9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HeadingConfidence" )] + public class HeadingConfidence: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HeadingConfidence" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HeadingConfidence() { + } + + public HeadingConfidence(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HeadingConfidence)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs new file mode 100644 index 0000000..b44bfcf --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HeadingValue" )] + public class HeadingValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HeadingValue" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 3601L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HeadingValue() { + } + + public HeadingValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HeadingValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs new file mode 100644 index 0000000..b22ec22 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HeightLonCarr" )] + public class HeightLonCarr: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HeightLonCarr" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 100L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HeightLonCarr() { + } + + public HeightLonCarr(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HeightLonCarr)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HighFrequencyContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HighFrequencyContainer.cs new file mode 100644 index 0000000..7a0043e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HighFrequencyContainer.cs @@ -0,0 +1,100 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Choice ( Name = "HighFrequencyContainer", IsExtensible = true) ] + public class HighFrequencyContainer : IASN1PreparedElement { + + + private BasicVehicleContainerHighFrequency basicVehicleContainerHighFrequency_ ; + private bool basicVehicleContainerHighFrequency_selected = false ; + + + + [ASN1Element ( Name = "basicVehicleContainerHighFrequency", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public BasicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency + { + get { return basicVehicleContainerHighFrequency_; } + set { selectBasicVehicleContainerHighFrequency(value); } + } + + + + + private RSUContainerHighFrequency rsuContainerHighFrequency_ ; + private bool rsuContainerHighFrequency_selected = false ; + + + + [ASN1Element ( Name = "rsuContainerHighFrequency", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public RSUContainerHighFrequency RsuContainerHighFrequency + { + get { return rsuContainerHighFrequency_; } + set { selectRsuContainerHighFrequency(value); } + } + + + + public bool isBasicVehicleContainerHighFrequencySelected () { + return this.basicVehicleContainerHighFrequency_selected ; + } + + + + + public void selectBasicVehicleContainerHighFrequency (BasicVehicleContainerHighFrequency val) { + this.basicVehicleContainerHighFrequency_ = val; + this.basicVehicleContainerHighFrequency_selected = true; + + + this.rsuContainerHighFrequency_selected = false; + + } + + + public bool isRsuContainerHighFrequencySelected () { + return this.rsuContainerHighFrequency_selected ; + } + + + + + public void selectRsuContainerHighFrequency (RSUContainerHighFrequency val) { + this.rsuContainerHighFrequency_ = val; + this.rsuContainerHighFrequency_selected = true; + + + this.basicVehicleContainerHighFrequency_selected = false; + + } + + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HighFrequencyContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs new file mode 100644 index 0000000..3de7a3d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HumanPresenceOnTheRoadSubCauseCode" )] + public class HumanPresenceOnTheRoadSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HumanPresenceOnTheRoadSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HumanPresenceOnTheRoadSubCauseCode() { + } + + public HumanPresenceOnTheRoadSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HumanPresenceOnTheRoadSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs new file mode 100644 index 0000000..32ce86a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HumanProblemSubCauseCode" )] + public class HumanProblemSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "HumanProblemSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public HumanProblemSubCauseCode() { + } + + public HumanProblemSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(HumanProblemSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs new file mode 100644 index 0000000..bd4c277 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "InformationQuality" )] + public class InformationQuality: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "InformationQuality" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 7L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public InformationQuality() { + } + + public InformationQuality(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(InformationQuality)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItineraryPath.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItineraryPath.cs new file mode 100644 index 0000000..3951136 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItineraryPath.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ItineraryPath" ) ] + public class ItineraryPath : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 1L, Max = 40L, IsExtensible = false) ] + + [ASN1SequenceOf( Name = "ItineraryPath", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(ReferencePosition item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ItineraryPath)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItsPduHeader.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItsPduHeader.cs new file mode 100644 index 0000000..b0a2a08 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ItsPduHeader.cs @@ -0,0 +1,75 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "ItsPduHeader", IsExtensible = false, IsSet = false)] + public class ItsPduHeader : IASN1PreparedElement { + + private int protocolVersion_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + [ASN1Element ( Name = "protocolVersion", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public int ProtocolVersion + { + get { return protocolVersion_; } + set { protocolVersion_ = value; } + } + + + + private int messageID_ ; + [ASN1Integer( Name = "" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + [ASN1Element ( Name = "messageID", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public int MessageID + { + get { return messageID_; } + set { messageID_ = value; } + } + + + + private StationID stationID_ ; + + [ASN1Element ( Name = "stationID", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public StationID StationID + { + get { return stationID_; } + set { stationID_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ItsPduHeader)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs new file mode 100644 index 0000000..a8e0131 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "LanePosition" )] + public class LanePosition: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "LanePosition" )] + [ASN1ValueRangeConstraint ( Min = -1L, Max = 14L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public LanePosition() { + } + + public LanePosition(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(LanePosition)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAcceleration.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAcceleration.cs new file mode 100644 index 0000000..5a4d148 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAcceleration.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "LateralAcceleration", IsExtensible = false, IsSet = false)] + public class LateralAcceleration : IASN1PreparedElement { + + private LateralAccelerationValue lateralAccelerationValue_ ; + + [ASN1Element ( Name = "lateralAccelerationValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LateralAccelerationValue LateralAccelerationValue + { + get { return lateralAccelerationValue_; } + set { lateralAccelerationValue_ = value; } + } + + + + private AccelerationConfidence lateralAccelerationConfidence_ ; + + [ASN1Element ( Name = "lateralAccelerationConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public AccelerationConfidence LateralAccelerationConfidence + { + get { return lateralAccelerationConfidence_; } + set { lateralAccelerationConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(LateralAcceleration)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs new file mode 100644 index 0000000..e32766b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "LateralAccelerationValue" )] + public class LateralAccelerationValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "LateralAccelerationValue" )] + [ASN1ValueRangeConstraint ( Min = -160L, Max = 161L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public LateralAccelerationValue() { + } + + public LateralAccelerationValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(LateralAccelerationValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs new file mode 100644 index 0000000..431f141 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "Latitude" )] + public class Latitude: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "Latitude" )] + [ASN1ValueRangeConstraint ( Min = -900000000L, Max = 900000001L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public Latitude() { + } + + public Latitude(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Latitude)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LightBarSirenInUse.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LightBarSirenInUse.cs new file mode 100644 index 0000000..eeadd42 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LightBarSirenInUse.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "LightBarSirenInUse") ] + public class LightBarSirenInUse : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "LightBarSirenInUse") ] + + [ASN1SizeConstraint ( Max = 2L )] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public LightBarSirenInUse() { + } + + public LightBarSirenInUse(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(LightBarSirenInUse)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs new file mode 100644 index 0000000..dff52e9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "Longitude" )] + public class Longitude: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "Longitude" )] + [ASN1ValueRangeConstraint ( Min = -1800000000L, Max = 1800000001L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public Longitude() { + } + + public Longitude(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Longitude)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAcceleration.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAcceleration.cs new file mode 100644 index 0000000..61a4b0e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAcceleration.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "LongitudinalAcceleration", IsExtensible = false, IsSet = false)] + public class LongitudinalAcceleration : IASN1PreparedElement { + + private LongitudinalAccelerationValue longitudinalAccelerationValue_ ; + + [ASN1Element ( Name = "longitudinalAccelerationValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LongitudinalAccelerationValue LongitudinalAccelerationValue + { + get { return longitudinalAccelerationValue_; } + set { longitudinalAccelerationValue_ = value; } + } + + + + private AccelerationConfidence longitudinalAccelerationConfidence_ ; + + [ASN1Element ( Name = "longitudinalAccelerationConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public AccelerationConfidence LongitudinalAccelerationConfidence + { + get { return longitudinalAccelerationConfidence_; } + set { longitudinalAccelerationConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(LongitudinalAcceleration)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs new file mode 100644 index 0000000..f233e2b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "LongitudinalAccelerationValue" )] + public class LongitudinalAccelerationValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "LongitudinalAccelerationValue" )] + [ASN1ValueRangeConstraint ( Min = -160L, Max = 161L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public LongitudinalAccelerationValue() { + } + + public LongitudinalAccelerationValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(LongitudinalAccelerationValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LowFrequencyContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LowFrequencyContainer.cs new file mode 100644 index 0000000..bb59365 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LowFrequencyContainer.cs @@ -0,0 +1,65 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Choice ( Name = "LowFrequencyContainer", IsExtensible = true) ] + public class LowFrequencyContainer : IASN1PreparedElement { + + + private BasicVehicleContainerLowFrequency basicVehicleContainerLowFrequency_ ; + private bool basicVehicleContainerLowFrequency_selected = false ; + + + + [ASN1Element ( Name = "basicVehicleContainerLowFrequency", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public BasicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency + { + get { return basicVehicleContainerLowFrequency_; } + set { selectBasicVehicleContainerLowFrequency(value); } + } + + + + public bool isBasicVehicleContainerLowFrequencySelected () { + return this.basicVehicleContainerLowFrequency_selected ; + } + + + + + public void selectBasicVehicleContainerLowFrequency (BasicVehicleContainerLowFrequency val) { + this.basicVehicleContainerLowFrequency_ = val; + this.basicVehicleContainerLowFrequency_selected = true; + + + } + + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(LowFrequencyContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs new file mode 100644 index 0000000..a1c5c8d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "NumberOfOccupants" )] + public class NumberOfOccupants: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "NumberOfOccupants" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 127L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public NumberOfOccupants() { + } + + public NumberOfOccupants(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(NumberOfOccupants)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs new file mode 100644 index 0000000..f98dec5 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PathDeltaTime" )] + public class PathDeltaTime: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PathDeltaTime" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 65535L, IsExtensible = true) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PathDeltaTime() { + } + + public PathDeltaTime(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PathDeltaTime)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathHistory.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathHistory.cs new file mode 100644 index 0000000..f1de464 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathHistory.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PathHistory" ) ] + public class PathHistory : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 0L, Max = 40L, IsExtensible = false) ] + + [ASN1SequenceOf( Name = "PathHistory", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(PathPoint item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PathHistory)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathPoint.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathPoint.cs new file mode 100644 index 0000000..09ba39b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathPoint.cs @@ -0,0 +1,65 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "PathPoint", IsExtensible = false, IsSet = false)] + public class PathPoint : IASN1PreparedElement { + + private DeltaReferencePosition pathPosition_ ; + + [ASN1Element ( Name = "pathPosition", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DeltaReferencePosition PathPosition + { + get { return pathPosition_; } + set { pathPosition_ = value; } + } + + + + private PathDeltaTime pathDeltaTime_ ; + + private bool pathDeltaTime_present = false ; + + [ASN1Element ( Name = "pathDeltaTime", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PathDeltaTime PathDeltaTime + { + get { return pathDeltaTime_; } + set { pathDeltaTime_ = value; pathDeltaTime_present = true; } + } + + + + public bool isPathDeltaTimePresent () { + return this.pathDeltaTime_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PathPoint)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs new file mode 100644 index 0000000..d5942ae --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PerformanceClass" )] + public class PerformanceClass: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PerformanceClass" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 7L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PerformanceClass() { + } + + public PerformanceClass(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PerformanceClass)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs new file mode 100644 index 0000000..40b3abb --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PosCentMass" )] + public class PosCentMass: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PosCentMass" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 63L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PosCentMass() { + } + + public PosCentMass(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PosCentMass)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosConfidenceEllipse.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosConfidenceEllipse.cs new file mode 100644 index 0000000..9f6865e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosConfidenceEllipse.cs @@ -0,0 +1,71 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "PosConfidenceEllipse", IsExtensible = false, IsSet = false)] + public class PosConfidenceEllipse : IASN1PreparedElement { + + private SemiAxisLength semiMajorConfidence_ ; + + [ASN1Element ( Name = "semiMajorConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SemiAxisLength SemiMajorConfidence + { + get { return semiMajorConfidence_; } + set { semiMajorConfidence_ = value; } + } + + + + private SemiAxisLength semiMinorConfidence_ ; + + [ASN1Element ( Name = "semiMinorConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SemiAxisLength SemiMinorConfidence + { + get { return semiMinorConfidence_; } + set { semiMinorConfidence_ = value; } + } + + + + private HeadingValue semiMajorOrientation_ ; + + [ASN1Element ( Name = "semiMajorOrientation", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public HeadingValue SemiMajorOrientation + { + get { return semiMajorOrientation_; } + set { semiMajorOrientation_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PosConfidenceEllipse)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs new file mode 100644 index 0000000..e3582aa --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PosFrontAx" )] + public class PosFrontAx: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PosFrontAx" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 20L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PosFrontAx() { + } + + public PosFrontAx(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PosFrontAx)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs new file mode 100644 index 0000000..ef5e09c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PosLonCarr" )] + public class PosLonCarr: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PosLonCarr" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PosLonCarr() { + } + + public PosLonCarr(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PosLonCarr)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs new file mode 100644 index 0000000..b9b95f9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PosPillar" )] + public class PosPillar: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PosPillar" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 30L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PosPillar() { + } + + public PosPillar(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PosPillar)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfOccupants.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfOccupants.cs new file mode 100644 index 0000000..8c41c6a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfOccupants.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PositionOfOccupants") ] + public class PositionOfOccupants : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "PositionOfOccupants") ] + + [ASN1SizeConstraint ( Max = 20L )] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public PositionOfOccupants() { + } + + public PositionOfOccupants(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PositionOfOccupants)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfPillars.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfPillars.cs new file mode 100644 index 0000000..da34748 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositionOfPillars.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PositionOfPillars" ) ] + public class PositionOfPillars : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 1L, Max = 3L, IsExtensible = true) ] + + [ASN1SequenceOf( Name = "PositionOfPillars", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(PosPillar item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PositionOfPillars)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs new file mode 100644 index 0000000..192b347 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs @@ -0,0 +1,58 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "PositioningSolutionType", IsExtensible = true, NumRootElements = 6)] + public class PositioningSolutionType : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "noPositioningSolution", HasTag = true , Tag = 0 )] + noPositioningSolution , + [ASN1EnumItem ( Name = "sGNSS", HasTag = true , Tag = 1 )] + sGNSS , + [ASN1EnumItem ( Name = "dGNSS", HasTag = true , Tag = 2 )] + dGNSS , + [ASN1EnumItem ( Name = "sGNSSplusDR", HasTag = true , Tag = 3 )] + sGNSSplusDR , + [ASN1EnumItem ( Name = "dGNSSplusDR", HasTag = true , Tag = 4 )] + dGNSSplusDR , + [ASN1EnumItem ( Name = "dR", HasTag = true , Tag = 5 )] + dR , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PositioningSolutionType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs new file mode 100644 index 0000000..f4179b3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PostCrashSubCauseCode" )] + public class PostCrashSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PostCrashSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PostCrashSubCauseCode() { + } + + public PostCrashSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PostCrashSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZone.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZone.cs new file mode 100644 index 0000000..eed131d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZone.cs @@ -0,0 +1,125 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "ProtectedCommunicationZone", IsExtensible = false, IsSet = false)] + public class ProtectedCommunicationZone : IASN1PreparedElement { + + private ProtectedZoneType protectedZoneType_ ; + + [ASN1Element ( Name = "protectedZoneType", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ProtectedZoneType ProtectedZoneType + { + get { return protectedZoneType_; } + set { protectedZoneType_ = value; } + } + + + + private TimestampIts expiryTime_ ; + + private bool expiryTime_present = false ; + + [ASN1Element ( Name = "expiryTime", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public TimestampIts ExpiryTime + { + get { return expiryTime_; } + set { expiryTime_ = value; expiryTime_present = true; } + } + + + + private Latitude protectedZoneLatitude_ ; + + [ASN1Element ( Name = "protectedZoneLatitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Latitude ProtectedZoneLatitude + { + get { return protectedZoneLatitude_; } + set { protectedZoneLatitude_ = value; } + } + + + + private Longitude protectedZoneLongitude_ ; + + [ASN1Element ( Name = "protectedZoneLongitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Longitude ProtectedZoneLongitude + { + get { return protectedZoneLongitude_; } + set { protectedZoneLongitude_ = value; } + } + + + + private ProtectedZoneRadius protectedZoneRadius_ ; + + private bool protectedZoneRadius_present = false ; + + [ASN1Element ( Name = "protectedZoneRadius", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ProtectedZoneRadius ProtectedZoneRadius + { + get { return protectedZoneRadius_; } + set { protectedZoneRadius_ = value; protectedZoneRadius_present = true; } + } + + + + private ProtectedZoneID protectedZoneID_ ; + + private bool protectedZoneID_present = false ; + + [ASN1Element ( Name = "protectedZoneID", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ProtectedZoneID ProtectedZoneID + { + get { return protectedZoneID_; } + set { protectedZoneID_ = value; protectedZoneID_present = true; } + } + + + + public bool isExpiryTimePresent () { + return this.expiryTime_present == true; + } + + public bool isProtectedZoneRadiusPresent () { + return this.protectedZoneRadius_present == true; + } + + public bool isProtectedZoneIDPresent () { + return this.protectedZoneID_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ProtectedCommunicationZone)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZonesRSU.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZonesRSU.cs new file mode 100644 index 0000000..c4ac016 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedCommunicationZonesRSU.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ProtectedCommunicationZonesRSU" ) ] + public class ProtectedCommunicationZonesRSU : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 1L, Max = 16L, IsExtensible = false) ] + + [ASN1SequenceOf( Name = "ProtectedCommunicationZonesRSU", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(ProtectedCommunicationZone item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ProtectedCommunicationZonesRSU)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs new file mode 100644 index 0000000..ee2490c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ProtectedZoneID" )] + public class ProtectedZoneID: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "ProtectedZoneID" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 134217727L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public ProtectedZoneID() { + } + + public ProtectedZoneID(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ProtectedZoneID)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs new file mode 100644 index 0000000..28b2ded --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ProtectedZoneRadius" )] + public class ProtectedZoneRadius: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "ProtectedZoneRadius" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 255L, IsExtensible = true) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public ProtectedZoneRadius() { + } + + public ProtectedZoneRadius(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ProtectedZoneRadius)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs new file mode 100644 index 0000000..02f47a9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs @@ -0,0 +1,48 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "ProtectedZoneType", IsExtensible = true, NumRootElements = 1)] + public class ProtectedZoneType : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "cenDsrcTolling", HasTag = true , Tag = 0 )] + cenDsrcTolling , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ProtectedZoneType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivation.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivation.cs new file mode 100644 index 0000000..a342275 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivation.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "PtActivation", IsExtensible = false, IsSet = false)] + public class PtActivation : IASN1PreparedElement { + + private PtActivationType ptActivationType_ ; + + [ASN1Element ( Name = "ptActivationType", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PtActivationType PtActivationType + { + get { return ptActivationType_; } + set { ptActivationType_ = value; } + } + + + + private PtActivationData ptActivationData_ ; + + [ASN1Element ( Name = "ptActivationData", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PtActivationData PtActivationData + { + get { return ptActivationData_; } + set { ptActivationData_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PtActivation)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationData.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationData.cs new file mode 100644 index 0000000..d852547 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationData.cs @@ -0,0 +1,56 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PtActivationData") ] + public class PtActivationData: IASN1PreparedElement { + + private byte[] val = null; + + [ASN1OctetString( Name = "PtActivationData") ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 20L, IsExtensible = false) ] + + public byte[] Value + { + get { return val; } + set { val = value; } + } + + public PtActivationData() { + } + + public PtActivationData(byte[] value) { + this.Value = value; + } + + public PtActivationData(BitString value) { + this.Value = value.Value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PtActivationData)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs new file mode 100644 index 0000000..d17bf1c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "PtActivationType" )] + public class PtActivationType: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "PtActivationType" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public PtActivationType() { + } + + public PtActivationType(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PtActivationType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PublicTransportContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PublicTransportContainer.cs new file mode 100644 index 0000000..631eb33 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PublicTransportContainer.cs @@ -0,0 +1,65 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "PublicTransportContainer", IsExtensible = false, IsSet = false)] + public class PublicTransportContainer : IASN1PreparedElement { + + private EmbarkationStatus embarkationStatus_ ; + + [ASN1Element ( Name = "embarkationStatus", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public EmbarkationStatus EmbarkationStatus + { + get { return embarkationStatus_; } + set { embarkationStatus_ = value; } + } + + + + private PtActivation ptActivation_ ; + + private bool ptActivation_present = false ; + + [ASN1Element ( Name = "ptActivation", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PtActivation PtActivation + { + get { return ptActivation_; } + set { ptActivation_ = value; ptActivation_present = true; } + } + + + + public bool isPtActivationPresent () { + return this.ptActivation_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(PublicTransportContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RSUContainerHighFrequency.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RSUContainerHighFrequency.cs new file mode 100644 index 0000000..63efffa --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RSUContainerHighFrequency.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "RSUContainerHighFrequency", IsExtensible = true, IsSet = false)] + public class RSUContainerHighFrequency : IASN1PreparedElement { + + private ProtectedCommunicationZonesRSU protectedCommunicationZonesRSU_ ; + + private bool protectedCommunicationZonesRSU_present = false ; + + [ASN1Element ( Name = "protectedCommunicationZonesRSU", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ProtectedCommunicationZonesRSU ProtectedCommunicationZonesRSU + { + get { return protectedCommunicationZonesRSU_; } + set { protectedCommunicationZonesRSU_ = value; protectedCommunicationZonesRSU_present = true; } + } + + + + public bool isProtectedCommunicationZonesRSUPresent () { + return this.protectedCommunicationZonesRSU_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RSUContainerHighFrequency)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ReferencePosition.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ReferencePosition.cs new file mode 100644 index 0000000..7a67df7 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ReferencePosition.cs @@ -0,0 +1,83 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "ReferencePosition", IsExtensible = false, IsSet = false)] + public class ReferencePosition : IASN1PreparedElement { + + private Latitude latitude_ ; + + [ASN1Element ( Name = "latitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Latitude Latitude + { + get { return latitude_; } + set { latitude_ = value; } + } + + + + private Longitude longitude_ ; + + [ASN1Element ( Name = "longitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Longitude Longitude + { + get { return longitude_; } + set { longitude_ = value; } + } + + + + private PosConfidenceEllipse positionConfidenceEllipse_ ; + + [ASN1Element ( Name = "positionConfidenceEllipse", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PosConfidenceEllipse PositionConfidenceEllipse + { + get { return positionConfidenceEllipse_; } + set { positionConfidenceEllipse_ = value; } + } + + + + private Altitude altitude_ ; + + [ASN1Element ( Name = "altitude", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public Altitude Altitude + { + get { return altitude_; } + set { altitude_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ReferencePosition)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs new file mode 100644 index 0000000..8248d93 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs @@ -0,0 +1,62 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "RelevanceDistance", IsExtensible = false, NumRootElements = 8)] + public class RelevanceDistance : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "lessThan50m", HasTag = true , Tag = 0 )] + lessThan50m , + [ASN1EnumItem ( Name = "lessThan100m", HasTag = true , Tag = 1 )] + lessThan100m , + [ASN1EnumItem ( Name = "lessThan200m", HasTag = true , Tag = 2 )] + lessThan200m , + [ASN1EnumItem ( Name = "lessThan500m", HasTag = true , Tag = 3 )] + lessThan500m , + [ASN1EnumItem ( Name = "lessThan1000m", HasTag = true , Tag = 4 )] + lessThan1000m , + [ASN1EnumItem ( Name = "lessThan5km", HasTag = true , Tag = 5 )] + lessThan5km , + [ASN1EnumItem ( Name = "lessThan10km", HasTag = true , Tag = 6 )] + lessThan10km , + [ASN1EnumItem ( Name = "over10km", HasTag = true , Tag = 7 )] + over10km , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RelevanceDistance)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs new file mode 100644 index 0000000..7d6035e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "RelevanceTrafficDirection", IsExtensible = false, NumRootElements = 4)] + public class RelevanceTrafficDirection : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "allTrafficDirections", HasTag = true , Tag = 0 )] + allTrafficDirections , + [ASN1EnumItem ( Name = "upstreamTraffic", HasTag = true , Tag = 1 )] + upstreamTraffic , + [ASN1EnumItem ( Name = "downstreamTraffic", HasTag = true , Tag = 2 )] + downstreamTraffic , + [ASN1EnumItem ( Name = "oppositeTraffic", HasTag = true , Tag = 3 )] + oppositeTraffic , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RelevanceTrafficDirection)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs new file mode 100644 index 0000000..d2000f9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs @@ -0,0 +1,50 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "RequestResponseIndication", IsExtensible = false, NumRootElements = 2)] + public class RequestResponseIndication : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "request", HasTag = true , Tag = 0 )] + request , + [ASN1EnumItem ( Name = "response", HasTag = true , Tag = 1 )] + response , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RequestResponseIndication)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs new file mode 100644 index 0000000..9de9c4f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "RescueAndRecoveryWorkInProgressSubCauseCode" )] + public class RescueAndRecoveryWorkInProgressSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "RescueAndRecoveryWorkInProgressSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public RescueAndRecoveryWorkInProgressSubCauseCode() { + } + + public RescueAndRecoveryWorkInProgressSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RescueAndRecoveryWorkInProgressSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueContainer.cs new file mode 100644 index 0000000..3b1cbec --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueContainer.cs @@ -0,0 +1,47 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "RescueContainer", IsExtensible = false, IsSet = false)] + public class RescueContainer : IASN1PreparedElement { + + private LightBarSirenInUse lightBarSirenInUse_ ; + + [ASN1Element ( Name = "lightBarSirenInUse", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LightBarSirenInUse LightBarSirenInUse + { + get { return lightBarSirenInUse_; } + set { lightBarSirenInUse_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RescueContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RestrictedTypes.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RestrictedTypes.cs new file mode 100644 index 0000000..e5cba1e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RestrictedTypes.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "RestrictedTypes" ) ] + public class RestrictedTypes : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 1L, Max = 3L, IsExtensible = true) ] + + [ASN1SequenceOf( Name = "RestrictedTypes", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(StationType item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RestrictedTypes)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs new file mode 100644 index 0000000..5cabd3e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "RoadType", IsExtensible = false, NumRootElements = 4)] + public class RoadType : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "urban-NoStructuralSeparationToOppositeLanes", HasTag = true , Tag = 0 )] + urban_NoStructuralSeparationToOppositeLanes , + [ASN1EnumItem ( Name = "urban-WithStructuralSeparationToOppositeLanes", HasTag = true , Tag = 1 )] + urban_WithStructuralSeparationToOppositeLanes , + [ASN1EnumItem ( Name = "nonUrban-NoStructuralSeparationToOppositeLanes", HasTag = true , Tag = 2 )] + nonUrban_NoStructuralSeparationToOppositeLanes , + [ASN1EnumItem ( Name = "nonUrban-WithStructuralSeparationToOppositeLanes", HasTag = true , Tag = 3 )] + nonUrban_WithStructuralSeparationToOppositeLanes , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RoadType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadWorksContainerBasic.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadWorksContainerBasic.cs new file mode 100644 index 0000000..84e633a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadWorksContainerBasic.cs @@ -0,0 +1,83 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "RoadWorksContainerBasic", IsExtensible = false, IsSet = false)] + public class RoadWorksContainerBasic : IASN1PreparedElement { + + private RoadworksSubCauseCode roadworksSubCauseCode_ ; + + private bool roadworksSubCauseCode_present = false ; + + [ASN1Element ( Name = "roadworksSubCauseCode", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public RoadworksSubCauseCode RoadworksSubCauseCode + { + get { return roadworksSubCauseCode_; } + set { roadworksSubCauseCode_ = value; roadworksSubCauseCode_present = true; } + } + + + + private LightBarSirenInUse lightBarSirenInUse_ ; + + [ASN1Element ( Name = "lightBarSirenInUse", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LightBarSirenInUse LightBarSirenInUse + { + get { return lightBarSirenInUse_; } + set { lightBarSirenInUse_ = value; } + } + + + + private ClosedLanes closedLanes_ ; + + private bool closedLanes_present = false ; + + [ASN1Element ( Name = "closedLanes", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public ClosedLanes ClosedLanes + { + get { return closedLanes_; } + set { closedLanes_ = value; closedLanes_present = true; } + } + + + + public bool isRoadworksSubCauseCodePresent () { + return this.roadworksSubCauseCode_present == true; + } + + public bool isClosedLanesPresent () { + return this.closedLanes_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RoadWorksContainerBasic)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs new file mode 100644 index 0000000..792753e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "RoadworksSubCauseCode" )] + public class RoadworksSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "RoadworksSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public RoadworksSubCauseCode() { + } + + public RoadworksSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(RoadworksSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs new file mode 100644 index 0000000..484ca7e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs @@ -0,0 +1,101 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "SafetyCarContainer", IsExtensible = false, IsSet = false)] + public class SafetyCarContainer : IASN1PreparedElement { + + private LightBarSirenInUse lightBarSirenInUse_ ; + + [ASN1Element ( Name = "lightBarSirenInUse", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LightBarSirenInUse LightBarSirenInUse + { + get { return lightBarSirenInUse_; } + set { lightBarSirenInUse_ = value; } + } + + + + private CauseCodeClass incidentIndication_ ; + + private bool incidentIndication_present = false ; + + [ASN1Element ( Name = "incidentIndication", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CauseCodeClass IncidentIndication + { + get { return incidentIndication_; } + set { incidentIndication_ = value; incidentIndication_present = true; } + } + + + + private TrafficRule trafficRule_ ; + + private bool trafficRule_present = false ; + + [ASN1Element ( Name = "trafficRule", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public TrafficRule TrafficRule + { + get { return trafficRule_; } + set { trafficRule_ = value; trafficRule_present = true; } + } + + + + private SpeedLimit speedLimit_ ; + + private bool speedLimit_present = false ; + + [ASN1Element ( Name = "speedLimit", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SpeedLimit SpeedLimit + { + get { return speedLimit_; } + set { speedLimit_ = value; speedLimit_present = true; } + } + + + + public bool isIncidentIndicationPresent () { + return this.incidentIndication_present == true; + } + + public bool isTrafficRulePresent () { + return this.trafficRule_present == true; + } + + public bool isSpeedLimitPresent () { + return this.speedLimit_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SafetyCarContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs new file mode 100644 index 0000000..cd8d91e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SemiAxisLength" )] + public class SemiAxisLength: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SemiAxisLength" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 4095L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SemiAxisLength() { + } + + public SemiAxisLength(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SemiAxisLength)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs new file mode 100644 index 0000000..5f4a8ce --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SequenceNumber" )] + public class SequenceNumber: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SequenceNumber" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 65535L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SequenceNumber() { + } + + public SequenceNumber(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SequenceNumber)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs new file mode 100644 index 0000000..0bf4b4a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SignalViolationSubCauseCode" )] + public class SignalViolationSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SignalViolationSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SignalViolationSubCauseCode() { + } + + public SignalViolationSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SignalViolationSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs new file mode 100644 index 0000000..d5dbfc9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SlowVehicleSubCauseCode" )] + public class SlowVehicleSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SlowVehicleSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SlowVehicleSubCauseCode() { + } + + public SlowVehicleSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SlowVehicleSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportContainer.cs new file mode 100644 index 0000000..5845817 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportContainer.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "SpecialTransportContainer", IsExtensible = false, IsSet = false)] + public class SpecialTransportContainer : IASN1PreparedElement { + + private SpecialTransportType specialTransportType_ ; + + [ASN1Element ( Name = "specialTransportType", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SpecialTransportType SpecialTransportType + { + get { return specialTransportType_; } + set { specialTransportType_ = value; } + } + + + + private LightBarSirenInUse lightBarSirenInUse_ ; + + [ASN1Element ( Name = "lightBarSirenInUse", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public LightBarSirenInUse LightBarSirenInUse + { + get { return lightBarSirenInUse_; } + set { lightBarSirenInUse_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SpecialTransportContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportType.cs new file mode 100644 index 0000000..970a0bf --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialTransportType.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SpecialTransportType") ] + public class SpecialTransportType : IASN1PreparedElement { + + private BitString val = null; + + [ASN1BitString( Name = "SpecialTransportType") ] + + [ASN1SizeConstraint ( Max = 4L )] + + public BitString Value + { + get { return val; } + set { val = value; } + } + + public SpecialTransportType() { + } + + public SpecialTransportType(BitString value) { + this.Value = value; + } + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SpecialTransportType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialVehicleContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialVehicleContainer.cs new file mode 100644 index 0000000..313229b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpecialVehicleContainer.cs @@ -0,0 +1,335 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Choice ( Name = "SpecialVehicleContainer", IsExtensible = true) ] + public class SpecialVehicleContainer : IASN1PreparedElement { + + + private PublicTransportContainer publicTransportContainer_ ; + private bool publicTransportContainer_selected = false ; + + + + [ASN1Element ( Name = "publicTransportContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public PublicTransportContainer PublicTransportContainer + { + get { return publicTransportContainer_; } + set { selectPublicTransportContainer(value); } + } + + + + + private SpecialTransportContainer specialTransportContainer_ ; + private bool specialTransportContainer_selected = false ; + + + + [ASN1Element ( Name = "specialTransportContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SpecialTransportContainer SpecialTransportContainer + { + get { return specialTransportContainer_; } + set { selectSpecialTransportContainer(value); } + } + + + + + private DangerousGoodsContainer dangerousGoodsContainer_ ; + private bool dangerousGoodsContainer_selected = false ; + + + + [ASN1Element ( Name = "dangerousGoodsContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public DangerousGoodsContainer DangerousGoodsContainer + { + get { return dangerousGoodsContainer_; } + set { selectDangerousGoodsContainer(value); } + } + + + + + private RoadWorksContainerBasic roadWorksContainerBasic_ ; + private bool roadWorksContainerBasic_selected = false ; + + + + [ASN1Element ( Name = "roadWorksContainerBasic", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public RoadWorksContainerBasic RoadWorksContainerBasic + { + get { return roadWorksContainerBasic_; } + set { selectRoadWorksContainerBasic(value); } + } + + + + + private RescueContainer rescueContainer_ ; + private bool rescueContainer_selected = false ; + + + + [ASN1Element ( Name = "rescueContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public RescueContainer RescueContainer + { + get { return rescueContainer_; } + set { selectRescueContainer(value); } + } + + + + + private EmergencyContainer emergencyContainer_ ; + private bool emergencyContainer_selected = false ; + + + + [ASN1Element ( Name = "emergencyContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public EmergencyContainer EmergencyContainer + { + get { return emergencyContainer_; } + set { selectEmergencyContainer(value); } + } + + + + + private SafetyCarContainer safetyCarContainer_ ; + private bool safetyCarContainer_selected = false ; + + + + [ASN1Element ( Name = "safetyCarContainer", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SafetyCarContainer SafetyCarContainer + { + get { return safetyCarContainer_; } + set { selectSafetyCarContainer(value); } + } + + + + public bool isPublicTransportContainerSelected () { + return this.publicTransportContainer_selected ; + } + + + + + public void selectPublicTransportContainer (PublicTransportContainer val) { + this.publicTransportContainer_ = val; + this.publicTransportContainer_selected = true; + + + this.specialTransportContainer_selected = false; + + this.dangerousGoodsContainer_selected = false; + + this.roadWorksContainerBasic_selected = false; + + this.rescueContainer_selected = false; + + this.emergencyContainer_selected = false; + + this.safetyCarContainer_selected = false; + + } + + + public bool isSpecialTransportContainerSelected () { + return this.specialTransportContainer_selected ; + } + + + + + public void selectSpecialTransportContainer (SpecialTransportContainer val) { + this.specialTransportContainer_ = val; + this.specialTransportContainer_selected = true; + + + this.publicTransportContainer_selected = false; + + this.dangerousGoodsContainer_selected = false; + + this.roadWorksContainerBasic_selected = false; + + this.rescueContainer_selected = false; + + this.emergencyContainer_selected = false; + + this.safetyCarContainer_selected = false; + + } + + + public bool isDangerousGoodsContainerSelected () { + return this.dangerousGoodsContainer_selected ; + } + + + + + public void selectDangerousGoodsContainer (DangerousGoodsContainer val) { + this.dangerousGoodsContainer_ = val; + this.dangerousGoodsContainer_selected = true; + + + this.publicTransportContainer_selected = false; + + this.specialTransportContainer_selected = false; + + this.roadWorksContainerBasic_selected = false; + + this.rescueContainer_selected = false; + + this.emergencyContainer_selected = false; + + this.safetyCarContainer_selected = false; + + } + + + public bool isRoadWorksContainerBasicSelected () { + return this.roadWorksContainerBasic_selected ; + } + + + + + public void selectRoadWorksContainerBasic (RoadWorksContainerBasic val) { + this.roadWorksContainerBasic_ = val; + this.roadWorksContainerBasic_selected = true; + + + this.publicTransportContainer_selected = false; + + this.specialTransportContainer_selected = false; + + this.dangerousGoodsContainer_selected = false; + + this.rescueContainer_selected = false; + + this.emergencyContainer_selected = false; + + this.safetyCarContainer_selected = false; + + } + + + public bool isRescueContainerSelected () { + return this.rescueContainer_selected ; + } + + + + + public void selectRescueContainer (RescueContainer val) { + this.rescueContainer_ = val; + this.rescueContainer_selected = true; + + + this.publicTransportContainer_selected = false; + + this.specialTransportContainer_selected = false; + + this.dangerousGoodsContainer_selected = false; + + this.roadWorksContainerBasic_selected = false; + + this.emergencyContainer_selected = false; + + this.safetyCarContainer_selected = false; + + } + + + public bool isEmergencyContainerSelected () { + return this.emergencyContainer_selected ; + } + + + + + public void selectEmergencyContainer (EmergencyContainer val) { + this.emergencyContainer_ = val; + this.emergencyContainer_selected = true; + + + this.publicTransportContainer_selected = false; + + this.specialTransportContainer_selected = false; + + this.dangerousGoodsContainer_selected = false; + + this.roadWorksContainerBasic_selected = false; + + this.rescueContainer_selected = false; + + this.safetyCarContainer_selected = false; + + } + + + public bool isSafetyCarContainerSelected () { + return this.safetyCarContainer_selected ; + } + + + + + public void selectSafetyCarContainer (SafetyCarContainer val) { + this.safetyCarContainer_ = val; + this.safetyCarContainer_selected = true; + + + this.publicTransportContainer_selected = false; + + this.specialTransportContainer_selected = false; + + this.dangerousGoodsContainer_selected = false; + + this.roadWorksContainerBasic_selected = false; + + this.rescueContainer_selected = false; + + this.emergencyContainer_selected = false; + + } + + + + public void initWithDefaults() + { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SpecialVehicleContainer)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Speed.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Speed.cs new file mode 100644 index 0000000..0ff0238 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Speed.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "Speed", IsExtensible = false, IsSet = false)] + public class Speed : IASN1PreparedElement { + + private SpeedValue speedValue_ ; + + [ASN1Element ( Name = "speedValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SpeedValue SpeedValue + { + get { return speedValue_; } + set { speedValue_ = value; } + } + + + + private SpeedConfidence speedConfidence_ ; + + [ASN1Element ( Name = "speedConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SpeedConfidence SpeedConfidence + { + get { return speedConfidence_; } + set { speedConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Speed)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs new file mode 100644 index 0000000..8f9d040 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SpeedConfidence" )] + public class SpeedConfidence: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SpeedConfidence" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SpeedConfidence() { + } + + public SpeedConfidence(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SpeedConfidence)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs new file mode 100644 index 0000000..dc70925 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SpeedLimit" )] + public class SpeedLimit: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SpeedLimit" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SpeedLimit() { + } + + public SpeedLimit(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SpeedLimit)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs new file mode 100644 index 0000000..4960489 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SpeedValue" )] + public class SpeedValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SpeedValue" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 16383L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SpeedValue() { + } + + public SpeedValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SpeedValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs new file mode 100644 index 0000000..67d92e3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "StationID" )] + public class StationID: IASN1PreparedElement { + + private long val; + + [ASN1Integer( Name = "StationID" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 4294967295L, IsExtensible = false) ] + + public long Value + { + get { return val; } + set { val = value; } + } + + public StationID() { + } + + public StationID(long value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(StationID)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs new file mode 100644 index 0000000..72f21ce --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "StationType" )] + public class StationType: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "StationType" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public StationType() { + } + + public StationType(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(StationType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs new file mode 100644 index 0000000..46e06f7 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "StationarySince", IsExtensible = false, NumRootElements = 4)] + public class StationarySince : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "lessThan1Minute", HasTag = true , Tag = 0 )] + lessThan1Minute , + [ASN1EnumItem ( Name = "lessThan2Minutes", HasTag = true , Tag = 1 )] + lessThan2Minutes , + [ASN1EnumItem ( Name = "lessThan15Minutes", HasTag = true , Tag = 2 )] + lessThan15Minutes , + [ASN1EnumItem ( Name = "equalOrGreater15Minutes", HasTag = true , Tag = 3 )] + equalOrGreater15Minutes , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(StationarySince)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs new file mode 100644 index 0000000..d257999 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "StationaryVehicleSubCauseCode" )] + public class StationaryVehicleSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "StationaryVehicleSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public StationaryVehicleSubCauseCode() { + } + + public StationaryVehicleSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(StationaryVehicleSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngle.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngle.cs new file mode 100644 index 0000000..dfe2156 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngle.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "SteeringWheelAngle", IsExtensible = false, IsSet = false)] + public class SteeringWheelAngle : IASN1PreparedElement { + + private SteeringWheelAngleValue steeringWheelAngleValue_ ; + + [ASN1Element ( Name = "steeringWheelAngleValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SteeringWheelAngleValue SteeringWheelAngleValue + { + get { return steeringWheelAngleValue_; } + set { steeringWheelAngleValue_ = value; } + } + + + + private SteeringWheelAngleConfidence steeringWheelAngleConfidence_ ; + + [ASN1Element ( Name = "steeringWheelAngleConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public SteeringWheelAngleConfidence SteeringWheelAngleConfidence + { + get { return steeringWheelAngleConfidence_; } + set { steeringWheelAngleConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SteeringWheelAngle)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs new file mode 100644 index 0000000..2915d2b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SteeringWheelAngleConfidence" )] + public class SteeringWheelAngleConfidence: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SteeringWheelAngleConfidence" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SteeringWheelAngleConfidence() { + } + + public SteeringWheelAngleConfidence(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SteeringWheelAngleConfidence)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs new file mode 100644 index 0000000..cf35213 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SteeringWheelAngleValue" )] + public class SteeringWheelAngleValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SteeringWheelAngleValue" )] + [ASN1ValueRangeConstraint ( Min = -511L, Max = 512L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SteeringWheelAngleValue() { + } + + public SteeringWheelAngleValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SteeringWheelAngleValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs new file mode 100644 index 0000000..28e0305 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "SubCauseCodeType" )] + public class SubCauseCodeType: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "SubCauseCodeType" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public SubCauseCodeType() { + } + + public SubCauseCodeType(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(SubCauseCodeType)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs new file mode 100644 index 0000000..10f23b5 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "Temperature" )] + public class Temperature: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "Temperature" )] + [ASN1ValueRangeConstraint ( Min = -60L, Max = 67L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public Temperature() { + } + + public Temperature(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Temperature)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs new file mode 100644 index 0000000..187c2fe --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "TimestampIts" )] + public class TimestampIts: IASN1PreparedElement { + + private long val; + + [ASN1Integer( Name = "TimestampIts" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 4398046511103L, IsExtensible = false) ] + + public long Value + { + get { return val; } + set { val = value; } + } + + public TimestampIts() { + } + + public TimestampIts(long value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TimestampIts)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Traces.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Traces.cs new file mode 100644 index 0000000..c1ab18b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Traces.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "Traces" ) ] + public class Traces : IASN1PreparedElement { + + private System.Collections.Generic.ICollection val = null; + + [ASN1ValueRangeConstraint ( Min = 1L, Max = 7L, IsExtensible = false) ] + + [ASN1SequenceOf( Name = "Traces", IsSetOf = false) ] + + public System.Collections.Generic.ICollection Value + { + get { return val; } + set { val = value; } + } + + public void initValue() { + this.Value = new System.Collections.Generic.List(); + } + + public void Add(PathHistory item) { + this.Value.Add(item); + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(Traces)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs new file mode 100644 index 0000000..4f9a978 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "TrafficConditionSubCauseCode" )] + public class TrafficConditionSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "TrafficConditionSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public TrafficConditionSubCauseCode() { + } + + public TrafficConditionSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TrafficConditionSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs new file mode 100644 index 0000000..a8e5bd4 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "TrafficRule", IsExtensible = true, NumRootElements = 4)] + public class TrafficRule : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "noPassing", HasTag = true , Tag = 0 )] + noPassing , + [ASN1EnumItem ( Name = "noPassingForTrucks", HasTag = true , Tag = 1 )] + noPassingForTrucks , + [ASN1EnumItem ( Name = "passToRight", HasTag = true , Tag = 2 )] + passToRight , + [ASN1EnumItem ( Name = "passToLeft", HasTag = true , Tag = 3 )] + passToLeft , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TrafficRule)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs new file mode 100644 index 0000000..69a464f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "TransmissionInterval" )] + public class TransmissionInterval: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "TransmissionInterval" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 10000L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public TransmissionInterval() { + } + + public TransmissionInterval(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TransmissionInterval)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs new file mode 100644 index 0000000..76da816 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "TurningRadius" )] + public class TurningRadius: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "TurningRadius" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public TurningRadius() { + } + + public TurningRadius(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(TurningRadius)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VDS.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VDS.cs new file mode 100644 index 0000000..2c79d0d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VDS.cs @@ -0,0 +1,54 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "VDS") ] + public class VDS: IASN1PreparedElement { + + private String val; + + [ASN1String( Name = "VDS", + StringType = UniversalTags.IA5String , IsUCS = false) ] + + [ASN1SizeConstraint ( Max = 6L )] + + public String Value + { + get { return val; } + set { val = value; } + } + + public VDS() { + } + + public VDS(String val) { + this.val = val; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VDS)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs new file mode 100644 index 0000000..81e6e93 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "ValidityDuration" )] + public class ValidityDuration: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "ValidityDuration" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 86400L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public ValidityDuration() { + } + + public ValidityDuration(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(ValidityDuration)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs new file mode 100644 index 0000000..0c6ec6f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "VehicleBreakdownSubCauseCode" )] + public class VehicleBreakdownSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "VehicleBreakdownSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public VehicleBreakdownSubCauseCode() { + } + + public VehicleBreakdownSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleBreakdownSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleIdentification.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleIdentification.cs new file mode 100644 index 0000000..4523f1b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleIdentification.cs @@ -0,0 +1,71 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "VehicleIdentification", IsExtensible = true, IsSet = false)] + public class VehicleIdentification : IASN1PreparedElement { + + private WMInumber wMInumber_ ; + + private bool wMInumber_present = false ; + + [ASN1Element ( Name = "wMInumber", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public WMInumber WMInumber + { + get { return wMInumber_; } + set { wMInumber_ = value; wMInumber_present = true; } + } + + + + private VDS vDS_ ; + + private bool vDS_present = false ; + + [ASN1Element ( Name = "vDS", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VDS VDS + { + get { return vDS_; } + set { vDS_ = value; vDS_present = true; } + } + + + + public bool isWMInumberPresent () { + return this.wMInumber_present == true; + } + + public bool isVDSPresent () { + return this.vDS_present == true; + } + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleIdentification)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLength.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLength.cs new file mode 100644 index 0000000..b410262 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLength.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "VehicleLength", IsExtensible = false, IsSet = false)] + public class VehicleLength : IASN1PreparedElement { + + private VehicleLengthValue vehicleLengthValue_ ; + + [ASN1Element ( Name = "vehicleLengthValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VehicleLengthValue VehicleLengthValue + { + get { return vehicleLengthValue_; } + set { vehicleLengthValue_ = value; } + } + + + + private VehicleLengthConfidenceIndication vehicleLengthConfidenceIndication_ ; + + [ASN1Element ( Name = "vehicleLengthConfidenceIndication", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VehicleLengthConfidenceIndication VehicleLengthConfidenceIndication + { + get { return vehicleLengthConfidenceIndication_; } + set { vehicleLengthConfidenceIndication_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleLength)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs new file mode 100644 index 0000000..ea8c495 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs @@ -0,0 +1,56 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "VehicleLengthConfidenceIndication", IsExtensible = false, NumRootElements = 5)] + public class VehicleLengthConfidenceIndication : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "noTrailerPresent", HasTag = true , Tag = 0 )] + noTrailerPresent , + [ASN1EnumItem ( Name = "trailerPresentWithKnownLength", HasTag = true , Tag = 1 )] + trailerPresentWithKnownLength , + [ASN1EnumItem ( Name = "trailerPresentWithUnknownLength", HasTag = true , Tag = 2 )] + trailerPresentWithUnknownLength , + [ASN1EnumItem ( Name = "trailerPresenceIsUnknown", HasTag = true , Tag = 3 )] + trailerPresenceIsUnknown , + [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 4 )] + unavailable , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleLengthConfidenceIndication)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs new file mode 100644 index 0000000..ed8509e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "VehicleLengthValue" )] + public class VehicleLengthValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "VehicleLengthValue" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 1023L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public VehicleLengthValue() { + } + + public VehicleLengthValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleLengthValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs new file mode 100644 index 0000000..9b49f4c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "VehicleMass" )] + public class VehicleMass: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "VehicleMass" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 1024L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public VehicleMass() { + } + + public VehicleMass(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleMass)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs new file mode 100644 index 0000000..0be84da --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs @@ -0,0 +1,78 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "VehicleRole", IsExtensible = false, NumRootElements = 16)] + public class VehicleRole : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "default", HasTag = true , Tag = 0 )] + Default , + [ASN1EnumItem ( Name = "publicTransport", HasTag = true , Tag = 1 )] + publicTransport , + [ASN1EnumItem ( Name = "specialTransport", HasTag = true , Tag = 2 )] + specialTransport , + [ASN1EnumItem ( Name = "dangerousGoods", HasTag = true , Tag = 3 )] + dangerousGoods , + [ASN1EnumItem ( Name = "roadWork", HasTag = true , Tag = 4 )] + roadWork , + [ASN1EnumItem ( Name = "rescue", HasTag = true , Tag = 5 )] + rescue , + [ASN1EnumItem ( Name = "emergency", HasTag = true , Tag = 6 )] + emergency , + [ASN1EnumItem ( Name = "safetyCar", HasTag = true , Tag = 7 )] + safetyCar , + [ASN1EnumItem ( Name = "agriculture", HasTag = true , Tag = 8 )] + agriculture , + [ASN1EnumItem ( Name = "commercial", HasTag = true , Tag = 9 )] + commercial , + [ASN1EnumItem ( Name = "military", HasTag = true , Tag = 10 )] + military , + [ASN1EnumItem ( Name = "roadOperator", HasTag = true , Tag = 11 )] + roadOperator , + [ASN1EnumItem ( Name = "taxi", HasTag = true , Tag = 12 )] + taxi , + [ASN1EnumItem ( Name = "reserved1", HasTag = true , Tag = 13 )] + reserved1 , + [ASN1EnumItem ( Name = "reserved2", HasTag = true , Tag = 14 )] + reserved2 , + [ASN1EnumItem ( Name = "reserved3", HasTag = true , Tag = 15 )] + reserved3 , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleRole)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs new file mode 100644 index 0000000..62cee44 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "VehicleWidth" )] + public class VehicleWidth: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "VehicleWidth" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 62L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public VehicleWidth() { + } + + public VehicleWidth(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VehicleWidth)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAcceleration.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAcceleration.cs new file mode 100644 index 0000000..8423e67 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAcceleration.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "VerticalAcceleration", IsExtensible = false, IsSet = false)] + public class VerticalAcceleration : IASN1PreparedElement { + + private VerticalAccelerationValue verticalAccelerationValue_ ; + + [ASN1Element ( Name = "verticalAccelerationValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public VerticalAccelerationValue VerticalAccelerationValue + { + get { return verticalAccelerationValue_; } + set { verticalAccelerationValue_ = value; } + } + + + + private AccelerationConfidence verticalAccelerationConfidence_ ; + + [ASN1Element ( Name = "verticalAccelerationConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public AccelerationConfidence VerticalAccelerationConfidence + { + get { return verticalAccelerationConfidence_; } + set { verticalAccelerationConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VerticalAcceleration)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs new file mode 100644 index 0000000..2345c06 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "VerticalAccelerationValue" )] + public class VerticalAccelerationValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "VerticalAccelerationValue" )] + [ASN1ValueRangeConstraint ( Min = -160L, Max = 161L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public VerticalAccelerationValue() { + } + + public VerticalAccelerationValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(VerticalAccelerationValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WMInumber.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WMInumber.cs new file mode 100644 index 0000000..30ee372 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WMInumber.cs @@ -0,0 +1,53 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "WMInumber") ] + public class WMInumber: IASN1PreparedElement { + + private String val; + + [ASN1String( Name = "WMInumber", + StringType = UniversalTags.IA5String , IsUCS = false) ] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 3L, IsExtensible = false) ] + + public String Value + { + get { return val; } + set { val = value; } + } + + public WMInumber() { + } + + public WMInumber(String val) { + this.val = val; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(WMInumber)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs new file mode 100644 index 0000000..213ebb5 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "WheelBaseVehicle" )] + public class WheelBaseVehicle: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "WheelBaseVehicle" )] + [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public WheelBaseVehicle() { + } + + public WheelBaseVehicle(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(WheelBaseVehicle)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs new file mode 100644 index 0000000..2930d2d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "WrongWayDrivingSubCauseCode" )] + public class WrongWayDrivingSubCauseCode: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "WrongWayDrivingSubCauseCode" )] + [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public WrongWayDrivingSubCauseCode() { + } + + public WrongWayDrivingSubCauseCode(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(WrongWayDrivingSubCauseCode)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRate.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRate.cs new file mode 100644 index 0000000..ab95f63 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRate.cs @@ -0,0 +1,59 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Sequence ( Name = "YawRate", IsExtensible = false, IsSet = false)] + public class YawRate : IASN1PreparedElement { + + private YawRateValue yawRateValue_ ; + + [ASN1Element ( Name = "yawRateValue", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public YawRateValue YawRateValue + { + get { return yawRateValue_; } + set { yawRateValue_ = value; } + } + + + + private YawRateConfidence yawRateConfidence_ ; + + [ASN1Element ( Name = "yawRateConfidence", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public YawRateConfidence YawRateConfidence + { + get { return yawRateConfidence_; } + set { yawRateConfidence_ = value; } + } + + + + + public void initWithDefaults() { + + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(YawRate)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs new file mode 100644 index 0000000..a607254 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs @@ -0,0 +1,64 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1Enum ( Name = "YawRateConfidence", IsExtensible = false, NumRootElements = 9)] + public class YawRateConfidence : IASN1PreparedElement { + public enum EnumType { + + [ASN1EnumItem ( Name = "degSec-000-01", HasTag = true , Tag = 0 )] + degSec_000_01 , + [ASN1EnumItem ( Name = "degSec-000-05", HasTag = true , Tag = 1 )] + degSec_000_05 , + [ASN1EnumItem ( Name = "degSec-000-10", HasTag = true , Tag = 2 )] + degSec_000_10 , + [ASN1EnumItem ( Name = "degSec-001-00", HasTag = true , Tag = 3 )] + degSec_001_00 , + [ASN1EnumItem ( Name = "degSec-005-00", HasTag = true , Tag = 4 )] + degSec_005_00 , + [ASN1EnumItem ( Name = "degSec-010-00", HasTag = true , Tag = 5 )] + degSec_010_00 , + [ASN1EnumItem ( Name = "degSec-100-00", HasTag = true , Tag = 6 )] + degSec_100_00 , + [ASN1EnumItem ( Name = "outOfRange", HasTag = true , Tag = 7 )] + outOfRange , + [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 8 )] + unavailable , + } + + private EnumType val; + + public EnumType Value + { + get { return val; } + set { val = value; } + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(YawRateConfidence)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs new file mode 100644 index 0000000..47bc863 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs @@ -0,0 +1,52 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "YawRateValue" )] + public class YawRateValue: IASN1PreparedElement { + + private int val; + + [ASN1Integer( Name = "YawRateValue" )] + [ASN1ValueRangeConstraint ( Min = -32766L, Max = 32767L, IsExtensible = false) ] + + public int Value + { + get { return val; } + set { val = value; } + } + + public YawRateValue() { + } + + public YawRateValue(int value) { + this.Value = value; + } + + public void initWithDefaults() + { + } + + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(YawRateValue)); + public IASN1PreparedElementData PreparedData { + get { return preparedData; } + } + + } + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/main.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/main.cs new file mode 100644 index 0000000..b80d23a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/main.cs @@ -0,0 +1,17 @@ + +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +using System; +using org.bn.attributes; +using org.bn.attributes.constraints; +using org.bn.coders; +using org.bn.types; +using org.bn; + +namespace its.cam { + +} diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index e28e152..9ec1d10 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -15,6 +15,7 @@ You may obtain a copy of the License at limitations under the License. */ using System; +using its.cam; using org.bn; using org.bn.coders; using org.bn.coders.test_asn; @@ -374,5 +375,98 @@ public override byte[] createTestExtensibleSize2Bytes() { return new byte[] { 0x82, 0x47, 0xaa, 0x22, 0x80 }; } + + public static CAM createCam() + { + CAM cam = new(); + cam.Header = new(); + cam.Header.ProtocolVersion = 1; + cam.Header.MessageID = 2; + cam.Header.StationID = new StationID(0); + cam.Cam = new(); + cam.Cam.GenerationDeltaTime = new(1); + cam.Cam.CamParameters = new(); + cam.Cam.CamParameters.BasicContainer = new(); + cam.Cam.CamParameters.BasicContainer.StationType = new StationType(0); + cam.Cam.CamParameters.BasicContainer.ReferencePosition = new(); + cam.Cam.CamParameters.BasicContainer.ReferencePosition.Latitude = new(10); + cam.Cam.CamParameters.BasicContainer.ReferencePosition.Longitude = new(10); + cam.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse = new() + { + SemiMajorConfidence = new(1), + SemiMinorConfidence = new(1), + SemiMajorOrientation = new(0) + }; + cam.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude = new() + { + AltitudeValue = new(0), + AltitudeConfidence = new() + { + Value = AltitudeConfidence.EnumType.alt_000_01 + } + }; + cam.Cam.CamParameters.HighFrequencyContainer = new() + { + BasicVehicleContainerHighFrequency = new() + { + Heading = new() + { + HeadingValue = new(0), + HeadingConfidence = new(1) + }, + Speed = new() + { + SpeedValue = new(0), + SpeedConfidence = new(1) + }, + DriveDirection = new() + { + Value = DriveDirection.EnumType.forward + }, + VehicleLength = new() + { + VehicleLengthValue = new(1), + VehicleLengthConfidenceIndication = + new() + { + Value = VehicleLengthConfidenceIndication.EnumType.noTrailerPresent + } + }, + VehicleWidth = new(1), + LongitudinalAcceleration = new() + { + LongitudinalAccelerationValue = new(1), + LongitudinalAccelerationConfidence = new(1) + }, + Curvature = new() + { + CurvatureValue = new(0), + CurvatureConfidence = new() + { + Value = CurvatureConfidence.EnumType.onePerMeter_0_00002 + } + }, + CurvatureCalculationMode = new() + { + Value = CurvatureCalculationMode.EnumType.yawRateUsed + }, + YawRate = new() + { + YawRateValue = new(0), + YawRateConfidence = new() + { + Value = YawRateConfidence.EnumType.degSec_000_01 + } + } + } + }; + + return cam; + } + + public static byte[] createCamBytes() + { + return System.IO.File.ReadAllBytes("org/bn/coders/per/sample_cam.uper"); + } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs index 3ac3ea3..938ad1b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs @@ -15,7 +15,10 @@ You may obtain a copy of the License at limitations under the License. */ +using its.cam; using Microsoft.VisualStudio.TestTools.UnitTesting; +using org.bn.coders.test_asn; +using System.Text; namespace org.bn.coders.per { @@ -33,5 +36,100 @@ protected override IDecoder newDecoder() { return coderFactory.newDecoder("PER/Unaligned"); } + + private void CheckCamResults(its.cam.CAM got, its.cam.CAM exp) + { + Assert.IsNotNull(got); + + Assert.AreEqual(got.Header.ProtocolVersion, exp.Header.ProtocolVersion); + Assert.AreEqual(got.Header.MessageID, exp.Header.MessageID); + Assert.AreEqual(got.Header.StationID.Value, exp.Header.StationID.Value); + Assert.AreEqual(got.Cam.GenerationDeltaTime.Value, exp.Cam.GenerationDeltaTime.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.StationType.Value, + exp.Cam.CamParameters.BasicContainer.StationType.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Latitude.Value, + exp.Cam.CamParameters.BasicContainer.ReferencePosition.Latitude.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Longitude.Value, + exp.Cam.CamParameters.BasicContainer.ReferencePosition.Longitude.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorConfidence.Value, + exp.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorConfidence.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMinorConfidence.Value, + exp.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMinorConfidence.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorOrientation.Value, + exp.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorOrientation.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeValue.Value, + exp.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeValue.Value); + Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeConfidence.Value, + exp.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeConfidence.Value); + var gotHighFreq = got.Cam.CamParameters.HighFrequencyContainer.BasicVehicleContainerHighFrequency; + var expHighFreq = exp.Cam.CamParameters.HighFrequencyContainer.BasicVehicleContainerHighFrequency; + Assert.AreEqual(gotHighFreq.Heading.HeadingValue.Value, + expHighFreq.Heading.HeadingValue.Value); + Assert.AreEqual(gotHighFreq.Heading.HeadingConfidence.Value, + expHighFreq.Heading.HeadingConfidence.Value); + + Assert.AreEqual(gotHighFreq.Speed.SpeedValue.Value, + expHighFreq.Speed.SpeedValue.Value); + Assert.AreEqual(gotHighFreq.Speed.SpeedConfidence.Value, + expHighFreq.Speed.SpeedConfidence.Value); + + Assert.AreEqual(gotHighFreq.DriveDirection.Value, + expHighFreq.DriveDirection.Value); + + Assert.AreEqual(gotHighFreq.VehicleLength.VehicleLengthValue.Value, + expHighFreq.VehicleLength.VehicleLengthValue.Value); + Assert.AreEqual(gotHighFreq.VehicleLength.VehicleLengthConfidenceIndication.Value, + expHighFreq.VehicleLength.VehicleLengthConfidenceIndication.Value); + + Assert.AreEqual(gotHighFreq.VehicleWidth.Value, + expHighFreq.VehicleWidth.Value); + + Assert.AreEqual(gotHighFreq.LongitudinalAcceleration.LongitudinalAccelerationValue.Value, + expHighFreq.LongitudinalAcceleration.LongitudinalAccelerationValue.Value); + Assert.AreEqual(gotHighFreq.LongitudinalAcceleration.LongitudinalAccelerationConfidence.Value, + expHighFreq.LongitudinalAcceleration.LongitudinalAccelerationConfidence.Value); + + Assert.AreEqual(gotHighFreq.Curvature.CurvatureValue.Value, + expHighFreq.Curvature.CurvatureValue.Value); + Assert.AreEqual(gotHighFreq.Curvature.CurvatureConfidence.Value, + expHighFreq.Curvature.CurvatureConfidence.Value); + Assert.AreEqual(gotHighFreq.CurvatureCalculationMode.Value, + expHighFreq.CurvatureCalculationMode.Value); + + + Assert.AreEqual(gotHighFreq.YawRate.YawRateValue.Value, + expHighFreq.YawRate.YawRateValue.Value); + Assert.AreEqual(gotHighFreq.YawRate.YawRateConfidence.Value, + expHighFreq.YawRate.YawRateConfidence.Value); + } + + [TestMethod] + public void testCamDecoding() + { + var decoder = newDecoder(); + System.IO.MemoryStream stream = new System.IO.MemoryStream(PERUnalignedCoderTestUtils.createCamBytes()); + + var got = decoder.decode(stream); + var exp = PERUnalignedCoderTestUtils.createCam(); + + CheckCamResults(got, exp); + } + + public void testCamEncodingDecoding() + { + var decoder = newDecoder(); + System.IO.MemoryStream stream = new System.IO.MemoryStream(PERUnalignedCoderTestUtils.createCamBytes()); + + IEncoder encoder = new PERUnalignedEncoder(); + + System.IO.MemoryStream outputStream = new System.IO.MemoryStream(); + var exp = PERUnalignedCoderTestUtils.createCam(); + encoder.encode(exp, outputStream); + + outputStream.Seek(0, SeekOrigin.Begin); + var got = decoder.decode(outputStream); + + CheckCamResults(got, exp); + } } } \ No newline at end of file diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedEncoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedEncoderTest.cs index 4ee6bc4..ef5fc9e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedEncoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedEncoderTest.cs @@ -42,5 +42,17 @@ public override void testNullEncode() { // PER does not encode NULL value } + + [TestMethod] + public void testCAMEncoding() + { + IEncoder encoder = newEncoder(); + Assert.IsNotNull(encoder); + if (encoder is org.bn.coders.per.PERUnalignedEncoder) + { + printEncoded("TestCAM", encoder, PERUnalignedCoderTestUtils.createCam()); + checkEncoded(encoder, PERUnalignedCoderTestUtils.createCam(), PERUnalignedCoderTestUtils.createCamBytes()); + } + } } } \ No newline at end of file diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/sample_cam.uper b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/sample_cam.uper new file mode 100644 index 0000000000000000000000000000000000000000..057dd16452f9bdcd9339511f0c1315ac8cb6cabd GIT binary patch literal 41 ocmZQ%VgLa~2DUA86@4?U937Y#6c`MyfJH$BQw#UX2LAsC0CbxNoB#j- literal 0 HcmV?d00001 diff --git a/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py index 8d4b3f7..2847c25 100644 --- a/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py +++ b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py @@ -4,6 +4,7 @@ zip_path = '../../BNCompiler/target/bncompiler-1.6-dist.zip' test_asn_path = '../../BNCompiler/src/test/resources/test.asn' +cam_asn_path = '../../BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn' extract_to = 'bncompiler' os.makedirs(extract_to, exist_ok=True) @@ -20,40 +21,43 @@ java = os.path.join(os.environ.get('JAVA_HOME'),java) jar_path = os.path.join(path, extract_to, 'bncompiler-1.6.jar') -namespace = "org.bn.coders.test_asn" - -# works with JAVA 20 -java_options = ['-Dsun.misc.URLClassPath.disableJarChecking=true', - '--add-opens', 'jdk.naming.rmi/com.sun.jndi.rmi.registry=ALL-UNNAMED', - '--add-opens', 'java.base/java.lang=ALL-UNNAMED', - '--add-opens', 'java.base/sun.security.action=ALL-UNNAMED', - '--add-opens', 'java.base/sun.net=ALL-UNNAMED'] - -cmd = [java] -cmd.extend(java_options) - -output_path = os.path.join(path, 'org/bn/coders/test_asn') - -# add the specific options for the bncompiler -bn_compiler_args = [ - '-classpath', jar_path, - 'org.bn.compiler.Main', - '-m', 'cs', - '-ns', namespace, - '-o', output_path, - "-f", os.path.join(path, test_asn_path) -] -cmd.extend(bn_compiler_args) - -result = subprocess.run(cmd, capture_output=True, text=True) -print(result.stdout) -print(result.stderr) - -for root, _, files in os.walk(output_path): - for file in files: - file_path = os.path.join(root, file) - with open(file_path, 'rb') as f: - content = f.read() - content = content.replace(b'\r\n', b'\n') - with open(file_path, 'wb') as f: - f.write(content) + +def run_compiler(namespace, asn_path, output_path): + # works with JAVA 20 + java_options = ['-Dsun.misc.URLClassPath.disableJarChecking=true', + '--add-opens', 'jdk.naming.rmi/com.sun.jndi.rmi.registry=ALL-UNNAMED', + '--add-opens', 'java.base/java.lang=ALL-UNNAMED', + '--add-opens', 'java.base/sun.security.action=ALL-UNNAMED', + '--add-opens', 'java.base/sun.net=ALL-UNNAMED'] + + cmd = [java] + cmd.extend(java_options) + + # add the specific options for the bncompiler + bn_compiler_args = [ + '-classpath', jar_path, + 'org.bn.compiler.Main', + '-m', 'cs', + '-ns', namespace, + '-o', output_path, + "-f", asn_path + ] + + cmd.extend(bn_compiler_args) + + result = subprocess.run(cmd, capture_output=True, text=True) + #result = subprocess.run(cmd + ["-x"], capture_output=True, text=True) + print(result.stdout) + print(result.stderr) + + for root, _, files in os.walk(output_path): + for file in files: + file_path = os.path.join(root, file) + with open(file_path, 'rb') as f: + content = f.read() + content = content.replace(b'\r\n', b'\n') + with open(file_path, 'wb') as f: + f.write(content) + +run_compiler("org.bn.coders.test_asn", os.path.join(path, test_asn_path), os.path.join(path, 'org/bn/coders/test_asn')) +run_compiler("its.cam", os.path.join(path, cam_asn_path), os.path.join(path, 'org/bn/coders/cam_asn')) From 9ed706585b9027d6d13b5fc0028008875cccf978 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 17:43:40 +0200 Subject: [PATCH 23/32] Add missing test functions for extensibleSize --- .../org/bn/coders/CoderTestUtilities.cs | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs index e5fd824..fb26a1f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs @@ -361,6 +361,14 @@ public TestBitStr createTestBitStrSmall() } public abstract byte[] createTestBitStrSmallBytes(); + //public TestBitStrNamed createTestBitStrNamed() + //{ + // TestBitStrNamed result = new TestBitStrNamed(); + // result.Value = new BitString(new byte[] { (byte)0xAA, (byte)0xB0 }, 4); + // return result; + //} + //public abstract byte[] createTestBitStrNamedBytes(); + public TestUnicodeStr createUnicodeStr() { TestUnicodeStr result = new TestUnicodeStr(); @@ -721,5 +729,29 @@ public ExtensibleInteger createTestExtendedInteger2() } public abstract byte[] createTestExtendedInteger2Bytes(); - } + + public ExtensibleSize createTestExtensibleSize1() + { + ExtensibleSize extInt = new(); + extInt.Value = new List(); + extInt.Value.Add(new SubInteger(0x23)); + extInt.Value.Add(new SubInteger(0x35)); + return extInt; + } + + public abstract byte[] createTestExtensibleSize1Bytes(); + + public ExtensibleSize createTestExtensibleSize2() + { + ExtensibleSize extInt = new(); + extInt.Value = new List(); + extInt.Value.Add(new SubInteger(0x23)); + extInt.Value.Add(new SubInteger(0x35)); + extInt.Value.Add(new SubInteger(0x11)); + extInt.Value.Add(new SubInteger(0x05)); + return extInt; + } + + public abstract byte[] createTestExtensibleSize2Bytes(); + } } From 4b7c6ef963aa9cda07b58a223181220e2e426ec1 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 26 May 2025 17:59:58 +0200 Subject: [PATCH 24/32] Use variables to shorten lines --- .../coders/per/PERUnalignedCoderTestUtils.cs | 16 ++++++++-- .../bn/coders/per/PERUnalignedDecoderTest.cs | 31 +++++++++---------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index 9ec1d10..b919b78 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -386,25 +386,35 @@ public static CAM createCam() cam.Cam = new(); cam.Cam.GenerationDeltaTime = new(1); cam.Cam.CamParameters = new(); - cam.Cam.CamParameters.BasicContainer = new(); + cam.Cam.CamParameters.BasicContainer = new() cam.Cam.CamParameters.BasicContainer.StationType = new StationType(0); cam.Cam.CamParameters.BasicContainer.ReferencePosition = new(); cam.Cam.CamParameters.BasicContainer.ReferencePosition.Latitude = new(10); cam.Cam.CamParameters.BasicContainer.ReferencePosition.Longitude = new(10); cam.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse = new() { + StationType = new StationType(0), + ReferencePosition = new() + { + Latitude = new(10), + Longitude = new(10), + PositionConfidenceEllipse = new() + { SemiMajorConfidence = new(1), SemiMinorConfidence = new(1), SemiMajorOrientation = new(0) - }; - cam.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude = new() + }, + Altitude = new() { AltitudeValue = new(0), AltitudeConfidence = new() { Value = AltitudeConfidence.EnumType.alt_000_01 } + } + } }; + cam.Cam.CamParameters.HighFrequencyContainer = new() { BasicVehicleContainerHighFrequency = new() diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs index 938ad1b..97e3088 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedDecoderTest.cs @@ -45,22 +45,21 @@ private void CheckCamResults(its.cam.CAM got, its.cam.CAM exp) Assert.AreEqual(got.Header.MessageID, exp.Header.MessageID); Assert.AreEqual(got.Header.StationID.Value, exp.Header.StationID.Value); Assert.AreEqual(got.Cam.GenerationDeltaTime.Value, exp.Cam.GenerationDeltaTime.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.StationType.Value, - exp.Cam.CamParameters.BasicContainer.StationType.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Latitude.Value, - exp.Cam.CamParameters.BasicContainer.ReferencePosition.Latitude.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Longitude.Value, - exp.Cam.CamParameters.BasicContainer.ReferencePosition.Longitude.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorConfidence.Value, - exp.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorConfidence.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMinorConfidence.Value, - exp.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMinorConfidence.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorOrientation.Value, - exp.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse.SemiMajorOrientation.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeValue.Value, - exp.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeValue.Value); - Assert.AreEqual(got.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeConfidence.Value, - exp.Cam.CamParameters.BasicContainer.ReferencePosition.Altitude.AltitudeConfidence.Value); + + var gotBasic = got.Cam.CamParameters.BasicContainer; + var expBasic = exp.Cam.CamParameters.BasicContainer; + Assert.AreEqual(gotBasic.StationType.Value, expBasic.StationType.Value); + Assert.AreEqual(gotBasic.ReferencePosition.Latitude.Value, expBasic.ReferencePosition.Latitude.Value); + Assert.AreEqual(gotBasic.ReferencePosition.Longitude.Value, expBasic.ReferencePosition.Longitude.Value); + + var gotPosEclipse = gotBasic.ReferencePosition.PositionConfidenceEllipse; + var expPosEclipse = expBasic.ReferencePosition.PositionConfidenceEllipse; + Assert.AreEqual(gotPosEclipse.SemiMajorConfidence.Value, expBasic.ReferencePosition.PositionConfidenceEllipse.SemiMajorConfidence.Value); + Assert.AreEqual(gotPosEclipse.SemiMinorConfidence.Value, expPosEclipse.SemiMinorConfidence.Value); + Assert.AreEqual(gotPosEclipse.SemiMajorOrientation.Value, expPosEclipse.SemiMajorOrientation.Value); + Assert.AreEqual(gotBasic.ReferencePosition.Altitude.AltitudeValue.Value, expBasic.ReferencePosition.Altitude.AltitudeValue.Value); + Assert.AreEqual(gotBasic.ReferencePosition.Altitude.AltitudeConfidence.Value, expBasic.ReferencePosition.Altitude.AltitudeConfidence.Value); + var gotHighFreq = got.Cam.CamParameters.HighFrequencyContainer.BasicVehicleContainerHighFrequency; var expHighFreq = exp.Cam.CamParameters.HighFrequencyContainer.BasicVehicleContainerHighFrequency; Assert.AreEqual(gotHighFreq.Heading.HeadingValue.Value, From 72577d4ff9c4bd7798c1e9c7c52dc4fe4b706e83 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Tue, 27 May 2025 16:12:07 +0200 Subject: [PATCH 25/32] Use upper case first letter for enums and avoid assigning a null to a boolean --- .../modules/cs/includes/boxedBooleanType.xsl | 2 +- .../modules/cs/includes/enumItem.xsl | 2 +- .../src/test/resources/ITS_CAM_v1.3.2.asn | 2 +- .../BinaryNotesTests/BinaryNotesTests.csproj | 5 +++ .../org/bn/coders/CoderTestUtilities.cs | 10 ++--- .../bn/coders/cam_asn/AltitudeConfidence.cs | 32 +++++++-------- .../{CauseCodeClass.cs => CauseCode.cs} | 16 ++++---- .../cam_asn/CurvatureCalculationMode.cs | 6 +-- .../bn/coders/cam_asn/CurvatureConfidence.cs | 16 ++++---- .../bn/coders/cam_asn/DangerousGoodsBasic.cs | 40 +++++++++---------- .../org/bn/coders/cam_asn/DriveDirection.cs | 6 +-- .../bn/coders/cam_asn/EmbarkationStatus.cs | 4 +- .../bn/coders/cam_asn/EmergencyContainer.cs | 4 +- .../bn/coders/cam_asn/HardShoulderStatus.cs | 6 +-- .../coders/cam_asn/PositioningSolutionType.cs | 12 +++--- .../bn/coders/cam_asn/ProtectedZoneType.cs | 2 +- .../bn/coders/cam_asn/RelevanceDistance.cs | 16 ++++---- .../cam_asn/RelevanceTrafficDirection.cs | 8 ++-- .../cam_asn/RequestResponseIndication.cs | 4 +- .../org/bn/coders/cam_asn/RoadType.cs | 8 ++-- .../bn/coders/cam_asn/SafetyCarContainer.cs | 4 +- .../org/bn/coders/cam_asn/StationarySince.cs | 8 ++-- .../org/bn/coders/cam_asn/TrafficRule.cs | 8 ++-- .../VehicleLengthConfidenceIndication.cs | 10 ++--- .../org/bn/coders/cam_asn/VehicleRole.cs | 30 +++++++------- .../bn/coders/cam_asn/YawRateConfidence.cs | 18 ++++----- .../coders/per/PERUnalignedCoderTestUtils.cs | 17 +++----- .../org/bn/coders/test_asn/ContentSchema.cs | 12 +++--- .../org/bn/coders/test_asn/ContentType.cs | 20 +++++----- .../org/bn/coders/test_asn/MixedEnumType.cs | 6 +-- .../bn/coders/test_asn/ProtectedZoneType.cs | 4 +- .../bn/coders/test_asn/SequenceWithDefault.cs | 6 +-- 32 files changed, 173 insertions(+), 171 deletions(-) rename BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/{CauseCodeClass.cs => CauseCode.cs} (76%) diff --git a/BNCompiler/src/main/resources/modules/cs/includes/boxedBooleanType.xsl b/BNCompiler/src/main/resources/modules/cs/includes/boxedBooleanType.xsl index a95965f..6f2d68a 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/boxedBooleanType.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/boxedBooleanType.xsl @@ -36,7 +36,7 @@ [ASN1BoxedType ( Name = "") ] public class : IASN1PreparedElement { - private bool val = null; + private bool val; [ASN1Boolean ( Name = "") ] diff --git a/BNCompiler/src/main/resources/modules/cs/includes/enumItem.xsl b/BNCompiler/src/main/resources/modules/cs/includes/enumItem.xsl index 027ffe3..7838015 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/enumItem.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/enumItem.xsl @@ -27,6 +27,6 @@ [ASN1EnumItem ( Name = "", HasTag = , Tag = )] - , + , diff --git a/BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn b/BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn index a1fdcb4..6e2530c 100644 --- a/BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn +++ b/BNCompiler/src/test/resources/ITS_CAM_v1.3.2.asn @@ -273,7 +273,7 @@ BEGIN } (0..4095) CauseCode ::= SEQUENCE { - causeCode CauseCodeType, + causeCodeT CauseCodeType, subCauseCode SubCauseCodeType } diff --git a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj index 51e288e..dbc339b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj +++ b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj @@ -31,6 +31,11 @@ PreserveNewest + + + + + diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs index fb26a1f..2bda361 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs @@ -42,7 +42,7 @@ public virtual TaggedNullSequence createTaggedNullSeq() public virtual ContentSchema createEnum() { ContentSchema schema = new ContentSchema(); - schema.Value = (ContentSchema.EnumType.multipart_mixed); + schema.Value = (ContentSchema.EnumType.Multipart_mixed); return schema; } public abstract byte[] createEnumBytes(); @@ -50,7 +50,7 @@ public virtual ContentSchema createEnum() public virtual MixedEnumType createMixedEnum() { MixedEnumType schema = new MixedEnumType(); - schema.Value = (MixedEnumType.EnumType.high); + schema.Value = (MixedEnumType.EnumType.High); return schema; } public abstract byte[] createMixedEnumBytes(); @@ -332,7 +332,7 @@ public SequenceWithDefault createSequenceWithDefaultValues() result.WithSeqOf2 = new TestPRN[] {new TestPRN("cc"), new TestPRN("ee")}; result.WithSeqOf3 = new StringArray() { Value = new String[] {"fff", "ggg"} }; result.WithEnumDef = new SequenceWithDefault.WithEnumDefEnumType(); - result.WithEnumDef.Value = SequenceWithDefault.WithEnumDefEnumType.EnumType.two; + result.WithEnumDef.Value = SequenceWithDefault.WithEnumDefEnumType.EnumType.Two; return result; } public SequenceWithDefault createSequenceWithUntouchedDefaultValues() @@ -643,7 +643,7 @@ public ExtendedEnumSeq createTestExtendedEnum1() { ExtendedEnumSeq seq = new ExtendedEnumSeq(); seq.Prot = new(); - seq.Prot.Value = ProtectedZoneType.EnumType.permanentCenDsrcTolling; + seq.Prot.Value = ProtectedZoneType.EnumType.PermanentCenDsrcTolling; seq.Tail = 0x19; return seq; } @@ -654,7 +654,7 @@ public ExtendedEnumSeq createTestExtendedEnum2() { ExtendedEnumSeq seq = new ExtendedEnumSeq(); seq.Prot = new(); - seq.Prot.Value = ProtectedZoneType.EnumType.temporaryCenDsrcTolling; + seq.Prot.Value = ProtectedZoneType.EnumType.TemporaryCenDsrcTolling; seq.Tail = 0x19; return seq; } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs index 7965b94..76bfbff 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeConfidence.cs @@ -21,37 +21,37 @@ public class AltitudeConfidence : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "alt-000-01", HasTag = true , Tag = 0 )] - alt_000_01 , + Alt_000_01 , [ASN1EnumItem ( Name = "alt-000-02", HasTag = true , Tag = 1 )] - alt_000_02 , + Alt_000_02 , [ASN1EnumItem ( Name = "alt-000-05", HasTag = true , Tag = 2 )] - alt_000_05 , + Alt_000_05 , [ASN1EnumItem ( Name = "alt-000-10", HasTag = true , Tag = 3 )] - alt_000_10 , + Alt_000_10 , [ASN1EnumItem ( Name = "alt-000-20", HasTag = true , Tag = 4 )] - alt_000_20 , + Alt_000_20 , [ASN1EnumItem ( Name = "alt-000-50", HasTag = true , Tag = 5 )] - alt_000_50 , + Alt_000_50 , [ASN1EnumItem ( Name = "alt-001-00", HasTag = true , Tag = 6 )] - alt_001_00 , + Alt_001_00 , [ASN1EnumItem ( Name = "alt-002-00", HasTag = true , Tag = 7 )] - alt_002_00 , + Alt_002_00 , [ASN1EnumItem ( Name = "alt-005-00", HasTag = true , Tag = 8 )] - alt_005_00 , + Alt_005_00 , [ASN1EnumItem ( Name = "alt-010-00", HasTag = true , Tag = 9 )] - alt_010_00 , + Alt_010_00 , [ASN1EnumItem ( Name = "alt-020-00", HasTag = true , Tag = 10 )] - alt_020_00 , + Alt_020_00 , [ASN1EnumItem ( Name = "alt-050-00", HasTag = true , Tag = 11 )] - alt_050_00 , + Alt_050_00 , [ASN1EnumItem ( Name = "alt-100-00", HasTag = true , Tag = 12 )] - alt_100_00 , + Alt_100_00 , [ASN1EnumItem ( Name = "alt-200-00", HasTag = true , Tag = 13 )] - alt_200_00 , + Alt_200_00 , [ASN1EnumItem ( Name = "outOfRange", HasTag = true , Tag = 14 )] - outOfRange , + OutOfRange , [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 15 )] - unavailable , + Unavailable , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeClass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCode.cs similarity index 76% rename from BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeClass.cs rename to BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCode.cs index 3c37918..5f0157a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeClass.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCode.cs @@ -17,17 +17,19 @@ namespace its.cam { [ASN1PreparedElement] [ASN1Sequence ( Name = "CauseCode", IsExtensible = false, IsSet = false)] - public class CauseCodeClass : IASN1PreparedElement { + public class CauseCode : IASN1PreparedElement { - private CauseCodeType causeCode_ ; + private CauseCodeType causeCodeT_ ; - [ASN1Element ( Name = "causeCode", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + [ASN1Element ( Name = "causeCodeT", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] - public CauseCodeType CauseCode + public CauseCodeType CauseCodeT { - get { return causeCode_; } - set { causeCode_ = value; } + get { return causeCodeT_; } + set { causeCodeT_ = value; } } + + private SubCauseCodeType subCauseCode_ ; @@ -47,7 +49,7 @@ public void initWithDefaults() { } - private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CauseCodeClass)); + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(typeof(CauseCode)); public IASN1PreparedElementData PreparedData { get { return preparedData; } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs index aa0d6b4..5d59939 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureCalculationMode.cs @@ -21,11 +21,11 @@ public class CurvatureCalculationMode : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "yawRateUsed", HasTag = true , Tag = 0 )] - yawRateUsed , + YawRateUsed , [ASN1EnumItem ( Name = "yawRateNotUsed", HasTag = true , Tag = 1 )] - yawRateNotUsed , + YawRateNotUsed , [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 2 )] - unavailable , + Unavailable , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs index 5f05aed..c38dbc7 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureConfidence.cs @@ -21,21 +21,21 @@ public class CurvatureConfidence : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "onePerMeter-0-00002", HasTag = true , Tag = 0 )] - onePerMeter_0_00002 , + OnePerMeter_0_00002 , [ASN1EnumItem ( Name = "onePerMeter-0-0001", HasTag = true , Tag = 1 )] - onePerMeter_0_0001 , + OnePerMeter_0_0001 , [ASN1EnumItem ( Name = "onePerMeter-0-0005", HasTag = true , Tag = 2 )] - onePerMeter_0_0005 , + OnePerMeter_0_0005 , [ASN1EnumItem ( Name = "onePerMeter-0-002", HasTag = true , Tag = 3 )] - onePerMeter_0_002 , + OnePerMeter_0_002 , [ASN1EnumItem ( Name = "onePerMeter-0-01", HasTag = true , Tag = 4 )] - onePerMeter_0_01 , + OnePerMeter_0_01 , [ASN1EnumItem ( Name = "onePerMeter-0-1", HasTag = true , Tag = 5 )] - onePerMeter_0_1 , + OnePerMeter_0_1 , [ASN1EnumItem ( Name = "outOfRange", HasTag = true , Tag = 6 )] - outOfRange , + OutOfRange , [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 7 )] - unavailable , + Unavailable , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs index 0dda795..ef6d33b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousGoodsBasic.cs @@ -21,45 +21,45 @@ public class DangerousGoodsBasic : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "explosives1", HasTag = true , Tag = 0 )] - explosives1 , + Explosives1 , [ASN1EnumItem ( Name = "explosives2", HasTag = true , Tag = 1 )] - explosives2 , + Explosives2 , [ASN1EnumItem ( Name = "explosives3", HasTag = true , Tag = 2 )] - explosives3 , + Explosives3 , [ASN1EnumItem ( Name = "explosives4", HasTag = true , Tag = 3 )] - explosives4 , + Explosives4 , [ASN1EnumItem ( Name = "explosives5", HasTag = true , Tag = 4 )] - explosives5 , + Explosives5 , [ASN1EnumItem ( Name = "explosives6", HasTag = true , Tag = 5 )] - explosives6 , + Explosives6 , [ASN1EnumItem ( Name = "flammableGases", HasTag = true , Tag = 6 )] - flammableGases , + FlammableGases , [ASN1EnumItem ( Name = "nonFlammableGases", HasTag = true , Tag = 7 )] - nonFlammableGases , + NonFlammableGases , [ASN1EnumItem ( Name = "toxicGases", HasTag = true , Tag = 8 )] - toxicGases , + ToxicGases , [ASN1EnumItem ( Name = "flammableLiquids", HasTag = true , Tag = 9 )] - flammableLiquids , + FlammableLiquids , [ASN1EnumItem ( Name = "flammableSolids", HasTag = true , Tag = 10 )] - flammableSolids , + FlammableSolids , [ASN1EnumItem ( Name = "substancesLiableToSpontaneousCombustion", HasTag = true , Tag = 11 )] - substancesLiableToSpontaneousCombustion , + SubstancesLiableToSpontaneousCombustion , [ASN1EnumItem ( Name = "substancesEmittingFlammableGasesUponContactWithWater", HasTag = true , Tag = 12 )] - substancesEmittingFlammableGasesUponContactWithWater , + SubstancesEmittingFlammableGasesUponContactWithWater , [ASN1EnumItem ( Name = "oxidizingSubstances", HasTag = true , Tag = 13 )] - oxidizingSubstances , + OxidizingSubstances , [ASN1EnumItem ( Name = "organicPeroxides", HasTag = true , Tag = 14 )] - organicPeroxides , + OrganicPeroxides , [ASN1EnumItem ( Name = "toxicSubstances", HasTag = true , Tag = 15 )] - toxicSubstances , + ToxicSubstances , [ASN1EnumItem ( Name = "infectiousSubstances", HasTag = true , Tag = 16 )] - infectiousSubstances , + InfectiousSubstances , [ASN1EnumItem ( Name = "radioactiveMaterial", HasTag = true , Tag = 17 )] - radioactiveMaterial , + RadioactiveMaterial , [ASN1EnumItem ( Name = "corrosiveSubstances", HasTag = true , Tag = 18 )] - corrosiveSubstances , + CorrosiveSubstances , [ASN1EnumItem ( Name = "miscellaneousDangerousSubstances", HasTag = true , Tag = 19 )] - miscellaneousDangerousSubstances , + MiscellaneousDangerousSubstances , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs index dd68ae9..7bd4db7 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DriveDirection.cs @@ -21,11 +21,11 @@ public class DriveDirection : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "forward", HasTag = true , Tag = 0 )] - forward , + Forward , [ASN1EnumItem ( Name = "backward", HasTag = true , Tag = 1 )] - backward , + Backward , [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 2 )] - unavailable , + Unavailable , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs index 31a5681..3eb2cfa 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmbarkationStatus.cs @@ -19,11 +19,11 @@ namespace its.cam { [ASN1BoxedType ( Name = "EmbarkationStatus") ] public class EmbarkationStatus: IASN1PreparedElement { - private bool? val = null; + private bool val; [ASN1Boolean ( Name = "EmbarkationStatus") ] - public bool? Value + public bool Value { get { return val; } set { val = value; } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs index e8b89cb..3e00a76 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyContainer.cs @@ -31,13 +31,13 @@ public LightBarSirenInUse LightBarSirenInUse - private CauseCodeClass incidentIndication_ ; + private CauseCode incidentIndication_ ; private bool incidentIndication_present = false ; [ASN1Element ( Name = "incidentIndication", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] - public CauseCodeClass IncidentIndication + public CauseCode IncidentIndication { get { return incidentIndication_; } set { incidentIndication_ = value; incidentIndication_present = true; } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs index 661809d..934c0eb 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HardShoulderStatus.cs @@ -21,11 +21,11 @@ public class HardShoulderStatus : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "availableForStopping", HasTag = true , Tag = 0 )] - availableForStopping , + AvailableForStopping , [ASN1EnumItem ( Name = "closed", HasTag = true , Tag = 1 )] - closed , + Closed , [ASN1EnumItem ( Name = "availableForDriving", HasTag = true , Tag = 2 )] - availableForDriving , + AvailableForDriving , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs index 192b347..3d148f3 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PositioningSolutionType.cs @@ -21,17 +21,17 @@ public class PositioningSolutionType : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "noPositioningSolution", HasTag = true , Tag = 0 )] - noPositioningSolution , + NoPositioningSolution , [ASN1EnumItem ( Name = "sGNSS", HasTag = true , Tag = 1 )] - sGNSS , + SGNSS , [ASN1EnumItem ( Name = "dGNSS", HasTag = true , Tag = 2 )] - dGNSS , + DGNSS , [ASN1EnumItem ( Name = "sGNSSplusDR", HasTag = true , Tag = 3 )] - sGNSSplusDR , + SGNSSplusDR , [ASN1EnumItem ( Name = "dGNSSplusDR", HasTag = true , Tag = 4 )] - dGNSSplusDR , + DGNSSplusDR , [ASN1EnumItem ( Name = "dR", HasTag = true , Tag = 5 )] - dR , + DR , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs index 02f47a9..7f90a48 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneType.cs @@ -21,7 +21,7 @@ public class ProtectedZoneType : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "cenDsrcTolling", HasTag = true , Tag = 0 )] - cenDsrcTolling , + CenDsrcTolling , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs index 8248d93..85e226f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceDistance.cs @@ -21,21 +21,21 @@ public class RelevanceDistance : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "lessThan50m", HasTag = true , Tag = 0 )] - lessThan50m , + LessThan50m , [ASN1EnumItem ( Name = "lessThan100m", HasTag = true , Tag = 1 )] - lessThan100m , + LessThan100m , [ASN1EnumItem ( Name = "lessThan200m", HasTag = true , Tag = 2 )] - lessThan200m , + LessThan200m , [ASN1EnumItem ( Name = "lessThan500m", HasTag = true , Tag = 3 )] - lessThan500m , + LessThan500m , [ASN1EnumItem ( Name = "lessThan1000m", HasTag = true , Tag = 4 )] - lessThan1000m , + LessThan1000m , [ASN1EnumItem ( Name = "lessThan5km", HasTag = true , Tag = 5 )] - lessThan5km , + LessThan5km , [ASN1EnumItem ( Name = "lessThan10km", HasTag = true , Tag = 6 )] - lessThan10km , + LessThan10km , [ASN1EnumItem ( Name = "over10km", HasTag = true , Tag = 7 )] - over10km , + Over10km , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs index 7d6035e..aa2a00e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RelevanceTrafficDirection.cs @@ -21,13 +21,13 @@ public class RelevanceTrafficDirection : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "allTrafficDirections", HasTag = true , Tag = 0 )] - allTrafficDirections , + AllTrafficDirections , [ASN1EnumItem ( Name = "upstreamTraffic", HasTag = true , Tag = 1 )] - upstreamTraffic , + UpstreamTraffic , [ASN1EnumItem ( Name = "downstreamTraffic", HasTag = true , Tag = 2 )] - downstreamTraffic , + DownstreamTraffic , [ASN1EnumItem ( Name = "oppositeTraffic", HasTag = true , Tag = 3 )] - oppositeTraffic , + OppositeTraffic , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs index d2000f9..7e57574 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RequestResponseIndication.cs @@ -21,9 +21,9 @@ public class RequestResponseIndication : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "request", HasTag = true , Tag = 0 )] - request , + Request , [ASN1EnumItem ( Name = "response", HasTag = true , Tag = 1 )] - response , + Response , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs index 5cabd3e..d8d6484 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadType.cs @@ -21,13 +21,13 @@ public class RoadType : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "urban-NoStructuralSeparationToOppositeLanes", HasTag = true , Tag = 0 )] - urban_NoStructuralSeparationToOppositeLanes , + Urban_NoStructuralSeparationToOppositeLanes , [ASN1EnumItem ( Name = "urban-WithStructuralSeparationToOppositeLanes", HasTag = true , Tag = 1 )] - urban_WithStructuralSeparationToOppositeLanes , + Urban_WithStructuralSeparationToOppositeLanes , [ASN1EnumItem ( Name = "nonUrban-NoStructuralSeparationToOppositeLanes", HasTag = true , Tag = 2 )] - nonUrban_NoStructuralSeparationToOppositeLanes , + NonUrban_NoStructuralSeparationToOppositeLanes , [ASN1EnumItem ( Name = "nonUrban-WithStructuralSeparationToOppositeLanes", HasTag = true , Tag = 3 )] - nonUrban_WithStructuralSeparationToOppositeLanes , + NonUrban_WithStructuralSeparationToOppositeLanes , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs index 484ca7e..84996b8 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SafetyCarContainer.cs @@ -31,13 +31,13 @@ public LightBarSirenInUse LightBarSirenInUse - private CauseCodeClass incidentIndication_ ; + private CauseCode incidentIndication_ ; private bool incidentIndication_present = false ; [ASN1Element ( Name = "incidentIndication", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] - public CauseCodeClass IncidentIndication + public CauseCode IncidentIndication { get { return incidentIndication_; } set { incidentIndication_ = value; incidentIndication_present = true; } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs index 46e06f7..b14a4fc 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationarySince.cs @@ -21,13 +21,13 @@ public class StationarySince : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "lessThan1Minute", HasTag = true , Tag = 0 )] - lessThan1Minute , + LessThan1Minute , [ASN1EnumItem ( Name = "lessThan2Minutes", HasTag = true , Tag = 1 )] - lessThan2Minutes , + LessThan2Minutes , [ASN1EnumItem ( Name = "lessThan15Minutes", HasTag = true , Tag = 2 )] - lessThan15Minutes , + LessThan15Minutes , [ASN1EnumItem ( Name = "equalOrGreater15Minutes", HasTag = true , Tag = 3 )] - equalOrGreater15Minutes , + EqualOrGreater15Minutes , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs index a8e5bd4..6eeb312 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficRule.cs @@ -21,13 +21,13 @@ public class TrafficRule : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "noPassing", HasTag = true , Tag = 0 )] - noPassing , + NoPassing , [ASN1EnumItem ( Name = "noPassingForTrucks", HasTag = true , Tag = 1 )] - noPassingForTrucks , + NoPassingForTrucks , [ASN1EnumItem ( Name = "passToRight", HasTag = true , Tag = 2 )] - passToRight , + PassToRight , [ASN1EnumItem ( Name = "passToLeft", HasTag = true , Tag = 3 )] - passToLeft , + PassToLeft , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs index ea8c495..98f103c 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthConfidenceIndication.cs @@ -21,15 +21,15 @@ public class VehicleLengthConfidenceIndication : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "noTrailerPresent", HasTag = true , Tag = 0 )] - noTrailerPresent , + NoTrailerPresent , [ASN1EnumItem ( Name = "trailerPresentWithKnownLength", HasTag = true , Tag = 1 )] - trailerPresentWithKnownLength , + TrailerPresentWithKnownLength , [ASN1EnumItem ( Name = "trailerPresentWithUnknownLength", HasTag = true , Tag = 2 )] - trailerPresentWithUnknownLength , + TrailerPresentWithUnknownLength , [ASN1EnumItem ( Name = "trailerPresenceIsUnknown", HasTag = true , Tag = 3 )] - trailerPresenceIsUnknown , + TrailerPresenceIsUnknown , [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 4 )] - unavailable , + Unavailable , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs index 0be84da..c323a39 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleRole.cs @@ -23,35 +23,35 @@ public enum EnumType { [ASN1EnumItem ( Name = "default", HasTag = true , Tag = 0 )] Default , [ASN1EnumItem ( Name = "publicTransport", HasTag = true , Tag = 1 )] - publicTransport , + PublicTransport , [ASN1EnumItem ( Name = "specialTransport", HasTag = true , Tag = 2 )] - specialTransport , + SpecialTransport , [ASN1EnumItem ( Name = "dangerousGoods", HasTag = true , Tag = 3 )] - dangerousGoods , + DangerousGoods , [ASN1EnumItem ( Name = "roadWork", HasTag = true , Tag = 4 )] - roadWork , + RoadWork , [ASN1EnumItem ( Name = "rescue", HasTag = true , Tag = 5 )] - rescue , + Rescue , [ASN1EnumItem ( Name = "emergency", HasTag = true , Tag = 6 )] - emergency , + Emergency , [ASN1EnumItem ( Name = "safetyCar", HasTag = true , Tag = 7 )] - safetyCar , + SafetyCar , [ASN1EnumItem ( Name = "agriculture", HasTag = true , Tag = 8 )] - agriculture , + Agriculture , [ASN1EnumItem ( Name = "commercial", HasTag = true , Tag = 9 )] - commercial , + Commercial , [ASN1EnumItem ( Name = "military", HasTag = true , Tag = 10 )] - military , + Military , [ASN1EnumItem ( Name = "roadOperator", HasTag = true , Tag = 11 )] - roadOperator , + RoadOperator , [ASN1EnumItem ( Name = "taxi", HasTag = true , Tag = 12 )] - taxi , + Taxi , [ASN1EnumItem ( Name = "reserved1", HasTag = true , Tag = 13 )] - reserved1 , + Reserved1 , [ASN1EnumItem ( Name = "reserved2", HasTag = true , Tag = 14 )] - reserved2 , + Reserved2 , [ASN1EnumItem ( Name = "reserved3", HasTag = true , Tag = 15 )] - reserved3 , + Reserved3 , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs index a607254..c41f77a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateConfidence.cs @@ -21,23 +21,23 @@ public class YawRateConfidence : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "degSec-000-01", HasTag = true , Tag = 0 )] - degSec_000_01 , + DegSec_000_01 , [ASN1EnumItem ( Name = "degSec-000-05", HasTag = true , Tag = 1 )] - degSec_000_05 , + DegSec_000_05 , [ASN1EnumItem ( Name = "degSec-000-10", HasTag = true , Tag = 2 )] - degSec_000_10 , + DegSec_000_10 , [ASN1EnumItem ( Name = "degSec-001-00", HasTag = true , Tag = 3 )] - degSec_001_00 , + DegSec_001_00 , [ASN1EnumItem ( Name = "degSec-005-00", HasTag = true , Tag = 4 )] - degSec_005_00 , + DegSec_005_00 , [ASN1EnumItem ( Name = "degSec-010-00", HasTag = true , Tag = 5 )] - degSec_010_00 , + DegSec_010_00 , [ASN1EnumItem ( Name = "degSec-100-00", HasTag = true , Tag = 6 )] - degSec_100_00 , + DegSec_100_00 , [ASN1EnumItem ( Name = "outOfRange", HasTag = true , Tag = 7 )] - outOfRange , + OutOfRange , [ASN1EnumItem ( Name = "unavailable", HasTag = true , Tag = 8 )] - unavailable , + Unavailable , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index b919b78..7f5f9d0 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -387,11 +387,6 @@ public static CAM createCam() cam.Cam.GenerationDeltaTime = new(1); cam.Cam.CamParameters = new(); cam.Cam.CamParameters.BasicContainer = new() - cam.Cam.CamParameters.BasicContainer.StationType = new StationType(0); - cam.Cam.CamParameters.BasicContainer.ReferencePosition = new(); - cam.Cam.CamParameters.BasicContainer.ReferencePosition.Latitude = new(10); - cam.Cam.CamParameters.BasicContainer.ReferencePosition.Longitude = new(10); - cam.Cam.CamParameters.BasicContainer.ReferencePosition.PositionConfidenceEllipse = new() { StationType = new StationType(0), ReferencePosition = new() @@ -409,7 +404,7 @@ public static CAM createCam() AltitudeValue = new(0), AltitudeConfidence = new() { - Value = AltitudeConfidence.EnumType.alt_000_01 + Value = AltitudeConfidence.EnumType.Alt_000_01 } } } @@ -431,7 +426,7 @@ public static CAM createCam() }, DriveDirection = new() { - Value = DriveDirection.EnumType.forward + Value = DriveDirection.EnumType.Forward }, VehicleLength = new() { @@ -439,7 +434,7 @@ public static CAM createCam() VehicleLengthConfidenceIndication = new() { - Value = VehicleLengthConfidenceIndication.EnumType.noTrailerPresent + Value = VehicleLengthConfidenceIndication.EnumType.NoTrailerPresent } }, VehicleWidth = new(1), @@ -453,19 +448,19 @@ public static CAM createCam() CurvatureValue = new(0), CurvatureConfidence = new() { - Value = CurvatureConfidence.EnumType.onePerMeter_0_00002 + Value = CurvatureConfidence.EnumType.OnePerMeter_0_00002 } }, CurvatureCalculationMode = new() { - Value = CurvatureCalculationMode.EnumType.yawRateUsed + Value = CurvatureCalculationMode.EnumType.YawRateUsed }, YawRate = new() { YawRateValue = new(0), YawRateConfidence = new() { - Value = YawRateConfidence.EnumType.degSec_000_01 + Value = YawRateConfidence.EnumType.DegSec_000_01 } } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs index 773b875..b137881 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs @@ -21,17 +21,17 @@ public class ContentSchema : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "multipart_any", HasTag = true , Tag = 110 )] - multipart_any , + Multipart_any , [ASN1EnumItem ( Name = "multipart_mixed", HasTag = true , Tag = 111 )] - multipart_mixed , + Multipart_mixed , [ASN1EnumItem ( Name = "multipart_form_data", HasTag = true , Tag = 112 )] - multipart_form_data , + Multipart_form_data , [ASN1EnumItem ( Name = "multipart_byteranges", HasTag = true , Tag = 113 )] - multipart_byteranges , + Multipart_byteranges , [ASN1EnumItem ( Name = "multipart_alternative", HasTag = true , Tag = 114 )] - multipart_alternative , + Multipart_alternative , [ASN1EnumItem ( Name = "multipart_related", HasTag = true , Tag = 175 )] - multipart_related , + Multipart_related , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs index 0f87a47..55ed5ed 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs @@ -21,25 +21,25 @@ public class ContentType : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "text_any", HasTag = true , Tag = 100 )] - text_any , + Text_any , [ASN1EnumItem ( Name = "text_html", HasTag = true , Tag = 101 )] - text_html , + Text_html , [ASN1EnumItem ( Name = "text_plain", HasTag = true , Tag = 102 )] - text_plain , + Text_plain , [ASN1EnumItem ( Name = "audio_x_midi", HasTag = true , Tag = 306 )] - audio_x_midi , + Audio_x_midi , [ASN1EnumItem ( Name = "video_any", HasTag = true , Tag = 400 )] - video_any , + Video_any , [ASN1EnumItem ( Name = "video_mpeg", HasTag = true , Tag = 401 )] - video_mpeg , + Video_mpeg , [ASN1EnumItem ( Name = "video_avi", HasTag = true , Tag = 402 )] - video_avi , + Video_avi , [ASN1EnumItem ( Name = "video_quicktime", HasTag = true , Tag = 403 )] - video_quicktime , + Video_quicktime , [ASN1EnumItem ( Name = "video_x_msvideo", HasTag = true , Tag = 404 )] - video_x_msvideo , + Video_x_msvideo , [ASN1EnumItem ( Name = "application_smil", HasTag = true , Tag = 500 )] - application_smil , + Application_smil , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs index 3968ba3..aa775c0 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/MixedEnumType.cs @@ -21,11 +21,11 @@ public class MixedEnumType : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "low", HasTag = true , Tag = 3 )] - low , + Low , [ASN1EnumItem ( Name = "mid", HasTag = true , Tag = 8 )] - mid , + Mid , [ASN1EnumItem ( Name = "high", HasTag = true , Tag = 101 )] - high , + High , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs index 8f8b1b1..2e0b1e3 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ProtectedZoneType.cs @@ -21,9 +21,9 @@ public class ProtectedZoneType : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "permanentCenDsrcTolling", HasTag = true , Tag = 0 )] - permanentCenDsrcTolling , + PermanentCenDsrcTolling , [ASN1EnumItem ( Name = "temporaryCenDsrcTolling", HasTag = true , Tag = 1 )] - temporaryCenDsrcTolling , + TemporaryCenDsrcTolling , } private EnumType val; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs index cbec605..4468596 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs @@ -191,11 +191,11 @@ public class WithEnumDefEnumType : IASN1PreparedElement { public enum EnumType { [ASN1EnumItem ( Name = "one", HasTag = true , Tag = 1 )] - one , + One , [ASN1EnumItem ( Name = "two", HasTag = true , Tag = 2 )] - two , + Two , [ASN1EnumItem ( Name = "three", HasTag = true , Tag = 3 )] - three , + Three , } private EnumType val; From 080960f26e77a4e518c0fffd01b7229c931ffd8e Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Wed, 28 May 2025 00:50:27 +0200 Subject: [PATCH 26/32] Support multiple input files --- BNCompiler/pom.xml | 11 +- .../java/org/bn/compiler/CompilerArgs.java | 22 +--- .../src/main/java/org/bn/compiler/Main.java | 108 +++++++++++++++--- .../bn/compiler/parser/model/ASN1Model.java | 2 +- .../modules/cs/includes/componentDefaults.xsl | 4 +- .../modules/cs/includes/componentTypeName.xsl | 6 +- .../cs/includes/doDeterminateEndValue.xsl | 2 +- .../cs/includes/elementDefaultValue.xsl | 4 +- .../src/main/resources/modules/cs/main.xsl | 30 ++--- .../java/includes/componentDefaults.xsl | 4 +- .../java/includes/componentTypeName.xsl | 6 +- .../java/includes/doDeterminateEndValue.xsl | 2 +- .../java/includes/elementDefaultValue.xsl | 2 +- .../src/main/resources/modules/java/main.xsl | 32 +++--- .../test/java/org/bn/compiler/MainTest.java | 8 +- .../org/bn/compiler/parser/ASNParserTest.java | 16 +-- .../bn/coders/test_asn/SequenceWithDefault.cs | 2 +- 17 files changed, 162 insertions(+), 99 deletions(-) diff --git a/BNCompiler/pom.xml b/BNCompiler/pom.xml index bd23b63..48b3fac 100644 --- a/BNCompiler/pom.xml +++ b/BNCompiler/pom.xml @@ -36,11 +36,6 @@ antlr 2.7.7 - - org.lineargs - LineArgs - 1.1.0 - jakarta.xml.bind jakarta.xml.bind-api @@ -52,6 +47,12 @@ 4.0.4 runtime + + + commons-cli + commons-cli + 1.9.0 + diff --git a/BNCompiler/src/main/java/org/bn/compiler/CompilerArgs.java b/BNCompiler/src/main/java/org/bn/compiler/CompilerArgs.java index db1fe15..da8f736 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/CompilerArgs.java +++ b/BNCompiler/src/main/java/org/bn/compiler/CompilerArgs.java @@ -15,28 +15,16 @@ */ package org.bn.compiler; -import org.lineargs.Option; -import org.lineargs.constraints.RegexConstraint; - public class CompilerArgs { - @Option(name = "--moduleName", shortName = "-m", description = "Binding module name ('cs' or 'java')") - @RegexConstraint(mask = ".+") private String moduleName = null; - @Option(name = "--outputDir", shortName = "-o", description = "Output directory name", isOptional = true) - @RegexConstraint(mask = ".+") private String outputDir = "output/"; - @Option(name = "--fileName", shortName = "-f", description = "Input ASN.1 filename") - @RegexConstraint(mask = ".+") - private String inputFileName = null; + private String[] inputFileNames = null; - @Option(name = "--namespace", shortName = "-ns", description = "Generate classes with specified namespace/package name", isOptional = true) - @RegexConstraint(mask = ".+") private String namespace = null; - @Option(name = "--model-only", shortName = "-x", description = "Generate only the ASN.1 model (as XML)", isOptional = true) private Boolean generateModelOnly = false; public String getModuleName() { @@ -55,12 +43,12 @@ public void setOutputDir(String outputDir) { this.outputDir = outputDir; } - public String getInputFileName() { - return inputFileName; + public String[] getInputFileNames() { + return inputFileNames; } - public void setInputFileName(String inputFileName) { - this.inputFileName = inputFileName; + public void setInputFileName(String[] inputFileNames) { + this.inputFileNames = inputFileNames; } public String getNamespace() { diff --git a/BNCompiler/src/main/java/org/bn/compiler/Main.java b/BNCompiler/src/main/java/org/bn/compiler/Main.java index 8ed8513..90a6750 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/Main.java +++ b/BNCompiler/src/main/java/org/bn/compiler/Main.java @@ -32,13 +32,14 @@ import org.bn.compiler.parser.ASNParser; import org.bn.compiler.parser.model.ASN1Model; import org.bn.compiler.parser.model.ASNModule; -import org.lineargs.LineArgsParser; + +import org.apache.commons.cli.*; public class Main { private static final String VERSION = "1.6"; - private CompilerArgs arguments = null; + private CompilerArgs arguments = new CompilerArgs(); public static void main(String args[]) { try { @@ -51,20 +52,84 @@ public static void main(String args[]) { } public void start(String[] args) throws Exception { - LineArgsParser parser = new LineArgsParser(); - if (args.length > 0) { - arguments = parser.parse(CompilerArgs.class, args); + Options options = new Options(); + + Option moduleOption = Option.builder("m") + .longOpt("moduleName") + .hasArg() + .desc("Binding module name ('cs' or 'java')") + .required() + .build(); + options.addOption(moduleOption); + Option outputDirOption = Option.builder("o") + .longOpt("outputDir") + .hasArg() + .desc("Output directory name") + .optionalArg(true) + .build(); + options.addOption(outputDirOption); + Option namespaceOption = Option.builder("ns") + .longOpt("namespace") + .hasArg() + .desc("Generate classes with specified namespace/package name") + .optionalArg(true) + .build(); + options.addOption(namespaceOption); + Option generateModelOnlyOption = Option.builder("x") + .longOpt("model-only") + .desc("Generate only the ASN.1 model (as XML)") + .optionalArg(true) + .build(); + options.addOption(generateModelOnlyOption); + Option helpOption = Option.builder("h") + .longOpt("help") + .desc("Show help message") + .build(); + options.addOption(helpOption); + + CommandLineParser parser = new DefaultParser(); + HelpFormatter formatter = new HelpFormatter(); + String executable = "bncompiler-" + VERSION + ".jar"; + + try { + CommandLine cmd = parser.parse(options, args); + // Show help and exit if --help is used + if (cmd.hasOption("h")) { + printHelp(formatter, options, executable); + return; + } + + arguments.setModuleName( cmd.getOptionValue("m") ); + arguments.setOutputDir( cmd.getOptionValue("o") ); + arguments.setNamespace( cmd.getOptionValue("ns") ); + arguments.setGenerateModelOnly( cmd.hasOption("x") ); + arguments.setInputFileName( cmd.getArgs() ); // Remaining arguments + + if (arguments.getInputFileNames() == null || arguments.getInputFileNames().length == 0) { + throw new ParseException("No input files specified."); + } + Module module = new Module(arguments.getModuleName(), arguments.getOutputDir()); startForModule(module); - } else { - parser.printHelp(CompilerArgs.class, System.out); + } catch (ParseException e) { + System.err.println("Error: " + e.getMessage()); + printHelp(formatter, options, executable); + System.exit(1); } } + private static void printHelp(HelpFormatter formatter, Options options, String executable) { + String usage = executable + " --moduleName --outputDir -ns [file2] ..."; + String header = "\nParses a list of files for a specified animal type.\n\nOptions:"; + String footer = "\nExample:\n " + executable + "--moduleName cs --outputDir output_ns -ns test_asn test.asn\n\n" + + " " + executable + " --moduleName java --outputDir output_java -ns test_asn test.asn\n"; + formatter.printHelp(usage, header, options, footer, false); + } + private void startForModule(Module module) throws TransformerException, JAXBException, IOException, ANTLRException { if (!arguments.getGenerateModelOnly()) { System.out.println("Current directory: " + new File(".").getCanonicalPath()); - System.out.println("Compiling file: " + arguments.getInputFileName()); + System.out.println("Compiling file(s): " + String.join(", ", arguments.getInputFileNames())); ByteArrayOutputStream outputXml = new ByteArrayOutputStream(65535); createModel(outputXml, module); @@ -81,7 +146,12 @@ private void createModel(OutputStream outputXml, Module module) throws JAXBExcep if (arguments.getNamespace() != null) { model.moduleNS = arguments.getNamespace(); } else { - model.moduleNS = model.module.moduleIdentifier.name.toLowerCase(); + for (ASNModule m : model.modules) { + if (m.moduleIdentifier != null && m.moduleIdentifier.name != null) { + model.moduleNS = m.moduleIdentifier.name.toLowerCase(); + break; + } + } } } @@ -92,15 +162,19 @@ private void createModel(OutputStream outputXml, Module module) throws JAXBExcep } private ASN1Model createModelFromStream() throws FileNotFoundException, ANTLRException { - InputStream stream = new FileInputStream(arguments.getInputFileName()); - ASNLexer lexer = new ASNLexer(stream); - ASNParser parser = new ASNParser(lexer); - - ASNModule module = new ASNModule(); - parser.module_definition(module); - ASN1Model model = new ASN1Model(); - model.module = module; + model.modules = new java.util.ArrayList<>(); + for (String inputFile : arguments.getInputFileNames()) { + InputStream stream = new FileInputStream(inputFile); + ASNLexer lexer = new ASNLexer(stream); + ASNParser parser = new ASNParser(lexer); + + ASNModule module = new ASNModule(); + parser.module_definition(module); + + model.modules.add(module); + } + return model; } } diff --git a/BNCompiler/src/main/java/org/bn/compiler/parser/model/ASN1Model.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/ASN1Model.java index 3885101..fb9d06e 100644 --- a/BNCompiler/src/main/java/org/bn/compiler/parser/model/ASN1Model.java +++ b/BNCompiler/src/main/java/org/bn/compiler/parser/model/ASN1Model.java @@ -6,5 +6,5 @@ @XmlRootElement public class ASN1Model implements Serializable { public String outputDirectory; public String moduleNS; - public ASNModule module; + public java.util.ArrayList modules = new java.util.ArrayList(); } diff --git a/BNCompiler/src/main/resources/modules/cs/includes/componentDefaults.xsl b/BNCompiler/src/main/resources/modules/cs/includes/componentDefaults.xsl index 516d5da..1724564 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/componentDefaults.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/componentDefaults.xsl @@ -36,7 +36,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/BNCompiler/src/main/resources/modules/cs/includes/componentTypeName.xsl b/BNCompiler/src/main/resources/modules/cs/includes/componentTypeName.xsl index fc6add9..36f8f75 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/componentTypeName.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/componentTypeName.xsl @@ -27,14 +27,14 @@ - + - + true @@ -47,7 +47,7 @@ - + diff --git a/BNCompiler/src/main/resources/modules/cs/includes/doDeterminateEndValue.xsl b/BNCompiler/src/main/resources/modules/cs/includes/doDeterminateEndValue.xsl index ccc00ba..2d72707 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/doDeterminateEndValue.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/doDeterminateEndValue.xsl @@ -31,7 +31,7 @@ - + diff --git a/BNCompiler/src/main/resources/modules/cs/includes/elementDefaultValue.xsl b/BNCompiler/src/main/resources/modules/cs/includes/elementDefaultValue.xsl index 43586d7..ee72b89 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/elementDefaultValue.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/elementDefaultValue.xsl @@ -40,10 +40,10 @@ false new (); - param_.Value = .EnumType. + param_.Value = .EnumType. - + diff --git a/BNCompiler/src/main/resources/modules/cs/main.xsl b/BNCompiler/src/main/resources/modules/cs/main.xsl index fba5d37..822147f 100644 --- a/BNCompiler/src/main/resources/modules/cs/main.xsl +++ b/BNCompiler/src/main/resources/modules/cs/main.xsl @@ -51,77 +51,77 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/BNCompiler/src/main/resources/modules/java/includes/componentDefaults.xsl b/BNCompiler/src/main/resources/modules/java/includes/componentDefaults.xsl index 516d5da..1724564 100644 --- a/BNCompiler/src/main/resources/modules/java/includes/componentDefaults.xsl +++ b/BNCompiler/src/main/resources/modules/java/includes/componentDefaults.xsl @@ -36,7 +36,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/BNCompiler/src/main/resources/modules/java/includes/componentTypeName.xsl b/BNCompiler/src/main/resources/modules/java/includes/componentTypeName.xsl index 9460e21..5f80717 100644 --- a/BNCompiler/src/main/resources/modules/java/includes/componentTypeName.xsl +++ b/BNCompiler/src/main/resources/modules/java/includes/componentTypeName.xsl @@ -27,14 +27,14 @@ - + - + @@ -47,7 +47,7 @@ - + diff --git a/BNCompiler/src/main/resources/modules/java/includes/doDeterminateEndValue.xsl b/BNCompiler/src/main/resources/modules/java/includes/doDeterminateEndValue.xsl index ccc00ba..2d72707 100644 --- a/BNCompiler/src/main/resources/modules/java/includes/doDeterminateEndValue.xsl +++ b/BNCompiler/src/main/resources/modules/java/includes/doDeterminateEndValue.xsl @@ -31,7 +31,7 @@ - + diff --git a/BNCompiler/src/main/resources/modules/java/includes/elementDefaultValue.xsl b/BNCompiler/src/main/resources/modules/java/includes/elementDefaultValue.xsl index 65d0d20..89d2a70 100644 --- a/BNCompiler/src/main/resources/modules/java/includes/elementDefaultValue.xsl +++ b/BNCompiler/src/main/resources/modules/java/includes/elementDefaultValue.xsl @@ -43,7 +43,7 @@ param_.setValue(.EnumType.) - + diff --git a/BNCompiler/src/main/resources/modules/java/main.xsl b/BNCompiler/src/main/resources/modules/java/main.xsl index 1f4948c..d43dc30 100644 --- a/BNCompiler/src/main/resources/modules/java/main.xsl +++ b/BNCompiler/src/main/resources/modules/java/main.xsl @@ -51,82 +51,82 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/BNCompiler/src/test/java/org/bn/compiler/MainTest.java b/BNCompiler/src/test/java/org/bn/compiler/MainTest.java index 035b08a..25f0b0e 100644 --- a/BNCompiler/src/test/java/org/bn/compiler/MainTest.java +++ b/BNCompiler/src/test/java/org/bn/compiler/MainTest.java @@ -29,8 +29,8 @@ public void testJava() throws Exception { new Main().start(new String[] { "--moduleName", "java", "--outputDir", "testworkdir" + File.separator + "output", - "--fileName", "src" + File.separator + "test" + File.separator + "resources" + File.separator + "test.asn", - "-ns", "test_asn" + "-ns", "test_asn", + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "test.asn", }); } @@ -39,8 +39,8 @@ public void testCS() throws Exception { new Main().start(new String[] { "--moduleName", "cs", "--outputDir", "testworkdir" + File.separator + "output-cs", - "--fileName", "src" + File.separator + "test" + File.separator + "resources" + File.separator + "test.asn", - "-ns", "test_asn" + "-ns", "test_asn", + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "test.asn", }); } } \ No newline at end of file diff --git a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java index 5ce3654..676bb7f 100644 --- a/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java +++ b/BNCompiler/src/test/java/org/bn/compiler/parser/ASNParserTest.java @@ -35,7 +35,7 @@ private ASN1Model createFromStream() throws Exception { parser.module_definition(module); ASN1Model model = new ASN1Model(); - model.module = module; + model.modules.add(module); return model; } @@ -57,12 +57,12 @@ public void testJaxb() throws Exception { @Test public void testModule_definition() throws Exception { ASN1Model model = createFromStream(); - - assertEquals("TEST_ASN", model.module.moduleIdentifier.name); - assertEquals(23, model.module.asnTypes.sequenceSets.size()); - assertEquals(4, model.module.asnTypes.enums.size()); - assertEquals(8, model.module.asnTypes.characterStrings.size()); - assertEquals(1, model.module.asnTypes.octetStrings.size()); - assertEquals(10, model.module.asnTypes.sequenceSetsOf.size()); + ASNModule module = model.modules.get(0); + assertEquals("TEST_ASN", module.moduleIdentifier.name); + assertEquals(23, module.asnTypes.sequenceSets.size()); + assertEquals(4, module.asnTypes.enums.size()); + assertEquals(8, module.asnTypes.characterStrings.size()); + assertEquals(1, module.asnTypes.octetStrings.size()); + assertEquals(10, module.asnTypes.sequenceSetsOf.size()); } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs index 4468596..546bcc8 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SequenceWithDefault.cs @@ -319,7 +319,7 @@ public void initWithDefaults() { WithEnumDefEnumType param_WithEnumDef = new WithEnumDefEnumType(); - param_WithEnumDef.Value = WithEnumDefEnumType.EnumType.two; + param_WithEnumDef.Value = WithEnumDefEnumType.EnumType.Two; WithEnumDef = param_WithEnumDef; } From 839cdf01938b1e916e643d7e4b27f77535d2c85e Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Tue, 3 Jun 2025 12:32:11 +0200 Subject: [PATCH 27/32] Build using gitlab ci/cd --- .gitlab-ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b520cc0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +stages: + - build + +variables: + MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" + MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" + +# Use Maven + OpenJDK 17 image from Docker Hub +default: + image: maven:3.9.6-eclipse-temurin-17 + +cache: + key: ${CI_PROJECT_NAME} + paths: + - .m2/repository/ + +build: + stage: build + script: + - mvn $MAVEN_CLI_OPTS package --file pom.xml From 4e523875c220260bca52840bb8abbbd73612b986 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Tue, 3 Jun 2025 12:34:52 +0200 Subject: [PATCH 28/32] Remove MVN options --- .gitlab-ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b520cc0..97c12fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,18 +2,13 @@ stages: - build variables: - MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" - MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" + MAVEN_OPTS: "" + MAVEN_CLI_OPTS: "" # Use Maven + OpenJDK 17 image from Docker Hub default: image: maven:3.9.6-eclipse-temurin-17 -cache: - key: ${CI_PROJECT_NAME} - paths: - - .m2/repository/ - build: stage: build script: From 406c84fc577fca476e4086161444a65a4d5946f0 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Tue, 3 Jun 2025 12:45:15 +0200 Subject: [PATCH 29/32] Update the exmple scripts with the new command line working --- BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd | 2 +- BNCompiler/src/main/scripts/examples/example-test-compile.cmd | 2 +- BNCompiler/src/main/scripts/examples/example-test-compile.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd b/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd index 7222ced..134062a 100644 --- a/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd +++ b/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd @@ -1,2 +1,2 @@ -call ../bncompiler.cmd -m java -o output/ldapv3 -ns ldapv3 -f ldapv3.asn +call ../bncompiler.cmd -m java -o output/ldapv3 -ns ldapv3 ldapv3.asn javac -cp ../../../../JavaLibrary/target/binarynotes-1.6.jar output/ldapv3/*.java diff --git a/BNCompiler/src/main/scripts/examples/example-test-compile.cmd b/BNCompiler/src/main/scripts/examples/example-test-compile.cmd index 201d541..192a39e 100644 --- a/BNCompiler/src/main/scripts/examples/example-test-compile.cmd +++ b/BNCompiler/src/main/scripts/examples/example-test-compile.cmd @@ -1,2 +1,2 @@ -call ../bncompiler.cmd -m java -o output/test -ns org.bn.coders.test_asn -f test.asn +call ../bncompiler.cmd -m java -o output/test -ns org.bn.coders.test_asn test.asn javac -cp ../../../../JavaLibrary/target/binarynotes-1.6.jar output/test/*.java diff --git a/BNCompiler/src/main/scripts/examples/example-test-compile.sh b/BNCompiler/src/main/scripts/examples/example-test-compile.sh index 922ddad..f8efa48 100644 --- a/BNCompiler/src/main/scripts/examples/example-test-compile.sh +++ b/BNCompiler/src/main/scripts/examples/example-test-compile.sh @@ -1,3 +1,3 @@ #!/bin/sh -../bncompiler.sh -m java -o output/test -ns org.bn.coders.test_asn -f test.asn +../bncompiler.sh -m java -o output/test -ns org.bn.coders.test_asn test.asn From bc992556f650e5c7cd175c7ffff0839f26819847 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Tue, 3 Jun 2025 12:45:15 +0200 Subject: [PATCH 30/32] Update the exmple scripts with the new command line working --- BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd | 2 +- BNCompiler/src/main/scripts/examples/example-test-compile.cmd | 2 +- BNCompiler/src/main/scripts/examples/example-test-compile.sh | 2 +- JavaLibrary/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd b/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd index 7222ced..134062a 100644 --- a/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd +++ b/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd @@ -1,2 +1,2 @@ -call ../bncompiler.cmd -m java -o output/ldapv3 -ns ldapv3 -f ldapv3.asn +call ../bncompiler.cmd -m java -o output/ldapv3 -ns ldapv3 ldapv3.asn javac -cp ../../../../JavaLibrary/target/binarynotes-1.6.jar output/ldapv3/*.java diff --git a/BNCompiler/src/main/scripts/examples/example-test-compile.cmd b/BNCompiler/src/main/scripts/examples/example-test-compile.cmd index 201d541..192a39e 100644 --- a/BNCompiler/src/main/scripts/examples/example-test-compile.cmd +++ b/BNCompiler/src/main/scripts/examples/example-test-compile.cmd @@ -1,2 +1,2 @@ -call ../bncompiler.cmd -m java -o output/test -ns org.bn.coders.test_asn -f test.asn +call ../bncompiler.cmd -m java -o output/test -ns org.bn.coders.test_asn test.asn javac -cp ../../../../JavaLibrary/target/binarynotes-1.6.jar output/test/*.java diff --git a/BNCompiler/src/main/scripts/examples/example-test-compile.sh b/BNCompiler/src/main/scripts/examples/example-test-compile.sh index 922ddad..f8efa48 100644 --- a/BNCompiler/src/main/scripts/examples/example-test-compile.sh +++ b/BNCompiler/src/main/scripts/examples/example-test-compile.sh @@ -1,3 +1,3 @@ #!/bin/sh -../bncompiler.sh -m java -o output/test -ns org.bn.coders.test_asn -f test.asn +../bncompiler.sh -m java -o output/test -ns org.bn.coders.test_asn test.asn diff --git a/JavaLibrary/pom.xml b/JavaLibrary/pom.xml index 1d14bd8..4257973 100644 --- a/JavaLibrary/pom.xml +++ b/JavaLibrary/pom.xml @@ -66,7 +66,7 @@ org.bn.compiler.Main compile - -m java -o ${project.build.directory}/generated-test-sources/bncompiler/org/bn/coders/test_asn -ns org.bn.coders.test_asn -f ${basedir}/../BNCompiler/src/test/resources/test.asn + -m java -o ${project.build.directory}/generated-test-sources/bncompiler/org/bn/coders/test_asn -ns org.bn.coders.test_asn ${basedir}/../BNCompiler/src/test/resources/test.asn From 5672629633cf7708179ba6e39b346269a1f2cf33 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Tue, 3 Jun 2025 13:25:56 +0200 Subject: [PATCH 31/32] Add artifact to gitlab build --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97c12fe..6c072c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,3 +13,7 @@ build: stage: build script: - mvn $MAVEN_CLI_OPTS package --file pom.xml + artifacts: + paths: + - $CI_PROJECT_DIR/binarynotes/Dist/target/binarynotes-dist-1.6.zip + From 005389dcc7714e1513c5c554fc05d8d8e452f69c Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Mon, 9 Jun 2025 08:40:25 +0200 Subject: [PATCH 32/32] Generate code for named integers --- .../modules/cs/includes/boxedIntegerType.xsl | 8 +++-- BNCompiler/temp.xml | 4 +-- .../coders/cam_asn/AccelerationConfidence.cs | 8 +++-- .../bn/coders/cam_asn/AccidentSubCauseCode.cs | 14 +++++++-- ...seWeatherCondition_AdhesionSubCauseCode.cs | 16 ++++++++-- ...ion_ExtremeWeatherConditionSubCauseCode.cs | 12 ++++++-- ...therCondition_PrecipitationSubCauseCode.cs | 9 ++++-- ...WeatherCondition_VisibilitySubCauseCode.cs | 14 +++++++-- .../org/bn/coders/cam_asn/AltitudeValue.cs | 8 +++-- .../org/bn/coders/cam_asn/CauseCodeType.cs | 30 +++++++++++++++++-- .../cam_asn/CollisionRiskSubCauseCode.cs | 10 +++++-- .../org/bn/coders/cam_asn/CurvatureValue.cs | 9 ++++-- .../DangerousEndOfQueueSubCauseCode.cs | 10 +++++-- .../cam_asn/DangerousSituationSubCauseCode.cs | 13 ++++++-- .../org/bn/coders/cam_asn/DeltaAltitude.cs | 8 +++-- .../org/bn/coders/cam_asn/DeltaLatitude.cs | 8 +++-- .../org/bn/coders/cam_asn/DeltaLongitude.cs | 8 +++-- ...EmergencyVehicleApproachingSubCauseCode.cs | 8 +++-- .../bn/coders/cam_asn/GenerationDeltaTime.cs | 6 ++-- ...ousLocation_AnimalOnTheRoadSubCauseCode.cs | 10 +++++-- ...dousLocation_DangerousCurveSubCauseCode.cs | 11 +++++-- ...sLocation_ObstacleOnTheRoadSubCauseCode.cs | 13 ++++++-- ...usLocation_SurfaceConditionSubCauseCode.cs | 15 ++++++++-- .../bn/coders/cam_asn/HeadingConfidence.cs | 9 ++++-- .../org/bn/coders/cam_asn/HeadingValue.cs | 10 +++++-- .../org/bn/coders/cam_asn/HeightLonCarr.cs | 7 +++-- .../HumanPresenceOnTheRoadSubCauseCode.cs | 9 ++++-- .../cam_asn/HumanProblemSubCauseCode.cs | 8 +++-- .../bn/coders/cam_asn/InformationQuality.cs | 8 +++-- .../org/bn/coders/cam_asn/LanePosition.cs | 9 ++++-- .../cam_asn/LateralAccelerationValue.cs | 8 +++-- .../org/bn/coders/cam_asn/Latitude.cs | 8 +++-- .../org/bn/coders/cam_asn/Longitude.cs | 8 +++-- .../cam_asn/LongitudinalAccelerationValue.cs | 8 +++-- .../bn/coders/cam_asn/NumberOfOccupants.cs | 7 +++-- .../org/bn/coders/cam_asn/PathDeltaTime.cs | 6 ++-- .../org/bn/coders/cam_asn/PerformanceClass.cs | 8 +++-- .../org/bn/coders/cam_asn/PosCentMass.cs | 7 +++-- .../org/bn/coders/cam_asn/PosFrontAx.cs | 7 +++-- .../org/bn/coders/cam_asn/PosLonCarr.cs | 7 +++-- .../org/bn/coders/cam_asn/PosPillar.cs | 7 +++-- .../coders/cam_asn/PostCrashSubCauseCode.cs | 10 +++++-- .../org/bn/coders/cam_asn/ProtectedZoneID.cs | 5 ++-- .../bn/coders/cam_asn/ProtectedZoneRadius.cs | 6 ++-- .../org/bn/coders/cam_asn/PtActivationType.cs | 8 +++-- ...ueAndRecoveryWorkInProgressSubCauseCode.cs | 11 +++++-- .../coders/cam_asn/RoadworksSubCauseCode.cs | 12 ++++++-- .../org/bn/coders/cam_asn/SemiAxisLength.cs | 8 +++-- .../org/bn/coders/cam_asn/SequenceNumber.cs | 5 ++-- .../cam_asn/SignalViolationSubCauseCode.cs | 9 ++++-- .../coders/cam_asn/SlowVehicleSubCauseCode.cs | 14 +++++++-- .../org/bn/coders/cam_asn/SpeedConfidence.cs | 9 ++++-- .../org/bn/coders/cam_asn/SpeedLimit.cs | 6 ++-- .../org/bn/coders/cam_asn/SpeedValue.cs | 8 +++-- .../org/bn/coders/cam_asn/StationID.cs | 5 ++-- .../org/bn/coders/cam_asn/StationType.cs | 18 +++++++++-- .../cam_asn/StationaryVehicleSubCauseCode.cs | 11 +++++-- .../cam_asn/SteeringWheelAngleConfidence.cs | 8 +++-- .../coders/cam_asn/SteeringWheelAngleValue.cs | 9 ++++-- .../org/bn/coders/cam_asn/SubCauseCodeType.cs | 5 ++-- .../org/bn/coders/cam_asn/Temperature.cs | 8 +++-- .../org/bn/coders/cam_asn/TimestampIts.cs | 7 +++-- .../cam_asn/TrafficConditionSubCauseCode.cs | 14 +++++++-- .../bn/coders/cam_asn/TransmissionInterval.cs | 7 +++-- .../org/bn/coders/cam_asn/TurningRadius.cs | 7 +++-- .../org/bn/coders/cam_asn/ValidityDuration.cs | 7 +++-- .../cam_asn/VehicleBreakdownSubCauseCode.cs | 14 +++++++-- .../bn/coders/cam_asn/VehicleLengthValue.cs | 8 +++-- .../org/bn/coders/cam_asn/VehicleMass.cs | 7 +++-- .../org/bn/coders/cam_asn/VehicleWidth.cs | 8 +++-- .../cam_asn/VerticalAccelerationValue.cs | 8 +++-- .../org/bn/coders/cam_asn/WheelBaseVehicle.cs | 7 +++-- .../cam_asn/WrongWayDrivingSubCauseCode.cs | 8 +++-- .../org/bn/coders/cam_asn/YawRateValue.cs | 9 ++++-- .../coders/per/PERUnalignedCoderTestUtils.cs | 16 +++++----- .../org/bn/coders/test_asn/BugEnum.cs | 5 ++-- .../bn/coders/test_asn/ExtensibleInteger.cs | 5 ++-- .../org/bn/coders/test_asn/SubInteger.cs | 5 ++-- .../org/bn/coders/test_asn/TestI.cs | 5 ++-- .../org/bn/coders/test_asn/TestI14.cs | 5 ++-- .../org/bn/coders/test_asn/TestI16.cs | 5 ++-- .../org/bn/coders/test_asn/TestI32.cs | 5 ++-- .../org/bn/coders/test_asn/TestI8.cs | 5 ++-- .../org/bn/coders/test_asn/TestI8named.cs | 8 +++-- .../org/bn/coders/test_asn/TestIR.cs | 5 ++-- .../org/bn/coders/test_asn/TestLong.cs | 5 ++-- .../org/bn/coders/test_asn/TestNI.cs | 5 ++-- .../org/bn/coders/test_asn/TestNI2.cs | 5 ++-- .../BinaryNotesTests/test_asn_convert.py | 4 +-- 89 files changed, 583 insertions(+), 184 deletions(-) diff --git a/BNCompiler/src/main/resources/modules/cs/includes/boxedIntegerType.xsl b/BNCompiler/src/main/resources/modules/cs/includes/boxedIntegerType.xsl index 1784686..08485e7 100644 --- a/BNCompiler/src/main/resources/modules/cs/includes/boxedIntegerType.xsl +++ b/BNCompiler/src/main/resources/modules/cs/includes/boxedIntegerType.xsl @@ -36,9 +36,13 @@ [ASN1PreparedElement] [ASN1BoxedType ( Name = "" )] public class : IASN1PreparedElement { - + + + + public static readonly = new(); + private val; - + [ASN1Integer( Name = "" )] diff --git a/BNCompiler/temp.xml b/BNCompiler/temp.xml index ffa72ef..b034328 100644 --- a/BNCompiler/temp.xml +++ b/BNCompiler/temp.xml @@ -2,7 +2,7 @@ testworkdir\output test_asn - + BIT STRING @@ -7598,5 +7598,5 @@ true IMPLICIT - + diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs index 095f73f..50fc11e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "AccelerationConfidence" )] public class AccelerationConfidence: IASN1PreparedElement { - - private int val; + public static readonly AccelerationConfidence PointOneMeterPerSecSquared = new(1); + public static readonly AccelerationConfidence OutOfRange = new(101); + public static readonly AccelerationConfidence Unavailable = new(102); + + private int val; + [ASN1Integer( Name = "AccelerationConfidence" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 102L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs index f01c141..873e49f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.cs @@ -18,9 +18,19 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "AccidentSubCauseCode" )] public class AccidentSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly AccidentSubCauseCode Unavailable = new(0); + public static readonly AccidentSubCauseCode MultiVehicleAccident = new(1); + public static readonly AccidentSubCauseCode HeavyAccident = new(2); + public static readonly AccidentSubCauseCode AccidentInvolvingLorry = new(3); + public static readonly AccidentSubCauseCode AccidentInvolvingBus = new(4); + public static readonly AccidentSubCauseCode AccidentInvolvingHazardousMaterials = new(5); + public static readonly AccidentSubCauseCode AccidentOnOppositeLane = new(6); + public static readonly AccidentSubCauseCode UnsecuredAccident = new(7); + public static readonly AccidentSubCauseCode AssistanceRequested = new(8); + + private int val; + [ASN1Integer( Name = "AccidentSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs index 544a9d2..13a2c54 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.cs @@ -18,9 +18,21 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "AdverseWeatherCondition_AdhesionSubCauseCode" )] public class AdverseWeatherCondition_AdhesionSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode Unavailable = new(0); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode HeavyFrostOnRoad = new(1); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode FuelOnRoad = new(2); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode MudOnRoad = new(3); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode SnowOnRoad = new(4); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode IceOnRoad = new(5); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode BlackIceOnRoad = new(6); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode OilOnRoad = new(7); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode LooseChippings = new(8); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode InstantBlackIce = new(9); + public static readonly AdverseWeatherCondition_AdhesionSubCauseCode RoadsSalted = new(10); + + private int val; + [ASN1Integer( Name = "AdverseWeatherCondition-AdhesionSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs index fcd8e65..f8bf307 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs @@ -18,9 +18,17 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode" )] public class AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode Unavailable = new(0); + public static readonly AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode StrongWinds = new(1); + public static readonly AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode DamagingHail = new(2); + public static readonly AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode Hurricane = new(3); + public static readonly AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode Thunderstorm = new(4); + public static readonly AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode Tornado = new(5); + public static readonly AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode Blizzard = new(6); + + private int val; + [ASN1Integer( Name = "AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs index 607acc0..db5416b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "AdverseWeatherCondition_PrecipitationSubCauseCode" )] public class AdverseWeatherCondition_PrecipitationSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly AdverseWeatherCondition_PrecipitationSubCauseCode Unavailable = new(0); + public static readonly AdverseWeatherCondition_PrecipitationSubCauseCode HeavyRain = new(1); + public static readonly AdverseWeatherCondition_PrecipitationSubCauseCode HeavySnowfall = new(2); + public static readonly AdverseWeatherCondition_PrecipitationSubCauseCode SoftHail = new(3); + + private int val; + [ASN1Integer( Name = "AdverseWeatherCondition-PrecipitationSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs index bad1be8..7d9ed1d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.cs @@ -18,9 +18,19 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "AdverseWeatherCondition_VisibilitySubCauseCode" )] public class AdverseWeatherCondition_VisibilitySubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode Unavailable = new(0); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode Fog = new(1); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode Smoke = new(2); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode HeavySnowfall = new(3); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode HeavyRain = new(4); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode HeavyHail = new(5); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode LowSunGlare = new(6); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode Sandstorms = new(7); + public static readonly AdverseWeatherCondition_VisibilitySubCauseCode SwarmsOfInsects = new(8); + + private int val; + [ASN1Integer( Name = "AdverseWeatherCondition-VisibilitySubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs index df8577a..d3ef28e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "AltitudeValue" )] public class AltitudeValue: IASN1PreparedElement { - - private int val; + public static readonly AltitudeValue ReferenceEllipsoidSurface = new(0); + public static readonly AltitudeValue OneCentimeter = new(1); + public static readonly AltitudeValue Unavailable = new(800001); + + private int val; + [ASN1Integer( Name = "AltitudeValue" )] [ASN1ValueRangeConstraint ( Min = -100000L, Max = 800001L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs index 00662a1..96f0eac 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.cs @@ -18,9 +18,35 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "CauseCodeType" )] public class CauseCodeType: IASN1PreparedElement { - - private int val; + public static readonly CauseCodeType Reserved = new(0); + public static readonly CauseCodeType TrafficCondition = new(1); + public static readonly CauseCodeType Accident = new(2); + public static readonly CauseCodeType Roadworks = new(3); + public static readonly CauseCodeType AdverseWeatherCondition_Adhesion = new(6); + public static readonly CauseCodeType HazardousLocation_SurfaceCondition = new(9); + public static readonly CauseCodeType HazardousLocation_ObstacleOnTheRoad = new(10); + public static readonly CauseCodeType HazardousLocation_AnimalOnTheRoad = new(11); + public static readonly CauseCodeType HumanPresenceOnTheRoad = new(12); + public static readonly CauseCodeType WrongWayDriving = new(14); + public static readonly CauseCodeType RescueAndRecoveryWorkInProgress = new(15); + public static readonly CauseCodeType AdverseWeatherCondition_ExtremeWeatherCondition = new(17); + public static readonly CauseCodeType AdverseWeatherCondition_Visibility = new(18); + public static readonly CauseCodeType AdverseWeatherCondition_Precipitation = new(19); + public static readonly CauseCodeType SlowVehicle = new(26); + public static readonly CauseCodeType DangerousEndOfQueue = new(27); + public static readonly CauseCodeType VehicleBreakdown = new(91); + public static readonly CauseCodeType PostCrash = new(92); + public static readonly CauseCodeType HumanProblem = new(93); + public static readonly CauseCodeType StationaryVehicle = new(94); + public static readonly CauseCodeType EmergencyVehicleApproaching = new(95); + public static readonly CauseCodeType HazardousLocation_DangerousCurve = new(96); + public static readonly CauseCodeType CollisionRisk = new(97); + public static readonly CauseCodeType SignalViolation = new(98); + public static readonly CauseCodeType DangerousSituation = new(99); + + private int val; + [ASN1Integer( Name = "CauseCodeType" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs index 358edbf..4e8fd10 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.cs @@ -18,9 +18,15 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "CollisionRiskSubCauseCode" )] public class CollisionRiskSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly CollisionRiskSubCauseCode Unavailable = new(0); + public static readonly CollisionRiskSubCauseCode LongitudinalCollisionRisk = new(1); + public static readonly CollisionRiskSubCauseCode CrossingCollisionRisk = new(2); + public static readonly CollisionRiskSubCauseCode LateralCollisionRisk = new(3); + public static readonly CollisionRiskSubCauseCode VulnerableRoadUser = new(4); + + private int val; + [ASN1Integer( Name = "CollisionRiskSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs index 6d6e3e3..62ed035 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "CurvatureValue" )] public class CurvatureValue: IASN1PreparedElement { - - private int val; + public static readonly CurvatureValue Straight = new(0); + public static readonly CurvatureValue ReciprocalOf1MeterRadiusToRight = new(-30000); + public static readonly CurvatureValue ReciprocalOf1MeterRadiusToLeft = new(30000); + public static readonly CurvatureValue Unavailable = new(30001); + + private int val; + [ASN1Integer( Name = "CurvatureValue" )] [ASN1ValueRangeConstraint ( Min = -30000L, Max = 30001L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs index 5ae2553..b3dc87a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.cs @@ -18,9 +18,15 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "DangerousEndOfQueueSubCauseCode" )] public class DangerousEndOfQueueSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly DangerousEndOfQueueSubCauseCode Unavailable = new(0); + public static readonly DangerousEndOfQueueSubCauseCode SuddenEndOfQueue = new(1); + public static readonly DangerousEndOfQueueSubCauseCode QueueOverHill = new(2); + public static readonly DangerousEndOfQueueSubCauseCode QueueAroundBend = new(3); + public static readonly DangerousEndOfQueueSubCauseCode QueueInTunnel = new(4); + + private int val; + [ASN1Integer( Name = "DangerousEndOfQueueSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs index e3972eb..2961774 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.cs @@ -18,9 +18,18 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "DangerousSituationSubCauseCode" )] public class DangerousSituationSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly DangerousSituationSubCauseCode Unavailable = new(0); + public static readonly DangerousSituationSubCauseCode EmergencyElectronicBrakeEngaged = new(1); + public static readonly DangerousSituationSubCauseCode PreCrashSystemEngaged = new(2); + public static readonly DangerousSituationSubCauseCode EspEngaged = new(3); + public static readonly DangerousSituationSubCauseCode AbsEngaged = new(4); + public static readonly DangerousSituationSubCauseCode AebEngaged = new(5); + public static readonly DangerousSituationSubCauseCode BrakeWarningEngaged = new(6); + public static readonly DangerousSituationSubCauseCode CollisionRiskWarningEngaged = new(7); + + private int val; + [ASN1Integer( Name = "DangerousSituationSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs index 63ce6d4..d48d01b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "DeltaAltitude" )] public class DeltaAltitude: IASN1PreparedElement { - - private int val; + public static readonly DeltaAltitude OneCentimeterUp = new(1); + public static readonly DeltaAltitude OneCentimeterDown = new(-1); + public static readonly DeltaAltitude Unavailable = new(12800); + + private int val; + [ASN1Integer( Name = "DeltaAltitude" )] [ASN1ValueRangeConstraint ( Min = -12700L, Max = 12800L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs index 39edff7..d57fb70 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "DeltaLatitude" )] public class DeltaLatitude: IASN1PreparedElement { - - private int val; + public static readonly DeltaLatitude OneMicrodegreeNorth = new(10); + public static readonly DeltaLatitude OneMicrodegreeSouth = new(-10); + public static readonly DeltaLatitude Unavailable = new(131072); + + private int val; + [ASN1Integer( Name = "DeltaLatitude" )] [ASN1ValueRangeConstraint ( Min = -131071L, Max = 131072L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs index 2c5e6b0..43d6bc9 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "DeltaLongitude" )] public class DeltaLongitude: IASN1PreparedElement { - - private int val; + public static readonly DeltaLongitude OneMicrodegreeEast = new(10); + public static readonly DeltaLongitude OneMicrodegreeWest = new(-10); + public static readonly DeltaLongitude Unavailable = new(131072); + + private int val; + [ASN1Integer( Name = "DeltaLongitude" )] [ASN1ValueRangeConstraint ( Min = -131071L, Max = 131072L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs index 90b89e1..d6f7954 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "EmergencyVehicleApproachingSubCauseCode" )] public class EmergencyVehicleApproachingSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly EmergencyVehicleApproachingSubCauseCode Unavailable = new(0); + public static readonly EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproaching = new(1); + public static readonly EmergencyVehicleApproachingSubCauseCode PrioritizedVehicleApproaching = new(2); + + private int val; + [ASN1Integer( Name = "EmergencyVehicleApproachingSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs index 350c069..db5c5c7 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.cs @@ -18,9 +18,11 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "GenerationDeltaTime" )] public class GenerationDeltaTime: IASN1PreparedElement { - - private int val; + public static readonly GenerationDeltaTime OneMilliSec = new(1); + + private int val; + [ASN1Integer( Name = "GenerationDeltaTime" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 65535L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs index d5b0dae..6f909fb 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.cs @@ -18,9 +18,15 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HazardousLocation_AnimalOnTheRoadSubCauseCode" )] public class HazardousLocation_AnimalOnTheRoadSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly HazardousLocation_AnimalOnTheRoadSubCauseCode Unavailable = new(0); + public static readonly HazardousLocation_AnimalOnTheRoadSubCauseCode WildAnimals = new(1); + public static readonly HazardousLocation_AnimalOnTheRoadSubCauseCode HerdOfAnimals = new(2); + public static readonly HazardousLocation_AnimalOnTheRoadSubCauseCode SmallAnimals = new(3); + public static readonly HazardousLocation_AnimalOnTheRoadSubCauseCode LargeAnimals = new(4); + + private int val; + [ASN1Integer( Name = "HazardousLocation-AnimalOnTheRoadSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs index 1570eaf..bc46336 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.cs @@ -18,9 +18,16 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HazardousLocation_DangerousCurveSubCauseCode" )] public class HazardousLocation_DangerousCurveSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly HazardousLocation_DangerousCurveSubCauseCode Unavailable = new(0); + public static readonly HazardousLocation_DangerousCurveSubCauseCode DangerousLeftTurnCurve = new(1); + public static readonly HazardousLocation_DangerousCurveSubCauseCode DangerousRightTurnCurve = new(2); + public static readonly HazardousLocation_DangerousCurveSubCauseCode MultipleCurvesStartingWithUnknownTurningDirection = new(3); + public static readonly HazardousLocation_DangerousCurveSubCauseCode MultipleCurvesStartingWithLeftTurn = new(4); + public static readonly HazardousLocation_DangerousCurveSubCauseCode MultipleCurvesStartingWithRightTurn = new(5); + + private int val; + [ASN1Integer( Name = "HazardousLocation-DangerousCurveSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs index b6cf2c8..662197b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.cs @@ -18,9 +18,18 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HazardousLocation_ObstacleOnTheRoadSubCauseCode" )] public class HazardousLocation_ObstacleOnTheRoadSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode Unavailable = new(0); + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode ShedLoad = new(1); + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode PartsOfVehicles = new(2); + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode PartsOfTyres = new(3); + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode BigObjects = new(4); + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode FallenTrees = new(5); + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode HubCaps = new(6); + public static readonly HazardousLocation_ObstacleOnTheRoadSubCauseCode WaitingVehicles = new(7); + + private int val; + [ASN1Integer( Name = "HazardousLocation-ObstacleOnTheRoadSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs index 7f99be3..53f1750 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs @@ -18,9 +18,20 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HazardousLocation_SurfaceConditionSubCauseCode" )] public class HazardousLocation_SurfaceConditionSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly HazardousLocation_SurfaceConditionSubCauseCode Unavailable = new(0); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode Rockfalls = new(1); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode EarthquakeDamage = new(2); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode SewerCollapse = new(3); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode Subsidence = new(4); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode SnowDrifts = new(5); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode StormDamage = new(6); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode BurstPipe = new(7); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode VolcanoEruption = new(8); + public static readonly HazardousLocation_SurfaceConditionSubCauseCode FallingIce = new(9); + + private int val; + [ASN1Integer( Name = "HazardousLocation-SurfaceConditionSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs index 02bd2e9..1c2a974 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HeadingConfidence" )] public class HeadingConfidence: IASN1PreparedElement { - - private int val; + public static readonly HeadingConfidence EqualOrWithinZeroPointOneDegree = new(1); + public static readonly HeadingConfidence EqualOrWithinOneDegree = new(10); + public static readonly HeadingConfidence OutOfRange = new(126); + public static readonly HeadingConfidence Unavailable = new(127); + + private int val; + [ASN1Integer( Name = "HeadingConfidence" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs index b44bfcf..14608bd 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.cs @@ -18,9 +18,15 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HeadingValue" )] public class HeadingValue: IASN1PreparedElement { - - private int val; + public static readonly HeadingValue Wgs84North = new(0); + public static readonly HeadingValue Wgs84East = new(900); + public static readonly HeadingValue Wgs84South = new(1800); + public static readonly HeadingValue Wgs84West = new(2700); + public static readonly HeadingValue Unavailable = new(3601); + + private int val; + [ASN1Integer( Name = "HeadingValue" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 3601L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs index b22ec22..5177a4b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HeightLonCarr" )] public class HeightLonCarr: IASN1PreparedElement { - - private int val; + public static readonly HeightLonCarr OneCentimeter = new(1); + public static readonly HeightLonCarr Unavailable = new(100); + + private int val; + [ASN1Integer( Name = "HeightLonCarr" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 100L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs index 3de7a3d..74e3047 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HumanPresenceOnTheRoadSubCauseCode" )] public class HumanPresenceOnTheRoadSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly HumanPresenceOnTheRoadSubCauseCode Unavailable = new(0); + public static readonly HumanPresenceOnTheRoadSubCauseCode ChildrenOnRoadway = new(1); + public static readonly HumanPresenceOnTheRoadSubCauseCode CyclistOnRoadway = new(2); + public static readonly HumanPresenceOnTheRoadSubCauseCode MotorcyclistOnRoadway = new(3); + + private int val; + [ASN1Integer( Name = "HumanPresenceOnTheRoadSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs index 32ce86a..d3f55fe 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "HumanProblemSubCauseCode" )] public class HumanProblemSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly HumanProblemSubCauseCode Unavailable = new(0); + public static readonly HumanProblemSubCauseCode GlycemiaProblem = new(1); + public static readonly HumanProblemSubCauseCode HeartProblem = new(2); + + private int val; + [ASN1Integer( Name = "HumanProblemSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs index bd4c277..f54c875 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "InformationQuality" )] public class InformationQuality: IASN1PreparedElement { - - private int val; + public static readonly InformationQuality Unavailable = new(0); + public static readonly InformationQuality Lowest = new(1); + public static readonly InformationQuality Highest = new(7); + + private int val; + [ASN1Integer( Name = "InformationQuality" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 7L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs index a8e0131..8ce7c74 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "LanePosition" )] public class LanePosition: IASN1PreparedElement { - - private int val; + public static readonly LanePosition OffTheRoad = new(-1); + public static readonly LanePosition HardShoulder = new(0); + public static readonly LanePosition OutermostDrivingLane = new(1); + public static readonly LanePosition SecondLaneFromOutside = new(2); + + private int val; + [ASN1Integer( Name = "LanePosition" )] [ASN1ValueRangeConstraint ( Min = -1L, Max = 14L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs index e32766b..23d4b8f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "LateralAccelerationValue" )] public class LateralAccelerationValue: IASN1PreparedElement { - - private int val; + public static readonly LateralAccelerationValue PointOneMeterPerSecSquaredToRight = new(-1); + public static readonly LateralAccelerationValue PointOneMeterPerSecSquaredToLeft = new(1); + public static readonly LateralAccelerationValue Unavailable = new(161); + + private int val; + [ASN1Integer( Name = "LateralAccelerationValue" )] [ASN1ValueRangeConstraint ( Min = -160L, Max = 161L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs index 431f141..c00162e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "Latitude" )] public class Latitude: IASN1PreparedElement { - - private int val; + public static readonly Latitude OneMicrodegreeNorth = new(10); + public static readonly Latitude OneMicrodegreeSouth = new(-10); + public static readonly Latitude Unavailable = new(900000001); + + private int val; + [ASN1Integer( Name = "Latitude" )] [ASN1ValueRangeConstraint ( Min = -900000000L, Max = 900000001L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs index dff52e9..646b8ba 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "Longitude" )] public class Longitude: IASN1PreparedElement { - - private int val; + public static readonly Longitude OneMicrodegreeEast = new(10); + public static readonly Longitude OneMicrodegreeWest = new(-10); + public static readonly Longitude Unavailable = new(1800000001); + + private int val; + [ASN1Integer( Name = "Longitude" )] [ASN1ValueRangeConstraint ( Min = -1800000000L, Max = 1800000001L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs index f233e2b..d321bad 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "LongitudinalAccelerationValue" )] public class LongitudinalAccelerationValue: IASN1PreparedElement { - - private int val; + public static readonly LongitudinalAccelerationValue PointOneMeterPerSecSquaredForward = new(1); + public static readonly LongitudinalAccelerationValue PointOneMeterPerSecSquaredBackward = new(-1); + public static readonly LongitudinalAccelerationValue Unavailable = new(161); + + private int val; + [ASN1Integer( Name = "LongitudinalAccelerationValue" )] [ASN1ValueRangeConstraint ( Min = -160L, Max = 161L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs index a1c5c8d..bfda7cd 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "NumberOfOccupants" )] public class NumberOfOccupants: IASN1PreparedElement { - - private int val; + public static readonly NumberOfOccupants OneOccupant = new(1); + public static readonly NumberOfOccupants Unavailable = new(127); + + private int val; + [ASN1Integer( Name = "NumberOfOccupants" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 127L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs index f98dec5..b04fd0e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.cs @@ -18,9 +18,11 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PathDeltaTime" )] public class PathDeltaTime: IASN1PreparedElement { - - private int val; + public static readonly PathDeltaTime TenMilliSecondsInPast = new(1); + + private int val; + [ASN1Integer( Name = "PathDeltaTime" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 65535L, IsExtensible = true) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs index d5942ae..5c34d58 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PerformanceClass" )] public class PerformanceClass: IASN1PreparedElement { - - private int val; + public static readonly PerformanceClass Unavailable = new(0); + public static readonly PerformanceClass PerformanceClassA = new(1); + public static readonly PerformanceClass PerformanceClassB = new(2); + + private int val; + [ASN1Integer( Name = "PerformanceClass" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 7L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs index 40b3abb..6c82ece 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PosCentMass" )] public class PosCentMass: IASN1PreparedElement { - - private int val; + public static readonly PosCentMass TenCentimeters = new(1); + public static readonly PosCentMass Unavailable = new(63); + + private int val; + [ASN1Integer( Name = "PosCentMass" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 63L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs index e3582aa..72b4c80 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PosFrontAx" )] public class PosFrontAx: IASN1PreparedElement { - - private int val; + public static readonly PosFrontAx TenCentimeters = new(1); + public static readonly PosFrontAx Unavailable = new(20); + + private int val; + [ASN1Integer( Name = "PosFrontAx" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 20L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs index ef5e09c..d4707c4 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PosLonCarr" )] public class PosLonCarr: IASN1PreparedElement { - - private int val; + public static readonly PosLonCarr OneCentimeter = new(1); + public static readonly PosLonCarr Unavailable = new(127); + + private int val; + [ASN1Integer( Name = "PosLonCarr" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs index b9b95f9..afae84f 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PosPillar" )] public class PosPillar: IASN1PreparedElement { - - private int val; + public static readonly PosPillar TenCentimeters = new(1); + public static readonly PosPillar Unavailable = new(30); + + private int val; + [ASN1Integer( Name = "PosPillar" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 30L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs index f4179b3..11d475a 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.cs @@ -18,9 +18,15 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PostCrashSubCauseCode" )] public class PostCrashSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly PostCrashSubCauseCode Unavailable = new(0); + public static readonly PostCrashSubCauseCode AccidentWithoutECallTriggered = new(1); + public static readonly PostCrashSubCauseCode AccidentWithECallManuallyTriggered = new(2); + public static readonly PostCrashSubCauseCode AccidentWithECallAutomaticallyTriggered = new(3); + public static readonly PostCrashSubCauseCode AccidentWithECallTriggeredWithoutAccessToCellularNetwork = new(4); + + private int val; + [ASN1Integer( Name = "PostCrashSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs index ee2490c..fcb4f2e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.cs @@ -18,9 +18,10 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "ProtectedZoneID" )] public class ProtectedZoneID: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "ProtectedZoneID" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 134217727L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs index 28b2ded..37078a8 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.cs @@ -18,9 +18,11 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "ProtectedZoneRadius" )] public class ProtectedZoneRadius: IASN1PreparedElement { - - private int val; + public static readonly ProtectedZoneRadius OneMeter = new(1); + + private int val; + [ASN1Integer( Name = "ProtectedZoneRadius" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 255L, IsExtensible = true) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs index d17bf1c..69e3728 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "PtActivationType" )] public class PtActivationType: IASN1PreparedElement { - - private int val; + public static readonly PtActivationType UndefinedCodingType = new(0); + public static readonly PtActivationType R09_16CodingType = new(1); + public static readonly PtActivationType Vdv_50149CodingType = new(2); + + private int val; + [ASN1Integer( Name = "PtActivationType" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs index 9de9c4f..05b0035 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.cs @@ -18,9 +18,16 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "RescueAndRecoveryWorkInProgressSubCauseCode" )] public class RescueAndRecoveryWorkInProgressSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly RescueAndRecoveryWorkInProgressSubCauseCode Unavailable = new(0); + public static readonly RescueAndRecoveryWorkInProgressSubCauseCode EmergencyVehicles = new(1); + public static readonly RescueAndRecoveryWorkInProgressSubCauseCode RescueHelicopterLanding = new(2); + public static readonly RescueAndRecoveryWorkInProgressSubCauseCode PoliceActivityOngoing = new(3); + public static readonly RescueAndRecoveryWorkInProgressSubCauseCode MedicalEmergencyOngoing = new(4); + public static readonly RescueAndRecoveryWorkInProgressSubCauseCode ChildAbductionInProgress = new(5); + + private int val; + [ASN1Integer( Name = "RescueAndRecoveryWorkInProgressSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs index 792753e..e39da49 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs @@ -18,9 +18,17 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "RoadworksSubCauseCode" )] public class RoadworksSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly RoadworksSubCauseCode Unavailable = new(0); + public static readonly RoadworksSubCauseCode MajorRoadworks = new(1); + public static readonly RoadworksSubCauseCode RoadMarkingWork = new(2); + public static readonly RoadworksSubCauseCode SlowMovingRoadMaintenance = new(3); + public static readonly RoadworksSubCauseCode ShortTermStationaryRoadworks = new(4); + public static readonly RoadworksSubCauseCode StreetCleaning = new(5); + public static readonly RoadworksSubCauseCode WinterService = new(6); + + private int val; + [ASN1Integer( Name = "RoadworksSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs index cd8d91e..36a72e1 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SemiAxisLength" )] public class SemiAxisLength: IASN1PreparedElement { - - private int val; + public static readonly SemiAxisLength OneCentimeter = new(1); + public static readonly SemiAxisLength OutOfRange = new(4094); + public static readonly SemiAxisLength Unavailable = new(4095); + + private int val; + [ASN1Integer( Name = "SemiAxisLength" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 4095L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs index 5f4a8ce..f0094d2 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.cs @@ -18,9 +18,10 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SequenceNumber" )] public class SequenceNumber: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "SequenceNumber" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 65535L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs index 0bf4b4a..7399a42 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SignalViolationSubCauseCode" )] public class SignalViolationSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly SignalViolationSubCauseCode Unavailable = new(0); + public static readonly SignalViolationSubCauseCode StopSignViolation = new(1); + public static readonly SignalViolationSubCauseCode TrafficLightViolation = new(2); + public static readonly SignalViolationSubCauseCode TurningRegulationViolation = new(3); + + private int val; + [ASN1Integer( Name = "SignalViolationSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs index d5dbfc9..f9f7755 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.cs @@ -18,9 +18,19 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SlowVehicleSubCauseCode" )] public class SlowVehicleSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly SlowVehicleSubCauseCode Unavailable = new(0); + public static readonly SlowVehicleSubCauseCode MaintenanceVehicle = new(1); + public static readonly SlowVehicleSubCauseCode VehiclesSlowingToLookAtAccident = new(2); + public static readonly SlowVehicleSubCauseCode AbnormalLoad = new(3); + public static readonly SlowVehicleSubCauseCode AbnormalWideLoad = new(4); + public static readonly SlowVehicleSubCauseCode Convoy = new(5); + public static readonly SlowVehicleSubCauseCode Snowplough = new(6); + public static readonly SlowVehicleSubCauseCode Deicing = new(7); + public static readonly SlowVehicleSubCauseCode SaltingVehicles = new(8); + + private int val; + [ASN1Integer( Name = "SlowVehicleSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs index 8f9d040..495a8f4 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SpeedConfidence" )] public class SpeedConfidence: IASN1PreparedElement { - - private int val; + public static readonly SpeedConfidence EqualOrWithinOneCentimeterPerSec = new(1); + public static readonly SpeedConfidence EqualOrWithinOneMeterPerSec = new(100); + public static readonly SpeedConfidence OutOfRange = new(126); + public static readonly SpeedConfidence Unavailable = new(127); + + private int val; + [ASN1Integer( Name = "SpeedConfidence" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs index dc70925..46fef2d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.cs @@ -18,9 +18,11 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SpeedLimit" )] public class SpeedLimit: IASN1PreparedElement { - - private int val; + public static readonly SpeedLimit OneKmPerHour = new(1); + + private int val; + [ASN1Integer( Name = "SpeedLimit" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs index 4960489..9926600 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SpeedValue" )] public class SpeedValue: IASN1PreparedElement { - - private int val; + public static readonly SpeedValue Standstill = new(0); + public static readonly SpeedValue OneCentimeterPerSec = new(1); + public static readonly SpeedValue Unavailable = new(16383); + + private int val; + [ASN1Integer( Name = "SpeedValue" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 16383L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs index 67d92e3..4f18633 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.cs @@ -18,9 +18,10 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "StationID" )] public class StationID: IASN1PreparedElement { - - private long val; + + private long val; + [ASN1Integer( Name = "StationID" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 4294967295L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs index 72f21ce..6dc59e0 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs @@ -18,9 +18,23 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "StationType" )] public class StationType: IASN1PreparedElement { - - private int val; + public static readonly StationType Unknown = new(0); + public static readonly StationType Pedestrian = new(1); + public static readonly StationType Cyclist = new(2); + public static readonly StationType Moped = new(3); + public static readonly StationType Motorcycle = new(4); + public static readonly StationType PassengerCar = new(5); + public static readonly StationType Bus = new(6); + public static readonly StationType LightTruck = new(7); + public static readonly StationType HeavyTruck = new(8); + public static readonly StationType Trailer = new(9); + public static readonly StationType SpecialVehicles = new(10); + public static readonly StationType Tram = new(11); + public static readonly StationType RoadSideUnit = new(15); + + private int val; + [ASN1Integer( Name = "StationType" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs index d257999..c84a2cd 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.cs @@ -18,9 +18,16 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "StationaryVehicleSubCauseCode" )] public class StationaryVehicleSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly StationaryVehicleSubCauseCode Unavailable = new(0); + public static readonly StationaryVehicleSubCauseCode HumanProblem = new(1); + public static readonly StationaryVehicleSubCauseCode VehicleBreakdown = new(2); + public static readonly StationaryVehicleSubCauseCode PostCrash = new(3); + public static readonly StationaryVehicleSubCauseCode PublicTransportStop = new(4); + public static readonly StationaryVehicleSubCauseCode CarryingDangerousGoods = new(5); + + private int val; + [ASN1Integer( Name = "StationaryVehicleSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs index 2915d2b..338500c 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SteeringWheelAngleConfidence" )] public class SteeringWheelAngleConfidence: IASN1PreparedElement { - - private int val; + public static readonly SteeringWheelAngleConfidence EqualOrWithinOnePointFiveDegree = new(1); + public static readonly SteeringWheelAngleConfidence OutOfRange = new(126); + public static readonly SteeringWheelAngleConfidence Unavailable = new(127); + + private int val; + [ASN1Integer( Name = "SteeringWheelAngleConfidence" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs index cf35213..442df17 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SteeringWheelAngleValue" )] public class SteeringWheelAngleValue: IASN1PreparedElement { - - private int val; + public static readonly SteeringWheelAngleValue Straight = new(0); + public static readonly SteeringWheelAngleValue OnePointFiveDegreesToRight = new(-1); + public static readonly SteeringWheelAngleValue OnePointFiveDegreesToLeft = new(1); + public static readonly SteeringWheelAngleValue Unavailable = new(512); + + private int val; + [ASN1Integer( Name = "SteeringWheelAngleValue" )] [ASN1ValueRangeConstraint ( Min = -511L, Max = 512L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs index 28e0305..0689f04 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.cs @@ -18,9 +18,10 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SubCauseCodeType" )] public class SubCauseCodeType: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "SubCauseCodeType" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs index 10f23b5..4bbe098 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "Temperature" )] public class Temperature: IASN1PreparedElement { - - private int val; + public static readonly Temperature EqualOrSmallerThanMinus60Deg = new(-60); + public static readonly Temperature OneDegreeCelsius = new(1); + public static readonly Temperature EqualOrGreaterThan67Deg = new(67); + + private int val; + [ASN1Integer( Name = "Temperature" )] [ASN1ValueRangeConstraint ( Min = -60L, Max = 67L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs index 187c2fe..7b9014e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TimestampIts" )] public class TimestampIts: IASN1PreparedElement { - - private long val; + public static readonly TimestampIts UtcStartOf2004 = new(0); + public static readonly TimestampIts OneMillisecAfterUTCStartOf2004 = new(1); + + private long val; + [ASN1Integer( Name = "TimestampIts" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 4398046511103L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs index 4f9a978..9a09e17 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.cs @@ -18,9 +18,19 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TrafficConditionSubCauseCode" )] public class TrafficConditionSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly TrafficConditionSubCauseCode Unavailable = new(0); + public static readonly TrafficConditionSubCauseCode IncreasedVolumeOfTraffic = new(1); + public static readonly TrafficConditionSubCauseCode TrafficJamSlowlyIncreasing = new(2); + public static readonly TrafficConditionSubCauseCode TrafficJamIncreasing = new(3); + public static readonly TrafficConditionSubCauseCode TrafficJamStronglyIncreasing = new(4); + public static readonly TrafficConditionSubCauseCode TrafficStationary = new(5); + public static readonly TrafficConditionSubCauseCode TrafficJamSlightlyDecreasing = new(6); + public static readonly TrafficConditionSubCauseCode TrafficJamDecreasing = new(7); + public static readonly TrafficConditionSubCauseCode TrafficJamStronglyDecreasing = new(8); + + private int val; + [ASN1Integer( Name = "TrafficConditionSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs index 69a464f..04db051 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TransmissionInterval" )] public class TransmissionInterval: IASN1PreparedElement { - - private int val; + public static readonly TransmissionInterval OneMilliSecond = new(1); + public static readonly TransmissionInterval TenSeconds = new(10000); + + private int val; + [ASN1Integer( Name = "TransmissionInterval" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 10000L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs index 76da816..dd709d9 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TurningRadius" )] public class TurningRadius: IASN1PreparedElement { - - private int val; + public static readonly TurningRadius Point4Meters = new(1); + public static readonly TurningRadius Unavailable = new(255); + + private int val; + [ASN1Integer( Name = "TurningRadius" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs index 81e6e93..ab63027 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "ValidityDuration" )] public class ValidityDuration: IASN1PreparedElement { - - private int val; + public static readonly ValidityDuration TimeOfDetection = new(0); + public static readonly ValidityDuration OneSecondAfterDetection = new(1); + + private int val; + [ASN1Integer( Name = "ValidityDuration" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 86400L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs index 0c6ec6f..fa74b52 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.cs @@ -18,9 +18,19 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "VehicleBreakdownSubCauseCode" )] public class VehicleBreakdownSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly VehicleBreakdownSubCauseCode Unavailable = new(0); + public static readonly VehicleBreakdownSubCauseCode LackOfFuel = new(1); + public static readonly VehicleBreakdownSubCauseCode LackOfBatteryPower = new(2); + public static readonly VehicleBreakdownSubCauseCode EngineProblem = new(3); + public static readonly VehicleBreakdownSubCauseCode TransmissionProblem = new(4); + public static readonly VehicleBreakdownSubCauseCode EngineCoolingProblem = new(5); + public static readonly VehicleBreakdownSubCauseCode BrakingSystemProblem = new(6); + public static readonly VehicleBreakdownSubCauseCode SteeringProblem = new(7); + public static readonly VehicleBreakdownSubCauseCode TyrePuncture = new(8); + + private int val; + [ASN1Integer( Name = "VehicleBreakdownSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs index ed8509e..75dc449 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "VehicleLengthValue" )] public class VehicleLengthValue: IASN1PreparedElement { - - private int val; + public static readonly VehicleLengthValue TenCentimeters = new(1); + public static readonly VehicleLengthValue OutOfRange = new(1022); + public static readonly VehicleLengthValue Unavailable = new(1023); + + private int val; + [ASN1Integer( Name = "VehicleLengthValue" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 1023L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs index 9b49f4c..5e604e9 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "VehicleMass" )] public class VehicleMass: IASN1PreparedElement { - - private int val; + public static readonly VehicleMass HundredKg = new(1); + public static readonly VehicleMass Unavailable = new(1024); + + private int val; + [ASN1Integer( Name = "VehicleMass" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 1024L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs index 62cee44..e4e395c 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "VehicleWidth" )] public class VehicleWidth: IASN1PreparedElement { - - private int val; + public static readonly VehicleWidth TenCentimeters = new(1); + public static readonly VehicleWidth OutOfRange = new(61); + public static readonly VehicleWidth Unavailable = new(62); + + private int val; + [ASN1Integer( Name = "VehicleWidth" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 62L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs index 2345c06..73e7b5e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "VerticalAccelerationValue" )] public class VerticalAccelerationValue: IASN1PreparedElement { - - private int val; + public static readonly VerticalAccelerationValue PointOneMeterPerSecSquaredUp = new(1); + public static readonly VerticalAccelerationValue PointOneMeterPerSecSquaredDown = new(-1); + public static readonly VerticalAccelerationValue Unavailable = new(161); + + private int val; + [ASN1Integer( Name = "VerticalAccelerationValue" )] [ASN1ValueRangeConstraint ( Min = -160L, Max = 161L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs index 213ebb5..83ccf80 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.cs @@ -18,9 +18,12 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "WheelBaseVehicle" )] public class WheelBaseVehicle: IASN1PreparedElement { - - private int val; + public static readonly WheelBaseVehicle TenCentimeters = new(1); + public static readonly WheelBaseVehicle Unavailable = new(127); + + private int val; + [ASN1Integer( Name = "WheelBaseVehicle" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 127L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs index 2930d2d..963bed6 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.cs @@ -18,9 +18,13 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "WrongWayDrivingSubCauseCode" )] public class WrongWayDrivingSubCauseCode: IASN1PreparedElement { - - private int val; + public static readonly WrongWayDrivingSubCauseCode Unavailable = new(0); + public static readonly WrongWayDrivingSubCauseCode WrongLane = new(1); + public static readonly WrongWayDrivingSubCauseCode WrongDirection = new(2); + + private int val; + [ASN1Integer( Name = "WrongWayDrivingSubCauseCode" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs index 47bc863..9870623 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.cs @@ -18,9 +18,14 @@ namespace its.cam { [ASN1PreparedElement] [ASN1BoxedType ( Name = "YawRateValue" )] public class YawRateValue: IASN1PreparedElement { - - private int val; + public static readonly YawRateValue Straight = new(0); + public static readonly YawRateValue DegSec_000_01ToRight = new(-1); + public static readonly YawRateValue DegSec_000_01ToLeft = new(1); + public static readonly YawRateValue Unavailable = new(32767); + + private int val; + [ASN1Integer( Name = "YawRateValue" )] [ASN1ValueRangeConstraint ( Min = -32766L, Max = 32767L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs index 7f5f9d0..7b7da98 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERUnalignedCoderTestUtils.cs @@ -395,17 +395,17 @@ public static CAM createCam() Longitude = new(10), PositionConfidenceEllipse = new() { - SemiMajorConfidence = new(1), - SemiMinorConfidence = new(1), - SemiMajorOrientation = new(0) + SemiMajorConfidence = new(1), + SemiMinorConfidence = new(1), + SemiMajorOrientation = new(0) }, Altitude = new() - { - AltitudeValue = new(0), - AltitudeConfidence = new() - { + { + AltitudeValue = new(0), + AltitudeConfidence = new() + { Value = AltitudeConfidence.EnumType.Alt_000_01 - } + } } } }; diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugEnum.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugEnum.cs index 9690bc1..896ae6d 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugEnum.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugEnum.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "BugEnum" )] public class BugEnum: IASN1PreparedElement { - - private long val; + + private long val; + [ASN1Integer( Name = "BugEnum" )] public long Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs index d8704b2..4af6e22 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "ExtensibleInteger" )] public class ExtensibleInteger: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "ExtensibleInteger" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 63L, IsExtensible = true) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs index b64ec57..224fe13 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "SubInteger" )] public class SubInteger: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "SubInteger" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 63L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI.cs index 540279e..ee410c4 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestI" )] public class TestI: IASN1PreparedElement { - - private long val; + + private long val; + [ASN1Integer( Name = "TestI" )] public long Value diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs index 1f5dede..f5e73f1 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestI14" )] public class TestI14: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "TestI14" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 16384L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs index d9dcd0c..dd17323 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestI16" )] public class TestI16: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "TestI16" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 65535L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs index 26ad694..85cde74 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestI32" )] public class TestI32: IASN1PreparedElement { - - private long val; + + private long val; + [ASN1Integer( Name = "TestI32" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 4294967295L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs index 1933916..3a08af1 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestI8" )] public class TestI8: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "TestI8" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 255L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs index bcf9e04..f8a8eb6 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.cs @@ -18,9 +18,13 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestI8named" )] public class TestI8named: IASN1PreparedElement { - - private int val; + public static readonly TestI8named A = new(1); + public static readonly TestI8named B = new(2); + public static readonly TestI8named D = new(5); + + private int val; + [ASN1Integer( Name = "TestI8named" )] [ASN1ValueRangeConstraint ( Min = 0L, Max = 253L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs index 998f429..da84361 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestIR" )] public class TestIR: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "TestIR" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 5L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs index 2c1dbdc..842954b 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestLong" )] public class TestLong: IASN1PreparedElement { - - private long val; + + private long val; + [ASN1Integer( Name = "TestLong" )] [ASN1ValueRangeConstraint ( Min = 1L, Max = 2247483648L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs index 1f20c7b..64a0709 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestNI" )] public class TestNI: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "TestNI" )] [ASN1ValueRangeConstraint ( Min = -128L, Max = 128L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs index 44d15fb..867accb 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs @@ -18,9 +18,10 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] [ASN1BoxedType ( Name = "TestNI2" )] public class TestNI2: IASN1PreparedElement { - - private int val; + + private int val; + [ASN1Integer( Name = "TestNI2" )] [ASN1ValueRangeConstraint ( Min = -2048L, Max = 2048L, IsExtensible = false) ] diff --git a/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py index 2847c25..cd294b3 100644 --- a/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py +++ b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py @@ -40,13 +40,13 @@ def run_compiler(namespace, asn_path, output_path): '-m', 'cs', '-ns', namespace, '-o', output_path, - "-f", asn_path ] + bn_compiler_args.extend(asn_path if isinstance(asn_path, list) else [asn_path]) cmd.extend(bn_compiler_args) result = subprocess.run(cmd, capture_output=True, text=True) - #result = subprocess.run(cmd + ["-x"], capture_output=True, text=True) + result = subprocess.run(cmd + ["-x"], capture_output=True, text=True) print(result.stdout) print(result.stderr)