4

My use case is generating and parsing AT commands

I'm looking for something similar to Boost.Spirit or https://github.com/ColinH/PEGTL , but friendly to an embedded environment (mbed OS) and doesn't need to be quite as powerful as the aforementioned. The mbed OS ATParser swings the other way and is a bit too weak/scanf-y for my tastes (no dispresect to the ATParser folks)

Boost.Spirit I can't get to compile under that environment and I am hesitant to try PEGTL for similar reasons in addition to it being a bit complex.

Malachi
  • 2,022
  • 2
  • 24
  • 35

3 Answers3

1

Not AT-specific, but this looks promising: embedded-commandline.

To use it, looks like you:

  • Create a class that inherits from Outputter, which implements the putchar() and puts() member functions for your platform. (You'll pass a reference to an instance of the class to the DumbLineEditor and CommandManager constructors.)
  • Create classes that derive from Command, and implement the execute() member function for each of your commands.
  • Instantiate a CommandManager. Call CommandManager::addCommand() with an instance of each of your derived Commands.
  • Instantiate DumbLineEditor, passing references to your CommandManager and derived Outputter to its constructor.
cp.engr
  • 1,862
  • 3
  • 24
  • 37
0

below project maybe what you looking for:

CMDB: A Command Interpreter with support for used defined commands, subsystems, macros, help and parameter parsing.

https://developer.mbed.org/users/wvd_vegt/code/CMDB/

sailfish009
  • 1,790
  • 1
  • 17
  • 26
0

Looks like I'm rolling my own. If it's not against stackoverflow rules, I'll post the link here.

Malachi
  • 2,022
  • 2
  • 24
  • 35
  • Please share the info. Then you can even accept your own answer if you think it's the best one, and you're satisfied with it. https://stackoverflow.com/help/self-answer – cp.engr Feb 06 '18 at 15:38