aboutsummaryrefslogtreecommitdiffstats
path: root/BSSMAP.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-27 17:08:43 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-28 21:27:57 +0100
commit3942e2f5867421c9f7f251b5f2092ea8c5c21f7e (patch)
treed7e2fb4a4ad564b17d497629468a6421336e2373 /BSSMAP.st
parentded50cff4da725d83935f0db6ace6b7863503d84 (diff)
BSSMAP: Parse a GSM48MIdentity here
Diffstat (limited to 'BSSMAP.st')
-rw-r--r--BSSMAP.st32
1 files changed, 32 insertions, 0 deletions
diff --git a/BSSMAP.st b/BSSMAP.st
index 40f1771..2a78298 100644
--- a/BSSMAP.st
+++ b/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.
+ ]
+]