GATT Client on blecent + AFH

Elivander Pereira
Posts: 5
Joined: Fri Aug 23, 2019 8:02 pm

GATT Client on blecent + AFH

Postby Elivander Pereira » Tue Dec 10, 2019 1:35 pm


Let's start talking about what I'm trying to do. The Bluetooth protocol have a feature called AFH (adaptative frequency hopping) that monitors the quality of each Bluetooth channel and include or exclude them of a channel map for the frequency hopping. I'm trying to reproduce this with a link made with 2 ESP-32, using the host layer of NimBle stack.

Then I connected these two devices, one as "blecent" and one as "bleprph". I also implemented a function of NimBle HCI (the function was ble_hs_hci_read_chan_map(conn_handle, channel_map) from ble_hs_hci.h) to read the channel map.

When I connect blecent to bleprph and I try to read the channel map, I can see only all channels (0-36 excluding 37/38 and 39 that are advertisement channels) as one that means no interference. No matter how much interferece I'm generating with a USRP in this band, no channel changes (from 0 to 36) changes to zero.

If I connect the bleprph to a smartphone, I can se a lot of "zeros" where there are wifi channels beeing used, meaning that AFH is doing its role.

I supposed that when I connect two ESP-32, the controler layer may use PER to decide about channel quality and as there's no data traffic between then, it may be the reason that I can't disable any channel with the interference I'm generating.

So, I started trying to connect blecent to blehr (that simulates a heart rate sensor) to se if it works. BUT, I connect them but I don't know how to make the blecent ask for notifications for the blehr. When I connect it to a smartphone, I ask for notifications and keep seeing it simulating a sensor, with blecent I only receive that "peer doesn't ANS New Alert Notification ....".

Finally my question, what is missing to blecent work as a Gatt client and be able to read the heart rate measurements simulated by blehr example? I changed blehr, then both are already connected.

Or the reading of channel map from AFH will not be possible this way connecting two ESP-32 with NimBle stack?

Thanks and sorry for this giant question!

Who is online

Users browsing this forum: No registered users and 24 guests