From a32f79726518306d4b976a0920077636dc011841 Mon Sep 17 00:00:00 2001 From: Giacomo Cusinato <7659518+giacomocusinato@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:51:54 +0100 Subject: [PATCH] feat: use Arduino CLI 1.1.0 --- arduino-ide-extension/package.json | 2 +- .../src/browser/contributions/debug.ts | 4 +- .../src/common/protocol/sketches-service.ts | 3 +- .../cli/commands/v1/commands_grpc_pb.d.ts | 8 +- .../cli/commands/v1/commands_grpc_pb.js | 52 +- .../arduino/cli/commands/v1/commands_pb.d.ts | 8 +- .../cc/arduino/cli/commands/v1/commands_pb.js | 16 +- .../cc/arduino/cli/commands/v1/common_pb.d.ts | 63 +++ .../cc/arduino/cli/commands/v1/common_pb.js | 530 +++++++++++++++++- .../cc/arduino/cli/commands/v1/debug_pb.d.ts | 10 + .../cc/arduino/cli/commands/v1/debug_pb.js | 120 +++- .../arduino/cli/commands/v1/monitor_pb.d.ts | 63 +-- .../cc/arduino/cli/commands/v1/monitor_pb.js | 394 +------------ .../cc/arduino/cli/commands/v1/upload_pb.d.ts | 15 + .../cc/arduino/cli/commands/v1/upload_pb.js | 180 +++++- .../src/node/monitor-service.ts | 6 +- .../src/node/sketches-service-impl.ts | 79 ++- .../test/node/core-service-impl.slow-test.ts | 2 +- 18 files changed, 1035 insertions(+), 520 deletions(-) diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index 5ef831049..a0e1df3de 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -170,7 +170,7 @@ ], "arduino": { "arduino-cli": { - "version": "1.0.4" + "version": "1.1.0" }, "arduino-fwuploader": { "version": "2.4.1" diff --git a/arduino-ide-extension/src/browser/contributions/debug.ts b/arduino-ide-extension/src/browser/contributions/debug.ts index e94755c46..93dd2aa51 100644 --- a/arduino-ide-extension/src/browser/contributions/debug.ts +++ b/arduino-ide-extension/src/browser/contributions/debug.ts @@ -289,8 +289,8 @@ export class Debug ): Promise { if (err instanceof Error) { try { - const tempBuildPaths = await this.sketchesService.tempBuildPath(sketch); - return tempBuildPaths.some((tempBuildPath) => + const buildPaths = await this.sketchesService.getBuildPath(sketch); + return buildPaths.some((tempBuildPath) => err.message.includes(tempBuildPath) ); } catch { diff --git a/arduino-ide-extension/src/common/protocol/sketches-service.ts b/arduino-ide-extension/src/common/protocol/sketches-service.ts index 4cc253d79..fa009e22f 100644 --- a/arduino-ide-extension/src/common/protocol/sketches-service.ts +++ b/arduino-ide-extension/src/common/protocol/sketches-service.ts @@ -141,13 +141,14 @@ export interface SketchesService { /** * This is the JS/TS re-implementation of [`GenBuildPath`](https://github.com/arduino/arduino-cli/blob/c0d4e4407d80aabad81142693513b3306759cfa6/arduino/sketch/sketch.go#L296-L306) of the CLI. * Pass in a sketch and get the build temporary folder filesystem path calculated from the main sketch file location. Can be multiple ones. This method does not check the existence of the sketch. + * Since CLI v1.1.0 the default sketch folder is the os user cache dir. See https://github.com/arduino/arduino-cli/pull/2673/commits/d2ffeb06ca6360a211d5aa7ddd11505212ffb1b9 * * The case sensitivity of the drive letter on Windows matters when the CLI calculates the MD5 hash of the temporary build folder. * IDE2 does not know and does not want to rely on how the CLI treats the paths: with lowercase or uppercase drive letters. * Hence, IDE2 has to provide multiple build paths on Windows. This hack will be obsolete when the CLI can provide error codes: * https://github.com/arduino/arduino-cli/issues/1762. */ - tempBuildPath(sketch: SketchRef): Promise; + getBuildPath(sketch: SketchRef): Promise; } export interface SketchRef { diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts index 993a3cd0f..c267fec60 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts @@ -6,16 +6,16 @@ import * as grpc from "@grpc/grpc-js"; 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_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb"; import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/cli/commands/v1/core_pb"; import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/cli/commands/v1/debug_pb"; -import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb"; -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"; +import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb"; import * as cc_arduino_cli_commands_v1_settings_pb from "../../../../../cc/arduino/cli/commands/v1/settings_pb"; +import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb"; +import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb"; interface IArduinoCoreServiceService extends grpc.ServiceDefinition { create: IArduinoCoreServiceService_ICreate; diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js index 4decb58e0..17ea5b8c4 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js @@ -19,16 +19,16 @@ // '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_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); var cc_arduino_cli_commands_v1_compile_pb = require('../../../../../cc/arduino/cli/commands/v1/compile_pb.js'); var cc_arduino_cli_commands_v1_core_pb = require('../../../../../cc/arduino/cli/commands/v1/core_pb.js'); var cc_arduino_cli_commands_v1_debug_pb = require('../../../../../cc/arduino/cli/commands/v1/debug_pb.js'); -var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js'); -var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js'); var cc_arduino_cli_commands_v1_lib_pb = require('../../../../../cc/arduino/cli/commands/v1/lib_pb.js'); +var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js'); var cc_arduino_cli_commands_v1_settings_pb = require('../../../../../cc/arduino/cli/commands/v1/settings_pb.js'); +var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js'); +var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js'); function serialize_cc_arduino_cli_commands_v1_ArchiveSketchRequest(arg) { if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest)) { @@ -1109,9 +1109,9 @@ function deserialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse(buffer } -// The main Arduino Platform service API +// The main Arduino Platform service API. var ArduinoCoreServiceService = exports['cc.arduino.cli.commands.v1.ArduinoCoreService'] = { - // Create a new Arduino Core instance + // Create a new Arduino Core instance. create: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Create', requestStream: false, @@ -1124,7 +1124,7 @@ create: { responseDeserialize: deserialize_cc_arduino_cli_commands_v1_CreateResponse, }, // Initializes an existing Arduino Core instance by loading platforms and -// libraries +// libraries. init: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Init', requestStream: false, @@ -1136,7 +1136,7 @@ init: { responseSerialize: serialize_cc_arduino_cli_commands_v1_InitResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_InitResponse, }, - // Destroy an instance of the Arduino Core Service + // Destroy an instance of the Arduino Core Service. destroy: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Destroy', requestStream: false, @@ -1148,7 +1148,7 @@ destroy: { responseSerialize: serialize_cc_arduino_cli_commands_v1_DestroyResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_DestroyResponse, }, - // Update package index of the Arduino Core Service + // Update package index of the Arduino Core Service. updateIndex: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateIndex', requestStream: false, @@ -1160,7 +1160,7 @@ updateIndex: { responseSerialize: serialize_cc_arduino_cli_commands_v1_UpdateIndexResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_UpdateIndexResponse, }, - // Update libraries index + // Update libraries index. updateLibrariesIndex: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateLibrariesIndex', requestStream: false, @@ -1184,7 +1184,7 @@ version: { responseSerialize: serialize_cc_arduino_cli_commands_v1_VersionResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_VersionResponse, }, - // Create a new Sketch + // Create a new Sketch. newSketch: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/NewSketch', requestStream: false, @@ -1196,7 +1196,7 @@ newSketch: { responseSerialize: serialize_cc_arduino_cli_commands_v1_NewSketchResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_NewSketchResponse, }, - // Returns all files composing a Sketch + // Returns all files composing a Sketch. loadSketch: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/LoadSketch', requestStream: false, @@ -1208,7 +1208,7 @@ loadSketch: { responseSerialize: serialize_cc_arduino_cli_commands_v1_LoadSketchResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_LoadSketchResponse, }, - // Creates a zip file containing all files of specified Sketch + // Creates a zip file containing all files of specified Sketch. archiveSketch: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ArchiveSketch', requestStream: false, @@ -1234,10 +1234,7 @@ setSketchDefaults: { responseSerialize: serialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse, }, - // BOARD COMMANDS -// -------------- -// -// Requests details about a board + // Requests details about a board. boardDetails: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/BoardDetails', requestStream: false, @@ -1469,7 +1466,7 @@ libraryUpgrade: { responseSerialize: serialize_cc_arduino_cli_commands_v1_LibraryUpgradeResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_LibraryUpgradeResponse, }, - // Install a library from a Zip File + // Install a library from a Zip File. zipLibraryInstall: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ZipLibraryInstall', requestStream: false, @@ -1481,7 +1478,7 @@ zipLibraryInstall: { responseSerialize: serialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse, }, - // Download and install a library from a git url + // Download and install a library from a git url. gitLibraryInstall: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/GitLibraryInstall', requestStream: false, @@ -1554,7 +1551,7 @@ libraryList: { responseSerialize: serialize_cc_arduino_cli_commands_v1_LibraryListResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_LibraryListResponse, }, - // Open a monitor connection to a board port + // Open a monitor connection to a board port. monitor: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Monitor', requestStream: true, @@ -1566,7 +1563,7 @@ monitor: { responseSerialize: serialize_cc_arduino_cli_commands_v1_MonitorResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_MonitorResponse, }, - // Returns the parameters that can be set in the MonitorRequest calls + // Returns the parameters that can be set in the MonitorRequest calls. enumerateMonitorPortSettings: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/EnumerateMonitorPortSettings', requestStream: false, @@ -1638,7 +1635,7 @@ cleanDownloadCacheDirectory: { responseSerialize: serialize_cc_arduino_cli_commands_v1_CleanDownloadCacheDirectoryResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_CleanDownloadCacheDirectoryResponse, }, - // Writes the settings currently stored in memory in a YAML file + // Writes the settings currently stored in memory in a YAML file. configurationSave: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ConfigurationSave', requestStream: false, @@ -1650,7 +1647,7 @@ configurationSave: { responseSerialize: serialize_cc_arduino_cli_commands_v1_ConfigurationSaveResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ConfigurationSaveResponse, }, - // Read the settings from a YAML file + // Read the settings from a YAML file. configurationOpen: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ConfigurationOpen', requestStream: false, @@ -1662,7 +1659,8 @@ configurationOpen: { responseSerialize: serialize_cc_arduino_cli_commands_v1_ConfigurationOpenResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ConfigurationOpenResponse, }, - configurationGet: { + // Get the current configuration. +configurationGet: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ConfigurationGet', requestStream: false, responseStream: false, @@ -1673,7 +1671,7 @@ configurationOpen: { responseSerialize: serialize_cc_arduino_cli_commands_v1_ConfigurationGetResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ConfigurationGetResponse, }, - // Enumerate all the keys/values pairs available in the configuration + // Enumerate all the keys/values pairs available in the configuration. settingsEnumerate: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsEnumerate', requestStream: false, @@ -1685,7 +1683,7 @@ settingsEnumerate: { responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsEnumerateResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsEnumerateResponse, }, - // Get a single configuration value + // Get a single configuration value. settingsGetValue: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsGetValue', requestStream: false, @@ -1697,7 +1695,7 @@ settingsGetValue: { responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse, }, - // Set a single configuration value + // Set a single configuration value. settingsSetValue: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsSetValue', requestStream: false, diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts index 53107cc5a..f8f4155ca 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts @@ -5,16 +5,16 @@ /* 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_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb"; import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/cli/commands/v1/core_pb"; import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/cli/commands/v1/debug_pb"; -import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb"; -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"; +import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb"; import * as cc_arduino_cli_commands_v1_settings_pb from "../../../../../cc/arduino/cli/commands/v1/settings_pb"; +import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb"; +import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb"; export class CreateRequest extends jspb.Message { diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js index b3ba4786b..447cb5f9c 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js @@ -21,26 +21,26 @@ var global = (function() { return Function('return this')(); }.call(null)); -var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js'); -goog.object.extend(proto, google_rpc_status_pb); -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_board_pb = require('../../../../../cc/arduino/cli/commands/v1/board_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_board_pb); +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_compile_pb = require('../../../../../cc/arduino/cli/commands/v1/compile_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_compile_pb); var cc_arduino_cli_commands_v1_core_pb = require('../../../../../cc/arduino/cli/commands/v1/core_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_core_pb); var cc_arduino_cli_commands_v1_debug_pb = require('../../../../../cc/arduino/cli/commands/v1/debug_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_debug_pb); -var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js'); -goog.object.extend(proto, cc_arduino_cli_commands_v1_monitor_pb); -var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js'); -goog.object.extend(proto, cc_arduino_cli_commands_v1_upload_pb); var cc_arduino_cli_commands_v1_lib_pb = require('../../../../../cc/arduino/cli/commands/v1/lib_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_lib_pb); +var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_monitor_pb); var cc_arduino_cli_commands_v1_settings_pb = require('../../../../../cc/arduino/cli/commands/v1/settings_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_settings_pb); +var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_upload_pb); +var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js'); +goog.object.extend(proto, google_rpc_status_pb); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.CheckForArduinoCLIUpdatesRequest', null, global); diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.d.ts index 5cfa42a8a..114e96560 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.d.ts @@ -471,6 +471,11 @@ export class Sketch extends jspb.Message { getDefaultProgrammer(): string; setDefaultProgrammer(value: string): Sketch; + hasDefaultPortConfig(): boolean; + clearDefaultPortConfig(): void; + getDefaultPortConfig(): MonitorPortConfiguration | undefined; + setDefaultPortConfig(value?: MonitorPortConfiguration): Sketch; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Sketch.AsObject; static toObject(includeInstance: boolean, msg: Sketch): Sketch.AsObject; @@ -494,6 +499,52 @@ export namespace Sketch { profilesList: Array, defaultProfile?: SketchProfile.AsObject, defaultProgrammer: string, + defaultPortConfig?: MonitorPortConfiguration.AsObject, + } +} + +export class MonitorPortConfiguration extends jspb.Message { + clearSettingsList(): void; + getSettingsList(): Array; + setSettingsList(value: Array): MonitorPortConfiguration; + addSettings(value?: MonitorPortSetting, index?: number): MonitorPortSetting; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MonitorPortConfiguration.AsObject; + static toObject(includeInstance: boolean, msg: MonitorPortConfiguration): MonitorPortConfiguration.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MonitorPortConfiguration, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MonitorPortConfiguration; + static deserializeBinaryFromReader(message: MonitorPortConfiguration, reader: jspb.BinaryReader): MonitorPortConfiguration; +} + +export namespace MonitorPortConfiguration { + export type AsObject = { + settingsList: Array, + } +} + +export class MonitorPortSetting extends jspb.Message { + getSettingId(): string; + setSettingId(value: string): MonitorPortSetting; + getValue(): string; + setValue(value: string): MonitorPortSetting; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MonitorPortSetting.AsObject; + static toObject(includeInstance: boolean, msg: MonitorPortSetting): MonitorPortSetting.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MonitorPortSetting, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MonitorPortSetting; + static deserializeBinaryFromReader(message: MonitorPortSetting, reader: jspb.BinaryReader): MonitorPortSetting; +} + +export namespace MonitorPortSetting { + export type AsObject = { + settingId: string, + value: string, } } @@ -504,6 +555,15 @@ export class SketchProfile extends jspb.Message { setFqbn(value: string): SketchProfile; getProgrammer(): string; setProgrammer(value: string): SketchProfile; + getPort(): string; + setPort(value: string): SketchProfile; + + hasPortConfig(): boolean; + clearPortConfig(): void; + getPortConfig(): MonitorPortConfiguration | undefined; + setPortConfig(value?: MonitorPortConfiguration): SketchProfile; + getProtocol(): string; + setProtocol(value: string): SketchProfile; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): SketchProfile.AsObject; @@ -520,5 +580,8 @@ export namespace SketchProfile { name: string, fqbn: string, programmer: string, + port: string, + portConfig?: MonitorPortConfiguration.AsObject, + protocol: string, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.js index 79d1e7660..0b959a33e 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/common_pb.js @@ -31,6 +31,8 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.HelpResources', null, global goog.exportSymbol('proto.cc.arduino.cli.commands.v1.InstalledPlatformReference', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Instance', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MissingProgrammerError', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortSetting', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Platform', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformMetadata', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformRelease', null, global); @@ -375,6 +377,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.commands.v1.Sketch.displayName = 'proto.cc.arduino.cli.commands.v1.Sketch'; } +/** + * 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.MonitorPortConfiguration = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.repeatedFields_, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration'; +} +/** + * 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.MonitorPortSetting = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.MonitorPortSetting, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.MonitorPortSetting.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorPortSetting'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -3553,7 +3597,8 @@ proto.cc.arduino.cli.commands.v1.Sketch.toObject = function(includeInstance, msg profilesList: jspb.Message.toObjectList(msg.getProfilesList(), proto.cc.arduino.cli.commands.v1.SketchProfile.toObject, includeInstance), defaultProfile: (f = msg.getDefaultProfile()) && proto.cc.arduino.cli.commands.v1.SketchProfile.toObject(includeInstance, f), - defaultProgrammer: jspb.Message.getFieldWithDefault(msg, 11, "") + defaultProgrammer: jspb.Message.getFieldWithDefault(msg, 11, ""), + defaultPortConfig: (f = msg.getDefaultPortConfig()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, f) }; if (includeInstance) { @@ -3636,6 +3681,11 @@ proto.cc.arduino.cli.commands.v1.Sketch.deserializeBinaryFromReader = function(m var value = /** @type {string} */ (reader.readString()); msg.setDefaultProgrammer(value); break; + case 12: + var value = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinaryFromReader); + msg.setDefaultPortConfig(value); + break; default: reader.skipField(); break; @@ -3744,6 +3794,14 @@ proto.cc.arduino.cli.commands.v1.Sketch.serializeBinaryToWriter = function(messa f ); } + f = message.getDefaultPortConfig(); + if (f != null) { + writer.writeMessage( + 12, + f, + proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter + ); + } }; @@ -4041,6 +4099,363 @@ proto.cc.arduino.cli.commands.v1.Sketch.prototype.setDefaultProgrammer = functio }; +/** + * optional MonitorPortConfiguration default_port_config = 12; + * @return {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} + */ +proto.cc.arduino.cli.commands.v1.Sketch.prototype.getDefaultPortConfig = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} */ ( + jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 12)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.Sketch} returns this +*/ +proto.cc.arduino.cli.commands.v1.Sketch.prototype.setDefaultPortConfig = function(value) { + return jspb.Message.setWrapperField(this, 12, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.Sketch} returns this + */ +proto.cc.arduino.cli.commands.v1.Sketch.prototype.clearDefaultPortConfig = function() { + return this.setDefaultPortConfig(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.Sketch.prototype.hasDefaultPortConfig = function() { + return jspb.Message.getField(this, 12) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.repeatedFields_ = [1]; + + + +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_, 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.MonitorPortConfiguration.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortConfiguration} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject = function(includeInstance, msg) { + var f, obj = { + settingsList: jspb.Message.toObjectList(msg.getSettingsList(), + proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.cc.arduino.cli.commands.v1.MonitorPortConfiguration} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration; + return proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortConfiguration} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortSetting; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortSetting.deserializeBinaryFromReader); + msg.addSettings(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.MonitorPortConfiguration.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortConfiguration} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSettingsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.cc.arduino.cli.commands.v1.MonitorPortSetting.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated MonitorPortSetting settings = 1; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.getSettingsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortSetting, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} returns this +*/ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.setSettingsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting=} opt_value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.addSettings = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.MonitorPortSetting, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} returns this + */ +proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.clearSettingsList = function() { + return this.setSettingsList([]); +}; + + + + + +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_, 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.MonitorPortSetting.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.MonitorPortSetting} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.toObject = function(includeInstance, msg) { + var f, obj = { + settingId: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.MonitorPortSetting} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.MonitorPortSetting; + return proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.MonitorPortSetting} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.setSettingId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setValue(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.MonitorPortSetting.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.MonitorPortSetting} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSettingId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getValue(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string setting_id = 1; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.getSettingId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} returns this + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.setSettingId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string value = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} returns this + */ +proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.setValue = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + @@ -4075,7 +4490,10 @@ proto.cc.arduino.cli.commands.v1.SketchProfile.toObject = function(includeInstan var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, ""), fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), - programmer: jspb.Message.getFieldWithDefault(msg, 3, "") + programmer: jspb.Message.getFieldWithDefault(msg, 3, ""), + port: jspb.Message.getFieldWithDefault(msg, 4, ""), + portConfig: (f = msg.getPortConfig()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, f), + protocol: jspb.Message.getFieldWithDefault(msg, 6, "") }; if (includeInstance) { @@ -4124,6 +4542,19 @@ proto.cc.arduino.cli.commands.v1.SketchProfile.deserializeBinaryFromReader = fun var value = /** @type {string} */ (reader.readString()); msg.setProgrammer(value); break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setPort(value); + break; + case 5: + var value = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinaryFromReader); + msg.setPortConfig(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setProtocol(value); + break; default: reader.skipField(); break; @@ -4174,6 +4605,28 @@ proto.cc.arduino.cli.commands.v1.SketchProfile.serializeBinaryToWriter = functio f ); } + f = message.getPort(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getPortConfig(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter + ); + } + f = message.getProtocol(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } }; @@ -4231,4 +4684,77 @@ proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.setProgrammer = functio }; +/** + * optional string port = 4; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.getPort = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SketchProfile} returns this + */ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.setPort = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional MonitorPortConfiguration port_config = 5; + * @return {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} + */ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.getPortConfig = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} */ ( + jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 5)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.SketchProfile} returns this +*/ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.setPortConfig = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.SketchProfile} returns this + */ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.clearPortConfig = function() { + return this.setPortConfig(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.hasPortConfig = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional string protocol = 6; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.getProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SketchProfile} returns this + */ +proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.setProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.d.ts index d36f20ec2..5a3c99ac8 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.d.ts @@ -119,6 +119,10 @@ export class IsDebugSupportedRequest extends jspb.Message { setInterpreter(value: string): IsDebugSupportedRequest; getProgrammer(): string; setProgrammer(value: string): IsDebugSupportedRequest; + clearDebugPropertiesList(): void; + getDebugPropertiesList(): Array; + setDebugPropertiesList(value: Array): IsDebugSupportedRequest; + addDebugProperties(value: string, index?: number): string; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): IsDebugSupportedRequest.AsObject; @@ -137,6 +141,7 @@ export namespace IsDebugSupportedRequest { port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, interpreter: string, programmer: string, + debugPropertiesList: Array, } } @@ -184,6 +189,10 @@ export class GetDebugConfigRequest extends jspb.Message { setImportDir(value: string): GetDebugConfigRequest; getProgrammer(): string; setProgrammer(value: string): GetDebugConfigRequest; + clearDebugPropertiesList(): void; + getDebugPropertiesList(): Array; + setDebugPropertiesList(value: Array): GetDebugConfigRequest; + addDebugProperties(value: string, index?: number): string; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetDebugConfigRequest.AsObject; @@ -204,6 +213,7 @@ export namespace GetDebugConfigRequest { interpreter: string, importDir: string, programmer: string, + debugPropertiesList: Array, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js index e0d781543..f6dfc3a92 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js @@ -111,7 +111,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.repeatedFields_, null); }; goog.inherits(proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -153,7 +153,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.repeatedFields_, null); }; goog.inherits(proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -841,6 +841,13 @@ proto.cc.arduino.cli.commands.v1.DebugResponse.prototype.hasResult = function() +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.repeatedFields_ = [6]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -876,7 +883,8 @@ proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.toObject = function(inc fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), interpreter: jspb.Message.getFieldWithDefault(msg, 4, ""), - programmer: jspb.Message.getFieldWithDefault(msg, 5, "") + programmer: jspb.Message.getFieldWithDefault(msg, 5, ""), + debugPropertiesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f }; if (includeInstance) { @@ -935,6 +943,10 @@ proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.deserializeBinaryFromRe var value = /** @type {string} */ (reader.readString()); msg.setProgrammer(value); break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.addDebugProperties(value); + break; default: reader.skipField(); break; @@ -1001,6 +1013,13 @@ proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.serializeBinaryToWriter f ); } + f = message.getDebugPropertiesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 6, + f + ); + } }; @@ -1132,6 +1151,43 @@ proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.prototype.setProgrammer }; +/** + * repeated string debug_properties = 6; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.prototype.getDebugPropertiesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.prototype.setDebugPropertiesList = function(value) { + return jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.prototype.addDebugProperties = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.IsDebugSupportedRequest.prototype.clearDebugPropertiesList = function() { + return this.setDebugPropertiesList([]); +}; + + @@ -1293,6 +1349,13 @@ proto.cc.arduino.cli.commands.v1.IsDebugSupportedResponse.prototype.setDebugFqbn +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.repeatedFields_ = [10]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1330,7 +1393,8 @@ proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.toObject = function(inclu 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, "") + programmer: jspb.Message.getFieldWithDefault(msg, 9, ""), + debugPropertiesList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f }; if (includeInstance) { @@ -1397,6 +1461,10 @@ proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.deserializeBinaryFromRead var value = /** @type {string} */ (reader.readString()); msg.setProgrammer(value); break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.addDebugProperties(value); + break; default: reader.skipField(); break; @@ -1477,6 +1545,13 @@ proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.serializeBinaryToWriter = f ); } + f = message.getDebugPropertiesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 10, + f + ); + } }; @@ -1644,6 +1719,43 @@ proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setProgrammer = }; +/** + * repeated string debug_properties = 10; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getDebugPropertiesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setDebugPropertiesList = function(value) { + return jspb.Message.setField(this, 10, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.addDebugProperties = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 10, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.clearDebugPropertiesList = function() { + return this.setDebugPropertiesList([]); +}; + + diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.d.ts index 8f6fefdd7..9af18f09d 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.d.ts @@ -24,8 +24,8 @@ export class MonitorRequest extends jspb.Message { hasUpdatedConfiguration(): boolean; clearUpdatedConfiguration(): void; - getUpdatedConfiguration(): MonitorPortConfiguration | undefined; - setUpdatedConfiguration(value?: MonitorPortConfiguration): MonitorRequest; + getUpdatedConfiguration(): cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration | undefined; + setUpdatedConfiguration(value?: cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration): MonitorRequest; hasClose(): boolean; clearClose(): void; @@ -48,7 +48,7 @@ export namespace MonitorRequest { export type AsObject = { openRequest?: MonitorPortOpenRequest.AsObject, txData: Uint8Array | string, - updatedConfiguration?: MonitorPortConfiguration.AsObject, + updatedConfiguration?: cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.AsObject, close: boolean, } @@ -78,8 +78,8 @@ export class MonitorPortOpenRequest extends jspb.Message { hasPortConfiguration(): boolean; clearPortConfiguration(): void; - getPortConfiguration(): MonitorPortConfiguration | undefined; - setPortConfiguration(value?: MonitorPortConfiguration): MonitorPortOpenRequest; + getPortConfiguration(): cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration | undefined; + setPortConfiguration(value?: cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration): MonitorPortOpenRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): MonitorPortOpenRequest.AsObject; @@ -96,29 +96,7 @@ export namespace MonitorPortOpenRequest { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, fqbn: string, - portConfiguration?: MonitorPortConfiguration.AsObject, - } -} - -export class MonitorPortConfiguration extends jspb.Message { - clearSettingsList(): void; - getSettingsList(): Array; - setSettingsList(value: Array): MonitorPortConfiguration; - addSettings(value?: MonitorPortSetting, index?: number): MonitorPortSetting; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): MonitorPortConfiguration.AsObject; - static toObject(includeInstance: boolean, msg: MonitorPortConfiguration): MonitorPortConfiguration.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: MonitorPortConfiguration, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): MonitorPortConfiguration; - static deserializeBinaryFromReader(message: MonitorPortConfiguration, reader: jspb.BinaryReader): MonitorPortConfiguration; -} - -export namespace MonitorPortConfiguration { - export type AsObject = { - settingsList: Array, + portConfiguration?: cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.AsObject, } } @@ -138,8 +116,8 @@ export class MonitorResponse extends jspb.Message { hasAppliedSettings(): boolean; clearAppliedSettings(): void; - getAppliedSettings(): MonitorPortConfiguration | undefined; - setAppliedSettings(value?: MonitorPortConfiguration): MonitorResponse; + getAppliedSettings(): cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration | undefined; + setAppliedSettings(value?: cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration): MonitorResponse; hasSuccess(): boolean; clearSuccess(): void; @@ -162,7 +140,7 @@ export namespace MonitorResponse { export type AsObject = { error: string, rxData: Uint8Array | string, - appliedSettings?: MonitorPortConfiguration.AsObject, + appliedSettings?: cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.AsObject, success: boolean, } @@ -176,29 +154,6 @@ export namespace MonitorResponse { } -export class MonitorPortSetting extends jspb.Message { - getSettingId(): string; - setSettingId(value: string): MonitorPortSetting; - getValue(): string; - setValue(value: string): MonitorPortSetting; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): MonitorPortSetting.AsObject; - static toObject(includeInstance: boolean, msg: MonitorPortSetting): MonitorPortSetting.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: MonitorPortSetting, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): MonitorPortSetting; - static deserializeBinaryFromReader(message: MonitorPortSetting, reader: jspb.BinaryReader): MonitorPortSetting; -} - -export namespace MonitorPortSetting { - export type AsObject = { - settingId: string, - value: string, - } -} - export class EnumerateMonitorPortSettingsRequest extends jspb.Message { hasInstance(): boolean; diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.js index 893592ea4..46039c58b 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/monitor_pb.js @@ -27,9 +27,7 @@ var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/ goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse', null, global); -goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest', null, global); -goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortSetting', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortSettingDescriptor', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorRequest.MessageCase', null, global); @@ -77,27 +75,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest'; } -/** - * 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.MonitorPortConfiguration = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.repeatedFields_, null); -}; -goog.inherits(proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration'; -} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -119,27 +96,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.commands.v1.MonitorResponse.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorResponse'; } -/** - * 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.MonitorPortSetting = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.commands.v1.MonitorPortSetting, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.commands.v1.MonitorPortSetting.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorPortSetting'; -} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -265,7 +221,7 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.toObject = function(includeInsta var f, obj = { openRequest: (f = msg.getOpenRequest()) && proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.toObject(includeInstance, f), txData: msg.getTxData_asB64(), - updatedConfiguration: (f = msg.getUpdatedConfiguration()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, f), + updatedConfiguration: (f = msg.getUpdatedConfiguration()) && cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.toObject(includeInstance, f), close: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) }; @@ -313,8 +269,8 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.deserializeBinaryFromReader = fu msg.setTxData(value); break; case 3: - var value = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration; - reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinaryFromReader); + var value = new cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration; + reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.deserializeBinaryFromReader); msg.setUpdatedConfiguration(value); break; case 4: @@ -370,7 +326,7 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.serializeBinaryToWriter = functi writer.writeMessage( 3, f, - proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter + cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.serializeBinaryToWriter ); } f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); @@ -486,7 +442,7 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasTxData = function() */ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getUpdatedConfiguration = function() { return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} */ ( - jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 3)); + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration, 3)); }; @@ -588,7 +544,7 @@ proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.toObject = function(incl instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), fqbn: jspb.Message.getFieldWithDefault(msg, 3, ""), - portConfiguration: (f = msg.getPortConfiguration()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, f) + portConfiguration: (f = msg.getPortConfiguration()) && cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.toObject(includeInstance, f) }; if (includeInstance) { @@ -640,8 +596,8 @@ proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.deserializeBinaryFromRea msg.setFqbn(value); break; case 4: - var value = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration; - reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinaryFromReader); + var value = new cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration; + reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.deserializeBinaryFromReader); msg.setPortConfiguration(value); break; default: @@ -701,7 +657,7 @@ proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.serializeBinaryToWriter writer.writeMessage( 4, f, - proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter + cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.serializeBinaryToWriter ); } }; @@ -805,7 +761,7 @@ proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.setFqbn = func */ proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.getPortConfiguration = function() { return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} */ ( - jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 4)); + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration, 4)); }; @@ -837,166 +793,6 @@ proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.hasPortConfigu -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.repeatedFields_ = [1]; - - - -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_, 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.MonitorPortConfiguration.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortConfiguration} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject = function(includeInstance, msg) { - var f, obj = { - settingsList: jspb.Message.toObjectList(msg.getSettingsList(), - proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.cc.arduino.cli.commands.v1.MonitorPortConfiguration} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration; - return proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortConfiguration} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortSetting; - reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortSetting.deserializeBinaryFromReader); - msg.addSettings(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.MonitorPortConfiguration.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.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.MonitorPortConfiguration} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSettingsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.cc.arduino.cli.commands.v1.MonitorPortSetting.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated MonitorPortSetting settings = 1; - * @return {!Array} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.getSettingsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortSetting, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} returns this -*/ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.setSettingsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting=} opt_value - * @param {number=} opt_index - * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.addSettings = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.MonitorPortSetting, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} returns this - */ -proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.prototype.clearSettingsList = function() { - return this.setSettingsList([]); -}; - - - /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -1058,7 +854,7 @@ proto.cc.arduino.cli.commands.v1.MonitorResponse.toObject = function(includeInst var f, obj = { error: jspb.Message.getFieldWithDefault(msg, 1, ""), rxData: msg.getRxData_asB64(), - appliedSettings: (f = msg.getAppliedSettings()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, f), + appliedSettings: (f = msg.getAppliedSettings()) && cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.toObject(includeInstance, f), success: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) }; @@ -1105,8 +901,8 @@ proto.cc.arduino.cli.commands.v1.MonitorResponse.deserializeBinaryFromReader = f msg.setRxData(value); break; case 3: - var value = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration; - reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinaryFromReader); + var value = new cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration; + reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.deserializeBinaryFromReader); msg.setAppliedSettings(value); break; case 4: @@ -1161,7 +957,7 @@ proto.cc.arduino.cli.commands.v1.MonitorResponse.serializeBinaryToWriter = funct writer.writeMessage( 3, f, - proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter + cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration.serializeBinaryToWriter ); } f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); @@ -1276,7 +1072,7 @@ proto.cc.arduino.cli.commands.v1.MonitorResponse.prototype.hasRxData = function( */ proto.cc.arduino.cli.commands.v1.MonitorResponse.prototype.getAppliedSettings = function() { return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} */ ( - jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 3)); + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.MonitorPortConfiguration, 3)); }; @@ -1346,166 +1142,6 @@ proto.cc.arduino.cli.commands.v1.MonitorResponse.prototype.hasSuccess = function -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_, 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.MonitorPortSetting.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.MonitorPortSetting} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.toObject = function(includeInstance, msg) { - var f, obj = { - settingId: jspb.Message.getFieldWithDefault(msg, 1, ""), - value: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - 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.MonitorPortSetting} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.MonitorPortSetting; - return proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.MonitorPortSetting} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.setSettingId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setValue(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.MonitorPortSetting.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.MonitorPortSetting.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.MonitorPortSetting} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSettingId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getValue(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string setting_id = 1; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.getSettingId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} returns this - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.setSettingId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string value = 2; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.getValue = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.MonitorPortSetting} returns this - */ -proto.cc.arduino.cli.commands.v1.MonitorPortSetting.prototype.setValue = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts index b16f167e2..19add9232 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts @@ -38,6 +38,10 @@ export class UploadRequest extends jspb.Message { getUserFieldsMap(): jspb.Map; clearUserFieldsMap(): void; + clearUploadPropertiesList(): void; + getUploadPropertiesList(): Array; + setUploadPropertiesList(value: Array): UploadRequest; + addUploadProperties(value: string, index?: number): string; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UploadRequest.AsObject; @@ -63,6 +67,7 @@ export namespace UploadRequest { dryRun: boolean, userFieldsMap: Array<[string, string]>, + uploadPropertiesList: Array, } } @@ -185,6 +190,10 @@ export class UploadUsingProgrammerRequest extends jspb.Message { getUserFieldsMap(): jspb.Map; clearUserFieldsMap(): void; + clearUploadPropertiesList(): void; + getUploadPropertiesList(): Array; + setUploadPropertiesList(value: Array): UploadUsingProgrammerRequest; + addUploadProperties(value: string, index?: number): string; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UploadUsingProgrammerRequest.AsObject; @@ -210,6 +219,7 @@ export namespace UploadUsingProgrammerRequest { dryRun: boolean, userFieldsMap: Array<[string, string]>, + uploadPropertiesList: Array, } } @@ -279,6 +289,10 @@ export class BurnBootloaderRequest extends jspb.Message { getUserFieldsMap(): jspb.Map; clearUserFieldsMap(): void; + clearUploadPropertiesList(): void; + getUploadPropertiesList(): Array; + setUploadPropertiesList(value: Array): BurnBootloaderRequest; + addUploadProperties(value: string, index?: number): string; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): BurnBootloaderRequest.AsObject; @@ -301,6 +315,7 @@ export namespace BurnBootloaderRequest { dryRun: boolean, userFieldsMap: Array<[string, string]>, + uploadPropertiesList: Array, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js index 3ff6946e1..d49f1b0d7 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js @@ -52,7 +52,7 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UserField', null, global); * @constructor */ proto.cc.arduino.cli.commands.v1.UploadRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.UploadRequest.repeatedFields_, null); }; goog.inherits(proto.cc.arduino.cli.commands.v1.UploadRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -136,7 +136,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.repeatedFields_, null); }; goog.inherits(proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -178,7 +178,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.repeatedFields_, null); }; goog.inherits(proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -315,6 +315,13 @@ if (goog.DEBUG && !COMPILED) { proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.displayName = 'proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.repeatedFields_ = [12]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -356,7 +363,8 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.toObject = function(includeInstan importDir: jspb.Message.getFieldWithDefault(msg, 8, ""), programmer: jspb.Message.getFieldWithDefault(msg, 9, ""), dryRun: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), - userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [] + userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [], + uploadPropertiesList: (f = jspb.Message.getRepeatedField(msg, 12)) == null ? undefined : f }; if (includeInstance) { @@ -441,6 +449,10 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.deserializeBinaryFromReader = fun jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); }); break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.addUploadProperties(value); + break; default: reader.skipField(); break; @@ -546,6 +558,13 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.serializeBinaryToWriter = functio if (f && f.getLength() > 0) { f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = message.getUploadPropertiesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 12, + f + ); + } }; @@ -789,6 +808,43 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.clearUserFieldsMap = fu return this;}; +/** + * repeated string upload_properties = 12; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.getUploadPropertiesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 12)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.UploadRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.setUploadPropertiesList = function(value) { + return jspb.Message.setField(this, 12, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.UploadRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.addUploadProperties = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 12, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.UploadRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.clearUploadPropertiesList = function() { + return this.setUploadPropertiesList([]); +}; + + /** * Oneof group definitions for this message. Each group defines the field @@ -1364,6 +1420,13 @@ proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.serializeBin +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.repeatedFields_ = [12]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1405,7 +1468,8 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.toObject = functio importDir: jspb.Message.getFieldWithDefault(msg, 8, ""), programmer: jspb.Message.getFieldWithDefault(msg, 9, ""), dryRun: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), - userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [] + userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [], + uploadPropertiesList: (f = jspb.Message.getRepeatedField(msg, 12)) == null ? undefined : f }; if (includeInstance) { @@ -1490,6 +1554,10 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.deserializeBinaryF jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); }); break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.addUploadProperties(value); + break; default: reader.skipField(); break; @@ -1595,6 +1663,13 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.serializeBinaryToW if (f && f.getLength() > 0) { f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = message.getUploadPropertiesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 12, + f + ); + } }; @@ -1838,6 +1913,43 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.clearUse return this;}; +/** + * repeated string upload_properties = 12; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.getUploadPropertiesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 12)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.setUploadPropertiesList = function(value) { + return jspb.Message.setField(this, 12, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.addUploadProperties = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 12, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.clearUploadPropertiesList = function() { + return this.setUploadPropertiesList([]); +}; + + /** * Oneof group definitions for this message. Each group defines the field @@ -2109,6 +2221,13 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.hasErrS +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.repeatedFields_ = [12]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -2147,7 +2266,8 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.toObject = function(inclu verify: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), programmer: jspb.Message.getFieldWithDefault(msg, 6, ""), dryRun: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), - userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [] + userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [], + uploadPropertiesList: (f = jspb.Message.getRepeatedField(msg, 12)) == null ? undefined : f }; if (includeInstance) { @@ -2220,6 +2340,10 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.deserializeBinaryFromRead jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); }); break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.addUploadProperties(value); + break; default: reader.skipField(); break; @@ -2304,6 +2428,13 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.serializeBinaryToWriter = if (f && f.getLength() > 0) { f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = message.getUploadPropertiesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 12, + f + ); + } }; @@ -2493,6 +2624,43 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.clearUserFields return this;}; +/** + * repeated string upload_properties = 12; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.getUploadPropertiesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 12)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.setUploadPropertiesList = function(value) { + return jspb.Message.setField(this, 12, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.addUploadProperties = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 12, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.clearUploadPropertiesList = function() { + return this.setUploadPropertiesList([]); +}; + + /** * Oneof group definitions for this message. Each group defines the field diff --git a/arduino-ide-extension/src/node/monitor-service.ts b/arduino-ide-extension/src/node/monitor-service.ts index 2e48f7f79..99145fddc 100644 --- a/arduino-ide-extension/src/node/monitor-service.ts +++ b/arduino-ide-extension/src/node/monitor-service.ts @@ -22,9 +22,7 @@ import { import { EnumerateMonitorPortSettingsRequest, EnumerateMonitorPortSettingsResponse, - MonitorPortConfiguration, MonitorPortOpenRequest, - MonitorPortSetting, MonitorRequest, MonitorResponse, } from './cli-protocol/cc/arduino/cli/commands/v1/monitor_pb'; @@ -39,6 +37,10 @@ import { } from '@theia/core/lib/common/promise-util'; import { MonitorServiceFactoryOptions } from './monitor-service-factory'; import { ServiceError } from './service-error'; +import { + MonitorPortConfiguration, + MonitorPortSetting, +} from './cli-protocol/cc/arduino/cli/commands/v1/common_pb'; export const MonitorServiceName = 'monitor-service'; type DuplexHandlerKeys = diff --git a/arduino-ide-extension/src/node/sketches-service-impl.ts b/arduino-ide-extension/src/node/sketches-service-impl.ts index 3a72c31d7..4505da26a 100644 --- a/arduino-ide-extension/src/node/sketches-service-impl.ts +++ b/arduino-ide-extension/src/node/sketches-service-impl.ts @@ -668,47 +668,43 @@ export class SketchesServiceImpl ); } - async tempBuildPath(sketch: Sketch): Promise { + async getBuildPath(sketch: Sketch): Promise { const sketchPath = FileUri.fsPath(sketch.uri); - const { tempDirRealpath } = this.isTempSketch; - const tempBuildPaths = [ - this.tempBuildPathMD5Hash(tempDirRealpath, sketchPath), - ]; + + let basePath: string; + try { + basePath = userCacheDir(); + } catch { + // Fallback to /tmp + const { tempDirRealpath } = this.isTempSketch; + basePath = tempDirRealpath; + } + const buildPaths = [this.buildPathMD5Hash(basePath, sketchPath)]; // If on Windows, provide both the upper and the lowercase drive letter MD5 hashes. All together four paths are expected: // One of them should match if the sketch is not yet compiled. // https://github.com/arduino/arduino-ide/pull/1809#discussion_r1071031040 - if (isWindows && Win32DriveRegex.test(tempDirRealpath)) { + if (isWindows && Win32DriveRegex.test(basePath)) { const toggleFirstCharCasing = (s: string) => startsWithUpperCase(s) ? firstToLowerCase(s) : firstToUpperCase(s); - const otherCaseTempDirRealPath = toggleFirstCharCasing(tempDirRealpath); - tempBuildPaths.push( - this.tempBuildPathMD5Hash(otherCaseTempDirRealPath, sketchPath) - ); + const otherCaseDirRealPath = toggleFirstCharCasing(basePath); + buildPaths.push(this.buildPathMD5Hash(otherCaseDirRealPath, sketchPath)); if (Win32DriveRegex.test(sketchPath)) { const otherCaseSketchPath = toggleFirstCharCasing(sketchPath); - tempBuildPaths.push( - this.tempBuildPathMD5Hash(tempDirRealpath, otherCaseSketchPath), - this.tempBuildPathMD5Hash( - otherCaseTempDirRealPath, - otherCaseSketchPath - ) + buildPaths.push( + this.buildPathMD5Hash(basePath, otherCaseSketchPath), + this.buildPathMD5Hash(otherCaseDirRealPath, otherCaseSketchPath) ); } } - return tempBuildPaths; + return buildPaths; } - private tempBuildPathMD5Hash(tempFolderPath: string, path: string): string { - return join( - tempFolderPath, - 'arduino', - 'sketches', - this.tempBuildFolderMD5Hash(path) - ); + private buildPathMD5Hash(basePath: string, path: string): string { + return join(basePath, 'arduino', 'sketches', this.buildFolderMD5Hash(path)); } - private tempBuildFolderMD5Hash(path: string): string { + private buildFolderMD5Hash(path: string): string { return crypto.createHash('md5').update(path).digest('hex').toUpperCase(); } @@ -988,3 +984,36 @@ async function globSketches(pattern: string, root: string): Promise { }); }); } + +/** + * Replica of Go `os.UserCacheDir()`. + * https://github.com/golang/go/blob/777f43ab27bde4c662cd0a663f807f74f3fbab0f/src/os/file.go#L477 + */ +export function userCacheDir(): string { + let dir: string | undefined; + const platform = os.platform(); + + switch (platform) { + case 'darwin': { + dir = path.join(os.homedir(), '/Library/Caches'); + break; + } + case 'win32': { + dir = process.env.LocalAppData || undefined; + if (!dir) { + throw new Error('%LocalAppData% is not defined'); + } + break; + } + default: { + dir = process.env.XDG_CACHE_HOME || undefined; + if (!dir) { + dir = path.join(os.homedir() + '/.cache'); + } else if (!path.isAbsolute(dir)) { + throw new Error('path in $XDG_CACHE_HOME is relative'); + } + } + } + + return dir; +} diff --git a/arduino-ide-extension/src/test/node/core-service-impl.slow-test.ts b/arduino-ide-extension/src/test/node/core-service-impl.slow-test.ts index 5bf9e5381..dd80bca56 100644 --- a/arduino-ide-extension/src/test/node/core-service-impl.slow-test.ts +++ b/arduino-ide-extension/src/test/node/core-service-impl.slow-test.ts @@ -61,7 +61,7 @@ describe('core-service-impl', () => { expect('buildOutputUri' in arg).to.be.true; expect(arg.buildOutputUri).to.be.not.undefined; - const tempBuildPaths = await sketchesService.tempBuildPath(sketch); + const tempBuildPaths = await sketchesService.getBuildPath(sketch); if (isWindows) { expect(tempBuildPaths.length).to.be.greaterThan(1); } else {