aboutsummaryrefslogtreecommitdiffstats
path: root/Messages.st
diff options
context:
space:
mode:
Diffstat (limited to 'Messages.st')
-rw-r--r--Messages.st15
1 files changed, 6 insertions, 9 deletions
diff --git a/Messages.st b/Messages.st
index bc8c908..79b406d 100644
--- a/Messages.st
+++ b/Messages.st
@@ -1,21 +1,20 @@
"General IE based message handling"
Object subclass: DataIE [
- | type data |
+ | data |
<category: 'osmo-messages'>
- DataIE class >> initWith: aType data: aData [
+ DataIE class >> initWith: aData [
^ self new
- type: aType;
data: aData;
yourself
]
type [
- ^ type
+ ^ data at: 1
]
type: aType [
- type := aType.
+ data at: 1 put: aType.
]
data [
@@ -27,8 +26,6 @@ Object subclass: DataIE [
]
writeOn: aMsg [
- aMsg putByte: type.
- aMsg putByte: data size.
aMsg putByteArray: data.
]
]
@@ -48,7 +45,7 @@ Object subclass: IEMessage [
"TODO: This needs to move some basic dispatch class"
"Find the IE that handles the type specified"
- ^ DataIE initWith: type data: data.
+ ^ DataIE initWith: data.
"
IEBase allSubclassesDo: [:each |
each elementId = type
@@ -70,7 +67,7 @@ Object subclass: IEMessage [
| type size data |
type := dat at: 1.
size := dat at: 2.
- data := dat copyFrom: 3 to: 2 + size.
+ data := dat copyFrom: 1 to: 2 + size.
dat := dat copyFrom: 3 + size.
msg addIe: (self findIE: type with: data from: IEBase).