diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-27 17:08:43 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-28 21:27:57 +0100 |
commit | 3942e2f5867421c9f7f251b5f2092ea8c5c21f7e (patch) | |
tree | d7e2fb4a4ad564b17d497629468a6421336e2373 /BSSMAP.st | |
parent | ded50cff4da725d83935f0db6ace6b7863503d84 (diff) |
BSSMAP: Parse a GSM48MIdentity here
Diffstat (limited to 'BSSMAP.st')
-rw-r--r-- | BSSMAP.st | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -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. + ] +] |