当前位置:网站首页>[cyw20189] VII. Detailed explanation of HCI command format

[cyw20189] VII. Detailed explanation of HCI command format

2022-06-22 01:18:00 White embedded

1. Preface

In this paper, MCU adopt HCI Command control CYW20189 Command format for . Reference resources HCI UART Control Protocol.

Sending HCI Special attention should be paid to the format of the command , When CYW20819 Received command ,BOOT The code will first check the received command , If it does not conform to the defined format , Will not go APP The program reports relevant events .

2. Header

The command contains a header format , as follows :
 Insert picture description here
It can be seen that , One HCI command , There are at least 5 Bytes .

3. Groups

Group Field in the third byte , The values and meanings are as follows :
 Insert picture description here
 Insert picture description here

4. Command

Command Field in the second byte , Because there are too many types , Here and there LE Command Medium Scan give an example :
 Insert picture description here
If we need to send Scan Enable How should I combine the formats with the commands of :

// 1 byte | 1 byte | 1 byte | 2bytes | N bytes
// Packet type | command | group | length | data

0x19 0x01 0x01 0x01 0x00 0x01

5. Event

Event The format of is and Command Allied , At least the field position is the same , The difference is Command finger MCU Send to CYW20819, and Event In the opposite direction .
 Insert picture description here

When MCU send out Scan Enable when ,CYW20819 The results will be reported :

// 1 byte | 1 byte | 1 byte | 2bytes | N bytes
// Packet type | event | group | length | data

0x19 0x03 0x01 0x01 0x00 0x01

6. At the end

Special attention required , If the format is wrong ,CYW20819 Of BOOT It filters out the data , Will give you a kind of UART The illusion of abnormal communication .

原网站

版权声明
本文为[White embedded]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220018543166.html