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

SCCP: Start parsing the SCCP response from the network

This commit is contained in:
Holger Hans Peter Freyther 2010-11-24 10:58:30 +01:00
parent ac111ccd53
commit 5a4cb78826
3 changed files with 28 additions and 6 deletions

View File

@ -62,7 +62,7 @@ Object subclass: MSGParser [
]
Object subclass: SCCPHadler [
Object subclass: SCCPHandler [
| connections last_ref |
<comment: 'I handle SCCP messages'>
@ -72,7 +72,19 @@ Object subclass: SCCPHadler [
]
handleMsg: aMsg [
'Got a new SCCP message' printNl.
| sccp |
'Got a new SCCP message here.' printNl.
[
sccp := MSGParser parse: (aMsg asByteArray).
sccp inspect.
sccp printNl.
sccp class printNl.
] on: Exception do: [
self logError: 'Failed to parse message' area: #sccp.
aMsg asByteArray printNl.
]
]
createConnection: aData [

View File

@ -23,7 +23,7 @@ Object subclass: IPAConnection [
dispatcher := Osmo.IPADispatcher new.
dispatcher initialize.
sccp := SCCPHadler new.
sccp := SCCPHandler new.
sccp registerOn: dispatcher.
ipa := Osmo.IPAProtoHandler new.
@ -58,6 +58,10 @@ Object subclass: IPAConnection [
muxer nextPut: aMsg with: aType.
self drainSendQueue.
]
sccpHandler [
^ sccp
]
]
Object subclass: IPAConfig [
@ -90,6 +94,12 @@ Object subclass: IPAConfig [
]
semaphore [ ^ sem ]
sendLU [
| msg |
msg := MessageTests createLU: (connection sccpHandler).
connection send: msg with: Osmo.IPAConstants protocolSCCP.
]
]
Object subclass: MessageTests [
@ -106,6 +116,6 @@ Object subclass: MessageTests [
bssap := BSSAPManagement initWith: msg.
sccp := aHandler createConnection: bssap.
^ sccp toMessage asByteArray.
^ sccp toMessage.
]
]

View File

@ -181,9 +181,9 @@ TestCase subclass: TestMessages [
testLU [
| sccp handler |
handler := SCCPHadler new.
handler := SCCPHandler new.
sccp := MessageTests createLU: handler.
self assert: sccp = #(1 154 2 0 2 2 4 2 66 254 15 32 0 30 87 5 8 0 114 244 128 16 3 156 64 23 17 5 8 112 0 240 0 0 0 51 7 97 102 102 102 102 102 246 0 ) asByteArray.
self assert: sccp asByteArray = #(1 154 2 0 2 2 4 2 66 254 15 32 0 30 87 5 8 0 114 244 128 16 3 156 64 23 17 5 8 112 0 240 0 0 0 51 7 97 102 102 102 102 102 246 0 ) asByteArray.
]
testMsgParser [