Skip to content

Latest commit

 

History

History
383 lines (364 loc) · 12.1 KB

colorbulb.md

File metadata and controls

383 lines (364 loc) · 12.1 KB

Color Bulb BLE open API

Color Bulb Broadcast Message

The following table is the Manufacture Data of ADV_IND.

Byte: 0 UUID 0x09 UUID is 0x0969, big-endian
Byte: 1 0x69
Byte: 2 MAC Address 0x01 Device Mac Address 0x010203040506, big-endian
Byte: 3 0x02
Byte: 4 0x03
Byte: 5 0x04
Byte: 6 0x05
Byte: 7 0x06
Byte: 8 Sequence Number 1~255 1~255 increments, 256 overflows to 1, and the broadcast packet data is automatically incremented when there is an update
Byte: 9 bit[7] power state 0-power off, 1-power on
bit[6:0] light level 1~100%
Byte: 10 bit[7] is delay 0-no delay,1-has delay Is there an delay
bit[6:4] Network status 0-Wi-Fi Connecting 1-IoT Connecting 2-IoT Connected
bit[3] is on state preset 0-not preset,1-preset
bit[2:0] light state 1-white, 2-color, 3-dynamic
Byte: 11 bit[7] RSSI quality 0-normal;1-Bad
bit[6:0] dynamic rate 1-100%
Byte: 12 bit[7:2] Loop Index
bit[1:0] NC

BLE communication packet basic format

  • he controlling terminal (short as the Terminal below) and the configured device (short as the Device below) use BLE to communicate with each other wirelessly. During the communication, the Terminal acts as a central device, while the Device acts as peripheral device. The Terminal gets basic device info by reading the broadcast message of the Device. They exchange data by using read and write characteristic of communication service.
  • All bilateral communication is after the BLE connection established. The Terminal send a REQ message to the Device, and then the Device returns a RESP message.
  • All communication message data length is 1-20 bytes, i.e. MTU=20.
  • RX characteristic UUID of the message from the Terminal to the Device:

    • UUID: ''cba20002-224d-11e6-9fb8-0002a5d5c51b''
    • UUID TYPE: Vendor UUID types start at this index (128-bit)
    • Char Attribute: RW
    • Char Properties: notify      
  • TX  characteristic UUID of the message from the Device to the Terminal:'''

    • cba20003-224d-11e6-9fb8-0002a5d5c51b
    • UUID TYPE: Vendor UUID types start at this index (128-bit)
    • Char Attribute: RW
  • The control terminal sends the REQ packet format, and the specific content format of payload varies from command:
REQ Packet No encryption
Byte: 0 Magic Number 0x57 – (fixed value)
Byte: 1 Header Bit [7:6] – Version 0 – (fixed value)
Bit [5:4] – reserve
Bit [3:0] – command 0x0F – expansion command
Byte: 2-19 Payload Depends on Command

0x0F Expansion command

0x570F4701 set the status and color of the Bulb

REQ Packet Payload Turn On Bulb Turn Off Bulb TOGGLE Change Lvl + RGB Change Lvl + CW Change Lvl Change RGB Change CW
Byte: 0 0x47
Byte: 1 0x01
Byte: 2 0x01 0x02 0x03 0x12 0x13 0x14 0x16 0x17
Byte: 3 0x01 Lvl (0 - 100) Lvl (0 - 100) Lvl (0 - 100) Lvl (0 - 100) C/W (2700K - 6500K)
Byte: 4 0x01 R (0 - 255) R (0 - 255)
Byte: 5 0x01 G (0 - 255) G (0 - 255)
Byte: 6 0x01 B (0 - 255) B (0 - 255)
RESP Packet
Byte: 0 0x01
Byte: 1 bit[7]: power status 0 OFF 1 ON bit[6]: light status 0 no preset
Byte: 2 Lvl (0 - 100)
Byte: 3 R (0 - 255)
Byte: 4 G (0 - 255)
Byte: 5 B (0 - 255)
Byte: 6 C/W (2700K- 6500K)
Byte: 7
Byte: 8 0xFF no care 0x01 white 0x02 color 0x03 dyanmic 0x04 dynamic group 0x06 music
Byte: 9 0xFF no care other preset idx
Byte: 10 current mode 0x01 white 0x02 color 0x03 dyanmic

Example:

  • Turn On Bulb REQ 0x570f470101 RESP 0x018032FF00000000FFFF02
  • Turn Off Bulb REQ 0x570f470102 RESP 0x010032FF00000000FFFF02
  • Set Bulb into a blue 50% brightness REQ 0x570f470112320000ff RESP 0x0180320000FF0000FFFF02
  • Adjust the brightness of Bulb REQ 0x570f47011420 RESP 0x0180200000FF0000FFFF02

0x570F4801 read the status of Bulb

The payload length of the request packet is 0.

The response will return the current Bulb status.

RESP Packet payload
Byte: 0 0x01
Byte: 1 power and light status
Byte: 2 bulb brightness
Byte: 3 bulb R
Byte: 4 bulb G
Byte: 5 bulb B
Byte: 6-7 bulb temperature
Byte: 5-10 bulb mode

Example:

  • Send 0x570F4801 query Bulb status RESP 0180200000FF0000FFFF02

CopyRight@2022 Wonderlabs, Inc.

Back to Home

Back to Device Types