Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions interfaces/IMessageControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,18 @@

#include "Module.h"

// @insert <core/MessageStore.h>
// @insert <com/IIteratorType.h>

namespace WPEFramework {

namespace Exchange {

// @json
// @json 1.0.0 @text:legacy_lowercase
struct EXTERNAL IMessageControl : virtual public Core::IUnknown {

enum { ID = ID_MESSAGE_CONTROL };

enum messagetype : uint8_t {
TRACING = 1,
LOGGING = 2,
REPORTING = 3,
STANDARD_OUT = 4,
STANDARD_ERROR = 5
};
using messagetype = Core::Messaging::Metadata::type;

Comment thread
VeithMetro marked this conversation as resolved.
struct Control {
messagetype type /* @brief Type of message */;
Expand All @@ -48,17 +42,22 @@ struct EXTERNAL IMessageControl : virtual public Core::IUnknown {
};

using IControlIterator = RPC::IIteratorType<Control, ID_MESSAGE_CONTROL_ITERATOR>;
using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;

// @brief Enables/disables a message control
// @param type Message type
// @param module Name of the module the message is originating from (e.g. Plugin_BluetoothControl)
// @param category Name of the message category (e.g. Information)
// @param enabled Denotes if control should be enabled (true) or disabled (false)
virtual uint32_t Enable(const messagetype type, const string& category, const string& module, const bool enabled) = 0;
// @param type: Message type
// @param module: Name of the module the message is originating from (e.g. Plugin_BluetoothControl)
// @param category: Name of the message category (e.g. Information)
Comment thread
VeithMetro marked this conversation as resolved.
Comment thread
VeithMetro marked this conversation as resolved.
Comment thread
VeithMetro marked this conversation as resolved.
// @param enabled: Denotes if control should be enabled (true) or disabled (false)
virtual Core::hresult Enable(const messagetype type, const string& category, const string& module, const bool enabled) = 0;

// @property
// @brief Retrieves a list of current message modules
virtual Core::hresult Modules(IStringIterator*& modules /* @out */) const = 0;

// @property
// @brief Retrieves a list of current message controls
virtual uint32_t Controls(IControlIterator*& control /* @out */) const = 0;
// @brief Retrieves a list of current message controls for a specific module
virtual Core::hresult Controls(const string& module /* @index */, IControlIterator*& control /* @out */) const = 0;
Comment thread
VeithMetro marked this conversation as resolved.
Outdated
};

} // namespace Exchange
Expand Down
Loading