exit status 1 expected declaration before '}' token

Hi there, I'm having this error, I don't know why. I tried to check for some weird error, like {}, or a missing ";" but I couldn't find any. I have checked the other post but for the life of me, I can not find it. It does not help that I'm dyslexic. I do have programming experience but in a higher level language like python or java.

It may be something(s) that I'm not seeing.

MitServer:132:1: error: expected declaration before '}' token
}
^
exit status 1
expected declaration before '}' token

#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEClient.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#include <BLEScan.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"

//para el servicio 2
#define SERVICE2_UUID "45ecddcf-c316-488d-8558-3222e5cb9b3c"
#define CHARACTERISTIC2_UUID "4a78b8dd-a43d-46cf-9270-f6b750a717c8"
////////////////////////////////////////Display\\\\\

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for SSD1306 display connected using software SPI (default case):
#define OLED_MOSI 23
#define OLED_CLK 18
#define OLED_DC 4
#define OLED_CS 5
#define OLED_RESET 2

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

/////////////////////////////////////////////////////////\\\\\

int LED_BUILTIN = 2;
bool deviceConnected = false;
int CUTOFF = -60;
int tiemporefresh = 1000;
int rssi = 200;

String valor;
//////////////////////////////////////////////Funciones\\\\

////////////////////////Callbacks////////////////////////////////
class MyCallbacks: public BLECharacteristicCallbacks {
void onWrite(BLECharacteristic *pCharacteristic) {
std::string value = pCharacteristic->getValue();

if (value.length() > 0) {
valor = "";
String Salida = "";
for (int i = 0; i < value.length(); i++) {
// Serial.print(value*); // Presenta value.*
_ valor = valor + value*;_
_
if (i > 0) {_
_
Salida = valor;_
_
}_
_
}_
_ Serial.println("");_
_
Serial.print("valor = ");
_
_
Serial.println(valor); // Presenta valor.
_
_
if (valor == "off") { //esto puede ser moverse adelante por ejemplo
_
digitalWrite(LED_BUILTIN, LOW);

* Serial.println("LED turned on OFF");*
* pCharacteristic->setValue("LED turned on OFF"); // Pone el numero aleatorio*
* }*
* if (valor == "on") {*
* digitalWrite(LED_BUILTIN, HIGH);
_
Serial.println("LED turned on");_
_
pCharacteristic->setValue("LED turned on"); // Pone el numero aleatorio*_
* }*
* if (valor.charAt(0) == 'r') {*
* rssi = Salida.toInt();*
* pCharacteristic->setValue(rssi);*
* }*
* }*
* }*
};
///////////////////////////////////no sabemos con seguridad que hace
//static void my_gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param) {
//
// Serial.print("RSSI status");
// Serial.println(param->read_rssi_cmpl.status);
// Serial.print("RSSI ");
// Serial.println(param->read_rssi_cmpl.rssi);
// Serial.print("Address ");
// Serial.println(BLEAddress(param->read_rssi_cmpl.remote_addr).toString().c_str());
//};
//////////////////////////////SETUP///////////////////////////////////////////
void setup() {
* Serial.begin(115200);*
* pinMode (LED_BUILTIN, OUTPUT);//pin y su salida*
* BLEDevice::init("Hide&Seek");// nombre del dispositivo bl*
_ BLEServer pServer = BLEDevice::createServer(); // Create the BLE Server_
BLEService pService = pServer->createService(SERVICE_UUID);
_ BLECharacteristic pCharacteristic = pService->createCharacteristic(_
CHARACTERISTIC_UUID,

BLECharacteristic::PROPERTY_READ |
BLECharacteristic::PROPERTY_NOTIFY |
BLECharacteristic::PROPERTY_WRITE*

* );*
* // pServer->setCallbacks(new myServerCallback());*
* pCharacteristic->setCallbacks(new MyCallbacks());*
* // BLEDevice::setCustomGapHandler(my_gap_event_handler);
_
pCharacteristic->setValue("Iniciado.");_
_
pCharacteristic->addDescriptor(new BLE2902());_
_
pService->start();_
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL0, ESP_PWR_LVL_P9 );
_ BLEAdvertising pAdvertising = pServer->getAdvertising();_
_
pAdvertising->start();
_
}
/////////////////////////////////LOOP\\\\\\\\\\\\\
void loop() {
* ////NADA*
}

Go through your code and indent and align the braces ({ and }) vertically. You've got more of one than the other. When they're lined up you'll be able to see the problem quickly.

Make sure when you paste your code here you

  1. click on the </> on the forum toolbar, then paste the code between the code tags
  2. In the Arduino IDE you Auto format it by clicking ctrl + t
    That'll help you and everyone read your code and find the error
      if (value.length() > 0) {
        valor = "";
        String Salida = "";
        for (int i = 0; i < value.length(); i++) {
          // Serial.print(value); // Presenta value.


          valor = valor + value;
          if (i > 0) {
            Salida = valor;
         } // neuvo <<<<<<<<<<<<<<<<<<<<
      }
   }