BSSMAP: Parse a GSM48MIdentity here
This commit is contained in:
parent
ded50cff4d
commit
3942e2f586
32
BSSMAP.st
32
BSSMAP.st
|
@ -267,3 +267,35 @@ GSM0808IE subclass: GSM0808ChosenChannel [
|
|||
aMsg putByte: channel
|
||||
]
|
||||
]
|
||||
|
||||
GSM0808IE subclass: GSM0808IMSI [
|
||||
| imsi |
|
||||
|
||||
GSM0808IMSI class >> elementId [ ^ 8 ]
|
||||
GSM0808IMSI class >> initWith: anImsi [
|
||||
^ self new
|
||||
imsi: anImsi;
|
||||
yourself
|
||||
]
|
||||
|
||||
GSM0808IMSI class >> parseFrom: aByteArray [
|
||||
| imsi |
|
||||
imsi := (GSM48MIdentity parseFrom: (aByteArray copyFrom: 2)) imsi.
|
||||
imsi ifNil: [
|
||||
^ Error signal: 'MI did not include the IMSI.'.
|
||||
].
|
||||
|
||||
^ GSM0808IMSI initWith: imsi.
|
||||
]
|
||||
|
||||
imsi [ ^ imsi ]
|
||||
imsi: anIMSI [ imsi := anIMSI ]
|
||||
|
||||
writeOnDirect: aMsg [
|
||||
| mi |
|
||||
mi := GSM48MIdentity new.
|
||||
mi imsi: imsi.
|
||||
|
||||
mi writeOnDirect: aMsg.
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue