Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send HCI command to bluetooth controller ? #1240

Closed
phb98 opened this issue Feb 10, 2023 · 3 comments
Closed

How to send HCI command to bluetooth controller ? #1240

phb98 opened this issue Feb 10, 2023 · 3 comments
Assignees

Comments

@phb98
Copy link

phb98 commented Feb 10, 2023

Hello. AFAIK the cyw firmware already support bluetooth, only the software on host side does not support, so at this moment how can i send and receive raw HCI data to bluetooth controller ?
The bluedroid bluetooth stack on ESP32 is already mature, so i can port the stack from esp-idf

@peterharperuk
Copy link
Contributor

I think the answer is, wait not very long and you can look at the code yourself. Duplicate of #1164

@peterharperuk peterharperuk self-assigned this Feb 10, 2023
@peterharperuk
Copy link
Contributor

You should be able to update to the latest version of the SDK v1.5 now.

To send a HCI command call cyw43_bluetooth_hci_write. It requires a 4-byte header. The first 3 bytes of this header are filled in for you. The final byte in the header is the hci packet type. The buffer must be 4-byte aligned. See hci_transport_cyw43_send_packet for an example of how it's used with BTstack.

When there's some BT work to be done cyw43_bluetooth_hci_process gets called by the driver. cyw43_bluetooth_hci_read reads hci data. Again it has a 4 byte header of which probably only the final byte giving the hci packet type will be of interest, see hci_transport_cyw43_process for an example.

@kilograham
Copy link
Contributor

not really an issue, so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants