spot-sdk-js
Version:
Develop applications and payloads for Spot using the unofficial Boston Dynamics Spot Node.js SDK.
1,198 lines (1,036 loc) • 33 kB
JavaScript
// source: bosdyn/api/network_stats.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js');
goog.object.extend(proto, google_protobuf_duration_pb);
goog.exportSymbol('proto.bosdyn.api.Association', null, global);
goog.exportSymbol('proto.bosdyn.api.WifiDevice', null, global);
goog.exportSymbol('proto.bosdyn.api.WifiDevice.Type', null, global);
goog.exportSymbol('proto.bosdyn.api.WifiStats', 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.bosdyn.api.Association = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.Association, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.Association.displayName = 'proto.bosdyn.api.Association';
}
/**
* 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.bosdyn.api.WifiDevice = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.bosdyn.api.WifiDevice.repeatedFields_, null);
};
goog.inherits(proto.bosdyn.api.WifiDevice, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.WifiDevice.displayName = 'proto.bosdyn.api.WifiDevice';
}
/**
* 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.bosdyn.api.WifiStats = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.bosdyn.api.WifiStats.repeatedFields_, null);
};
goog.inherits(proto.bosdyn.api.WifiStats, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.WifiStats.displayName = 'proto.bosdyn.api.WifiStats';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.Association.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.Association.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.Association} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Association.toObject = function(includeInstance, msg) {
var f, obj = {
macAddress: jspb.Message.getFieldWithDefault(msg, 1, ""),
connectedTime: (f = msg.getConnectedTime()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f),
rxSignalDbm: jspb.Message.getFieldWithDefault(msg, 3, 0),
rxSignalAvgDbm: jspb.Message.getFieldWithDefault(msg, 4, 0),
rxBeaconSignalAvgDbm: jspb.Message.getFieldWithDefault(msg, 5, 0),
expectedBitsPerSecond: jspb.Message.getFieldWithDefault(msg, 6, 0),
rxBytes: jspb.Message.getFieldWithDefault(msg, 7, 0),
rxPackets: jspb.Message.getFieldWithDefault(msg, 8, 0),
rxBitsPerSecond: jspb.Message.getFieldWithDefault(msg, 9, 0),
txBytes: jspb.Message.getFieldWithDefault(msg, 10, 0),
txPackets: jspb.Message.getFieldWithDefault(msg, 11, 0),
txBitsPerSecond: jspb.Message.getFieldWithDefault(msg, 12, 0),
txRetries: jspb.Message.getFieldWithDefault(msg, 13, 0),
txFailed: jspb.Message.getFieldWithDefault(msg, 14, 0),
beaconsReceived: jspb.Message.getFieldWithDefault(msg, 15, 0),
beaconLossCount: jspb.Message.getFieldWithDefault(msg, 16, 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.bosdyn.api.Association}
*/
proto.bosdyn.api.Association.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.Association;
return proto.bosdyn.api.Association.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.Association} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.Association}
*/
proto.bosdyn.api.Association.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.setMacAddress(value);
break;
case 2:
var value = new google_protobuf_duration_pb.Duration;
reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
msg.setConnectedTime(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt32());
msg.setRxSignalDbm(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt32());
msg.setRxSignalAvgDbm(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt32());
msg.setRxBeaconSignalAvgDbm(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt64());
msg.setExpectedBitsPerSecond(value);
break;
case 7:
var value = /** @type {number} */ (reader.readInt64());
msg.setRxBytes(value);
break;
case 8:
var value = /** @type {number} */ (reader.readInt64());
msg.setRxPackets(value);
break;
case 9:
var value = /** @type {number} */ (reader.readInt64());
msg.setRxBitsPerSecond(value);
break;
case 10:
var value = /** @type {number} */ (reader.readInt64());
msg.setTxBytes(value);
break;
case 11:
var value = /** @type {number} */ (reader.readInt64());
msg.setTxPackets(value);
break;
case 12:
var value = /** @type {number} */ (reader.readInt64());
msg.setTxBitsPerSecond(value);
break;
case 13:
var value = /** @type {number} */ (reader.readInt64());
msg.setTxRetries(value);
break;
case 14:
var value = /** @type {number} */ (reader.readInt64());
msg.setTxFailed(value);
break;
case 15:
var value = /** @type {number} */ (reader.readInt64());
msg.setBeaconsReceived(value);
break;
case 16:
var value = /** @type {number} */ (reader.readInt64());
msg.setBeaconLossCount(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.Association.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.Association.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.Association} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Association.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getMacAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getConnectedTime();
if (f != null) {
writer.writeMessage(
2,
f,
google_protobuf_duration_pb.Duration.serializeBinaryToWriter
);
}
f = message.getRxSignalDbm();
if (f !== 0) {
writer.writeInt32(
3,
f
);
}
f = message.getRxSignalAvgDbm();
if (f !== 0) {
writer.writeInt32(
4,
f
);
}
f = message.getRxBeaconSignalAvgDbm();
if (f !== 0) {
writer.writeInt32(
5,
f
);
}
f = message.getExpectedBitsPerSecond();
if (f !== 0) {
writer.writeInt64(
6,
f
);
}
f = message.getRxBytes();
if (f !== 0) {
writer.writeInt64(
7,
f
);
}
f = message.getRxPackets();
if (f !== 0) {
writer.writeInt64(
8,
f
);
}
f = message.getRxBitsPerSecond();
if (f !== 0) {
writer.writeInt64(
9,
f
);
}
f = message.getTxBytes();
if (f !== 0) {
writer.writeInt64(
10,
f
);
}
f = message.getTxPackets();
if (f !== 0) {
writer.writeInt64(
11,
f
);
}
f = message.getTxBitsPerSecond();
if (f !== 0) {
writer.writeInt64(
12,
f
);
}
f = message.getTxRetries();
if (f !== 0) {
writer.writeInt64(
13,
f
);
}
f = message.getTxFailed();
if (f !== 0) {
writer.writeInt64(
14,
f
);
}
f = message.getBeaconsReceived();
if (f !== 0) {
writer.writeInt64(
15,
f
);
}
f = message.getBeaconLossCount();
if (f !== 0) {
writer.writeInt64(
16,
f
);
}
};
/**
* optional string mac_address = 1;
* @return {string}
*/
proto.bosdyn.api.Association.prototype.getMacAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setMacAddress = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional google.protobuf.Duration connected_time = 2;
* @return {?proto.google.protobuf.Duration}
*/
proto.bosdyn.api.Association.prototype.getConnectedTime = function() {
return /** @type{?proto.google.protobuf.Duration} */ (
jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 2));
};
/**
* @param {?proto.google.protobuf.Duration|undefined} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setConnectedTime = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.clearConnectedTime = function() {
return this.setConnectedTime(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Association.prototype.hasConnectedTime = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional int32 rx_signal_dbm = 3;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getRxSignalDbm = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setRxSignalDbm = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional int32 rx_signal_avg_dbm = 4;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getRxSignalAvgDbm = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setRxSignalAvgDbm = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional int32 rx_beacon_signal_avg_dbm = 5;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getRxBeaconSignalAvgDbm = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setRxBeaconSignalAvgDbm = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional int64 expected_bits_per_second = 6;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getExpectedBitsPerSecond = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setExpectedBitsPerSecond = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional int64 rx_bytes = 7;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getRxBytes = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setRxBytes = function(value) {
return jspb.Message.setProto3IntField(this, 7, value);
};
/**
* optional int64 rx_packets = 8;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getRxPackets = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setRxPackets = function(value) {
return jspb.Message.setProto3IntField(this, 8, value);
};
/**
* optional int64 rx_bits_per_second = 9;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getRxBitsPerSecond = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setRxBitsPerSecond = function(value) {
return jspb.Message.setProto3IntField(this, 9, value);
};
/**
* optional int64 tx_bytes = 10;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getTxBytes = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setTxBytes = function(value) {
return jspb.Message.setProto3IntField(this, 10, value);
};
/**
* optional int64 tx_packets = 11;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getTxPackets = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setTxPackets = function(value) {
return jspb.Message.setProto3IntField(this, 11, value);
};
/**
* optional int64 tx_bits_per_second = 12;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getTxBitsPerSecond = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setTxBitsPerSecond = function(value) {
return jspb.Message.setProto3IntField(this, 12, value);
};
/**
* optional int64 tx_retries = 13;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getTxRetries = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setTxRetries = function(value) {
return jspb.Message.setProto3IntField(this, 13, value);
};
/**
* optional int64 tx_failed = 14;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getTxFailed = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setTxFailed = function(value) {
return jspb.Message.setProto3IntField(this, 14, value);
};
/**
* optional int64 beacons_received = 15;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getBeaconsReceived = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setBeaconsReceived = function(value) {
return jspb.Message.setProto3IntField(this, 15, value);
};
/**
* optional int64 beacon_loss_count = 16;
* @return {number}
*/
proto.bosdyn.api.Association.prototype.getBeaconLossCount = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Association} returns this
*/
proto.bosdyn.api.Association.prototype.setBeaconLossCount = function(value) {
return jspb.Message.setProto3IntField(this, 16, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.bosdyn.api.WifiDevice.repeatedFields_ = [6];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.WifiDevice.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.WifiDevice.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.WifiDevice} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.WifiDevice.toObject = function(includeInstance, msg) {
var f, obj = {
type: jspb.Message.getFieldWithDefault(msg, 1, 0),
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
macAddress: jspb.Message.getFieldWithDefault(msg, 3, ""),
ssid: jspb.Message.getFieldWithDefault(msg, 4, ""),
txPowerDbm: jspb.Message.getFieldWithDefault(msg, 5, 0),
associationsList: jspb.Message.toObjectList(msg.getAssociationsList(),
proto.bosdyn.api.Association.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.WifiDevice}
*/
proto.bosdyn.api.WifiDevice.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.WifiDevice;
return proto.bosdyn.api.WifiDevice.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.WifiDevice} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.WifiDevice}
*/
proto.bosdyn.api.WifiDevice.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.bosdyn.api.WifiDevice.Type} */ (reader.readEnum());
msg.setType(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setMacAddress(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setSsid(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt32());
msg.setTxPowerDbm(value);
break;
case 6:
var value = new proto.bosdyn.api.Association;
reader.readMessage(value,proto.bosdyn.api.Association.deserializeBinaryFromReader);
msg.addAssociations(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.WifiDevice.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.WifiDevice.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.WifiDevice} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.WifiDevice.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getType();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getMacAddress();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getSsid();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getTxPowerDbm();
if (f !== 0) {
writer.writeInt32(
5,
f
);
}
f = message.getAssociationsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
6,
f,
proto.bosdyn.api.Association.serializeBinaryToWriter
);
}
};
/**
* @enum {number}
*/
proto.bosdyn.api.WifiDevice.Type = {
UNKNOWN: 0,
AP: 1,
CLIENT: 2
};
/**
* optional Type type = 1;
* @return {!proto.bosdyn.api.WifiDevice.Type}
*/
proto.bosdyn.api.WifiDevice.prototype.getType = function() {
return /** @type {!proto.bosdyn.api.WifiDevice.Type} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.bosdyn.api.WifiDevice.Type} value
* @return {!proto.bosdyn.api.WifiDevice} returns this
*/
proto.bosdyn.api.WifiDevice.prototype.setType = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional string name = 2;
* @return {string}
*/
proto.bosdyn.api.WifiDevice.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.WifiDevice} returns this
*/
proto.bosdyn.api.WifiDevice.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string mac_address = 3;
* @return {string}
*/
proto.bosdyn.api.WifiDevice.prototype.getMacAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.WifiDevice} returns this
*/
proto.bosdyn.api.WifiDevice.prototype.setMacAddress = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string ssid = 4;
* @return {string}
*/
proto.bosdyn.api.WifiDevice.prototype.getSsid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.WifiDevice} returns this
*/
proto.bosdyn.api.WifiDevice.prototype.setSsid = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional int32 tx_power_dbm = 5;
* @return {number}
*/
proto.bosdyn.api.WifiDevice.prototype.getTxPowerDbm = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.WifiDevice} returns this
*/
proto.bosdyn.api.WifiDevice.prototype.setTxPowerDbm = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* repeated Association associations = 6;
* @return {!Array<!proto.bosdyn.api.Association>}
*/
proto.bosdyn.api.WifiDevice.prototype.getAssociationsList = function() {
return /** @type{!Array<!proto.bosdyn.api.Association>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.bosdyn.api.Association, 6));
};
/**
* @param {!Array<!proto.bosdyn.api.Association>} value
* @return {!proto.bosdyn.api.WifiDevice} returns this
*/
proto.bosdyn.api.WifiDevice.prototype.setAssociationsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 6, value);
};
/**
* @param {!proto.bosdyn.api.Association=} opt_value
* @param {number=} opt_index
* @return {!proto.bosdyn.api.Association}
*/
proto.bosdyn.api.WifiDevice.prototype.addAssociations = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.bosdyn.api.Association, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.bosdyn.api.WifiDevice} returns this
*/
proto.bosdyn.api.WifiDevice.prototype.clearAssociationsList = function() {
return this.setAssociationsList([]);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.bosdyn.api.WifiStats.repeatedFields_ = [2];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.WifiStats.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.WifiStats.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.WifiStats} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.WifiStats.toObject = function(includeInstance, msg) {
var f, obj = {
hostname: jspb.Message.getFieldWithDefault(msg, 1, ""),
devicesList: jspb.Message.toObjectList(msg.getDevicesList(),
proto.bosdyn.api.WifiDevice.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.WifiStats}
*/
proto.bosdyn.api.WifiStats.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.WifiStats;
return proto.bosdyn.api.WifiStats.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.WifiStats} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.WifiStats}
*/
proto.bosdyn.api.WifiStats.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.setHostname(value);
break;
case 2:
var value = new proto.bosdyn.api.WifiDevice;
reader.readMessage(value,proto.bosdyn.api.WifiDevice.deserializeBinaryFromReader);
msg.addDevices(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.WifiStats.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.WifiStats.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.WifiStats} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.WifiStats.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getHostname();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getDevicesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
proto.bosdyn.api.WifiDevice.serializeBinaryToWriter
);
}
};
/**
* optional string hostname = 1;
* @return {string}
*/
proto.bosdyn.api.WifiStats.prototype.getHostname = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.WifiStats} returns this
*/
proto.bosdyn.api.WifiStats.prototype.setHostname = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated WifiDevice devices = 2;
* @return {!Array<!proto.bosdyn.api.WifiDevice>}
*/
proto.bosdyn.api.WifiStats.prototype.getDevicesList = function() {
return /** @type{!Array<!proto.bosdyn.api.WifiDevice>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.bosdyn.api.WifiDevice, 2));
};
/**
* @param {!Array<!proto.bosdyn.api.WifiDevice>} value
* @return {!proto.bosdyn.api.WifiStats} returns this
*/
proto.bosdyn.api.WifiStats.prototype.setDevicesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.bosdyn.api.WifiDevice=} opt_value
* @param {number=} opt_index
* @return {!proto.bosdyn.api.WifiDevice}
*/
proto.bosdyn.api.WifiStats.prototype.addDevices = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.bosdyn.api.WifiDevice, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.bosdyn.api.WifiStats} returns this
*/
proto.bosdyn.api.WifiStats.prototype.clearDevicesList = function() {
return this.setDevicesList([]);
};
goog.object.extend(exports, proto.bosdyn.api);