ConOpSys V2970  P004.07
ANVILEX control operating system
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TCommand_Manager Class Reference

ConOpSys terminal command manager class. More...

#include <Command_Manager.h>

Inheritance diagram for TCommand_Manager:
Inheritance graph
Collaboration diagram for TCommand_Manager:
Collaboration graph

Public Member Functions

 TCommand_Manager ()
 Class constructor method. More...
 
virtual ~TCommand_Manager ()
 Class destructor method. More...
 
virtual VOID Init ()
 Command manager initialisation method. More...
 
virtual VOID Done ()
 Command manager finalisation method. More...
 
virtual BOOL Get_Index (U32 *u32_Storage_Index, TCommand_Base *object_Command)
 Get command object index referenced by command object pointer. More...
 
virtual BOOL Get_Command_By_Storage_Index (U32 u32_Storage_Index, TCommand_Base **object_Command)
 Get pointer to the command object referenced by command manager storage index. More...
 
virtual BOOL Is_Registered (TCommand_Base *object_Command)
 Test for command registered in command manager. More...
 
virtual BOOL Register (TCommand_Base *object_Command)
 Performs registration of the command in command manager. More...
 
virtual BOOL Unregister (TCommand_Base *object_Command)
 Performs unregistration of the command in command manager. More...
 
virtual BOOL Execute (C8 *c8_Command_String, TProtocol_Base *object_Protocol)
 Execute command method. More...
 
virtual U32 Get_Command_Count ()
 Get command count registered in command manager. More...
 
virtual VOID Get_Usage (U32 *u32_Command_Capacity, U32 *u32_Command_Count)
 Get command manager storage utilisation. More...
 
virtual VOID Show_Boot_Information (TProtocol_Base *object_Protocol)
 Send boot information message over given protocol. More...
 
virtual U32 Get_OS_Status ()
 This method return OS status. More...
 
virtual BOOL Start_Operation ()
 This method set module in operation mode. More...
 
- Public Member Functions inherited from TCommand_Manager_Base
 TCommand_Manager_Base ()
 Class constructor method. More...
 
virtual ~TCommand_Manager_Base ()
 Class destructor method. More...
 

Private Member Functions

U32 Get_Database_Size_In_Bytes ()
 Get command manager database size in bytes. More...
 
U32 Get_Database_Record_Count ()
 Get command manager database record count. More...
 

Private Attributes

TCommand_Baseobject_Command_Storage [COMMAND_STORAGE_SIZE]
 Static storage for command object pointers. More...
 
TCommand_Base::TCommand_Descriptorstruct_Command_Database
 Pointer to the command database storage mapped directly to the section. More...
 
U32 u32_Command_Registration_Requests_Counter
 Command registration requests counter. More...
 
U32 u32_Command_Successful_Registration_Counter
 Successful command registration counter. More...
 
U32 u32_Command_Failed_Registration_Counter
 Failed command registration counter. More...
 
U32 u32_Command_Double_Registration_Counter
 Count of double registered commands. More...
 
BOOL bool_Command_Storage_Overflow
 Command storage overflow status. More...
 

Additional Inherited Members

- Protected Attributes inherited from TCommand_Manager_Base
TOS_Status_Structure struct_OS_Status
 Container for OS status. More...
 

Detailed Description

ConOpSys terminal command manager class.

Constructor & Destructor Documentation

◆ TCommand_Manager()

TCommand_Manager::TCommand_Manager ( )

◆ ~TCommand_Manager()

TCommand_Manager::~TCommand_Manager ( )
virtual

Class destructor method.


Note
None
Override
Not allowed
Attention
Don't call this method directly.

Member Function Documentation

◆ Done()

VOID TCommand_Manager::Done ( )
virtual

Command manager finalisation method.


Note
None
Override
Not allowed
Attention
Don't call this method directly.

Reimplemented from TCommand_Manager_Base.

◆ Execute()

BOOL TCommand_Manager::Execute ( C8 c8_Command_String,
TProtocol_Base object_Protocol 
)
virtual

Execute command method.


Note
None
Parameters
[in]*c8_Command_String- Pointer to the command name string
[in]*object_Protocol- Pointer to the communication protocol object
Returns
BOOL - Execution status
Return values
false- Command name is not equal and command not executed
true- Command name is equal and command executed
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References TCommand_Base::Execute(), TCommand_Base::Is_Command_Name(), TProtocol_Base::Is_Terminal_Mode(), NULL, object_Command_Storage, and true.

