Skip to content

[ATL-1531] Integrate arduino-cli 0.19.1 #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
integrate cli 0.19.0
  • Loading branch information
Alberto Iannaccone committed Sep 17, 2021
commit 4528f2c82c7cf56d1d7d8c7fe65462fcf921fc6f
2 changes: 1 addition & 1 deletion arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
],
"arduino": {
"cli": {
"version": "0.18.3"
"version": "0.19.0"
},
"fwuploader": {
"version": "2.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class BurnBootloader extends SketchContribution {
}
try {
const { boardsConfig } = this.boardsServiceClientImpl;
const port = boardsConfig.selectedPort?.address;
const port = boardsConfig.selectedPort;
const [fqbn, { selectedProgrammer: programmer }, verify, verbose] =
await Promise.all([
this.boardsDataStore.appendConfigToFqbn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class UploadSketch extends SketchContribution {
const sketchUri = sketch.uri;
const optimizeForDebug = this.editorMode.compileForDebug;
const { selectedPort } = boardsConfig;
const port = selectedPort?.address;
const port = selectedPort;

if (usingProgrammer) {
const programmer = selectedProgrammer;
Expand Down
5 changes: 3 additions & 2 deletions arduino-ide-extension/src/common/protocol/core-service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Port } from '../../common/protocol/boards-service';
import { Programmer } from './boards-service';

export const CompilerWarningLiterals = [
Expand Down Expand Up @@ -39,7 +40,7 @@ export namespace CoreService {

export namespace Upload {
export interface Options extends Compile.Options {
readonly port?: string | undefined;
readonly port?: Port | undefined;
readonly programmer?: Programmer | undefined;
readonly verify: boolean;
}
Expand All @@ -48,7 +49,7 @@ export namespace CoreService {
export namespace Bootloader {
export interface Options {
readonly fqbn?: string | undefined;
readonly port?: string | undefined;
readonly port?: Port | undefined;
readonly programmer?: Programmer | undefined;
readonly verbose: boolean;
readonly verify: boolean;
Expand Down
9 changes: 6 additions & 3 deletions arduino-ide-extension/src/node/board-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class BoardDiscovery extends CoreClientAware {

@postConstruct()
protected async init(): Promise<void> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
const req = new BoardListWatchRequest();
Expand All @@ -75,12 +76,14 @@ export class BoardDiscovery extends CoreClientAware {
const oldState = deepClone(this._state);
const newState = deepClone(this._state);

const address = detectedPort.getAddress();
const protocol = Port.Protocol.toProtocol(detectedPort.getProtocol());
const address = (detectedPort as any).getPort().getAddress();
const protocol = Port.Protocol.toProtocol(
(detectedPort as any).getPort().getProtocol()
);
// const label = detectedPort.getProtocolLabel();
const port = { address, protocol };
const boards: Board[] = [];
for (const item of detectedPort.getBoardsList()) {
for (const item of detectedPort.getMatchingBoardsList()) {
boards.push({
fqbn: item.getFqbn(),
name: item.getName() || 'unknown',
Expand Down
17 changes: 11 additions & 6 deletions arduino-ide-extension/src/node/boards-service-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class BoardsServiceImpl
async getBoardDetails(options: {
fqbn: string;
}): Promise<BoardDetails | undefined> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
const { fqbn } = options;
Expand Down Expand Up @@ -165,13 +166,13 @@ export class BoardsServiceImpl

let VID = 'N/A';
let PID = 'N/A';
const usbId = detailsResp
.getIdentificationPrefsList()
.map((item) => item.getUsbId())
const prop = detailsResp
.getIdentificationPropertiesList()
.map((item) => item.getPropertiesMap())
.find(notEmpty);
if (usbId) {
VID = usbId.getVid();
PID = usbId.getPid();
if (prop) {
VID = prop.get('vid') || '';
PID = prop.get('pid') || '';
}

return {
Expand Down Expand Up @@ -214,6 +215,7 @@ export class BoardsServiceImpl
}: {
query?: string;
}): Promise<BoardWithPackage[]> {
await this.coreClientProvider.initialized;
const { instance, client } = await this.coreClient();
const req = new BoardSearchRequest();
req.setSearchArgs(query || '');
Expand Down Expand Up @@ -244,6 +246,7 @@ export class BoardsServiceImpl
}

async search(options: { query?: string }): Promise<BoardsPackage[]> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;

Expand Down Expand Up @@ -361,6 +364,7 @@ export class BoardsServiceImpl
const version = !!options.version
? options.version
: item.availableVersions[0];
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;

Expand Down Expand Up @@ -406,6 +410,7 @@ export class BoardsServiceImpl
progressId?: string;
}): Promise<void> {
const { item, progressId } = options;
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import * as jspb from "google-protobuf";
import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb";
import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/cli/commands/v1/port_pb";

export class BoardDetailsRequest extends jspb.Message {

Expand Down Expand Up @@ -79,11 +80,6 @@ export class BoardDetailsResponse extends jspb.Message {
setConfigOptionsList(value: Array<ConfigOption>): BoardDetailsResponse;
addConfigOptions(value?: ConfigOption, index?: number): ConfigOption;

clearIdentificationPrefsList(): void;
getIdentificationPrefsList(): Array<IdentificationPref>;
setIdentificationPrefsList(value: Array<IdentificationPref>): BoardDetailsResponse;
addIdentificationPrefs(value?: IdentificationPref, index?: number): IdentificationPref;

clearProgrammersList(): void;
getProgrammersList(): Array<cc_arduino_cli_commands_v1_common_pb.Programmer>;
setProgrammersList(value: Array<cc_arduino_cli_commands_v1_common_pb.Programmer>): BoardDetailsResponse;
Expand All @@ -92,6 +88,11 @@ export class BoardDetailsResponse extends jspb.Message {
getDebuggingSupported(): boolean;
setDebuggingSupported(value: boolean): BoardDetailsResponse;

clearIdentificationPropertiesList(): void;
getIdentificationPropertiesList(): Array<BoardIdentificationProperties>;
setIdentificationPropertiesList(value: Array<BoardIdentificationProperties>): BoardDetailsResponse;
addIdentificationProperties(value?: BoardIdentificationProperties, index?: number): BoardIdentificationProperties;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BoardDetailsResponse.AsObject;
Expand All @@ -116,58 +117,32 @@ export namespace BoardDetailsResponse {
platform?: BoardPlatform.AsObject,
toolsDependenciesList: Array<ToolsDependencies.AsObject>,
configOptionsList: Array<ConfigOption.AsObject>,
identificationPrefsList: Array<IdentificationPref.AsObject>,
programmersList: Array<cc_arduino_cli_commands_v1_common_pb.Programmer.AsObject>,
debuggingSupported: boolean,
identificationPropertiesList: Array<BoardIdentificationProperties.AsObject>,
}
}

export class IdentificationPref extends jspb.Message {
export class BoardIdentificationProperties extends jspb.Message {

hasUsbId(): boolean;
clearUsbId(): void;
getUsbId(): USBID | undefined;
setUsbId(value?: USBID): IdentificationPref;
getPropertiesMap(): jspb.Map<string, string>;
clearPropertiesMap(): void;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): IdentificationPref.AsObject;
static toObject(includeInstance: boolean, msg: IdentificationPref): IdentificationPref.AsObject;
toObject(includeInstance?: boolean): BoardIdentificationProperties.AsObject;
static toObject(includeInstance: boolean, msg: BoardIdentificationProperties): BoardIdentificationProperties.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: IdentificationPref, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): IdentificationPref;
static deserializeBinaryFromReader(message: IdentificationPref, reader: jspb.BinaryReader): IdentificationPref;
static serializeBinaryToWriter(message: BoardIdentificationProperties, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): BoardIdentificationProperties;
static deserializeBinaryFromReader(message: BoardIdentificationProperties, reader: jspb.BinaryReader): BoardIdentificationProperties;
}

export namespace IdentificationPref {
export namespace BoardIdentificationProperties {
export type AsObject = {
usbId?: USBID.AsObject,
}
}

export class USBID extends jspb.Message {
getVid(): string;
setVid(value: string): USBID;

getPid(): string;
setPid(value: string): USBID;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): USBID.AsObject;
static toObject(includeInstance: boolean, msg: USBID): USBID.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: USBID, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): USBID;
static deserializeBinaryFromReader(message: USBID, reader: jspb.BinaryReader): USBID;
}

export namespace USBID {
export type AsObject = {
vid: string,
pid: string,
propertiesMap: Array<[string, string]>,
}
}

Expand Down Expand Up @@ -480,6 +455,9 @@ export class BoardListRequest extends jspb.Message {
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): BoardListRequest;

getTimeout(): number;
setTimeout(value: number): BoardListRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BoardListRequest.AsObject;
Expand All @@ -494,6 +472,7 @@ export class BoardListRequest extends jspb.Message {
export namespace BoardListRequest {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
timeout: number,
}
}

Expand Down Expand Up @@ -521,22 +500,16 @@ export namespace BoardListResponse {
}

export class DetectedPort extends jspb.Message {
getAddress(): string;
setAddress(value: string): DetectedPort;

getProtocol(): string;
setProtocol(value: string): DetectedPort;

getProtocolLabel(): string;
setProtocolLabel(value: string): DetectedPort;
clearMatchingBoardsList(): void;
getMatchingBoardsList(): Array<BoardListItem>;
setMatchingBoardsList(value: Array<BoardListItem>): DetectedPort;
addMatchingBoards(value?: BoardListItem, index?: number): BoardListItem;

clearBoardsList(): void;
getBoardsList(): Array<BoardListItem>;
setBoardsList(value: Array<BoardListItem>): DetectedPort;
addBoards(value?: BoardListItem, index?: number): BoardListItem;

getSerialNumber(): string;
setSerialNumber(value: string): DetectedPort;
hasPort(): boolean;
clearPort(): void;
getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined;
setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): DetectedPort;


serializeBinary(): Uint8Array;
Expand All @@ -551,11 +524,8 @@ export class DetectedPort extends jspb.Message {

export namespace DetectedPort {
export type AsObject = {
address: string,
protocol: string,
protocolLabel: string,
boardsList: Array<BoardListItem.AsObject>,
serialNumber: string,
matchingBoardsList: Array<BoardListItem.AsObject>,
port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject,
}
}

Expand Down Expand Up @@ -686,12 +656,6 @@ export class BoardListItem extends jspb.Message {
getIsHidden(): boolean;
setIsHidden(value: boolean): BoardListItem;

getVid(): string;
setVid(value: string): BoardListItem;

getPid(): string;
setPid(value: string): BoardListItem;


hasPlatform(): boolean;
clearPlatform(): void;
Expand All @@ -714,8 +678,6 @@ export namespace BoardListItem {
name: string,
fqbn: string,
isHidden: boolean,
vid: string,
pid: string,
platform?: cc_arduino_cli_commands_v1_common_pb.Platform.AsObject,
}
}
Expand Down Expand Up @@ -773,4 +735,4 @@ export namespace BoardSearchResponse {
export type AsObject = {
boardsList: Array<BoardListItem.AsObject>,
}
}
}
Loading