Going thru the course and starting to work with the BLE part. Code from the class gives me an error msg and looking thru the forum, cannot find this error. I hope that somebody has code I can download to work thru the class.
Beginning of code:
/*
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippe … Server.cpp
Ported to Arduino ESP32 by Evandro Copercini
updates by chegewara
*/
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
// See the following for generating UUIDs:
// https://www.uuidgenerator.net/
#define SERVICE_UUID “Enter_Service_UUID”
#define CHARACTERISTIC_UUID “Enter_Charactersistic_UUID”
void setup() {
Serial.begin(115200);
Serial.println(“Starting BLE work!”);
BLEDevice::init(“My_ESP32”);
BLEServer *pServer = BLEDevice::createServer();
BLEService *pS ervice = pServer->createService(SERVICE_UUID);
BLE_server:23:18: error: expected initializer before ‘ervice’
BLEService *pS ervice = pServer->createService(SERVICE_UUID);
^
Error with above code.
BLE_server:24:40: error: ‘pService’ was not declared in this scope
BLECharacteristic *pCharacteristic = pService->createCharacteristic(
^
exit status 1
expected initializer before ‘ervice’
Hope somebody can help.
thx
Mike