Referenced by TProtocol_ANVILEX_Over_UART::Command_Execution_Request(), and TProtocol_ANVILEX_Over_UART_V2::Command_Execution_Request().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_Command_By_Storage_Index()

BOOL TCommand_Manager::Get_Command_By_Storage_Index ( U32  u32_Storage_Index,
TCommand_Base **  object_Command 
)
virtual

Get pointer to the command object referenced by command manager storage index.


Note
None
Parameters
[in]u32_Storage_Index- Command manager storage index
[out]**object_Command- Pointer to the command object
Returns
BOOL - Execution status
Return values
false- Command object not found in command manager storage
true- Command object found in command manager storage
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References NULL, and object_Command_Storage.

Referenced by TCommand_HELP::Execute().

Here is the caller graph for this function:

◆ Get_Command_Count()

U32 TCommand_Manager::Get_Command_Count ( )
virtual

Get command count registered in command manager.


Note
None
Returns
U32 - Command count
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References u32_Command_Successful_Registration_Counter.

Referenced by Get_Usage().

Here is the caller graph for this function:

◆ Get_Database_Record_Count()

U32 TCommand_Manager::Get_Database_Record_Count ( )
private

Get command manager database record count.


Note
None
Returns
U32 - Command manager database record count
Override
Not allowed
Attention
None

References Get_Database_Size_In_Bytes().

Referenced by Show_Boot_Information().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_Database_Size_In_Bytes()

U32 TCommand_Manager::Get_Database_Size_In_Bytes ( )
private

Get command manager database size in bytes.


Note
None
Returns
U32 - Command manager database size in bytes
Override
Not allowed
Attention
None

References Command_Database_End_Pointer, and Command_Database_Start_Pointer.

Referenced by Get_Database_Record_Count(), and Show_Boot_Information().

Here is the caller graph for this function:

◆ Get_Index()

BOOL TCommand_Manager::Get_Index ( U32 u32_Storage_Index,
TCommand_Base object_Command 
)
virtual

Get command object index referenced by command object pointer.


Note
This method allows resovle command manager storage index of the command
Parameters
[out]*u32_Storage_Index- Command manager storage index
[in]*object_Command- Pointer to the command object
Returns
BOOL - Execution status
Return values
false- Command object not found in command manager storage
true- Command object found in command manager storage
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References object_Command_Storage.

Referenced by Is_Registered(), Register(), and Unregister().

Here is the caller graph for this function:

◆ Get_OS_Status()

U32 TCommand_Manager::Get_OS_Status ( )
virtual

This method return OS status.


Note
None
Returns
U32 - Command manager OS status
Override
Required
Attention
None

Reimplemented from TCommand_Manager_Base.

References TCommand_Manager_Base::struct_OS_Status, and TOS_Status_Structure::u32_Raw_Data.

Referenced by TSystem_LED_Base::Decode().

Here is the caller graph for this function:

◆ Get_Usage()

VOID TCommand_Manager::Get_Usage ( U32 u32_Command_Capacity,
U32 u32_Command_Count 
)
virtual

Get command manager storage utilisation.


Note
None
Parameters
[out]*u32_Command_Capacity- Pointer to the command manager capacity variable
[out]*u32_Command_Count- Pointer to the command count variable
Returns
None
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References Get_Command_Count().

Referenced by TCommand_INFO::Execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

VOID TCommand_Manager::Init ( )
virtual

◆ Is_Registered()

BOOL TCommand_Manager::Is_Registered ( TCommand_Base object_Command)
virtual

Test for command registered in command manager.


Note
None
Parameters
[in]*object_Command- Pointer to the command object
Returns
BOOL - Execution status
Return values
false- Command object not registered in command manager storage
true- Command object registered in command manager storage
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References Get_Index(), and NULL.

Referenced by Register().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Register()

BOOL TCommand_Manager::Register ( TCommand_Base object_Command)
virtual

Performs registration of the command in command manager.


