BSSMAP: Be able to dissect a assignment complete
This commit is contained in:
parent
4ebe933b5b
commit
ebd0c2db73
50
BSSMAP.st
50
BSSMAP.st
|
@ -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.
|
||||
]
|
||||
]
|
||||
|
|
5
Tests.st
5
Tests.st
|
@ -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.
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue