gsm48: Decode the Request Reference IE
This commit is contained in:
parent
7658a3ca59
commit
d130ebaa5e
23
GSM48.st
23
GSM48.st
|
@ -318,6 +318,29 @@ GSM48SimpleData subclass: GSM48RequestReference [
|
|||
|
||||
<gsmName: 'requestReference'>
|
||||
<gsmValueLength: 3>
|
||||
|
||||
ra [
|
||||
<category: 'decoding'>
|
||||
^ data at: 1
|
||||
]
|
||||
|
||||
t1 [
|
||||
<category: 'decoding'>
|
||||
^ (data at: 2) bitShift: - 3
|
||||
]
|
||||
|
||||
t2 [
|
||||
<category: 'decoding'>
|
||||
^ (data at: 3) bitAnd: 2r00011111
|
||||
]
|
||||
|
||||
t3 [
|
||||
| high low |
|
||||
<category: 'decoding'>
|
||||
high := (data at: 2) bitAnd: 2r111.
|
||||
low := (data at: 3) bitShift: -5.
|
||||
^ low bitOr: (high bitShift: 3)
|
||||
]
|
||||
]
|
||||
|
||||
GSM48DataHolder subclass: GSM48IARestOctets [
|
||||
|
|
4
Tests.st
4
Tests.st
|
@ -298,6 +298,10 @@ TestCase subclass: GSM48Test [
|
|||
16r2B 16r2B 16r2B 16r2B) asByteArray.
|
||||
dec := GSM48MSG decode: inp readStream.
|
||||
self assert: dec type = GSM48RRImmediateAssignCommand messageType.
|
||||
self assert: dec requestReference ra = 16r1A.
|
||||
self assert: dec requestReference t1 = 1.
|
||||
self assert: dec requestReference t2 = 15.
|
||||
self assert: dec requestReference t3 = 17.
|
||||
self assert: dec toMessage asByteArray = inp.
|
||||
]
|
||||
|
||||
|
|
Reference in New Issue