spot-sdk-ts
Version:
TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics
30 lines • 1.43 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PowerServiceClientImpl = exports.protobufPackage = void 0;
/* eslint-disable */
const power_1 = require("./power");
const minimal_1 = __importDefault(require("protobufjs/minimal"));
exports.protobufPackage = "bosdyn.api";
class PowerServiceClientImpl {
rpc;
constructor(rpc) {
this.rpc = rpc;
this.PowerCommand = this.PowerCommand.bind(this);
this.PowerCommandFeedback = this.PowerCommandFeedback.bind(this);
}
PowerCommand(request) {
const data = power_1.PowerCommandRequest.encode(request).finish();
const promise = this.rpc.request("bosdyn.api.PowerService", "PowerCommand", data);
return promise.then((data) => power_1.PowerCommandResponse.decode(new minimal_1.default.Reader(data)));
}
PowerCommandFeedback(request) {
const data = power_1.PowerCommandFeedbackRequest.encode(request).finish();
const promise = this.rpc.request("bosdyn.api.PowerService", "PowerCommandFeedback", data);
return promise.then((data) => power_1.PowerCommandFeedbackResponse.decode(new minimal_1.default.Reader(data)));
}
}
exports.PowerServiceClientImpl = PowerServiceClientImpl;
//# sourceMappingURL=power_service.js.map