From 6db40339dec58e37f3ae4f279a596a5f3562d80b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 23 Dec 2012 19:20:48 +0100 Subject: [PATCH] rsl: Implement the positive CRCX, MDCX and DLCX messages --- fakebts/RSLMsg.st | 182 ++++++++++++++++++++++++++++++++++++++++++++-- fakebts/Test.st | 45 ++++++++++++ 2 files changed, 222 insertions(+), 5 deletions(-) diff --git a/fakebts/RSLMsg.st b/fakebts/RSLMsg.st index da8a9e7..d93eee0 100644 --- a/fakebts/RSLMsg.st +++ b/fakebts/RSLMsg.st @@ -151,7 +151,7 @@ Osmo.TLVParserBase subclass: RSLMessageBase [ RSLMessageBase class >> ignoredBaseClasses [ ^ {RSLCommonChannelManagement. RSLTRXManagement. - RSLDedicatedChannelManagement. RSLRadioLinkManagement} + RSLDedicatedChannelManagement. RSLRadioLinkManagement. RSLIPAVendorManagement} ] RSLMessageBase class >> canHandle: aDiscrim transparent: aTrans type: aType [ @@ -290,6 +290,14 @@ Object subclass: RSLMessageDefinitions [ beTV; valueSize: 1; yourself ] + causeIE [ + + ^ Osmo.TLVDescription new + tag: RSLInformationElement attrCause; + instVarName: #cause; parseClass: RSLAttributeData; + beTLV; minSize: 1; yourself + ] + radioLinkMessageBase [ ^ OrderedCollection new @@ -473,10 +481,7 @@ Object subclass: RSLMessageDefinitions [ channelActivationNackMessage [ ^ self dedicatedChannelMessageBase - add: (Osmo.TLVDescription new - tag: RSLInformationElement attrCause; - instVarName: #cause; parseClass: RSLAttributeData; - beTLV; minSize: 1; yourself); + add: self causeIE; yourself ] @@ -1120,3 +1125,170 @@ RSLRadioLinkManagement subclass: RSLReleaseIndication [ ] + +RSLMessageDefinitions subclass: RSLIPAMessageDefinitions [ + RSLIPAMessageDefinitions class [ + connectionIdentifierIE [ + ^ Osmo.TLVDescription new + tag: 16rF8; instVarName: #conn_id; parseClass: RSLAttributeData; + beTV; valueSize: 2; yourself + ] + + localIPIE [ + ^ Osmo.TLVDescription new + tag: 16rF5; instVarName: #local_ip; parseClass: RSLAttributeData; + beTV; valueSize: 4; yourself + ] + + localPortIE [ + ^ Osmo.TLVDescription new + tag: 16rF3; instVarName: #local_port; parseClass: RSLAttributeData; + beTV; valueSize: 2; yourself + ] + + remoteIPIE [ + ^ self localIPIE + tag: 16rF0; instVarName: #remote_ip; yourself + ] + + remotePortIE [ + ^ self localPortIE + tag: 16rF1; instVarName: #remote_port; yourself. + ] + + speechModeIE [ + ^ Osmo.TLVDescription new + tag: 16rF4; instVarName: #speech_mode; parseClass: RSLAttributeData; + beTV; valueSize: 1; yourself + ] + + rtpPayloadTypeIE [ + ^ Osmo.TLVDescription new + tag: 16rF2; instVarName: #rtp_payload; parseClass: RSLAttributeData; + beTV; valueSize: 1; yourself + ] + + connectionStatisticsIE [ + ^ Osmo.TLVDescription new + tag: 16rF6; instVarName: #stats; parseClass: RSLAttributeData; + beTLV; valueSize: 28; yourself + ] + + createConnectionMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self speechModeIE; + add: self rtpPayloadTypeIE; + yourself + ] + + createConnectionAckMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + add: self localPortIE; + add: self localIPIE; + yourself + ] + + modifyConnectionMessage [ + + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + add: self remoteIPIE; + add: self remotePortIE; + add: self speechModeIE; + add: self rtpPayloadTypeIE; + yourself + ] + + modifyConnectionAckMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + yourself + ] + + deleteConnectionIndMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + add: self connectionStatisticsIE; + add: self causeIE; + yourself + ] + ] +] + +RSLMessageBase subclass: RSLIPAVendorManagement [ + + + + RSLIPAVendorManagement class [ + messageCRCX [ ^ 16r70 ] + messageCRCXAck [ ^ 16r71 ] + messageCRCXNack [ ^ 16r72 ] + messageMDCX [ ^ 16r73 ] + messageMDCXAck [ ^ 16r74 ] + messageMDCXNack [ ^ 16r75 ] + messageDLCXInd [ ^ 16r76 ] + messageDLCX [ ^ 16r77 ] + messageDLCXAck [ ^ 16r78 ] + messageDLCXNack [ ^ 16r79 ] + ] + + RSLIPAVendorManagement class >> messageDiscrimator [ + + ^ 63 + ] + + RSLIPAVendorManagement class >> isTransparent [ + ^ 0 + ] + + RSLIPAVendorManagement class >> tlvDescription [ + + ^ RSLIPAMessageDefinitions perform: messageDefinition + ] +] + +RSLIPAVendorManagement subclass: RSLIPACreateConnection [ + | channel_number speech_mode rtp_payload | + + + + +] + +RSLIPAVendorManagement subclass: RSLIPACreateConnectionAck [ + | channel_number conn_id local_port local_ip | + + + + +] + +RSLIPAVendorManagement subclass: RSLIPAModifyConnection [ + | channel_number conn_id remote_ip remote_port speech_mode rtp_payload | + + + + +] + +RSLIPAVendorManagement subclass: RSLIPAModifyConnectionAck [ + | channel_number conn_id | + + + + +] + +RSLIPAVendorManagement subclass: RSLIPADeleteConnectionInd [ + | channel_number conn_id stats cause | + + + + +] diff --git a/fakebts/Test.st b/fakebts/Test.st index 5e254a4..79c9ff2 100644 --- a/fakebts/Test.st +++ b/fakebts/Test.st @@ -472,6 +472,51 @@ RoundTripTestCase subclass: RSLRoundTripTest [ ^ #(8 41 1 10 6 4 0 1 8 17 ) ] + ipaCrcxData [ + ^ #(126 112 1 10 244 17 242 97) + ] + + ipaCrcxAckData [ + ^ #(16r7E 16r71 16r01 16r0A 16rF8 16r00 16r27 16rF3 16r0F + 16rAE 16rF5 16rC0 16rA8 16r0A 16r4E) + ] + + ipaDlcxIndData [ + ^ #(16r7E 16r76 16r01 16r0A 16rF8 16r00 16r27 16rF6 16r1C + 16r00 16r00 16r06 16rE4 16r00 16r00 16rD5 16r9C 16r00 + 16r00 16r07 16r14 16r00 16r00 16rDB 16r6C 16r00 16r00 + 16r00 16r2A 16r00 16r00 16r00 16r35 16r00 16r00 16r00 + 16r00 16r1A 16r01 16r0F) + ] + + ipaMdcxData [ + ^ #(126 115 1 10 248 0 0 240 0 0 0 0 241 0 0 244 1 242 97) + ] + + ipaMdcxDataAck [ + ^ #(16r7E 16r74 16r01 16r0A 16rF8 16r00 16r27) + ] + + testIpaCrcxAck [ + self roundtripTestFor: #ipaCrcxAckData class: RSLIPACreateConnectionAck. + ] + + testIpaCrcx [ + self roundtripTestFor: #ipaCrcxData class: RSLIPACreateConnection. + ] + + testIpaDlcx [ + self roundtripTestFor: #ipaDlcxIndData class: RSLIPADeleteConnectionInd. + ] + + testIpaMdcx [ + self roundtripTestFor: #ipaMdcxData class: RSLIPAModifyConnection. + ] + + testIpaMdcxAck [ + self roundtripTestFor: #ipaMdcxDataAck class: RSLIPAModifyConnectionAck. + ] + testBCCHInformation [ self roundtripTestFor: #bcchInformationData class: RSLBCCHInformation ]