// source: meta/meta.proto /** * @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')(); var common_common_pb = require('../common/common_pb.js'); goog.object.extend(proto, common_common_pb); var gw_gw_pb = require('../gw/gw_pb.js'); goog.object.extend(proto, gw_gw_pb); goog.exportSymbol('proto.meta.DownlinkMeta', null, global); goog.exportSymbol('proto.meta.UplinkMeta', 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.meta.UplinkMeta = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.meta.UplinkMeta.repeatedFields_, null); }; goog.inherits(proto.meta.UplinkMeta, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.meta.UplinkMeta.displayName = 'proto.meta.UplinkMeta'; } /** * 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.meta.DownlinkMeta = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.meta.DownlinkMeta, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.meta.DownlinkMeta.displayName = 'proto.meta.DownlinkMeta'; } /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.meta.UplinkMeta.repeatedFields_ = [3]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.meta.UplinkMeta.prototype.toObject = function(opt_includeInstance) { return proto.meta.UplinkMeta.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.meta.UplinkMeta} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.meta.UplinkMeta.toObject = function(includeInstance, msg) { var f, obj = { devEui: jspb.Message.getFieldWithDefault(msg, 1, ""), txInfo: (f = msg.getTxInfo()) && gw_gw_pb.UplinkTxInfo.toObject(includeInstance, f), rxInfoList: jspb.Message.toObjectList(msg.getRxInfoList(), gw_gw_pb.UplinkRxInfo.toObject, includeInstance), phyPayloadByteCount: jspb.Message.getFieldWithDefault(msg, 4, 0), macCommandByteCount: jspb.Message.getFieldWithDefault(msg, 5, 0), applicationPayloadByteCount: jspb.Message.getFieldWithDefault(msg, 6, 0), messageType: jspb.Message.getFieldWithDefault(msg, 7, 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.meta.UplinkMeta} */ proto.meta.UplinkMeta.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.meta.UplinkMeta; return proto.meta.UplinkMeta.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.meta.UplinkMeta} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.meta.UplinkMeta} */ proto.meta.UplinkMeta.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.setDevEui(value); break; case 2: var value = new gw_gw_pb.UplinkTxInfo; reader.readMessage(value,gw_gw_pb.UplinkTxInfo.deserializeBinaryFromReader); msg.setTxInfo(value); break; case 3: var value = new gw_gw_pb.UplinkRxInfo; reader.readMessage(value,gw_gw_pb.UplinkRxInfo.deserializeBinaryFromReader); msg.addRxInfo(value); break; case 4: var value = /** @type {number} */ (reader.readUint32()); msg.setPhyPayloadByteCount(value); break; case 5: var value = /** @type {number} */ (reader.readUint32()); msg.setMacCommandByteCount(value); break; case 6: var value = /** @type {number} */ (reader.readUint32()); msg.setApplicationPayloadByteCount(value); break; case 7: var value = /** @type {!proto.common.MType} */ (reader.readEnum()); msg.setMessageType(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.meta.UplinkMeta.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.meta.UplinkMeta.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.meta.UplinkMeta} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.meta.UplinkMeta.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getDevEui(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getTxInfo(); if (f != null) { writer.writeMessage( 2, f, gw_gw_pb.UplinkTxInfo.serializeBinaryToWriter ); } f = message.getRxInfoList(); if (f.length > 0) { writer.writeRepeatedMessage( 3, f, gw_gw_pb.UplinkRxInfo.serializeBinaryToWriter ); } f = message.getPhyPayloadByteCount(); if (f !== 0) { writer.writeUint32( 4, f ); } f = message.getMacCommandByteCount(); if (f !== 0) { writer.writeUint32( 5, f ); } f = message.getApplicationPayloadByteCount(); if (f !== 0) { writer.writeUint32( 6, f ); } f = message.getMessageType(); if (f !== 0.0) { writer.writeEnum( 7, f ); } }; /** * optional string dev_eui = 1; * @return {string} */ proto.meta.UplinkMeta.prototype.getDevEui = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.setDevEui = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional gw.UplinkTxInfo tx_info = 2; * @return {?proto.gw.UplinkTxInfo} */ proto.meta.UplinkMeta.prototype.getTxInfo = function() { return /** @type{?proto.gw.UplinkTxInfo} */ ( jspb.Message.getWrapperField(this, gw_gw_pb.UplinkTxInfo, 2)); }; /** * @param {?proto.gw.UplinkTxInfo|undefined} value * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.setTxInfo = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.clearTxInfo = function() { return this.setTxInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.meta.UplinkMeta.prototype.hasTxInfo = function() { return jspb.Message.getField(this, 2) != null; }; /** * repeated gw.UplinkRxInfo rx_info = 3; * @return {!Array} */ proto.meta.UplinkMeta.prototype.getRxInfoList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, gw_gw_pb.UplinkRxInfo, 3)); }; /** * @param {!Array} value * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.setRxInfoList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 3, value); }; /** * @param {!proto.gw.UplinkRxInfo=} opt_value * @param {number=} opt_index * @return {!proto.gw.UplinkRxInfo} */ proto.meta.UplinkMeta.prototype.addRxInfo = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.gw.UplinkRxInfo, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.clearRxInfoList = function() { return this.setRxInfoList([]); }; /** * optional uint32 phy_payload_byte_count = 4; * @return {number} */ proto.meta.UplinkMeta.prototype.getPhyPayloadByteCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.setPhyPayloadByteCount = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional uint32 mac_command_byte_count = 5; * @return {number} */ proto.meta.UplinkMeta.prototype.getMacCommandByteCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.setMacCommandByteCount = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * optional uint32 application_payload_byte_count = 6; * @return {number} */ proto.meta.UplinkMeta.prototype.getApplicationPayloadByteCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; /** * @param {number} value * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.setApplicationPayloadByteCount = function(value) { return jspb.Message.setProto3IntField(this, 6, value); }; /** * optional common.MType message_type = 7; * @return {!proto.common.MType} */ proto.meta.UplinkMeta.prototype.getMessageType = function() { return /** @type {!proto.common.MType} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); }; /** * @param {!proto.common.MType} value * @return {!proto.meta.UplinkMeta} returns this */ proto.meta.UplinkMeta.prototype.setMessageType = function(value) { return jspb.Message.setProto3EnumField(this, 7, 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_, 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.meta.DownlinkMeta.prototype.toObject = function(opt_includeInstance) { return proto.meta.DownlinkMeta.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.meta.DownlinkMeta} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.meta.DownlinkMeta.toObject = function(includeInstance, msg) { var f, obj = { devEui: jspb.Message.getFieldWithDefault(msg, 1, ""), multicastGroupId: jspb.Message.getFieldWithDefault(msg, 2, ""), txInfo: (f = msg.getTxInfo()) && gw_gw_pb.DownlinkTxInfo.toObject(includeInstance, f), phyPayloadByteCount: jspb.Message.getFieldWithDefault(msg, 4, 0), macCommandByteCount: jspb.Message.getFieldWithDefault(msg, 5, 0), applicationPayloadByteCount: jspb.Message.getFieldWithDefault(msg, 6, 0), messageType: jspb.Message.getFieldWithDefault(msg, 7, 0), gatewayId: jspb.Message.getFieldWithDefault(msg, 8, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.meta.DownlinkMeta} */ proto.meta.DownlinkMeta.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.meta.DownlinkMeta; return proto.meta.DownlinkMeta.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.meta.DownlinkMeta} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.meta.DownlinkMeta} */ proto.meta.DownlinkMeta.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.setDevEui(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setMulticastGroupId(value); break; case 3: var value = new gw_gw_pb.DownlinkTxInfo; reader.readMessage(value,gw_gw_pb.DownlinkTxInfo.deserializeBinaryFromReader); msg.setTxInfo(value); break; case 4: var value = /** @type {number} */ (reader.readUint32()); msg.setPhyPayloadByteCount(value); break; case 5: var value = /** @type {number} */ (reader.readUint32()); msg.setMacCommandByteCount(value); break; case 6: var value = /** @type {number} */ (reader.readUint32()); msg.setApplicationPayloadByteCount(value); break; case 7: var value = /** @type {!proto.common.MType} */ (reader.readEnum()); msg.setMessageType(value); break; case 8: var value = /** @type {string} */ (reader.readString()); msg.setGatewayId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.meta.DownlinkMeta.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.meta.DownlinkMeta.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.meta.DownlinkMeta} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.meta.DownlinkMeta.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getDevEui(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getMulticastGroupId(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getTxInfo(); if (f != null) { writer.writeMessage( 3, f, gw_gw_pb.DownlinkTxInfo.serializeBinaryToWriter ); } f = message.getPhyPayloadByteCount(); if (f !== 0) { writer.writeUint32( 4, f ); } f = message.getMacCommandByteCount(); if (f !== 0) { writer.writeUint32( 5, f ); } f = message.getApplicationPayloadByteCount(); if (f !== 0) { writer.writeUint32( 6, f ); } f = message.getMessageType(); if (f !== 0.0) { writer.writeEnum( 7, f ); } f = message.getGatewayId(); if (f.length > 0) { writer.writeString( 8, f ); } }; /** * optional string dev_eui = 1; * @return {string} */ proto.meta.DownlinkMeta.prototype.getDevEui = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setDevEui = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string multicast_group_id = 2; * @return {string} */ proto.meta.DownlinkMeta.prototype.getMulticastGroupId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setMulticastGroupId = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional gw.DownlinkTxInfo tx_info = 3; * @return {?proto.gw.DownlinkTxInfo} */ proto.meta.DownlinkMeta.prototype.getTxInfo = function() { return /** @type{?proto.gw.DownlinkTxInfo} */ ( jspb.Message.getWrapperField(this, gw_gw_pb.DownlinkTxInfo, 3)); }; /** * @param {?proto.gw.DownlinkTxInfo|undefined} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setTxInfo = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.clearTxInfo = function() { return this.setTxInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.meta.DownlinkMeta.prototype.hasTxInfo = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional uint32 phy_payload_byte_count = 4; * @return {number} */ proto.meta.DownlinkMeta.prototype.getPhyPayloadByteCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setPhyPayloadByteCount = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional uint32 mac_command_byte_count = 5; * @return {number} */ proto.meta.DownlinkMeta.prototype.getMacCommandByteCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setMacCommandByteCount = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * optional uint32 application_payload_byte_count = 6; * @return {number} */ proto.meta.DownlinkMeta.prototype.getApplicationPayloadByteCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; /** * @param {number} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setApplicationPayloadByteCount = function(value) { return jspb.Message.setProto3IntField(this, 6, value); }; /** * optional common.MType message_type = 7; * @return {!proto.common.MType} */ proto.meta.DownlinkMeta.prototype.getMessageType = function() { return /** @type {!proto.common.MType} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); }; /** * @param {!proto.common.MType} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setMessageType = function(value) { return jspb.Message.setProto3EnumField(this, 7, value); }; /** * optional string gateway_id = 8; * @return {string} */ proto.meta.DownlinkMeta.prototype.getGatewayId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); }; /** * @param {string} value * @return {!proto.meta.DownlinkMeta} returns this */ proto.meta.DownlinkMeta.prototype.setGatewayId = function(value) { return jspb.Message.setProto3StringField(this, 8, value); }; goog.object.extend(exports, proto.meta);