FInding RSSI of a specific UUID ( BLE Device ) with arduino ide

Currently i am using below code to check if any ble device is present around.

#include <BLEAdvertisedDevice.h>
#include <BLEDevice.h>
#include <BLEScan.h>

const int PIN = 2;
const int CUTOFF = -60;

void setup() {
  pinMode(PIN, OUTPUT);
  BLEDevice::init("");
}

void loop() {
  BLEScan *scan = BLEDevice::getScan();
  scan->setActiveScan(true);
  BLEScanResults results = scan->start(1);
  int best = CUTOFF;
  for (int i = 0; i < results.getCount(); i++) {
    BLEAdvertisedDevice device = results.getDevice(i);
    int rssi = device.getRSSI();
    if (rssi > best) {
      best = rssi;
    }
  }
  digitalWrite(PIN, best > CUTOFF ? HIGH : LOW);
}

I would like to check rssi of a specific uuid. Is it possible.

I am using esp-Wroom-32 board

Source: Windows Questions C++

LEAVE A COMMENT