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
  • Thank you very much for your reply.

    I have a commercial device, Mantis X8, which when switched on is only detected from its own application, it does not appear in the operating system list and does not need to be paired. I am looking for a similar operation to this one.

    At first I thought it would use broadcast advertising messages to send data, and receive data through the scans, but I would like to think that it could be a better direct communication.


    Thank you.

Children
  • 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.

  • Thanks for the answer and the example, I'm looking into it.

    Looking for more information, I find this extended advertising mode that fits what I want to do: BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED

    Could we confirm that it is possible to use this configuration, does anyone have an example to test it?

    Thank you very much.

  • 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