mirror of https://github.com/espruino/BangleApps
Documenting message size
parent
df26f64e44
commit
93f818eef4
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "/Users/hopkira/Documents/BangleApps"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -7,10 +7,10 @@ Amaze your friends by controlling your robot, your house or any other BLE device
|
|||
<iframe width="560" height="315" src="https://www.youtube.com/embed/acQxcoFe0W0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
|
||||
To keep the messages small, commands are sent from the Controller to the BLE target in a text string. This is made up of a comma delimited string of the following elements:
|
||||
* message number (3 characters)
|
||||
* screen name (3 characters)
|
||||
* object name (3 characters)
|
||||
* value/status (3 characters)
|
||||
* message number (up to the least significant four digits)
|
||||
* screen name (up to four characters)
|
||||
* object name (up to four characters)
|
||||
* value/status (up to four characters)
|
||||
|
||||
The combination of these variables will uniquely identify the status change requested from the watch to the target device that can then be programmed to respond appropriately.
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ const transmit = (state,object,status) => {
|
|||
n: msgNum.toString().slice(-4),
|
||||
s: state.substr(0,4),
|
||||
o: object.substr(0,4),
|
||||
v: status.substr(0.4),
|
||||
v: status.substr(0,4),
|
||||
};
|
||||
message= msg.n + "," + msg.s + "," + msg.o + "," + msg.v;
|
||||
NRF.setAdvertising({},{
|
||||
|
|
|
@ -45,7 +45,7 @@ const transmit = (state,object,status) => {
|
|||
n: msgNum.toString().slice(-4),
|
||||
s: state.substr(0,4),
|
||||
o: object.substr(0,4),
|
||||
v: status.substr(0.4),
|
||||
v: status.substr(0,4),
|
||||
};
|
||||
message= msg.n + "," + msg.s + "," + msg.o + "," + msg.v;
|
||||
NRF.setAdvertising({},{
|
||||
|
|
|
@ -46,7 +46,7 @@ const transmit = (state,object,status) => {
|
|||
n: msgNum.toString().slice(-4),
|
||||
s: state.substr(0,4),
|
||||
o: object.substr(0,4),
|
||||
v: status.substr(0.4),
|
||||
v: status.substr(0,4),
|
||||
};
|
||||
message= msg.n + "," + msg.s + "," + msg.o + "," + msg.v;
|
||||
NRF.setAdvertising({},{
|
||||
|
|
Loading…
Reference in New Issue