Added 'optimize for debug' option

This commit is contained in:
Miro Spönemann 2020-02-24 10:33:39 +01:00
parent 486f110c80
commit 0445700088
24 changed files with 2441 additions and 424 deletions

View File

@ -13,6 +13,10 @@ export interface ArduinoLaunchRequestArguments extends DebugProtocol.LaunchReque
export class ArduinoDebugSession extends GDBDebugSession {
protected get arduinoBackend(): ArduinoGDBBackend {
return this.gdb as ArduinoGDBBackend;
}
protected createBackend(): GDBBackend {
return new ArduinoGDBBackend();
}
@ -38,4 +42,24 @@ export class ArduinoDebugSession extends GDBDebugSession {
}
}
protected async disconnectRequest(response: DebugProtocol.DisconnectResponse): Promise<void> {
try {
if (this.isRunning) {
// Need to pause first
const waitPromise = new Promise(resolve => this.waitPaused = resolve);
this.gdb.pause();
await waitPromise;
}
try {
await this.arduinoBackend.sendTargetDetach();
} catch (e) {
// Need to catch here as the command result being returned will never exist as it's detached
}
await this.gdb.sendGDBExit();
this.sendResponse(response);
} catch (err) {
this.sendErrorResponse(response, 1, err.message);
}
}
}

View File

