Skip to main content
Version: 1.0.1

BLE data spec

This chapter outlines the Bluetooth Low Energy (BLE) data specification for controlling the device's LED ring, accessing sensor values, and retrieving device information.

Control

LED Animations service is used to control the device's LED ring.

Demonstration Animation

Demonstration Animation characteristic is used to set the predefined animation for the LED ring. This characteristic expects data in the following format (LED Ring Data):

FieldData TypeDescription
modesigned 8-bit integerMode of LED animation
durationunsigned 32-bit integerDuration of the animation (in milliseconds)
speedunsigned 8-bit integerSpeed of animation
brightnessunsigned 8-bit integerBrightness level of the LED
coloursarray of three unsigned 32-bit integersRGB colours for the LED animation
mode can be one of the following values:
Mode IdentifierMode IDDescription
CLEAR_ANIMATION-1Stops any ongoing LED animation
FX_MODE_STATIC0Static LED animation
FX_MODE_BLINK1Blinking LED animation
FX_MODE_BREATH2Breathing LED animation
FX_MODE_COLOUR_WIPE3Colour wipe LED animation
FX_MODE_COLOUR_WIPE_RANDOM4Random colour wipe LED animation
FX_MODE_RANDOM_COLOUR5Random colour LED animation
FX_MODE_COLOUR_SWEEP6Colour sweep LED animation
FX_MODE_DYNAMIC7Dynamic LED animation
FX_MODE_RAINBOW8Rainbow LED animation
FX_MODE_RAINBOW_CYCLE9Rainbow cycle LED animation
FX_MODE_SCAN10Scanning LED animation
FX_MODE_DUAL_SCAN11Dual scanning LED animation
FX_MODE_FADE12Fading LED animation
FX_MODE_THEATER_CHASE13Theater chase LED animation
FX_MODE_THEATER_CHASE_RAINBOW14Rainbow theater chase LED animation
FX_MODE_RUNNING_LIGHTS15Running lights LED animation
FX_MODE_SAW16Saw LED animation
FX_MODE_TWINKLE17Twinkling LED animation
FX_MODE_DISSOLVE18Dissolving LED animation
FX_MODE_DISSOLVE_RANDOM19Random dissolving LED animation
FX_MODE_SPARKLE20Sparkling LED animation
FX_MODE_FLASH_SPARKLE21Flash sparkling LED animation
FX_MODE_HYPER_SPARKLE22Hyper sparkling LED animation
FX_MODE_STROBE23Strobing LED animation
FX_MODE_STROBE_RAINBOW24Rainbow strobing LED animation
FX_MODE_MULTI_STROBE25Multi strobe LED animation
FX_MODE_BLINK_RAINBOW26Rainbow blinking LED animation
FX_MODE_ANDROID27Android LED animation
FX_MODE_CHASE_COLOUR28Colour chasing LED animation
FX_MODE_CHASE_RANDOM29Random chasing LED animation
FX_MODE_CHASE_RAINBOW30Rainbow chasing LED animation
FX_MODE_CHASE_FLASH31Flash chasing LED animation
FX_MODE_CHASE_FLASH_RANDOM32Random flash chasing LED animation
FX_MODE_CHASE_RAINBOW_WHITE33White rainbow chasing LED animation
FX_MODE_COLOURFUL34Colourful LED animation
FX_MODE_TRAFFIC_LIGHT35Traffic light LED animation
FX_MODE_COLOUR_SWEEP_RANDOM36Random colour sweep LED animation
FX_MODE_RUNNING_COLOUR37Running colour LED animation
FX_MODE_RUNNING_RED_BLUE38Running red-blue LED animation
FX_MODE_RUNNING_RANDOM39Random running LED animation
FX_MODE_LARSON_SCANNER40Larson scanner LED animation
FX_MODE_COMET41Comet LED animation
FX_MODE_FIREWORKS42Fireworks LED animation
FX_MODE_RAIN43Rain LED animation
FX_MODE_MERRY_CHRISTMAS44Merry Christmas LED animation
FX_MODE_FIRE_FLICKER45Fire flicker LED animation
FX_MODE_GRADIENT46Gradient LED animation
FX_MODE_LOADING47Loading LED animation
FX_MODE_POLICE48Police LED animation
FX_MODE_POLICE_ALL49All-police LED animation
FX_MODE_TWO_DOTS50Two dots LED animation
FX_MODE_TWO_AREAS51Two areas LED animation
FX_MODE_CIRCUS_COMBUSTUS52Circus combustus LED animation
FX_MODE_HALLOWEEN53Halloween LED animation
FX_MODE_TRICOLOUR_CHASE54Tricolour chasing LED animation
FX_MODE_TRICOLOUR_WIPE55Tricolour wipe LED animation
FX_MODE_TRICOLOUR_FADE56Tricolour fade LED animation
FX_MODE_LIGHTNING57Lightning LED animation
FX_MODE_ICU58ICU LED animation
FX_MODE_MULTI_COMET59Multi-comet LED animation
FX_MODE_DUAL_LARSON_SCANNER60Dual Larson scanner LED animation
FX_MODE_RANDOM_CHASE61Random chasing LED animation
FX_MODE_OSCILLATE62Oscillating LED animation
FX_MODE_PRIDE_201563Pride 2015 LED animation
FX_MODE_JUGGLE64Juggling LED animation
FX_MODE_PALETTE65Palette LED animation
FX_MODE_FIRE_201266Fire 2012 LED animation
FX_MODE_COLOURWAVES67Colour waves LED animation
FX_MODE_BPM68BPM LED animation
FX_MODE_FILLNOISE869Fill noise 8 LED animation
FX_MODE_NOISE16_170Noise 16_1 LED animation
FX_MODE_NOISE16_271Noise 16_2 LED animation
FX_MODE_NOISE16_372Noise 16_3 LED animation
FX_MODE_NOISE16_473Noise 16_4 LED animation
FX_MODE_COLOURTWINKLE74Colour twinkle LED animation
FX_MODE_LAKE75Lake LED animation
FX_MODE_METEOR76Meteor LED animation
FX_MODE_METEOR_SMOOTH77Smooth meteor LED animation
FX_MODE_RAILWAY78Railway LED animation
FX_MODE_RIPPLE79Ripple LED animation
FX_MODE_TWINKLEFOX80Twinkle fox LED animation
FX_MODE_TWINKLECAT81Twinkle cat LED animation
FX_MODE_HALLOWEEN_EYES82Halloween eyes LED animation
FX_MODE_STATIC_PATTERN83Static pattern LED animation
FX_MODE_TRI_STATIC_PATTERN84Tricolour static pattern LED animation
FX_MODE_SPOTS85Spots LED animation
FX_MODE_SPOTS_FADE86Fading spots LED animation
FX_MODE_GLITTER87Glitter LED animation
FX_MODE_CANDLE88Candle LED animation
FX_MODE_STARBURST89Starburst LED animation
FX_MODE_EXPLODING_FIREWORKS90Exploding fireworks LED animation
FX_MODE_BOUNCINGBALLS91Bouncing balls LED animation
FX_MODE_SINELON92Sinelon LED animation
FX_MODE_SINELON_DUAL93Dual sinelon LED animation
FX_MODE_SINELON_RAINBOW94Rainbow sinelon LED animation
FX_MODE_POPCORN95Popcorn LED animation
FX_MODE_DRIP96Drip LED animation
FX_MODE_PLASMA97Plasma LED animation
FX_MODE_PERCENT98Percentage LED animation
FX_MODE_RIPPLE_RAINBOW99Rainbow ripple LED animation
FX_MODE_HEARTBEAT100Heartbeat LED animation
FX_MODE_SUNRISE101Sunrise LED animation
FX_MODE_FLOW102Flow LED animation

In BLE GATT communication, data should be in little-endian format and padding zeros should be added if necessary to conform to specified data type. Here is an example of static blue animation that lasts 10 seconds:

FieldValueFormatted DataNote
mode000-
duration100001027000010000 ms = 0x2710, padding zeros added
speed000-
brightness200C8-
colours[ff, 0, 0][ff000000, 00000000, 00000000]blue colour: 0xff, don't care, don't care

Here's the final packet that would be sent to the Demonstration Animation characteristic (0x5543) of the LED Animations service (0x5541) in little-endian hex format:

001027000000C8ff0000000000000000000000

Sensor Colour Scheme

Sensor Colour Scheme characteristic is used to set the colour scheme for the LED ring based on the value of selected sensor. This characteristic expects data in the following format (Sensor Colour Scheme):

FieldData TypeDescription
Sensor IDunsigned 32-bit integerSelected sensor
Rulesarray of three Sensor Colour Scheme Rule rulesArray of rules for the colour scheme based on the sensor value
Sensor ID can be one of the following values:
DescriptionValue
Temperature0
VOC1
Humidity2
Light sensor3
Microphone4
Motion sensor8
CO2 sensor9

Here's breakdown of Sensor Colour Scheme Rule:

FieldData TypeDescription
Operator Typeunsigned 8-bit integerOperator type for the rule
Valuesigned 32-bit integerValue for the rule
LED DataLED Ring DataLED data for the rule
Operator Type can be one of the following values:
DescriptionValue
EQUAL0
LESS1
GREATER2
OTHERWISE3

