Skip to content

Commit

Permalink
Migration document.
Browse files Browse the repository at this point in the history
  • Loading branch information
slav-at-attachix committed Dec 5, 2023
1 parent b6719df commit 7ba5fdf
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sming/Components/CommandProcessing/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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``.
63 changes: 63 additions & 0 deletions docs/source/upgrading/4.7-5.1.rst
Original file line number Diff line number Diff line change
@@ -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 <Services/CommandProcessing/CommandProcessingDependencies.h>

becomes::

#include <CommandProcessing/Utils.h>


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.
1 change: 1 addition & 0 deletions docs/source/upgrading/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ba5fdf

Please sign in to comment.