File tree 2 files changed +5
-20
lines changed
arduino-ide-extension/src
2 files changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export const BoardsServicePath = '/services/boards-service';
134
134
export const BoardsService = Symbol ( 'BoardsService' ) ;
135
135
export interface BoardsService
136
136
extends Installable < BoardsPackage > ,
137
- Searchable < BoardsPackage > {
137
+ Searchable < BoardsPackage > {
138
138
/**
139
139
* Deprecated. `getState` should be used to correctly map a board with a port.
140
140
* @deprecated
@@ -156,26 +156,13 @@ export interface BoardsService
156
156
157
157
export interface Port {
158
158
readonly address : string ;
159
- readonly protocol : Port . Protocol ;
159
+ readonly protocol : string ;
160
160
/**
161
161
* Optional label for the protocol. For example: `Serial Port (USB)`.
162
162
*/
163
163
readonly label ?: string ;
164
164
}
165
165
export namespace Port {
166
- export type Protocol = 'serial' | 'network' | 'unknown' ;
167
- export namespace Protocol {
168
- export function toProtocol ( protocol : string | undefined ) : Protocol {
169
- if ( protocol === 'serial' ) {
170
- return 'serial' ;
171
- } else if ( protocol === 'network' ) {
172
- return 'network' ;
173
- } else {
174
- return 'unknown' ;
175
- }
176
- }
177
- }
178
-
179
166
export function is ( arg : any ) : arg is Port {
180
167
return (
181
168
! ! arg &&
Original file line number Diff line number Diff line change @@ -95,11 +95,9 @@ export class BoardDiscovery extends CoreClientAware {
95
95
const newState = deepClone ( this . _state ) ;
96
96
97
97
const address = ( detectedPort as any ) . getPort ( ) . getAddress ( ) ;
98
- const protocol = Port . Protocol . toProtocol (
99
- ( detectedPort as any ) . getPort ( ) . getProtocol ( )
100
- ) ;
101
- // const label = detectedPort.getProtocolLabel();
102
- const port = { address, protocol } ;
98
+ const protocol = ( detectedPort as any ) . getPort ( ) . getProtocol ( ) ;
99
+ const label = ( detectedPort as any ) . getPort ( ) . getLabel ( ) ; ;
100
+ const port = { address, protocol, label } ;
103
101
const boards : Board [ ] = [ ] ;
104
102
for ( const item of detectedPort . getMatchingBoardsList ( ) ) {
105
103
boards . push ( {
You can’t perform that action at this time.
0 commit comments