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

gsm: Be able to handle the channel mode modify and channel mode modify ack

Split the channel description and packet description in two classes
while adding the channel mode modify.
This commit is contained in:
Holger Hans Peter Freyther 2012-12-23 11:52:54 +01:00
parent 2cad3db5c8
commit dd93a5c1b1
2 changed files with 117 additions and 6 deletions

106
GSM48.st
View File

@ -286,16 +286,13 @@ GSM48SimpleData subclass: GSM48PageAndDedicatedMode [
<gsmValueLength: 1>
]
GSM48SimpleData subclass: GSM48ChannelOrPacketDescription [
GSM48SimpleData subclass: GSM48ChannelDescription [
<category: 'OsmoGSM'>
<comment: 'I represent a 10.5.2.5 or 10.5.2.25a. Conditionals
can not be easily expressed yet.'>
<comment: 'I represent a 10.5.2.5 channel description'>
<gsmName: 'channelOrPacketDescription'>
<gsmName: 'channelDescription'>
<gsmValueLength: 3>
"broken stuff.. I really need to add a proper conditional
checking here..."
timeslotNumber [
<category: 'channel-description'>
^ (data at: 1) bitAnd: 2r111
@ -307,6 +304,49 @@ GSM48SimpleData subclass: GSM48ChannelOrPacketDescription [
]
]
GSM48SimpleData subclass: GSM48ChannelMode [
| mode |
<category: 'OsmoGSM'>
<comment: 'I represent a 10.5.2.6'>
<gsmName: 'channelMode'>
<gsmValueLength: 1>
GSM48ChannelMode class [
modeSignallingOnly [ <category: 'attr'> ^ 2r00000000 ]
modeSpeechVersion1 [ <category: 'attr'> ^ 2r00000001 ]
modeSpeechVersion2 [ <category: 'attr'> ^ 2r00100001 ]
modeSpeechVersion3 [ <category: 'attr'> ^ 2r01000001 ]
modeData145 [ <category: 'attr'> ^ 2r00001111 ]
modeData120 [ <category: 'attr'> ^ 2r00000011 ]
modeData60 [ <category: 'attr'> ^ 2r00001011 ]
modeData36 [ <category: 'attr'> ^ 2r00010011 ]
]
GSM48ChannelMode class >> defaultValue [
<category: 'creation'>
^ ByteArray with: self modeSignallingOnly
]
mode [
^ data first
]
mode: aMode [
data := ByteArray with: aMode.
]
]
GSM48ChannelDescription subclass: GSM48ChannelOrPacketDescription [
<category: 'OsmoGSM'>
<comment: 'I represent a 10.5.2.5 or 10.5.2.25a. Conditionals
can not be easily expressed yet.'>
<gsmName: 'channelOrPacketDescription'>
"broken stuff.. I really need to add a proper conditional
checking here..."
]
GSM48SimpleData subclass: GSM48TimingAdvance [
<category: 'OsmoGSM'>
<comment: 'I represent a 10.5.2.40'>
@ -315,6 +355,14 @@ GSM48SimpleData subclass: GSM48TimingAdvance [
<gsmValueLength: 1>
]
GSM48DataHolder subclass: GSM48VGCSTargetModeIndication [
<category: 'OsmoGSM'>
<comment: 'I represent a 10.5.2.42a'>
<gsmName: 'vgcsTargetMode'>
<gsmMinValueSize: 1 max: 1>
]
GSM48SimpleData subclass: GSM48StartingTime [
<category: 'OsmoGSM'>
<comment: 'I represent a 10.5.2.38'>
@ -397,6 +445,15 @@ GSM48DataHolder subclass: GSM48MobileAllocation [
<gsmMinValueSize: 0 max: 8>
]
GSM48DataHolder subclass: GSM48MultiRateConfiguration [
<category: 'OsmoGSM'>
<comment: 'I represent a GSM 04.08 Multi-rate configuration as of
10.5.2.21aa'>
<gsmName: 'multiRate'>
<gsmMinValueSize: 2 max: 6>
]
GSM48SimpleData subclass: GSM48KeySeqLuType [
<category: 'OsmoGSM'>
<comment: 'This byte is shared for two things'>
@ -2568,6 +2625,41 @@ GSM48RRMessage subclass: GSM48RRPagingResponse [
]
]
GSM48RRMessage subclass: GSM48RRChannelModeModify [
<category: 'OsmoGSM'>
GSM48RRChannelModeModify class >> messageType [
<category: 'factory'>
^ self msgChannelModeModify
]
GSM48RRChannelModeModify class >> tlvDescription [
<category: 'parsing'>
^ OrderedCollection new
add: GSM48ChannelDescription asTLVDescription;
add: GSM48ChannelMode asTLVDescription;
add: (GSM48VGCSTargetModeIndication asTLVDescription beOptional; yourself);
add: (GSM48MultiRateConfiguration asTLVDescription beOptional; yourself);
yourself
]
]
GSM48RRMessage subclass: GSM48RRChannelModeModifyAck [
<category: 'OsmoGSM'>
GSM48RRChannelModeModifyAck class >> messageType [
<category: 'factory'>
^ self msgChannelModeModifyAck
]
GSM48RRChannelModeModifyAck class >> tlvDescription [
^ OrderedCollection new
add: GSM48ChannelDescription asTLVDescription;
add: GSM48ChannelMode asTLVDescription;
yourself
]
]
GSM48SSMessage subclass: GSM48SSFacility [
<category: 'OsmoGSM'>
@ -2640,6 +2732,8 @@ Eval [
GSM48RRChannelRelease initialize.
GSM48RRClassmarkChange initialize.
GSM48RRPagingResponse initialize.
GSM48RRChannelModeModify initialize.
GSM48RRChannelModeModifyAck initialize.
GSM48SSFacility initialize.
GSM48SSRegister initialize.

View File

@ -412,6 +412,23 @@ TestCase subclass: GSM48Test [
dec := GSM48MSG decode: inp readStream.
self assert: dec toMessage asByteArray = inp.
]
testChannelModify [
| dec inp |
inp := #(16r06 16r10 16r0A 16rE3 16r68 16r21) asByteArray.
dec := GSM48MSG decode: inp readStream.
self assert: dec toMessage asByteArray = inp.
dec channelMode mode: GSM48ChannelMode modeSpeechVersion2.
self assert: dec toMessage asByteArray = inp.
]
testChannelModifyAck [
| dec inp |
inp := #(16r06 16r17 16r0A 16rE3 16r68 16r21) asByteArray.
dec := GSM48MSG decode: inp readStream.
self assert: dec toMessage asByteArray = inp.
]
]
SCCPHandler subclass: TestSCCPHandler [