Comments (3)
Hi, I too have projects with some cpp and h files
Works with cpp class or not.
To do RemoteDebug in each cpp, please do this:
----- INO ----
void setup() {
// Your code .....
test_SetRemoteDebug(Debug);
// Or if it is a class
test.setRemoteDebug(Debug);
}
----- CPP (not class) ----
#include "RemoteDebug.h"
static RemoteDebug *_Debug; // static -> private - for only this file
void test_SetRemoteDebug(RemoteDebug *Debug) {
_Debug = Debug;
}
void test1() {
uint8_t a = 2 + 2;
// Debug
if(_Debug->isActive(_Debug->VERBOSE)) {
_Debug->printf("test1: a-> %d\n", a);
}
}
Its clear now ?
Regards
Joao
from remotedebug.
Thank you for the reply, I very much appreciate the help as I use your library in another project and really like it, but still not having much luck in this case - I'm sure it's something I am doing based on my lack of familiarity with the ++ side of C, I am working on a fork so am stuck with this structure. Here is what I tried. Taking your approach I added the line
test_SetRemoteDebug(Debug);
to the setup loop in the ino file, and added the other pieces to one of the .cpp files in my project (tweaked it with a single debug line). I didn't add any include or object instantiation in the ino file (since you didn't mention this) When compiling it errors on the ino file saying 'Debug' was not declared in this scope. I thought maybe I also needed to do the object creation in the ino so then tried adding
RemoteDebug Debug;
So then upon compile the error changed to
ogMainArduino:42: error: 'test_SetRemoteDebug' was not declared in this scope
But still no luck - tried a few other things but it doesn't like any of them.
If it makes it easier to see -the project link is below. For my testing/attempt I was trying to add a debug line to espconnect.cpp (and once I had a working example extend that to main.cpp and opengarage.cpp)
https://github.com/lawrence-jeff/OpenGarage-Firmware/tree/master/OpenGarage
Any pointers?
from remotedebug.
I'm struggling with the same thing.
INO:
RemoteDebug Debug;
HanReader hanReader;
setup() {
Debug.begin("AMS2MQTT", Debug.INFO);
hanReader.setRemoteDebug(Debug);
}
HanReader.cpp:
#include <RemoteDebug.h>
#include "HanReader.h"
static RemoteDebug *_Debug; // static -> private - for only this file
HanReader::HanReader()
{
}
void HanReader::setRemoteDebug(RemoteDebug *Debug) {
_Debug = Debug;
}
HanReader.h:
class HanReader
{
public:
void setRemoteDebug(RemoteDebug *Debug);
}
Error when compiling:
AmsToMqttBridge.ino: In function 'void setup()':
AmsToMqttBridge:75: error: no matching function for call to 'HanReader::setRemoteDebug(RemoteDebug&)'
hanReader.setRemoteDebug(Debug);
^
AmsToMqttBridge.ino:75:35: note: candidate is:
In file included from AmsToMqttBridge.ino:13:0:
libraries\HanReader/HanReader.h:21:7: note: void HanReader::setRemoteDebug(RemoteDebug*)
void setRemoteDebug(RemoteDebug *Debug);
^
libraries\HanReader/HanReader.h:21:7: note: no known conversion for argument 1 from 'RemoteDebug' to 'RemoteDebug*'
exit status 1
no matching function for call to 'HanReader::setRemoteDebug(RemoteDebug&)'
It's probably just a silly error, but I'm unable to figure it out... :(
from remotedebug.
Related Issues (20)
- Feature Serial full stream control HOT 2
- Allow bracket pattern customization HOT 1
- Make the functionality of this library possible for Arduino MKR WiFi 1010 / Nano 33 IoT boards if possible
- How to disable debugs for production release
- http://joaolopesf.net/remotedebugapp HOT 1
- Debug during setup
- The connection will be lost when I use external interupts or use adc
- Debug through MQTT
- Websockets library error and Ethernet access HOT 2
- arduinoWebSockets is in the Arduino Library manager and platform IO :)
- Support samd / P1AM?
- error: 'class BearSSL::WiFiClientSecure' has no member named 'verify' HOT 10
- [ESP32] "hwcrypto/sha.h" has been moved HOT 1
- RemoteDebug interferes with others shockets libraries
- Error en la salida por el puerto serie, incluye secuencia erronea
- Build fails ... "esp_is_8285"
- SHA resource no longer correct for ESP32 HOT 4
- error: 'ets_vsnprintf' was not declared in this scope, suggested alternative: 'ets_printf' but ESP32 chashes
- The opening bracket is missing when you switch off log level display
- Drop-in replacement for this library HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remotedebug.