GM6000 Digital Heater Controller Build: 16 (Branch = develop)
SDX-1330
Cmd.h
Go to the documentation of this file.
1#ifndef Driver_RHTemp_TShell_Cmd_h
2#define Driver_RHTemp_TShell_Cmd_h
3/*-----------------------------------------------------------------------------
4* This file is part of the Colony.Core Project. The Colony.Core Project is an
5* open source project with a BSD type of licensing agreement. See the license
6* agreement (license.txt) in the top/ directory or on the Internet at
7* http://integerfox.com/colony.core/license.txt
8*
9* Copyright (c) 2014-2025 John T. Taylor
10*
11* Redistributions of the source code must retain the above copyright notice.
12*----------------------------------------------------------------------------*/
13/** @file */
14
15#include "colony_config.h"
17#include "Driver/RHTemp/Api.h"
18
19
20///
21namespace Driver {
22///
23namespace RHTemp {
24
25/** This class implements a TShell command that exercises the RH/Temp
26 driver. The class is ABSOLUTELY NOT THREAD SAFE! Its intended use is to
27 support unit testing.
28 */
30{
31public:
32 /// The command verb/identifier
33 static constexpr const char* verb = "rhtemp";
34
35 /// The command usage string
36 static constexpr const char* usage =
37 "rhtemp start|stop\n"
38 "rhtemp sample\n"
39 "rhtemp begin\n"
40 "rhtemp read\n"
41 "rhtemp heater on|off";
42
43
44 /** The command detailed help string (recommended that lines do not exceed 80 chars)
45 1 2 3 4 5 6 7 8
46 12345678901234567890123456789012345678901234567890123456789012345678901234567890
47 */
48 static constexpr const char* detailedHelp =
49 " Exercises the RHTemp Driver. The user is required to manually start (and\n"
50 " stop) the driver for proper operation.\n"
51 " 'sample' performs a blocking sampling\n"
52 " 'begin' starts an asynchronous sample\n"
53 " 'read' returns the async result/state";
54protected:
55 /// See Cpl::TShell::Command
56 const char* getUsage() const noexcept { return usage; }
57
58 /// See Cpl::TShell::Command
59 const char* getHelp() const noexcept { return detailedHelp; }
60
61
62public:
63 /// Constructor
67
68public:
69 /// See Cpl::TShell::Command
70 Cpl::TShell::Command::Result_T execute( Cpl::TShell::Context_& context, char* cmdString, Cpl::Io::Output& outfd ) noexcept;
71
72protected:
73 /// Driver instance under test
75};
76
77}; // end namespaces
78};
79#endif // end header latch
#define OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
Default Permission level for all commands.
Definition Command.h:22
This template class implements a THREAD SAFE Ring Buffer.
Definition RingBufferMT.h:33
This partially abstract class defines a interface for operating on an output stream (example of a str...
Definition Output.h:34
This partially concrete class implements infrastructure and/or common functionality for a Shell comma...
Definition Command.h:37
Result_T
Possible result codes when executing a command.
Definition Command.h:35
This Private Namespace class defines a "Context" for a TShell command.
Definition Context_.h:32
Permission_T
Permissions levels.
Definition Security.h:34
This class defines an interface for reading and managing a combined RH and Temperature sensor.
Definition Api.h:33
This class implements a TShell command that exercises the RH/Temp driver.
Definition Cmd.h:30
const char * getUsage() const noexcept
See Cpl::TShell::Command.
Definition Cmd.h:56
Driver::RHTemp::Api & m_driver
Driver instance under test.
Definition Cmd.h:74
static constexpr const char * detailedHelp
The command detailed help string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 1234...
Definition Cmd.h:48
TShellCmd(Driver::RHTemp::Api &driver, Cpl::Container::SList< Cpl::TShell::Command > &commandList, Cpl::TShell::Security::Permission_T minPermLevel=OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL) noexcept
Constructor.
const char * getHelp() const noexcept
See Cpl::TShell::Command.
Definition Cmd.h:59
Cpl::TShell::Command::Result_T execute(Cpl::TShell::Context_ &context, char *cmdString, Cpl::Io::Output &outfd) noexcept
See Cpl::TShell::Command.
static constexpr const char * verb
The command verb/identifier.
Definition Cmd.h:33
static constexpr const char * usage
The command usage string.
Definition Cmd.h:36
namespace