OKOK Protocol
OKOK Protocol
The History:
REV1.4
Modify 0x00-0x01 broadcasts to send weighting data
acknowledgement command
instruction
1. Protocol overview
The document describes in detail the access to OKOK health scale APP communication frame
format, as well as equipment and APP interactive process.
Currently available devices are Bluetooth body scales and Bluetooth body fat scales,
in which Bluetooth body scales are used in blue Dental broadcast mode and APP transmission
data, the Bluetooth body fat scale uses the broadcast + transparent transmission mode
to transmit data.
Description Start bit Version number Data field length Data domain Body check bits
Byte 1 1 1 Variable 1
Frame format field description:
Field name
Start bit
Description
The command starts with 0xCA to determine whether the start
of a frame.
Version number The version number of the frame for use when the subsequent
frame is extended.
Data field length To indicate the length of the data domain text and how many
bytes are in it.
Data domain Here to save all the information and data that is associated
with the device.
Check digital bit (version number begins at the end of the data domain text, bit
by bit or XOR).
3 0x10
4 0x10
Data domain length
0x--
Command byte,0x10
5
Subcontracting information (high four bits representing
current packages, low four representing packages)
6 0x--
Number)
7 0x--
Current App time, in seconds
8 0x--
Note: current time is between January 1, 1970, 00:00:00.0,
9 0x--
UTC, total seconds.
10 0x--
11 0x--
Hold back
16 0x-- Sex and age,the highest position is 1 for men and 0 for women .
17 0x--
18 0x--
Height
19 0x--
High weight byte
20 0x--
Low weight byte
Check code
1 0xCA
2 0x11 Version V1.1
Frame head
3 0x0A
4 0x10
Data domain length
0x--
Command byte,0x10
5
Subcontracting information (high four bits representing
10 0x--
women .
Sex and age,The highest position is 1, for men and 0 for
11 0x--
12 0x--
Height
13 0x--
High weight byte
14 0x--
Low weight byte
Check code
Note: since BLE4.0 is transmitted with a maximum of 20 bytes per frame, the maximum number
of bytes in the case of the 8 characters is at most 5 times send.
Byte Value Description
2) 0x11 Synchronous historical data instruction:
6 0x--
The final user number selected by the user
7 0x--
8 0x--
9 0x-- Check code
7 0x--
High weight byte
12 0x
tables 1
Message body properties, defined reference
13 0x00
14 0x00
Hold back
15 0x00
Hold back
16 0x00
Hold back
17 0x00
Hold back
18 0x00
Hold back
19 0x--
Hold back
Check code
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
Table 1
Message body
properties
00 = KG(default)
selection
01 = Jin
10 = LB
11 = ST:LB
Bit2-1
00 = 1 decimal(default)
Decimal digit selection
01 = 0 decimal
10 = 2 decimal
Hold back 1 decimal,the upload weight is 10 times the actual value, and 2 decimal places are
retained. The weight value uploaded is 100 times of the actual value, and so on.
Instructions on the number of units and decimals: the number of decimal digits displayed by
APP is determined by the scale, which is determined by the decimal number of the message body,
the default unit is kg, and the decimal digit is 1 bits.
e.g.
Item Message body High weight byte Low weight byte
properties
50kg,1 decimal, 0X00 0X01 0XF4
not locked
50LB,1 decimal, 0X10 0X01 0XF4
not locked
4:13 ST:LB,1 0X00 0X04 0X82
decimal, not
locked
Note: the 1.ST:LB unit defaults to: ST bytes are fixed to integers, and LB bytes are fixed
to 1 decimal places. The decimal point at this point selects the bits that are converted into
other units.
2) 0x12 Transmit data by sending data through instruction
6 0x--
7 0x--
Weighing time is in seconds
8 0x--
Note: weighing time is between January 1 and 1970
9
00:00:00.0 UTC total seconds.
0x--
10 0x-- Message body properties, defined by reference table 1
11 0x--
12-15 0x-- User ID
Hold back
16 0x--
17 0x--
High weight byte
18 0x--
Low weight byte
19 0x--
High body-fat byte
20 0x-
Low body-fat byte
Check code
Byte Value Description
The second package:
6 0x--
representing total package)
7 0x--
High water byte
8 0x--
Low water byte
9 0x--
High byte of muscle
10 0x-- BMR
Low byte of muscle
11 0x-- BMR
high byte
12 0x--
low byte
13 0x--
Visceral fat high byte
14 0x--
Visceral fat low byte
15 0x--
Bone
Check code
8 0x--
Note: weighing time is between January 1 and 1970 00:00:00.0 UTC
9
total seconds.
0x--
10 0x-- Message body properties, defined reference tables 1
11 0x--
12- 0x-- User ID
Hold back
15
16 0x--
17 0x--
High weight byte
18 0x--
Low weight byte
19 0x--
High body-fat byte
20 0x-
Low body-fat byte
Check code
The second package:
6 0x--
representing total package)
7 0x--
High water byte
8 0x--
Low water byte
9 0x--
High byte of muscle
10 0x-- BMR
Low byte of muscle
11 0x-- BMR
high byte
12 0x--
low byte
13 0x--
Visceral fat high byte
14 0x--
Visceral fat low byte
15 0x--
Bone
Check code
6 0x--
current packet number,low four representing total package)
7 0x--
High weight byte
9 0x--
10 0x--
Match user 1 number
11 0x--
12 0x--
13 0x--
14 0x--
Match user 2 number
15 0x--
16 0x--
17 0x--
18 0x--
19 0x--
20 0x-
Byte Value Description
1 0xCA Frame head
2 0x11 Protocol version number, V1.1
3 0x10 Data domain length
4 0x14
5 0x--
The command byte,0x14
Subcontracting information (high four bits
representing current packet number, low four
representing total package)
6 0x--
7 0x--
Match user 3 number
8
Match user 4 number
0x--
9 0x--
10 0x--
11 0x--
12
Match user 5 number
0x--
13 0x--
14 0x--
15 0x--
16
Match user 6 number
0x--
17 0x--
18 0x--
19 0x--
20 0x-
Match user 7 number
Check code
6 0x--
7 0x--
Match user 7 number
8 0x--
9 0x--
10
Match user 8 number
0x--
11 0x--
12 0x--
13 0x-- Check code
REMARKS:
Bluetooth status through the P1.3 pin, High level indicates broadcast,
low level indicates connection. V1.4 version send data with 96 instructions,
sleep with 80 command, only these 2 commands.
2.2.3 MCU and BLE data interaction format (for MCU Engineers)
1 0xCA
2 0x0A
Frame head
3 0x10
Data length, length 3-11 bytes
Synchronous command
4 0x--
5~8 0x--
User number,0x00~0x09
Time, the unit is second, is relative to a certain benchmark
time offset, the reference time is defined as the benchmark
in the C function library time (1970 1)April 1, 0, 0), high
byte in front, low byte in back.
9 0x--
10 0x--
Gender, 0x80 means male, 0x00 means female
11 0x-- Height,unit is cm
Age
12 0x--
13 0x--
Note: the direction BLE-->MCU
Check code
6 0x-- High weight byte,Small end mode, 10 times the actual weight value
Description: Command direction MCU-->BLE, the command data using small end data format, and the data
is 10 times the actual value, so as to retain 1 decimal places. For example: 65.5KG = 655 = 0x28F
1 0x--
2-5 0x--
Message body properties, defined by reference table 1
Time, the unit is second, the offset is relative to a certain
base time, Quasi time is defined as the benchmark in the C
function library (January 1, 1970, 0, time),0 minutes) high
byte in front, low byte in back.
6 0x--
7 0x-- High weight byte,Unit: kg (Modifiable)
User code,0x00~0x09
8 0x--
9 0x--
Low weight byte
10 0x--
Fat high byte, percent
11 0x--
Fat low byte
12 0x--
Water high byte, percent
13 0x--
Water low byte
14 0x--
Muscle high byte,kg
19 0x--
Visceral fat, low byte
20 0x--
Bone ,kg
Exclusive or checksum value, exclusive or value of byte 1-19
Description: Command direction MCU-->BLE, the command data using small end data format,
and the data is 10 times the actual value.
In order to retain 1 decimal places. For example: 65.5KG = 655 = 0x28F.
Table 1:
Message Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
02 = KG(default)
03 = Jin
10 = LB
11 = ST:LB
Bit2-1
00 = 1 decimal places (default)
decimal places selection
01 = 0 decimal places
10 = 2 decimal places
Retain 1 decimal places, the weight of the uploaded value is 10 times the actual value,
and retain 2 decimal places, then upload the weight value of 100 times the actual value,
and so on.
Bit0
0 = Non lock data
Non lock / lock data
1 = lock data
Instructions on the number of units and decimals: the number of decimal digits displayed
by APP is determined by the scale, which is determined by the decimal number of the message
body attribute, the default unit is kg, and the decimal digit is 1 bits.
e.g.:
Note: the 1.ST:LB unit defaults to: ST bytes are fixed to integers, and LB bytes are fixed to
1 decimal places. The decimal point at this point. Select bits represent small bits that are
converted to other units.
Sleep command:
7 0x44
Sleep command
Check code
Description: Command direction MCU-->BLE, which enables Bluetooth to enter deep
sleep mode.
1 0xC5
2 0x01
Frame head