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

* integrate cli 0.19.0

* Update CLI version used to fix crash on lib/core install/uninstall

* Update CLI version

* Update CLI version

* update cli version

Co-authored-by: Silvano Cerza <silvanocerza@gmail.com>
This commit is contained in:
Alberto Iannaccone 2021-09-30 09:02:09 +01:00 committed by GitHub
parent ba177be41d
commit 7f8b227c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 3208 additions and 1349 deletions

View File

@ -140,7 +140,7 @@
],
"arduino": {
"cli": {
"version": "0.18.3"
"version": "0.19.1"
},
"fwuploader": {
"version": "2.0.0"

View File

@ -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(

View File

@ -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;

View File

@ -1,3 +1,4 @@
import { Port } from '../../common/protocol/boards-service';
import { Programmer } from './boards-service';
export const CompilerWarningLiterals = [
@ -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;
}
@ -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;

View File

@ -2,7 +2,7 @@ import { injectable, inject, postConstruct, named } from 'inversify';
import { ClientDuplexStream } from '@grpc/grpc-js';
import { ILogger } from '@theia/core/lib/common/logger';
import { deepClone } from '@theia/core/lib/common/objects';
import { CoreClientAware } from './core-client-provider';
import { CoreClientAware, CoreClientProvider } from './core-client-provider';
import {
BoardListWatchRequest,
BoardListWatchResponse,
@ -29,6 +29,10 @@ export class BoardDiscovery extends CoreClientAware {
@inject(NotificationServiceServer)
protected readonly notificationService: NotificationServiceServer;
// Used to know if the board watch process is already running to avoid
// starting it multiple times
private watching: boolean;
protected boardWatchDuplex:
| ClientDuplexStream<BoardListWatchRequest, BoardListWatchResponse>
| undefined;
@ -51,11 +55,26 @@ export class BoardDiscovery extends CoreClientAware {
@postConstruct()
protected async init(): Promise<void> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
this.startBoardListWatch(coreClient);
}
startBoardListWatch(coreClient: CoreClientProvider.Client): void {
if (this.watching) {
// We want to avoid starting the board list watch process multiple
// times to meet unforseen consequences
return
}
this.watching = true;
const { client, instance } = coreClient;
const req = new BoardListWatchRequest();
req.setInstance(instance);
this.boardWatchDuplex = client.boardListWatch();
this.boardWatchDuplex.on('end', () => {
this.watching = false;
console.info('board watch ended')
})
this.boardWatchDuplex.on('data', (resp: BoardListWatchResponse) => {
const detectedPort = resp.getPort();
if (detectedPort) {
@ -75,12 +94,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',
@ -92,9 +113,7 @@ export class BoardDiscovery extends CoreClientAware {
if (newState[port.address] !== undefined) {
const [, knownBoards] = newState[port.address];
console.warn(
`Port '${
port.address
}' was already available. Known boards before override: ${JSON.stringify(
`Port '${port.address}' was already available. Known boards before override: ${JSON.stringify(
knownBoards
)}`
);

View File

@ -42,8 +42,7 @@ import { InstallWithProgress } from './grpc-installable';
@injectable()
export class BoardsServiceImpl
extends CoreClientAware
implements BoardsService
{
implements BoardsService {
@inject(ILogger)
protected logger: ILogger;
@ -75,6 +74,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;
@ -165,13 +165,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 {
@ -214,6 +214,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 || '');
@ -244,6 +245,7 @@ export class BoardsServiceImpl
}
async search(options: { query?: string }): Promise<BoardsPackage[]> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
@ -361,6 +363,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;
@ -382,7 +385,10 @@ export class BoardsServiceImpl
})
);
await new Promise<void>((resolve, reject) => {
resp.on('end', resolve);
resp.on('end', () => {
this.boardDiscovery.startBoardListWatch(coreClient)
resolve();
});
resp.on('error', (error) => {
this.responseService.appendToOutput({
chunk: `Failed to install platform: ${item.id}.\n`,
@ -406,6 +412,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;
@ -426,7 +433,10 @@ export class BoardsServiceImpl
})
);
await new Promise<void>((resolve, reject) => {
resp.on('end', resolve);
resp.on('end', () => {
this.boardDiscovery.startBoardListWatch(coreClient)
resolve();
});
resp.on('error', reject);
});

View File

@ -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 {
@ -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;
@ -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;
@ -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]>,
}
}
@ -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;
@ -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,
}
}
@ -521,22 +500,16 @@ export namespace BoardListResponse {
}
export class DetectedPort extends jspb.Message {
getAddress(): string;
setAddress(value: string): DetectedPort;
clearMatchingBoardsList(): void;
getMatchingBoardsList(): Array<BoardListItem>;
setMatchingBoardsList(value: Array<BoardListItem>): DetectedPort;
addMatchingBoards(value?: BoardListItem, index?: number): BoardListItem;
getProtocol(): string;
setProtocol(value: string): DetectedPort;
getProtocolLabel(): string;
setProtocolLabel(value: string): DetectedPort;
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;
@ -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,
}
}
@ -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;
@ -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,
}
}
@ -773,4 +735,4 @@ export namespace BoardSearchResponse {
export type AsObject = {
boardsList: Array<BoardListItem.AsObject>,
}
}
}

View File

@ -17,10 +17,13 @@ var global = Function('return this')();
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);
var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardAttachRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardAttachResponse', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardDetailsRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardDetailsResponse', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardListAllRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardListAllResponse', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardListItem', null, global);
@ -35,11 +38,9 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ConfigOption', null, global)
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ConfigValue', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DetectedPort', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Help', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.IdentificationPref', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Package', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Systems', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ToolsDependencies', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.USBID', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@ -92,37 +93,16 @@ if (goog.DEBUG && !COMPILED) {
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref = function(opt_data) {
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.IdentificationPref, jspb.Message);
goog.inherits(proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.displayName = 'proto.cc.arduino.cli.commands.v1.IdentificationPref';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.v1.USBID = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.USBID, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cc.arduino.cli.commands.v1.USBID.displayName = 'proto.cc.arduino.cli.commands.v1.USBID';
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.displayName = 'proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties';
}
/**
* Generated by JsPbCodeGenerator.
@ -710,7 +690,7 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsRequest.prototype.setFqbn = functio
* @private {!Array<number>}
* @const
*/
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.repeatedFields_ = [10,11,12,13];
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.repeatedFields_ = [10,11,13,15];
@ -756,11 +736,11 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.toObject = function(includ
proto.cc.arduino.cli.commands.v1.ToolsDependencies.toObject, includeInstance),
configOptionsList: jspb.Message.toObjectList(msg.getConfigOptionsList(),
proto.cc.arduino.cli.commands.v1.ConfigOption.toObject, includeInstance),
identificationPrefsList: jspb.Message.toObjectList(msg.getIdentificationPrefsList(),
proto.cc.arduino.cli.commands.v1.IdentificationPref.toObject, includeInstance),
programmersList: jspb.Message.toObjectList(msg.getProgrammersList(),
cc_arduino_cli_commands_v1_common_pb.Programmer.toObject, includeInstance),
debuggingSupported: jspb.Message.getBooleanFieldWithDefault(msg, 14, false)
debuggingSupported: jspb.Message.getBooleanFieldWithDefault(msg, 14, false),
identificationPropertiesList: jspb.Message.toObjectList(msg.getIdentificationPropertiesList(),
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.toObject, includeInstance)
};
if (includeInstance) {
@ -845,11 +825,6 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.deserializeBinaryFromReade
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.ConfigOption.deserializeBinaryFromReader);
msg.addConfigOptions(value);
break;
case 12:
var value = new proto.cc.arduino.cli.commands.v1.IdentificationPref;
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.IdentificationPref.deserializeBinaryFromReader);
msg.addIdentificationPrefs(value);
break;
case 13:
var value = new cc_arduino_cli_commands_v1_common_pb.Programmer;
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Programmer.deserializeBinaryFromReader);
@ -859,6 +834,11 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.deserializeBinaryFromReade
var value = /** @type {boolean} */ (reader.readBool());
msg.setDebuggingSupported(value);
break;
case 15:
var value = new proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties;
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.deserializeBinaryFromReader);
msg.addIdentificationProperties(value);
break;
default:
reader.skipField();
break;
@ -969,14 +949,6 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.serializeBinaryToWriter =
proto.cc.arduino.cli.commands.v1.ConfigOption.serializeBinaryToWriter
);
}
f = message.getIdentificationPrefsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
12,
f,
proto.cc.arduino.cli.commands.v1.IdentificationPref.serializeBinaryToWriter
);
}
f = message.getProgrammersList();
if (f.length > 0) {
writer.writeRepeatedMessage(
@ -992,6 +964,14 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.serializeBinaryToWriter =
f
);
}
f = message.getIdentificationPropertiesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
15,
f,
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.serializeBinaryToWriter
);
}
};
@ -1271,44 +1251,6 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.clearConfigOptio
};
/**
* repeated IdentificationPref identification_prefs = 12;
* @return {!Array<!proto.cc.arduino.cli.commands.v1.IdentificationPref>}
*/
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.getIdentificationPrefsList = function() {
return /** @type{!Array<!proto.cc.arduino.cli.commands.v1.IdentificationPref>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.IdentificationPref, 12));
};
/**
* @param {!Array<!proto.cc.arduino.cli.commands.v1.IdentificationPref>} value
* @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.setIdentificationPrefsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 12, value);
};
/**
* @param {!proto.cc.arduino.cli.commands.v1.IdentificationPref=} opt_value
* @param {number=} opt_index
* @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref}
*/
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.addIdentificationPrefs = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.cc.arduino.cli.commands.v1.IdentificationPref, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.clearIdentificationPrefsList = function() {
return this.setIdentificationPrefsList([]);
};
/**
* repeated Programmer programmers = 13;
* @return {!Array<!proto.cc.arduino.cli.commands.v1.Programmer>}
@ -1365,154 +1307,41 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.setDebuggingSupp
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
* repeated BoardIdentificationProperties identification_properties = 15;
* @return {!Array<!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties>}
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.IdentificationPref.toObject(opt_includeInstance, this);
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.getIdentificationPropertiesList = function() {
return /** @type{!Array<!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties, 15));
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.v1.IdentificationPref} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.toObject = function(includeInstance, msg) {
var f, obj = {
usbId: (f = msg.getUsbId()) && proto.cc.arduino.cli.commands.v1.USBID.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref}
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.v1.IdentificationPref;
return proto.cc.arduino.cli.commands.v1.IdentificationPref.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.commands.v1.IdentificationPref} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref}
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.cc.arduino.cli.commands.v1.USBID;
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader);
msg.setUsbId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.v1.IdentificationPref.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cc.arduino.cli.commands.v1.IdentificationPref} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUsbId();
if (f != null) {
writer.writeMessage(
1,
f,
proto.cc.arduino.cli.commands.v1.USBID.serializeBinaryToWriter
);
}
};
/**
* optional USBID usb_id = 1;
* @return {?proto.cc.arduino.cli.commands.v1.USBID}
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.getUsbId = function() {
return /** @type{?proto.cc.arduino.cli.commands.v1.USBID} */ (
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.USBID, 1));
};
/**
* @param {?proto.cc.arduino.cli.commands.v1.USBID|undefined} value
* @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref} returns this
* @param {!Array<!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties>} value
* @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.setUsbId = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.setIdentificationPropertiesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 15, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref} returns this
* @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties=} opt_value
* @param {number=} opt_index
* @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties}
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.clearUsbId = function() {
return this.setUsbId(undefined);
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.addIdentificationProperties = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 15, opt_value, proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties, opt_index);
};
/**
* Returns whether this field is set.
* @return {boolean}
* Clears the list making it empty but non-null.
* @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this
*/
proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.hasUsbId = function() {
return jspb.Message.getField(this, 1) != null;
proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.clearIdentificationPropertiesList = function() {
return this.setIdentificationPropertiesList([]);
};
@ -1532,8 +1361,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.commands.v1.USBID.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.USBID.toObject(opt_includeInstance, this);
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.toObject(opt_includeInstance, this);
};
@ -1542,14 +1371,13 @@ proto.cc.arduino.cli.commands.v1.USBID.prototype.toObject = function(opt_include
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.v1.USBID} msg The msg instance to transform.
* @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.USBID.toObject = function(includeInstance, msg) {
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.toObject = function(includeInstance, msg) {
var f, obj = {
vid: jspb.Message.getFieldWithDefault(msg, 1, ""),
pid: jspb.Message.getFieldWithDefault(msg, 2, "")
propertiesMap: (f = msg.getPropertiesMap()) ? f.toObject(includeInstance, undefined) : []
};
if (includeInstance) {
@ -1563,23 +1391,23 @@ proto.cc.arduino.cli.commands.v1.USBID.toObject = function(includeInstance, msg)
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.commands.v1.USBID}
* @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties}
*/
proto.cc.arduino.cli.commands.v1.USBID.deserializeBinary = function(bytes) {
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.v1.USBID;
return proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader(msg, reader);
var msg = new proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties;
return proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.commands.v1.USBID} msg The message object to deserialize into.
* @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.v1.USBID}
* @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties}
*/
proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader = function(msg, reader) {
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
@ -1587,12 +1415,10 @@ proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader = function(ms
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setVid(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setPid(value);
var value = msg.getPropertiesMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
});
break;
default:
reader.skipField();
@ -1607,9 +1433,9 @@ proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader = function(ms
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.commands.v1.USBID.prototype.serializeBinary = function() {
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.v1.USBID.serializeBinaryToWriter(this, writer);
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
@ -1617,63 +1443,39 @@ proto.cc.arduino.cli.commands.v1.USBID.prototype.serializeBinary = function() {
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cc.arduino.cli.commands.v1.USBID} message
* @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.USBID.serializeBinaryToWriter = function(message, writer) {
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getVid();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPid();
if (f.length > 0) {
writer.writeString(
2,
f
);
f = message.getPropertiesMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
};
/**
* optional string vid = 1;
* @return {string}
* map<string, string> properties = 1;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,string>}
*/
proto.cc.arduino.cli.commands.v1.USBID.prototype.getVid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.getPropertiesMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,string>} */ (
jspb.Message.getMapField(this, 1, opt_noLazyCreate,
null));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.USBID} returns this
* Clears values from the map. The map will be non-null.
* @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} returns this
*/
proto.cc.arduino.cli.commands.v1.USBID.prototype.setVid = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string pid = 2;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.USBID.prototype.getPid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.USBID} returns this
*/
proto.cc.arduino.cli.commands.v1.USBID.prototype.setPid = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.clearPropertiesMap = function() {
this.getPropertiesMap().clear();
return this;};
@ -3751,7 +3553,8 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.toObject = function(
*/
proto.cc.arduino.cli.commands.v1.BoardListRequest.toObject = function(includeInstance, msg) {
var f, obj = {
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f)
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
timeout: jspb.Message.getFieldWithDefault(msg, 2, 0)
};
if (includeInstance) {
@ -3793,6 +3596,10 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.deserializeBinaryFromReader =
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader);
msg.setInstance(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setTimeout(value);
break;
default:
reader.skipField();
break;
@ -3830,6 +3637,13 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.serializeBinaryToWriter = func
cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter
);
}
f = message.getTimeout();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
};
@ -3870,6 +3684,24 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.hasInstance = functi
};
/**
* optional int64 timeout = 2;
* @return {number}
*/
proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.getTimeout = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.cc.arduino.cli.commands.v1.BoardListRequest} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.setTimeout = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* List of repeated fields within this message type.
@ -4036,7 +3868,7 @@ proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.clearPortsList = fu
* @private {!Array<number>}
* @const
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.repeatedFields_ = [4];
proto.cc.arduino.cli.commands.v1.DetectedPort.repeatedFields_ = [1];
@ -4069,12 +3901,9 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.toObject = function(opt_
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.toObject = function(includeInstance, msg) {
var f, obj = {
address: jspb.Message.getFieldWithDefault(msg, 1, ""),
protocol: jspb.Message.getFieldWithDefault(msg, 2, ""),
protocolLabel: jspb.Message.getFieldWithDefault(msg, 3, ""),
boardsList: jspb.Message.toObjectList(msg.getBoardsList(),
matchingBoardsList: jspb.Message.toObjectList(msg.getMatchingBoardsList(),
proto.cc.arduino.cli.commands.v1.BoardListItem.toObject, includeInstance),
serialNumber: jspb.Message.getFieldWithDefault(msg, 5, "")
port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f)
};
if (includeInstance) {
@ -4112,25 +3941,14 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.deserializeBinaryFromReader = func
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setProtocol(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setProtocolLabel(value);
break;
case 4:
var value = new proto.cc.arduino.cli.commands.v1.BoardListItem;
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.BoardListItem.deserializeBinaryFromReader);
msg.addBoards(value);
msg.addMatchingBoards(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setSerialNumber(value);
case 2:
var value = new cc_arduino_cli_commands_v1_port_pb.Port;
reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader);
msg.setPort(value);
break;
default:
reader.skipField();
@ -4161,106 +3979,32 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.serializeBinary = functi
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getProtocol();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getProtocolLabel();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getBoardsList();
f = message.getMatchingBoardsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
4,
1,
f,
proto.cc.arduino.cli.commands.v1.BoardListItem.serializeBinaryToWriter
);
}
f = message.getSerialNumber();
if (f.length > 0) {
writer.writeString(
5,
f
f = message.getPort();
if (f != null) {
writer.writeMessage(
2,
f,
cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter
);
}
};
/**
* optional string address = 1;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setAddress = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string protocol = 2;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getProtocol = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setProtocol = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string protocol_label = 3;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getProtocolLabel = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setProtocolLabel = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* repeated BoardListItem boards = 4;
* repeated BoardListItem matching_boards = 1;
* @return {!Array<!proto.cc.arduino.cli.commands.v1.BoardListItem>}
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getBoardsList = function() {
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getMatchingBoardsList = function() {
return /** @type{!Array<!proto.cc.arduino.cli.commands.v1.BoardListItem>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.BoardListItem, 4));
jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.BoardListItem, 1));
};
@ -4268,8 +4012,8 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getBoardsList = function
* @param {!Array<!proto.cc.arduino.cli.commands.v1.BoardListItem>} value
* @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setBoardsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 4, value);
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setMatchingBoardsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 1, value);
};
@ -4278,8 +4022,8 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setBoardsList = function
* @param {number=} opt_index
* @return {!proto.cc.arduino.cli.commands.v1.BoardListItem}
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.addBoards = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.cc.arduino.cli.commands.v1.BoardListItem, opt_index);
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.addMatchingBoards = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.BoardListItem, opt_index);
};
@ -4287,26 +4031,45 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.addBoards = function(opt
* Clears the list making it empty but non-null.
* @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.clearBoardsList = function() {
return this.setBoardsList([]);
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.clearMatchingBoardsList = function() {
return this.setMatchingBoardsList([]);
};
/**
* optional string serial_number = 5;
* @return {string}
* optional Port port = 2;
* @return {?proto.cc.arduino.cli.commands.v1.Port}
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getSerialNumber = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getPort = function() {
return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ (
jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 2));
};
/**
* @param {string} value
* @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value
* @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setPort = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setSerialNumber = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.clearPort = function() {
return this.setPort(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.hasPort = function() {
return jspb.Message.getField(this, 2) != null;
};
@ -5134,8 +4897,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.toObject = function(includeInstan
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""),
isHidden: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
vid: jspb.Message.getFieldWithDefault(msg, 4, ""),
pid: jspb.Message.getFieldWithDefault(msg, 5, ""),
platform: (f = msg.getPlatform()) && cc_arduino_cli_commands_v1_common_pb.Platform.toObject(includeInstance, f)
};
@ -5185,14 +4946,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.deserializeBinaryFromReader = fun
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsHidden(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setVid(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setPid(value);
break;
case 6:
var value = new cc_arduino_cli_commands_v1_common_pb.Platform;
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Platform.deserializeBinaryFromReader);
@ -5248,20 +5001,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.serializeBinaryToWriter = functio
f
);
}
f = message.getVid();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getPid();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getPlatform();
if (f != null) {
writer.writeMessage(
@ -5327,42 +5066,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.setIsHidden = function(
};
/**
* optional string vid = 4;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.getVid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.BoardListItem} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.setVid = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional string pid = 5;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.getPid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.BoardListItem} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.setPid = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional Platform platform = 6;
* @return {?proto.cc.arduino.cli.commands.v1.Platform}
@ -5771,4 +5474,4 @@ proto.cc.arduino.cli.commands.v1.BoardSearchResponse.prototype.clearBoardsList =
};
goog.object.extend(exports, proto.cc.arduino.cli.commands.v1);
goog.object.extend(exports, proto.cc.arduino.cli.commands.v1);

View File

@ -7,6 +7,7 @@
import * as grpc from "@grpc/grpc-js";
import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call";
import * as cc_arduino_cli_commands_v1_commands_pb from "../../../../../cc/arduino/cli/commands/v1/commands_pb";
import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb";
import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb";
import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb";
import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb";
@ -15,9 +16,9 @@ import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino
import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb";
interface IArduinoCoreServiceService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
create: IArduinoCoreServiceService_ICreate;
init: IArduinoCoreServiceService_IInit;
destroy: IArduinoCoreServiceService_IDestroy;
rescan: IArduinoCoreServiceService_IRescan;
updateIndex: IArduinoCoreServiceService_IUpdateIndex;
updateLibrariesIndex: IArduinoCoreServiceService_IUpdateLibrariesIndex;
updateCoreLibrariesIndex: IArduinoCoreServiceService_IUpdateCoreLibrariesIndex;
@ -54,6 +55,15 @@ interface IArduinoCoreServiceService extends grpc.ServiceDefinition<grpc.Untyped
libraryList: IArduinoCoreServiceService_ILibraryList;
}
interface IArduinoCoreServiceService_ICreate extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_commands_pb.CreateRequest, cc_arduino_cli_commands_v1_commands_pb.CreateResponse> {
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/Create";
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_commands_pb.CreateRequest>;
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_commands_pb.CreateRequest>;
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_commands_pb.CreateResponse>;
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_commands_pb.CreateResponse>;
}
interface IArduinoCoreServiceService_IInit extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_commands_pb.InitRequest, cc_arduino_cli_commands_v1_commands_pb.InitResponse> {
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/Init";
requestStream: false;
@ -72,15 +82,6 @@ interface IArduinoCoreServiceService_IDestroy extends grpc.MethodDefinition<cc_a
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_commands_pb.DestroyResponse>;
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_commands_pb.DestroyResponse>;
}
interface IArduinoCoreServiceService_IRescan extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_commands_pb.RescanRequest, cc_arduino_cli_commands_v1_commands_pb.RescanResponse> {
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/Rescan";
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_commands_pb.RescanRequest>;
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_commands_pb.RescanRequest>;
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_commands_pb.RescanResponse>;
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_commands_pb.RescanResponse>;
}
interface IArduinoCoreServiceService_IUpdateIndex extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, cc_arduino_cli_commands_v1_commands_pb.UpdateIndexResponse> {
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateIndex";
requestStream: false;
@ -391,9 +392,9 @@ interface IArduinoCoreServiceService_ILibraryList extends grpc.MethodDefinition<
export const ArduinoCoreServiceService: IArduinoCoreServiceService;
export interface IArduinoCoreServiceServer {
create: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_commands_pb.CreateRequest, cc_arduino_cli_commands_v1_commands_pb.CreateResponse>;
init: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_commands_pb.InitRequest, cc_arduino_cli_commands_v1_commands_pb.InitResponse>;
destroy: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, cc_arduino_cli_commands_v1_commands_pb.DestroyResponse>;
rescan: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_commands_pb.RescanRequest, cc_arduino_cli_commands_v1_commands_pb.RescanResponse>;
updateIndex: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, cc_arduino_cli_commands_v1_commands_pb.UpdateIndexResponse>;
updateLibrariesIndex: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexRequest, cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexResponse>;
updateCoreLibrariesIndex: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_commands_pb.UpdateCoreLibrariesIndexRequest, cc_arduino_cli_commands_v1_commands_pb.UpdateCoreLibrariesIndexResponse>;
@ -431,14 +432,14 @@ export interface IArduinoCoreServiceServer {
}
export interface IArduinoCoreServiceClient {
create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall;
create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall;
create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall;
init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.InitResponse>;
init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.InitResponse>;
destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall;
destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall;
destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall;
rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall;
rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall;
rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall;
updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.UpdateIndexResponse>;
updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.UpdateIndexResponse>;
updateLibrariesIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexResponse>;
@ -526,14 +527,14 @@ export interface IArduinoCoreServiceClient {
export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCoreServiceClient {
constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial<grpc.ClientOptions>);
public create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall;
public create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall;
public create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall;
public init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.InitResponse>;
public init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.InitResponse>;
public destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall;
public destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall;
public destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall;
public rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall;
public rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall;
public rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall;
public updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.UpdateIndexResponse>;
public updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.UpdateIndexResponse>;
public updateLibrariesIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexResponse>;
@ -616,4 +617,4 @@ export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCor
public libraryList(request: cc_arduino_cli_commands_v1_lib_pb.LibraryListRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_lib_pb.LibraryListResponse) => void): grpc.ClientUnaryCall;
public libraryList(request: cc_arduino_cli_commands_v1_lib_pb.LibraryListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_lib_pb.LibraryListResponse) => void): grpc.ClientUnaryCall;
public libraryList(request: cc_arduino_cli_commands_v1_lib_pb.LibraryListRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_lib_pb.LibraryListResponse) => void): grpc.ClientUnaryCall;
}
}

View File

@ -18,6 +18,7 @@
//
'use strict';
var cc_arduino_cli_commands_v1_commands_pb = require('../../../../../cc/arduino/cli/commands/v1/commands_pb.js');
var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js');
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
var cc_arduino_cli_commands_v1_board_pb = require('../../../../../cc/arduino/cli/commands/v1/board_pb.js');
var cc_arduino_cli_commands_v1_compile_pb = require('../../../../../cc/arduino/cli/commands/v1/compile_pb.js');
@ -223,6 +224,28 @@ function deserialize_cc_arduino_cli_commands_v1_CompileResponse(buffer_arg) {
return cc_arduino_cli_commands_v1_compile_pb.CompileResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_commands_v1_CreateRequest(arg) {
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.CreateRequest)) {
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.CreateRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_commands_v1_CreateRequest(buffer_arg) {
return cc_arduino_cli_commands_v1_commands_pb.CreateRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_commands_v1_CreateResponse(arg) {
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.CreateResponse)) {
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.CreateResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_commands_v1_CreateResponse(buffer_arg) {
return cc_arduino_cli_commands_v1_commands_pb.CreateResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_commands_v1_DestroyRequest(arg) {
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.DestroyRequest)) {
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.DestroyRequest');
@ -641,28 +664,6 @@ function deserialize_cc_arduino_cli_commands_v1_PlatformUpgradeResponse(buffer_a
return cc_arduino_cli_commands_v1_core_pb.PlatformUpgradeResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_commands_v1_RescanRequest(arg) {
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.RescanRequest)) {
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.RescanRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_commands_v1_RescanRequest(buffer_arg) {
return cc_arduino_cli_commands_v1_commands_pb.RescanRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_commands_v1_RescanResponse(arg) {
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.RescanResponse)) {
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.RescanResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_commands_v1_RescanResponse(buffer_arg) {
return cc_arduino_cli_commands_v1_commands_pb.RescanResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_commands_v1_UpdateCoreLibrariesIndexRequest(arg) {
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.UpdateCoreLibrariesIndexRequest)) {
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.UpdateCoreLibrariesIndexRequest');
@ -842,7 +843,20 @@ function deserialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse(buffer
// The main Arduino Platform service API
var ArduinoCoreServiceService = exports['cc.arduino.cli.commands.v1.ArduinoCoreService'] = {
// Start a new instance of the Arduino Core Service
// Create a new Arduino Core instance
create: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Create',
requestStream: false,
responseStream: false,
requestType: cc_arduino_cli_commands_v1_commands_pb.CreateRequest,
responseType: cc_arduino_cli_commands_v1_commands_pb.CreateResponse,
requestSerialize: serialize_cc_arduino_cli_commands_v1_CreateRequest,
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_CreateRequest,
responseSerialize: serialize_cc_arduino_cli_commands_v1_CreateResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_CreateResponse,
},
// Initializes an existing Arduino Core instance by loading platforms and
// libraries
init: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Init',
requestStream: false,
@ -866,18 +880,6 @@ destroy: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_DestroyResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_DestroyResponse,
},
// Rescan instance of the Arduino Core Service
rescan: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Rescan',
requestStream: false,
responseStream: false,
requestType: cc_arduino_cli_commands_v1_commands_pb.RescanRequest,
responseType: cc_arduino_cli_commands_v1_commands_pb.RescanResponse,
requestSerialize: serialize_cc_arduino_cli_commands_v1_RescanRequest,
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_RescanRequest,
responseSerialize: serialize_cc_arduino_cli_commands_v1_RescanResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_RescanResponse,
},
// Update package index of the Arduino Core Service
updateIndex: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateIndex',
@ -1297,4 +1299,4 @@ libraryList: {
};
// BOOTSTRAP COMMANDS
// -------------------
// -------------------

View File

@ -5,6 +5,7 @@
/* eslint-disable */
import * as jspb from "google-protobuf";
import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb";
import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb";
import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb";
import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb";
@ -12,9 +13,53 @@ import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/c
import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb";
import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb";
export class CreateRequest extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CreateRequest.AsObject;
static toObject(includeInstance: boolean, msg: CreateRequest): CreateRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: CreateRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): CreateRequest;
static deserializeBinaryFromReader(message: CreateRequest, reader: jspb.BinaryReader): CreateRequest;
}
export namespace CreateRequest {
export type AsObject = {
}
}
export class CreateResponse extends jspb.Message {
hasInstance(): boolean;
clearInstance(): void;
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): CreateResponse;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CreateResponse.AsObject;
static toObject(includeInstance: boolean, msg: CreateResponse): CreateResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: CreateResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): CreateResponse;
static deserializeBinaryFromReader(message: CreateResponse, reader: jspb.BinaryReader): CreateResponse;
}
export namespace CreateResponse {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
}
}
export class InitRequest extends jspb.Message {
getLibraryManagerOnly(): boolean;
setLibraryManagerOnly(value: boolean): InitRequest;
hasInstance(): boolean;
clearInstance(): void;
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): InitRequest;
serializeBinary(): Uint8Array;
@ -29,37 +74,25 @@ export class InitRequest extends jspb.Message {
export namespace InitRequest {
export type AsObject = {
libraryManagerOnly: boolean,
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
}
}
export class InitResponse extends jspb.Message {
hasInstance(): boolean;
clearInstance(): void;
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): InitResponse;
clearPlatformsIndexErrorsList(): void;
getPlatformsIndexErrorsList(): Array<string>;
setPlatformsIndexErrorsList(value: Array<string>): InitResponse;
addPlatformsIndexErrors(value: string, index?: number): string;
getLibrariesIndexError(): string;
setLibrariesIndexError(value: string): InitResponse;
hasInitProgress(): boolean;
clearInitProgress(): void;
getInitProgress(): InitResponse.Progress | undefined;
setInitProgress(value?: InitResponse.Progress): InitResponse;
hasDownloadProgress(): boolean;
clearDownloadProgress(): void;
getDownloadProgress(): cc_arduino_cli_commands_v1_common_pb.DownloadProgress | undefined;
setDownloadProgress(value?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress): InitResponse;
hasError(): boolean;
clearError(): void;
getError(): google_rpc_status_pb.Status | undefined;
setError(value?: google_rpc_status_pb.Status): InitResponse;
hasTaskProgress(): boolean;
clearTaskProgress(): void;
getTaskProgress(): cc_arduino_cli_commands_v1_common_pb.TaskProgress | undefined;
setTaskProgress(value?: cc_arduino_cli_commands_v1_common_pb.TaskProgress): InitResponse;
getMessageCase(): InitResponse.MessageCase;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): InitResponse.AsObject;
@ -73,12 +106,52 @@ export class InitResponse extends jspb.Message {
export namespace InitResponse {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
platformsIndexErrorsList: Array<string>,
librariesIndexError: string,
downloadProgress?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress.AsObject,
taskProgress?: cc_arduino_cli_commands_v1_common_pb.TaskProgress.AsObject,
initProgress?: InitResponse.Progress.AsObject,
error?: google_rpc_status_pb.Status.AsObject,
}
export class Progress extends jspb.Message {
hasDownloadProgress(): boolean;
clearDownloadProgress(): void;
getDownloadProgress(): cc_arduino_cli_commands_v1_common_pb.DownloadProgress | undefined;
setDownloadProgress(value?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress): Progress;
hasTaskProgress(): boolean;
clearTaskProgress(): void;
getTaskProgress(): cc_arduino_cli_commands_v1_common_pb.TaskProgress | undefined;
setTaskProgress(value?: cc_arduino_cli_commands_v1_common_pb.TaskProgress): Progress;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Progress.AsObject;
static toObject(includeInstance: boolean, msg: Progress): Progress.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Progress, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Progress;
static deserializeBinaryFromReader(message: Progress, reader: jspb.BinaryReader): Progress;
}
export namespace Progress {
export type AsObject = {
downloadProgress?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress.AsObject,
taskProgress?: cc_arduino_cli_commands_v1_common_pb.TaskProgress.AsObject,
}
}
export enum MessageCase {
MESSAGE_NOT_SET = 0,
INIT_PROGRESS = 1,
ERROR = 2,
}
}
export class DestroyRequest extends jspb.Message {
@ -122,57 +195,6 @@ export namespace DestroyResponse {
}
}
export class RescanRequest extends jspb.Message {
hasInstance(): boolean;
clearInstance(): void;
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): RescanRequest;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): RescanRequest.AsObject;
static toObject(includeInstance: boolean, msg: RescanRequest): RescanRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: RescanRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): RescanRequest;
static deserializeBinaryFromReader(message: RescanRequest, reader: jspb.BinaryReader): RescanRequest;
}
export namespace RescanRequest {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
}
}
export class RescanResponse extends jspb.Message {
clearPlatformsIndexErrorsList(): void;
getPlatformsIndexErrorsList(): Array<string>;
setPlatformsIndexErrorsList(value: Array<string>): RescanResponse;
addPlatformsIndexErrors(value: string, index?: number): string;
getLibrariesIndexError(): string;
setLibrariesIndexError(value: string): RescanResponse;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): RescanResponse.AsObject;
static toObject(includeInstance: boolean, msg: RescanResponse): RescanResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: RescanResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): RescanResponse;
static deserializeBinaryFromReader(message: RescanResponse, reader: jspb.BinaryReader): RescanResponse;
}
export namespace RescanResponse {
export type AsObject = {
platformsIndexErrorsList: Array<string>,
librariesIndexError: string,
}
}
export class UpdateIndexRequest extends jspb.Message {
hasInstance(): boolean;
@ -582,4 +604,4 @@ export class ArchiveSketchResponse extends jspb.Message {
export namespace ArchiveSketchResponse {
export type AsObject = {
}
}
}

View File

@ -194,6 +194,23 @@ export namespace PlatformUninstallResponse {
}
}
export class AlreadyAtLatestVersionError extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AlreadyAtLatestVersionError.AsObject;
static toObject(includeInstance: boolean, msg: AlreadyAtLatestVersionError): AlreadyAtLatestVersionError.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: AlreadyAtLatestVersionError, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AlreadyAtLatestVersionError;
static deserializeBinaryFromReader(message: AlreadyAtLatestVersionError, reader: jspb.BinaryReader): AlreadyAtLatestVersionError;
}
export namespace AlreadyAtLatestVersionError {
export type AsObject = {
}
}
export class PlatformUpgradeRequest extends jspb.Message {
hasInstance(): boolean;
@ -369,4 +386,4 @@ export namespace PlatformListResponse {
export type AsObject = {
installedPlatformsList: Array<cc_arduino_cli_commands_v1_common_pb.Platform.AsObject>,
}
}
}

View File

@ -17,6 +17,7 @@ var global = Function('return this')();
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformDownloadRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformDownloadResponse', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformInstallRequest', null, global);
@ -155,6 +156,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.cc.arduino.cli.commands.v1.PlatformUninstallResponse.displayName = 'proto.cc.arduino.cli.commands.v1.PlatformUninstallResponse';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.displayName = 'proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@ -1511,6 +1533,107 @@ proto.cc.arduino.cli.commands.v1.PlatformUninstallResponse.prototype.hasTaskProg
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError}
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError;
return proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError}
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
@ -2693,4 +2816,4 @@ proto.cc.arduino.cli.commands.v1.PlatformListResponse.prototype.clearInstalledPl
};
goog.object.extend(exports, proto.cc.arduino.cli.commands.v1);
goog.object.extend(exports, proto.cc.arduino.cli.commands.v1);

View File

@ -0,0 +1 @@
// GENERATED CODE -- NO SERVICES IN PROTO

View File

@ -0,0 +1,46 @@
// package: cc.arduino.cli.commands.v1
// file: cc/arduino/cli/commands/v1/port.proto
/* tslint:disable */
/* eslint-disable */
import * as jspb from "google-protobuf";
export class Port extends jspb.Message {
getAddress(): string;
setAddress(value: string): Port;
getLabel(): string;
setLabel(value: string): Port;
getProtocol(): string;
setProtocol(value: string): Port;
getProtocolLabel(): string;
setProtocolLabel(value: string): Port;
getPropertiesMap(): jspb.Map<string, string>;
clearPropertiesMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Port.AsObject;
static toObject(includeInstance: boolean, msg: Port): Port.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Port, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Port;
static deserializeBinaryFromReader(message: Port, reader: jspb.BinaryReader): Port;
}
export namespace Port {
export type AsObject = {
address: string,
label: string,
protocol: string,
protocolLabel: string,
propertiesMap: Array<[string, string]>,
}
}

View File

@ -0,0 +1,293 @@
// source: cc/arduino/cli/commands/v1/port.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Port', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.v1.Port = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.Port, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cc.arduino.cli.commands.v1.Port.displayName = 'proto.cc.arduino.cli.commands.v1.Port';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.Port.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.v1.Port} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.Port.toObject = function(includeInstance, msg) {
var f, obj = {
address: jspb.Message.getFieldWithDefault(msg, 1, ""),
label: jspb.Message.getFieldWithDefault(msg, 2, ""),
protocol: jspb.Message.getFieldWithDefault(msg, 3, ""),
protocolLabel: jspb.Message.getFieldWithDefault(msg, 4, ""),
propertiesMap: (f = msg.getPropertiesMap()) ? f.toObject(includeInstance, undefined) : []
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.commands.v1.Port}
*/
proto.cc.arduino.cli.commands.v1.Port.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.v1.Port;
return proto.cc.arduino.cli.commands.v1.Port.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.commands.v1.Port} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.v1.Port}
*/
proto.cc.arduino.cli.commands.v1.Port.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setLabel(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setProtocol(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setProtocolLabel(value);
break;
case 5:
var value = msg.getPropertiesMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
});
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.v1.Port.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cc.arduino.cli.commands.v1.Port} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.Port.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getLabel();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getProtocol();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getProtocolLabel();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getPropertiesMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
};
/**
* optional string address = 1;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.Port} returns this
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.setAddress = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string label = 2;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.getLabel = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.Port} returns this
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.setLabel = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string protocol = 3;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.getProtocol = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.Port} returns this
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.setProtocol = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string protocol_label = 4;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.getProtocolLabel = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.Port} returns this
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.setProtocolLabel = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* map<string, string> properties = 5;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,string>}
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.getPropertiesMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,string>} */ (
jspb.Message.getMapField(this, 5, opt_noLazyCreate,
null));
};
/**
* Clears values from the map. The map will be non-null.
* @return {!proto.cc.arduino.cli.commands.v1.Port} returns this
*/
proto.cc.arduino.cli.commands.v1.Port.prototype.clearPropertiesMap = function() {
this.getPropertiesMap().clear();
return this;};
goog.object.extend(exports, proto.cc.arduino.cli.commands.v1);

View File

@ -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 UploadRequest extends jspb.Message {
@ -20,8 +21,11 @@ export class UploadRequest extends jspb.Message {
getSketchPath(): string;
setSketchPath(value: string): UploadRequest;
getPort(): string;
setPort(value: string): UploadRequest;
hasPort(): boolean;
clearPort(): void;
getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined;
setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): UploadRequest;
getVerbose(): boolean;
setVerbose(value: boolean): UploadRequest;
@ -38,6 +42,13 @@ export class UploadRequest extends jspb.Message {
getProgrammer(): string;
setProgrammer(value: string): UploadRequest;
getDryRun(): boolean;
setDryRun(value: boolean): UploadRequest;
getUserFieldsMap(): jspb.Map<string, string>;
clearUserFieldsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UploadRequest.AsObject;
@ -54,12 +65,15 @@ export namespace UploadRequest {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
fqbn: string,
sketchPath: string,
port: string,
port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject,
verbose: boolean,
verify: boolean,
importFile: string,
importDir: string,
programmer: string,
dryRun: boolean,
userFieldsMap: Array<[string, string]>,
}
}
@ -92,6 +106,23 @@ export namespace UploadResponse {
}
}
export class ProgrammerIsRequiredForUploadError extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProgrammerIsRequiredForUploadError.AsObject;
static toObject(includeInstance: boolean, msg: ProgrammerIsRequiredForUploadError): ProgrammerIsRequiredForUploadError.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: ProgrammerIsRequiredForUploadError, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ProgrammerIsRequiredForUploadError;
static deserializeBinaryFromReader(message: ProgrammerIsRequiredForUploadError, reader: jspb.BinaryReader): ProgrammerIsRequiredForUploadError;
}
export namespace ProgrammerIsRequiredForUploadError {
export type AsObject = {
}
}
export class UploadUsingProgrammerRequest extends jspb.Message {
hasInstance(): boolean;
@ -105,8 +136,11 @@ export class UploadUsingProgrammerRequest extends jspb.Message {
getSketchPath(): string;
setSketchPath(value: string): UploadUsingProgrammerRequest;
getPort(): string;
setPort(value: string): UploadUsingProgrammerRequest;
hasPort(): boolean;
clearPort(): void;
getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined;
setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): UploadUsingProgrammerRequest;
getVerbose(): boolean;
setVerbose(value: boolean): UploadUsingProgrammerRequest;
@ -123,6 +157,13 @@ export class UploadUsingProgrammerRequest extends jspb.Message {
getProgrammer(): string;
setProgrammer(value: string): UploadUsingProgrammerRequest;
getDryRun(): boolean;
setDryRun(value: boolean): UploadUsingProgrammerRequest;
getUserFieldsMap(): jspb.Map<string, string>;
clearUserFieldsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UploadUsingProgrammerRequest.AsObject;
@ -139,12 +180,15 @@ export namespace UploadUsingProgrammerRequest {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
fqbn: string,
sketchPath: string,
port: string,
port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject,
verbose: boolean,
verify: boolean,
importFile: string,
importDir: string,
programmer: string,
dryRun: boolean,
userFieldsMap: Array<[string, string]>,
}
}
@ -187,8 +231,11 @@ export class BurnBootloaderRequest extends jspb.Message {
getFqbn(): string;
setFqbn(value: string): BurnBootloaderRequest;
getPort(): string;
setPort(value: string): BurnBootloaderRequest;
hasPort(): boolean;
clearPort(): void;
getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined;
setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): BurnBootloaderRequest;
getVerbose(): boolean;
setVerbose(value: boolean): BurnBootloaderRequest;
@ -199,6 +246,13 @@ export class BurnBootloaderRequest extends jspb.Message {
getProgrammer(): string;
setProgrammer(value: string): BurnBootloaderRequest;
getDryRun(): boolean;
setDryRun(value: boolean): BurnBootloaderRequest;
getUserFieldsMap(): jspb.Map<string, string>;
clearUserFieldsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BurnBootloaderRequest.AsObject;
@ -214,10 +268,13 @@ export namespace BurnBootloaderRequest {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
fqbn: string,
port: string,
port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject,
verbose: boolean,
verify: boolean,
programmer: string,
dryRun: boolean,
userFieldsMap: Array<[string, string]>,
}
}
@ -300,3 +357,91 @@ export namespace ListProgrammersAvailableForUploadResponse {
programmersList: Array<cc_arduino_cli_commands_v1_common_pb.Programmer.AsObject>,
}
}
export class SupportedUserFieldsRequest extends jspb.Message {
hasInstance(): boolean;
clearInstance(): void;
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): SupportedUserFieldsRequest;
getFqbn(): string;
setFqbn(value: string): SupportedUserFieldsRequest;
getProtocol(): string;
setProtocol(value: string): SupportedUserFieldsRequest;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): SupportedUserFieldsRequest.AsObject;
static toObject(includeInstance: boolean, msg: SupportedUserFieldsRequest): SupportedUserFieldsRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: SupportedUserFieldsRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): SupportedUserFieldsRequest;
static deserializeBinaryFromReader(message: SupportedUserFieldsRequest, reader: jspb.BinaryReader): SupportedUserFieldsRequest;
}
export namespace SupportedUserFieldsRequest {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
fqbn: string,
protocol: string,
}
}
export class UserField extends jspb.Message {
getToolId(): string;
setToolId(value: string): UserField;
getName(): string;
setName(value: string): UserField;
getLabel(): string;
setLabel(value: string): UserField;
getSecret(): boolean;
setSecret(value: boolean): UserField;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UserField.AsObject;
static toObject(includeInstance: boolean, msg: UserField): UserField.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: UserField, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UserField;
static deserializeBinaryFromReader(message: UserField, reader: jspb.BinaryReader): UserField;
}
export namespace UserField {
export type AsObject = {
toolId: string,
name: string,
label: string,
secret: boolean,
}
}
export class SupportedUserFieldsResponse extends jspb.Message {
clearUserFieldsList(): void;
getUserFieldsList(): Array<UserField>;
setUserFieldsList(value: Array<UserField>): SupportedUserFieldsResponse;
addUserFields(value?: UserField, index?: number): UserField;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): SupportedUserFieldsResponse.AsObject;
static toObject(includeInstance: boolean, msg: SupportedUserFieldsResponse): SupportedUserFieldsResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: SupportedUserFieldsResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): SupportedUserFieldsResponse;
static deserializeBinaryFromReader(message: SupportedUserFieldsResponse, reader: jspb.BinaryReader): SupportedUserFieldsResponse;
}
export namespace SupportedUserFieldsResponse {
export type AsObject = {
userFieldsList: Array<UserField.AsObject>,
}
}

View File

@ -8,6 +8,7 @@ import * as grpc from "@grpc/grpc-js";
import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call";
import * as cc_arduino_cli_debug_v1_debug_pb from "../../../../../cc/arduino/cli/debug/v1/debug_pb";
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";
interface IDebugServiceService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
debug: IDebugServiceService_IDebug;
@ -56,4 +57,4 @@ export class DebugServiceClient extends grpc.Client implements IDebugServiceClie
public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall;
public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall;
public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall;
}
}

View File

@ -19,6 +19,7 @@
'use strict';
var cc_arduino_cli_debug_v1_debug_pb = require('../../../../../cc/arduino/cli/debug/v1/debug_pb.js');
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js');
function serialize_cc_arduino_cli_debug_v1_DebugConfigRequest(arg) {
if (!(arg instanceof cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest)) {
@ -91,4 +92,3 @@ debug: {
responseDeserialize: deserialize_cc_arduino_cli_debug_v1_GetDebugConfigResponse,
},
};

View File

@ -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 DebugRequest extends jspb.Message {
@ -54,8 +55,11 @@ export class DebugConfigRequest extends jspb.Message {
getSketchPath(): string;
setSketchPath(value: string): DebugConfigRequest;
getPort(): string;
setPort(value: string): DebugConfigRequest;
hasPort(): boolean;
clearPort(): void;
getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined;
setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): DebugConfigRequest;
getInterpreter(): string;
setInterpreter(value: string): DebugConfigRequest;
@ -82,7 +86,7 @@ export namespace DebugConfigRequest {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
fqbn: string,
sketchPath: string,
port: string,
port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject,
interpreter: string,
importDir: string,
programmer: string,
@ -167,4 +171,4 @@ export namespace GetDebugConfigResponse {
serverConfigurationMap: Array<[string, string]>,
}
}
}

View File

@ -17,6 +17,8 @@ var global = Function('return this')();
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);
var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb);
goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugConfigRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugResponse', null, global);
@ -375,7 +377,7 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.toObject = function(includeInst
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""),
sketchPath: jspb.Message.getFieldWithDefault(msg, 3, ""),
port: jspb.Message.getFieldWithDefault(msg, 4, ""),
port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f),
interpreter: jspb.Message.getFieldWithDefault(msg, 5, ""),
importDir: jspb.Message.getFieldWithDefault(msg, 8, ""),
programmer: jspb.Message.getFieldWithDefault(msg, 9, "")
@ -429,7 +431,8 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.deserializeBinaryFromReader = f
msg.setSketchPath(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
var value = new cc_arduino_cli_commands_v1_port_pb.Port;
reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader);
msg.setPort(value);
break;
case 5:
@ -496,10 +499,11 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.serializeBinaryToWriter = funct
);
}
f = message.getPort();
if (f.length > 0) {
writer.writeString(
if (f != null) {
writer.writeMessage(
4,
f
f,
cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter
);
}
f = message.getInterpreter();
@ -600,20 +604,39 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setSketchPath = funct
/**
* optional string port = 4;
* @return {string}
* optional cc.arduino.cli.commands.v1.Port port = 4;
* @return {?proto.cc.arduino.cli.commands.v1.Port}
*/
proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getPort = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ (
jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 4));
};
/**
* @param {string} value
* @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value
* @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this
*/
proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setPort = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this
*/
proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setPort = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.clearPort = function() {
return this.setPort(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.hasPort = function() {
return jspb.Message.getField(this, 4) != null;
};
@ -1201,4 +1224,4 @@ proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.clearServerConfig
return this;};
goog.object.extend(exports, proto.cc.arduino.cli.debug.v1);
goog.object.extend(exports, proto.cc.arduino.cli.debug.v1);

View File

@ -0,0 +1 @@
// GENERATED CODE -- NO SERVICES IN PROTO

View File

@ -0,0 +1,39 @@
// package: google.rpc
// file: google/rpc/status.proto
/* tslint:disable */
/* eslint-disable */
import * as jspb from "google-protobuf";
import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb";
export class Status extends jspb.Message {
getCode(): number;
setCode(value: number): Status;
getMessage(): string;
setMessage(value: string): Status;
clearDetailsList(): void;
getDetailsList(): Array<google_protobuf_any_pb.Any>;
setDetailsList(value: Array<google_protobuf_any_pb.Any>): Status;
addDetails(value?: google_protobuf_any_pb.Any, index?: number): google_protobuf_any_pb.Any;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Status.AsObject;
static toObject(includeInstance: boolean, msg: Status): Status.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Status, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Status;
static deserializeBinaryFromReader(message: Status, reader: jspb.BinaryReader): Status;
}
export namespace Status {
export type AsObject = {
code: number,
message: string,
detailsList: Array<google_protobuf_any_pb.Any.AsObject>,
}
}

View File

@ -0,0 +1,262 @@
// source: google/rpc/status.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js');
goog.object.extend(proto, google_protobuf_any_pb);
goog.exportSymbol('proto.google.rpc.Status', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.google.rpc.Status = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.google.rpc.Status.repeatedFields_, null);
};
goog.inherits(proto.google.rpc.Status, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.google.rpc.Status.displayName = 'proto.google.rpc.Status';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.google.rpc.Status.repeatedFields_ = [3];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.google.rpc.Status.prototype.toObject = function(opt_includeInstance) {
return proto.google.rpc.Status.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.google.rpc.Status} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.google.rpc.Status.toObject = function(includeInstance, msg) {
var f, obj = {
code: jspb.Message.getFieldWithDefault(msg, 1, 0),
message: jspb.Message.getFieldWithDefault(msg, 2, ""),
detailsList: jspb.Message.toObjectList(msg.getDetailsList(),
google_protobuf_any_pb.Any.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.google.rpc.Status}
*/
proto.google.rpc.Status.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.rpc.Status;
return proto.google.rpc.Status.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.rpc.Status} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.rpc.Status}
*/
proto.google.rpc.Status.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt32());
msg.setCode(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setMessage(value);
break;
case 3:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.addDetails(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.rpc.Status.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.google.rpc.Status.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.google.rpc.Status} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.google.rpc.Status.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getCode();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
f = message.getMessage();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getDetailsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
3,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
};
/**
* optional int32 code = 1;
* @return {number}
*/
proto.google.rpc.Status.prototype.getCode = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.google.rpc.Status} returns this
*/
proto.google.rpc.Status.prototype.setCode = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional string message = 2;
* @return {string}
*/
proto.google.rpc.Status.prototype.getMessage = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.google.rpc.Status} returns this
*/
proto.google.rpc.Status.prototype.setMessage = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* repeated google.protobuf.Any details = 3;
* @return {!Array<!proto.google.protobuf.Any>}
*/
proto.google.rpc.Status.prototype.getDetailsList = function() {
return /** @type{!Array<!proto.google.protobuf.Any>} */ (
jspb.Message.getRepeatedWrapperField(this, google_protobuf_any_pb.Any, 3));
};
/**
* @param {!Array<!proto.google.protobuf.Any>} value
* @return {!proto.google.rpc.Status} returns this
*/
proto.google.rpc.Status.prototype.setDetailsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 3, value);
};
/**
* @param {!proto.google.protobuf.Any=} opt_value
* @param {number=} opt_index
* @return {!proto.google.protobuf.Any}
*/
proto.google.rpc.Status.prototype.addDetails = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Any, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.google.rpc.Status} returns this
*/
proto.google.rpc.Status.prototype.clearDetailsList = function() {
return this.setDetailsList([]);
};
goog.object.extend(exports, proto.google.rpc);

View File

@ -1,11 +1,12 @@
import * as grpc from '@grpc/grpc-js';
import { inject, injectable } from 'inversify';
import { inject, injectable, postConstruct } from 'inversify';
import { Event, Emitter } from '@theia/core/lib/common/event';
import { DisposableCollection } from '@theia/core/lib/common/disposable';
import { GrpcClientProvider } from './grpc-client-provider';
import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
import { Instance } from './cli-protocol/cc/arduino/cli/commands/v1/common_pb';
import {
CreateRequest,
CreateResponse,
InitRequest,
InitResponse,
UpdateIndexRequest,
@ -15,6 +16,7 @@ import {
} from './cli-protocol/cc/arduino/cli/commands/v1/commands_pb';
import * as commandsGrpcPb from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
import { NotificationServiceServer } from '../common/protocol';
import { Deferred } from '@theia/core/lib/common/promise-util';
@injectable()
export class CoreClientProvider extends GrpcClientProvider<CoreClientProvider.Client> {
@ -23,12 +25,27 @@ export class CoreClientProvider extends GrpcClientProvider<CoreClientProvider.Cl
protected readonly onClientReadyEmitter = new Emitter<void>();
protected _created = new Deferred<void>();
protected _initialized = new Deferred<void>();
get created(): Promise<void> {
return this._created.promise;
}
get initialized(): Promise<void> {
return this._initialized.promise;
}
get onClientReady(): Event<void> {
return this.onClientReadyEmitter.event;
}
close(client: CoreClientProvider.Client): void {
client.client.close();
this._created.reject();
this._initialized.reject();
this._created = new Deferred<void>();
this._initialized = new Deferred<void>();
}
protected async reconcileClient(
@ -46,6 +63,39 @@ export class CoreClientProvider extends GrpcClientProvider<CoreClientProvider.Cl
}
}
@postConstruct()
protected async init(): Promise<void> {
this.daemon.ready.then(async () => {
const cliConfig = this.configService.cliConfiguration;
// First create the client and the instance synchronously
// and notify client is ready.
// TODO: Creation failure should probably be handled here
await this.reconcileClient(
cliConfig ? cliConfig.daemon.port : undefined
).then(() => {
this._created.resolve();
});
// If client has been created correctly update indexes and initialize
// its instance by loading platforms and cores.
if (this._client && !(this._client instanceof Error)) {
await this.updateIndexes(this._client)
.then(this.initInstance)
.then(() => {
this._initialized.resolve();
});
}
});
this.daemon.onDaemonStopped(() => {
if (this._client && !(this._client instanceof Error)) {
this.close(this._client);
}
this._client = undefined;
this._port = undefined;
});
}
protected async createClient(
port: string | number
): Promise<CoreClientProvider.Client> {
@ -60,31 +110,64 @@ export class CoreClientProvider extends GrpcClientProvider<CoreClientProvider.Cl
grpc.credentials.createInsecure(),
this.channelOptions
) as ArduinoCoreServiceClient;
const initReq = new InitRequest();
initReq.setLibraryManagerOnly(false);
const initResp = await new Promise<InitResponse>((resolve, reject) => {
let resp: InitResponse | undefined = undefined;
const stream = client.init(initReq);
stream.on('data', (data: InitResponse) => (resp = data));
stream.on('end', () => resolve(resp!));
stream.on('error', (err) => reject(err));
const createRes = await new Promise<CreateResponse>((resolve, reject) => {
client.create(new CreateRequest(), (err, res: CreateResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
const instance = initResp.getInstance();
const instance = createRes.getInstance();
if (!instance) {
throw new Error(
'Could not retrieve instance from the initialize response.'
);
}
await this.updateIndexes({ instance, client });
return { instance, client };
}
protected async initInstance({
client,
instance,
}: CoreClientProvider.Client): Promise<void> {
const initReq = new InitRequest();
initReq.setInstance(instance);
await new Promise<void>((resolve, reject) => {
const stream = client.init(initReq);
stream.on('data', (res: InitResponse) => {
const progress = res.getInitProgress();
if (progress) {
const downloadProgress = progress.getDownloadProgress();
if (downloadProgress && downloadProgress.getCompleted()) {
const file = downloadProgress.getFile();
console.log(`Downloaded ${file}`);
}
const taskProgress = progress.getTaskProgress();
if (taskProgress && taskProgress.getCompleted()) {
const name = taskProgress.getName();
console.log(`Completed ${name}`);
}
}
const err = res.getError();
if (err) {
console.error(err.getMessage());
}
});
stream.on('error', (err) => reject(err));
stream.on('end', resolve);
});
}
protected async updateIndexes({
client,
instance,
}: CoreClientProvider.Client): Promise<void> {
}: CoreClientProvider.Client): Promise<CoreClientProvider.Client> {
// in a separate promise, try and update the index
let indexUpdateSucceeded = true;
for (let i = 0; i < 10; i++) {
@ -119,6 +202,7 @@ export class CoreClientProvider extends GrpcClientProvider<CoreClientProvider.Cl
if (indexUpdateSucceeded && libIndexUpdateSucceeded) {
this.notificationService.notifyIndexUpdated();
}
return { client, instance };
}
protected async updateLibraryIndex({
@ -202,32 +286,15 @@ export abstract class CoreClientAware {
protected readonly coreClientProvider: CoreClientProvider;
protected async coreClient(): Promise<CoreClientProvider.Client> {
const coreClient = await new Promise<CoreClientProvider.Client>(
return await new Promise<CoreClientProvider.Client>(
async (resolve, reject) => {
const handle = (c: CoreClientProvider.Client | Error) => {
if (c instanceof Error) {
reject(c);
} else {
resolve(c);
}
};
const client = await this.coreClientProvider.client();
if (client) {
handle(client);
return;
if (client && client instanceof Error) {
reject(client);
} else if (client) {
return resolve(client);
}
const toDispose = new DisposableCollection();
toDispose.push(
this.coreClientProvider.onClientReady(async () => {
const client = await this.coreClientProvider.client();
if (client) {
handle(client);
}
toDispose.dispose();
})
);
}
);
return coreClient;
}
}

View File

@ -22,6 +22,7 @@ import { ResponseService } from '../common/protocol/response-service';
import { NotificationServiceServer } from '../common/protocol';
import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
import { firstToUpperCase, firstToLowerCase } from '../common/utils';
import { Port } from './cli-protocol/cc/arduino/cli/commands/v1/port_pb';
@injectable()
export class CoreServiceImpl extends CoreClientAware implements CoreService {
@ -40,6 +41,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
const { sketchUri, fqbn, compilerWarnings } = options;
const sketchPath = FileUri.fsPath(sketchUri);
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
@ -122,6 +124,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
const { sketchUri, fqbn, port, programmer } = options;
const sketchPath = FileUri.fsPath(sketchUri);
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
@ -131,9 +134,13 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
if (fqbn) {
req.setFqbn(fqbn);
}
const p = new Port();
if (port) {
req.setPort(port);
p.setAddress(port.address);
p.setLabel(port.label || '');
p.setProtocol(port.protocol);
}
req.setPort(p);
if (programmer) {
req.setProgrammer(programmer.id);
}
@ -170,6 +177,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
}
async burnBootloader(options: CoreService.Bootloader.Options): Promise<void> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
const { fqbn, port, programmer } = options;
@ -178,9 +186,13 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
if (fqbn) {
burnReq.setFqbn(fqbn);
}
const p = new Port();
if (port) {
burnReq.setPort(port);
p.setAddress(port.address);
p.setLabel(port.label || '');
p.setProtocol(port.protocol);
}
burnReq.setPort(p);
if (programmer) {
burnReq.setProgrammer(programmer.id);
}

View File

@ -6,6 +6,7 @@ import {
LibraryService,
} from '../common/protocol/library-service';
import { CoreClientAware } from './core-client-provider';
import { BoardDiscovery } from './board-discovery';
import {
InstalledLibrary,
Library,
@ -29,18 +30,21 @@ import { InstallWithProgress } from './grpc-installable';
@injectable()
export class LibraryServiceImpl
extends CoreClientAware
implements LibraryService
{
implements LibraryService {
@inject(ILogger)
protected logger: ILogger;
@inject(ResponseService)
protected readonly responseService: ResponseService;
@inject(BoardDiscovery)
protected readonly boardDiscovery: BoardDiscovery;
@inject(NotificationServiceServer)
protected readonly notificationServer: NotificationServiceServer;
async search(options: { query?: string }): Promise<LibraryPackage[]> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
@ -107,6 +111,7 @@ export class LibraryServiceImpl
}: {
fqbn?: string | undefined;
}): Promise<LibraryPackage[]> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
const req = new LibraryListRequest();
@ -212,6 +217,7 @@ export class LibraryServiceImpl
version: Installable.Version;
filterSelf?: boolean;
}): Promise<LibraryDependency[]> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
const req = new LibraryResolveDependenciesRequest();
@ -253,6 +259,7 @@ export class LibraryServiceImpl
const version = !!options.version
? options.version
: item.availableVersions[0];
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
@ -274,12 +281,14 @@ export class LibraryServiceImpl
})
);
await new Promise<void>((resolve, reject) => {
resp.on('end', resolve);
resp.on('end', () => {
this.boardDiscovery.startBoardListWatch(coreClient)
resolve();
});
resp.on('error', (error) => {
this.responseService.appendToOutput({
chunk: `Failed to install library: ${item.name}${
version ? `:${version}` : ''
}.\n`,
chunk: `Failed to install library: ${item.name}${version ? `:${version}` : ''
}.\n`,
});
this.responseService.appendToOutput({
chunk: error.toString(),
@ -304,6 +313,7 @@ export class LibraryServiceImpl
progressId?: string;
overwrite?: boolean;
}): Promise<void> {
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
const req = new ZipLibraryInstallRequest();
@ -321,7 +331,10 @@ export class LibraryServiceImpl
})
);
await new Promise<void>((resolve, reject) => {
resp.on('end', resolve);
resp.on('end', () => {
this.boardDiscovery.startBoardListWatch(coreClient)
resolve();
});
resp.on('error', reject);
});
}
@ -331,6 +344,7 @@ export class LibraryServiceImpl
progressId?: string;
}): Promise<void> {
const { item, progressId } = options;
await this.coreClientProvider.initialized;
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
@ -349,7 +363,10 @@ export class LibraryServiceImpl
})
);
await new Promise<void>((resolve, reject) => {
resp.on('end', resolve);
resp.on('end', () => {
this.boardDiscovery.startBoardListWatch(coreClient)
resolve();
});
resp.on('error', reject);
});

View File

@ -136,6 +136,7 @@ export class SketchesServiceImpl
}
async loadSketch(uri: string): Promise<SketchWithDetails> {
await this.coreClientProvider.initialized;
const { client, instance } = await this.coreClient();
const req = new LoadSketchRequest();
req.setSketchPath(FileUri.fsPath(uri));
@ -462,6 +463,7 @@ void loop() {
}
async archive(sketch: Sketch, destinationUri: string): Promise<string> {
await this.coreClientProvider.initialized;
await this.loadSketch(sketch.uri); // sanity check
const { client } = await this.coreClient();
const archivePath = FileUri.fsPath(destinationUri);