Giter Site home page Giter Site logo

dbus-binding's Introduction

Dbus Binding

Sample binding for interfacing DBUS.

Dependencies

This binding uses afb-binding, libjson-c and libsystemd.

Compiling

Example:

mkdir build
cd build
cmake ..
make

It produces the binding dbus-binding.so.

API

The binding v1 offers 5 verbs: version, call, signal, subscribe, unsubscribe.

version

Takes no arguments.

Returns the STRINGZ representing is version.

call

Make a call to DBUS method The unique argument is a json object with:

  • bus: optional string, : 'system' or 'user' (default is system)
  • destination: string, the DBUS destination
  • path: string, the DBUS path
  • interface: string, the DBUS interface
  • member: string, member of the interface
  • signature: optional string, DBUS signature signature of the data
  • data: mostly array, the data of the call

That call is synchronous and waits for the response. The response is an JSON object

signal

Send a DBUS signal The unique argument is a json object with:

  • bus: optional string, : 'system' or 'user' (default is system)
  • destination: string, the DBUS destination
  • path: string, the DBUS path
  • interface: string, the DBUS interface
  • member: string, member of the interface
  • signature: optional string, DBUS signature signature of the data
  • data: mostly array, the data of the call

subscribe

Subscribe to a DBUS event. The unique argument is a json object with:

  • bus: optional string, : 'system' or 'user' (default is system)
  • match: string, the DBUS match specification
  • event: optional string, Name of the expected event (default is default)

unsubscribe

Unsuscribe from a previous subscription. Same content than subscribe.

Examples

dbus version

dbus call {"bus":"user", "destination":"org.freedesktop.DBus", "path":"/org/freedesktop/DBus", "interface": "org.freedesktop.DBus", "member": "RequestName", "signature": "su", "data": [ "bzh.iot.dbus.binding", 0 ] }

dbus call {"bus":"user", "destination":"org.freedesktop.DBus", "path":"/org/freedesktop/DBus", "interface": "org.freedesktop.DBus", "member": "ListNames", "signature": "", "data": null }

dbus call {"bus":"system", "destination":"org.freedesktop.DBus", "path":"/org/freedesktop/DBus", "interface": "org.freedesktop.DBus", "member": "ListNames", "signature": "", "data": null }

dbus subscribe {"bus": "system", "match": "type=signal,sender=org.freedesktop.NetworkManager", "event":"nme"}

dbus subscribe {"bus": "system", "match": "type=signal,sender=org.freedesktop.NetworkManager,member=StateChanged", "event":"nme"}
dbus subscribe {"bus": "system", "match": "type=signal,sender=org.freedesktop.NetworkManager,member=StateChanged,interface=org.freedesktop.NetworkManager.Connection.Active", "event":"nme"}

dbus-binding's People

Contributors

val-gfr avatar ronan22 avatar

Watchers

 avatar Stephane Desneux avatar benierc avatar  avatar Fulup Ar Foll avatar Sebastien Douheret avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.