diff options
author | Matthew Johnson <mjj29@hecate.matthew.ath.cx> | 2007-12-28 16:05:28 +0000 |
---|---|---|
committer | Matthew Johnson <mjj29@hecate.matthew.ath.cx> | 2007-12-28 16:05:28 +0000 |
commit | ff7f71f7907987426f168b616c4e1df183a6f8ab (patch) | |
tree | 02de9b51388506bedd50904f1fecf4896fd3981b | |
parent | 161644dd1e25cf9d455a6371d8a4a248da61834f (diff) |
more stuffdyncode
-rw-r--r-- | org/freedesktop/dbus/DBusProxy.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/org/freedesktop/dbus/DBusProxy.java b/org/freedesktop/dbus/DBusProxy.java index a5938d5..9def176 100644 --- a/org/freedesktop/dbus/DBusProxy.java +++ b/org/freedesktop/dbus/DBusProxy.java @@ -22,6 +22,7 @@ import java.util.Map; import java.util.Vector; import cx.ath.matthew.debug.Debug; +import cx.ath.matthew.utils.Hexdump; import org.freedesktop.dbus.exceptions.DBusException; @@ -172,9 +173,19 @@ public class DBusProxy bsize += 8; } // - calculate signature + //END + String sig = Marshalling.getDBusType(m.getParameterTypes()); + out.print("byte[] headers = new byte[] { "); + byte[] bsizes = new byte[4]; + Message.marshallintBig(bsize, bsizes, 0, 4); + out.print(Hexdump.toByteArray(bsizes)); + out.print(",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,"); + Message.marshallintBig(Message.HeaderField.PATH, bsizes, 0, 4); + out.print(Hexdump.toByteArray(bsizes)); // - calculate header size - // - ua(yv) + // - uua(yv) // - u = body length + // - u = serial // - a(yv) = // { ( PATH, [ OBJECT_PATH, ro.path ] ), // ( DESTINATION, [ STRING, ro.dest ] ), @@ -182,10 +193,15 @@ public class DBusProxy // ( MEMBER, [ STRING, m.getName() ] ) // ( SIGNATURE, [ SIGNATURE, sig ] ) } // - create literal headers (sans serial) + out.println("};"); + //<<END // - insert serial + Message.marshallintBig(m.getSerial(),headers, 4, 4); + Message.marshallintBig(harrlen,headers, 8, 4); // - create body byte[] body = new byte[bsize]; bytes[1] = body; + bytes[2] = headers; // - insert body int ofs = 0; //END @@ -220,10 +236,10 @@ public class DBusProxy if (!m.isAnnotationPresent(DBus.Method.NoReply.class)) { out.println("Message reply = call.getReply();"); out.println("if (null == reply) throw new DBus.Error.NoReply(_("No reply within specified time"));"); -out.println(""); + out.println(""); out.println("if (reply instanceof Error)"); - out.println("((Error) reply).throwException();"); -out.println(""); + out.println("((Error) reply).throwException();"); + out.println(""); out.println("byte[] body = reply.getBody();"); if (m.getReturnType().equals(Integer.TYPE) || m.getReturnType().equals(Short.TYPE) |