GM6000 Digital Heater Controller
Build: 16 (Branch = develop)
SDX-1330
Main Page
Namespaces
Components
Files
File List
File Members
Driver
Crypto
TShell
Random.h
Go to the documentation of this file.
1
#ifndef Driver_Crypt_TShell_Random_h
2
#define Driver_Crypt_TShell_Random_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
* Copyright (c) 2014-2025 John T. Taylor
11
*
12
* Redistributions of the source code must retain the above copyright notice.
13
*----------------------------------------------------------------------------*/
14
/** @file */
15
16
#include "colony_config.h"
17
#include "
Cpl/TShell/Cmd/Command.h
"
18
19
20
///
21
namespace
Driver
{
22
///
23
namespace
Crypto {
24
///
25
namespace
TShell {
26
27
/** This class implements a Shell command. This command is only 'useful' if
28
the application was built to use simulated time (see Cpl::System::SimTick.h).
29
*/
30
class
Random
:
public
Cpl::TShell::Cmd::Command
31
{
32
public
:
33
/// The command verb/identifier
34
static
constexpr
const
char
*
verb
=
"rnd"
;
35
36
/// The command usage string
37
static
constexpr
const
char
*
usage
=
"rnd <numBytes>"
;
38
39
/** The command detailed help string (recommended that lines do not exceed 80 chars)
40
1 2 3 4 5 6 7 8
41
12345678901234567890123456789012345678901234567890123456789012345678901234567890
42
*/
43
static
constexpr
const
char
*
detailedHelp
=
" Generates a random number of <numBytes> long."
;
44
45
46
protected
:
47
/// See Cpl::TShell::Command
48
const
char
*
getUsage
() const noexcept {
return
usage
; }
49
50
/// See Cpl::TShell::Command
51
const
char
*
getHelp
() const noexcept {
return
detailedHelp
; }
52
53
54
public
:
55
/// Constructor
56
Random
(
Cpl::Container::SList<Cpl::TShell::Command>
& commandList,
57
Cpl::TShell::Security::Permission_T
minPermLevel =
OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
)
noexcept
;
58
59
public
:
60
/// See Cpl::TShell::Command
61
Cpl::TShell::Command::Result_T
execute
(
Cpl::TShell::Context_
& context,
char
* cmdString,
Cpl::Io::Output
& outfd )
noexcept
;
62
};
63
64
}
// end namespaces
65
}
66
}
67
#endif
// end header latch
Command.h
OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
#define OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
Default Permission level for all commands.
Definition
Command.h:22
Cpl::Container::RingBufferMT
This template class implements a THREAD SAFE Ring Buffer.
Definition
RingBufferMT.h:33
Cpl::Io::Output
This partially abstract class defines a interface for operating on an output stream (example of a str...
Definition
Output.h:34
Cpl::TShell::Cmd::Command
This partially concrete class implements infrastructure and/or common functionality for a Shell comma...
Definition
Command.h:37
Cpl::TShell::Command::Result_T
Result_T
Possible result codes when executing a command.
Definition
Command.h:35
Cpl::TShell::Context_
This Private Namespace class defines a "Context" for a TShell command.
Definition
Context_.h:32
Cpl::TShell::Security::Permission_T
Permission_T
Permissions levels.
Definition
Security.h:34
Driver::Crypto::TShell::Random
This class implements a Shell command.
Definition
Random.h:31
Driver::Crypto::TShell::Random::getHelp
const char * getHelp() const noexcept
See Cpl::TShell::Command.
Definition
Random.h:51
Driver::Crypto::TShell::Random::getUsage
const char * getUsage() const noexcept
See Cpl::TShell::Command.
Definition
Random.h:48
Driver::Crypto::TShell::Random::usage
static constexpr const char * usage
The command usage string.
Definition
Random.h:37
Driver::Crypto::TShell::Random::verb
static constexpr const char * verb
The command verb/identifier.
Definition
Random.h:34
Driver::Crypto::TShell::Random::detailedHelp
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
Random.h:43
Driver::Crypto::TShell::Random::execute
Cpl::TShell::Command::Result_T execute(Cpl::TShell::Context_ &context, char *cmdString, Cpl::Io::Output &outfd) noexcept
See Cpl::TShell::Command.
Driver::Crypto::TShell::Random::Random
Random(Cpl::Container::SList< Cpl::TShell::Command > &commandList, Cpl::TShell::Security::Permission_T minPermLevel=OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL) noexcept
Constructor.
Driver
namespace
Generated on Sun Jun 8 2025 21:10:10 for GM6000 Digital Heater Controller by
1.10.0