PLRBNEITO Protocol

PLRBNEITO Peripheral Application Protocol
Project: PLRBNEITO/Bluetooth 5 BLE module
Module name:RabbitN/RabbitI/Rabbit-CN/Rabbit-CI
Designed:Suzhou Pairlink Network Technology Ltd.

VersionV1.0

Note
CreateDate
2021/11/15

This document contains information that is proprietary to Pairlink . This document is commerciallyconfidential andmust NOT be disclosed to third parties without prior consent. The information

provided herein is believed to be reliable. But

production testing may not include testing of allparameters. Pairlink reserves the right to change information at any time without notification.
-1www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO ProtocolContents
1.Serial Interface.......................................................................................................................... - 3 1.1.UART Setting .................................................................................................................. - 3 1.2.Packet Format ................................................................................................................ - 4 2.Protocol .................................................................................................................................... - 5 2.1.Command [Type = 0x01] ................................................................................................ - 5 2.1.1.OpCode ............................................................................................................... - 5 1) Set Pairing Mode [0x01]......................................................................................... - 5 2) Set Pairing Mode Cancel [0x02] ............................................................................. - 5 3) Set Disconnected [0x03] ........................................................................................ - 6 4) Get Local Device Name [0x04] ............................................................................... - 6 5) Get Local BD Address [0x05] .................................................................................. - 6 6) Get Firmware Version [0x06] ................................................................................. - 7 7) Send Data [0x0B] .................................................................................................... - 7 8) Set Local Name [0x0C] ........................................................................................... - 7 9) Get System State [0x0D] ........................................................................................ - 8 10) Set GPIO [0x0E] .................................................................................................... - 9 11) Set Baudrate [0x0F]............................................................................................ - 10 12) Set_Deep_Sleep[0x11] ....................................................................................... - 10 13) Set_LPM_WAKEUP_IO[0x12] ............................................................................. - 11 14) Set_LPM_ADV[0x13] .......................................................................................... - 11 15.Set_LPM_CON[0x14] ........................................................................................... - 12 2.2.Reserved [Type = 0x02] ............................................................................................... - 12 2.3.Response [Type = 0x03] ............................................................................................... - 12 2.3.1. Response Error Code ....................................................................................... - 12 2.4.Event [Type = 0x04] ..................................................................................................... - 13 2.4.1. OpCode ............................................................................................................ - 13 1) BLE Startup [0x01]................................................................................................ - 13 2) Pairing Status [0x02] ............................................................................................ - 13 3) Local Device Name [0x03] .................................................................................... - 13 4) Local BD Address [0x04] ....................................................................................... - 14 5) Local Firmware Version [0x05] ............................................................................. - 14 6) Master send data package [0x06] ........................................................................ - 14 7) Baudrate Return [0x07] ........................................................................................ - 14 8) EVENT_LPM_ADV_TIMEOUT [0x09] .................................................................... - 14 9) EVENT_LPM_CON_TIMEOUT [0x0A].................................................................... - 15 3.Uart Port Diagram................................................................................................................... - 15 4.Message Sequence Example .................................................................................................. - 16 --2www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

1.Serial Interface
Send data packet via serial interface to manage the BLE connections.

1.1.UART Setting
NO1234NAME
Baud Rate
Data Bit
StopParity Bit

CONFIG
9600
8Bit
1Bit
None-3www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

1.2.Packet Format
CommandReserved
Response
Event

Host send to Rabbit, to manage the BLE connections
N/ARabbit send to Host, to response the command packet from Host
Rabbit send to Host, to report BLE connection event to Host

Packet format
LSBHeader
TypeMSB
Length OpCode Payload

Checksum

Payload contents are variable, it depends on the OpCode.
Table 1 <Packet Format>
Header
Type0x77
Type of Packet
CommandReserved

0x01
0x02

Response0x03

Event0x04

LengthLength of OpCode + Payload

OpCodeSelected Rabbit Function

PayloadChecksum

Detail data of each OpCode
Check the validity Packet header
Checksum = Header ^ Type ^ Length ^ OpCode ^ Payload-4www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

2.Protocol
2.1.Command [Type = 0x01]
Command control BLE Command : 0x01

* Packet Format : Command
LSBHeader
TypeLength
0x77 (Fix)0x01 (Fix) Variable

OpCodeVariable

PayloadVariable

