diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-22 22:46:45 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-22 22:46:45 +0100 |
commit | 711ccdf1fa1f91f6fc4e9ebdb5fc425bac2b0429 (patch) | |
tree | a9850d50fb043e7d68652cde3048a0debf3cbddb /Messages.st | |
parent | df1afe14407bebac3b377cf15842efe45e6e862a (diff) |
IEMessage: Pass the data with type and length...
Diffstat (limited to 'Messages.st')
-rw-r--r-- | Messages.st | 15 |
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). |