Closed t0m4s closed 4 years ago
About the last 2 printf : as count is post-incremented, it's normal that the second printf is printing random data. The problem isn't there (and that's quite reassuring ;-).
After being copying/pasting very sample codes found on internet, I finally found what was the problem : I was including #include <argtable3/argtable3.h> after "myclass.h" Took my almost 2 days...
@t0m4s Glad that you found the issue, and thanks for sharing this info.
Hi, I don't know if this is the right place to post the message. If it isn't, please redirect me to the correct place.
I'am developping a C++ project on an ESP32. I'd like to use esp_console + argtable3 in it. I'm trying to use argtable in my members functions. To do so, I'm creating callback functions to my members functions with a global pointer. I'm sure my class is going to be instanced only once so I assume it's ok to create callback functions.
The problem is that argtable isn't giving me back the parameters entered by the user. It checks for them successfully (number of args and their type) but the data it gives me back is random. I've tested my code outside of members functions and it works well. But I want to use it inside members functions to access other parts of my object. Here is my code :
The problem seems to be here : In argatable3.c : at the end of function static int arg_int_scanfn(struct arg_int parent, const char argval) :
The first printf gives me back the correct value but the second one gives me back a random value.
Is my approach of using callback member function good ? Any idea of what is my problem and how I could solve it ?
Thanks in advance for your answers.