CYBT-343026-EVAL: Modify "hci_audio_gateway" demo to make the module discoverable and connectable without ClientControl.exe app?

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

cross mob
Anonymous
Not applicable

Greetings,

So far, the only way I've managed to send data and commands to the module from an external host via SPP has been by using the "hci_audio_gateway" demo and the ClientControl.exe app.

After having downloaded the Make Target to the board, I need to open the serial port at a given baudrate from the ClientControl so that the module is set to discoverable and connectable. After that, I am able to connect an external interface to the GND and RXD pins of J1 and send commands.

What do I have to do in order to enable the discoverability and the connectability of the module at the moment it gets turned on (like in the spp.c snip)?

It would also be helpful to know which commands and events of the HCI_CONTROL_GROUP_DEVICE group must take part before the enabling the transmission of data via HCI_CONTROL_GROUP_SPP Data commands so that I no longer have the need for the ClientControl app.

Thank you in advance.

Best regards.

0 Likes
1 Solution
Anonymous
Not applicable

You need to call the below APIs to make the device discoverable and connectable:

wiced_bt_dev_set_discoverability()

wiced_bt_dev_set_discoverability()

The hci_audio_gateway example is intended for use with an external host, which is why the above APIs are not called automatically. When you use ClientControl, the ClientControl sends WICED HCI commands to make the device discoverable and connectable.

On the other hand, the spp example doesn't require and external host and the APIs are called directly without waiting for any commands.

View solution in original post

4 Replies
Anonymous
Not applicable

You need to call the below APIs to make the device discoverable and connectable:

wiced_bt_dev_set_discoverability()

wiced_bt_dev_set_discoverability()

The hci_audio_gateway example is intended for use with an external host, which is why the above APIs are not called automatically. When you use ClientControl, the ClientControl sends WICED HCI commands to make the device discoverable and connectable.

On the other hand, the spp example doesn't require and external host and the APIs are called directly without waiting for any commands.

Anonymous
Not applicable

Yes, I have already done that and the module is discoverable and pairable.

In fact, after downloading the new version of WICED Studio (6.1) and creating a new application with the Bluetooth Designer feature I've seen that this configuration is set by default.

However, although I can find the module and pair it with my phone, I can't seem to be able to stablish a serial communication.

Which files and/or functions should I add to my project in order to be able to connect to the module?

I've already initialized the rfcomm and created the buffer pool. I also included the hci_control_spp_startup() function in the app initialization.

I don't know what's missing. Any suggestion would be appreciated.

Thank you again.

Regards.

EDIT:

The reason why I could find but not connect to the module from my phone was that the sdp_database[] of the app generated by the Bluetooth Designer was empty.

After having copied the database of the hci_audio_gateway demo the module could be found and connected just fine.

Now I'm facing other problems ...

What I do after connecting to the module is to send a 'HCI_CONTROL_SPP_COMMAND_DATA' command to the module at the same baudrate configured in my project via a UART debugger connected to the J1 of the evaluation board. However, after doing so the module does not send anything via bluetooth.

I'd like to make clear that the command I'm using works when I bypass the communications of the 'hci_audio_gateway' demo, and that I receive a '5' in my phone whenever I execute the program that sends this command to the module.

Also, my project contains the following code inside the 'hci_control_process_rx_cmd' function:

  case HCI_CONTROL_GROUP_DEVICE:

  hci_control_device_handle_command( opcode, p_data, payload_length );

  break;

But yet again, something seems to be missing.

Any ideas about why does the module not send anything after receiving the command?

Thank you.

Regards.

0 Likes
Anonymous
Not applicable

Which API are you using to send the data over RFCOMM?

0 Likes

HCI_CONTROL_SPP_COMMAND_DATA is handled under HCI_CONTROL_GROUP_SPP by hci_control_spp_handle_command, not under HCI_CONTROL_GROUP_DEVICE.

0 Likes