Hello, I'm new to ASN.1 and am looking for some guidance, I think I'm trying to treat it too much like inheritance in c++ but not sure what is the best direction..

I would like to define a set of messages that have a common header with three guid octet strings, the first of these strings will have a constant, unique pre-defined value. Rough example is below, it compiles, but I've tried many syntax variations trying to add default values to msgObj with DEFAULT and 'abc...'H, etc, but none of them compile. What are some approaches to do something like this?


MsgBase DEFINITIONS ::=
BEGIN

MsgBaseType ::= SEQUENCE {
   msgObj  UuidType,
   srcObj  UuidType,
   dstObj  UuidType
}

UuidType ::= OCTET STRING (SIZE (16))

-- how to make header->msgObj unique for IntegerMessage and BoolMessage?
-- say, d6dc8a30428611dbb0de0800200c9a66 and 217fe690428711dbb0de0800200c9a66
-- repectivly??

IntMessage ::= SEQUENCE {
   header MsgBaseType,
   intVal INTEGER
}

BoolMessage ::= SEQUENCE {
   header MsgBaseType,
   boolVal BOOLEAN
}

END

Dear Mr. Kaple:

Please understand that setting a default value for IntMessage.header means that you'll have to set a value for all three elements thereof. That is, something like this

   IntMessage ::= SEQUENCE {
       header MsgBaseType DEFAULT {
            msgObj 'D6DC8A30428611DBB0DE0800200C9A66'H,
            srcObj 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'H,
            dstObj 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'H
       },
       intVal INTEGER
   }

For your convenience, I have attached a file with default values for both IntMessage.header and BoolMessage.header, each value with a unique msgObj.

Please let me know if you still have questions.

=====================================================================
Conrad Sigona                    Voice Mail     : 1-732-302-9669 x400
OSS Nokalva                      Fax            : 1-614-388-4156
[EMAIL PROTECTED]                   My direct line : 1-315-845-1773
MsgBase DEFINITIONS ::=
BEGIN

MsgBaseType ::= SEQUENCE {
    msgObj  UuidType,
    srcObj  UuidType,
    dstObj  UuidType
}

UuidType ::= OCTET STRING (SIZE (16)) 

-- how to make header->msgObj unique for IntegerMessage and BoolMessage?
-- say, d6dc8a30428611dbb0de0800200c9a66 and 217fe690428711dbb0de0800200c9a66
-- repectivly??

IntMessage ::= SEQUENCE {
    header MsgBaseType DEFAULT { msgObj 'D6DC8A30428611DBB0DE0800200C9A66'H,
                                 srcObj 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'H,
                                 dstObj 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'H
    },                                 
    intVal INTEGER
}

BoolMessage ::= SEQUENCE {
    header MsgBaseType DEFAULT { msgObj '217FE690428711DBB0DE0800200C9A66'H,
                                 srcObj 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'H,
                                 dstObj 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD'H
    },                  
    boolVal BOOLEAN
}

END
_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to