-
Notifications
You must be signed in to change notification settings - Fork 7
Remote Process Communication
The freebird is a framework to manage a machine network composed of various protocols, such as BLE, ZigBee, MQTT, and CoAP, with a single unified interface. This makes things easier for developers to build an IoT web apps or mobile apps.
To communicate with freebird, a client/server model can be applied. Here, the freebird is a server and your apps are the clients.
There are many ways to implement RPC channels, for example, use TCP sockets, RESTful APIs, WebSockets, etc. The freebird has a ready-made RPC module freebird-rpc based on WebSocket for your convenience.
If you like to create your own RPC channel to be used in the freebird framework, please see the documentation of freebird-transport for more details.
Assume that you have got your transport instance ready, just call freebird.addTransport()
to register it to freebird for RPC messaging:
- Server-side
var fooRpcTrasnport = require('./fooRpcTrasnport');
var myRpcServer;
/* initialize a server-side transport instance to myRpcServer */
// ...
// register to the freebird
freebird.addTransport(myRpcServer, function (err) {
if (err)
console.log(err);
});
- Client-side
- Depends on your implementation.
Overview
APIs & Events
- APIs
- Events
Advanced Topics
- Remote Process Comm. (RPC)
- Plugin System
Appendix
- Device data object format
- Gadget data object format