Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
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?
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.