GSM: Attempt to work with different SAPIs to do proper dispatch
This commit is contained in:
parent
bfca9dd8c3
commit
7bf1e7e038
4
BSSAP.st
4
BSSAP.st
|
@ -118,6 +118,10 @@ BSSAPMessage subclass: BSSAPDTAP [
|
|||
data := aData.
|
||||
]
|
||||
|
||||
sapi [
|
||||
^ li bitAnd: 7
|
||||
]
|
||||
|
||||
linkIdentifier [
|
||||
^ li
|
||||
]
|
||||
|
|
26
GSMDriver.st
26
GSMDriver.st
|
@ -1,5 +1,5 @@
|
|||
Object subclass: GSMDriver [
|
||||
| goal sccp proc completeSem result phoneConfig |
|
||||
| sccp proc sapis completeSem result phoneConfig |
|
||||
<category: 'osmo-gsm-operation'>
|
||||
<comment: 'I create a SCCP connection and handle stuff on it. In the base class
|
||||
I am just capable of handling BSSMAP Management and need to dispatch it to other
|
||||
|
@ -10,10 +10,10 @@ classes.'>
|
|||
^ super new initialize; yourself
|
||||
]
|
||||
|
||||
GSMDriver class >> initWith: aSCCPConnection goal: aGoal phone: aPhone [
|
||||
GSMDriver class >> initWith: aSCCPConnection sapi: aSapi on: aProc phone: aPhone[
|
||||
<category: 'creation'>
|
||||
^ self new
|
||||
goal: aGoal;
|
||||
sapi: aSapi on: aProc;
|
||||
sccp: aSCCPConnection;
|
||||
phone: aPhone;
|
||||
yourself
|
||||
|
@ -22,6 +22,7 @@ classes.'>
|
|||
initialize [
|
||||
<category: 'private'>
|
||||
completeSem := Semaphore new.
|
||||
sapis := Dictionary new.
|
||||
]
|
||||
|
||||
result [
|
||||
|
@ -41,9 +42,9 @@ classes.'>
|
|||
delay timedWaitOn: completeSem.
|
||||
]
|
||||
|
||||
goal: aGoal [
|
||||
sapi: aSapi on: aProc [
|
||||
<category: 'manage'>
|
||||
goal := aGoal.
|
||||
sapis at: aSapi put: aProc.
|
||||
]
|
||||
|
||||
phone: aPhone [
|
||||
|
@ -121,7 +122,7 @@ classes.'>
|
|||
^ phoneConfig imsi.
|
||||
]
|
||||
|
||||
dispatchDTAP: aMsg [
|
||||
dispatchDTAP: aMsg sapi: aSapi [
|
||||
<category: 'private'>
|
||||
aMsg class messageType = GSM48MMMessage msgAuReq ifTrue: [
|
||||
| auth resp |
|
||||
|
@ -133,6 +134,9 @@ classes.'>
|
|||
^ true
|
||||
].
|
||||
|
||||
sapis at: aSapi ifPresent: [:handler |
|
||||
].
|
||||
|
||||
'Unhandled DTAP message' printNl.
|
||||
aMsg inspect.
|
||||
]
|
||||
|
@ -144,7 +148,7 @@ classes.'>
|
|||
self dispatchMan: aMsg data.
|
||||
]
|
||||
ifFalse: [
|
||||
self dispatchDTAP: aMsg data.
|
||||
self dispatchDTAP: aMsg data sapi: aMsg sapi.
|
||||
].
|
||||
aMsg inspect.
|
||||
]
|
||||
|
@ -159,7 +163,7 @@ Object subclass: ProcedureBase [
|
|||
yourself
|
||||
]
|
||||
|
||||
openConnection: aMsg goal: aGoal phone: aPhone handler: aHandler [
|
||||
openConnection: aMsg sapi: aSapi phone: aPhone handler: aHandler [
|
||||
| msg bssap |
|
||||
msg := IEMessage initWith: GSM0808Helper msgComplL3.
|
||||
msg addIe: (GSMCellIdentifier initWith: 274 mnc: 8 lac: 4099 ci: 40000).
|
||||
|
@ -168,7 +172,7 @@ Object subclass: ProcedureBase [
|
|||
bssap := BSSAPManagement initWith: msg.
|
||||
|
||||
conn := aHandler createConnection: bssap.
|
||||
driver := GSMDriver initWith: conn goal: aGoal phone: aPhone.
|
||||
driver := GSMDriver initWith: conn sapi: aSapi on: self phone: aPhone.
|
||||
'Created the driver' printNl.
|
||||
]
|
||||
|
||||
|
@ -188,7 +192,7 @@ ProcedureBase subclass: LUProcedure [
|
|||
lu mi imsi: aPhone imsi.
|
||||
|
||||
'LU proc started' printNl.
|
||||
self openConnection: lu goal: #lu phone: aPhone handler: aHandler.
|
||||
self openConnection: lu sapi: 0 phone: aPhone handler: aHandler.
|
||||
]
|
||||
|
||||
execute [
|
||||
|
@ -202,7 +206,7 @@ ProcedureBase subclass: CallProcedure [
|
|||
| cm |
|
||||
|
||||
cm := GSM48CMServiceReq new.
|
||||
self openConnection: cm goal: #cc phone: aPhone handler: aHandler.
|
||||
self openConnection: cm sapi: 0 phone: aPhone handler: aHandler.
|
||||
]
|
||||
|
||||
execute [
|
||||
|
|
Reference in New Issue