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

gsm: Provide decoding for Handover Reference and ARFCN...

This commit is contained in:
Holger Hans Peter Freyther 2012-12-25 10:51:34 +01:00
parent f653a23da5
commit 97e0ffa6a8
2 changed files with 34 additions and 0 deletions

View File

@ -334,6 +334,31 @@ GSM48SimpleData subclass: GSM48ChannelDescription2 [
<gsmName: 'channelDescription2'>
<gsmValueLength: 3>
channelType [
<category: 'accessing'>
^ data first bitShift: -3.
]
timeSlot [
^ data first bitAnd: 2r111
]
isH1 [
^ (data second bitAt: 5) = 1
]
isH0 [
^ (data second bitAt: 5) = 0
]
arfcn [
| low |
self isH0 ifFalse: [^self error: 'ARFCN requires H=0'].
low := data second bitAnd: 2r11.
^ (low bitShift: 8) bitOr: data third.
]
]
GSM48SimpleData subclass: GSM48ChannelMode [
@ -426,6 +451,11 @@ GSM48SimpleData subclass: GSM48HandoverReference [
<comment: 'I represent a 10.5.2.15 handover reference'>
<gsmName: 'handoverReference'>
<gsmValueLength: 1>
value [
<category: 'accessing'>
^ data first
]
]
GSM48DataHolder subclass: GSM48MultislotAllocation [

View File

@ -440,6 +440,10 @@ TestCase subclass: GSM48Test [
self assert: dec cellDescription bcc = 7.
self assert: dec cellDescription ncc = 7.
self assert: dec cellDescription bcch = 809.
self assert: dec handoverReference value = 0.
self assert: dec channelDescription2 channelType = 1.
self assert: dec channelDescription2 timeSlot = 3.
self assert: dec channelDescription2 arfcn = 809.
]
]