Distributed Publish & Subscribe for IoT
|
libuv version 1.15 or higher is required.
SWIG is only required if building the Python or JavaScript bindings.
NASM is only required to build the optimized SHA-512 implementation.
libuv version 1.15 or higher is required.
ext\libuv
. To use a pre-built libuv set the UV_PATH
to point to the libuv installation folder.SWIG is only required if building the Python or JavaScript bindings. Chocolatey provides another means to install this dependency.
MinGW is only required if building the Go binding. Chocolatey provides another means to install this dependency.
NASM is only required to build the optimized SHA-512 implementation. Chocolatey provides another means to install this dependency.
Yocto Project through the OpenEmbedded build system provides an open source development environment targeting the ARM, MIPS, PowerPC and x86 architectures for a variety of platforms including x86-64 and emulated ones.
The C API documentation is generated using Doxygen. The Python (pydoc) and JavaScript API (JSDoc) documentation is generated from the Doxygen output.
Doxygen can be downloaded from here: Doxygen
Building the documentation requires the scons DoxygenBuilder tool. This page has instructions on how to install the builder.
To build the DPS libraries, examples, bindings, and documentation run scons
.
$ scons [variant=debug|release] [transport=udp|tcp|dtls] [bindings=all|none|{python,nodejs,go}]
To build with a different compiler use the CC
and CXX
build options or the –tool
option.
$ scons CC=clang CXX=clang++ $ scons --tool=mingw
Depending on the platform and compiler only a subset of bindings are supported.
Platform | Compiler | Bindings |
---|---|---|
Linux | gcc | python,nodejs,go |
Linux | clang | python,nodejs |
Windows | cl | python |
Windows | gcc (MinGW) | go |
To see the complete list of build options run scons –help
. The default build configuration is variant=release transport=udp bindings=all
.
The scons script pulls down source code from three external projects (mbedtls, libuv, and safestringlib) into the ./ext
directory. If necessary these projects can be populated manually:
$ git clone https://github.com/ARMmbed/mbedtls ext/mbedtls $ git clone https://github.com/01org/safestringlib.git ext/safestring $ git clone https://github.com/libuv/libuv.git ext/libuv
git pull
or delete the project directory and rerun scons.Clone the poky repository and configure the Yocto environment. Refer to Yocto Project Quick Start for more information.
Clone the libuv Yocto project and yocto/recipes-connectivity/dps to the Yocto Project directory. Modify the value of SRCREV_dps in dps_git.bb to the last commit of dps.
The Yocto Project directory needs to be included in BBLAYERS of conf/bblayers.conf. Refer to Yocto Wiki for more information.
From the root directory of the Yocto Project, initialize the Yocto environment, provide a meaningful build directory name and build Yocto DPS.
$ source oe-init-build-env mybuilds $ bitbake dps
In the ./application
subdirectory there is a simple SConscript that can be used as a template for building your own statically linked DPS C application. Copy the application tree somewhere and add your source and header files to the src
and include
directories.
To build:
scons -C <dps-root-dir> application=<your-application-dir> bindings=none
There are C, Python, JS (node.js), and Go examples.
The C examples are found in ./examples
, the Python examples are in ./py_scripts
, the JS examples are in ./js_scripts
and the Go examples are in ./go/src
. Refer to the README.md in each of those directories for more info.
The C examples are installed in ./build/dist/bin
. There are some some test scripts in ./test_scripts that run some more complex scenarios using the example programs. The test script
tree1
builds a small mesh and shows how publications sent to any node in the mesh get forwarded to the matching subscribers. The script reg1
uses the registry
, reg_pubs
, and reg_subs
examples programs to build a dynamic mesh using the experimental discovery service.