ble.setAdvertName()

Description

Sets the advertised name of the device. This is what is displayed when scanning for Bluetooth devices on a laptop or cell phone.

Syntax

ble.setAdvertName(advertName); // char array or string literal
ble.setAdvertName(&advertName); // String object

Parameters

advertName: Either a char array or a pointer to a String object.

Returns

Status code

Example (string literal)

#include <BLE.h>

void setup() {
  ble.begin();
  ble.setAdvertName("Energia BLE");
  ble.startAdvert();
}

Example (char array)

#include <BLE.h>
char advertName[] = "Energia BLE";
void setup() {
  ble.begin();
  ble.setAdvertName(advertName);
  ble.startAdvert();
}

Example (String object)

#include <BLE.h>
String advertName = String("Energia BLE");
void setup() {
  ble.begin();
  ble.setAdvertName(advertName);
  ble.startAdvert();
}

Reference Home || BLE Library