misc: First round of categories and things for the code
This commit is contained in:
parent
b3181b1eff
commit
55971af370
9
BSSAP.st
9
BSSAP.st
|
@ -1,8 +1,12 @@
|
|||
Object subclass: BSSAPHelper [
|
||||
BSSAPHelper class >> msgManagemnt [ ^ 0 ]
|
||||
BSSAPHelper class >> msgDtap [ ^ 1 ]
|
||||
<category: 'osmo-message'>
|
||||
<comment: 'BSSAP message routines'>
|
||||
|
||||
BSSAPHelper class >> msgManagemnt [ <category: 'spec'> ^ 0 ]
|
||||
BSSAPHelper class >> msgDtap [ <category: 'spec'> ^ 1 ]
|
||||
|
||||
BSSAPHelper class >> prependManagement: aMsg [
|
||||
<category: 'creation'>
|
||||
"Prepent the BSSAP Management header"
|
||||
| tmp |
|
||||
|
||||
|
@ -13,6 +17,7 @@ Object subclass: BSSAPHelper [
|
|||
]
|
||||
|
||||
BSSAPHelper class >> prependDTAP: aMsg dlci: sapi [
|
||||
<category: 'creation'>
|
||||
"Prepend the DTAP header"
|
||||
| tmp |
|
||||
tmp := OrderedCollection new.
|
||||
|
|
33
BSSMAP.st
33
BSSMAP.st
|
@ -1,17 +1,21 @@
|
|||
Object subclass: GSM0808IE [
|
||||
<category: 'osmo-message'>
|
||||
<comment: 'Base class of IEs for GSM0808'>
|
||||
]
|
||||
|
||||
Object subclass: GSM0808Helper [
|
||||
GSM0808Helper class >> msgComplL3 [ ^ 16r57 ]
|
||||
GSM0808Helper class >> msgReset [ ^ 16r30 ]
|
||||
GSM0808Helper class >> msgResetAck [ ^ 16r31 ]
|
||||
GSM0808Helper class >> msgClear [ ^ 16r20 ]
|
||||
GSM0808Helper class >> msgClearComp [ ^ 16r21 ]
|
||||
GSM0808Helper class >> msgComplL3 [ <category: 'spec'> ^ 16r57 ]
|
||||
GSM0808Helper class >> msgReset [ <category: 'spec'> ^ 16r30 ]
|
||||
GSM0808Helper class >> msgResetAck [ <category: 'spec'> ^ 16r31 ]
|
||||
GSM0808Helper class >> msgClear [ <category: 'spec'> ^ 16r20 ]
|
||||
GSM0808Helper class >> msgClearComp [ <category: 'spec'> ^ 16r21 ]
|
||||
]
|
||||
|
||||
Object subclass: BCD [
|
||||
<category: 'osmo-message'>
|
||||
<comment: 'Class to deal with Binary Coded Decimals'>
|
||||
BCD class >> encode: aNumber [
|
||||
<category: 'access'>
|
||||
| col num |
|
||||
col := OrderedCollection new.
|
||||
|
||||
|
@ -26,7 +30,11 @@ Object subclass: BCD [
|
|||
]
|
||||
|
||||
Object subclass: LAI [
|
||||
<category: 'osmo-message'>
|
||||
<comment: 'Generate a Location Area Identifier'>
|
||||
|
||||
LAI class >> generateLAI: mcc mnc: mnc [
|
||||
<category: 'creation'>
|
||||
| mcc_bcd mnc_bcd lai_0 lai_1 lai_2 |
|
||||
mcc_bcd := BCD encode: mcc.
|
||||
mnc_bcd := BCD encode: mnc.
|
||||
|
@ -49,15 +57,20 @@ Object subclass: LAI [
|
|||
]
|
||||
|
||||
GSM0808IE subclass: GSMCellIdentifier [
|
||||
<category: 'osmo-message'>
|
||||
<comment: 'Generate a GSM0808 Cell Identifier'>
|
||||
|
||||
| mcc mnc lac ci |
|
||||
GSMCellIdentifier class >> elementId [ ^ 5 ]
|
||||
GSMCellIdentifier class >> elementId [ <category: 'spec'> ^ 5 ]
|
||||
GSMCellIdentifier class >> initWith: mcc mnc: mnc lac: lac ci: ci [
|
||||
<category: 'creation'>
|
||||
^ (self new)
|
||||
mcc: mcc mnc: mnc lac: lac ci: ci;
|
||||
yourself
|
||||
]
|
||||
|
||||
mcc: aMcc mnc: aMnc lac: aLac ci: aCi [
|
||||
<category: 'creation'>
|
||||
mcc := aMcc.
|
||||
mnc := aMnc.
|
||||
lac := aLac.
|
||||
|
@ -65,6 +78,7 @@ GSM0808IE subclass: GSMCellIdentifier [
|
|||
]
|
||||
|
||||
storeOn: aMsg [
|
||||
<category: 'creation'>
|
||||
| lai |
|
||||
lai := LAI generateLAI: mcc mnc: mnc.
|
||||
|
||||
|
@ -78,19 +92,24 @@ GSM0808IE subclass: GSMCellIdentifier [
|
|||
]
|
||||
|
||||
GSM0808IE subclass: GSMLayer3Info [
|
||||
<category: 'osmo-message'>
|
||||
<comment: 'Generate a Layer3 IE'>
|
||||
| data |
|
||||
GSMLayer3Info class >> elementId [ ^ 23 ]
|
||||
GSMLayer3Info class >> elementId [ <category: 'spec'> ^ 23 ]
|
||||
GSMLayer3Info class >> initWith: data [
|
||||
<category: 'creation'>
|
||||
^ (self new)
|
||||
data: data;
|
||||
yourself
|
||||
]
|
||||
|
||||
data: aData [
|
||||
<category: 'creation'>
|
||||
data := aData
|
||||
]
|
||||
|
||||
storeOn: aMsg [
|
||||
<category: 'creation'>
|
||||
aMsg putByte: self class elementId.
|
||||
aMsg putByte: data size.
|
||||
aMsg putByteArray: data.
|
||||
|
|
24
GSM48.st
24
GSM48.st
|
@ -4,26 +4,32 @@
|
|||
IEs for GSM48MSG
|
||||
"""
|
||||
Object subclass: GSM48KeySeqLuType [
|
||||
<category: 'osmo-message'>
|
||||
| val |
|
||||
|
||||
GSM48KeySeqLuType class >> createDefault [
|
||||
<category: 'creation'>
|
||||
^ (self new)
|
||||
val: 16r70;
|
||||
yourself
|
||||
]
|
||||
|
||||
val: aVal [
|
||||
<category: 'creation'>
|
||||
val := aVal.
|
||||
]
|
||||
|
||||
storeOnDirect: aMsg [
|
||||
<category: 'creation'>
|
||||
aMsg putByte: val.
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: GSM48Lai [
|
||||
| mcc mnc lac |
|
||||
<category: 'osmo-message'>
|
||||
GSM48Lai class >> createDefault [
|
||||
<category: 'creation'>
|
||||
^ (self new)
|
||||
mcc: 0;
|
||||
mnc: 0;
|
||||
|
@ -31,41 +37,48 @@ Object subclass: GSM48Lai [
|
|||
yourself
|
||||
]
|
||||
|
||||
mcc: aMcc [ mcc := aMcc ]
|
||||
mnc: aMnc [ mnc := aMnc ]
|
||||
lac: aLac [ lac := aLac ]
|
||||
mcc: aMcc [ <category: 'creation'> mcc := aMcc ]
|
||||
mnc: aMnc [ <category: 'creation'> mnc := aMnc ]
|
||||
lac: aLac [ <category: 'creation'> lac := aLac ]
|
||||
|
||||
storeOnDirect: aMsg [
|
||||
<category: 'creation'>
|
||||
aMsg putByteArray: (LAI generateLAI: mcc mnc: mnc).
|
||||
aMsg putLen16: lac.
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: GSM48Classmark1 [
|
||||
<category: 'osmo-message'>
|
||||
| cm1 |
|
||||
|
||||
GSM48Classmark1 class >> createDefault [
|
||||
<category: 'creation'>
|
||||
^ (self new)
|
||||
cm1: 16r33;
|
||||
yourself
|
||||
]
|
||||
|
||||
cm1: aCm [ cm1 := aCm ]
|
||||
cm1: aCm [ <category: 'creation'> cm1 := aCm ]
|
||||
storeOnDirect: aMsg [
|
||||
<category: 'creation'>
|
||||
aMsg putByte: cm1.
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: GSM48MIdentity [
|
||||
<category: 'osmo-message'>
|
||||
| imsi tmsi |
|
||||
GSM48MIdentity class >> createDefault [
|
||||
<category: 'creation'>
|
||||
^ (self new)
|
||||
imsi: '000000000000';
|
||||
yourself
|
||||
]
|
||||
|
||||
imsi: aImsi [ imsi := aImsi. ]
|
||||
imsi: aImsi [ <category: 'creation'> imsi := aImsi. ]
|
||||
storeOnDirect: aMsg [
|
||||
<category: 'creation'>
|
||||
imsi ifNotNil: [
|
||||
^ self storeImsiDirect: aMsg.
|
||||
].
|
||||
|
@ -121,6 +134,7 @@ IEMessage subclass: GSM48MSG [
|
|||
]
|
||||
|
||||
GSM48MSG subclass: GSM48MMMessage [
|
||||
<category: 'osmo-message'>
|
||||
<comment: 'Baseclass for mobility managamenet'>
|
||||
|
||||
GSM48MMMessage class >> classType [ ^ 5 ]
|
||||
|
|
|
@ -1,22 +1,27 @@
|
|||
"General IE based message handling"
|
||||
Object subclass: IEMessage [
|
||||
<category: 'osmo-messages'>
|
||||
| ies type |
|
||||
|
||||
IEMessage class >> initWith: type [
|
||||
<category: 'creation'>
|
||||
^ (self new)
|
||||
type: type;
|
||||
yourself
|
||||
]
|
||||
|
||||
type: aType [
|
||||
<category: 'creation'>
|
||||
type := aType.
|
||||
]
|
||||
|
||||
addIe: aIe [
|
||||
<category: 'creation'>
|
||||
self ies add: aIe.
|
||||
]
|
||||
|
||||
ies [
|
||||
<category: 'access'>
|
||||
ies isNil ifTrue: [
|
||||
ies := OrderedCollection new.
|
||||
].
|
||||
|
@ -25,6 +30,7 @@ Object subclass: IEMessage [
|
|||
]
|
||||
|
||||
storeOn: aMsg [
|
||||
<category: 'creation'>
|
||||
aMsg putByte: type.
|
||||
|
||||
self ies do: [:each | each storeOn: aMsg ]
|
||||
|
|
Reference in New Issue