ArduinoBLE - addService()

Add a BLEService to the set of services the BLE device provides

Syntax

BLE.addService(service)

Parameters

service: BLEService to add

Returns

Nothing

Example


BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // BLE LED Service



 // begin initialization
  if (!BLE.begin()) {
    Serial.println("starting BLE failed!");

    while (1);
  }

  // ...

  BLE.addService(ledService);

  // ...