1
0
Fork 0

GSMDriver: Send a clear request in case there is an exception

This commit is contained in:
Holger Hans Peter Freyther 2010-12-13 05:25:25 +01:00
parent bb4e22695c
commit e35bac5357
2 changed files with 18 additions and 0 deletions

View File

@ -13,6 +13,7 @@ Object subclass: GSM0808Helper [
GSM0808Helper class >> msgResetAck [ <category: 'spec'> ^ 16r31 ]
GSM0808Helper class >> msgClear [ <category: 'spec'> ^ 16r20 ]
GSM0808Helper class >> msgClearComp [ <category: 'spec'> ^ 16r21 ]
GSM0808Helper class >> msgClearReq [ <category: 'spec'> ^ 16r22 ]
GSM0808Helper class >> msgCipherModeCmd [ <category: 'spec'> ^ 16r53 ]
GSM0808Helper class >> msgCipherModeCmpl [ <category: 'spec'> ^ 16r55 ]
GSM0808Helper class >> msgAssRequest [ <category: 'spec'> ^ 16r1 ]

View File

@ -56,10 +56,20 @@ classes.'>
sccp := aSCCPConnection
]
sendClearRequest [
| clear |
clear := IEMessage initWith: GSM0808Helper msgClearReq.
clear addIe: (GSMCauseIE initWith: 0).
sccp nextPutData: (BSSAPManagement initWith: clear).
]
run [
| connected |
<category: 'processing'>
"Process all messages in a thread"
connected := true.
proc := [
[
[
@ -69,9 +79,16 @@ classes.'>
self dispatch: msg.
].
] on: SystemExceptions.EndOfStream do: [
connected := false.
'SCCP Connection is now disconnected' printNl.
].
] ensure: [
connected ifTrue: [
'SCCP Cleaning up connection' printNl.
connected := false.
self sendClearRequest.
].
completeSem signal.
].
] fork.