@ -6,7 +6,7 @@ import { ArduinoLaunchRequestArguments } from './arduino-debug-session';
export class ArduinoGDBBackend extends GDBBackend {
public spawn(requestArgs: ArduinoLaunchRequestArguments): Promise<void> {
spawn(requestArgs: ArduinoLaunchRequestArguments): Promise<void> {
if (!requestArgs.sketch) {
throw new Error('Missing argument: sketch');
}
@ -28,14 +28,18 @@ export class ArduinoGDBBackend extends GDBBackend {
return this.parser.parse(proc.stdout);
}
public sendFileExecAndSymbols(): Promise<void> {
sendFileExecAndSymbols(): Promise<void> {
// The program file is already sent by `arduino-cli`
return Promise.resolve();
}
public pause(): boolean {
pause(): boolean {
this.sendCommand('-exec-interrupt');
return true;
}
sendTargetDetach(): Promise<void> {
return this.sendCommand('-target-detach');
}
}

View File

@ -12,6 +12,10 @@ export namespace ArduinoCommands {
label: 'Upload Sketch'
}
export const TOGGLE_COMPILE_FOR_DEBUG: Command = {
id: "arduino-toggle-compile-for-debug"
}
export const SHOW_OPEN_CONTEXT_MENU: Command = {
id: 'arduino-show-open-context-menu',
label: 'Open Sketch'

View File

@ -289,13 +289,22 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
}
// Reveal the Output view asynchronously (don't await it)
this.outputContribution.openView({ reveal: true });
await this.coreService.compile({ uri: uri.toString(), board: boardsConfig.selectedBoard });
await this.coreService.compile({
uri: uri.toString(),
board: boardsConfig.selectedBoard,
optimizeForDebug: this.editorMode.compileForDebug
});
} catch (e) {
await this.messageService.error(e.toString());
}
}
});
registry.registerCommand(ArduinoCommands.TOGGLE_COMPILE_FOR_DEBUG, {
execute: () => this.editorMode.toggleCompileForDebug(),
isToggled: () => this.editorMode.compileForDebug
});
registry.registerCommand(ArduinoCommands.UPLOAD, {
isVisible: widget => ArduinoToolbar.is(widget) && widget.side === 'left',
isEnabled: widget => true,
@ -326,7 +335,12 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
}
// Reveal the Output view asynchronously (don't await it)
this.outputContribution.openView({ reveal: true });
await this.coreService.upload({ uri: uri.toString(), board: boardsConfig.selectedBoard, port: selectedPort.address });
await this.coreService.upload({
uri: uri.toString(),
board: boardsConfig.selectedBoard,
port: selectedPort.address,
optimizeForDebug: this.editorMode.compileForDebug
});
} catch (e) {
await this.messageService.error(e.toString());
} finally {
@ -402,7 +416,7 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
});
registry.registerCommand(ArduinoCommands.TOGGLE_ADVANCED_MODE, {
execute: () => this.editorMode.toggle(),
execute: () => this.editorMode.toggleProMode(),
isVisible: widget => ArduinoToolbar.is(widget) && widget.side === 'right',
isToggled: () => this.editorMode.proMode
});
@ -445,10 +459,15 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
label: 'Verify/Compile',
order: '1'
});
registry.registerMenuAction(ArduinoMenus.SKETCH, {
commandId: ArduinoCommands.TOGGLE_COMPILE_FOR_DEBUG.id,
label: 'Optimize for Debug',
order: '2'
});
registry.registerMenuAction(ArduinoMenus.SKETCH, {
commandId: ArduinoCommands.UPLOAD.id,
label: 'Upload',
order: '2'
order: '3'
});
registry.registerMenuAction(ArduinoToolbarContextMenu.OPEN_GROUP, {
commandId: ArduinoCommands.OPEN_FILE_NAVIGATOR.id,

View File

@ -22,7 +22,7 @@ export class EditorMode implements FrontendApplicationContribution {
return value === 'true';
}
async toggle(): Promise<void> {
async toggleProMode(): Promise<void> {
const oldState = this.proMode;
const inAdvancedMode = !oldState;
window.localStorage.setItem(EditorMode.PRO_MODE_KEY, String(inAdvancedMode));
@ -41,8 +41,20 @@ export class EditorMode implements FrontendApplicationContribution {
window.location.reload(true);
}
get compileForDebug(): boolean {
const value = window.localStorage.getItem(EditorMode.COMPILE_FOR_DEBUG_KEY);
return value === 'true';
}
async toggleCompileForDebug(): Promise<void> {
const oldState = this.compileForDebug;
const newState = !oldState;
window.localStorage.setItem(EditorMode.COMPILE_FOR_DEBUG_KEY, String(newState));
}
}
export namespace EditorMode {
export const PRO_MODE_KEY = 'arduino-advanced-mode';
export const COMPILE_FOR_DEBUG_KEY = 'arduino-compile-for-debug';
}

View File

@ -186,22 +186,12 @@ export interface BoardDetails extends Board {
fqbn: string;
requiredTools: Tool[];
locations?: BoardDetailLocations;
}
export interface BoardDetailLocations {
debugScript: string;
}
export interface Tool {
readonly packager: string;
readonly name: string;
readonly version: string;
readonly locations?: ToolLocations;
}
export interface ToolLocations {
main: string
[key: string]: string
}
export namespace Board {

View File

@ -14,6 +14,7 @@ export namespace CoreService {
readonly uri: string;
readonly board: Board;
readonly port: string;
readonly optimizeForDebug: boolean;
}
}
@ -21,6 +22,7 @@ export namespace CoreService {
export interface Options {
readonly uri: string;
readonly board: Board;
readonly optimizeForDebug: boolean;
}
}
}
}

View File

@ -5,18 +5,17 @@ import { Deferred } from '@theia/core/lib/common/promise-util';
import { FileSystem } from '@theia/filesystem/lib/common';
import {
BoardsService, AttachedSerialBoard, BoardPackage, Board, AttachedNetworkBoard, BoardsServiceClient,
Port, BoardDetails, Tool, ToolLocations, BoardDetailLocations
Port, BoardDetails, Tool
} from '../common/protocol/boards-service';
import {
PlatformSearchReq, PlatformSearchResp, PlatformInstallReq, PlatformInstallResp, PlatformListReq,
PlatformListResp, Platform, PlatformUninstallResp, PlatformUninstallReq
} from './cli-protocol/commands/core_pb';
import { CoreClientProvider } from './core-client-provider';
import { BoardListReq, BoardListResp, BoardDetailsReq, BoardDetailsResp, RequiredTool } from './cli-protocol/commands/board_pb';
import { BoardListReq, BoardListResp, BoardDetailsReq, BoardDetailsResp } from './cli-protocol/commands/board_pb';
import { ToolOutputServiceServer } from '../common/protocol/tool-output-service';
import { Installable } from '../common/protocol/installable';
import { ConfigService } from '../common/protocol/config-service';
import * as path from 'path';
@injectable()
export class BoardsServiceImpl implements BoardsService {
@ -237,59 +236,18 @@ export class BoardsServiceImpl implements BoardsService {
const tools = await Promise.all(resp.getRequiredToolsList().map(async t => <Tool>{
name: t.getName(),
packager: t.getPackager(),
version: t.getVersion(),
locations: await this.getToolLocations(t),
version: t.getVersion()
}));
return {
item: {
name: resp.getName(),
fqbn: options.id,
requiredTools: tools,
locations: await this.getBoardLocations(resp)
requiredTools: tools
}
};
}
// TODO: these location should come from the CLI/daemon rather than us botching them together
protected async getBoardLocations(details: BoardDetailsResp): Promise<BoardDetailLocations | undefined> {
const config = await this.configService.getConfiguration();
const datadir = await this.fileSystem.getFsPath(config.dataDirUri);
if (!datadir) {
return undefined;
}
return {
debugScript: path.join(datadir, "packages", "arduino", "hardware", "samd", "1.8.4", "variants", "arduino_zero", "openocd_scripts", "arduino_zero.cfg")
}
}
// TODO: these location should come from the CLI/daemon rather than us botching them together
protected async getToolLocations(t: RequiredTool): Promise<ToolLocations | undefined> {
const config = await this.configService.getConfiguration();
const datadir = await this.fileSystem.getFsPath(config.dataDirUri);
if (!datadir) {
return undefined;
}
const toolBasePath = path.join(datadir, "packages", "arduino", "tools");
let loc: ToolLocations = {
main: path.join(toolBasePath, t.getName(), t.getVersion())
};
switch (t.getName()) {
case "openocd":
loc.scripts = path.join(loc.main, "share", "openocd", "scripts");
loc.main = path.join(loc.main, "bin", "openocd");
break;
case "arm-none-eabi-gcc":
["gdb", "objdump"].forEach(s => loc[s] = path.join(loc.main, "bin", `arm-none-eabi-${s}`));
break;
}
return loc;
}
async search(options: { query?: string }): Promise<{ items: BoardPackage[] }> {
const coreClient = await this.coreClientProvider.getClient();
if (!coreClient) {

View File

@ -1,10 +1,9 @@
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
//
// This file is part of arduino-cli.
//
// Copyright 2018 ARDUINO SA (http://www.arduino.cc/)
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
@ -12,11 +11,10 @@
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to modify or
// otherwise use the software for commercial activities involving the Arduino
// software without disclosing the source code of your own applications. To purchase
// a commercial license, send an email to license@arduino.cc.
//
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
//
'use strict';
var grpc = require('@grpc/grpc-js');
@ -582,7 +580,7 @@ function deserialize_cc_arduino_cli_commands_VersionResp(buffer_arg) {
// The main Arduino Platform Service
var ArduinoCoreService = exports.ArduinoCoreService = {
// Start a new instance of the Arduino Core Service
init: {
init: {
path: '/cc.arduino.cli.commands.ArduinoCore/Init',
requestStream: false,
responseStream: true,
@ -594,7 +592,7 @@ var ArduinoCoreService = exports.ArduinoCoreService = {
responseDeserialize: deserialize_cc_arduino_cli_commands_InitResp,
},
// Destroy an instance of the Arduino Core Service
destroy: {
destroy: {
path: '/cc.arduino.cli.commands.ArduinoCore/Destroy',
requestStream: false,
responseStream: false,
@ -606,7 +604,7 @@ var ArduinoCoreService = exports.ArduinoCoreService = {
responseDeserialize: deserialize_cc_arduino_cli_commands_DestroyResp,
},
// Rescan instance of the Arduino Core Service
rescan: {
rescan: {
path: '/cc.arduino.cli.commands.ArduinoCore/Rescan',
requestStream: false,
responseStream: false,
@ -618,7 +616,7 @@ var ArduinoCoreService = exports.ArduinoCoreService = {
responseDeserialize: deserialize_cc_arduino_cli_commands_RescanResp,
},
// Update package index of the Arduino Core Service
updateIndex: {
updateIndex: {
path: '/cc.arduino.cli.commands.ArduinoCore/UpdateIndex',
requestStream: false,
responseStream: true,
@ -630,7 +628,7 @@ var ArduinoCoreService = exports.ArduinoCoreService = {
responseDeserialize: deserialize_cc_arduino_cli_commands_UpdateIndexResp,
},
// Update libraries index
updateLibrariesIndex: {
updateLibrariesIndex: {
path: '/cc.arduino.cli.commands.ArduinoCore/UpdateLibrariesIndex',
requestStream: false,
responseStream: true,
@ -653,10 +651,10 @@ var ArduinoCoreService = exports.ArduinoCoreService = {
responseDeserialize: deserialize_cc_arduino_cli_commands_VersionResp,
},
// BOARD COMMANDS
// --------------
//
// Requests details about a board
boardDetails: {
// --------------
//
// Requests details about a board
boardDetails: {
path: '/cc.arduino.cli.commands.ArduinoCore/BoardDetails',
requestStream: false,
responseStream: false,

View File

@ -12,48 +12,7 @@ import * as commands_core_pb from "../commands/core_pb";
import * as commands_upload_pb from "../commands/upload_pb";
import * as commands_lib_pb from "../commands/lib_pb";
export class Configuration extends jspb.Message {
getDatadir(): string;
setDatadir(value: string): void;
getSketchbookdir(): string;
setSketchbookdir(value: string): void;
getDownloadsdir(): string;
setDownloadsdir(value: string): void;
clearBoardmanageradditionalurlsList(): void;
getBoardmanageradditionalurlsList(): Array<string>;
setBoardmanageradditionalurlsList(value: Array<string>): void;
addBoardmanageradditionalurls(value: string, index?: number): string;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Configuration.AsObject;
static toObject(includeInstance: boolean, msg: Configuration): Configuration.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Configuration, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Configuration;
static deserializeBinaryFromReader(message: Configuration, reader: jspb.BinaryReader): Configuration;
}
export namespace Configuration {
export type AsObject = {
datadir: string,
sketchbookdir: string,
downloadsdir: string,
boardmanageradditionalurlsList: Array<string>,
}
}
export class InitReq extends jspb.Message {
hasConfiguration(): boolean;
clearConfiguration(): void;
getConfiguration(): Configuration | undefined;
setConfiguration(value?: Configuration): void;
getLibraryManagerOnly(): boolean;
setLibraryManagerOnly(value: boolean): void;
@ -70,7 +29,6 @@ export class InitReq extends jspb.Message {
export namespace InitReq {
export type AsObject = {
configuration?: Configuration.AsObject,
libraryManagerOnly: boolean,
}
}

View File

@ -23,7 +23,6 @@ var commands_upload_pb = require('../commands/upload_pb.js');
goog.object.extend(proto, commands_upload_pb);
var commands_lib_pb = require('../commands/lib_pb.js');
goog.object.extend(proto, commands_lib_pb);
goog.exportSymbol('proto.cc.arduino.cli.commands.Configuration', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.DestroyReq', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.DestroyResp', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.InitReq', null, global);
@ -37,250 +36,6 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.UpdateLibrariesIndexResp', null
goog.exportSymbol('proto.cc.arduino.cli.commands.VersionReq', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.VersionResp', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.Configuration = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.Configuration.repeatedFields_, null);
};
goog.inherits(proto.cc.arduino.cli.commands.Configuration, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.commands.Configuration.displayName = 'proto.cc.arduino.cli.commands.Configuration';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.cc.arduino.cli.commands.Configuration.repeatedFields_ = [4];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.commands.Configuration.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.Configuration.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.Configuration} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.Configuration.toObject = function(includeInstance, msg) {
var f, obj = {
datadir: jspb.Message.getFieldWithDefault(msg, 1, ""),
sketchbookdir: jspb.Message.getFieldWithDefault(msg, 2, ""),
downloadsdir: jspb.Message.getFieldWithDefault(msg, 3, ""),
boardmanageradditionalurlsList: jspb.Message.getRepeatedField(msg, 4)
};
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.Configuration}
*/
proto.cc.arduino.cli.commands.Configuration.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.Configuration;
return proto.cc.arduino.cli.commands.Configuration.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.Configuration} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.Configuration}
*/
proto.cc.arduino.cli.commands.Configuration.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.setDatadir(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setSketchbookdir(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setDownloadsdir(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.addBoardmanageradditionalurls(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.Configuration.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.Configuration.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.Configuration} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.Configuration.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getDatadir();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getSketchbookdir();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getDownloadsdir();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getBoardmanageradditionalurlsList();
if (f.length > 0) {
writer.writeRepeatedString(
4,
f
);
}
};
/**
* optional string dataDir = 1;
* @return {string}
*/
proto.cc.arduino.cli.commands.Configuration.prototype.getDatadir = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.commands.Configuration.prototype.setDatadir = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string sketchbookDir = 2;
* @return {string}
*/
proto.cc.arduino.cli.commands.Configuration.prototype.getSketchbookdir = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.commands.Configuration.prototype.setSketchbookdir = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string downloadsDir = 3;
* @return {string}
*/
proto.cc.arduino.cli.commands.Configuration.prototype.getDownloadsdir = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.commands.Configuration.prototype.setDownloadsdir = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* repeated string boardManagerAdditionalUrls = 4;
* @return {!Array<string>}
*/
proto.cc.arduino.cli.commands.Configuration.prototype.getBoardmanageradditionalurlsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 4));
};
/** @param {!Array<string>} value */
proto.cc.arduino.cli.commands.Configuration.prototype.setBoardmanageradditionalurlsList = function(value) {
jspb.Message.setField(this, 4, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.cc.arduino.cli.commands.Configuration.prototype.addBoardmanageradditionalurls = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 4, value, opt_index);
};
proto.cc.arduino.cli.commands.Configuration.prototype.clearBoardmanageradditionalurlsList = function() {
this.setBoardmanageradditionalurlsList([]);
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@ -327,7 +82,6 @@ proto.cc.arduino.cli.commands.InitReq.prototype.toObject = function(opt_includeI
*/
proto.cc.arduino.cli.commands.InitReq.toObject = function(includeInstance, msg) {
var f, obj = {
configuration: (f = msg.getConfiguration()) && proto.cc.arduino.cli.commands.Configuration.toObject(includeInstance, f),
libraryManagerOnly: jspb.Message.getFieldWithDefault(msg, 2, false)
};
@ -365,11 +119,6 @@ proto.cc.arduino.cli.commands.InitReq.deserializeBinaryFromReader = function(msg
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.cc.arduino.cli.commands.Configuration;
reader.readMessage(value,proto.cc.arduino.cli.commands.Configuration.deserializeBinaryFromReader);
msg.setConfiguration(value);
break;
case 2:
var value = /** @type {boolean} */ (reader.readBool());
msg.setLibraryManagerOnly(value);
@ -403,14 +152,6 @@ proto.cc.arduino.cli.commands.InitReq.prototype.serializeBinary = function() {
*/
proto.cc.arduino.cli.commands.InitReq.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getConfiguration();
if (f != null) {
writer.writeMessage(
1,
f,
proto.cc.arduino.cli.commands.Configuration.serializeBinaryToWriter
);
}
f = message.getLibraryManagerOnly();
if (f) {
writer.writeBool(
@ -421,36 +162,6 @@ proto.cc.arduino.cli.commands.InitReq.serializeBinaryToWriter = function(message
};
/**
* optional Configuration configuration = 1;
* @return {?proto.cc.arduino.cli.commands.Configuration}
*/
proto.cc.arduino.cli.commands.InitReq.prototype.getConfiguration = function() {
return /** @type{?proto.cc.arduino.cli.commands.Configuration} */ (
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.Configuration, 1));
};
/** @param {?proto.cc.arduino.cli.commands.Configuration|undefined} value */
proto.cc.arduino.cli.commands.InitReq.prototype.setConfiguration = function(value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.cc.arduino.cli.commands.InitReq.prototype.clearConfiguration = function() {
this.setConfiguration(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.commands.InitReq.prototype.hasConfiguration = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional bool library_manager_only = 2;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.

View File

@ -55,6 +55,14 @@ export class CompileReq extends jspb.Message {
getJobs(): number;
setJobs(value: number): void;
clearLibrariesList(): void;
getLibrariesList(): Array<string>;
setLibrariesList(value: Array<string>): void;
addLibraries(value: string, index?: number): string;
getOptimizefordebug(): boolean;
setOptimizefordebug(value: boolean): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CompileReq.AsObject;
@ -82,6 +90,8 @@ export namespace CompileReq {
vidpid: string,
exportfile: string,
jobs: number,
librariesList: Array<string>,
optimizefordebug: boolean,
}
}

View File

@ -38,7 +38,7 @@ if (goog.DEBUG && !COMPILED) {
* @private {!Array<number>}
* @const
*/
proto.cc.arduino.cli.commands.CompileReq.repeatedFields_ = [8];
proto.cc.arduino.cli.commands.CompileReq.repeatedFields_ = [8,15];
@ -82,7 +82,9 @@ proto.cc.arduino.cli.commands.CompileReq.toObject = function(includeInstance, ms
quiet: jspb.Message.getFieldWithDefault(msg, 11, false),
vidpid: jspb.Message.getFieldWithDefault(msg, 12, ""),
exportfile: jspb.Message.getFieldWithDefault(msg, 13, ""),
jobs: jspb.Message.getFieldWithDefault(msg, 14, 0)
jobs: jspb.Message.getFieldWithDefault(msg, 14, 0),
librariesList: jspb.Message.getRepeatedField(msg, 15),
optimizefordebug: jspb.Message.getFieldWithDefault(msg, 16, false)
};
if (includeInstance) {
@ -176,6 +178,14 @@ proto.cc.arduino.cli.commands.CompileReq.deserializeBinaryFromReader = function(
var value = /** @type {number} */ (reader.readInt32());
msg.setJobs(value);
break;
case 15:
var value = /** @type {string} */ (reader.readString());
msg.addLibraries(value);
break;
case 16:
var value = /** @type {boolean} */ (reader.readBool());
msg.setOptimizefordebug(value);
break;
default:
reader.skipField();
break;
@ -304,6 +314,20 @@ proto.cc.arduino.cli.commands.CompileReq.serializeBinaryToWriter = function(mess
f
);
}
f = message.getLibrariesList();
if (f.length > 0) {
writer.writeRepeatedString(
15,
f
);
}
f = message.getOptimizefordebug();
if (f) {
writer.writeBool(
16,
f
);
}
};
@ -554,6 +578,52 @@ proto.cc.arduino.cli.commands.CompileReq.prototype.setJobs = function(value) {
};
/**
* repeated string libraries = 15;
* @return {!Array<string>}
*/
proto.cc.arduino.cli.commands.CompileReq.prototype.getLibrariesList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 15));
};
/** @param {!Array<string>} value */
proto.cc.arduino.cli.commands.CompileReq.prototype.setLibrariesList = function(value) {
jspb.Message.setField(this, 15, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.cc.arduino.cli.commands.CompileReq.prototype.addLibraries = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 15, value, opt_index);
};
proto.cc.arduino.cli.commands.CompileReq.prototype.clearLibrariesList = function() {
this.setLibrariesList([]);
};
/**
* optional bool optimizeForDebug = 16;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.cc.arduino.cli.commands.CompileReq.prototype.getOptimizefordebug = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 16, false));
};
/** @param {boolean} value */
proto.cc.arduino.cli.commands.CompileReq.prototype.setOptimizefordebug = function(value) {
jspb.Message.setProto3BooleanField(this, 16, value);
};
/**
* Generated by JsPbCodeGenerator.

View File

@ -0,0 +1,40 @@
// package: cc.arduino.cli.debug
// file: debug/debug.proto
/* tslint:disable */
/* eslint-disable */
import * as grpc from "@grpc/grpc-js";
import * as debug_debug_pb from "../debug/debug_pb";
interface IDebugService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
debug: IDebugService_IDebug;
}
interface IDebugService_IDebug extends grpc.MethodDefinition<debug_debug_pb.DebugReq, debug_debug_pb.DebugResp> {
path: string; // "/cc.arduino.cli.debug.Debug/Debug"
requestStream: boolean; // true
responseStream: boolean; // true
requestSerialize: grpc.serialize<debug_debug_pb.DebugReq>;
requestDeserialize: grpc.deserialize<debug_debug_pb.DebugReq>;
responseSerialize: grpc.serialize<debug_debug_pb.DebugResp>;
responseDeserialize: grpc.deserialize<debug_debug_pb.DebugResp>;
}
export const DebugService: IDebugService;
export interface IDebugServer {
debug: grpc.handleBidiStreamingCall<debug_debug_pb.DebugReq, debug_debug_pb.DebugResp>;
}
export interface IDebugClient {
debug(): grpc.ClientDuplexStream<debug_debug_pb.DebugReq, debug_debug_pb.DebugResp>;
debug(options: Partial<grpc.CallOptions>): grpc.ClientDuplexStream<debug_debug_pb.DebugReq, debug_debug_pb.DebugResp>;
debug(metadata: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientDuplexStream<debug_debug_pb.DebugReq, debug_debug_pb.DebugResp>;
}
export class DebugClient extends grpc.Client implements IDebugClient {
constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
public debug(options?: Partial<grpc.CallOptions>): grpc.ClientDuplexStream<debug_debug_pb.DebugReq, debug_debug_pb.DebugResp>;
public debug(metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientDuplexStream<debug_debug_pb.DebugReq, debug_debug_pb.DebugResp>;
}

View File

@ -0,0 +1,61 @@
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
//
'use strict';
var grpc = require('@grpc/grpc-js');
var debug_debug_pb = require('../debug/debug_pb.js');
function serialize_cc_arduino_cli_debug_DebugReq(arg) {
if (!(arg instanceof debug_debug_pb.DebugReq)) {
throw new Error('Expected argument of type cc.arduino.cli.debug.DebugReq');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_debug_DebugReq(buffer_arg) {
return debug_debug_pb.DebugReq.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_debug_DebugResp(arg) {
if (!(arg instanceof debug_debug_pb.DebugResp)) {
throw new Error('Expected argument of type cc.arduino.cli.debug.DebugResp');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_debug_DebugResp(buffer_arg) {
return debug_debug_pb.DebugResp.deserializeBinary(new Uint8Array(buffer_arg));
}
// Service that abstract a debug Session usage
var DebugService = exports.DebugService = {
debug: {
path: '/cc.arduino.cli.debug.Debug/Debug',
requestStream: true,
responseStream: true,
requestType: debug_debug_pb.DebugReq,
responseType: debug_debug_pb.DebugResp,
requestSerialize: serialize_cc_arduino_cli_debug_DebugReq,
requestDeserialize: deserialize_cc_arduino_cli_debug_DebugReq,
responseSerialize: serialize_cc_arduino_cli_debug_DebugResp,
responseDeserialize: deserialize_cc_arduino_cli_debug_DebugResp,
},
};
exports.DebugClient = grpc.makeGenericClientConstructor(DebugService);

View File

@ -0,0 +1,129 @@
// package: cc.arduino.cli.debug
// file: debug/debug.proto
/* tslint:disable */
/* eslint-disable */
import * as jspb from "google-protobuf";
export class DebugReq extends jspb.Message {
hasDebugreq(): boolean;
clearDebugreq(): void;
getDebugreq(): DebugConfigReq | undefined;
setDebugreq(value?: DebugConfigReq): void;
getData(): Uint8Array | string;
getData_asU8(): Uint8Array;
getData_asB64(): string;
setData(value: Uint8Array | string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DebugReq.AsObject;
static toObject(includeInstance: boolean, msg: DebugReq): DebugReq.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DebugReq, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DebugReq;
static deserializeBinaryFromReader(message: DebugReq, reader: jspb.BinaryReader): DebugReq;
}
export namespace DebugReq {
export type AsObject = {
debugreq?: DebugConfigReq.AsObject,
data: Uint8Array | string,
}
}
export class DebugConfigReq extends jspb.Message {
hasInstance(): boolean;
clearInstance(): void;
getInstance(): Instance | undefined;
setInstance(value?: Instance): void;
getFqbn(): string;
setFqbn(value: string): void;
getSketchPath(): string;
setSketchPath(value: string): void;
getPort(): string;
setPort(value: string): void;
getVerbose(): boolean;
setVerbose(value: boolean): void;
getImportFile(): string;
setImportFile(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DebugConfigReq.AsObject;
static toObject(includeInstance: boolean, msg: DebugConfigReq): DebugConfigReq.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DebugConfigReq, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DebugConfigReq;
static deserializeBinaryFromReader(message: DebugConfigReq, reader: jspb.BinaryReader): DebugConfigReq;
}
export namespace DebugConfigReq {
export type AsObject = {
instance?: Instance.AsObject,
fqbn: string,
sketchPath: string,
port: string,
verbose: boolean,
importFile: string,
}
}
export class DebugResp extends jspb.Message {
getData(): Uint8Array | string;
getData_asU8(): Uint8Array;
getData_asB64(): string;
setData(value: Uint8Array | string): void;
getError(): string;
setError(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DebugResp.AsObject;
static toObject(includeInstance: boolean, msg: DebugResp): DebugResp.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DebugResp, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DebugResp;
static deserializeBinaryFromReader(message: DebugResp, reader: jspb.BinaryReader): DebugResp;
}
export namespace DebugResp {
export type AsObject = {
data: Uint8Array | string,
error: string,
}
}
export class Instance extends jspb.Message {
getId(): number;
setId(value: number): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Instance.AsObject;
static toObject(includeInstance: boolean, msg: Instance): Instance.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Instance, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Instance;
static deserializeBinaryFromReader(message: Instance, reader: jspb.BinaryReader): Instance;
}
export namespace Instance {
export type AsObject = {
id: number,
}
}

View File

@ -0,0 +1,859 @@
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.cc.arduino.cli.debug.DebugConfigReq', null, global);
goog.exportSymbol('proto.cc.arduino.cli.debug.DebugReq', null, global);
goog.exportSymbol('proto.cc.arduino.cli.debug.DebugResp', null, global);
goog.exportSymbol('proto.cc.arduino.cli.debug.Instance', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.debug.DebugReq = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.debug.DebugReq, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.debug.DebugReq.displayName = 'proto.cc.arduino.cli.debug.DebugReq';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.debug.DebugReq.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.debug.DebugReq.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.debug.DebugReq} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.DebugReq.toObject = function(includeInstance, msg) {
var f, obj = {
debugreq: (f = msg.getDebugreq()) && proto.cc.arduino.cli.debug.DebugConfigReq.toObject(includeInstance, f),
data: msg.getData_asB64()
};
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.debug.DebugReq}
*/
proto.cc.arduino.cli.debug.DebugReq.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.debug.DebugReq;
return proto.cc.arduino.cli.debug.DebugReq.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.debug.DebugReq} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.debug.DebugReq}
*/
proto.cc.arduino.cli.debug.DebugReq.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.debug.DebugConfigReq;
reader.readMessage(value,proto.cc.arduino.cli.debug.DebugConfigReq.deserializeBinaryFromReader);
msg.setDebugreq(value);
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setData(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.debug.DebugReq.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.debug.DebugReq.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.debug.DebugReq} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.DebugReq.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getDebugreq();
if (f != null) {
writer.writeMessage(
1,
f,
proto.cc.arduino.cli.debug.DebugConfigReq.serializeBinaryToWriter
);
}
f = message.getData_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
};
/**
* optional DebugConfigReq debugReq = 1;
* @return {?proto.cc.arduino.cli.debug.DebugConfigReq}
*/
proto.cc.arduino.cli.debug.DebugReq.prototype.getDebugreq = function() {
return /** @type{?proto.cc.arduino.cli.debug.DebugConfigReq} */ (
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.debug.DebugConfigReq, 1));
};
/** @param {?proto.cc.arduino.cli.debug.DebugConfigReq|undefined} value */
proto.cc.arduino.cli.debug.DebugReq.prototype.setDebugreq = function(value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.cc.arduino.cli.debug.DebugReq.prototype.clearDebugreq = function() {
this.setDebugreq(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.debug.DebugReq.prototype.hasDebugreq = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional bytes data = 2;
* @return {!(string|Uint8Array)}
*/
proto.cc.arduino.cli.debug.DebugReq.prototype.getData = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* optional bytes data = 2;
* This is a type-conversion wrapper around `getData()`
* @return {string}
*/
proto.cc.arduino.cli.debug.DebugReq.prototype.getData_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getData()));
};
/**
* optional bytes data = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getData()`
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.debug.DebugReq.prototype.getData_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getData()));
};
/** @param {!(string|Uint8Array)} value */
proto.cc.arduino.cli.debug.DebugReq.prototype.setData = function(value) {
jspb.Message.setProto3BytesField(this, 2, value);
};
/**
* 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.debug.DebugConfigReq = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.debug.DebugConfigReq, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.debug.DebugConfigReq.displayName = 'proto.cc.arduino.cli.debug.DebugConfigReq';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.debug.DebugConfigReq.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.debug.DebugConfigReq} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.DebugConfigReq.toObject = function(includeInstance, msg) {
var f, obj = {
instance: (f = msg.getInstance()) && proto.cc.arduino.cli.debug.Instance.toObject(includeInstance, f),
fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""),
sketchPath: jspb.Message.getFieldWithDefault(msg, 3, ""),
port: jspb.Message.getFieldWithDefault(msg, 4, ""),
verbose: jspb.Message.getFieldWithDefault(msg, 5, false),
importFile: jspb.Message.getFieldWithDefault(msg, 7, "")
};
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.debug.DebugConfigReq}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.debug.DebugConfigReq;
return proto.cc.arduino.cli.debug.DebugConfigReq.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.debug.DebugConfigReq} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.debug.DebugConfigReq}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.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.debug.Instance;
reader.readMessage(value,proto.cc.arduino.cli.debug.Instance.deserializeBinaryFromReader);
msg.setInstance(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setFqbn(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setSketchPath(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setPort(value);
break;
case 5:
var value = /** @type {boolean} */ (reader.readBool());
msg.setVerbose(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setImportFile(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.debug.DebugConfigReq.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.debug.DebugConfigReq} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.DebugConfigReq.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getInstance();
if (f != null) {
writer.writeMessage(
1,
f,
proto.cc.arduino.cli.debug.Instance.serializeBinaryToWriter
);
}
f = message.getFqbn();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getSketchPath();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getPort();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getVerbose();
if (f) {
writer.writeBool(
5,
f
);
}
f = message.getImportFile();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
};
/**
* optional Instance instance = 1;
* @return {?proto.cc.arduino.cli.debug.Instance}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.getInstance = function() {
return /** @type{?proto.cc.arduino.cli.debug.Instance} */ (
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.debug.Instance, 1));
};
/** @param {?proto.cc.arduino.cli.debug.Instance|undefined} value */
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.setInstance = function(value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.clearInstance = function() {
this.setInstance(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.hasInstance = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional string fqbn = 2;
* @return {string}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.getFqbn = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.setFqbn = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string sketch_path = 3;
* @return {string}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.getSketchPath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.setSketchPath = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string port = 4;
* @return {string}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.getPort = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.setPort = function(value) {
jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional bool verbose = 5;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.getVerbose = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 5, false));
};
/** @param {boolean} value */
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.setVerbose = function(value) {
jspb.Message.setProto3BooleanField(this, 5, value);
};
/**
* optional string import_file = 7;
* @return {string}
*/
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.getImportFile = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.debug.DebugConfigReq.prototype.setImportFile = function(value) {
jspb.Message.setProto3StringField(this, 7, value);
};
/**
* 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.debug.DebugResp = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.debug.DebugResp, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.debug.DebugResp.displayName = 'proto.cc.arduino.cli.debug.DebugResp';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.debug.DebugResp.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.debug.DebugResp.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.debug.DebugResp} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.DebugResp.toObject = function(includeInstance, msg) {
var f, obj = {
data: msg.getData_asB64(),
error: 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.debug.DebugResp}
*/
proto.cc.arduino.cli.debug.DebugResp.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.debug.DebugResp;
return proto.cc.arduino.cli.debug.DebugResp.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.debug.DebugResp} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.debug.DebugResp}
*/
proto.cc.arduino.cli.debug.DebugResp.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setData(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setError(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.debug.DebugResp.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.debug.DebugResp.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.debug.DebugResp} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.DebugResp.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getData_asU8();
if (f.length > 0) {
writer.writeBytes(
1,
f
);
}
f = message.getError();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional bytes data = 1;
* @return {!(string|Uint8Array)}
*/
proto.cc.arduino.cli.debug.DebugResp.prototype.getData = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* optional bytes data = 1;
* This is a type-conversion wrapper around `getData()`
* @return {string}
*/
proto.cc.arduino.cli.debug.DebugResp.prototype.getData_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getData()));
};
/**
* optional bytes data = 1;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getData()`
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.debug.DebugResp.prototype.getData_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getData()));
};
/** @param {!(string|Uint8Array)} value */
proto.cc.arduino.cli.debug.DebugResp.prototype.setData = function(value) {
jspb.Message.setProto3BytesField(this, 1, value);
};
/**
* optional string error = 2;
* @return {string}
*/
proto.cc.arduino.cli.debug.DebugResp.prototype.getError = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.debug.DebugResp.prototype.setError = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* 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.debug.Instance = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.debug.Instance, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.debug.Instance.displayName = 'proto.cc.arduino.cli.debug.Instance';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.debug.Instance.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.debug.Instance.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.debug.Instance} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.Instance.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, 0)
};
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.debug.Instance}
*/
proto.cc.arduino.cli.debug.Instance.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.debug.Instance;
return proto.cc.arduino.cli.debug.Instance.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.debug.Instance} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.debug.Instance}
*/
proto.cc.arduino.cli.debug.Instance.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt32());
msg.setId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.debug.Instance.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.debug.Instance.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.debug.Instance} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.debug.Instance.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
};
/**
* optional int32 id = 1;
* @return {number}
*/
proto.cc.arduino.cli.debug.Instance.prototype.getId = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/** @param {number} value */
proto.cc.arduino.cli.debug.Instance.prototype.setId = function(value) {
jspb.Message.setProto3IntField(this, 1, value);
};
goog.object.extend(exports, proto.cc.arduino.cli.debug);

View File

@ -3,7 +3,7 @@
// Original file comments:
// This file is part of arduino-cli.
//
// Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.

View File

@ -0,0 +1,92 @@
// package: cc.arduino.cli.settings
// file: settings/settings.proto
/* tslint:disable */
/* eslint-disable */
import * as grpc from "@grpc/grpc-js";
import * as settings_settings_pb from "../settings/settings_pb";
interface ISettingsService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
getAll: ISettingsService_IGetAll;
merge: ISettingsService_IMerge;
getValue: ISettingsService_IGetValue;
setValue: ISettingsService_ISetValue;
}
interface ISettingsService_IGetAll extends grpc.MethodDefinition<settings_settings_pb.GetAllRequest, settings_settings_pb.RawData> {
path: string; // "/cc.arduino.cli.settings.Settings/GetAll"
requestStream: boolean; // false
responseStream: boolean; // false
requestSerialize: grpc.serialize<settings_settings_pb.GetAllRequest>;
requestDeserialize: grpc.deserialize<settings_settings_pb.GetAllRequest>;
responseSerialize: grpc.serialize<settings_settings_pb.RawData>;
responseDeserialize: grpc.deserialize<settings_settings_pb.RawData>;
}
interface ISettingsService_IMerge extends grpc.MethodDefinition<settings_settings_pb.RawData, settings_settings_pb.MergeResponse> {
path: string; // "/cc.arduino.cli.settings.Settings/Merge"
requestStream: boolean; // false
responseStream: boolean; // false
requestSerialize: grpc.serialize<settings_settings_pb.RawData>;
requestDeserialize: grpc.deserialize<settings_settings_pb.RawData>;
responseSerialize: grpc.serialize<settings_settings_pb.MergeResponse>;
responseDeserialize: grpc.deserialize<settings_settings_pb.MergeResponse>;
}
interface ISettingsService_IGetValue extends grpc.MethodDefinition<settings_settings_pb.GetValueRequest, settings_settings_pb.Value> {
path: string; // "/cc.arduino.cli.settings.Settings/GetValue"
requestStream: boolean; // false
responseStream: boolean; // false
requestSerialize: grpc.serialize<settings_settings_pb.GetValueRequest>;
requestDeserialize: grpc.deserialize<settings_settings_pb.GetValueRequest>;
responseSerialize: grpc.serialize<settings_settings_pb.Value>;
responseDeserialize: grpc.deserialize<settings_settings_pb.Value>;
}
interface ISettingsService_ISetValue extends grpc.MethodDefinition<settings_settings_pb.Value, settings_settings_pb.SetValueResponse> {
path: string; // "/cc.arduino.cli.settings.Settings/SetValue"
requestStream: boolean; // false
responseStream: boolean; // false
requestSerialize: grpc.serialize<settings_settings_pb.Value>;
requestDeserialize: grpc.deserialize<settings_settings_pb.Value>;
responseSerialize: grpc.serialize<settings_settings_pb.SetValueResponse>;
responseDeserialize: grpc.deserialize<settings_settings_pb.SetValueResponse>;
}
export const SettingsService: ISettingsService;
export interface ISettingsServer {
getAll: grpc.handleUnaryCall<settings_settings_pb.GetAllRequest, settings_settings_pb.RawData>;
merge: grpc.handleUnaryCall<settings_settings_pb.RawData, settings_settings_pb.MergeResponse>;
getValue: grpc.handleUnaryCall<settings_settings_pb.GetValueRequest, settings_settings_pb.Value>;
setValue: grpc.handleUnaryCall<settings_settings_pb.Value, settings_settings_pb.SetValueResponse>;
}
export interface ISettingsClient {
getAll(request: settings_settings_pb.GetAllRequest, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.RawData) => void): grpc.ClientUnaryCall;
getAll(request: settings_settings_pb.GetAllRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.RawData) => void): grpc.ClientUnaryCall;
getAll(request: settings_settings_pb.GetAllRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.RawData) => void): grpc.ClientUnaryCall;
merge(request: settings_settings_pb.RawData, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
merge(request: settings_settings_pb.RawData, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
merge(request: settings_settings_pb.RawData, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
getValue(request: settings_settings_pb.GetValueRequest, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.Value) => void): grpc.ClientUnaryCall;
getValue(request: settings_settings_pb.GetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.Value) => void): grpc.ClientUnaryCall;
getValue(request: settings_settings_pb.GetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.Value) => void): grpc.ClientUnaryCall;
setValue(request: settings_settings_pb.Value, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
setValue(request: settings_settings_pb.Value, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
setValue(request: settings_settings_pb.Value, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
}
export class SettingsClient extends grpc.Client implements ISettingsClient {
constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
public getAll(request: settings_settings_pb.GetAllRequest, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.RawData) => void): grpc.ClientUnaryCall;
public getAll(request: settings_settings_pb.GetAllRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.RawData) => void): grpc.ClientUnaryCall;
public getAll(request: settings_settings_pb.GetAllRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.RawData) => void): grpc.ClientUnaryCall;
public merge(request: settings_settings_pb.RawData, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
public merge(request: settings_settings_pb.RawData, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
public merge(request: settings_settings_pb.RawData, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
public getValue(request: settings_settings_pb.GetValueRequest, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.Value) => void): grpc.ClientUnaryCall;
public getValue(request: settings_settings_pb.GetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.Value) => void): grpc.ClientUnaryCall;
public getValue(request: settings_settings_pb.GetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.Value) => void): grpc.ClientUnaryCall;
public setValue(request: settings_settings_pb.Value, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
public setValue(request: settings_settings_pb.Value, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
public setValue(request: settings_settings_pb.Value, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: settings_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
}

View File

@ -0,0 +1,137 @@
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
//
'use strict';
var grpc = require('@grpc/grpc-js');
var settings_settings_pb = require('../settings/settings_pb.js');
function serialize_cc_arduino_cli_settings_GetAllRequest(arg) {
if (!(arg instanceof settings_settings_pb.GetAllRequest)) {
throw new Error('Expected argument of type cc.arduino.cli.settings.GetAllRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_settings_GetAllRequest(buffer_arg) {
return settings_settings_pb.GetAllRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_settings_GetValueRequest(arg) {
if (!(arg instanceof settings_settings_pb.GetValueRequest)) {
throw new Error('Expected argument of type cc.arduino.cli.settings.GetValueRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_settings_GetValueRequest(buffer_arg) {
return settings_settings_pb.GetValueRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_settings_MergeResponse(arg) {
if (!(arg instanceof settings_settings_pb.MergeResponse)) {
throw new Error('Expected argument of type cc.arduino.cli.settings.MergeResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_settings_MergeResponse(buffer_arg) {
return settings_settings_pb.MergeResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_settings_RawData(arg) {
if (!(arg instanceof settings_settings_pb.RawData)) {
throw new Error('Expected argument of type cc.arduino.cli.settings.RawData');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_settings_RawData(buffer_arg) {
return settings_settings_pb.RawData.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_settings_SetValueResponse(arg) {
if (!(arg instanceof settings_settings_pb.SetValueResponse)) {
throw new Error('Expected argument of type cc.arduino.cli.settings.SetValueResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_settings_SetValueResponse(buffer_arg) {
return settings_settings_pb.SetValueResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_cc_arduino_cli_settings_Value(arg) {
if (!(arg instanceof settings_settings_pb.Value)) {
throw new Error('Expected argument of type cc.arduino.cli.settings.Value');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_cc_arduino_cli_settings_Value(buffer_arg) {
return settings_settings_pb.Value.deserializeBinary(new Uint8Array(buffer_arg));
}
var SettingsService = exports.SettingsService = {
getAll: {
path: '/cc.arduino.cli.settings.Settings/GetAll',
requestStream: false,
responseStream: false,
requestType: settings_settings_pb.GetAllRequest,
responseType: settings_settings_pb.RawData,
requestSerialize: serialize_cc_arduino_cli_settings_GetAllRequest,
requestDeserialize: deserialize_cc_arduino_cli_settings_GetAllRequest,
responseSerialize: serialize_cc_arduino_cli_settings_RawData,
responseDeserialize: deserialize_cc_arduino_cli_settings_RawData,
},
merge: {
path: '/cc.arduino.cli.settings.Settings/Merge',
requestStream: false,
responseStream: false,
requestType: settings_settings_pb.RawData,
responseType: settings_settings_pb.MergeResponse,
requestSerialize: serialize_cc_arduino_cli_settings_RawData,
requestDeserialize: deserialize_cc_arduino_cli_settings_RawData,
responseSerialize: serialize_cc_arduino_cli_settings_MergeResponse,
responseDeserialize: deserialize_cc_arduino_cli_settings_MergeResponse,
},
getValue: {
path: '/cc.arduino.cli.settings.Settings/GetValue',
requestStream: false,
responseStream: false,
requestType: settings_settings_pb.GetValueRequest,
responseType: settings_settings_pb.Value,
requestSerialize: serialize_cc_arduino_cli_settings_GetValueRequest,
requestDeserialize: deserialize_cc_arduino_cli_settings_GetValueRequest,
responseSerialize: serialize_cc_arduino_cli_settings_Value,
responseDeserialize: deserialize_cc_arduino_cli_settings_Value,
},
setValue: {
path: '/cc.arduino.cli.settings.Settings/SetValue',
requestStream: false,
responseStream: false,
requestType: settings_settings_pb.Value,
responseType: settings_settings_pb.SetValueResponse,
requestSerialize: serialize_cc_arduino_cli_settings_Value,
requestDeserialize: deserialize_cc_arduino_cli_settings_Value,
responseSerialize: serialize_cc_arduino_cli_settings_SetValueResponse,
responseDeserialize: deserialize_cc_arduino_cli_settings_SetValueResponse,
},
};
exports.SettingsClient = grpc.makeGenericClientConstructor(SettingsService);

View File

@ -0,0 +1,125 @@
// package: cc.arduino.cli.settings
// file: settings/settings.proto
/* tslint:disable */
/* eslint-disable */
import * as jspb from "google-protobuf";
export class RawData extends jspb.Message {
getJsondata(): string;
setJsondata(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): RawData.AsObject;
static toObject(includeInstance: boolean, msg: RawData): RawData.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: RawData, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): RawData;
static deserializeBinaryFromReader(message: RawData, reader: jspb.BinaryReader): RawData;
}
export namespace RawData {
export type AsObject = {
jsondata: string,
}
}
export class Value extends jspb.Message {
getKey(): string;
setKey(value: string): void;
getJsondata(): string;
setJsondata(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Value.AsObject;
static toObject(includeInstance: boolean, msg: Value): Value.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Value, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Value;
static deserializeBinaryFromReader(message: Value, reader: jspb.BinaryReader): Value;
}
export namespace Value {
export type AsObject = {
key: string,
jsondata: string,
}
}
export class GetAllRequest extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetAllRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetAllRequest): GetAllRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetAllRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetAllRequest;
static deserializeBinaryFromReader(message: GetAllRequest, reader: jspb.BinaryReader): GetAllRequest;
}
export namespace GetAllRequest {
export type AsObject = {
}
}
export class GetValueRequest extends jspb.Message {
getKey(): string;
setKey(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetValueRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetValueRequest): GetValueRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetValueRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetValueRequest;
static deserializeBinaryFromReader(message: GetValueRequest, reader: jspb.BinaryReader): GetValueRequest;
}
export namespace GetValueRequest {
export type AsObject = {
key: string,
}
}
export class MergeResponse extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): MergeResponse.AsObject;
static toObject(includeInstance: boolean, msg: MergeResponse): MergeResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: MergeResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): MergeResponse;
static deserializeBinaryFromReader(message: MergeResponse, reader: jspb.BinaryReader): MergeResponse;
}
export namespace MergeResponse {
export type AsObject = {
}
}
export class SetValueResponse extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): SetValueResponse.AsObject;
static toObject(includeInstance: boolean, msg: SetValueResponse): SetValueResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: SetValueResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): SetValueResponse;
static deserializeBinaryFromReader(message: SetValueResponse, reader: jspb.BinaryReader): SetValueResponse;
}
export namespace SetValueResponse {
export type AsObject = {
}
}

View File

@ -0,0 +1,821 @@
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.cc.arduino.cli.settings.GetAllRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.settings.GetValueRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.settings.MergeResponse', null, global);
goog.exportSymbol('proto.cc.arduino.cli.settings.RawData', null, global);
goog.exportSymbol('proto.cc.arduino.cli.settings.SetValueResponse', null, global);
goog.exportSymbol('proto.cc.arduino.cli.settings.Value', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.settings.RawData = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.settings.RawData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.settings.RawData.displayName = 'proto.cc.arduino.cli.settings.RawData';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.settings.RawData.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.settings.RawData.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.settings.RawData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.RawData.toObject = function(includeInstance, msg) {
var f, obj = {
jsondata: jspb.Message.getFieldWithDefault(msg, 1, "")
};
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.settings.RawData}
*/
proto.cc.arduino.cli.settings.RawData.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.settings.RawData;
return proto.cc.arduino.cli.settings.RawData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.settings.RawData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.settings.RawData}
*/
proto.cc.arduino.cli.settings.RawData.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.setJsondata(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.settings.RawData.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.settings.RawData.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.settings.RawData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.RawData.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getJsondata();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string jsonData = 1;
* @return {string}
*/
proto.cc.arduino.cli.settings.RawData.prototype.getJsondata = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.settings.RawData.prototype.setJsondata = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* 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.settings.Value = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.settings.Value, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.settings.Value.displayName = 'proto.cc.arduino.cli.settings.Value';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.settings.Value.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.settings.Value.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.settings.Value} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.Value.toObject = function(includeInstance, msg) {
var f, obj = {
key: jspb.Message.getFieldWithDefault(msg, 1, ""),
jsondata: 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.settings.Value}
*/
proto.cc.arduino.cli.settings.Value.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.settings.Value;
return proto.cc.arduino.cli.settings.Value.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.settings.Value} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.settings.Value}
*/
proto.cc.arduino.cli.settings.Value.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.setKey(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setJsondata(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.settings.Value.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.settings.Value.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.settings.Value} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.Value.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getKey();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getJsondata();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string key = 1;
* @return {string}
*/
proto.cc.arduino.cli.settings.Value.prototype.getKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.settings.Value.prototype.setKey = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string jsonData = 2;
* @return {string}
*/
proto.cc.arduino.cli.settings.Value.prototype.getJsondata = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.settings.Value.prototype.setJsondata = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* 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.settings.GetAllRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.settings.GetAllRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.settings.GetAllRequest.displayName = 'proto.cc.arduino.cli.settings.GetAllRequest';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.settings.GetAllRequest.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.settings.GetAllRequest.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.settings.GetAllRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.GetAllRequest.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.settings.GetAllRequest}
*/
proto.cc.arduino.cli.settings.GetAllRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.settings.GetAllRequest;
return proto.cc.arduino.cli.settings.GetAllRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.settings.GetAllRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.settings.GetAllRequest}
*/
proto.cc.arduino.cli.settings.GetAllRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.settings.GetAllRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.settings.GetAllRequest.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.settings.GetAllRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.GetAllRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
/**
* 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.settings.GetValueRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.settings.GetValueRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.settings.GetValueRequest.displayName = 'proto.cc.arduino.cli.settings.GetValueRequest';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.settings.GetValueRequest.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.settings.GetValueRequest.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.settings.GetValueRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.GetValueRequest.toObject = function(includeInstance, msg) {
var f, obj = {
key: jspb.Message.getFieldWithDefault(msg, 1, "")
};
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.settings.GetValueRequest}
*/
proto.cc.arduino.cli.settings.GetValueRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.settings.GetValueRequest;
return proto.cc.arduino.cli.settings.GetValueRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.settings.GetValueRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.settings.GetValueRequest}
*/
proto.cc.arduino.cli.settings.GetValueRequest.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.setKey(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.settings.GetValueRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.settings.GetValueRequest.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.settings.GetValueRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.GetValueRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getKey();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string key = 1;
* @return {string}
*/
proto.cc.arduino.cli.settings.GetValueRequest.prototype.getKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.cc.arduino.cli.settings.GetValueRequest.prototype.setKey = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* 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.settings.MergeResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.settings.MergeResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.settings.MergeResponse.displayName = 'proto.cc.arduino.cli.settings.MergeResponse';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.settings.MergeResponse.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.settings.MergeResponse.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.settings.MergeResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.MergeResponse.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.settings.MergeResponse}
*/
proto.cc.arduino.cli.settings.MergeResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.settings.MergeResponse;
return proto.cc.arduino.cli.settings.MergeResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.settings.MergeResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.settings.MergeResponse}
*/
proto.cc.arduino.cli.settings.MergeResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.settings.MergeResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.settings.MergeResponse.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.settings.MergeResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.MergeResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
/**
* 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.settings.SetValueResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.settings.SetValueResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.cc.arduino.cli.settings.SetValueResponse.displayName = 'proto.cc.arduino.cli.settings.SetValueResponse';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.settings.SetValueResponse.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.settings.SetValueResponse.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.settings.SetValueResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.SetValueResponse.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.settings.SetValueResponse}
*/
proto.cc.arduino.cli.settings.SetValueResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.settings.SetValueResponse;
return proto.cc.arduino.cli.settings.SetValueResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.settings.SetValueResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.settings.SetValueResponse}
*/
proto.cc.arduino.cli.settings.SetValueResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.settings.SetValueResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.settings.SetValueResponse.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.settings.SetValueResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.settings.SetValueResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
goog.object.extend(exports, proto.cc.arduino.cli.settings);

View File

@ -11,7 +11,6 @@ import { ArduinoCoreClient } from './cli-protocol/commands/commands_grpc_pb';
import {
InitResp,
InitReq,
Configuration,
UpdateIndexReq,
UpdateIndexResp,
UpdateLibrariesIndexReq,
@ -91,7 +90,6 @@ export class CoreClientProviderImpl implements CoreClientProvider {
console.info(` >>> Creating and caching a new client for ${rootUri}...`);
const client = new ArduinoCoreClient('localhost:50051', grpc.credentials.createInsecure());
const config = new Configuration();
const rootPath = await this.fileSystem.getFsPath(rootUri);
if (!rootPath) {
throw new Error(`Could not resolve filesystem path of URI: ${rootUri}.`);
@ -114,13 +112,7 @@ export class CoreClientProviderImpl implements CoreClientProvider {
fs.mkdirSync(downloadDir);
}
config.setSketchbookdir(sketchDirPath);
config.setDatadir(dataDirPath);
config.setDownloadsdir(downloadDir);
config.setBoardmanageradditionalurlsList(['https://downloads.arduino.cc/packages/package_index.json']);
const initReq = new InitReq();
initReq.setConfiguration(config);
initReq.setLibraryManagerOnly(false);
const initResp = await new Promise<InitResp>(resolve => {
let resp: InitResp | undefined = undefined;

View File

@ -50,6 +50,7 @@ export class CoreServiceImpl implements CoreService {
compilerReq.setInstance(instance);
compilerReq.setSketchpath(sketchpath);
compilerReq.setFqbn(currentBoard.fqbn!);
compilerReq.setOptimizefordebug(options.optimizeForDebug);
compilerReq.setPreprocess(false);
compilerReq.setVerbose(true);
compilerReq.setQuiet(false);
@ -72,7 +73,7 @@ export class CoreServiceImpl implements CoreService {
}
async upload(options: CoreService.Upload.Options): Promise<void> {
await this.compile({ uri: options.uri, board: options.board });
await this.compile({ uri: options.uri, board: options.board, optimizeForDebug: options.optimizeForDebug });
console.log('upload', options);
const { uri } = options;