MSB
Checksum
Variable* Indication: Header, Type, Length, OpCode, Payload, Checksum in Sequencemark as H, T, L, O, P, C

2.1.1.OpCode1) Set Pairing Mode [0x01]
Set Rabbit start advertising.
CommandHTLO
P7701
N01
User Data
ResponseHT
LO
P
77
03
02
01
Err(1 byte)
Custom broadcast data supports up to 17 bytes.
E.g.
No custom data broadcast: 77 01 01 01 76
Custom data broadcast: 77 01 09 01 11 22 33 44 11 22 33 44 7E

C76
CChecksum2) Set Pairing Mode Cancel [0x02]
Set Rabbit stop advertising.
H77

T01

L01

H77

T03

L02

CommandO02
ResponseO02

PNAC75P
Err(1 byte)

CChecksum-5www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol3) Set Disconnected [0x03]
Set Rabbit to disconnect BLE connection of Handle.
CommandHTLO
PC
7701
03
03Handle
Checksum
ResponseHTLO
PC77
03
02
03
Err(1 byte)
Checksum
Handle: the connection handle: 2 Bytes.
Rabbit could connect to 2 masters at the same time, the connection handle is dedicated toeach master. This connection handle would be report to MCU once one master successfully
connect to Rabbit, by the Pairing Status event[0x02].

4) Get Local Device Name [0x04]
Get the Rabbit Local device name.
H77T01

H77

T
03

H77

T
04

CommandLO
01
04
Response
L
O
02
04
EventLO
Length03

PNA

C
73

PErr(1 byte)

CChecksumP
PayloadCChecksum

5) Get Local BD Address [0x05]
Get the Rabbit BD address, the BD_ADDR would be report with ASCII code.
CommandHT
LOPC
77
01
01
05
NA72
Response
HTLOPC77030205
Err(1 byte)Checksum
EventHTLO
PC7704
Length04
PayloadChecksum-6www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

E.g. BD_ADDR is 00 18 31 84 A1 32
Command:77 01 01 05 72
Response: 77 03 02 05 01 72
Event: 77 04 0D 04 30 30 31 38 33 31 38 34 41 31 33 32 Checksum

6) Get Firmware Version [0x06]
Get the Rabbit Firmware Version.
CommandHT
LOP
77
01
0106
NA
ResponseHTLO
P77030206
Err(1 byte)
EventHTLOP
7704
Length05
PayloadE.g. Version: S20150506(ASCII 53 32 30 31 35 30 35 30 36)
Command: 77 01 01 06 71
Response: 77 03 02 06 01 71
Event: 77 04 0A 05 53 32 30 31 35 30 35 30 36 Checksum

C71
CChecksum
CChecksum7) Send Data [0x0B]
Send data to master(APP/APK).
CommandHTLO
PC
7701
Length0B
PayloadChecksum
ResponseHTLOPC
7703020B
Err(1 byte)
Checksum
Payload: handle of connection(2 bytes) + user data(ex: 0A CE 09 )Max length of the Payload is 22 bytes.
Rabbit can connected 2 masters at the same time, each master with a different Handle, andone of the Handle must be selected when sending data.

8) Set Local Name [0x0C]
After local name set, Rabbit would advertising with this name, and APP/APK could scan andshow the BLE device with this name.
This command should be set after Rabbit Reset or Power on. Must before the command of“Set Pairing Mode”-7www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO ProtocolCommandHTLO
77
01
Length0C
ResponseHTLO
7703
020C
Payload: Local name in ASCII code.
Max length of the Payload is 16 bytes.

PPayloadCChecksumPErr(1 byte)

CChecksum9) Get System State [0x0D]
After send this command to Rabbit, MCU could get the system state by the command
response.
CommandHT
LO
P
C
7701
01
0DNA
7A
Response
H
T
L
O
P
C
7703
06
0DPayload
Checksum
Payload: Advertising status(0 disable; 1 advertising) + handle1(00 no handle1) + handle2(00no handle2.

-8www.pairlink.com.cnAll rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol10) Set GPIO [0x0E]
After send this command to Rabbit, Rabbit can set the GPIOs output High or Low.
CommandHTLOPC(1)
7701
Length0EPayload
Checksum
ResponseHTLOPC
77

03

02

0EErr(1 byte)

