Giter Site home page Giter Site logo

data-datadriven_api's Introduction

Deprecation Notice The Data-Driven API project has been terminated and this code is no longer maintained. The last released version is R15.04, tagged in this repository as v15.04.

The Data-Driven API (DDAPI) for AllJoyn

About the DDAPI

The Data-driven API (DDAPI) for AllJoyn is an alternative API for the AllJoyn framework. It is built on top of the standard AllJoyn API and is specifically tailored to use cases for the Internet of Things. Instead of the standard framework's service-oriented paradigm, it uses the publish/subcribe paradigm.

Some conceptual knowledge of the standard AllJoyn framework is required to use the DDAPI. for application development.

Get to Know the DDAPI

To get to know the DDAPI, here are some sources of information:

General Installation Process

The general installation process for the DDAPI is as follows:

  1. Download and Install AllJoyn Core. If AllJoyn core is not installed globally on your system, set ALLJOYN_DISTDIR to the path where alljoyn is compiled. For Linux 64bit this is ${ALLJOYN_SRC_DIR}/build/linux/x86_64/debug/dist/
  2. [Install][cginst] the AllJoyn Code Generator. If the Code Generator is not installed globally on your system, make sure ajcodegen.py is in your PATH and PYTHONPATH point to dist/lib/python in the codegen compilation.
  3. Unpack the DDAPI tarball in the directory where you installed the AllJoyn Core files.
  4. Go to the directory /data/datadriven_api/ and run the scons script.

Read the rest of this document for more information.

How to Run the Samples

The samples have been compiled with a built-in router. Therefore, there is no need to start the AllJoyn routing daemon.

DDAPI applications depend on liballjoyn_ddapi.so, which in turn depends on liballjoyn.so and liballjoyn_about.so. You'll need to include the location where you installed these libraries in the LD_LIBRARY_PATH environment variable. For example:

$ LD_LIBRARY_PATH=${ALLSEEN_INSTALL_PATH}/lib/:${LD_LIBRARY_PATH}
$ export LD_LIBRARY_PATH

There are currently two sample applications to illustrate the use of the DDAPI:

  • a simple chat application (in samples/ddchat)
  • a toy home security system simulation (in samples/door).

Building your own applications with the DDAPI

Prerequisites

Before you can use the DDAPI, the following needs to be fulfilled:

  • Your compiler should at least support C++0x.
  • You must make sure you downloaded and installed AllJoyn Core Framework.
  • You must make sure you [installed][cginst] the AllJoyn Code Generator.

Using the Data-driven API code generator

The AllJoyn Code Generator is a command line driven tool which reads AllJoyn introspection XML files and outputs both client and server code ready for compilation and running. The Code Generator creates the type support classes for all interfaces you defined using the AllJoyn Introspection XML.

The code generator is located in the devtools folder. Use the SCONS script to build it.

For detailed instructions on how to use the code generator, we refer you to the code generator's documentation.

As a quick instruction, use the following command to convert an Introspection XML file:

$ ajcodegen.py -t ddcpp your_interface_definition.xml

For each interface specified in the XML file, 3 header files and 3 source files are generated:

  • One of each for the consumer side (<intfname>Proxy.{cc|h}).
  • One of each for the provider side (<intfname>Interface.{cc|h}).
  • One of each that is common to both consumer and provider and that describes the interface type (<intfname>TypeDescription.{cc|h}).

Building and linking

To install the DDAPI, unpack the DDAPI tarball in your AllJoyn installation folder. The DDAPI files are located in the data/datadriven/ folder. Use the SCONS script to build it.

To buiild your own Linux application with the DDAPI, you must pass two AllJoyn-related defines:

  • QCC_OS_LINUX
  • QCC_OS_GROUP_POSIX

All files pertaining to the DDAPI are found in the datadriven directory. Regarding header dependencies, you should include the individual directories found under cpp/inc in your compilation directive.

Besides these framework include directories, you still need to make sure the generated header files (based on your data model) are found.

After the compilation step of your application (make sure to also compile the generated code), you should link your application to:

  • liballjoyn_ddapi.so
  • liballjoyn_about.so
  • liballjoyn.so

[cgdl]: [cginst]: https://wiki.allseenalliance.org/devtools/code_generator

data-datadriven_api's People

Contributors

cjac avatar

Watchers

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