diff --git a/arduino-ide-extension/src/common/protocol/index.ts b/arduino-ide-extension/src/common/protocol/index.ts index 10190575..1a9a25c2 100644 --- a/arduino-ide-extension/src/common/protocol/index.ts +++ b/arduino-ide-extension/src/common/protocol/index.ts @@ -13,3 +13,4 @@ export * from './examples-service'; export * from './executable-service'; export * from './response-service'; export * from './notification-service'; +export * from './monitor-service'; diff --git a/arduino-ide-extension/src/common/protocol/monitor-service.ts b/arduino-ide-extension/src/common/protocol/monitor-service.ts new file mode 100644 index 00000000..d3d5c1ed --- /dev/null +++ b/arduino-ide-extension/src/common/protocol/monitor-service.ts @@ -0,0 +1,30 @@ +import { Event, JsonRpcServer } from "@theia/core"; +import { Board, Port } from './boards-service'; + +export const MonitorManagerProxyPath = '/services/monitor-manager-proxy'; +export const MonitorManagerProxy = Symbol('MonitorManagerProxy'); +export interface MonitorManagerProxy extends JsonRpcServer { + //set the monitor settings, which includes address, port and other monitor-specific settings + setMonitorSettings(board: Board, port: Port, settings: MonitorSettings): Promise; +} + +export const MonitorManagerProxyClient = Symbol('MonitorManagerProxyClient'); +export interface MonitorManagerProxyClient { + onWebSocketChanged: Event; + notifyWebSocketChanged(message: string): void; +} + +export interface MonitorSetting { + // The setting identifier + readonly id: string; + // A human-readable label of the setting (to be displayed on the GUI) + readonly label: string; + // The setting type (at the moment only "enum" is avaiable) + readonly type: string; + // The values allowed on "enum" types + readonly values: string[]; + // The selected value + selectedValue: string; +} + +export type MonitorSettings = Record; \ No newline at end of file