Hi all,
I'm trying to write layer 3 GSM messages
based on the 3GPP TS 04.80.
In Annex A, there are a set of ASN.1 SS Protocols
that I can use to generate layer 3 messages.
I've been having a few problems,
trying to work out how certain ASN1 elements work.
1) I'm not sure how to
approach CHOICE elements.
Sometimes I think I should use the tag value of
the chosen element for the CHOICE and a length value of whole of the chosen
element.(When the chosen element is SEQUENCE)
Other times it seems that the
CHOICE element shouldn't have it's own tag or length values. (When the chosen
element is NULL, INTEGER, OCTET STRING)
[Zemer Margolin] CHOICE type has no real existence, it is more of a
way to propose an alternative on the ASN.1 specification
level.a value of type CHOICE is encoded
according to the type and tag of the alternative that has been
retained.If the
CHOICE type is preceded by a tag (of class EXPLICIT) like in your example, the
tag ( [0] ) is encoded in a constructed
form
2) Is an element with zero length always a NULL type
or can other types have zero length?
The problems I am having are
with the following examples
Facility Invoke=NotifySS(ss-code=CNAP,
nameUnavailable)
Should this be 30 09 81 01 19 b4 04 80 02 82 00 (with
callingName choice tag/le! ngth)
[Zemer Margolin] following the rule to encode
CHOICE type, this seems the right way (for BER)
or 30 07
81 01 19 b4 02 82 00 (without callingName choice tag/length)
[Zemer Margolin]
here you are missing the CHOICE EXPLICIT
tag.
notifySS OPERATION
ARGUMENT
notifySS-Arg SEQUENCE
{
ss-Code
[1] IMPLICIT OCTET STRING ( SIZE (1 ) )
OPTIONAL,
......
nameIndicator
[20] IMPLICIT SEQUENCE
{
callingName [0] CHOICE
{
namePresentationAllowed [0] IMPLICIT
SEQUENCE {
&!
nbsp;
dataCodingScheme [0] IMPLICIT OCTET STRING ( SIZE
(1 )
),
lengthInCharacters [1] IMPLICIT
INTEGER,
nameString [2]
IMPLICIT OCTET STRING ( SIZE (1 .. 160 )
),
...
},
presentationRestricted [1]
IMPLICIT
NULL,
nameUnavailable &nb!
sp; [2] IMPLICIT
NULL,
namePresentationRestricted [3] IMPLICIT SEQUENCE
{
dataCodingScheme [0] IMPLICIT OCTET STRING ( SIZE
(1 )
),
lengthInCharacters [1] IMPLICIT
INTEGER,
nameString [2]
IMPLICIT OCTET STRING ( SIZE (1 .. 160 )
),
... }}
OPTIONAL,
... } OPTIONAL! ,
best regards
Zemer Margolin
Tel: +9723-645-5189
E-mail: [EMAIL PROTECTED]
With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs
