diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-27 17:15:51 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-28 21:27:57 +0100 |
commit | 788866cb1ee1546bba176afa909ebe09c7370afe (patch) | |
tree | 834cb53a0b11d9207e8e8ab322bc5e1dfea040c9 /BSSMAP.st | |
parent | 3942e2f5867421c9f7f251b5f2092ea8c5c21f7e (diff) |
BSSMAP: Add a test case to handle the Paging Request
Diffstat (limited to 'BSSMAP.st')
-rw-r--r-- | BSSMAP.st | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -299,3 +299,55 @@ GSM0808IE subclass: GSM0808IMSI [ mi writeOnDirect: aMsg. ] ] + +GSM0808IE subclass: GSM0808CellIdentifierList [ + | ident cells | + + GSM0808CellIdentifierList class >> elementId [ ^ 26 ] + GSM0808CellIdentifierList class >> parseFrom: aByteArray [ + | len ident cells | + + len := aByteArray at: 2. + len < 2 + ifTrue: [ + Error signal: 'No place for the cell identifier list'. + ]. + + (len - 1) even + ifFalse: [ + Error signal: 'Need to have an even number of cells'. + ]. + + ident := aByteArray at: 3. + + cells := OrderedCollection new. + 1 to: len - 1 by: 2 do: [:each | + | cell | + cell := (aByteArray ushortAt: 3 + each) swap16. + cells add: cell. + ]. + + ident printNl. + cells printNl. + + ^ self new + cells: cells; + ident: ident; + yourself + ] + + ident [ ^ ident ] + ident: anIdent [ ident := anIdent bitAnd: 16r00FF ] + + cells [ ^ cells ] + cells: aCells [ cells := aCells ] + + writeOnDirect: aMsg [ + aMsg putByte: 1 + (cells size * 2). + aMsg putByte: ident. + + cells do: [:lac | + aMsg putLen16: lac. + ]. + ] +] |