diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2010-05-31 15:54:40 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2010-06-03 17:08:12 +0200 |
commit | a3fb4753f7d5f4180402332cc9b076a8dd44e676 (patch) | |
tree | 2d1c51d650bf2e5bacdf4e3185ba0f67c9efc216 | |
parent | 8c61eab564bc10ad76e207914c806bd68542e1e0 (diff) | |
download | json-dbus-bridge-a3fb4753f7d5f4180402332cc9b076a8dd44e676.tar.gz json-dbus-bridge-a3fb4753f7d5f4180402332cc9b076a8dd44e676.tar.xz |
[README] add stuff for variants
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | README | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -26,11 +26,11 @@ 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]. +as defined by the D-Bus Specification[3]. For the result the signature is +skipped. A simple JSON-RPC call could look like this: - request = { "id": 1, "service":"org.examle|/", @@ -43,6 +43,27 @@ response = { "result": "Hello World!" } +Variants are handled the same way. A variant value is an array with two +elements: The variant signature and the actual value. Note the variant can +only contain single complete types. For returned variants the signature is +skipped as well: + +Calling a method with one variant as parameter and a variant as return +value, could look like this: + +request = { + "id": 1, + "service":"org.examle|/", + "method":"org.Example.VariantEcho" + "params": [ "v", [ "s", "Hello World!" ] ] +} +response = { + "id": 1, + "error": null, + "result": "Hello World!" +} + + Limitations ----------- The bridge cannot handle all D-Bus features: |