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

BSSMAP: Be able to dissect a assignment complete

This commit is contained in:
Holger Hans Peter Freyther 2010-11-30 09:22:09 +01:00
parent 4ebe933b5b
commit ebd0c2db73
2 changed files with 55 additions and 0 deletions

View File

@ -511,3 +511,53 @@ GSM0808IE subclass: GSM0808CICIE [
aMsg putByteArray: cic.
]
]
GSM0808IE subclass: GSM0808CauseIE [
| cause |
GSM0808CauseIE class >> elementId [ ^ 21 ]
GSM0808CauseIE class >> length: aByteArray [ ^ 1 ]
GSM0808CauseIE class >> initWith: aCause [
^ self new
cause: aCause;
yourself
]
GSM0808CauseIE class >> parseFrom: aByteArray [
^ self initWith: (aByteArray at: 2)
]
cause [ ^ cause ]
cause: aCause [ cause := aCause ]
writeOnDirect: aMsg [
aMsg putByte: cause.
]
]
GSM0808IE subclass: GSM0808SpeechVerIE [
| speech |
GSM0808SpeechVerIE class >> elementId [ ^ 64 ]
GSM0808SpeechVerIE class >> length: aByteArray [ ^ 1 ]
GSM0808SpeechVerIE class >> initWith: aVersion [
^ self new
speechVersion: aVersion;
yourself
]
GSM0808SpeechVerIE class >> parseFrom: aByteArray [
^ self initWith: (aByteArray at: 2)
]
speechVersion: aVersion [
speech := aVersion
]
speechVersion [ ^ speech ]
writeOnDirect: aMsg [
aMsg putByte: speech.
]
]

View File

@ -334,5 +334,10 @@ TestCase subclass: TestMessages [
inp := #(6 0 0 72 0 1 11 0 9 1 11 3 1 10 17 1 0 20 ) asByteArray.
msg := MSGParser parse: inp.
self assert: msg toMessage asByteArray = inp.
"Assignment Complete"
inp := #(6 1 3 35 0 1 11 0 9 2 21 0 33 152 44 2 64 17) asByteArray.
msg := MSGParser parse: inp.
self assert: msg toMessage asByteArray = inp.
]
]