Datasheet
The individual characteristic values are set via the .set*() functions above, and when all values have been set you call
the .begin() function to add the service to the device's internal GATT registry.
Example
The following bare bones examples show how to setup the device information service with user-configurable strings
for values:
BLEDis(void);
void setModel(const char* model);
void setHardwareRev(const char* hw_rev);
void setSoftwareRev(const char* sw_rev);
void setManufacturer(const char* manufacturer);
err_t begin(void);
#include <bluefruit.h>
BLEDis bledis;
void setup()
{
Serial.begin(115200);
Serial.println("Bluefruit52 DIS Example");
Bluefruit.begin();
Bluefruit.setName("Bluefruit52");
// Configure and Start Device Information Service
bledis.setManufacturer("Adafruit Industries");
bledis.setModel("Bluefruit Feather52");
bledis.begin();
// Set up Advertising Packet
setupAdv();
// Start Advertising
Bluefruit.Advertising.start();
}
void setupAdv(void)
{
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
Bluefruit.Advertising.addTxPower();
// There isn't enough room in the advertising packet for the
// name so we'll place it on the secondary Scan Response packet
Bluefruit.ScanResponse.addName();
}
void loop()
{
}
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 125 of 175