Closed rodneygmorgan closed 1 month ago
The device may not be advertising it's name so there is no data.
I based the server code off the new user guide and included that code in my request for help. The documentation indicates the value specified in the init() command is used as the device name. Is there a different place/method I should use to supply an "advertised" name? Thanks for the quick reply.
On Wed, Jun 28, 2023 at 9:44 PM h2zero @.***> wrote:
The device may not be advertising it's name so there is no data.
— Reply to this email directly, view it on GitHub https://github.com/h2zero/NimBLE-Arduino/issues/559#issuecomment-1612390069, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOIJVJMLZHMOQY5FRRE7W3XNT227ANCNFSM6AAAAAAZXRU4HQ . You are receiving this because you authored the thread.Message ID: @.***>
Yes you need to set the name in the advertisement, the device name in init only sets the name value for the characteristic.
What am I missing or doing wrong?
--- More details at https://bit.ly/pio-monitor-filters --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H Found 8 devices Connected to Length of getName() : 0 Found our UUID : 4fafc201-1fb5-459e-8fcc-c5c9c331914b
BLE server code=========
include
include "NimBLEDevice.h"
NimBLEServer *pServer;
// void setup() void setup(void) { Serial.begin(115200); Serial.println("Starting NimBLE Server");
}
void loop() { delay(2000); Serial.print("."); }
BLE Client code=================
include "NimBLEDevice.h"
include
void setup() { char foo[48]; Serial.begin(115200); Serial.println("Starting NimBLE Client");
NimBLEDevice::init("");
NimBLEScan *pScan = NimBLEDevice::getScan(); NimBLEScanResults results = pScan->start(10);
NimBLEUUID serviceUuid("4fafc201-1fb5-459e-8fcc-c5c9c331914b");
Serial.printf("Found %i devices\n",results.getCount()); for(int i = 0; i < results.getCount(); i++) { NimBLEAdvertisedDevice device = results.getDevice(i);
} }
void loop() { // put your main code here, to run repeatedly: }