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

cross mob
bt_fw_eng
Level 1
Level 1
5 sign-ins First reply posted First question asked

In the RFCOMM_Serial_Port_Multi-Port example project for a CYW20721 the function hci_spp_handle_command is in the file hci_spp.c

I can't find anywhere in the code, or library headers any clues as to how hci_spp_handle_command is registered to receive commands from from the HCI UART. Is "hci_spp_handle_command" a defacto name that has to be used and that is baked into the Bluetooth stack? Or is the function registered through a const structure somewhere?

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @bt_fw_eng ,

spp_multi_port_proc_rx_cmd (user defined) is the handle used to receive HCI commands over UART from the host. The handle is registered in the configuration structure wiced_transport_cfg_t transport_cfg in spp_multi_port.c. Whenever the SPP group command is received, hci_spp_handle_command() (user defined) is called to process the commands.

Check the following exercise where this is explained clearly.

https://github.com/cypresssemiconductorco/CypressAcademy_BT101_Files/blob/master/PDFs/WBT101-05-Debu...

Regards,
Bragadeesh

View solution in original post

0 Likes
1 Reply