Skip to main content

BLE Communication Specification (WhizToys Bluetooth Control Box)

This document defines the BLE (Bluetooth Low Energy) GATT Profile used by the WhizToys Bluetooth Control Box, intended for third-party developers and system integrators.


1. WhizToys Profile Architecture

The WhizToys Bluetooth Control Box operates as a BLE Peripheral, broadcasting advertising packets while waiting for a phone or other Central device to connect. Broadcasting stops once a connection is established. The Profile architecture is as follows:

LevelItem
ProfileWhizToys Profile
├ ServiceGAP Service (0x1800)
├ ServiceGATT Service (0x1801)
└ ServiceCustom Service (0000FEE0-0000-1000-8000-00805F9B34FB)
 ├ CharacteristicLayout Information
 ├ CharacteristicSensor Information
 └ CharacteristicLED Control Information

2. GAP Service (0x1800)

A mandatory standard BLE service containing the device name, appearance, and connection parameters.

CharacteristicUUIDPropertiesValueDescription
Device Name0x2A00Read | WriteArrayRead/write the device name
Appearance0x2A01ReadArrayRead the device appearance
Peripheral Preferred Connection Parameters0x2A04ReadArrayRead the peripheral's preferred connection parameters

3. GATT Service (0x1801)

A GATT Profile-defined service containing the "Service Changed" characteristic. When the GATT attribute layout of a Service changes (added or removed), the Server can notify the Client through this characteristic.


4. Custom Service (0xFEE0)

UUID: 0000FEE0-0000-1000-8000-00805F9B34FB

The core service for WhizToys hardware, providing pressure sensor data and LED light control. After powering on, the mat tiles automatically perform a Mapping Layout to discover the relative positions between tiles.

This service contains three Characteristics:

CharacteristicUUIDPropertiesDescription
Layout Information0000FEE1-0000-1000-8000-00805F9B34FBReadRead the mat tile layout
Sensor Information0000FEE2-0000-1000-8000-00805F9B34FBNotifyNotify on sensor value changes
LED Control Command0000FEE3-0000-1000-8000-00805F9B34FBWriteWrite LED light control commands

5. Characteristic Value Definitions

5.1 Layout Information (0xFEE1) — Read

After the mat tiles complete the Mapping process, they enter sensing and standby mode. The Layout information is stored in the control box and does not change until the device is restarted. It is designed as a one-time Read operation.

Packet format (20 bytes):

Byte 0Byte 1Byte 2...Byte n-1
Layout Row and Column4 Sensor States4 Sensor States...Check Sum

Layout Row and Column (Byte 0)

A single byte split into two 4-bit nibbles:

  • High 4 bits: Layout Row (number of rows)
  • Low 4 bits: Layout Col (number of columns)

For example, 00010001₂ = 0x11: Row = 1, Col = 1, representing one row and one column.

4 Sensor States (Byte 1 ~ n-2)

Each byte represents the states of 4 sensors, with 2 bits per sensor:

BinaryDecimalSensor State
000No tile connected
011No pressure
102Pressure detected

The 4 sensors are arranged in horizontal order.

Example — Two tiles arranged in a 1x2 layout. The 8 sensor states obtained from the data are arranged left to right, top to bottom:

Data: [00010010, 01011010, 01011010, checksum]

Layout parsed: Row=1, Col=2 (one row, two columns)

Sensor matrix (4 sensors per tile):
┌──────────┬──────────┐
│ 01 01 │ 10 10 │
│ │ │
│ 01 01 │ 10 10 │
└──────────┴──────────┘
Tile 1 Tile 2
(No press) (Pressed)

Check Sum (Last byte)

An XOR checksum of all data bytes to ensure data integrity during transmission.


5.2 Sensor Information (0xFEE2) — Notify

After enabling Notify, sensor value change notifications are triggered when a mat tile is stepped on or when the foot is lifted.

Packet format (20 bytes, in groups of 2 bytes):

Byte 0Byte 1Byte 2Byte 3...
Sensor Change Position (1)4 Sensor States (1)Sensor Change Position (2)4 Sensor States (2)...

Sensor Change Position

A single byte split into two 4-bit nibbles:

  • High 4 bits: Layout Row Index (starting from 0)
  • Low 4 bits: Layout Col Index (starting from 0)

For example, 00010000₂ = 0x10: Row Index = 1, Col Index = 0, representing the tile in the second row, first column.

4 Sensor States

