MessageControl Plugin
Version: 1.0
Status:
MessageControl plugin for Thunder framework.
Table of Contents
Introduction
Scope
This document describes purpose and functionality of the MessageControl plugin. It includes detailed specification about its configuration, methods and properties provided.
Case Sensitivity
All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.
Acronyms, Abbreviations and Terms
The table below provides and overview of acronyms used in this document and their definitions.
Acronym | Description |
---|---|
API | Application Programming Interface |
HTTP | Hypertext Transfer Protocol |
JSON | JavaScript Object Notation; a data interchange format |
JSON-RPC | A remote procedure call protocol encoded in JSON |
The table below provides and overview of terms and abbreviations used in this document and their definitions.
Term | Description |
---|---|
callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. |
References
Ref ID | Description |
---|---|
HTTP | HTTP specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
Description
The MessageControl plugin allows reading of the traces from Thunder, and controlling them tracing and logging. Allows for outputting logging messages to the websocket.
The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].
Configuration
The table below lists configuration options of the plugin.
Name | Type | M/O | Description |
---|---|---|---|
callsign | string | mandatory | Plugin instance name (default: MessageControl) |
classname | string | mandatory | Class name: MessageControl |
locator | string | mandatory | Library name: libThunderMessageControl.so |
startmode | string | mandatory | Determines in which state the plugin should be moved to at startup of the framework |
console | boolean | optional | Enables message output messages to the console |
syslog | boolean | optional | Enables message ouutput to syslog |
filepath | string | optional | Path to file (inside VolatilePath) where messages will be stored |
abbreviated | boolean | optional | Denotes if the messages should be abbreviated |
maxexportconnections | integer | optional | Specifies to how many websockets can the messages be outputted |
remote | object | optional | ... |
remote.port | integer | mandatory | Port |
remote?.bindig | string | optional | Binding address |
Interfaces
This plugin implements the following interfaces:
- IMessageControl (IMessageControl.h) (version 1.0.0) (compliant format)
This interface uses legacy
lowercase
naming convention. With the next major release the naming convention will change tocamelCase
.
Methods
The following methods are provided by the MessageControl plugin:
MessageControl interface methods:
Method | Description |
---|---|
enable | Enables/disables a message control |
enable method
Enables/disables a message control.
Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.type | string | mandatory | Message type (must be one of the following: Assert, Invalid, Logging, OperationalStream, Reporting, Tracing) |
params.category | string | mandatory | Name of the message category |
params.module | string | mandatory | Name of the module the message is originating from |
params.enabled | boolean | mandatory | Denotes if control should be enabled (true) or disabled (false) |
Result
Name | Type | M/O | Description |
---|---|---|---|
result | null | mandatory | Always null |
Example
Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "MessageControl.1.enable",
"params": {
"type": "Tracing",
"category": "Information",
"module": "Plugin_BluetoothControl",
"enabled": false
}
}
Response
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
Properties
The following properties are provided by the MessageControl plugin:
MessageControl interface properties:
Property | R/W | Description |
---|---|---|
modules | read-only | Retrieves a list of current message modules |
controls | read-only | Retrieves a list of current message controls for a specific module |
modules property
Provides access to the retrieves a list of current message modules.
This property is read-only.
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | Retrieves a list of current message modules |
(property)[#] | string | mandatory | ... |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "MessageControl.1.modules"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
"..."
]
}
controls property
Provides access to the retrieves a list of current message controls for a specific module.
This property is read-only.
The module parameter shall be passed as the index to the property, i.e.
controls@<module>
.
Index
Name | Type | M/O | Description |
---|---|---|---|
module | string | mandatory | ... |
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | Retrieves a list of current message controls for a specific module |
(property)[#] | object | mandatory | ... |
(property)[#].type | string | mandatory | Type of message (must be one of the following: Assert, Invalid, Logging, OperationalStream, Reporting, Tracing) |
(property)[#].category | string | mandatory | Name of the message category |
(property)[#].module | string | mandatory | Name of the module the message is originating from |
(property)[#].enabled | boolean | mandatory | Denotes if the control is enabled (true) or disabled (false) |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "MessageControl.1.controls@xyz"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"type": "Tracing",
"category": "Information",
"module": "Plugin_BluetoothControl",
"enabled": false
}
]
}