Skip to content

Latest commit

 

History

History
252 lines (231 loc) · 7.88 KB

File metadata and controls

252 lines (231 loc) · 7.88 KB

Plug Mini BLE open API

Plug Mini 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 Plug Mini state 0x00 - power off 0x80 - power on Plug Mini's switch status
Byte: 10 bit[0] delay 0-no delay, 1-has delay Is there a delay
bit[1] timer 0-no timer, 1-has timer Is there a Timer
bit[2] sync utc time 0-no sync time , 1-already sync time Whether the UTC time has been synchronized
Byte: 11 wifi rssi The rssi signal value of the currently connected wifi
Byte: 12-13 Overload byte 12[7] overload Whether the Plug Mini is overloaded, more than 15A current overload
Power byte 12[0-6] Power MSB

byte 13[0-7] Power LSB

Plug Mini current power value of the load

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

0x570f5001 set state

REQ Packet payload
REQ Packet Turn On Plug Mini Turn Off Plug Mini TOGGLE Plug Mini
Byte: 0 0x50
Byte: 1 0x01
Byte: 2 0x01 0x02
Byte: 3 0x80 0x00 0x80
RESP Packet
Byte: 0 0x01
Byte: 1 0x00 Plug Mini Off 0x80 Plug Mini On

Example:

  • Turn On Plug Mini REQ 0x570f50010180 RESP 0x0180
  • Turn Off Plug Mini REQ 0x570f50010100 RESP 0x0100

0x570f5101 read state

The payload length of the request packet is 0.

The response will return the current Plug Mini status.

RESP Packet payload
Byte: 0 0x01
Byte: 1 0x00 Plug Mini Off 0x80 Plug Mini On

Example:

  • Send 0x570f5101 query Plug Mini status RESP 0180

CopyRight@2022 Wonderlabs, Inc.

Back to Home

Back to Device Types