Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Bluetooth communication without pairing, connectable, non-scannable and non-direct advertising.

Hello everyone, a pleasure and very grateful to be able to write in this forum.

I am trying to program a Nordic BLE device so that it does not appear in the pairing list of a mobile operating system, but I can connect to it.

I am trying to configure the device as connectable, not scannable and with no direct advertising. I am not trying an offline broadcast communication, I want to connect to the device once I capture its MAC with the first advertisment message received.

I have several doubts because I'm not succeeding, and I think I have some concept wrong, but I can't solve it with the documentation:

- Is it possible to make a connectable, non-scannable, non-direct advertisement communication with Nordic's nrf5 SDK? I can't find the possibility of non-scannable and non-direct advertising.

- How can I configure advertisment and disable scanning, so that I can only connect knowing the MAC address?


I tried a small code on an ESP32 that worked like this, I attached it, but I don't see any possibility to transfer the method to Nordic SDK.

Thank you all for your help.

#include <BLEDevice.h> // Include BLEDevice library
#include <BLEUtils.h> // Include BLEUtils library
// #include <BLEServer.h> // Include BLEServer library if you need the server part


std::string advDataString = /* Length */ "\x1E"
/* Flags */ "\x02\x01\x1A"
/* Manufacturer info */ "\x1A\xFF"
/* Custom data */ "HOLA NTC";


void setup() {
BLEDevice::init("AZUD-TEST"); // Initialize BLE with a given name
// BLEServer *pServer = BLEDevice::createServer(); // Create a BLE server (if you need to handle connections or services)
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); // Create a BLE advertising object
BLEAdvertisementData advertisementData; // Create a BLEAdvertisementData object
advertisementData.setManufacturerData(advDataString); // Set the advertisement data
pAdvertising->setAdvertisementData(advertisementData); // Apply the advertising data to the advertising object
pAdvertising->start(); // Start advertising
}


void loop() {}

Parents Reply
  • Hi Adrian,

    Usually the bluetooth setting list only show device which has some special/common UUID in the advertising packet (for example HID, audio etc) or device already paird with the phone. 
    If your device doesn't advertise those UUID, it will not show up in the list. Have you tried for example peripheral_uart example  ? 

    Note that the device will still show up in the BLE scanner app, for example nRF Connect app on mobile.

Children
Related