smalltalk
/
osmo-st-gsm
Archived
1
0
Fork 0

GSM48: Parse the IdentityRequest message

This commit is contained in:
Holger Hans Peter Freyther 2010-11-26 22:55:13 +01:00
parent 67e54da19c
commit 5d0db43bed
2 changed files with 40 additions and 2 deletions

View File

@ -34,9 +34,13 @@ GSM48IE subclass: GSM48SimpleData [
^ self length
]
GSM48SimpleData class >> defaultValue [
^ ByteArray new: self length
]
GSM48SimpleData class >> createDefault [
^ self new
data: (ByteArray new: self length);
data: self defaultValue;
yourself
]
@ -347,6 +351,23 @@ GSM48SimpleData subclass: GSM48CTSPermission [
GSM48CTSPermission class >> elementId [ ^ 16rA2 ]
]
GSM48SimpleData subclass: GSM48IdentityType [
<category: 'osmo-message'>
<comment: 'I represent the 10.5.3.4. Identity Type'>
"Ignore the spare values"
GSM48IdentityType class >> typeIMSI [ ^ 1 ]
GSM48IdentityType class >> typeIMEI [ ^ 2 ]
GSM48IdentityType class >> typeIMEISV [ ^ 3 ]
GSM48IdentityType class >> typeTMSI [ ^ 4 ]
GSM48IdentityType class >> defaultValue [
^ ByteArray with: self typeIMSI
]
GSM48IdentityType class >> length [ ^ 1 ]
]
IEMessage subclass: GSM48MSG [
| seq |
@ -577,8 +598,18 @@ GSM48MMMessage subclass: AuthenticationResponse [
]
]
Object subclass: IdentityRequest [
GSM48MMMessage subclass: IdentityRequest [
<category: 'osmo-message'>
Mandantory := nil.
IdentityRequest class >> messageType [ ^ self msgIdReq ]
IdentityRequest class >> Mandantory [
^ Mandantory ifNil: [ Mandantory := OrderedCollection new ].
]
IdentityRequest class >> initialize [
self addMandantory: 'idType' with: GSM48IdentityType.
]
]
Object subclass: IdentityResponse [
@ -591,4 +622,5 @@ Eval [
LocationUpdatingAccept initialize.
AuthenticationRequest initialize.
AuthenticationResponse initialize.
IdentityRequest initialize.
]

View File

@ -295,5 +295,11 @@ TestCase subclass: TestMessages [
inp := #(6 46 4 5 0 1 20 1 0 17 5 2 114 244 128 16 3 23 8 41 34 1 96 16 85 37 115) asByteArray.
msg := MSGParser parse: inp.
self assert: msg toMessage asByteArray = inp.
"Identity Request"
inp := #(16r06 16r3A 16r04 16r05 16r00 16r01 16r06 16r01 16r00 16r03 16r05 16r18 16r01) asByteArray.
msg := MSGParser parse: inp.
self assert: msg toMessage asByteArray = inp.
]
]