On Wed, 19 Nov 2008, pradeep kashyap s.a wrote:

Hello,
I hav a few questions concerning the ASN.1 syntax. Consider the following
record structure below:

PosPayLoad ::= CHOICE {
tia801payload OCTET STRING(SIZE (1..8192)),
rrcPayload OCTET STRING(SIZE (1..8192)),
rrlpPayload OCTET STRING(SIZE (1..8192)),
...}
I have (4) questions........
(1) Will the CHOICE{} let me select any one among the three ?? i.e. does it
act like an enumumerated{} ?? I suppose it should be yes but want to
confirm.

On the encoding side, you may select any one of the three possibilities.
On the decoding side, you can accept any one of the three, plus (by virtue
of the extensibility marker "...") you can accept yet unknown possibilities.

For instance, if your side implemented version 1 of your protocol and the sending side implemented version 2 of the protocol which includes five possibilities, you would be able to accept them all, both the three you know about and the two you don't know about. This is not to say that you can make sense of the two you don't know about. By including the extensibility marker, you are specifying that the decoder is supposed to accept unknown choices as valid.

(2) Say I want to use/send only the rrcPayload in the above PosPayload,
which is defined as an OCTET STRING(SIZE (1..8192)), does that mean that it
contains only string bits of 0's and 1's encoded in Octet format of
unaligned PER (I want to use PER in my case)?? I ask this because the
rrcPayload that I want to send is in another document which is written as
below (not in the ASN.1 syntax)

C/A or P on L2      Mandatory        Bit string(2)
URA Index            Mandatory        Bit string(4)

and many more parameters.........so do I have to write this as another ASN.1
syntax record structure and include it within that or do I have to do it
separately and include only the octet string bits there? For example I could
write a record structure for the above parameters as

RRCNavModel::=SEQUENCE{
C/A or P on L2    BIT STRING(SIZE(1..2))
URA Index          BIT STRING(SIZE(1..4))
}

Bear in mind that if you specify a field as an OCTET STRING, it has to be a multiple of 8 bits. That is, you might have to pad out your field if it is not an integral number of octets. That said, you may insert any payload into the OCTET STRING, leaving it specified simply as an OCTET STRING. On the other hand, if you wish to work with the individual fields within the payload, you would specify them with ASN.1 (assuming they are able to be specified in ASN.1).

(3) I have a related question here.........does the BIT STRING(SIZE(1..4))
mean that I have a string of 4 bits??......because that is what I want. If
not please correct me.

No. It means the string is no less than 1 nor more than 4 bits. If you wish to specify that it must have 4 bits, you would use something like

    BIT STRING (SIZE(4))

Also I suppose the answer for the 2nd question would be that I have to
include only the OCTET STRING for the rrcPayload.
(4) Again the OCTET STRING(SIZE (1..8192)) means that I can have anything
upto 8192 OCTET strings right???

Not quite. You may not have a null string. If you wish to also allow null strings, you would use (0..8192).


=====================================================================
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
_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to