0% found this document useful (0 votes)
3 views6 pages

111111

datasheeet rada HLK LD6002

Uploaded by

nam Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

111111

datasheeet rada HLK LD6002

Uploaded by

nam Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Shenzhen Hi-Link Electronic Co.

, Ltd

HLK-LD6002
Communication Protocol
Respiratory heart rate detection

©Shenzhen Hi-Link Electronic Co.,Ltd ,All rights reserved


1
CONTENT

1. APPLICATION PROJECT .................................................................. 3

1.1. RESPIRATORY + HEART RATE DETECTION ITEMS .................................. 3


Message Type: Report the phase test result of 0x0A13 ............................. 3
Message Type: Report the breath rate test result of 0x0A14 .....................3
Message Type: Report the heartbeat rate test result of 0x0A15 ................3
Message Type: Report the detection target distance of 0x0A16 ............... 4

2. PROGRAMMING INTERFACE .........................................................5

2.1. ENCODE THE TF MESSAGE .....................................................................5


2.2. DECODE THE TF MESSAGE .................................................................... 5
2.3. EXAMPLE CODE ......................................................................................5

©Shenzhen Hi-Link Electronic Co.,Ltd ,All rights reserved


2
1. Application project
For different application projects, all the messages related to TF frames are listed for user
reference and analysis. For the message class appearing in the document and the message data bits,
they are equipped corresponding to the actual project.
1.1. Respiratory + heart rate detection items
Message Type: Report the phase test result of 0x 0A13
Message type is 0x0A13, supporting only one-way data transfer mode.
The radar sends the data to the upper computer
fundamental Example
form Byte number frame structure The frame meaning
type frames
SOF 1 byte uint8 Start frame 01
ID 2 byte uint16 frame ID 00 00
LEN 2 byte uint16 Data frame length 00 04
TYPE 2 byte uint16 frame type 0A 13
HEAD_CKS Used to output the total
1 byte uint8 Head checksum \ phase, heartbeat phase,
UM
DATA 4 byte float [total phase] \ respiratory phase results.
DATA 4 byte float [breath phase] \
DATA 4 byte float [heart phase] \
DATA_CKS
1 byte uint8 Data checksum \
UM

Message Type: Report the breath rate test result of 0x0A14


Message type is 0x0A14, supporting only one-way data transfer mode.
The radar sends the data to the upper computer
fundamental Example
form Byte number frame structure The frame meaning
type frames
SOF 1 byte uint8 Start frame 01
ID 2 byte uint16 frame ID 00 00
LEN 2 byte uint16 Data frame length 00 04
TYPE 2 byte uint16 frame type 0A 14 To report the respiratory rate
HEAD_CKS test results.
1 byte uint8 Head check and \
UM
DATA 4 byte float [rate] \
DATA_CKS Data verification
1 byte uint8 \
UM and

Message type: Report the heartbeat rate, test result 0x0A15


Message type is 0x0A15, supporting only one-way data transfer mode.

©Shenzhen Hi-Link Electronic Co.,Ltd ,All rights reserved


3
The radar sends the data to the upper computer
fundamental Example
form Byte number frame structure The frame meaning
type frames
SOF 1 byte uint8 Start frame 01
ID 2 byte uint16 frame ID 00 00
LEN 2 byte uint16 Data frame length 00 04
TYPE 2 byte uint16 frame type 0A 15 Used to report the heartbeat
HEAD_CKS phase test results.
1 byte uint8 Head checksum \
UM
DATA 4 byte float [rate] \
DATA_CKS
1 byte uint8 Data checksum \
UM

Message Type: Report the detection target distance of 0x0A16


Message type is 0x0A16, supporting only one-way data transfer mode.
The radar sends the data to the upper computer
fundamental Example
form Byte number frame structure The frame meaning
type frames
SOF 1 byte uint8 Start frame 01
ID 2 byte uint16 frame ID 00 00
LEN 2 byte uint16 Data frame length 00 04
TYPE 2 byte uint16 frame type 0A 16
HEAD_CKS To report the detection
1 byte uint8 Head checksum \ distances.
UM
DATA 4 byte Uint32 [flag ] \
DATA 4 byte float [range ] \
DATA_CKS
1 byte uint8 Data checksum \
UM
Note: When flag as 1, the output distance (unit: cm)
If the flag is 0, no distance is output

A, the following is the data conversion of the DATA-bit:


Convert to float: for example, [rate] bit 0x66,0x66,0xA2,0x41, first spell uint32 bit shaping, because
the TF frame Data bit small end order, so the value is 0x 41A26666, and then float type strong turn,
the final result is: 20.3.

1. int main(void )
2. {
3. unsigned int param = 0x 41A 26666;
4. float res = *(float *)&param ;
5.
6. printf("data: %f\n", res);
7. return 0;
8. }

B, The following is the analysis of each CKSUM:

©Shenzhen Hi-Link Electronic Co.,Ltd ,All rights reserved


4
HEAD _ CKSUM: TF frame header checksum [Starting from the first byte to the previous byte
of the HEAD CKSUM bit]
DATA _ CKSUM: TF data test and [The first byte of DATA to the last byte of the DATA
CKSUM bit]
The method c code for calculating C KSUM is as follows:

1. unsigned char getCksum(unsigned char *data, unsigned char len)


2. {
3. unsigned char ret = 0;
4.
5. for (int i = 0; i < len; i++)
6. ret = ret ^ data[i];
7.
8. ret = ~ret;
9.
10.return ret;
11.}
12.

2. Programming interface
2.1. Encode the TF message
void tinyFramefTx(TF_TYPE type, uint8 *data, TF_LEN len);

Where type is the sending data type, the u int16 type, such as the personnel detection data result
report, the data type is 0x0A10. See 4.2.1.6 for details
Uint8 * Data is the address that sends the data.
Len is the length of the sent data, the u int16 type.

2.2. Decode the TF message


TinyFrameRx tinyFramefRx(void);

After successfully receiving the message, the received data is returned to a variable of the
TinyFrameRx type.

2.3. Example code


If you want to analyze the demo of TF frame data (including C message in Linux environment
and Python language demo) in Keil μVision5 environment, you can directly communicate with the
sales.

©Shenzhen Hi-Link Electronic Co.,Ltd ,All rights reserved


5
Shenzhen Hi-Link Electronic Co., Ltd
Address:17F,Building E, Xinghe WORLD, Minzhi Street, Long Hua district,
Shenzhen 51813
Email:[email protected]
Website:www.hlktech.net

©Shenzhen Hi-Link Electronic Co.,Ltd ,All rights reserved


6

You might also like