diff --git a/Sming/Components/CommandProcessing/README.rst b/Sming/Components/CommandProcessing/README.rst index 366d617daf..bdaad7ee9c 100644 --- a/Sming/Components/CommandProcessing/README.rst +++ b/Sming/Components/CommandProcessing/README.rst @@ -19,7 +19,7 @@ Commands can be added to and removed from the command handler. Each command will A welcome message may be shown when a user connects and end-of-line (EOL) character may be defined. An automatic "help" display is available. For more examples take a look at the -:sample:`CommandProcessing`, +:sample:`CommandLine`, :sample:`TelnetServer` and :sample:`HttpServer_WebSockets` samples. diff --git a/Sming/Components/CommandProcessing/samples/TelnetServer/README.rst b/Sming/Components/CommandProcessing/samples/TelnetServer/README.rst index 9852111d82..0a80ec3087 100644 --- a/Sming/Components/CommandProcessing/samples/TelnetServer/README.rst +++ b/Sming/Components/CommandProcessing/samples/TelnetServer/README.rst @@ -1,4 +1,4 @@ -Arducam -======= +TelnetServer +============ -A demonstration application for controlling ArduCAM camera modules via web or telnet interface. +A demonstration of a telnet server built using ``CommandProcessing``. diff --git a/docs/source/upgrading/4.7-5.1.rst b/docs/source/upgrading/4.7-5.1.rst new file mode 100644 index 0000000000..a1c8aa0c87 --- /dev/null +++ b/docs/source/upgrading/4.7-5.1.rst @@ -0,0 +1,63 @@ +From v4.7 to v5.1 +================= + +.. highlight:: c++ + +Command Processing +------------------ + +The CommandProcessing service has been refactored and moved to a component. +This means that the following classes ``CommandHandler``, ``CommandExecutor`` and ``CommandOutput`` are no longer available. + + +Enabling +~~~~~~~~ + +The command processing component used to be enabled by setting the directive ``ENABLE_CMD_EXECUTOR`` to 1 in your ``component.mk`` file or during compilation. +This has to be replaced with the directive ``COMPONENT_DEPENDS += CommandProcessing`` in your ``component.mk`` file. + + +Including Header Files +~~~~~~~~~~~~~~~~~~~~~~~ + +To include the command processing headers in your C/C++ application we used to do the following + +For example:: + + #include + +becomes:: + + #include + + +Usage +~~~~~ + +There is no longer a global instance of commandHandler. This means that you will need to create one yourself when you need it. +This can be done using the code below:: + + CommandProcessing::CommandHandler commandHandler; + +In order to register a command the old example code:: + + commandHandler.registerCommand( + CommandDelegate("example", "Example Command", "Application", processExampleCommand)); + +becomes:: + + commandHandler.registerCommand( + CommandProcessing::Command("example", "Example Command", "Application", processExampleCommand)); + +HardwareSerial no longer is dependent on CommandProcessing classes. And the following command will no longer work:: + + Serial.commandProcessing(true); + +The line above has to be replaced with:: + + CommandProcessing::enable(commandProcessing, Serial); + +See the modified samples +:sample:`CommandLine`, +:sample:`TelnetServer` +and :sample:`HttpServer_WebSockets` for details. diff --git a/docs/source/upgrading/index.rst b/docs/source/upgrading/index.rst index a53c6a896f..9677ddf287 100644 --- a/docs/source/upgrading/index.rst +++ b/docs/source/upgrading/index.rst @@ -7,6 +7,7 @@ For newer versions we have dedicated pages. .. toctree:: :maxdepth: 1 + 4.7-5.1 4.6-4.7 4.5-4.6 4.4-4.5