raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.25k stars 838 forks source link

Bluetooth LE connectable unidirected advertisements' long intervals unreliable #1674

Open matsobdev opened 3 months ago

matsobdev commented 3 months ago

Values greater than approx. 100 ms are unreliable for connectable unidirected advertisements, ex. 150 ms equals more likely to 800 ms, 1280 ms - 6500 ms (with high variations). Non-connectable unidirected advertisements' intervals are reliable. BTstack it is not the root of the problem. It is the same with or without it - just HCI commands written by cyw43 driver. To reproduce, just use some BTstack example, like hog_mouse_demo.c:

// setup advertisements
uint16_t adv_int_min = 0x0030;
uint16_t adv_int_max = 0x0030;
uint8_t adv_type = 0;

adv_int_min and adv_int_max are values of intervals in number of time slots (0,625 ms). Min value is 32 (0x20), max 16384 (0x4000). adv_type of 3 will switch it to non-connectable unidirected. It seems to be more likely firmware or CYW43439 ROM for Bluetooth.