ke6jjj / ebus

An Erlang binding to libdbus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Travis Hex.pm Version License Erlang Versions Build Tool

ebus

The ebus library provides an Erlang binding for the canonical libdbus IPC mechanism.

Features

  • A native binding to libdbus
  • A callback based service implemenatation scaffold to make it easy to implement a dbus service
  • A proxy object to make it easy to call a dbus service

Install

Add ebus to your deps section in rebar.config:

{deps, [ebus]}.

Examples

Here's an example of talking to connman to get the current list of connectivity related technologies:

Eshell V10.1  (abort with ^G)E
1>  {ok, B} = ebus:start(system).
{ok,<0.221.0>}
2>  {ok, P} = ebus_proxy:start(B, "net.connman", "/", []).
{ok,<0.224.0>}
3> ebus_proxy:call(P, "net.connman.Manager.GetTechnologies").
{ok,[[{"/net/connman/technology/p2p",
       #{"Connected" => false,"Name" => "P2P","Powered" => false,
         "Tethering" => false,"Type" => "p2p"}},
      {"/net/connman/technology/ethernet",
       #{"Connected" => false,"Name" => "Wired","Powered" => true,
         "Tethering" => false,"Type" => "ethernet"}},
      {"/net/connman/technology/wifi",
       #{"Connected" => true,"Name" => "WiFi","Powered" => true,
         "Tethering" => false,"Type" => "wifi"}},
      {"/net/connman/technology/bluetooth",
       #{"Connected" => false,"Name" => "Bluetooth",
         "Powered" => false,"Tethering" => false,
         "Type" => "bluetooth"}}]]}

Building

Fork the repo and simply use make to build the library. You will need the libdbus development libraries and headers installed on your system.

To run the tests run make test.

About

An Erlang binding to libdbus

License:Apache License 2.0


Languages

Language:Erlang 52.9%Language:C 44.1%Language:Makefile 1.7%Language:C++ 1.3%