Topic: Cannot compile; error: expected type-specifier before 'CRemoteXYStream
I'm brand new to RemoteXY, I thought I'd try it out with an ESP8266 relay board and an HC-05.
I've set the board to Generic ESP8266 and added RemoteXY library however if I use SOFTWARESERIAL I get the following error, if I use HARDWARESERIAL it compiles fine.
If I set the board to an Arduino board it doesn't compile and presents the same error, which leads me to think it's something with my environment rather than a systemic issue or bug. I'm hoping I could get some suggestions here?
Here's my code, the operational parts (relay on/off) aren't complete;
/*
-- New project --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 3.1.8 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.11.1 or later version;
- for iOS 1.9.1 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__SOFTWARESERIAL
#include <SoftwareSerial.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX D1
#define REMOTEXY_SERIAL_TX D2
#define REMOTEXY_SERIAL_SPEED 9600
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] = // 78 bytes
{ 255,4,0,0,0,71,0,16,31,1,2,0,33,9,22,11,2,26,31,31,
79,78,0,79,70,70,0,2,0,33,23,22,11,2,26,31,31,79,78,0,
79,70,70,0,2,0,33,36,22,11,2,26,31,31,79,78,0,79,70,70,
0,2,0,33,50,22,11,2,26,31,31,79,78,0,79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t switch_1; // =1 if switch ON and =0 if OFF
uint8_t switch_2; // =1 if switch ON and =0 if OFF
uint8_t switch_3; // =1 if switch ON and =0 if OFF
uint8_t switch_4; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define RELAY_1 13
#define RELAY_2 14
#define RELAY_3 15
#define RELAY_4 16
void setup()
{
RemoteXY_Init ();
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(RELAY_1, (RemoteXY.switch_1==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}
Here's the error;
In file included from C:\Users\mswin\AppData\Local\Temp\Temp1_project-2023-04-26-09-13-42.zip\project\project.ino:25:
C:\Users\mswin\AppData\Local\Temp\Temp1_project-2023-04-26-09-13-42.zip\project\project.ino: In function 'void setup()':
c:\Users\mswin\Documents\Arduino\libraries\RemoteXY\src/RemoteXY.h:166:117: error: expected type-specifier before 'CRemoteXYStream_SoftSerial'
166 | #define RemoteXY_Init() remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &RemoteXY, REMOTEXY_ACCESS_PASSWORD, new CRemoteXYStream_SoftSerial (REMOTEXY_SERIAL_RX, REMOTEXY_SERIAL_TX, REMOTEXY_SERIAL_SPEED))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\mswin\AppData\Local\Temp\Temp1_project-2023-04-26-09-13-42.zip\project\project.ino:67:3: note: in expansion of macro 'RemoteXY_Init'
67 |
| ^
exit status 1
Compilation error: exit status 1