@@ -7,14 +7,14 @@ import {
77 BoardsPackage , Board , Port , BoardDetails , Tool , ConfigOption , ConfigValue , Programmer , OutputService , NotificationServiceServer , AvailablePorts , BoardWithPackage
88} from '../common/protocol' ;
99import {
10- PlatformSearchReq , PlatformSearchResp , PlatformInstallReq , PlatformInstallResp , PlatformListReq ,
11- PlatformListResp , PlatformUninstallResp , PlatformUninstallReq
12- } from './cli-protocol/commands/core_pb' ;
13- import { Platform } from './cli-protocol/commands/common_pb' ;
10+ PlatformInstallRequest , PlatformInstallResponse , PlatformListRequest , PlatformListResponse , PlatformSearchRequest ,
11+ PlatformSearchResponse , PlatformUninstallRequest , PlatformUninstallResponse
12+ } from './cli-protocol/cc/arduino/cli/ commands/v1 /core_pb' ;
13+ import { Platform } from './cli-protocol/cc/arduino/cli/ commands/v1 /common_pb' ;
1414import { BoardDiscovery } from './board-discovery' ;
1515import { CoreClientAware } from './core-client-provider' ;
16- import { BoardDetailsReq , BoardDetailsResp , BoardSearchReq } from './cli-protocol/commands/board_pb' ;
17- import { ListProgrammersAvailableForUploadReq , ListProgrammersAvailableForUploadResp } from './cli-protocol/commands/upload_pb' ;
16+ import { BoardDetailsRequest , BoardDetailsResponse , BoardSearchRequest } from './cli-protocol/cc/arduino/cli/ commands/v1 /board_pb' ;
17+ import { ListProgrammersAvailableForUploadRequest , ListProgrammersAvailableForUploadResponse } from './cli-protocol/cc/arduino/cli/ commands/v1 /upload_pb' ;
1818
1919@injectable ( )
2020export class BoardsServiceImpl extends CoreClientAware implements BoardsService {
@@ -51,10 +51,10 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
5151 const coreClient = await this . coreClient ( ) ;
5252 const { client, instance } = coreClient ;
5353 const { fqbn } = options ;
54- const detailsReq = new BoardDetailsReq ( ) ;
54+ const detailsReq = new BoardDetailsRequest ( ) ;
5555 detailsReq . setInstance ( instance ) ;
5656 detailsReq . setFqbn ( fqbn ) ;
57- const detailsResp = await new Promise < BoardDetailsResp | undefined > ( ( resolve , reject ) => client . boardDetails ( detailsReq , ( err , resp ) => {
57+ const detailsResp = await new Promise < BoardDetailsResponse | undefined > ( ( resolve , reject ) => client . boardDetails ( detailsReq , ( err , resp ) => {
5858 if ( err ) {
5959 // Required cores are not installed manually: https://github.com/arduino/arduino-cli/issues/954
6060 if ( ( err . message . indexOf ( 'missing platform release' ) !== - 1 && err . message . indexOf ( 'referenced by board' ) !== - 1 )
@@ -75,7 +75,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
7575
7676 const debuggingSupported = detailsResp . getDebuggingSupported ( ) ;
7777
78- const requiredTools = detailsResp . getToolsdependenciesList ( ) . map ( t => < Tool > {
78+ const requiredTools = detailsResp . getToolsDependenciesList ( ) . map ( t => < Tool > {
7979 name : t . getName ( ) ,
8080 packager : t . getPackager ( ) ,
8181 version : t . getVersion ( )
@@ -91,10 +91,10 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
9191 } )
9292 } ) ;
9393
94- const listReq = new ListProgrammersAvailableForUploadReq ( ) ;
94+ const listReq = new ListProgrammersAvailableForUploadRequest ( ) ;
9595 listReq . setInstance ( instance ) ;
9696 listReq . setFqbn ( fqbn ) ;
97- const listResp = await new Promise < ListProgrammersAvailableForUploadResp > ( ( resolve , reject ) => client . listProgrammersAvailableForUpload ( listReq , ( err , resp ) => {
97+ const listResp = await new Promise < ListProgrammersAvailableForUploadResponse > ( ( resolve , reject ) => client . listProgrammersAvailableForUpload ( listReq , ( err , resp ) => {
9898 if ( err ) {
9999 reject ( err ) ;
100100 return ;
@@ -110,7 +110,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
110110
111111 let VID = 'N/A' ;
112112 let PID = 'N/A' ;
113- const usbId = detailsResp . getIdentificationPrefList ( ) . map ( item => item . getUsbid ( ) ) . find ( notEmpty ) ;
113+ const usbId = detailsResp . getIdentificationPrefsList ( ) . map ( item => item . getUsbId ( ) ) . find ( notEmpty ) ;
114114 if ( usbId ) {
115115 VID = usbId . getVid ( ) ;
116116 PID = usbId . getPid ( ) ;
@@ -147,7 +147,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
147147
148148 async searchBoards ( { query } : { query ?: string } ) : Promise < BoardWithPackage [ ] > {
149149 const { instance, client } = await this . coreClient ( ) ;
150- const req = new BoardSearchReq ( ) ;
150+ const req = new BoardSearchRequest ( ) ;
151151 req . setSearchArgs ( query || '' ) ;
152152 req . setInstance ( instance ) ;
153153 const boards = await new Promise < BoardWithPackage [ ] > ( ( resolve , reject ) => {
@@ -178,18 +178,18 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
178178 const coreClient = await this . coreClient ( ) ;
179179 const { client, instance } = coreClient ;
180180
181- const installedPlatformsReq = new PlatformListReq ( ) ;
181+ const installedPlatformsReq = new PlatformListRequest ( ) ;
182182 installedPlatformsReq . setInstance ( instance ) ;
183- const installedPlatformsResp = await new Promise < PlatformListResp > ( ( resolve , reject ) =>
183+ const installedPlatformsResp = await new Promise < PlatformListResponse > ( ( resolve , reject ) =>
184184 client . platformList ( installedPlatformsReq , ( err , resp ) => ( ! ! err ? reject : resolve ) ( ! ! err ? err : resp ) )
185185 ) ;
186- const installedPlatforms = installedPlatformsResp . getInstalledPlatformList ( ) ;
186+ const installedPlatforms = installedPlatformsResp . getInstalledPlatformsList ( ) ;
187187
188- const req = new PlatformSearchReq ( ) ;
188+ const req = new PlatformSearchRequest ( ) ;
189189 req . setSearchArgs ( options . query || '' ) ;
190190 req . setAllVersions ( true ) ;
191191 req . setInstance ( instance ) ;
192- const resp = await new Promise < PlatformSearchResp > ( ( resolve , reject ) => client . platformSearch ( req , ( err , resp ) => ( ! ! err ? reject : resolve ) ( ! ! err ? err : resp ) ) ) ;
192+ const resp = await new Promise < PlatformSearchResponse > ( ( resolve , reject ) => client . platformSearch ( req , ( err , resp ) => ( ! ! err ? reject : resolve ) ( ! ! err ? err : resp ) ) ) ;
193193 const packages = new Map < string , BoardsPackage > ( ) ;
194194 const toPackage = ( platform : Platform ) => {
195195 let installedVersion : string | undefined ;
@@ -262,15 +262,15 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
262262
263263 const [ platform , architecture ] = item . id . split ( ':' ) ;
264264
265- const req = new PlatformInstallReq ( ) ;
265+ const req = new PlatformInstallRequest ( ) ;
266266 req . setInstance ( instance ) ;
267267 req . setArchitecture ( architecture ) ;
268268 req . setPlatformPackage ( platform ) ;
269269 req . setVersion ( version ) ;
270270
271271 console . info ( '>>> Starting boards package installation...' , item ) ;
272272 const resp = client . platformInstall ( req ) ;
273- resp . on ( 'data' , ( r : PlatformInstallResp ) => {
273+ resp . on ( 'data' , ( r : PlatformInstallResponse ) => {
274274 const prog = r . getProgress ( ) ;
275275 if ( prog && prog . getFile ( ) ) {
276276 this . outputService . append ( { chunk : `downloading ${ prog . getFile ( ) } \n` } ) ;
@@ -298,15 +298,15 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
298298
299299 const [ platform , architecture ] = item . id . split ( ':' ) ;
300300
301- const req = new PlatformUninstallReq ( ) ;
301+ const req = new PlatformUninstallRequest ( ) ;
302302 req . setInstance ( instance ) ;
303303 req . setArchitecture ( architecture ) ;
304304 req . setPlatformPackage ( platform ) ;
305305
306306 console . info ( '>>> Starting boards package uninstallation...' , item ) ;
307307 let logged = false ;
308308 const resp = client . platformUninstall ( req ) ;
309- resp . on ( 'data' , ( _ : PlatformUninstallResp ) => {
309+ resp . on ( 'data' , ( _ : PlatformUninstallResponse ) => {
310310 if ( ! logged ) {
311311 this . outputService . append ( { chunk : `uninstalling ${ item . id } \n` } ) ;
312312 logged = true ;
0 commit comments