You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NimBLEScan *pBLEScan;
class MyAdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
{
void onResult(NimBLEAdvertisedDevice *advertisedDevice)
{
// // local variables from bluetooth scan
uint8_t blueRSSI = (uint8_t)advertisedDevice->getRSSI();
uint8_t blueMAC_0 = advertisedDevice->getAddress().getNative()[5];
uint8_t blueMAC_1 = advertisedDevice->getAddress().getNative()[4];
uint8_t blueMAC_2 = advertisedDevice->getAddress().getNative()[3];
uint8_t blueMAC_3 = advertisedDevice->getAddress().getNative()[2];
uint8_t blueMAC_4 = advertisedDevice->getAddress().getNative()[1];
uint8_t blueMAC_5 = advertisedDevice->getAddress().getNative()[0];
// MAC will be in the correct order as we went in reverse.
Serial.printf("%X:%X:%X:%X:%X:%X\n", blueMAC_0, blueMAC_1, blueMAC_2, blueMAC_3, blueMAC_4, blueMAC_5);
}
}
The text was updated successfully, but these errors were encountered:
This is the way it is represented by the NimBLE stack, thus it is the "native" address. Unfortunately this does cause some confusion for users occasionally.
Not sure if this intentional.
Example Code:
The text was updated successfully, but these errors were encountered: