Topic: ESP32S2 devboard no compile error first example
Hi,
First button example, Copy Arduino code from remote xy editor, add led blind, error in compiling.
Follow compiler error, library 3.1.14
In file included from g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXY.h:158,
from C:\Users\bertolet\AppData\Local\Temp\.arduinoIDE-unsaved202526-4864-1d1ds70.yexol\sketch_mar6a\sketch_mar6a.ino:34:
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:19:77: error: expected class-name before ',' token
19 | class CRemoteXYStream_BLEDevice : public CRemoteXYStream, BLEServerCallbacks, BLECharacteristicCallbacks {
| ^
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:19:106: error: expected class-name before '{' token
19 | class CRemoteXYStream_BLEDevice : public CRemoteXYStream, BLEServerCallbacks, BLECharacteristicCallbacks {
| ^
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:24:3: error: 'BLEServer' does not name a type; did you mean 'Server'?
24 | BLEServer *pServer;
| ^~~~~~~~~
| Server
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:25:3: error: 'BLECharacteristic' does not name a type
25 | BLECharacteristic * pRxTxCharacteristic;
| ^~~~~~~~~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:91:18: error: 'BLEServer' has not been declared
91 | void onConnect(BLEServer* pServer) {
| ^~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:100:21: error: 'BLEServer' has not been declared
100 | void onDisconnect(BLEServer* pServer) {
| ^~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:108:17: error: 'BLECharacteristic' has not been declared
108 | void onWrite (BLECharacteristic *pCharacteristic) {
| ^~~~~~~~~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h: In constructor 'CRemoteXYStream_BLEDevice::CRemoteXYStream_BLEDevice(const char*)':
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:56:5: error: 'BLEDevice' has not been declared
56 | BLEDevice::init(_bleDeviceName);
| ^~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:59:5: error: 'pServer' was not declared in this scope; did you mean 'Server'?
59 | pServer = BLEDevice::createServer();
| ^~~~~~~
| Server
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:59:15: error: 'BLEDevice' has not been declared
59 | pServer = BLEDevice::createServer();
| ^~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:63:5: error: 'BLEService' was not declared in this scope
63 | BLEService *pService = pServer->createService(REMOTEXYCOMM_BLEDEVICE__SERVICE_UUID);
| ^~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:63:17: error: 'pService' was not declared in this scope
63 | BLEService *pService = pServer->createService(REMOTEXYCOMM_BLEDEVICE__SERVICE_UUID);
| ^~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:66:5: error: 'pRxTxCharacteristic' was not declared in this scope
66 | pRxTxCharacteristic = pService->createCharacteristic(
| ^~~~~~~~~~~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:68:29: error: 'BLECharacteristic' has not been declared
68 | BLECharacteristic::PROPERTY_READ |
| ^~~~~~~~~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:69:29: error: 'BLECharacteristic' has not been declared
69 | BLECharacteristic::PROPERTY_NOTIFY |
| ^~~~~~~~~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:70:29: error: 'BLECharacteristic' has not been declared
70 | BLECharacteristic::PROPERTY_WRITE_NR
| ^~~~~~~~~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:73:5: error: 'BLE2902' was not declared in this scope
73 | BLE2902 *ble2902 = new BLE2902();
| ^~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:73:14: error: 'ble2902' was not declared in this scope
73 | BLE2902 *ble2902 = new BLE2902();
| ^~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:73:28: error: expected type-specifier before 'BLE2902'
73 | BLE2902 *ble2902 = new BLE2902();
| ^~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h: In member function 'void CRemoteXYStream_BLEDevice::onDisconnect(int*)':
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:105:14: error: request for member 'getAdvertising' in '* pServer', which is of non-class type 'int'
105 | pServer->getAdvertising ()->start ();
| ^~~~~~~~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h: In member function 'void CRemoteXYStream_BLEDevice::onWrite(int*)':
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:111:39: error: request for member 'getValue' in '* pCharacteristic', which is of non-class type 'int'
111 | String rxValue = pCharacteristic->getValue();
| ^~~~~~~~
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h: In member function 'virtual void CRemoteXYStream_BLEDevice::write(uint8_t)':
g:\Il mio Drive\Mio\Arduino\libraries\RemoteXY\src/RemoteXYStream_BLEDevice.h:156:7: error: 'pRxTxCharacteristic' was not declared in this scope
156 | pRxTxCharacteristic->setValue((uint8_t *)sendBuffer, sendBufferCount);
| ^~~~~~~~~~~~~~~~~~~
Follow Arduino code:
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP32CORE_BLE
#include <BLEDevice.h>
// RemoteXY connection settings
#define REMOTEXY_BLUETOOTH_NAME "RemoteXY"
#include <RemoteXY.h>
// RemoteXY GUI configuration
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] = // 29 bytes
{ 255,1,0,0,0,22,0,19,0,0,0,0,31,1,106,200,1,1,1,0,
1,29,36,45,45,0,2,31,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t button_01; // =1 if button pressed, else =0
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_BUTTON_1 18
void setup()
{
RemoteXY_Init ();
pinMode (PIN_BUTTON_1, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_BUTTON_1, (RemoteXY.button_01==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay(), use instead RemoteXY_delay()
}
Any suggestion? thanks
Fabrizio