A single byte split into 4 groups of 2 bits, representing the sensor states at the top-left, bottom-left, bottom-right, and top-right positions:

ValueSensor State
00No pressure
01Level 1
10Level 2
11Level 3

For example, 00001100₂ = 0x0C: top-left = no pressure, bottom-left = no pressure, bottom-right = Level 3, top-right = no pressure.


5.3 LED Control Command (0xFEE3) — Write

The client sends LED light control commands via Write.

Packet format (20 bytes):

Byte 0Byte 1~3Byte 4~6...Byte 3n+1
Subsequent data lengthLight control commandLight control command...Check Sum

Each light control command consists of 3 bytes:

ByteFieldDescription
0LocationLED position in the Layout
1ModeLight control mode
2ColorColor code

Location

Same format as the Sensor Change Position: high 4 bits = Row Index, low 4 bits = Col Index.

Mode (8-bit breakdown)

BitPurposeRangeValue Description
1~3Light position0~70 Entire tile lit, 1 Top-left only, 2 Bottom-left only, 3 Bottom-right only, 4 Top-right only, 5 All individually lit
4Trigger mechanism0~10 Trigger feedback once immediately, 1 Trigger on step
5~7Feedback mode0~70 Unspecified (direct light control), 1 No feedback on step, 2 Basic, 3 Blink, 4 Marquee, 5 Breathing light, 6 Neon light
8Feedback duration0~10 Short, 1 Long (affects blink and marquee speed)
Entire Tile Lit Mode

When bits 1~3 are set to 0 (entire tile lit), all 4 LEDs will light up together regardless of which position sensor is triggered.

Color (Color Code)

A 1-byte color code index mapped to a predefined 62-color RGB palette:

CodeRGBColor
00000Black (off)
0125500Red
02~1025525~2250Red to Yellow gradient
112552550Yellow
12~20225~252550Yellow to Green gradient
2102550Green
22~30025525~225Green to Cyan gradient
310255255Cyan
32~400225~25255Cyan to Blue gradient
4100255Blue
42~5025~2250255Blue to Purple gradient
512550255Purple
52~602550225~25Purple to Red gradient
61255255255White
Full 62-Color RGB Reference Table
CodeRGBColor
00000
0125500Red
02255250
03255500
04255750
052551000
062551250
072551500
082551750
092552000
102552250
112552550Yellow
122252550
132002550
141752550
151502550
161252550
171002550
18752550
19502550
20252550
2102550Green
22025525
23025550
24025575
250255100
260255125
270255150
280255175
290255200
300255225
310255255Cyan
320225255
330200255
340175255
350150255
360125255
370100255
38075255
39050255
40025255
4100255Blue
42250255
43500255
44750255
451000255
461250255
471500255
481750255
492000255
502250255
512550255Purple
522550225
532550200
542550175
552550150
562550125
572550100
58255075
59255050
60255025
61255255255White

sequenceDiagram
participant App
participant ControlBox as Control Box

App->>ControlBox: Scan BLE advertisements
App->>ControlBox: Initiate connection
ControlBox-->>App: Connection established, stop advertising
App->>ControlBox: Read GAP Service (device name, connection parameters)
App->>ControlBox: Read Layout Information (0xFEE1)
App->>ControlBox: Enable Sensor Information Notify (0xFEE2)
ControlBox-->>App: Push sensor change data
App->>ControlBox: Write LED Control Command (0xFEE3)

7. Development Notes

  1. Mapping Timing: The control box automatically performs Mapping Layout after powering on. Do not step on the mat tiles during this process. Layout information can only be read after Mapping is complete.
  2. Data Length: The packet length for Layout information, sensor information, and LED control commands is always 20 bytes.
  3. Check Sum: The last byte of every packet is an XOR checksum. The receiver should verify data integrity.
  4. Index Starting Value: Both Row Index and Col Index start from 0.
  5. Android Permissions: Android 12+ requires BLUETOOTH_SCAN and BLUETOOTH_CONNECT permissions; Android 11 and below requires ACCESS_FINE_LOCATION.
  6. iOS Limitations: iOS does not support reading the BLE MAC Address. Use the advertising name or Service UUID for device identification.

Version History

VersionDateDescription
1.02023-03-02Original WhizToys custom Bluetooth specification document
1.12026-04-08Converted to online documentation format

Contact Us

For the complete SDK or technical integration inquiries, please contact: support@seda-gtech.com.tw