Update NimBLE usage

This commit is contained in:
Just Call Me Koko
2024-06-26 18:42:51 -04:00
parent 1f10c73c5e
commit 3ebab15c69
2 changed files with 14 additions and 19 deletions

View File

@@ -54,12 +54,12 @@ jobs:
ref: v2.0.6
path: CustomMicroNMEA
- name: Install ESPAsyncWebServer
uses: actions/checkout@v2
with:
repository: bigbrodude6119/ESPAsyncWebServer
ref: master
path: CustomESPAsyncWebServer
#- name: Install ESPAsyncWebServer
# uses: actions/checkout@v2
# with:
# repository: bigbrodude6119/ESPAsyncWebServer
# ref: master
# path: CustomESPAsyncWebServer
- name: Install TFT_eSPI
uses: actions/checkout@v2
@@ -86,7 +86,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: h2zero/NimBLE-Arduino
ref: 1.4.2
ref: master
path: CustomNimBLE-Arduino
- name: Install Adafruit_NeoPixel
@@ -102,13 +102,6 @@ jobs:
repository: bblanchon/ArduinoJson
ref: v6.18.2
path: CustomArduinoJson
#- name: Install SwitchLib
# uses: actions/checkout@v2
# with:
# repository: justcallmekoko/SwitchLib
# ref: main
# path: CustomSwitchLib
- name: Install LinkedList
uses: actions/checkout@v2

View File

@@ -1928,9 +1928,11 @@ void WiFiScan::executeSwiftpairSpam(EBLEPayloadType type) {
//NimBLEAdvertisementData advertisementData = getSwiftAdvertisementData();
NimBLEAdvertisementData advertisementData = this->GetUniversalAdvertisementData(type);
pAdvertising->setAdvertisementData(advertisementData);
Serial.println("Advertising...");
pAdvertising->start();
delay(10);
pAdvertising->stop();
Serial.println("Advertising stop");
NimBLEDevice::deinit();
#endif
@@ -2362,7 +2364,7 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
#endif
pBLEScan->setAdvertisedDeviceCallbacks(new bluetoothScanAllCallback(), false);
pBLEScan->setScanCallbacks(new bluetoothScanAllCallback(), false);
}
else if ((scan_mode == BT_SCAN_WAR_DRIVE) || (scan_mode == BT_SCAN_WAR_DRIVE_CONT)) {
#ifdef HAS_GPS
@@ -2399,9 +2401,9 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
#endif
if (scan_mode != BT_SCAN_WAR_DRIVE_CONT)
pBLEScan->setAdvertisedDeviceCallbacks(new bluetoothScanAllCallback(), false);
pBLEScan->setScanCallbacks(new bluetoothScanAllCallback(), false);
else
pBLEScan->setAdvertisedDeviceCallbacks(new bluetoothScanAllCallback(), true);
pBLEScan->setScanCallbacks(new bluetoothScanAllCallback(), true);
}
else if (scan_mode == BT_SCAN_SKIMMERS)
{
@@ -2418,13 +2420,13 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
display_obj.tft.setTextColor(TFT_BLACK, TFT_DARKGREY);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
#endif
pBLEScan->setAdvertisedDeviceCallbacks(new bluetoothScanSkimmersCallback(), false);
pBLEScan->setScanCallbacks(new bluetoothScanSkimmersCallback(), false);
}
pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster
pBLEScan->setInterval(97);
pBLEScan->setWindow(37); // less or equal setInterval value
pBLEScan->setMaxResults(0);
pBLEScan->start(0, scanCompleteCB, false);
pBLEScan->start(0, false);
Serial.println("Started BLE Scan");
this->ble_initialized = true;
initTime = millis();