Skip to content

Latest commit

 

History

History
360 lines (322 loc) · 13.1 KB

curtain.md

File metadata and controls

360 lines (322 loc) · 13.1 KB

Curtain BLE open API

Curtain Broadcast Package

  • The following table is the Service Data of SCAN_RSP.
Service data
Byte: 0 Enc type Bit[7] NC
Dev Type Bit [6:0] – Device Type ‘c’Const Adv Mode ‘C’Pair Mode
Byte: 1 Status Bit [7] – Whether to allow connection 1- allowed, 0- not allowed
Bit [6] – Calibration situation 1-calibrated, 0-not calibrated, need to be calibrated
Bit [5-0] NC
Byte: 2 Update utc flag Bit[7] NC
Battery Bit [6:0] – Battery capacity 0~100%
Byte: 3 MotionState Bit [7] - Movement status, 0-stationary, 1-movement
Position Bit [6:0] - The current position of the device (%)
Byte: 4 LightLevel Bit [7:4] - Light level (1-10)
DeviceChain Bit [3:0] - Device chain length

boardcast_1

Basic format of BLE communication data packet

  1. UUID related to communication.
    • Communication service UUID:

cba20d00-224d-11e6-9fb8-0002a5d5c51b
UUID TYPE:Vendor UUID types start at this index (128-bit)

  • RX characteristic UUID of the terminal sending data to the device:

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 device sending data to the terminal:

cba20003-224d-11e6-9fb8-0002a5d5c51b
UUID TYPE :Vendor UUID types start at this index (128-bit)

Char Attribute :RW

  1. All two-way communication occurs after the BLE connection is established. The communication form is that the terminal first sends a REQ request packet to the device, and the device returns an RSP packet.

The terminal first sends the REQ request packet to the device. The basic format is as follows:

REQ Packet
Byte: 0 Magic Number 0x57 – (fixed value)
Byte: 1 Header Bit [7:6] – Version 0 – (fixed value)
Bit [5:4] – Encryption Mode 0 – no encryption
Bit [3:0] – command 0x02 – Get basic device information 0x0F – extended command
Byte: 2-19 Payload Depends on Command

The basic format of the RSP packet returned by the device to the terminal is as follows:

RSP Packet
Byte: 0 Response status 0x01 - OK, Action executed 0x02 - ERROR, Error while executing an Action 0x03 - BUSY, Device is busy now, please try later 0x04 - Communication protocol version incompatible 0x05 - Device does not support this Command 0x06 - Device is low power 0x0D - This command is not supported in the current mode 0x0E - Disconnected from the device that needs to stay connected
Byte: 1-19 Payload Depends on the Command to reply

0x02 Get the basic information of the device command

  • Used to obtain basic information about the device.
  • REQ Packet Payload is 0.
  • The Status byte of the RSP packet after successful execution is 0x01, and the Payload is:
RSP Packet Payload
Byte: 0 Bat Per The battery percentage
Byte: 1 FW Ver Firmware Version
Byte: 2 Chain Length Device Chain Length
Byte: 3 State 1 bit7-direction, 0: default (open to the left), 1: reverse bit6-touch and go, 0: disable, 1: enable bit5-lighting effect, 0: disable, 1: enable bit4-reserved bit3-fault, 0-none, 1-faulty bit2:0-reserved
Byte: 4 State 2 bit3-Whether solar panel is plugged in, 0-No, 1-There is solar panel bit2-calibrated, 0-not calibrated, 1-calibrated bit1:0-motion status, 0-static, 1-open window, 2-close window
Byte: 5 Position Current location of the device (%)
Byte: 6 Timer Amount Number of timers

5702_1

0x0F extended command

0x45 Curtain setting command

  • Set Curtain's unique setting content.
Function code Function parameter code REQ Packet Payload
Byte: 0 Byte: 1 Byte: 2 Byte: 3
0x01-Action 0x05-unified action of device chain 0xFF The distance between the final position of the device and the origin (%)
0x03-Light sensor 0x02-device chain light trigger source The serial number of the device where the photosensitive sensor is located (device identification B) 0x0-Motherboard 0x01-Solar Panel
0x03-delete all light sensing actions
  • REQ Packet不同命令返回值不同。
REQ Packet RSP Packet
Functioncode Function parameter code Payload Byte: 0 Byte: 0 Byte: 1 Byte: 2
0x01-Action - - Command Status Device 0 current percentage position Current percentage position of device 1

570f450105ff32

0x46 Curtain get command

  • Get Curtain's unique setting content.
  • Action mode A: 0-performance mode, 1-silent mode, other-invalid value, the default invalid value is 1 for all bit values.
  • Charging status A:
    • 0:Not charging,
    • 1:Adapter charging,
    • 2:Solar panel charging,
    • 3:The adapter connection is full,
    • 4:The solar panel connection is full,
    • 5:The solar panel is connected and not charged when it is not fully charged.
    • 6:Hardware error.
Function Function Function Function
Byte: 1 Byte: 2 Byte: 3 Byte: 0 Byte: 1 Byte: 2 Byte: 3 Byte: 4 Byte: 5 Byte: 6
0x04-Basic attributes 0x01-Summary information Command Status Device 0 bit7-direction, 0: default, 1: reverse bit6-touch and go, 0: disable, 1: enable bit5-light sensor, 0: disable, 1: enable bit4-reserved bit3-window mode, 0-window to the left, 1-window to the right bit2:0-reserved Device 1 bit7-direction, 0: default (open to the left), 1: reverse bit6-touch and go, 0: disable, 1: enable bit5-light sensor 0: disable, 1: enable bit4-reserved bit3-window mode, 0-open window to the left, 1-open window to the right bit2:0-reserved
0x02-Advanced page Device 0 battery power Device 0 Firmware version Device 0 State of charge A Device 1 battery power Device 1 Firmware version Device 1 State of charge A
0x01-Query the basic status of the device chain bit7-reserved bit6-delay action 0-none, 1-yes bit5:4-device chain head movement status, 0-static, 1-open window, 2-close window, bit3:0-the number of light sensing actions bit7:4-device chain head action mode A bit3:0-the number of device chain head timers Device chain length bit7- whether to insert solar panel, 0-no, 1- insert solar panel; bit6:0-sequence number 0 device current location bit7-whether to charge, 0-no, 1-charging; bit6:0-serial number 0 device current battery power bit7- whether to insert solar panel, 0-no, 1- insert solar panel; bit6:0-sequence number 1 current location of the device

570f460401

570f460402

570f468101

CopyRight@2022 Wonderlabs, Inc.

Back to Home

Back to Device Types