In BLE GATT communication, data should be in little-endian format and padding zeros should be added if necessary to conform to specified data type. Here is an example of colour scheme:

  • Temperature T:
    • T < 20°C : blue
    • T < 24 °C : orange
    • Otherwise: red
FieldValueFormatted DataNote
Sensor ID000000000Temperature sensor
Sensor Colour Scheme Rule[ { "operator": "less", "value": 20, "LED Ring Data": "static blue animation" }, { "operator": "less", "value": 24, "LED Ring Data": "static orange animation" }, { "operator": "otherwise", "value": "don't care, LED Ring Data: static red animation" } ]01 14000000 00 ffffffff C8 C8 ff000000 00000000 00000000 01 18000000 00 ffffffff C8 C8 00a5ff00 00000000 00000000 03 00000000 00 ffffffff C8 C8 0000ff00 00000000 00000000Explained below

Here's breakdown of the first Sensor Colour Scheme Rule data (Temperature T < 20°C: Blue) in little-endian hex format:

FieldValueFormatted DataNote
Operator Type101Less
Value201400000020 (0x14) in little-endian hex format
LED Ring Data{ "mode": 0, "duration": "max", "speed": 200, "brightness": 200, "colours": ["ff", "don't care", "don't care"] }00 ffffffff C8 C8 ff000000 00000000 00000000Static blue animation

The data for the second and third rule is formatted in the same way as the data for the first rule.

Rule 2 (Temperature T < 24°C: Orange) in little-endian hex format: 01 18000000 00 ffffffff C8 C8 00a5ff00 00000000 00000000

Rule 3 (Otherwise: Red) in little-endian hex format: 03 00000000 00 ffffffff C8 C8 0000ff00 00000000 00000000

When Sensor ID gets combined with these three rules, here's the final data:

00000000 01 14000000 00 ffffffff C8 C8 ff000000 00000000 00000000 01 18000000 00 ffffffff C8 C8 00a5ff00 00000000 00000000 03 00000000 00 ffffffff C8 C8 0000ff00 00000000 00000000

And here's the final packet that would be sent to the Sensor Colour Scheme characteristic (0x5542) of the LED Animations service (0x5541) in little-endian hex format:

00000000011400000000ffffffffC8C8ff0000000000000000000000011800000000ffffffffC8C800a5ff000000000000000000030000000000ffffffffC8C80000000000ff000000000000

Sensor Values

Environmental Sensing service exposes sensor values. These values are updated every second.

CharacteristicData TypeNote
Temperaturesigned 16-bit integerMultiplied by 100, needed to conform to the GATT temperature characteristic format (e.g. 25.02°C is represented as 2502).
Humidityunsigned 16-bit integerMultiplied by 100, needed to conform to the GATT humidity characteristic format (e.g. 63% is represented as 6300).
Illuminanceunsigned 32-bit integerMultiplied by 100, needed to send floating value as unsigned 32-bit integer over GATT (e.g. 150.32 lux is represented as 15032).
VOCsigned 32-bit integer-
Noiseunsigned 8-bit integer-
Presencesigned 8-bit integerVacant = 1, Occupied = 4
CO2unsigned 16-bit integer-

Device Information

Device Information service exposes following information about the sensor:

CharacteristicData TypeNote
Manufacturer NameString"Sauter"
Model Number StringStringe.g. FMS197F121A (Black gateway, with CO2)
Serial Number StringStringProduction serial number
Hardware Revision StringStringHardware index of device
Firmware Revision StringStringFirmware version of device
Production DateStringYYWW format, e.g. 2314