Payload: Level(bit7)|GPIO_Number(bit0~6),
Bit7 means High or low levels , 1 meas high level and 0 means low level.
Bit4~Bit6 means GPIO Port，Bit0~Bit3 means GPIO Pin.
Max length of the Payload is 8 bytes. User can control 8 GPIOs one time.
The pins can be set are as follows:
P0_0
P0_1
P0_2
P0_4
P0_5
P0_6

P2_0

P4_0

P2_1

P4_1

Checksum

P0_7

P1_2

P1_3

P1_4

P1_5

P1_6

P1_7

P2_2

P2_3

P2_4

P2_5

P2_6

P2_7

P3_2

P3_3

P3_4

P3_5

P3_6

P4_2

P4_3

E.g.
CMD :0x 77 01 04 0E A3 A4 A5 DE
0xA3
P2_3
output High
0xA4
P2_4
output High
0xA5
P2_5
output HighCMD :0x 77 01 04 0E 23 24 25 5E
0x23
P2_3
output Low
0x24
P2_4
output Low
0x25
P2_5
output Low-9www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol11) Set Baudrate [0x0F]
After send this command to Rabbit, Rabbit can set UART output baudrate.
CommandHTL
O
P
77
01
05
0F
Payload(1)Response
H
T
L
O
P
77

03

C
ChecksumC

020F
Err(1 byte)
Checksum
EventH
T
L
O
P
C
77
04
05
07
PayloadChecksum
Payload: UINT 32 Baudrate 9600~1500000
E.g. Set Rabbit Baudrate to 115200. (0x 00 01 C2 00)
CMD:0x 77 01 05 0F 00 C2 01 00 BF
After send this command to Rabbit, Rabbit will response a value (0x 77 03 02 0F 01 78) toMCU by 9600bps , then change the baudrate to 115200 100ms later and use new baudrate
send a Event(0x 77 04 05 07 00 C2 01 00 B2) to MCU.
Note:(1): Note: Default baudrate of Rabbit is 9600bps.

The supported Baudrates are as follows:
9600
28800
76800
1536005000001382400

14400
38400
1152002304009216001444400

19200
57600
12800
4608001000000
1500000

12) Set_Deep_Sleep[0x11]
After send this command to Rabbit, Rabbit into Deepsleep mode after 100ms.
CommandHTLOPC
770103
11Payload
Checksum
ResponseHTLOPC
7703
0211Payload(2 Bytes):
Byte 0: Bit7~Bit4 GPIO Port, Bit3~Bit0 GPIO Pin
Byte 1: Wakeup Level(0:Low，1:High)

Err(1 byte)

Checksum- 10 www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

E.g. CMD:77 01 03 11 04 01 61
Set GPIO P0_4 high level to wake up Rabbit. Rabbit into Deepsleep mode after 100ms
when receive this command, and Rabbit can wake up by P0_4 high level status.

13) Set_LPM_WAKEUP_IO[0x12]
Set the pin to wake up the MCU and model.
CommandHTLO
7701
03
12ResponseHTLOP
PayloadC
Checksum

PC

7703
02
12Err(1 byte)
Checksum
Payload(2 Bytes):
Byte 0: Bit7~Bit4 GPIO Port, Bit3~Bit0 GPIO Pin，
Byte 1: The duration of the high-level pulse, unit is 10ms.
E.g. CMD: 77 01 03 12 06 04 65
Set the P0_6 pin of the Bluetooth module, the high-level pulse lasts for 40ms to wake up theMCU.

14) Set_LPM_ADV[0x13]
Set the Bluetooth heartbeat mode sleep interval.
CommandHTL
O7701
05
13
ResponseHTLO

P
PayloadCChecksum

PC

77Err(1 byte)

Checksum03

02

13EventO
09

HTL
PC
770401N
7B
Payload(4 Bytes):
UINT16 Interval , Bluetooth heartbeat mode sleep interval: 0.625*Interval ms.
UINT16 Timeout, The broadcast duration of the heartbeat mode, in seconds, the timeout
will wake up the MCU through the CMD[0x12] setting, and send the event
EVENT_LPM_ADV_TIMEOUT[0x09].

- 11 www.pairlink.com.cnAll rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

15.Set_LPM_CON[0x14]
Set the Bluetooth heartbeat mode connection interval.
CommandHTL
O
77
0105
14
ResponseHTL
OP
PayloadC
ChecksumPC

77

Err(1 byte)

Checksum

03

02

