diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2010-05-27 19:25:41 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2010-06-03 17:08:10 +0200 |
commit | c356cffea9504ae9ed657bb5b47e7baf27425fb4 (patch) | |
tree | e2c2db7ef43bf70e2a7f8945a8a9ac5c1ed579b2 | |
parent | 0b7219bd7c0ef0622ea7fcf07c9d27b9a99672b4 (diff) | |
download | json-dbus-bridge-c356cffea9504ae9ed657bb5b47e7baf27425fb4.tar.gz json-dbus-bridge-c356cffea9504ae9ed657bb5b47e7baf27425fb4.tar.xz |
[doc] add README & TODO
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | README | 57 | ||||
-rw-r--r-- | TODO | 19 |
3 files changed, 79 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index ca965f0..3cbb368 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,9 @@ SUBDIRS = \ EXTRA_DIST = \ autogen.sh \ - README.lighttpd + README.lighttpd \ + README \ + TODO MAINTAINERCLEANFILES = \ configure \ @@ -0,0 +1,57 @@ +json-dbus-bridge +================ + +json-dbus-bridge is a fast-cgi application that provides access to D-Bus. +It accepts JSON-RPC[1] calls as used by qooxdoo[2] and translates these +into D-Bus calls. Any response is converted back to JSON and sent to the +client. +The bridge is completely generic. New D-Bus services can be added without +modifications to the bridge. + +Syntax +------ +A D-Bus method is identified by +- bus name +- object path +- interface +- method +The JSON-RPC used by qooxdoo only knows +- service +- method +This is handled by using "<bus name>|<object path>" as service and +"<interface>.<method>" as method. + +To make a successful D-Bus call, all parameters must be encoded with the +correct type. Unfortunately not all D-Bus types can be uniquely mapped to +a JSON type. E.g. int32, uint32, int16, ... are all mapped to a JSON +number. To generate the correct D-Bus message, the JSON-RPC call must +contain an extra first parameter with the D-Bus signature of the parameters +as defined by the D-Bus Specification[3]. + +A simple JSON-RPC call could look like this: + + +request = { + "id": 1, + "service":"org.examle|/", + "method":"org.Example.Echo" + "params": [ "s", "Hello World!" ] +} +response = { + "id": 1, + "error": null, + "result": "Hello World!" +} + +Limitations +----------- +The bridge cannot handle all D-Bus features: +- D-Bus Dictionaries are translated into JSON objects. As a result only + dictionaries with string keys can be used. +- Translation of structs is not yet implemented. +- D-Bus signals are not yet supported. + +[1] http://json-rpc.org +[2] http://qooxdoo.org +[3] http://dbus.freedesktop.org/doc/dbus-specification.html + @@ -0,0 +1,19 @@ +TODO +==== + +[ ] unit tests + - via web server + - standalone test application + +[ ] D-Bus structs + - There are no structs in JSON. Maybe an array and the type from the + parameter signature. + +[ ] D-Bus signals + - bridge need to save a state for each client + - attach received signals to the state + - client can fetch signals with a special call (?) + - how to avoid denial of service issues? + +[ ] D-Bus dictionaries with non-string keys + |