Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Studio Bluetooth Forum Discussions

YaTr_3516311
Level 5
Level 5
25 sign-ins First solution authored 100 replies posted

Hi,

I check WICED HCI Control Protocol Definition document. And it refer below information.

pastedImage_0.png

1. Packet Type is always a fixed data which is 0x19. Right?

2. How to distinguish command/event code?  0 for command, 1 for event code? Any related document?

3. Group Code means Operating code in the document? I think it should be two byte here. One is Group value and the other is Operating code. Then device can distinguish the different command. But I don't see both in above 5 bytes head.

4. How to define LE Scan command?

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

                    |        |         |

                    |    Operating code

            Group value       |

                                       len?

5. How to calculate len? All the packeted data len? Or just content len(0x01 0x00)?

6. Any detailed document to descripbe all of these?

0 Likes
1 Solution
Owen_Zhang123
Moderator
Moderator
Moderator
500 solutions authored 250 sign-ins 1000 replies posted

1. Yes, packet type is fixed as 0x19.

2. Why do you need to distinguish the command and event? Command is sent from the host MCU to the BT device. Event is sent from BT device to the host MCU. They have different directions.

3. No. Group code means group value in table 3-1. Operating code corresponds to the command/event code for each command/event in the head. They are both one byte.

4. The LE Scan command is defined as follows:

19 01 01 02 00 01 01

19:          fixed header

01:          command code for LE Scan

01:          group code for HCI_CONTROL_GROUP_LE

02 00:     packet length 2 bytes

01:          scan parameter for start device-discovery scanning

01:          scan parameter for filter duplicate advertisements

5. Length is just for the content.

6. The WICED HCI Control Protocol document doesn't list all the group code. You may refer to hci_control_api.h for all the group, command and event code.

View solution in original post

0 Likes
2 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
500 solutions authored 250 sign-ins 1000 replies posted

1. Yes, packet type is fixed as 0x19.

2. Why do you need to distinguish the command and event? Command is sent from the host MCU to the BT device. Event is sent from BT device to the host MCU. They have different directions.

3. No. Group code means group value in table 3-1. Operating code corresponds to the command/event code for each command/event in the head. They are both one byte.

4. The LE Scan command is defined as follows:

19 01 01 02 00 01 01

19:          fixed header

01:          command code for LE Scan

01:          group code for HCI_CONTROL_GROUP_LE

02 00:     packet length 2 bytes

01:          scan parameter for start device-discovery scanning

01:          scan parameter for filter duplicate advertisements

5. Length is just for the content.

6. The WICED HCI Control Protocol document doesn't list all the group code. You may refer to hci_control_api.h for all the group, command and event code.

0 Likes

Understand completely. Thank you for your clear explanations.

0 Likes