Difference between revisions of "IoTGateway/WiseSnail"
Fred.chang (talk | contribs) (→example) |
Fred.chang (talk | contribs) (→Infospec) |
||
| Line 4: | Line 4: | ||
=Structures= | =Structures= | ||
==Infospec== | ==Infospec== | ||
| − | |||
| − | |||
| + | {| | ||
| + | |- | ||
| + | | '''Description''' | ||
| + | <div style="margin-left:0.847cm;margin-right:0cm;"> | ||
| + | The infospec structure defines your parameters in sensor hub. Those parameter structures will represented in Wise-Paas like a tag. this structure includes two callback functions. You can use the callbacks to define your own get and set function. The parameter button on Wise-Paas will different by whether the set function is defined or not. If the set function is defined, the value is writeable by users on Wise-Paas. | ||
| + | </div> | ||
| + | |- | ||
| + | | | ||
struct WiseSnail_InfoSpec{ | struct WiseSnail_InfoSpec{ | ||
WiseSnail_DataType type; | WiseSnail_DataType type; | ||
| Line 21: | Line 27: | ||
WiseSnail_GetValue getValue; | WiseSnail_GetValue getValue; | ||
}; | }; | ||
| − | + | |- | |
| + | | '''Example''' | ||
| + | |- | ||
| + | | | ||
{ | { | ||
WISE_VALUE, //WiseSnail_DataType | WISE_VALUE, //WiseSnail_DataType | ||
| Line 33: | Line 42: | ||
NULL //get function | NULL //get function | ||
} | } | ||
| + | |} | ||
Revision as of 04:01, 5 September 2016
Introduction
WiseSnail is the short name of Wise Sensor Network Abstract Interactive Layer. It is a layer to define the topology and behavior of sensor network. A complete device represented in WiseSnail includes one virtual gateway, one sensor connectivity interface and several sensor hubs. WiseSnail provides a form-like array which we call it infospec array to define tha parameters of sensor hub. And a form-like data array updates your real time data. So, you can easy to represent your device by creating several arrays.
Structures
Infospec
| Description
The infospec structure defines your parameters in sensor hub. Those parameter structures will represented in Wise-Paas like a tag. this structure includes two callback functions. You can use the callbacks to define your own get and set function. The parameter button on Wise-Paas will different by whether the set function is defined or not. If the set function is defined, the value is writeable by users on Wise-Paas. |
struct WiseSnail_InfoSpec{
WiseSnail_DataType type;
char *name;
char *unit;
union {
float value;
char *string;
};
float min;
float max;
char *resourcetype;
WiseSnail_SetValue setValue;
WiseSnail_GetValue getValue;
};
|
| Example |
{
WISE_VALUE, //WiseSnail_DataType
"Temperature", //name
"Cel", //unit
0, //value or string
-100, //min
200, //max
"ucum.Cel", //resourcetype, optional
NULL, //set function
NULL //get function
}
|