diff --git a/delay_ack/DelayAck.st b/delay_ack/DelayAck.st index 297e74d..4390ffc 100644 --- a/delay_ack/DelayAck.st +++ b/delay_ack/DelayAck.st @@ -30,6 +30,23 @@ FakeBTS.BTS subclass: DelayedAckBTS [ super sendRSLActivationAck: aMsg on: aTrx. ] ] + +] + +FakeBTS.BTS subclass: DelayedReleaseAckBTS [ + + + sendOnPrimaryRSL: aMsg [ + | rsl | + "We need to decode the message and check if it is a ChannelReleaseACK + and we will delay it then..." + rsl := RSLMessageBase parse: aMsg readStream. + rsl class = FakeBTS.RSLRFChannelReleaseAck + ifTrue: [Osmo.TimerScheduler instance scheduleInSeconds: 6 block: + [super sendOnPrimaryRSL: aMsg]] + ifFalse: [super sendOnPrimaryRSL: aMsg]. + ] ] FakeBTS.OpenBSCTest subclass: DelayedAckTest [ @@ -67,7 +84,27 @@ FakeBTS.OpenBSCTest subclass: DelayedAckTest [ lchan := self requireAnyChannel. self assert: lchan isNil message: 'Channel assignment should fail'. - Transcript nextPutAll: 'Waiting for new line.. press any key to quit'. + Transcript nextPutAll: 'Waiting for new line.. press to continue'. + stdin next. + ] +] + +FakeBTS.OpenBSCTest subclass: DelayedReleaseAckTest [ + + + createBTS [ + ^DelayedReleaseAckBTS new + ] + + startTest [ + | lchan | + + self createAndConnectBTS: '1801/0/0'. + + lchan := self requireAnyChannel. + self deny: lchan isNil message: 'Channel assignment should work'. + + Transcript nextPutAll: 'Waiting for new line.. press to quit'. stdin next. ] ] @@ -75,4 +112,6 @@ FakeBTS.OpenBSCTest subclass: DelayedAckTest [ Eval [ DelayedAckTest new startTest. + DelayedReleaseAckTest new + startTest. ]