maryam mahmoodi wrote:
Dear All,
  i have a question,
i defined a asn.1 file like this:
  =========
MOC_RecordType ::= SEQUENCE {
recordType                 [PRIVATE 2]     IMPLICIT  RecordType,
calTransactionType         [PRIVATE 3]     IMPLICIT  CallTransactionType,
servedMobileNumber         [PRIVATE 65319] IMPLICIT  ServedMobileNumber,
}
  RecordType ::= INTEGER {
     singleType           (0),
     firstType            (1),
     intermediateType     (2),
     lastType             (3),
     undefined_type       (8)
}
CallTransactionType ::= INTEGER {
     default                         ( 0),
     moc                             ( 1),
     mtc                             ( 2),
     emergencyCall                   ( 3)
}
  ServedMobileNumber ::= SEQUENCE {
     servedImsi      ServedIMSI,
     servedMsisdn  [PRIVATE 199] IMPLICIT  ServedMSIsdn
}
ServedIMSI ::=[PRIVATE 198] IMPLICIT TBCD-String (SIZE (1..8))
===========
  when i use this type and encode it the crteated encoded file is like this:
c2  1  0  c3  1  0  ff  83  fe  27  80  df  81  46  8  34  12  1  1  1  3  53  
f0  df  81  47  6  89 (etc...)
as u see the tag of 1-byte tags is correct ,but for "servedMobileNumber" the encoded is "ff 83 fe 27",
that i do not know why it changed???it should be "ff 27".

[EMAIL PROTECTED]:~]> unber -t 'ff27'
BER: FF27
TAG: [PRIVATE 39] (constructed)

ff 27 is [PRIVATE 39], constructed. Since the tag number is greater than
31, the bits 5 to 1 of the first octet (ff) shall be encoded as 11111.
(X.690, #8.1.2.4.1, c). Since the tag number is less than 128, the
second octet (27) has the leading bit set to 0 (end of tag encoding),
and the rest 7 bits encode number 39 (27h).

[EMAIL PROTECTED]:~]> unber -t 'ff 83 fe 27'
BER: FF83FE27
TAG: [PRIVATE 65319] (constructed)
[EMAIL PROTECTED]:~]>

ff 83 fe 27 is [PRIVATE 65319]. If we take bits 7 to 1 from the
last three bytes (83 fe 27) we'll have a0000011 b1111110 c0100111,
which is 65319. The bits 8 of these bytes are, respectively, 1,1 and 0.

I don't see a problem in this encoding.

--
Lev Walkin
[EMAIL PROTECTED]


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

Reply via email to