Page 1 of 1

A2dp_Source Help

Posted: Mon Jul 01, 2019 12:59 pm
by MNathan
First of all, I would like to thank the responsible for such an amazing code! you da best!

I know the A2dp_source code is just an example and I got the new updates made yesterday.

I'm here to ask a little help on the code, code works great if the device I wanna connect with is advertising, problem is, sometimes a few devices just saves the BT name of my board on the memory and auto connects with it before it even begins to discover or the device to advertise.

My workaround to this was simple, begin with "Connecting" event instead of Discovery, and give both connect and discovery short periods, like 2 attemps. It works great but I was wondering, is there a way to check if there is something connected on the discovery mode while its discovering?

I'm gonna put here the "Code solution" I "try to implement" ::

Code: Select all

/* set discoverable and connectable mode */
        esp_bt_gap_set_scan_mode(ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE);

        /* start device Connection */
        printf("Checking Device Connection\n");
        s_a2d_state = APP_AV_STATE_CONNECTING;
Connection state instead of discovery right on the start of hdl_stack function.
I reduced the numbers of attempts to two so It can enter on discovery faster.

So in resume: A way to check if any device is connected inside discovery mode!!!!