Update JS payload codec configuration and templates.

This commit is contained in:
Orne Brocaar
2022-04-27 09:49:33 +01:00
parent f2e6d77ce4
commit d69ff895b6
19 changed files with 320 additions and 376 deletions

View File

@ -31,11 +31,8 @@ export class DeviceProfile extends jspb.Message {
getPayloadCodecRuntime(): CodecRuntimeMap[keyof CodecRuntimeMap];
setPayloadCodecRuntime(value: CodecRuntimeMap[keyof CodecRuntimeMap]): void;
getPayloadEncoderConfig(): string;
setPayloadEncoderConfig(value: string): void;
getPayloadDecoderConfig(): string;
setPayloadDecoderConfig(value: string): void;
getPayloadCodecScript(): string;
setPayloadCodecScript(value: string): void;
getUplinkInterval(): number;
setUplinkInterval(value: number): void;
@ -101,8 +98,7 @@ export namespace DeviceProfile {
regParamsRevision: common_common_pb.RegParamsRevisionMap[keyof common_common_pb.RegParamsRevisionMap],
adrAlgorithmId: string,
payloadCodecRuntime: CodecRuntimeMap[keyof CodecRuntimeMap],
payloadEncoderConfig: string,
payloadDecoderConfig: string,
payloadCodecScript: string,
uplinkInterval: number,
deviceStatusReqInterval: number,
supportsOtaa: boolean,

View File

@ -79,8 +79,7 @@ proto.api.DeviceProfile.toObject = function(includeInstance, msg) {
regParamsRevision: msg.getRegParamsRevision(),
adrAlgorithmId: msg.getAdrAlgorithmId(),
payloadCodecRuntime: msg.getPayloadCodecRuntime(),
payloadEncoderConfig: msg.getPayloadEncoderConfig(),
payloadDecoderConfig: msg.getPayloadDecoderConfig(),
payloadCodecScript: msg.getPayloadCodecScript(),
uplinkInterval: msg.getUplinkInterval(),
deviceStatusReqInterval: msg.getDeviceStatusReqInterval(),
supportsOtaa: msg.getSupportsOtaa(),
@ -166,11 +165,7 @@ proto.api.DeviceProfile.deserializeBinaryFromReader = function(msg, reader) {
break;
case 9:
var value = /** @type {string} */ (reader.readString());
msg.setPayloadEncoderConfig(value);
break;
case 10:
var value = /** @type {string} */ (reader.readString());
msg.setPayloadDecoderConfig(value);
msg.setPayloadCodecScript(value);
break;
case 11:
var value = /** @type {number} */ (reader.readUint32());
@ -328,20 +323,13 @@ proto.api.DeviceProfile.prototype.serializeBinaryToWriter = function (writer) {
f
);
}
f = this.getPayloadEncoderConfig();
f = this.getPayloadCodecScript();
if (f.length > 0) {
writer.writeString(
9,
f
);
}
f = this.getPayloadDecoderConfig();
if (f.length > 0) {
writer.writeString(
10,
f
);
}
f = this.getUplinkInterval();
if (f !== 0) {
writer.writeUint32(
@ -577,35 +565,20 @@ proto.api.DeviceProfile.prototype.setPayloadCodecRuntime = function(value) {
/**
* optional string payload_encoder_config = 9;
* optional string payload_codec_script = 9;
* @return {string}
*/
proto.api.DeviceProfile.prototype.getPayloadEncoderConfig = function() {
proto.api.DeviceProfile.prototype.getPayloadCodecScript = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 9, ""));
};
/** @param {string} value */
proto.api.DeviceProfile.prototype.setPayloadEncoderConfig = function(value) {
proto.api.DeviceProfile.prototype.setPayloadCodecScript = function(value) {
jspb.Message.setField(this, 9, value);
};
/**
* optional string payload_decoder_config = 10;
* @return {string}
*/
proto.api.DeviceProfile.prototype.getPayloadDecoderConfig = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 10, ""));
};
/** @param {string} value */
proto.api.DeviceProfile.prototype.setPayloadDecoderConfig = function(value) {
jspb.Message.setField(this, 10, value);
};
/**
* optional uint32 uplink_interval = 11;
* @return {number}

2
api/js/package.json vendored
View File

@ -1,6 +1,6 @@
{
"name": "@chirpstack/chirpstack-api",
"version": "4.0.0-test.1",
"version": "4.0.0",
"description": "Chirpstack JS and TS API",
"license": "MIT",
"devDependencies": {