Git Product home page Git Product logo

arduino-serialcommand's People

Contributors

gandy92 avatar kroimon avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-serialcommand's Issues

Bug Issue or me is not good use sCmd.next () . ??

Hello,

Thank you for your project is nice as a project. I noticed a problem and I would like to know if it would come from a bug in your library.

So, I will try to explain the problem!

I have several functions that find calling by the sCmD menu and in two function works with a new menu that expects an argument.

As with your example. =

arg = sCmd.next ();
if (arg! = NULL) {
aNumber = atoi (arg);

If this function is last in my code it works fine.

On the other hand, as to explain, I have two function of this type ... So either one or the other does not work. By reversing the order, one works and the other does not work anymore. This translates as if it is not executing the code and returning the echo bits of the other function. It's really strange because suddenly, I can not use two function that uses sCmd.next () ... Do you think I have to rename the variables "aNumber" and "atoi" every time I use it in my functions which are calling by the menu?

Waiting for your help
Thank you in advance,

Félix

Use of realloc may cause data corruption

I've been tracing a problem with the command strings frequently being corrupted after using addCommand several times. I believe that the following line in SerialCommand.cpp is a bug:

   commandList = (SerialCommandCallback *) realloc(commandList, (commandCount + 1) * sizeof(SerialCommandCallback));

The C++ reference on realloc states the following:

The content of the memory block is preserved up to the lesser of the new and old sizes, even if the block is moved to a new location. If the new size is larger, the value of the newly allocated portion is indeterminate.

A simple but inelegant fix would be to hard-code the size of commandList in the header file and limit the maximum number of commands.

Perhaps a more flexible dynamic allocation approach could follow from a linked-list implementation.

Nothing happens

I'm not sure if I'm being stupid but I can't get this to work.

I download the library, and install it as normal. I load up the example sketch and it compiles fine, but when I test it out using an Uno R3, nothing happens when I send the commands in the example sketch.

I've checked the baud rates and all the obvious stuff, so I'm guessing it's something to do with Arduino 1.0.3, which is the latest version that I'm using. Anyone else having the problem?

[LICENSE] Is this project GPLv3, or LGPLv2.1?

The original https://github.com/scogswell/ArduinoSerialCommand/ is licensed under GNU LGPLv2.1, though it's not very prominent. (I have submitted a Pull Request to fix this...)

The LGPLv2.1 requires that modifications be distributed under the same terms (§2(c) of the GNU Lesser General Public License, version 2.1)

The GPLv3 is actually a lot more restrictive, so I (and I am not a lawyer) do not know if it's compatible. However, I do know it's also completely legal for scogswell to license the library to you under GPLv3 anyway.

As someone who has a fork of this repo, I'm merely requesting this clarification for the sake of clarity, so I can add the appropriate LICENSE file to my own repository.

Speaking of LICENSE files, adding one to the root of your repository will allow GitHub to prominently display the license of the project along the top. You can add it with just a few clicks by going to https://choosealicense.com/licenses/

Thank you!

Use parser from other class?

Hi!

I'm trying to use SerialCommand from inside another class (library).
But whenever I try to add a command I get the following compiler error:
addCommand(const char [10], )'

Any idea of how I can get around this error?

BR,
Martin

Calling commands from serial multiple times

Hi kroimon,

Thank you for putting together a nice library. However I am having issues calling a command from serial multiple times. My command is Commands.addCommand("SET_ID", Command_SetId_Callback); and my command callback is as below:

void Command_SetId_Callback() { Serial.println("Set Id Mode"); String Argument = String(Commands.next()); if (Argument != NULL) { Serial.println("New ID is: " + Argument); } }

It works fine when I for example enter SET_ID 20 the first time. But I get no response the second time onwards. Looking forward to your support.

Thanks.

Check return alone

Hello,

I use your library on a RP2040 zero with success :-)
How can i check Carriage Return key with the addCommand.
I have tested sCmd.addCommand("0D", DisplayHelp); without success.

Thanks for your help,

Pierre

buffer length

I cannot pass long parameter like "set_MLT_sensor 5E72631403A4FFFF"
because a buffer size is short
I think to change
from line 151 in SerialCommend.cpp
if (bufPos > SERIALCOMMANDBUFFER-1) {
bufPos=0; // wrap buffer around if full
Serial.println("Short SERIALCOMMANDBUFFER");
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.