Skip to content

Commit 0040024

Browse files
Update method to get last command index
Signed-off-by: CreativeRobotics <bill@creative-robotics.com>
1 parent 5869c80 commit 0040024

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Commander changelog
22
(Changelog started at 1.2.3)
3+
4.3.0
4+
Added getCommandIndex that returns the index of the last used command in the command array. Calling this from a handler will inform you which command in the command array was used to invoke the handler.
35

46
4.2.3
57
Update *char to const *char to remove compiler warnings.

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Commander
2-
version=4.2.3
2+
version=4.3.0
33
author=Bill Bigge
44
maintainer=Bill Bigge <bbigge@gmail.com>
55
sentence=Command line library for Arduino.

src/Commander.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
class Commander;
1111

1212
const uint8_t majorVersion = 4;
13-
const uint8_t minorVersion = 2;
14-
const uint8_t subVersion = 3;
13+
const uint8_t minorVersion = 3;
14+
const uint8_t subVersion = 0;
1515

1616

1717
//#define BENCHMARKING_ON
@@ -412,6 +412,7 @@ class Commander : public Stream {
412412
Commander& rewind();
413413
Commander& printCommandList();
414414
Commander& printCommanderVersion();
415+
int16_t getCommandIndex() {return commandIndex;}
415416
String bufferString = ""; //the buffer - public so user functions can read it
416417
String commanderName = "CMD";
417418

0 commit comments

Comments
 (0)