Note
None
Parameters
[in]*object_Command- Pointer to the command object
Returns
BOOL - Execution status
Return values
false- Command object registration successed
true- Command object registration failed
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References bool_Command_Storage_Overflow, Get_Index(), Increment_Saturated(), Is_Registered(), NULL, object_Command_Storage, u32_Command_Double_Registration_Counter, u32_Command_Failed_Registration_Counter, u32_Command_Registration_Requests_Counter, and u32_Command_Successful_Registration_Counter.

Referenced by Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Show_Boot_Information()

VOID TCommand_Manager::Show_Boot_Information ( TProtocol_Base object_Protocol)
virtual

Send boot information message over given protocol.


Note
None
Parameters
[in]*object_Protocol- Pointer to the communication protocol object
Returns
None
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References Command_Database_End_Pointer, Command_Database_Start_Pointer, Get_Database_Record_Count(), Get_Database_Size_In_Bytes(), TProtocol_Base::Transmit_String(), TProtocol_Base::Transmit_String_Of_Char(), TProtocol_Base::Transmit_U32_Value_As_Decimal(), TProtocol_Base::Transmit_U32_Value_As_Hex(), u32_Command_Double_Registration_Counter, u32_Command_Failed_Registration_Counter, u32_Command_Registration_Requests_Counter, and u32_Command_Successful_Registration_Counter.

Referenced by TApplication_Base::Init(), and TBootloader_Base::Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Start_Operation()

BOOL TCommand_Manager::Start_Operation ( )
virtual

This method set module in operation mode.


Note
None
Returns
BOOL - Module status
Return values
false- Module in error mode
true- Module ready to operations
Override
Required
Attention
None

Reimplemented from TCommand_Manager_Base.

References TOS_Status_Structure::Bits, TCommand_Manager_Base::struct_OS_Status, TOS_Status_Structure::u32_Alarm, TOS_Status_Structure::u32_Error, TOS_Status_Structure::u32_Init, and TOS_Status_Structure::u32_Ready.

Referenced by TApplication_Base::Init(), and TBootloader_Base::Init().

Here is the caller graph for this function:

◆ Unregister()

BOOL TCommand_Manager::Unregister ( TCommand_Base object_Command)
virtual

Performs unregistration of the command in command manager.


Note
None
Parameters
[in]*object_Command- Pointer to the command object
Returns
BOOL - Execution status
Return values
false- Command object unregistration successed
true- Command object unregistration failed
Override
Not allowed
Attention
None

Reimplemented from TCommand_Manager_Base.

References bool_Command_Storage_Overflow, Decrement_Saturated(), Get_Index(), NULL, object_Command_Storage, u32_Command_Double_Registration_Counter, and u32_Command_Successful_Registration_Counter.

Here is the call graph for this function:

Member Data Documentation

◆ bool_Command_Storage_Overflow

BOOL TCommand_Manager::bool_Command_Storage_Overflow
private

Command storage overflow status.

Referenced by Register(), TCommand_Manager(), and Unregister().

◆ object_Command_Storage

TCommand_Base* TCommand_Manager::object_Command_Storage[COMMAND_STORAGE_SIZE]
private

Static storage for command object pointers.

Referenced by Execute(), Get_Command_By_Storage_Index(), Get_Index(), Register(), TCommand_Manager(), and Unregister().

◆ struct_Command_Database

TCommand_Base::TCommand_Descriptor* TCommand_Manager::struct_Command_Database
private

Pointer to the command database storage mapped directly to the section.

Referenced by TCommand_Manager().

◆ u32_Command_Double_Registration_Counter

U32 TCommand_Manager::u32_Command_Double_Registration_Counter
private

Count of double registered commands.

Referenced by Register(), Show_Boot_Information(), TCommand_Manager(), and Unregister().

◆ u32_Command_Failed_Registration_Counter

U32 TCommand_Manager::u32_Command_Failed_Registration_Counter
private

Failed command registration counter.

Referenced by Register(), Show_Boot_Information(), and TCommand_Manager().

◆ u32_Command_Registration_Requests_Counter

U32 TCommand_Manager::u32_Command_Registration_Requests_Counter
private

Command registration requests counter.

Referenced by Register(), Show_Boot_Information(), and TCommand_Manager().

◆ u32_Command_Successful_Registration_Counter

U32 TCommand_Manager::u32_Command_Successful_Registration_Counter
private

Successful command registration counter.

Referenced by Get_Command_Count(), Register(), Show_Boot_Information(), TCommand_Manager(), and Unregister().


The documentation for this class was generated from the following files: