Closed dhebbeker closed 10 months ago
Tested also with real device:
begin program '/home/dhebbeker/pro/time-tracker/src/time-tracker.ino compiled at Nov 30 2023 21:50:08
---- Sent utf8 encoded message: "list\n" ----
this is a list: a, b, c, ...
---- Sent utf8 encoded message: "list\n" ----
this is a list: a, b, c, ...
---- Sent utf8 encoded message: "edit --name \"hello world\"\n" ----
Edit id(0) label('hello world') duration(0)
---- Sent utf8 encoded message: "edit --name \"@²³ß\\\"ä\" --duration 1337\n" ----
Edit id(0) label('@²³ß"ä') duration(1337)
:heavy_check_mark:
Purpose
Create a command parser which is capable to interpret the commands from serial interface according to the defined protocol.
Resolves #60
Acceptance criteria
Todos
Command
which generates a string which is intended to specify the correct use of the command (command line format)Command
by printing a messageChanges
.github/workflows/platformio.yml
: Added test execution to workflow.lib/3rd_party_adapters/serial_port.cpp
: Change line extraction to omit line ending characters and empty lines.lib/application_business_rules/Protocol.*
: This implements the protocol (here: dummies) by using the command line interpreter.lib/application_business_rules/command_line_interpreter.hpp
: Essentially providesOption
andCommand
class templates which can be used to call a function with some arguments based on a command line.lib/enterprise_business_rules/string_helpers.*
: Add helper functions which can be used to operate on strings.platformio.ini
: Add configuration for unit tests.src/main.cpp
: AttachProtocolHandler
to serial port.test/test_cli/test_cli.cpp
: Unit test for command line interpreter.test/test_serial_port/test_serial_port.cpp
: Adjust to changed fetching of lines. The end of line character is omitted now.test/test_string_helpers/test_string_helpers.cpp
: Unit test for string helpers.