SHARE
TWEET

Untitled

a guest Sep 13th, 2017 84 in 294 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "BLE.h"
  2.  
  3. BLE::BLE() {
  4. }
  5.  
  6. void BLE::init() {
  7.  
  8.         this->ble.init("MyESP32");
  9.         BLEServer *pServer = new BLEServer();
  10.         BLEService *pService = pServer->createService(SERVICE_UUID);
  11.         BLECharacteristic *pCharacteristic = pService->createCharacteristic(
  12.                 CHARACTERISTIC_UUID,
  13.                 BLECharacteristic::PROPERTY_READ |
  14.                 BLECharacteristic::PROPERTY_WRITE
  15.                 );
  16.  
  17.         pCharacteristic->setValue("Hello World says Neil");
  18.         pService->start();
  19.         BLEAdvertising *pAdvertising = pServer->getAdvertising();
  20.         pAdvertising->start();
  21. }
RAW Paste Data
Top