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

GSM48: Add dummy code to generate a LU and wrap it in all layers

Create a GSM48 message, wrap it in BSSMAP, BSSAP, SCCP. This
allows us to test the code that is wrapping messages...
This commit is contained in:
Holger Hans Peter Freyther 2010-11-20 01:15:52 +01:00
parent e277181234
commit 4cbfc1d0be
3 changed files with 31 additions and 0 deletions

View File

@ -83,3 +83,24 @@ Object subclass: IPAConfig [
semaphore [ ^ sem ]
]
Object subclass: MessageTests [
MessageTests class >> createLU [
| lu gsm48 gsm88 msg sccp |
gsm48 := Osmo.MessageBuffer new.
gsm88 := Osmo.MessageBuffer new.
lu := LocationUpdatingRequest new.
lu mi imsi: '666666666666'.
lu storeOn: gsm48.
msg := IEMessage initWith: GSM0808Helper msgComplL3.
msg addIe: (GSMCellIdentifier initWith: 274 mnc: 8 lac: 4099 ci: 40000).
msg addIe: (GSMLayer3Info initWith: gsm48 asByteArray).
msg storeOn: gsm88.
BSSAPHelper prependManagement: gsm88.
sccp := Osmo.SCCPHelper createCR: 666 dest: (Osmo.SCCPAddress createWith: 254) data: gsm88 asByteArray.
sccp asByteArray printNl.
^ sccp asByteArray.
]
]

View File

@ -117,3 +117,12 @@ TestCase subclass: GSM48Test [
self assert: msg asByteArray = #(5 8 112 2 242 80 255 254 51 8 105 102 1 69 0 114 131 136) asByteArray.
]
]
TestCase subclass: TestMessages [
testLU [
| sccp |
sccp := MessageTests createLU.
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.
]
]

View File

@ -15,6 +15,7 @@
<sunit>OsmoTestPhone.GSM0808Test</sunit>
<sunit>OsmoTestPhone.BSSAPTest</sunit>
<sunit>OsmoTestPhone.GSM48Test</sunit>
<sunit>OsmoTestPhone.TestMessages</sunit>
<filein>Tests.st</filein>
</test>