aboutsummaryrefslogtreecommitdiffstats
path: root/BSSMAP.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-24 15:33:19 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-24 15:33:19 +0100
commit50001c769b5b3011a13ad5c76446419bccfd4b18 (patch)
treed1c6f1287cc6da428d27923147c4d80ed2496e65 /BSSMAP.st
parent92c95cab9785ee3a32fea14eed2544f33c7d74a0 (diff)
BSSMAP: Parse the Clear Command message.
Diffstat (limited to 'BSSMAP.st')
-rw-r--r--BSSMAP.st35
1 files changed, 35 insertions, 0 deletions
diff --git a/BSSMAP.st b/BSSMAP.st
index a18d05d..4b78034 100644
--- a/BSSMAP.st
+++ b/BSSMAP.st
@@ -210,3 +210,38 @@ GSM0808IE subclass: GSMLayer3Info [
aMsg putByteArray: dat.
]
]
+
+GSM0808IE subclass: GSMCauseIE [
+ | cause |
+
+ <category: 'osmo-message'>
+ <comment: 'Generate a CauseIE'>
+ "TODO: Only simple ones are supported right now"
+
+ GSMCauseIE class >> elementId [ <category: 'spec'> ^ 4 ]
+
+ GSMCauseIE class >> initWith: aCause [
+ ^ self new
+ cause: aCause;
+ yourself
+ ]
+ GSMCauseIE class >> parseFrom: aByteArray [
+ | size |
+ size := aByteArray at: 2.
+ size = 1
+ ifFalse: [
+ ^ Error signal: 'Extended error codes are not supported.'.
+ ].
+
+ ^ GSMCauseIE initWith: (aByteArray at: 3)
+ ]
+
+ cause [ ^ cause ]
+ cause: aCause [ cause := aCause ]
+
+ writeOn: aMsg [
+ aMsg putByte: self class elementId.
+ aMsg putByte: 1.
+ aMsg putByte: cause.
+ ]
+]