-
Notifications
You must be signed in to change notification settings - Fork 8
Protocol definition files
Oğuz Eroğlu edited this page Dec 31, 2019
·
2 revisions
A protocol definition file is a JSON file. Each key of this JSON is the protocol name. Each value is an object having parameter names as keys and parameter types as values.
See this example:
{
"protocol1": {
"value1": "numerical",
"value2": "char_10"
}
}
In this protocol definition file we define only one protocol called protocol1. This protocol has 2 parameters called value1 and value2. value1 is a numerical parameter, meaning that it can have integer or float values. value2 is a string parameter and the max length of this string is 10.
Rhubarb uses Float32Array to store and send data. Therefore numerical data should not exceed 4 bytes.
Rhubarb supports these characters for its string parameter values:
var supportedChars = [
"!", "\"", "#", "$", "%", "&", "\'", "(", ")", "*", "+", ",", "-", ".", "/",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?",
"@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
"P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p",
"r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~", "q", "Q"
];
Rhubarb string parameters cannot exceed 100 characters.