14
EventO
0A

H
T
L
P
C
770401
N
78
Payload(4 Bytes):
UINT16 Interval , Bluetooth heartbeat mode connection interval :1.25*Interval ms.
UINT16 Timeout,The duration of the heartbeat mode connection broadcast, in seconds,
the timeout will wake up the MCU through the CMD[0x12] setting, and send the event
EVENT_LPM_CON_TIMEOUT[0x0A],Interval : 0x0020~0x4000, interval *0.625ms. The power consumption becomes lower as theinterval set becomes larger.

2.2.Reserved [Type = 0x02]
Not in use

2.3.Response [Type = 0x03]
Response is the packet to notify result to host when it successfully receive the commandfrom host.Host can check the response packet after command send.

*Packet Format :Response
LSB
Header
TypeLength
0x77 (Fix)0x03 (Fix) Variable

OpCodeVariable

PayloadVariable

MSB
Checksum
Variable

2.3.1. Response Error CodeError
0x01
0x020x03

RemarkERR_NONE //Command received and processing
ERR_LENGTH_FAIL // Length of command is error
ERR_INVALID_FAIL // Command invalid error- 12 www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

2.4.Event [Type = 0x04]
Event is the packet to transmit data from Rabbit to Host, to report the event happened on
BLE connections. Opcode of event package is complied with each event.

* Packet Format : EventLSBHeader
Type0x77 (Fix)0x04 (Fix)LengthVariableOpCode
Variable

PayloadVariableMSB
Checksum
Variable

2.4.1. OpCode
1) BLE Startup [0x01]
BLE is ready.
EventO01

HTL
7704
02
Payload: 0x01ready; 0x02 fail.

PPayloadCChecksum

2) Pairing Status [0x02]
One master connected or disconnected with Rabbit.
To report this event to host.
EventH
TLO
P
7704
Length02
Payload
Payload: Connected: 0x01 + connection Handle + master BD_ADDR
Disconnected: 0x02 + connection handleCChecksum3) Local Device Name [0x03]
Report Rabbit device name to Host.
EventHTL
O
7704
Length03
Payload: Rabbit device name in ASCII code.

PPayloadCChecksum- 13 www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

4) Local BD Address [0x04]
Report Rabbit BD address to Host in ASCII.
Event
HT
L
O
7704
Length04
Payload: Rabbit BD_ADDR in ASCII.

PPayloadC
Checksum

PPayloadCChecksum5) Local Firmware Version [0x05]
Report Rabbit Firmware version to Host.
HTL
7704
LengthPayload: Rabbit firmware version in ASCII.

EventO056) Master send data package [0x06]
Report to Host, the data sent by BLE master.
EventHTLO
P
77
04
Length06
Payload
Payload: connection handle(2 bytes) + data from BLE master.

CChecksum7) Baudrate Return [0x07]
Report to Host, the data sent by BLE master.
Event
HTLOPC77
04
05
07
PayloadChecksum
Payload: UINT 32 Baudrate 9600~1500000. The Baudrate which set by MCU.
E.g. SET Rabbit Baudrate to 115200. (0x 00 01 C2 00)

8) EVENT_LPM_ADV_TIMEOUT [0x09]
Rabbit reports heartbeat mode broadcast interval timeout information.
Event
HTL
OP
77040109
NPayload: NOC
7B- 14 www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

9) EVENT_LPM_CON_TIMEOUT [0x0A]
Rabbit reports connection interval timeout information in heartbeat mode.
EventHTL
OP
C
7704010A
N
78
Payload: NO

3.Uart Port Diagram- 15 www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.

PLRBNEITO Protocol

4.Message Sequence Example
Set Pairing Mode : 0x01 to connect with Phone 1 & Phone 2.

Notice: Rabbit works as peripheral, could supports 2 BLE connections with two central
phones at the same time.
For connection 1: Host set Rabbit into pairing mode, and when the Phone1 connect withRabbit, it would report the 2-bytes connection handle1 to Host with the Phone1’s
BD_ADDR.
For connection 2: Host set Rabbit to pairing mode again, and when the Phone2 connect
with Rabbit, it would report this 2-bytes connection handle2 to HOST with the Phone2’s
BD_ADDR.
Handle1 and Handle2 is a different value.

- 16 www.pairlink.com.cn

All rights reserved

Suzhou Pairlink Network Technology Ltd.