diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-24 15:33:19 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-24 15:33:19 +0100 |
commit | 50001c769b5b3011a13ad5c76446419bccfd4b18 (patch) | |
tree | d1c6f1287cc6da428d27923147c4d80ed2496e65 /BSSMAP.st | |
parent | 92c95cab9785ee3a32fea14eed2544f33c7d74a0 (diff) |
BSSMAP: Parse the Clear Command message.
Diffstat (limited to 'BSSMAP.st')
-rw-r--r-- | BSSMAP.st | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -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. + ] +] |