GSM48.st: Add lot of IE formation to be able to create a LU Request
This commit is contained in:
parent
512da52c99
commit
b7a67d63e5
121
GSM48.st
121
GSM48.st
|
@ -1,40 +1,127 @@
|
|||
"Messages for GSM04.08"
|
||||
|
||||
Object subclass: LocationUpdatingRequest [
|
||||
"""
|
||||
IEs for GSM48MSG
|
||||
"""
|
||||
Object subclass: GSM48KeySeqLuType [
|
||||
| val |
|
||||
|
||||
GSM48KeySeqLuType class >> createDefault [
|
||||
^ (self new)
|
||||
val: 16r70;
|
||||
yourself
|
||||
]
|
||||
|
||||
val: aVal [
|
||||
val := aVal.
|
||||
]
|
||||
|
||||
storeOnDirect: aMsg [
|
||||
aMsg putByte: val.
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: GSM48Lai [
|
||||
| mcc mnc lac |
|
||||
GSM48Lai class >> createDefault [
|
||||
^ (self new)
|
||||
mcc: 0;
|
||||
mnc: 0;
|
||||
lac: 0;
|
||||
yourself
|
||||
]
|
||||
|
||||
mcc: aMcc [ mcc := aMcc ]
|
||||
mnc: aMnc [ mnc := aMnc ]
|
||||
lac: aLac [ lac := aLac ]
|
||||
|
||||
storeOnDirect: aMsg [
|
||||
self notImplemented
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: GSM48Classmark1 [
|
||||
| cm1 |
|
||||
|
||||
GSM48Classmark1 class >> createDefault [
|
||||
^ (self new)
|
||||
cm1: 16r33;
|
||||
yourself
|
||||
]
|
||||
|
||||
cm1: aCm [ cm1 := aCm ]
|
||||
storeOnDirect: aMsg [
|
||||
aMsg putByte: cm1.
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: GSM48MIdentity [
|
||||
| imsi tmsi |
|
||||
|
||||
LocationUpdatingRequest class >> initWithIMSI: aImsi [
|
||||
GSM48MIdentity class >> createDefault [
|
||||
^ (self new)
|
||||
imsi: aImsi;
|
||||
imsi: '000000000000';
|
||||
yourself
|
||||
]
|
||||
|
||||
LocationUpdatingRequest class >> initWithTMSI: aTmsi [
|
||||
^ (self new)
|
||||
tmsi: aTmsi;
|
||||
yourself
|
||||
imsi: aImsi [ imsi := aImsi. ]
|
||||
storeOnDirect: aMsg [
|
||||
self notImplemented
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
IEMessage subclass: GSM48MSG [
|
||||
<comment: 'GSM48 has helper code for mandantory types'>
|
||||
|
||||
Mandantory := nil.
|
||||
Optional := nil.
|
||||
|
||||
GSM48MSG class >> mandantory: anArray [
|
||||
]
|
||||
|
||||
toMessage [
|
||||
storeOn: aMsg [
|
||||
"Write the header. Skip Ind, Sequence are hardcoded"
|
||||
aMsg putByte: self class classType.
|
||||
aMsg putByte: self class messageType.
|
||||
|
||||
"Write all Mandantory parts"
|
||||
Mandantory ifNotNil: [
|
||||
Mandantory do: [:each | each storeOnDirect: aMsg ]
|
||||
]
|
||||
|
||||
"Optional"
|
||||
Optional ifNotNil: [
|
||||
Optional do: [:each | each storeOn: aMsg ]
|
||||
]
|
||||
|
||||
"TODO: Handle the Conditionals too"
|
||||
]
|
||||
]
|
||||
|
||||
GSM48MSG subclass: GSM48MMMessage [
|
||||
<comment: 'Baseclass for mobility managamenet'>
|
||||
|
||||
GSM48MMMessage class >> classType [ ^ 5 ]
|
||||
GSM48MMMessage class >> msgLU [ ^ 8 ]
|
||||
]
|
||||
|
||||
GSM48MSG subclass: LocationUpdatingRequest [
|
||||
<mandantory: #(#(#luType #GSM48KeySeqLuType)
|
||||
#(#lai #GSM48Lai)
|
||||
#(#cm1 #GSM48Classmark1)
|
||||
#(#mi #GSM48MIdentity) ) >
|
||||
|
||||
LocationUpdatingRequest class >> messageType [ ^ self msgLU ]
|
||||
]
|
||||
|
||||
Object subclass: LocationUpdatingAccept [
|
||||
toMessage [
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: LocationUpdatingReject [
|
||||
toMessage [
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: IdentityRequest [
|
||||
toMessage [
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: IdentityResponse [
|
||||
toMessage [
|
||||
]
|
||||
]
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
<filein>BSSAP.st</filein>
|
||||
<filein>BSSMAP.st</filein>
|
||||
<filein>GSM48.st</filein>
|
||||
<filein>Messages.st</filein>
|
||||
<filein>GSM48.st</filein>
|
||||
<filein>SCCPHandler.st</filein>
|
||||
<filein>TestPhone.st</filein>
|
||||
|
||||
|
|
Reference in New Issue