Skip to content

Commit

Permalink
Initialize pAdvertising after NimBLEDevice::init() (#545)
Browse files Browse the repository at this point in the history
Initializing the pAdvertising variable from NimBLEDevice::init while defining it as a globally results in the name getting truncated.
  • Loading branch information
ankgt committed May 19, 2023
1 parent 90ab225 commit bb8b670
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"

static NimBLEUUID dataUuid(SERVICE_UUID);
static NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
static NimBLEAdvertising *pAdvertising = nullptr;
static uint32_t count = 0;

void setup() {
Serial.begin(115200);
Serial.println("Starting BLE work!");

NimBLEDevice::init("svc data");
pAdvertising = NimBLEDevice::getAdvertising();
}

void loop() {
Expand Down

0 comments on commit bb8b670

Please sign in to comment.