Refactor uplink / downlink GW <> NS messages.

This includes:

* Changing the modulation parameters to its own type.
* Changing the timing parameters to its own type.
* Change the gateway_id to string. As the json encoding for bytes fields
  is base64, this was confusing some users.
* Change the uplink / downlink id to uint32 from uuid. A string
  representation of the UUID field (for the same reason as the gateway
  id) would consome quite some additional bytes. An uint32 provides
  sufficient uniqueness for the purpose of uplink / downlink.
This commit is contained in:
Orne Brocaar
2022-04-21 11:42:28 +01:00
parent f033793f74
commit e649e75c8d
56 changed files with 6112 additions and 3661 deletions

View File

@ -67,9 +67,9 @@ proto.meta.UplinkMeta.prototype.toObject = function(opt_includeInstance) {
proto.meta.UplinkMeta.toObject = function(includeInstance, msg) {
var f, obj = {
devEui: msg.getDevEui(),
txInfo: (f = msg.getTxInfo()) && gw_gw_pb.UplinkTXInfo.toObject(includeInstance, f),
txInfo: (f = msg.getTxInfo()) && gw_gw_pb.UplinkTxInfo.toObject(includeInstance, f),
rxInfoList: jspb.Message.toObjectList(msg.getRxInfoList(),
gw_gw_pb.UplinkRXInfo.toObject, includeInstance),
gw_gw_pb.UplinkRxInfo.toObject, includeInstance),
phyPayloadByteCount: msg.getPhyPayloadByteCount(),
macCommandByteCount: msg.getMacCommandByteCount(),
applicationPayloadByteCount: msg.getApplicationPayloadByteCount(),
@ -115,13 +115,13 @@ proto.meta.UplinkMeta.deserializeBinaryFromReader = function(msg, reader) {
msg.setDevEui(value);
break;
case 2:
var value = new gw_gw_pb.UplinkTXInfo;
reader.readMessage(value,gw_gw_pb.UplinkTXInfo.deserializeBinaryFromReader);
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);
var value = new gw_gw_pb.UplinkRxInfo;
reader.readMessage(value,gw_gw_pb.UplinkRxInfo.deserializeBinaryFromReader);
msg.getRxInfoList().push(value);
msg.setRxInfoList(msg.getRxInfoList());
break;
@ -191,7 +191,7 @@ proto.meta.UplinkMeta.prototype.serializeBinaryToWriter = function (writer) {
writer.writeMessage(
2,
f,
gw_gw_pb.UplinkTXInfo.serializeBinaryToWriter
gw_gw_pb.UplinkTxInfo.serializeBinaryToWriter
);
}
f = this.getRxInfoList();
@ -199,7 +199,7 @@ proto.meta.UplinkMeta.prototype.serializeBinaryToWriter = function (writer) {
writer.writeRepeatedMessage(
3,
f,
gw_gw_pb.UplinkRXInfo.serializeBinaryToWriter
gw_gw_pb.UplinkRxInfo.serializeBinaryToWriter
);
}
f = this.getPhyPayloadByteCount();
@ -258,16 +258,16 @@ proto.meta.UplinkMeta.prototype.setDevEui = function(value) {
/**
* optional gw.UplinkTXInfo tx_info = 2;
* @return {proto.gw.UplinkTXInfo}
* 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));
return /** @type{proto.gw.UplinkTxInfo} */ (
jspb.Message.getWrapperField(this, gw_gw_pb.UplinkTxInfo, 2));
};
/** @param {proto.gw.UplinkTXInfo|undefined} value */
/** @param {proto.gw.UplinkTxInfo|undefined} value */
proto.meta.UplinkMeta.prototype.setTxInfo = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
@ -288,18 +288,18 @@ proto.meta.UplinkMeta.prototype.hasTxInfo = function() {
/**
* repeated gw.UplinkRXInfo rx_info = 3;
* repeated gw.UplinkRxInfo rx_info = 3;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.gw.UplinkRXInfo>}
* @return {!Array.<!proto.gw.UplinkRxInfo>}
*/
proto.meta.UplinkMeta.prototype.getRxInfoList = function() {
return /** @type{!Array.<!proto.gw.UplinkRXInfo>} */ (
jspb.Message.getRepeatedWrapperField(this, gw_gw_pb.UplinkRXInfo, 3));
return /** @type{!Array.<!proto.gw.UplinkRxInfo>} */ (
jspb.Message.getRepeatedWrapperField(this, gw_gw_pb.UplinkRxInfo, 3));
};
/** @param {Array.<!proto.gw.UplinkRXInfo>} value */
/** @param {Array.<!proto.gw.UplinkRxInfo>} value */
proto.meta.UplinkMeta.prototype.setRxInfoList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 3, value);
};
@ -418,7 +418,7 @@ proto.meta.DownlinkMeta.toObject = function(includeInstance, msg) {
var f, obj = {
devEui: msg.getDevEui(),
multicastGroupId: msg.getMulticastGroupId(),
txInfo: (f = msg.getTxInfo()) && gw_gw_pb.DownlinkTXInfo.toObject(includeInstance, f),
txInfo: (f = msg.getTxInfo()) && gw_gw_pb.DownlinkTxInfo.toObject(includeInstance, f),
phyPayloadByteCount: msg.getPhyPayloadByteCount(),
macCommandByteCount: msg.getMacCommandByteCount(),
applicationPayloadByteCount: msg.getApplicationPayloadByteCount(),
@ -469,8 +469,8 @@ proto.meta.DownlinkMeta.deserializeBinaryFromReader = function(msg, reader) {
msg.setMulticastGroupId(value);
break;
case 3:
var value = new gw_gw_pb.DownlinkTXInfo;
reader.readMessage(value,gw_gw_pb.DownlinkTXInfo.deserializeBinaryFromReader);
var value = new gw_gw_pb.DownlinkTxInfo;
reader.readMessage(value,gw_gw_pb.DownlinkTxInfo.deserializeBinaryFromReader);
msg.setTxInfo(value);
break;
case 4:
@ -550,7 +550,7 @@ proto.meta.DownlinkMeta.prototype.serializeBinaryToWriter = function (writer) {
writer.writeMessage(
3,
f,
gw_gw_pb.DownlinkTXInfo.serializeBinaryToWriter
gw_gw_pb.DownlinkTxInfo.serializeBinaryToWriter
);
}
f = this.getPhyPayloadByteCount();
@ -631,16 +631,16 @@ proto.meta.DownlinkMeta.prototype.setMulticastGroupId = function(value) {
/**
* optional gw.DownlinkTXInfo tx_info = 3;
* @return {proto.gw.DownlinkTXInfo}
* 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));
return /** @type{proto.gw.DownlinkTxInfo} */ (
jspb.Message.getWrapperField(this, gw_gw_pb.DownlinkTxInfo, 3));
};
/** @param {proto.gw.DownlinkTXInfo|undefined} value */
/** @param {proto.gw.DownlinkTxInfo|undefined} value */
proto.meta.DownlinkMeta.prototype.setTxInfo = function(value) {
jspb.Message.setWrapperField(this, 3, value);
};