smalltalk
/
osmo-st-gsm
Archived
1
0
Fork 0

gsm: Provide access to the cell description..

This commit is contained in:
Holger Hans Peter Freyther 2012-12-25 10:43:07 +01:00
parent 11efcf94bb
commit f653a23da5
2 changed files with 22 additions and 0 deletions

View File

@ -291,6 +291,23 @@ GSM48SimpleData subclass: GSM48CellDescription [
<comment: 'I represent a 10.5.2.2 Cell Description'>
<gsmName: 'cellDescription'>
<gsmValueLength: 2>
ncc [
<category: 'accessing'>
^ (data first bitShift: -3) bitAnd: 2r111
]
bcc [
<category: 'accessing'>
^ (data first bitShift: -0) bitAnd: 2r111
]
bcch [
| hi low |
hi := data first bitShift: -6.
low := data second.
^ (hi bitShift: 8) bitOr: low.
]
]
GSM48SimpleData subclass: GSM48ChannelDescription [

View File

@ -435,6 +435,11 @@ TestCase subclass: GSM48Test [
inp := #(16r06 16r2B 16rFF 16r29 16r0B 16rE3 16r29 16r00 16r00) asByteArray.
dec := GSM48MSG decode: inp readStream.
self assert: dec toMessage asByteArray = inp.
"Now test some decoding inside"
self assert: dec cellDescription bcc = 7.
self assert: dec cellDescription ncc = 7.
self assert: dec cellDescription bcch = 809.
]
]