ArduinoBLE - BLE.addService()

Add a BLEService to the set of services the Bluetooth® Low Energy device provides

Syntax

BLE.addService(service)

Parameters

  • service: BLEService to add

Returns

Nothing

Example


BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service



 // begin initialization
  if (!BLE.begin()) {
    Serial.println("starting Bluetooth® Low Energy module failed!");

    while (1);
  }

  // ...

  BLE.addService(ledService);

  // ...