Hi all,
I started to convert my ESP8266 and Arduino libraries to B4R platform, but encountered some problems.
I used PSPad as text editor to edit my first library, I want suggest all to use PSPad because is a fantastic application and show highlight syntax for any language, custom syntax can be added, and have more tools inside it, eg, to convert colors, to preview an html page and others good tools. I never tried Notepad++ but I think is like PSPad.
I'm started to open on PSPad some B4R libraries, just to know how works, so I've open rEEPROM, rSD, rESP8266 etc...
I tried to convert header and cpp file of my first library, then I used my tool B4Rh2xml UI
https://www.b4x.com/android/forum/t...eate-b4r-xml-file-from-b4r-header-file.80940/
to create a xml file from header file, but always I receive a parse error, now I want to know what is the problem.
I've attached an image with error I receive from parser, note that I edited a cpp file too.
What is wrong on my header file?
This is original header file:
And this is my conversion for B4R (rESP8266FirebaseCloudMessaging.h):
Many thanks to all.
I started to convert my ESP8266 and Arduino libraries to B4R platform, but encountered some problems.
I used PSPad as text editor to edit my first library, I want suggest all to use PSPad because is a fantastic application and show highlight syntax for any language, custom syntax can be added, and have more tools inside it, eg, to convert colors, to preview an html page and others good tools. I never tried Notepad++ but I think is like PSPad.
I'm started to open on PSPad some B4R libraries, just to know how works, so I've open rEEPROM, rSD, rESP8266 etc...
I tried to convert header and cpp file of my first library, then I used my tool B4Rh2xml UI
https://www.b4x.com/android/forum/t...eate-b4r-xml-file-from-b4r-header-file.80940/
to create a xml file from header file, but always I receive a parse error, now I want to know what is the problem.
I've attached an image with error I receive from parser, note that I edited a cpp file too.
What is wrong on my header file?
This is original header file:
B4X:
#ifndef FCM_ESP8266_h
#define FCM_ESP8266_h
#include <ESP8266WiFi.h>
#define DEFAULT_TITLE F("This is default title")
#define DEFAULT_MESSAGE F("Hello from ESP8266!")
//#define FCM_DEBUG // <<<<<<<<---------- UNCOMMENT THIS TO SHOW SERIAL DEBUG. NOTE: USE MORE SRAM
#define FIELD_COUNT 30 // <<<<<<<<---------- INCREASE THIS NUMBER TO USE CUSTOM FIELDS
class FCM_ESP8266
{
private:
String _API_key;
WiFiClient client;
public:
FCM_ESP8266(String API_key);
typedef struct{
String key;
String value;
} keyValuePair;
bool sendMessage(String tokens[], unsigned int tokensLen, String From, String Title, String Message);
bool sendMessage(String tokens[], unsigned int tokensLen);
void resetFields();
keyValuePair field[FIELD_COUNT];
};
#endif
B4X:
#pragma once
#include "B4RDefines.h"
//~dependson: <ESP8266WiFi.h>
#define DEFAULT_TITLE "This is default title"
#define DEFAULT_MESSAGE "Hello from ESP8266!"
//#define FCM_DEBUG // <<<<<<<<---------- UNCOMMENT THIS TO SHOW SERIAL DEBUG. NOTE: USE MORE SRAM
#define FIELD_COUNT 30 // <<<<<<<<---------- INCREASE THIS NUMBER TO USE CUSTOM FIELDS
//~Version: 1.02
namespace B4R {
//~shortname: FirebaseCloudMessaging
class B4RFirebaseCloudMessaging
{
private:
B4RString _API_key;
WiFiClient client;
public:
B4RFirebaseCloudMessaging(B4RString* API_key);
typedef struct{
B4RString key;
B4RString value;
} keyValuePair;
bool sendMessage(B4RString* tokens[], UInt tokensLen, B4RString* From, B4RString* Title, B4RString* Message);
bool sendMessage(B4RString* tokens[], UInt tokensLen);
void resetFields();
keyValuePair field[FIELD_COUNT];
};
}
Many thanks to all.
Attachments
Last edited: