File tree 3 files changed +13
-10
lines changed
arduino-ide-extension/src 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ export class MonitorManagerProxyClientImpl
111
111
112
112
this . webSocket . send (
113
113
JSON . stringify ( {
114
- command : Monitor . Command . SEND_MESSAGE ,
114
+ command : Monitor . ClientCommand . SEND_MESSAGE ,
115
115
data : message ,
116
116
} )
117
117
) ;
@@ -124,9 +124,7 @@ export class MonitorManagerProxyClientImpl
124
124
125
125
this . webSocket . send (
126
126
JSON . stringify ( {
127
- command : Monitor . Command . CHANGE_SETTINGS ,
128
- // TODO: This might be wrong, verify if it works
129
- // SPOILER: It doesn't
127
+ command : Monitor . ClientCommand . CHANGE_SETTINGS ,
130
128
data : settings ,
131
129
} )
132
130
) ;
Original file line number Diff line number Diff line change @@ -59,13 +59,18 @@ export interface PluggableMonitorSetting {
59
59
}
60
60
61
61
export namespace Monitor {
62
- export enum Command {
63
- SEND_MESSAGE = 'MONITOR_SEND_MESSAGE' ,
64
- CHANGE_SETTINGS = 'MONITOR_CHANGE_SETTINGS' ,
62
+ // Commands sent by the clients to the web socket server
63
+ export enum ClientCommand {
64
+ SEND_MESSAGE = 'SEND_MESSAGE' ,
65
+ CHANGE_SETTINGS = 'CHANGE_SETTINGS' ,
66
+ }
67
+
68
+ export enum MiddlewareCommand {
69
+ ON_SETTINGS_DID_CHANGE = 'ON_SETTINGS_DID_CHANGE' ,
65
70
}
66
71
67
72
export type Message = {
68
- command : Monitor . Command ;
73
+ command : Monitor . ClientCommand ;
69
74
data : string | MonitorSettings ;
70
75
} ;
71
76
}
Original file line number Diff line number Diff line change @@ -419,10 +419,10 @@ export class MonitorService extends CoreClientAware implements Disposable {
419
419
const message : Monitor . Message = JSON . parse ( msg ) ;
420
420
421
421
switch ( message . command ) {
422
- case Monitor . Command . SEND_MESSAGE :
422
+ case Monitor . ClientCommand . SEND_MESSAGE :
423
423
this . send ( message . data as string ) ;
424
424
break ;
425
- case Monitor . Command . CHANGE_SETTINGS :
425
+ case Monitor . ClientCommand . CHANGE_SETTINGS :
426
426
this . changeSettings ( message . data as MonitorSettings ) ;
427
427
break ;
428
428
}
You can’t perform that action at this time.
0 commit comments