Coder Social home page Coder Social logo

sprink951 / busybus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lubing521/busybus

0.0 2.0 0.0 876 KB

Lightweight, simple and portable message bus and IPC system for embedded Linux.

License: GNU General Public License v3.0

Makefile 2.57% C 93.06% C++ 0.78% Python 3.59%

busybus's Introduction

        Busybus ALPHA (development in progress)

What is it?

  Busybus is a lightweight, simple and portable message bus and IPC system
  for embedded, Linux-based systems. The main objective is to create an
  intuitive, easy-to-use and small message bus using binary data marshalling
  without any external dependencies other than a standard Unix-like C library
  (glibc, eglibc or uClibc). It shall work out-of-the-box - ie. server daemon
  bbusd will be fully functional without any kind of configuration files - just
  simple command line options will suffice.

Why busybus?

  Having D-Bus on small flash-based embedded systems is often overkill. Other
  than that there are no many alternatives. There is ubus, but it's
  integrated with OpenWRT, there's abus, but it uses JSON for serialization
  and there's embus, but it doesn't seem to be actively developed and it
  doesn't offer much functionality either.

Is it ready?

  Not yet - right now I'm working on an initial alpha version of this program,
  which will act basically as a working proof of concept. Once a working
  version is ready I will try and get some attention on various mailing lists
  and open-source focused websites.

Compilation and installation:

  This will probably change, but for now it's a simple 'make all' in order to
  build the libbbus.so library and all the binaries. Additionally there's
  the 'make test' command, that will run the test suite located in the test/
  directory. For more info just type 'make help'.

  There's no installation procedure for now - just make sure your loader can
  locate libbbus.so and put the binaries where you like.

  It is already possible to view partial documentation - just run 'make doc' to
  generate html, TeX etc. output from doxygen comments in the API header file.

How easy is it?

  Here's an example of a simple user session - a program connects to the server
  and calls a method (error checking has been left out).

    bbus_client_connection* conn;
    bbus_object* arg;
    bbus_object* ret;
    char* retstr;

    conn = bbus_connect();
    arg = bbus_obj_build("s", "Hello world!");
    ret = bbus_callmethod(conn, "bbus.bbusd.echo", ret);
    bbus_obj_parse(obj, "s", &retstr);
    printf("%s\n", retstr);
    bbus_closeconn(conn);
    bbus_obj_free(ret);
    bbus_obj_free(arg);

  Example echo method implementation on the service provider side:

    static bbus_object* echo(const char* UNUSED method, bbus_object* arg)
    {
            char* str;

            bbus_obj_parse(arg, "s", &str);
            return bbus_obj_build("s", str);
    }

    struct bbus_method method = {
            .name = "echo",
            .argdscr = "s",
            .retdscr = "s",
            .func = echo
    };

    bbus_service_connection* conn;
    struct bbus_timeval tv;

    tv.sec = 0;
    tv.usec = 500000;
    conn = bbus_srvc_connect("some_provider");
    bbus_srvc_regmethod(conn, &method);
    while (bbus_srvc_listencalls(conn, &tv) >= 0);
    bbus_srvc_closeconn(conn);

  Functions used by bbusd are a bit more complex, but user programs don't
  even need to look at them.

Questions and suggestions => Bartosz Golaszewski <[email protected]>

busybus's People

Contributors

brgl avatar

Watchers

James Cloos 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.