diff --git a/.gitignore b/.gitignore index 7ba402cf..8a183262 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/* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..6c072c2a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +stages: + - build + +variables: + MAVEN_OPTS: "" + MAVEN_CLI_OPTS: "" + +# Use Maven + OpenJDK 17 image from Docker Hub +default: + image: maven:3.9.6-eclipse-temurin-17 + +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 + diff --git a/BNCompiler/pom.xml b/BNCompiler/pom.xml index bd23b63d..48b3facf 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/antlr/org/bn/compiler/parser/ASN1.g b/BNCompiler/src/main/antlr/org/bn/compiler/parser/ASN1.g index 76be35e7..8a6dbf30 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;} ; @@ -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; } ; @@ -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; @@ -859,8 +861,14 @@ 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);}))*) + : (eletyp = elementType {elelist.addElement(eletyp, false); } + (COMMA (eletyp = elementType {elelist.addElement(eletyp, false);}))* + ( + (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] @@ -882,11 +890,20 @@ Object obj; AsnTag tg; String s;} } } ; - + +namedNumberExtensible_list returns [AsnNamedNumberList nnlist] +{nnlist = new AsnNamedNumberList(true);AsnNamedNumber nnum ; } + : ( 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.namedNumbers.add(nnum); }) - (COMMA (nnum = namedNumber {nnlist.namedNumbers.add(nnum); }) )* R_BRACE ) + : ( L_BRACE (nnum= namedNumber {nnlist.addNamedNumber(nnum, false); }) + (COMMA (nnum = namedNumber {nnlist.addNamedNumber(nnum, false); }) )* R_BRACE ) ; namedNumber returns [AsnNamedNumber nnum] @@ -922,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/CompilerArgs.java b/BNCompiler/src/main/java/org/bn/compiler/CompilerArgs.java index db1fe15c..da8f736d 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 8ed8513c..90a67503 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 38851014..fb9d06ea 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/java/org/bn/compiler/parser/model/AsnConstraint.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnConstraint.java index 791944a6..6ec8c494 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/java/org/bn/compiler/parser/model/AsnElementType.java b/BNCompiler/src/main/java/org/bn/compiler/parser/model/AsnElementType.java index a3305f87..11f66523 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 5ea07198..01d9fc6c 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,11 +5,17 @@ public class AsnElementTypeList { public ArrayList elements; + public boolean isExtensible; public AsnElementTypeList() { elements = new ArrayList<>(); } + public void addElement(AsnElementType element, boolean extendedElement) { + element.isExtended = extendedElement; + elements.add(element); + } + @Override public String toString() { return ""; 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 7b13bb7d..2d628796 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 1350e034..e5eb3b26 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,13 +1,49 @@ 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) { + namedNumbers = new ArrayList<>(); + this.sortOnAddition = sortOnAddition; + } + + // sort by value when adding a new named number + 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."); + } + } + } } /** Returns the total number of elements in the list */ diff --git a/BNCompiler/src/main/resources/modules/cs/includes/boxedBooleanType.xsl b/BNCompiler/src/main/resources/modules/cs/includes/boxedBooleanType.xsl index a95965f2..6f2d68a7 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/boxedIntegerType.xsl b/BNCompiler/src/main/resources/modules/cs/includes/boxedIntegerType.xsl index 1784686f..08485e71 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/src/main/resources/modules/cs/includes/choice.xsl b/BNCompiler/src/main/resources/modules/cs/includes/choice.xsl index 7d3e9dac..18de0cb3 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 e3e21433..832f56c9 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 = truefalse )] 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/componentDefaults.xsl b/BNCompiler/src/main/resources/modules/cs/includes/componentDefaults.xsl index 516d5da0..17245640 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 fc6add91..36f8f752 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 ccc00baa..2d727079 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/elementDecl.xsl b/BNCompiler/src/main/resources/modules/cs/includes/elementDecl.xsl index 2cd28d90..2a8d38c5 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/elementDefaultValue.xsl b/BNCompiler/src/main/resources/modules/cs/includes/elementDefaultValue.xsl index 43586d7e..ee72b899 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/includes/enum.xsl b/BNCompiler/src/main/resources/modules/cs/includes/enum.xsl index 3c407dba..edf44314 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 = truefalse, NumRootElements = )] 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/enumItem.xsl b/BNCompiler/src/main/resources/modules/cs/includes/enumItem.xsl index 027ffe3c..7838015e 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/main/resources/modules/cs/includes/sequence.xsl b/BNCompiler/src/main/resources/modules/cs/includes/sequence.xsl index f0e8b26e..0e498663 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 = truefalse, 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 d90eb936..8102fa8b 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 = truefalse, IsSetOf = truefalse )] diff --git a/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl b/BNCompiler/src/main/resources/modules/cs/includes/valueRangeConstraint.xsl index 93ce3c3f..61d8e4d8 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, IsExtensible = truefalse) ] diff --git a/BNCompiler/src/main/resources/modules/cs/main.xsl b/BNCompiler/src/main/resources/modules/cs/main.xsl index fba5d374..822147ff 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 516d5da0..17245640 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 9460e219..5f807173 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 ccc00baa..2d727079 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 65d0d208..89d2a707 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 1f4948c0..d43dc30a 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/main/scripts/examples/example-ldapv3-compile.cmd b/BNCompiler/src/main/scripts/examples/example-ldapv3-compile.cmd index 7222cedc..134062af 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 201d5410..192a39e7 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 922ddad9..f8efa480 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/BNCompiler/src/test/java/org/bn/compiler/MainTest.java b/BNCompiler/src/test/java/org/bn/compiler/MainTest.java index 035b08ab..25f0b0e3 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 11262c08..676bb7fb 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.modules.add(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(); + 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/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 00000000..6e2530c4 --- /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 { + causeCodeT 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/src/test/resources/test.asn b/BNCompiler/src/test/resources/test.asn index c67f2624..86b51dc3 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) @@ -139,6 +144,12 @@ EXPORTS TestOCT,TestPRN,TestIA5,TestI32,TestI16,TestI8,ContentType,ValueWithPara application_smil (500) -- SMIL } + MixedEnumType ::= ENUMERATED { + high (101), + low (3), + mid (8) + } + ContentSchema ::= ENUMERATED { multipart_any (110), multipart_mixed (111), @@ -292,16 +303,20 @@ 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 TestChild3 ::= SEQUENCE { COMPONENTS OF TestTParent, - field5 [4] UTF8String, + field6 [4] UTF8String, COMPONENTS OF SEQUENCE { - field6 [5] INTEGER DEFAULT 0 + field7 [5] INTEGER DEFAULT 0 } } @@ -330,6 +345,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"| ".-" ) @@ -383,4 +400,42 @@ 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) + } + + DataSeqExtensible ::= SEQUENCE { + simpleInt [0] INTEGER (0 .. 255), + simpleBool [1] BOOLEAN, + optBool [2] BOOLEAN OPTIONAL, + ..., + 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) + } + + SubInteger ::= INTEGER (0..63) + + ExtensibleSize ::= SEQUENCE (SIZE(1..3,...)) OF SubInteger + ExtensibleInteger ::= INTEGER(0..63,...) END diff --git a/BNCompiler/temp.xml b/BNCompiler/temp.xml new file mode 100644 index 00000000..b0343282 --- /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/BinaryNotes.sln b/BinaryNotes.NET/BinaryNotes.sln index 51213c2c..99b114c2 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 5a7dc3fc..cdc91ea9 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/BinaryNotes/Properties/AssemblyInfo.cs b/BinaryNotes.NET/BinaryNotes/Properties/AssemblyInfo.cs deleted file mode 100644 index 1540341d..00000000 --- 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/attributes/ASN1Choice.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Choice.cs index 333ab25c..2a19c82b 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/ASN1Element.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Element.cs index c9d14801..720ae265 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/ASN1Enum.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs index 38ee612a..c0ed7917 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Enum.cs @@ -29,5 +29,20 @@ public string Name set { name = value; } } + private bool isExtensible = false; + + 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/attributes/ASN1Sequence.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/ASN1Sequence.cs index 1551e09b..91091d2f 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 83a1c75d..ba69353a 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; } + } } } diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/attributes/constraints/ASN1ValueRangeConstraint.cs b/BinaryNotes.NET/BinaryNotes/org/bn/attributes/constraints/ASN1ValueRangeConstraint.cs index 7bf381e7..fef28064 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 1e50e5bb..d6ca53c4 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 @@ -347,6 +348,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 ea661abc..de83821b 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/coders/Encoder.cs @@ -251,16 +251,22 @@ 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, elementInfo, false); + } + + 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) { - resultSize += encodeSequenceField(obj, fieldIdx++, field, stream, elementInfo); - } + resultSize += encodeSequenceField(obj, fieldIdx, field, stream, elementInfo); + fieldIdx++; + } return resultSize; } @@ -356,7 +362,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 +383,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 f367bc24..3378b4d2 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) { @@ -74,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 @@ -163,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. @@ -173,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; @@ -264,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 ); } @@ -281,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()) @@ -295,32 +309,112 @@ 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 < 0) + { + throw new System.ArgumentException("The extended index is negative: " + extendedIndex); + } + 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!"); @@ -328,34 +422,63 @@ 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 List ExtendedFields = new List(); + } + + 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); + if ((seqMeta != null) && (seqMeta.IsExtensible)) + { + 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 = CoderUtils.isExtendedField(field, info); + bool isOptionalField = CoderUtils.isOptionalField(field, info); + + if (isExtendeField) + { + parsingInfo.ExtendedFields.Add(fieldIdx); + } + else if (isOptionalField) { - 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); @@ -380,20 +503,60 @@ public override DecodedObject decodeSequence(DecodedObject decod { info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(idx); } - if(CoderUtils.isOptionalField(field, info)) + // only parse root fields, skip extended fields + if (!CoderUtils.isExtendedField(field, info)) + { + 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++; + } + } + + 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++) { - if ((preamble & (0x80000000 >> preambleCurrentBit)) != 0) + int bitMask = 0x1 << (extensionLength - extIdx - 1); + if ((extBitMask & bitMask) != 0) { - decodeSequenceField(null, sequence, idx, field, stream, elementInfo, true); + // decoded length field + int fieldLength = decodeLengthDeterminant(bitStream); + // read the corresponding data + var sequenceBuffer = new byte[fieldLength]; + bitStream.ReadExactly(sequenceBuffer, 0, fieldLength); + + if (extIdx < parsingInfo.ExtendedFields.Count) + { + // decode the extended field + int extFieldIdx = parsingInfo.ExtendedFields[extIdx]; + PropertyInfo extField = fields[extFieldIdx]; + if (elementInfo.hasPreparedInfo()) + { + info.PreparedInfo = elementInfo.PreparedInfo.getPropertyMetadata(extFieldIdx); + } + BitArrayInputStream sequenceStream = new BitArrayInputStream(new MemoryStream(sequenceBuffer)); + decodeSequenceField(null, sequence, extFieldIdx, extField, sequenceStream, elementInfo, true); + } } - preambleCurrentBit++; } - else - { - decodeSequenceField(null, sequence, idx, field, stream, elementInfo, true); - } - idx++; } + return new DecodedObject(sequence); /* } else @@ -416,7 +579,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()) @@ -456,8 +638,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) @@ -466,6 +650,7 @@ public override DecodedObject decodeInteger(DecodedObject decode hasConstraint = true; min = ((ASN1ValueRangeConstraintMetadata)constraint).Min; max = ((ASN1ValueRangeConstraintMetadata)constraint).Max; + isExtensible = ((ASN1ValueRangeConstraintMetadata)constraint).IsExtensible; } } else @@ -475,12 +660,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); @@ -593,7 +785,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 3a80b92e..ff10991c 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); } @@ -199,7 +223,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 @@ -207,9 +231,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; @@ -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()) @@ -403,11 +440,25 @@ 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 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); + if (seqMeta != null) + { + presence.IsExtensible = seqMeta.IsExtensible; + } + foreach (PropertyInfo field in fields) { if (elementInfo.hasPreparedInfo()) @@ -415,39 +466,123 @@ 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 = CoderUtils.isExtendedField(field, info); + + bool isOptionalField = CoderUtils.isOptionalField(field, info); + if (isOptionalField || isExtendeField) + { + bool fieldResult = !isOptionalField; + 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 = presence.ExtensionVector.Count; + } + } + 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, 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 (elementInfo.hasPreparedInfo()) + { + 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) + { + resultSize += encodeLengthDeterminant((int)extendedStream.Length, (BitArrayOutputStream)stream); + stream.Write(extendedStream.ToArray(), 0, (int)extendedStream.Length); + } + } + } else + { + if (!isExtendedField) + { + // first encode the non-optional fields, later the optional ones + 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, elementInfo, false); + + if ((presence.IsExtensible) && (presence.MaxExtensionLength > 0)) + { + resultSize += encodeNormallySmallNumber(presence.MaxExtensionLength-1, (BitArrayOutputStream)stream); + // write the extension preamble + for (int extIdx=0; extIdx Encoding of the choice structure @@ -479,16 +614,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 @@ -496,42 +644,103 @@ 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; } 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-1, (BitArrayOutputStream)stream); + } + } public override int encodeBoolean(object obj, System.IO.Stream stream, ElementInfo elementInfo) { @@ -628,8 +837,10 @@ public virtual int encodeSet(object obj, System.IO.Stream stream, ElementInfo el fields = new PropertyInfo[fieldOrder.Count]; fieldOrder.Values.CopyTo(fields, 0); } - - resultSize += encodeSequencePreamble(obj, fields, stream, elementInfo); + + ASN1SequenceFieldPresence presence = estimateFieldPresense(obj, fields, elementInfo); + + resultSize += encodeSequencePreamble(presence, stream); int fieldIdx = 0; foreach (PropertyInfo field in fields) { diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1BoxedTypeMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1BoxedTypeMetadata.cs index 5a56dbd5..46b6954a 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/ASN1ChoiceMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ChoiceMetadata.cs index 3c826399..324a789e 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/BinaryNotes/org/bn/metadata/ASN1ElementMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1ElementMetadata.cs index 1cb2d939..9ca69898 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/ASN1EnumMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1EnumMetadata.cs index cf80fff2..175aaf81 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/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs index 6ecc7627..4f9ea857 100644 --- a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs +++ b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/ASN1SequenceMetadata.cs @@ -25,16 +25,18 @@ namespace org.bn.metadata public class ASN1SequenceMetadata: ASN1TypeMetadata { private bool isSet; + bool isExtensible = false; public ASN1SequenceMetadata(ASN1Sequence annotation) - : this(annotation.Name, annotation.IsSet) + : this(annotation.Name, annotation.IsSet, annotation.IsExtensible) { } public ASN1SequenceMetadata(String name, - bool isSet): base(name) + bool isSet, bool isExtensible): base(name) { this.isSet = isSet; + this.isExtensible = isExtensible; } public bool IsSet @@ -42,6 +44,11 @@ public bool IsSet get { return isSet; } } + public bool IsExtensible + { + get { return isExtensible; } + } + public override int encode(IASN1TypesEncoder encoder, object obj, Stream stream, ElementInfo elementInfo) { return encoder.encodeSequence(obj, stream, elementInfo); diff --git a/BinaryNotes.NET/BinaryNotes/org/bn/metadata/constraints/ASN1ValueRangeConstraintMetadata.cs b/BinaryNotes.NET/BinaryNotes/org/bn/metadata/constraints/ASN1ValueRangeConstraintMetadata.cs index 4fd6fcd9..f0eed82b 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/BinaryNotesTests.csproj b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj index 2d688f0e..dbc339b0 100644 --- a/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj +++ b/BinaryNotes.NET/BinaryNotesTests/BinaryNotesTests.csproj @@ -1,199 +1,41 @@ - - + + - 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 + false + + + + + + + + + + + + + - - - 3.5 - + + - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + PreserveNewest + + + - - {7bb91554-ca9a-4f6e-91cb-e34410f215a7} - BinaryNotes - + - - - - - False - - - False - - - False - - - False - - - - - - - - \ No newline at end of file + + + diff --git a/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py new file mode 100644 index 00000000..33956630 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/asn1tool_test.py @@ -0,0 +1,125 @@ +# Example: Encode data using ASN.1 UPER with asn1tools + +import asn1tools + +# Define a simple ASN.1 specification +asn1_spec = """ +MyModule DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +ProtectedZoneType ::= ENUMERATED { + permanentCenDsrcTolling(0), + ..., + temporaryCenDsrcTolling(1) +} + +ExtendedEnumSeq ::= SEQUENCE { + prot ProtectedZoneType, + tail INTEGER (0..255) +} + +DataSeqExtensible ::= SEQUENCE { + simpleInt [0] INTEGER (0 .. 255), + simpleBool [1] BOOLEAN, + optBool [2] BOOLEAN OPTIONAL, + ..., + 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) +} + +ExtensibleSize ::= SEQUENCE (SIZE(1..3,...)) OF INTEGER(0..63) +ExtensibleInteger ::= INTEGER(0..63,...) + +END +""" + +class Compiler: + def __init__(self, asn1_spec): + # Compile the ASN.1 specification for UPER + self.uper_compiler = asn1tools.compile_string(asn1_spec, 'uper') + self.per_compiler = asn1tools.compile_string(asn1_spec, 'per') + self.ber_compiler = asn1tools.compile_string(asn1_spec, 'ber') + + def compile(self, entry, data): + # Compile the ASN.1 specification + print(f"{entry}: {data}") + 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()) + +compiler = Compiler(asn1_spec) + +# Data to encode +data1 = { + 'prot': "permanentCenDsrcTolling", + 'tail': 0x19 +} + +data2 = { + 'prot': "temporaryCenDsrcTolling", + 'tail': 0x19 +} + +# Encode the data +compiler.compile('ExtendedEnumSeq', data1) +compiler.compile('ExtendedEnumSeq', data2) + +data3 = { + 'simpleInt': 0x45, + 'simpleBool': True, + 'extendedInt2': 0x2D +} + +data4 = { + 'simpleInt': 0x45, + 'simpleBool': True, + 'optBool': True, + 'extendedInt1': 0x11, + 'extendedInt2': 0x2D +} + +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) + +data7 = 0x23 + +data8 = 0x73 + +compiler.compile('ExtensibleInteger', data7) +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 diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/AllTests.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/AllTests.cs deleted file mode 100644 index ee69834f..00000000 --- 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 diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs index 6487813c..2bda3617 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/CoderTestUtilities.cs @@ -42,13 +42,20 @@ 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(); - - - 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"; @@ -325,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() @@ -354,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(); @@ -624,5 +639,119 @@ 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(); + + public DataSeqExtensible createTestExtendedSeq1() + { + DataSeqExtensible seq = new() + { + SimpleInt = 0x45, + SimpleBool = true, + ExtendedInt2 = 0x2D + }; + return seq; + } + + public abstract byte[] createTestExtendedSeq1Bytes(); + + public DataSeqExtensible createTestExtendedSeq2() + { + DataSeqExtensible seq = new() + { + SimpleInt = 0x45, + SimpleBool = true, + OptBool = true, + ExtendedInt1 = 0x11, + ExtendedInt2 = 0x2D + }; + return seq; + } + + 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(); + + 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(); + + 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(); + } } diff --git a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/DecoderTest.cs index e0e33f6d..5fb8f4af 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()); @@ -509,5 +510,171 @@ public void testDecodeTaggedSetInSet() stream = new System.IO.MemoryStream(coderTestUtils.createSet7Bytes()); Set7 set7 = decoder.decode(stream); } + + [TestMethod] + public void testDecodeExtendedEnum1() + { + 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 testDecodeExtendedEnum2() + { + 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); + } + + [TestMethod] + public void testDecodeExtendedSeq1() + { + var decoder = newDecoder(); + Assert.IsNotNull(decoder); + + if (decoder is org.bn.coders.per.PERUnalignedDecoder) { + System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestExtendedSeq1Bytes()); + var got = decoder.decode(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 testDecodeExtendedSeq2() + { + 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); + } + } + + [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); + } + } + + [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 5ec3d977..080aee23 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() { @@ -283,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(); @@ -435,5 +453,120 @@ 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()); + } + + [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()); + } + } + + [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()); + } + } + + [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 c3d32ed6..6fcfe3e0 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)}; } @@ -335,5 +339,54 @@ 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 }; + } + + public override byte[] createTestExtendedSeq1Bytes() + { + return new byte[] { }; + } + + 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 }; + } + + 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/cam_asn/AccelerationConfidence.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.cs new file mode 100644 index 00000000..50fc11e7 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccelerationConfidence.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 = "AccelerationConfidence" )] + public class AccelerationConfidence: IASN1PreparedElement { + + 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) ] + + 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 00000000..30818edb --- /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 00000000..873e49fd --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AccidentSubCauseCode.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] + [ASN1BoxedType ( Name = "AccidentSubCauseCode" )] + public class AccidentSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..d04c7fd4 --- /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 00000000..13a2c545 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_AdhesionSubCauseCode.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] + [ASN1BoxedType ( Name = "AdverseWeatherCondition_AdhesionSubCauseCode" )] + public class AdverseWeatherCondition_AdhesionSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..f8bf307b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode.cs @@ -0,0 +1,60 @@ + +// +// 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 { + + 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) ] + + 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 00000000..db5416b3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_PrecipitationSubCauseCode.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] + [ASN1BoxedType ( Name = "AdverseWeatherCondition_PrecipitationSubCauseCode" )] + public class AdverseWeatherCondition_PrecipitationSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..7d9ed1dc --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AdverseWeatherCondition_VisibilitySubCauseCode.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] + [ASN1BoxedType ( Name = "AdverseWeatherCondition_VisibilitySubCauseCode" )] + public class AdverseWeatherCondition_VisibilitySubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..5f3b5b03 --- /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 00000000..76bfbff3 --- /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 00000000..d3ef28eb --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/AltitudeValue.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 = "AltitudeValue" )] + public class AltitudeValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..3c835660 --- /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 00000000..7d166ab0 --- /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 00000000..c0a35fd7 --- /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 00000000..45e006b9 --- /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 00000000..e9fa20bd --- /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 00000000..7f8077d8 --- /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/CauseCode.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCode.cs new file mode 100644 index 00000000..5f0157a1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCode.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 = "CauseCode", IsExtensible = false, IsSet = false)] + public class CauseCode : IASN1PreparedElement { + + private CauseCodeType causeCodeT_ ; + + [ASN1Element ( Name = "causeCodeT", IsOptional = false , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CauseCodeType CauseCodeT + { + get { return causeCodeT_; } + set { causeCodeT_ = 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(CauseCode)); + 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 00000000..96f0eac1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CauseCodeType.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] + [ASN1BoxedType ( Name = "CauseCodeType" )] + public class CauseCodeType: IASN1PreparedElement { + + 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) ] + + 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 00000000..03d29bb6 --- /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 00000000..e9dda3ee --- /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 00000000..aaa93082 --- /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 00000000..4e8fd10c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CollisionRiskSubCauseCode.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] + [ASN1BoxedType ( Name = "CollisionRiskSubCauseCode" )] + public class CollisionRiskSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..1421f945 --- /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 00000000..76c95c79 --- /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 00000000..5d59939e --- /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 00000000..c38dbc7d --- /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 00000000..62ed0353 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/CurvatureValue.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] + [ASN1BoxedType ( Name = "CurvatureValue" )] + public class CurvatureValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..b3dc87ae --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousEndOfQueueSubCauseCode.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] + [ASN1BoxedType ( Name = "DangerousEndOfQueueSubCauseCode" )] + public class DangerousEndOfQueueSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..ef6d33b9 --- /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 00000000..3b0683f2 --- /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 00000000..4447ca73 --- /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 00000000..2961774b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DangerousSituationSubCauseCode.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 its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "DangerousSituationSubCauseCode" )] + public class DangerousSituationSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..d48d01b3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaAltitude.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 = "DeltaAltitude" )] + public class DeltaAltitude: IASN1PreparedElement { + + 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) ] + + 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 00000000..d57fb705 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLatitude.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 = "DeltaLatitude" )] + public class DeltaLatitude: IASN1PreparedElement { + + 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) ] + + 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 00000000..43d6bc9c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/DeltaLongitude.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 = "DeltaLongitude" )] + public class DeltaLongitude: IASN1PreparedElement { + + 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) ] + + 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 00000000..9ab0f564 --- /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 00000000..7bd4db78 --- /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 00000000..3d01dc67 --- /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 00000000..3eb2cfa4 --- /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; + + [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 00000000..3e00a766 --- /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 CauseCode incidentIndication_ ; + + private bool incidentIndication_present = false ; + + [ASN1Element ( Name = "incidentIndication", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CauseCode 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 00000000..73d94f51 --- /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 00000000..d6f79545 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/EmergencyVehicleApproachingSubCauseCode.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 = "EmergencyVehicleApproachingSubCauseCode" )] + public class EmergencyVehicleApproachingSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..779b32f0 --- /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 00000000..833abfdf --- /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 00000000..a8cc6890 --- /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 00000000..362fabf4 --- /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 00000000..db5c5c7f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/GenerationDeltaTime.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 = "GenerationDeltaTime" )] + public class GenerationDeltaTime: IASN1PreparedElement { + + public static readonly GenerationDeltaTime OneMilliSec = new(1); + + 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 00000000..934c0ebd --- /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 00000000..6f909fb1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_AnimalOnTheRoadSubCauseCode.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] + [ASN1BoxedType ( Name = "HazardousLocation_AnimalOnTheRoadSubCauseCode" )] + public class HazardousLocation_AnimalOnTheRoadSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..bc463361 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_DangerousCurveSubCauseCode.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] + [ASN1BoxedType ( Name = "HazardousLocation_DangerousCurveSubCauseCode" )] + public class HazardousLocation_DangerousCurveSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..662197b1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_ObstacleOnTheRoadSubCauseCode.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 its.cam { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "HazardousLocation_ObstacleOnTheRoadSubCauseCode" )] + public class HazardousLocation_ObstacleOnTheRoadSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..53f1750b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HazardousLocation_SurfaceConditionSubCauseCode.cs @@ -0,0 +1,63 @@ + +// +// 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 { + + 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) ] + + 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 00000000..049bdef1 --- /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 00000000..1c2a9744 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingConfidence.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] + [ASN1BoxedType ( Name = "HeadingConfidence" )] + public class HeadingConfidence: IASN1PreparedElement { + + 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) ] + + 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 00000000..14608bd9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeadingValue.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] + [ASN1BoxedType ( Name = "HeadingValue" )] + public class HeadingValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..5177a4b3 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HeightLonCarr.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 = "HeightLonCarr" )] + public class HeightLonCarr: IASN1PreparedElement { + + 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) ] + + 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 00000000..7a0043e5 --- /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 00000000..74e30473 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanPresenceOnTheRoadSubCauseCode.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] + [ASN1BoxedType ( Name = "HumanPresenceOnTheRoadSubCauseCode" )] + public class HumanPresenceOnTheRoadSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..d3f55fe1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/HumanProblemSubCauseCode.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 = "HumanProblemSubCauseCode" )] + public class HumanProblemSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..f54c875a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/InformationQuality.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 = "InformationQuality" )] + public class InformationQuality: IASN1PreparedElement { + + 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) ] + + 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 00000000..3951136c --- /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 00000000..b0a2a088 --- /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 00000000..8ce7c746 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LanePosition.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] + [ASN1BoxedType ( Name = "LanePosition" )] + public class LanePosition: IASN1PreparedElement { + + 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) ] + + 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 00000000..5a4d148c --- /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 00000000..23d4b8f5 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LateralAccelerationValue.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 = "LateralAccelerationValue" )] + public class LateralAccelerationValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..c00162e0 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Latitude.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 = "Latitude" )] + public class Latitude: IASN1PreparedElement { + + 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) ] + + 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 00000000..eeadd42b --- /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 00000000..646b8bac --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Longitude.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 = "Longitude" )] + public class Longitude: IASN1PreparedElement { + + 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) ] + + 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 00000000..61a4b0ec --- /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 00000000..d321badd --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/LongitudinalAccelerationValue.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 = "LongitudinalAccelerationValue" )] + public class LongitudinalAccelerationValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..bb593654 --- /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 00000000..bfda7cd1 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/NumberOfOccupants.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 = "NumberOfOccupants" )] + public class NumberOfOccupants: IASN1PreparedElement { + + 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) ] + + 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 00000000..b04fd0e4 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PathDeltaTime.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 = "PathDeltaTime" )] + public class PathDeltaTime: IASN1PreparedElement { + + public static readonly PathDeltaTime TenMilliSecondsInPast = new(1); + + 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 00000000..f1de464f --- /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 00000000..09ba39b9 --- /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 00000000..5c34d584 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PerformanceClass.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 = "PerformanceClass" )] + public class PerformanceClass: IASN1PreparedElement { + + 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) ] + + 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 00000000..6c82ece0 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosCentMass.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 = "PosCentMass" )] + public class PosCentMass: IASN1PreparedElement { + + 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) ] + + 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 00000000..9f6865e2 --- /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 00000000..72b4c80d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosFrontAx.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 = "PosFrontAx" )] + public class PosFrontAx: IASN1PreparedElement { + + 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) ] + + 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 00000000..d4707c4a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosLonCarr.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 = "PosLonCarr" )] + public class PosLonCarr: IASN1PreparedElement { + + 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) ] + + 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 00000000..afae84f6 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PosPillar.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 = "PosPillar" )] + public class PosPillar: IASN1PreparedElement { + + 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) ] + + 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 00000000..8c41c6a9 --- /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 00000000..da34748f --- /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 00000000..3d148f3f --- /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 00000000..11d475a9 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PostCrashSubCauseCode.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] + [ASN1BoxedType ( Name = "PostCrashSubCauseCode" )] + public class PostCrashSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..eed131d5 --- /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 00000000..c4ac0167 --- /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 00000000..fcb4f2e2 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneID.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 = "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 00000000..37078a83 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ProtectedZoneRadius.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 = "ProtectedZoneRadius" )] + public class ProtectedZoneRadius: IASN1PreparedElement { + + public static readonly ProtectedZoneRadius OneMeter = new(1); + + 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 00000000..7f90a487 --- /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 00000000..a3422751 --- /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 00000000..d852547a --- /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 00000000..69e37286 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/PtActivationType.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 = "PtActivationType" )] + public class PtActivationType: IASN1PreparedElement { + + 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) ] + + 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 00000000..631eb335 --- /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 00000000..63efffa9 --- /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 00000000..7a67df7e --- /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 00000000..85e226f5 --- /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 00000000..aa2a00ef --- /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 00000000..7e57574d --- /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 00000000..05b00350 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RescueAndRecoveryWorkInProgressSubCauseCode.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] + [ASN1BoxedType ( Name = "RescueAndRecoveryWorkInProgressSubCauseCode" )] + public class RescueAndRecoveryWorkInProgressSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..3b1cbece --- /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 00000000..e5cba1e2 --- /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 00000000..d8d6484e --- /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 00000000..84e633af --- /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 00000000..e39da498 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/RoadworksSubCauseCode.cs @@ -0,0 +1,60 @@ + +// +// 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 { + + 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) ] + + 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 00000000..84996b8f --- /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 CauseCode incidentIndication_ ; + + private bool incidentIndication_present = false ; + + [ASN1Element ( Name = "incidentIndication", IsOptional = true , IsExtended = false , HasTag = false , HasDefaultValue = false ) ] + + public CauseCode 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 00000000..36a72e14 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SemiAxisLength.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 = "SemiAxisLength" )] + public class SemiAxisLength: IASN1PreparedElement { + + 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) ] + + 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 00000000..f0094d21 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SequenceNumber.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 = "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 00000000..7399a422 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SignalViolationSubCauseCode.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] + [ASN1BoxedType ( Name = "SignalViolationSubCauseCode" )] + public class SignalViolationSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..f9f7755f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SlowVehicleSubCauseCode.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] + [ASN1BoxedType ( Name = "SlowVehicleSubCauseCode" )] + public class SlowVehicleSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..58458171 --- /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 00000000..970a0bf6 --- /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 00000000..313229b2 --- /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 00000000..0ff02386 --- /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 00000000..495a8f4a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedConfidence.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] + [ASN1BoxedType ( Name = "SpeedConfidence" )] + public class SpeedConfidence: IASN1PreparedElement { + + 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) ] + + 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 00000000..46fef2da --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedLimit.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 = "SpeedLimit" )] + public class SpeedLimit: IASN1PreparedElement { + + public static readonly SpeedLimit OneKmPerHour = new(1); + + 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 00000000..99266004 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SpeedValue.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 = "SpeedValue" )] + public class SpeedValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..4f186335 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationID.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 = "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 00000000..6dc59e0c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationType.cs @@ -0,0 +1,66 @@ + +// +// 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 { + + 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) ] + + 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 00000000..b14a4fc5 --- /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 00000000..c84a2cd0 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/StationaryVehicleSubCauseCode.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] + [ASN1BoxedType ( Name = "StationaryVehicleSubCauseCode" )] + public class StationaryVehicleSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..dfe2156d --- /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 00000000..338500c5 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleConfidence.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 = "SteeringWheelAngleConfidence" )] + public class SteeringWheelAngleConfidence: IASN1PreparedElement { + + 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) ] + + 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 00000000..442df17f --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SteeringWheelAngleValue.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] + [ASN1BoxedType ( Name = "SteeringWheelAngleValue" )] + public class SteeringWheelAngleValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..0689f04d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/SubCauseCodeType.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 = "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 00000000..4bbe0987 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/Temperature.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 = "Temperature" )] + public class Temperature: IASN1PreparedElement { + + 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) ] + + 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 00000000..7b9014e4 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TimestampIts.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 = "TimestampIts" )] + public class TimestampIts: IASN1PreparedElement { + + 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) ] + + 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 00000000..c1ab18b7 --- /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 00000000..9a09e17a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TrafficConditionSubCauseCode.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] + [ASN1BoxedType ( Name = "TrafficConditionSubCauseCode" )] + public class TrafficConditionSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..6eeb312c --- /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 00000000..04db051e --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TransmissionInterval.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 = "TransmissionInterval" )] + public class TransmissionInterval: IASN1PreparedElement { + + 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) ] + + 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 00000000..dd709d90 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/TurningRadius.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 = "TurningRadius" )] + public class TurningRadius: IASN1PreparedElement { + + 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) ] + + 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 00000000..2c79d0db --- /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 00000000..ab63027a --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/ValidityDuration.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 = "ValidityDuration" )] + public class ValidityDuration: IASN1PreparedElement { + + 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) ] + + 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 00000000..fa74b527 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleBreakdownSubCauseCode.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] + [ASN1BoxedType ( Name = "VehicleBreakdownSubCauseCode" )] + public class VehicleBreakdownSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..4523f1ba --- /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 00000000..b410262a --- /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 00000000..98f103ce --- /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 00000000..75dc4496 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleLengthValue.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 = "VehicleLengthValue" )] + public class VehicleLengthValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..5e604e9c --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleMass.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 = "VehicleMass" )] + public class VehicleMass: IASN1PreparedElement { + + 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) ] + + 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 00000000..c323a391 --- /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 00000000..e4e395c0 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VehicleWidth.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 = "VehicleWidth" )] + public class VehicleWidth: IASN1PreparedElement { + + 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) ] + + 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 00000000..8423e67f --- /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 00000000..73e7b5ec --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/VerticalAccelerationValue.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 = "VerticalAccelerationValue" )] + public class VerticalAccelerationValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..30ee3727 --- /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 00000000..83ccf803 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WheelBaseVehicle.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 = "WheelBaseVehicle" )] + public class WheelBaseVehicle: IASN1PreparedElement { + + 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) ] + + 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 00000000..963bed6b --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/WrongWayDrivingSubCauseCode.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 = "WrongWayDrivingSubCauseCode" )] + public class WrongWayDrivingSubCauseCode: IASN1PreparedElement { + + 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) ] + + 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 00000000..ab95f637 --- /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 00000000..c41f77aa --- /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 00000000..98706232 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/cam_asn/YawRateValue.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] + [ASN1BoxedType ( Name = "YawRateValue" )] + public class YawRateValue: IASN1PreparedElement { + + 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) ] + + 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 00000000..b80d23a2 --- /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/PERAlignedCoderTestUtils.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/PERAlignedCoderTestUtils.cs index 13d7c8da..d724678a 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)}; } @@ -312,5 +317,55 @@ 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 }; + } + + 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 }; + } + + 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 }; + } + + 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 5d034dba..7b7da982 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; @@ -38,8 +39,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)}; } @@ -312,5 +318,160 @@ 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 }; + } + + 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 }; + } + + public override byte[] createTestExtendedChoiceSeq1Bytes() + { + return new byte[] { 0x00, 0x44, 0x86, 0x40 }; + } + + 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 }; + } + + 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() + { + StationType = new StationType(0), + ReferencePosition = new() + { + Latitude = new(10), + Longitude = new(10), + PositionConfidenceEllipse = new() + { + SemiMajorConfidence = new(1), + SemiMinorConfidence = new(1), + SemiMajorOrientation = new(0) + }, + 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 3ac3ea3a..97e30883 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,99 @@ 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); + + 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, + 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 4ee6bc42..ef5fc9e8 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 00000000..057dd164 Binary files /dev/null and b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/per/sample_cam.uper differ 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 9690bc12..896ae6d2 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/BugPrimitive.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/BugPrimitive.cs index bb041909..6b89592b 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 7f543c42..a09dd46f 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 825f9c46..2a9cf415 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 00000000..37355b25 --- /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 b7f39ced..208f302e 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 f196d53d..c318e823 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 9a2e23e0..bcd715da 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 81769532..b1378818 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentSchema.cs @@ -16,22 +16,22 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Enum ( Name = "ContentSchema")] + [ASN1Enum ( Name = "ContentSchema", IsExtensible = false, NumRootElements = 6)] 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; @@ -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 78f2b8ef..55ed5eda 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ContentType.cs @@ -16,30 +16,30 @@ namespace org.bn.coders.test_asn { [ASN1PreparedElement] - [ASN1Enum ( Name = "ContentType")] + [ASN1Enum ( Name = "ContentType", IsExtensible = false, NumRootElements = 10)] 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; @@ -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 a79738d7..6ac35cf1 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 2d55aac9..7a67f636 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 00000000..d34c5145 --- /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 71237e64..68fc2e86 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 00000000..cd3ed085 --- /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 00000000..160ec990 --- /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 00000000..4af6e222 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/ExtensibleInteger.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 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 00000000..6ab1c284 --- /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 c3aa6e98..3545c3d0 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 af831a46..7979e3b6 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 1348ff9d..7c86a073 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 b99239d3..36e222ae 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 dd3590eb..5fe6444f 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 d82c9f3b..11db613b 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 7bd27bac..a83fc8f9 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 5b32920e..c816d990 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 32d231f7..845de46b 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 73f02a61..0c3b12a7 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 00000000..aa775c01 --- /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 65897727..0c69fb6b 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 00000000..2e0b1e32 --- /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 ff73f107..546bcc82 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 { @@ -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; @@ -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 = @@ -319,18 +319,17 @@ public void initWithDefaults() { WithEnumDefEnumType param_WithEnumDef = new WithEnumDefEnumType(); - param_WithEnumDef.Value = WithEnumDefEnumType.EnumType.two; + 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 3fbeceb3..48456931 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 9295d1a2..3c64e4d6 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 f7190578..5d84c7d8 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 c7c6661d..3e2ecb1d 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 ec4f76e1..8d35753a 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 207265ec..b95d5d5f 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 a571960a..65192219 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 db3f72d3..d5750587 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 ccc1a17f..cbac2add 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 b13af27f..134fe992 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 00000000..224fe139 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/SubInteger.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 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 55f16672..25aac94d 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 136be168..afdcaa42 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 50664cf9..a405e33e 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 26b0b591..30231348 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 622856da..c38ac5f9 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 a9a5eae3..c0c14684 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 f3738c18..a811d86d 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/TestI.cs b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI.cs index 540279e4..ee410c47 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 9d39e7ec..f5e73f1e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI14.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 91a4d831..dd173232 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI16.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 e69f87ab..85cde746 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI32.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 fe722484..3a08af1e 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 00000000..f8a8eb6d --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestI8named.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 org.bn.coders.test_asn { + + + [ASN1PreparedElement] + [ASN1BoxedType ( Name = "TestI8named" )] + public class TestI8named: IASN1PreparedElement { + + 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) ] + + 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 2bdc5f97..da843616 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestIR.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 7d1efc14..842954ba 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestLong.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 a31222ac..797698ec 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 6dd4cef5..e4aed2f7 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 23ae170e..777ca82d 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 2c31f81e..64a07096 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 4023a027..867accb9 100644 --- a/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs +++ b/BinaryNotes.NET/BinaryNotesTests/org/bn/coders/test_asn/TestNI2.cs @@ -18,17 +18,12 @@ 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 - - ) ] + [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 70615e07..6b7f791f 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 f2b9989d..27a92a7c 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 950ac1b6..15b81390 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 c6c6abbb..180a19d4 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 00000000..85a89df7 --- /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 7a9cb680..0a4bf952 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 bc4fe3cf..da350f9c 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 95706887..78d9b53f 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 37539d54..685d4f6f 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 d82d2c97..84bb44d5 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 d0d5b20e..053ffe0c 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 a0fbf2f8..88e4a904 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 9cbea898..ff455e1e 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 f7e73aca..233061fc 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 new file mode 100644 index 00000000..cd294b37 --- /dev/null +++ b/BinaryNotes.NET/BinaryNotesTests/test_asn_convert.py @@ -0,0 +1,63 @@ +import zipfile +import os +import subprocess + +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) + +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') + +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, + ] + 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) + 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')) diff --git a/JavaLibrary/pom.xml b/JavaLibrary/pom.xml index 1d14bd8a..42579735 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