![Seeed Technology MeshBee Series Скачать руководство пользователя страница 28](http://html.mh-extra.com/html/seeed-technology/meshbee-series/meshbee-series_cookbook_1232954028.webp)
©2014 Seeed Technology Inc.
MB_2014_D02
28
Make an RPC
Chapter 4: Make an RPC
A micro-RPC framework was implemented in MeshBee firmware. Here is the brief guide for
your application programming.
4.1
What's a micro-RPC?
A method used for connecting two remotely placed functions by first using a protocol for
connecting the processes. It’s used in the cases of distributed tasks.
Micro-RPC is a tiny RPC framework on resource-limit embedded device.
4.2
What kind of system can make an RPC?
Each system in peer-to-peer mode can make an RPC.
RPC Commands are in the format:
"/<Object name>/<Method name> <Arguments separated by spaces>"
This is an example of the RPC command required to turn on a LED on MeshBee:
"/myled/write HIGH"
4.3
Why micro-RPC?
Divide different kinds of remote procedure into groups which is marked by a simple
obj_name.
Time-complexity of the function search is highly reduced with the hash algorithm.
4.2 How to deploy your own PRC method?
1)
Open /include/rpc_usr.h at first.
2)
Add a set of methods which is divided into groups according to their objName to a
methodEntity.
3)
Add one obj(something like air_conditioner, or light_switch) to rpcEntity[]