Module Updates
A module update is a message sent from the Dock. It originates from a specific module that informs the client about a change of state.
Module updates are sent from the Dock to the host over USB serial at 115200 baud. They are always terminated with a Carriage Return, and a Newline: '\r\n'
.
Module updates are rate-limited, and trigger when the changing value passes a threshold.
For example; Moving a Flotilla slider from zero to 100% will result in a different number of updates under different conditions. A rapid movement of the slider will yield fewer updates. A slow movement will yield more granular updates.
A slider has one value, so it will emit updates which look like this: u 1/slider 255
.
A module update always begins with u
, followed by a space. This is then followed by the channel number, an integer from 1 to 8 corresponding to the numbers on the dock. A forward-slash follows the channel number. The modules simple name (lowercase, one word) appears next.
The simple name lets explorers of the Flotilla protocol see which module is generating an update.
The simple name is followed by a space, and then a list of comma-separated parameters.
Each module update is terminated by a carriage return: \r
, and a newline: \n
Here are some example updates from Flotilla modules:
- Slider:
u 1/slider 50
- Dial:
u 1/dial 172
- Colour:
u 1/colour 50,60,10,100
- Touch:
u 1/touch 1,0,0,0
- Motion:
u 1/motion 2040,128,-134,-184,2135,124
- Weather:
u 1/weather 3200,10298
Modules that emit updates include: Light, Colour, Dial, Slider, Joystick, Motion, Weather and Touch