Make flush queue on activate configurable through dev-profile.

This commit is contained in:
Orne Brocaar
2022-04-28 08:52:14 +01:00
parent 54f74277ab
commit b159436dd0
16 changed files with 331 additions and 191 deletions

View File

@ -34,6 +34,9 @@ export class DeviceProfile extends jspb.Message {
getPayloadCodecScript(): string;
setPayloadCodecScript(value: string): void;
getFlushQueueOnActivate(): boolean;
setFlushQueueOnActivate(value: boolean): void;
getUplinkInterval(): number;
setUplinkInterval(value: number): void;
@ -99,6 +102,7 @@ export namespace DeviceProfile {
adrAlgorithmId: string,
payloadCodecRuntime: CodecRuntimeMap[keyof CodecRuntimeMap],
payloadCodecScript: string,
flushQueueOnActivate: boolean,
uplinkInterval: number,
deviceStatusReqInterval: number,
supportsOtaa: boolean,

View File

@ -80,6 +80,7 @@ proto.api.DeviceProfile.toObject = function(includeInstance, msg) {
adrAlgorithmId: msg.getAdrAlgorithmId(),
payloadCodecRuntime: msg.getPayloadCodecRuntime(),
payloadCodecScript: msg.getPayloadCodecScript(),
flushQueueOnActivate: msg.getFlushQueueOnActivate(),
uplinkInterval: msg.getUplinkInterval(),
deviceStatusReqInterval: msg.getDeviceStatusReqInterval(),
supportsOtaa: msg.getSupportsOtaa(),
@ -167,6 +168,10 @@ proto.api.DeviceProfile.deserializeBinaryFromReader = function(msg, reader) {
var value = /** @type {string} */ (reader.readString());
msg.setPayloadCodecScript(value);
break;
case 10:
var value = /** @type {boolean} */ (reader.readBool());
msg.setFlushQueueOnActivate(value);
break;
case 11:
var value = /** @type {number} */ (reader.readUint32());
msg.setUplinkInterval(value);
@ -330,6 +335,13 @@ proto.api.DeviceProfile.prototype.serializeBinaryToWriter = function (writer) {
f
);
}
f = this.getFlushQueueOnActivate();
if (f) {
writer.writeBool(
10,
f
);
}
f = this.getUplinkInterval();
if (f !== 0) {
writer.writeUint32(
@ -579,6 +591,23 @@ proto.api.DeviceProfile.prototype.setPayloadCodecScript = function(value) {
};
/**
* optional bool flush_queue_on_activate = 10;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.api.DeviceProfile.prototype.getFlushQueueOnActivate = function() {
return /** @type {boolean} */ (jspb.Message.getFieldProto3(this, 10, false));
};
/** @param {boolean} value */
proto.api.DeviceProfile.prototype.setFlushQueueOnActivate = function(value) {
jspb.Message.setField(this, 10, value);
};
/**
* optional uint32 uplink_interval = 11;
* @return {number}