Hello every body,
excuse me for my poor english
I post a library for set or read your global variable with command text ( like AT command)
my project is into github server :
Hello every body,
excuse me for my poor english
I post a library for set or read your global variable with command text ( like AT command)
my project is into github server :
#ifdef ARDUI_DEBUG_X86
using namespace std;
#endif
Bad idea. You should never drag the entire namespace in. Put in "using std::xxxx" statements only for those symbols that you actually use.
Why do your classes not have destructors? Yes, default destructors are generated, but they don't manage the dynamically allocated data of your class. So, potential memory leaks exist.
ArduiParamItem::ArduiParamItem(char *str , CB_ARDUI_COMMAND cb)
{
strcpy(strCmd,str);
cmd = cb;
strCmd is 6 elements long. What is
ArduiParamItem item("SomeNiceLongName", NULL);
going to do? Overflow your buffer, and mess up something else, that's what. Some error checking is in order.
Some explanation about how this functionality should be used would be useful.
thanks you for your comments
I wanted my library uses minimal memory, and I doesn’t use new and delete method, so I decided that the string of command had a maximum size of 5.
I think add a control in ArduiParamItem constructor to avoid a buffer overflow
the ArduiParamItem items are global variables. and this create a link with a call back and string command
In my project repository, I add a example project :