MessageControl API
Version: 1.0.0
Status:
MessageControl interface for Thunder framework.
(Defined with IMessageControl in IMessageControl.h)
Table of Contents
Introduction
Scope
This document describes purpose and functionality of the MessageControl interface (version 1.0.0). It includes detailed specification about its 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
MessageControl JSON-RPC interface.
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 interface:
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": "<callsign>.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 interface:
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": "<callsign>.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": "<callsign>.1.controls@xyz"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"type": "Tracing",
"category": "Information",
"module": "Plugin_BluetoothControl",
"enabled": false
}
]
}