Skip to content

Commit

Permalink
Mitigation for #181 by scanning for 12&13 on Side B with reduced BLE …
Browse files Browse the repository at this point in the history
…scan time
  • Loading branch information
JosephHewitt committed Oct 5, 2024
1 parent 16fe49a commit fdfbad8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion A/A.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2478,7 +2478,7 @@ void primary_scan_loop(void * parameter){
while (true){
disp_wifi_count = wifi_count;
wifi_count = 0;
for(int scan_channel = 1; scan_channel < 14; scan_channel++){
for(int scan_channel = 1; scan_channel < 12; scan_channel++){
yield();
//scanNetworks(bool async, bool show_hidden, bool passive, uint32_t max_ms_per_chan, uint8_t channel)
int n = WiFi.scanNetworks(false,true,false,110,scan_channel);
Expand Down
12 changes: 9 additions & 3 deletions B/B.ino
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ void loop() {
}
}
}
BLEScanResults* foundDevices = pBLEScan->start(2.2, false);
BLEScanResults* foundDevices = pBLEScan->start(1.8, false);
await_serial();
serial_lock = true;
Serial1.print("BLC,");
Expand All @@ -410,8 +410,8 @@ void loop() {
last_temperature = millis();
}

//This side will only scan the primary non-overlapping channels; most scan time is dedicated to Bluetooth here.
for (int y = 0; y < 4; y++){
//This side will only scan a subset of channels defined below; most scan time is dedicated to Bluetooth here.
for (int y = 0; y < 6; y++){
switch(wifi_scan_channel){
case 1:
wifi_scan_channel = 6;
Expand All @@ -420,6 +420,12 @@ void loop() {
wifi_scan_channel = 11;
break;
case 11:
wifi_scan_channel = 12;
break;
case 12:
wifi_scan_channel = 13;
break;
case 13:
wifi_scan_channel = 14;
break;
default:
Expand Down

0 comments on commit fdfbad8

Please sign in to comment.