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 Children
  • Hi Adrian, 
    Could you explain why you think BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED matches with your need ? 

    As I said, even non-scannable will still show up in the list if you have the correct UUID in the advertising packet (HID device for example). 
    And for normal advertising, if you want non-scannable, simply don't add scan response packet to the advertising. 

Related