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

@ -11,15 +11,15 @@ export class UplinkFrameLog extends jspb.Message {
getPhyPayload_asB64(): string;
setPhyPayload(value: Uint8Array | string): UplinkFrameLog;
getTxInfo(): gw_gw_pb.UplinkTXInfo | undefined;
setTxInfo(value?: gw_gw_pb.UplinkTXInfo): UplinkFrameLog;
getTxInfo(): gw_gw_pb.UplinkTxInfo | undefined;
setTxInfo(value?: gw_gw_pb.UplinkTxInfo): UplinkFrameLog;
hasTxInfo(): boolean;
clearTxInfo(): UplinkFrameLog;
getRxInfoList(): Array<gw_gw_pb.UplinkRXInfo>;
setRxInfoList(value: Array<gw_gw_pb.UplinkRXInfo>): UplinkFrameLog;
getRxInfoList(): Array<gw_gw_pb.UplinkRxInfo>;
setRxInfoList(value: Array<gw_gw_pb.UplinkRxInfo>): UplinkFrameLog;
clearRxInfoList(): UplinkFrameLog;
addRxInfo(value?: gw_gw_pb.UplinkRXInfo, index?: number): gw_gw_pb.UplinkRXInfo;
addRxInfo(value?: gw_gw_pb.UplinkRxInfo, index?: number): gw_gw_pb.UplinkRxInfo;
getMType(): common_common_pb.MType;
setMType(value: common_common_pb.MType): UplinkFrameLog;
@ -46,8 +46,8 @@ export class UplinkFrameLog extends jspb.Message {
export namespace UplinkFrameLog {
export type AsObject = {
phyPayload: Uint8Array | string,
txInfo?: gw_gw_pb.UplinkTXInfo.AsObject,
rxInfoList: Array<gw_gw_pb.UplinkRXInfo.AsObject>,
txInfo?: gw_gw_pb.UplinkTxInfo.AsObject,
rxInfoList: Array<gw_gw_pb.UplinkRxInfo.AsObject>,
mType: common_common_pb.MType,
devAddr: string,
devEui: string,
@ -66,13 +66,13 @@ export class DownlinkFrameLog extends jspb.Message {
getPhyPayload_asB64(): string;
setPhyPayload(value: Uint8Array | string): DownlinkFrameLog;
getTxInfo(): gw_gw_pb.DownlinkTXInfo | undefined;
setTxInfo(value?: gw_gw_pb.DownlinkTXInfo): DownlinkFrameLog;
getTxInfo(): gw_gw_pb.DownlinkTxInfo | undefined;
setTxInfo(value?: gw_gw_pb.DownlinkTxInfo): DownlinkFrameLog;
hasTxInfo(): boolean;
clearTxInfo(): DownlinkFrameLog;
getDownlinkId(): string;
setDownlinkId(value: string): DownlinkFrameLog;
getDownlinkId(): number;
setDownlinkId(value: number): DownlinkFrameLog;
getGatewayId(): string;
setGatewayId(value: string): DownlinkFrameLog;
@ -98,8 +98,8 @@ export namespace DownlinkFrameLog {
export type AsObject = {
time?: google_protobuf_timestamp_pb.Timestamp.AsObject,
phyPayload: Uint8Array | string,
txInfo?: gw_gw_pb.DownlinkTXInfo.AsObject,
downlinkId: string,
txInfo?: gw_gw_pb.DownlinkTxInfo.AsObject,
downlinkId: number,
gatewayId: string,
mType: common_common_pb.MType,
devAddr: string,

View File

@ -105,9 +105,9 @@ proto.api.UplinkFrameLog.prototype.toObject = function(opt_includeInstance) {
proto.api.UplinkFrameLog.toObject = function(includeInstance, msg) {
var f, obj = {
phyPayload: msg.getPhyPayload_asB64(),
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),
mType: jspb.Message.getFieldWithDefault(msg, 4, 0),
devAddr: jspb.Message.getFieldWithDefault(msg, 5, ""),
devEui: jspb.Message.getFieldWithDefault(msg, 6, ""),
@ -153,13 +153,13 @@ proto.api.UplinkFrameLog.deserializeBinaryFromReader = function(msg, reader) {
msg.setPhyPayload(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.addRxInfo(value);
break;
case 4:
@ -220,7 +220,7 @@ proto.api.UplinkFrameLog.serializeBinaryToWriter = function(message, writer) {
writer.writeMessage(
2,
f,
gw_gw_pb.UplinkTXInfo.serializeBinaryToWriter
gw_gw_pb.UplinkTxInfo.serializeBinaryToWriter
);
}
f = message.getRxInfoList();
@ -228,7 +228,7 @@ proto.api.UplinkFrameLog.serializeBinaryToWriter = function(message, writer) {
writer.writeRepeatedMessage(
3,
f,
gw_gw_pb.UplinkRXInfo.serializeBinaryToWriter
gw_gw_pb.UplinkRxInfo.serializeBinaryToWriter
);
}
f = message.getMType();
@ -306,17 +306,17 @@ proto.api.UplinkFrameLog.prototype.setPhyPayload = function(value) {
/**
* optional gw.UplinkTXInfo tx_info = 2;
* @return {?proto.gw.UplinkTXInfo}
* optional gw.UplinkTxInfo tx_info = 2;
* @return {?proto.gw.UplinkTxInfo}
*/
proto.api.UplinkFrameLog.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
* @return {!proto.api.UplinkFrameLog} returns this
*/
proto.api.UplinkFrameLog.prototype.setTxInfo = function(value) {
@ -343,17 +343,17 @@ proto.api.UplinkFrameLog.prototype.hasTxInfo = function() {
/**
* repeated gw.UplinkRXInfo rx_info = 3;
* @return {!Array<!proto.gw.UplinkRXInfo>}
* repeated gw.UplinkRxInfo rx_info = 3;
* @return {!Array<!proto.gw.UplinkRxInfo>}
*/
proto.api.UplinkFrameLog.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
* @return {!proto.api.UplinkFrameLog} returns this
*/
proto.api.UplinkFrameLog.prototype.setRxInfoList = function(value) {
@ -362,12 +362,12 @@ proto.api.UplinkFrameLog.prototype.setRxInfoList = function(value) {
/**
* @param {!proto.gw.UplinkRXInfo=} opt_value
* @param {!proto.gw.UplinkRxInfo=} opt_value
* @param {number=} opt_index
* @return {!proto.gw.UplinkRXInfo}
* @return {!proto.gw.UplinkRxInfo}
*/
proto.api.UplinkFrameLog.prototype.addRxInfo = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.gw.UplinkRXInfo, opt_index);
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.gw.UplinkRxInfo, opt_index);
};
@ -505,8 +505,8 @@ proto.api.DownlinkFrameLog.toObject = function(includeInstance, msg) {
var f, obj = {
time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
phyPayload: msg.getPhyPayload_asB64(),
txInfo: (f = msg.getTxInfo()) && gw_gw_pb.DownlinkTXInfo.toObject(includeInstance, f),
downlinkId: jspb.Message.getFieldWithDefault(msg, 4, ""),
txInfo: (f = msg.getTxInfo()) && gw_gw_pb.DownlinkTxInfo.toObject(includeInstance, f),
downlinkId: jspb.Message.getFieldWithDefault(msg, 4, 0),
gatewayId: jspb.Message.getFieldWithDefault(msg, 5, ""),
mType: jspb.Message.getFieldWithDefault(msg, 6, 0),
devAddr: jspb.Message.getFieldWithDefault(msg, 7, ""),
@ -557,12 +557,12 @@ proto.api.DownlinkFrameLog.deserializeBinaryFromReader = function(msg, reader) {
msg.setPhyPayload(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:
var value = /** @type {string} */ (reader.readString());
var value = /** @type {number} */ (reader.readUint32());
msg.setDownlinkId(value);
break;
case 5:
@ -630,12 +630,12 @@ proto.api.DownlinkFrameLog.serializeBinaryToWriter = function(message, writer) {
writer.writeMessage(
3,
f,
gw_gw_pb.DownlinkTXInfo.serializeBinaryToWriter
gw_gw_pb.DownlinkTxInfo.serializeBinaryToWriter
);
}
f = message.getDownlinkId();
if (f.length > 0) {
writer.writeString(
if (f !== 0) {
writer.writeUint32(
4,
f
);
@ -751,17 +751,17 @@ proto.api.DownlinkFrameLog.prototype.setPhyPayload = function(value) {
/**
* optional gw.DownlinkTXInfo tx_info = 3;
* @return {?proto.gw.DownlinkTXInfo}
* optional gw.DownlinkTxInfo tx_info = 3;
* @return {?proto.gw.DownlinkTxInfo}
*/
proto.api.DownlinkFrameLog.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
* @return {!proto.api.DownlinkFrameLog} returns this
*/
proto.api.DownlinkFrameLog.prototype.setTxInfo = function(value) {
@ -788,20 +788,20 @@ proto.api.DownlinkFrameLog.prototype.hasTxInfo = function() {
/**
* optional string downlink_id = 4;
* @return {string}
* optional uint32 downlink_id = 4;
* @return {number}
*/
proto.api.DownlinkFrameLog.prototype.getDownlinkId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {string} value
* @param {number} value
* @return {!proto.api.DownlinkFrameLog} returns this
*/
proto.api.DownlinkFrameLog.prototype.setDownlinkId = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
return jspb.Message.setProto3IntField(this, 4, value);
};