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

BSSMAP: Parse a GSM48MIdentity here

This commit is contained in:
Holger Hans Peter Freyther 2010-11-27 17:08:43 +01:00
parent ded50cff4d
commit 3942e2f586
1 changed files with 32 additions and 0 deletions

View File

@ -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.
]
]