Skip to content

Commit 40db200

Browse files
committed
Remove service start call from examples/stream
1 parent 41acb1a commit 40db200

7 files changed

Lines changed: 2 additions & 20 deletions

File tree

examples/Bluetooth_5/NimBLE_extended_server/NimBLE_extended_server.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ void setup() {
9898

9999
pCharacteristic->setValue("Hello World");
100100

101-
/** Start the service */
102-
pService->start();
103-
104101
/**
105102
* Create an extended advertisement with the instance ID 0 and set the PHY's.
106103
* Multiple instances can be added as long as the instance ID is incremented.

examples/Bluetooth_5/NimBLE_multi_advertiser/NimBLE_multi_advertiser.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ void setup() {
116116

117117
pCharacteristic->setValue("Hello World");
118118

119-
/** Start the service */
120-
pService->start();
121-
122119
/** Create our multi advertising instances */
123120

124121
/** extended scannable instance advertising on coded and 1m PHY's. */

examples/L2CAP/L2CAP_Server/L2CAP_Server.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ void setup() {
7070
auto service = server->createService(SERVICE_UUID);
7171
auto characteristic = service->createCharacteristic(CHARACTERISTIC_UUID, NIMBLE_PROPERTY::READ);
7272
characteristic->setValue(L2CAP_CHANNEL);
73-
service->start();
7473

7574
auto advertising = BLEDevice::getAdvertising();
7675
advertising->addServiceUUID(SERVICE_UUID);

examples/NimBLE_Secure_Server/NimBLE_Secure_Server.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ void setup() {
2929
pService->createCharacteristic("1235",
3030
NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::READ_ENC | NIMBLE_PROPERTY::READ_AUTHEN);
3131

32-
pService->start();
3332
pNonSecureCharacteristic->setValue("Hello Non Secure BLE");
3433
pSecureCharacteristic->setValue("Hello Secure BLE");
3534

examples/NimBLE_Server/NimBLE_Server.ino

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,6 @@ void setup(void) {
186186
pC01Ddsc->setValue("Send it back!");
187187
pC01Ddsc->setCallbacks(&dscCallbacks);
188188

189-
/** Start the services when finished creating all Characteristics and Descriptors */
190-
pDeadService->start();
191-
pBaadService->start();
192-
193189
/** Create an advertising instance and add the services to the advertised data */
194190
NimBLEAdvertising* pAdvertising = NimBLEDevice::getAdvertising();
195191
pAdvertising->setName("NimBLE-Server");

examples/NimBLE_Server_Whitelist/NimBLE_Server_Whitelist.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ void setup() {
5555
pCharacteristic =
5656
pService->createCharacteristic(CHARACTERISTIC_UUID,
5757
NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::NOTIFY);
58-
pService->start();
5958

6059
NimBLEAdvertising* pAdvertising = NimBLEDevice::getAdvertising();
6160
pAdvertising->addServiceUUID(SERVICE_UUID);

src/NimBLEStream.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,8 @@ bool NimBLEStreamServer::begin(
607607
if (!pSvc) {
608608
return false;
609609
}
610+
611+
m_deleteSvcOnEnd = true; // mark service for deletion on end since we created it here
610612

611613
// Create characteristic with notify + write properties for bidirectional stream
612614
uint32_t props = 0;
@@ -630,13 +632,6 @@ bool NimBLEStreamServer::begin(
630632
goto error;
631633
}
632634

633-
m_deleteSvcOnEnd = true; // mark service for deletion on end since we created it here
634-
635-
if (!pSvc->start()) {
636-
NIMBLE_LOGE(LOG_TAG, "Failed to start service");
637-
goto error;
638-
}
639-
640635
if (!begin(pChr, txBufSize, rxBufSize)) {
641636
NIMBLE_LOGE(LOG_TAG, "Failed to initialize stream with characteristic");
642637
goto error;

0 commit comments

Comments
 (0)