spot-sdk-js
Version:
Develop applications and payloads for Spot using the unofficial Boston Dynamics Spot Node.js SDK.
1,399 lines (1,199 loc) • 43.6 kB
JavaScript
// source: bosdyn/api/time_sync.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_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js');
goog.object.extend(proto, google_protobuf_duration_pb);
var bosdyn_api_header_pb = require('../../bosdyn/api/header_pb.js');
goog.object.extend(proto, bosdyn_api_header_pb);
goog.exportSymbol('proto.bosdyn.api.TimeSyncEstimate', null, global);
goog.exportSymbol('proto.bosdyn.api.TimeSyncRoundTrip', null, global);
goog.exportSymbol('proto.bosdyn.api.TimeSyncState', null, global);
goog.exportSymbol('proto.bosdyn.api.TimeSyncState.Status', null, global);
goog.exportSymbol('proto.bosdyn.api.TimeSyncUpdateRequest', null, global);
goog.exportSymbol('proto.bosdyn.api.TimeSyncUpdateResponse', 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.TimeSyncRoundTrip = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.TimeSyncRoundTrip, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.TimeSyncRoundTrip.displayName = 'proto.bosdyn.api.TimeSyncRoundTrip';
}
/**
* 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.TimeSyncEstimate = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.TimeSyncEstimate, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.TimeSyncEstimate.displayName = 'proto.bosdyn.api.TimeSyncEstimate';
}
/**
* 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.TimeSyncState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.TimeSyncState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.TimeSyncState.displayName = 'proto.bosdyn.api.TimeSyncState';
}
/**
* 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.TimeSyncUpdateRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.TimeSyncUpdateRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.TimeSyncUpdateRequest.displayName = 'proto.bosdyn.api.TimeSyncUpdateRequest';
}
/**
* 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.TimeSyncUpdateResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.TimeSyncUpdateResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.TimeSyncUpdateResponse.displayName = 'proto.bosdyn.api.TimeSyncUpdateResponse';
}
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.TimeSyncRoundTrip.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.TimeSyncRoundTrip.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.TimeSyncRoundTrip} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncRoundTrip.toObject = function(includeInstance, msg) {
var f, obj = {
clientTx: (f = msg.getClientTx()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
serverRx: (f = msg.getServerRx()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
serverTx: (f = msg.getServerTx()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
clientRx: (f = msg.getClientRx()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.TimeSyncRoundTrip}
*/
proto.bosdyn.api.TimeSyncRoundTrip.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.TimeSyncRoundTrip;
return proto.bosdyn.api.TimeSyncRoundTrip.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.TimeSyncRoundTrip} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.TimeSyncRoundTrip}
*/
proto.bosdyn.api.TimeSyncRoundTrip.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setClientTx(value);
break;
case 2:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setServerRx(value);
break;
case 3:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setServerTx(value);
break;
case 4:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setClientRx(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.TimeSyncRoundTrip.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.TimeSyncRoundTrip} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncRoundTrip.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getClientTx();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getServerRx();
if (f != null) {
writer.writeMessage(
2,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getServerTx();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getClientRx();
if (f != null) {
writer.writeMessage(
4,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
};
/**
* optional google.protobuf.Timestamp client_tx = 1;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.getClientTx = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.setClientTx = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.clearClientTx = function() {
return this.setClientTx(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.hasClientTx = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional google.protobuf.Timestamp server_rx = 2;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.getServerRx = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.setServerRx = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.clearServerRx = function() {
return this.setServerRx(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.hasServerRx = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional google.protobuf.Timestamp server_tx = 3;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.getServerTx = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.setServerTx = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.clearServerTx = function() {
return this.setServerTx(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.hasServerTx = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional google.protobuf.Timestamp client_rx = 4;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.getClientRx = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.setClientRx = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncRoundTrip} returns this
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.clearClientRx = function() {
return this.setClientRx(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncRoundTrip.prototype.hasClientRx = function() {
return jspb.Message.getField(this, 4) != null;
};
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.TimeSyncEstimate.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.TimeSyncEstimate.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.TimeSyncEstimate} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncEstimate.toObject = function(includeInstance, msg) {
var f, obj = {
roundTripTime: (f = msg.getRoundTripTime()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f),
clockSkew: (f = msg.getClockSkew()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.TimeSyncEstimate}
*/
proto.bosdyn.api.TimeSyncEstimate.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.TimeSyncEstimate;
return proto.bosdyn.api.TimeSyncEstimate.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.TimeSyncEstimate} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.TimeSyncEstimate}
*/
proto.bosdyn.api.TimeSyncEstimate.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new google_protobuf_duration_pb.Duration;
reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
msg.setRoundTripTime(value);
break;
case 2:
var value = new google_protobuf_duration_pb.Duration;
reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
msg.setClockSkew(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.TimeSyncEstimate.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.TimeSyncEstimate} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncEstimate.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getRoundTripTime();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_duration_pb.Duration.serializeBinaryToWriter
);
}
f = message.getClockSkew();
if (f != null) {
writer.writeMessage(
2,
f,
google_protobuf_duration_pb.Duration.serializeBinaryToWriter
);
}
};
/**
* optional google.protobuf.Duration round_trip_time = 1;
* @return {?proto.google.protobuf.Duration}
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.getRoundTripTime = function() {
return /** @type{?proto.google.protobuf.Duration} */ (
jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 1));
};
/**
* @param {?proto.google.protobuf.Duration|undefined} value
* @return {!proto.bosdyn.api.TimeSyncEstimate} returns this
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.setRoundTripTime = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncEstimate} returns this
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.clearRoundTripTime = function() {
return this.setRoundTripTime(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.hasRoundTripTime = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional google.protobuf.Duration clock_skew = 2;
* @return {?proto.google.protobuf.Duration}
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.getClockSkew = 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.TimeSyncEstimate} returns this
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.setClockSkew = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncEstimate} returns this
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.clearClockSkew = function() {
return this.setClockSkew(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncEstimate.prototype.hasClockSkew = function() {
return jspb.Message.getField(this, 2) != null;
};
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.TimeSyncState.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.TimeSyncState.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.TimeSyncState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncState.toObject = function(includeInstance, msg) {
var f, obj = {
bestEstimate: (f = msg.getBestEstimate()) && proto.bosdyn.api.TimeSyncEstimate.toObject(includeInstance, f),
status: jspb.Message.getFieldWithDefault(msg, 2, 0),
measurementTime: (f = msg.getMeasurementTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.TimeSyncState}
*/
proto.bosdyn.api.TimeSyncState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.TimeSyncState;
return proto.bosdyn.api.TimeSyncState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.TimeSyncState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.TimeSyncState}
*/
proto.bosdyn.api.TimeSyncState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.bosdyn.api.TimeSyncEstimate;
reader.readMessage(value,proto.bosdyn.api.TimeSyncEstimate.deserializeBinaryFromReader);
msg.setBestEstimate(value);
break;
case 2:
var value = /** @type {!proto.bosdyn.api.TimeSyncState.Status} */ (reader.readEnum());
msg.setStatus(value);
break;
case 3:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setMeasurementTime(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.TimeSyncState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.TimeSyncState.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.TimeSyncState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getBestEstimate();
if (f != null) {
writer.writeMessage(
1,
f,
proto.bosdyn.api.TimeSyncEstimate.serializeBinaryToWriter
);
}
f = message.getStatus();
if (f !== 0.0) {
writer.writeEnum(
2,
f
);
}
f = message.getMeasurementTime();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
};
/**
* @enum {number}
*/
proto.bosdyn.api.TimeSyncState.Status = {
STATUS_UNKNOWN: 0,
STATUS_OK: 1,
STATUS_MORE_SAMPLES_NEEDED: 2,
STATUS_SERVICE_NOT_READY: 3
};
/**
* optional TimeSyncEstimate best_estimate = 1;
* @return {?proto.bosdyn.api.TimeSyncEstimate}
*/
proto.bosdyn.api.TimeSyncState.prototype.getBestEstimate = function() {
return /** @type{?proto.bosdyn.api.TimeSyncEstimate} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.TimeSyncEstimate, 1));
};
/**
* @param {?proto.bosdyn.api.TimeSyncEstimate|undefined} value
* @return {!proto.bosdyn.api.TimeSyncState} returns this
*/
proto.bosdyn.api.TimeSyncState.prototype.setBestEstimate = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncState} returns this
*/
proto.bosdyn.api.TimeSyncState.prototype.clearBestEstimate = function() {
return this.setBestEstimate(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncState.prototype.hasBestEstimate = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional Status status = 2;
* @return {!proto.bosdyn.api.TimeSyncState.Status}
*/
proto.bosdyn.api.TimeSyncState.prototype.getStatus = function() {
return /** @type {!proto.bosdyn.api.TimeSyncState.Status} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {!proto.bosdyn.api.TimeSyncState.Status} value
* @return {!proto.bosdyn.api.TimeSyncState} returns this
*/
proto.bosdyn.api.TimeSyncState.prototype.setStatus = function(value) {
return jspb.Message.setProto3EnumField(this, 2, value);
};
/**
* optional google.protobuf.Timestamp measurement_time = 3;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.bosdyn.api.TimeSyncState.prototype.getMeasurementTime = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.bosdyn.api.TimeSyncState} returns this
*/
proto.bosdyn.api.TimeSyncState.prototype.setMeasurementTime = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncState} returns this
*/
proto.bosdyn.api.TimeSyncState.prototype.clearMeasurementTime = function() {
return this.setMeasurementTime(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncState.prototype.hasMeasurementTime = function() {
return jspb.Message.getField(this, 3) != null;
};
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.TimeSyncUpdateRequest.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.TimeSyncUpdateRequest.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.TimeSyncUpdateRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncUpdateRequest.toObject = function(includeInstance, msg) {
var f, obj = {
header: (f = msg.getHeader()) && bosdyn_api_header_pb.RequestHeader.toObject(includeInstance, f),
previousRoundTrip: (f = msg.getPreviousRoundTrip()) && proto.bosdyn.api.TimeSyncRoundTrip.toObject(includeInstance, f),
clockIdentifier: jspb.Message.getFieldWithDefault(msg, 3, "")
};
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.TimeSyncUpdateRequest}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.TimeSyncUpdateRequest;
return proto.bosdyn.api.TimeSyncUpdateRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.TimeSyncUpdateRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.TimeSyncUpdateRequest}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new bosdyn_api_header_pb.RequestHeader;
reader.readMessage(value,bosdyn_api_header_pb.RequestHeader.deserializeBinaryFromReader);
msg.setHeader(value);
break;
case 2:
var value = new proto.bosdyn.api.TimeSyncRoundTrip;
reader.readMessage(value,proto.bosdyn.api.TimeSyncRoundTrip.deserializeBinaryFromReader);
msg.setPreviousRoundTrip(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setClockIdentifier(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.TimeSyncUpdateRequest.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.TimeSyncUpdateRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncUpdateRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getHeader();
if (f != null) {
writer.writeMessage(
1,
f,
bosdyn_api_header_pb.RequestHeader.serializeBinaryToWriter
);
}
f = message.getPreviousRoundTrip();
if (f != null) {
writer.writeMessage(
2,
f,
proto.bosdyn.api.TimeSyncRoundTrip.serializeBinaryToWriter
);
}
f = message.getClockIdentifier();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional RequestHeader header = 1;
* @return {?proto.bosdyn.api.RequestHeader}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.getHeader = function() {
return /** @type{?proto.bosdyn.api.RequestHeader} */ (
jspb.Message.getWrapperField(this, bosdyn_api_header_pb.RequestHeader, 1));
};
/**
* @param {?proto.bosdyn.api.RequestHeader|undefined} value
* @return {!proto.bosdyn.api.TimeSyncUpdateRequest} returns this
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.setHeader = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncUpdateRequest} returns this
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.clearHeader = function() {
return this.setHeader(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.hasHeader = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional TimeSyncRoundTrip previous_round_trip = 2;
* @return {?proto.bosdyn.api.TimeSyncRoundTrip}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.getPreviousRoundTrip = function() {
return /** @type{?proto.bosdyn.api.TimeSyncRoundTrip} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.TimeSyncRoundTrip, 2));
};
/**
* @param {?proto.bosdyn.api.TimeSyncRoundTrip|undefined} value
* @return {!proto.bosdyn.api.TimeSyncUpdateRequest} returns this
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.setPreviousRoundTrip = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncUpdateRequest} returns this
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.clearPreviousRoundTrip = function() {
return this.setPreviousRoundTrip(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.hasPreviousRoundTrip = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional string clock_identifier = 3;
* @return {string}
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.getClockIdentifier = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.TimeSyncUpdateRequest} returns this
*/
proto.bosdyn.api.TimeSyncUpdateRequest.prototype.setClockIdentifier = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
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.TimeSyncUpdateResponse.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.TimeSyncUpdateResponse.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.TimeSyncUpdateResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncUpdateResponse.toObject = function(includeInstance, msg) {
var f, obj = {
header: (f = msg.getHeader()) && bosdyn_api_header_pb.ResponseHeader.toObject(includeInstance, f),
previousEstimate: (f = msg.getPreviousEstimate()) && proto.bosdyn.api.TimeSyncEstimate.toObject(includeInstance, f),
state: (f = msg.getState()) && proto.bosdyn.api.TimeSyncState.toObject(includeInstance, f),
clockIdentifier: jspb.Message.getFieldWithDefault(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.bosdyn.api.TimeSyncUpdateResponse}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.TimeSyncUpdateResponse;
return proto.bosdyn.api.TimeSyncUpdateResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.TimeSyncUpdateResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new bosdyn_api_header_pb.ResponseHeader;
reader.readMessage(value,bosdyn_api_header_pb.ResponseHeader.deserializeBinaryFromReader);
msg.setHeader(value);
break;
case 2:
var value = new proto.bosdyn.api.TimeSyncEstimate;
reader.readMessage(value,proto.bosdyn.api.TimeSyncEstimate.deserializeBinaryFromReader);
msg.setPreviousEstimate(value);
break;
case 3:
var value = new proto.bosdyn.api.TimeSyncState;
reader.readMessage(value,proto.bosdyn.api.TimeSyncState.deserializeBinaryFromReader);
msg.setState(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setClockIdentifier(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.TimeSyncUpdateResponse.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.TimeSyncUpdateResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.TimeSyncUpdateResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getHeader();
if (f != null) {
writer.writeMessage(
1,
f,
bosdyn_api_header_pb.ResponseHeader.serializeBinaryToWriter
);
}
f = message.getPreviousEstimate();
if (f != null) {
writer.writeMessage(
2,
f,
proto.bosdyn.api.TimeSyncEstimate.serializeBinaryToWriter
);
}
f = message.getState();
if (f != null) {
writer.writeMessage(
3,
f,
proto.bosdyn.api.TimeSyncState.serializeBinaryToWriter
);
}
f = message.getClockIdentifier();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
};
/**
* optional ResponseHeader header = 1;
* @return {?proto.bosdyn.api.ResponseHeader}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.getHeader = function() {
return /** @type{?proto.bosdyn.api.ResponseHeader} */ (
jspb.Message.getWrapperField(this, bosdyn_api_header_pb.ResponseHeader, 1));
};
/**
* @param {?proto.bosdyn.api.ResponseHeader|undefined} value
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse} returns this
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.setHeader = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse} returns this
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.clearHeader = function() {
return this.setHeader(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.hasHeader = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional TimeSyncEstimate previous_estimate = 2;
* @return {?proto.bosdyn.api.TimeSyncEstimate}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.getPreviousEstimate = function() {
return /** @type{?proto.bosdyn.api.TimeSyncEstimate} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.TimeSyncEstimate, 2));
};
/**
* @param {?proto.bosdyn.api.TimeSyncEstimate|undefined} value
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse} returns this
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.setPreviousEstimate = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse} returns this
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.clearPreviousEstimate = function() {
return this.setPreviousEstimate(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.hasPreviousEstimate = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional TimeSyncState state = 3;
* @return {?proto.bosdyn.api.TimeSyncState}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.getState = function() {
return /** @type{?proto.bosdyn.api.TimeSyncState} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.TimeSyncState, 3));
};
/**
* @param {?proto.bosdyn.api.TimeSyncState|undefined} value
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse} returns this
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.setState = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse} returns this
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.clearState = function() {
return this.setState(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.hasState = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional string clock_identifier = 4;
* @return {string}
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.getClockIdentifier = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.TimeSyncUpdateResponse} returns this
*/
proto.bosdyn.api.TimeSyncUpdateResponse.prototype.setClockIdentifier = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
goog.object.extend(exports, proto.bosdyn.api);