Skip to content

Commit 7730ec4

Browse files
authored
Cayenne LPP Decoding Profile (#333)
* add cayenne-lpp decoding
1 parent 815d28a commit 7730ec4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,4 @@ Every commit on branch `development` will be built with the tag `development`.
8585
[MongoDB]:http://www.mongodb.com/
8686
[openSenseMap]:https://opensensemap.org/
8787
[senseBox]:https://sensebox.de/
88+

packages/api/lib/controllers/boxesController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
* @apiParam (TTNOption) {String} dev_id The device ID recieved from TTN
3333
* @apiParam (TTNOption) {String} app_id The application ID recieved from TTN
34-
* @apiParam (TTNOption) {String="lora-serialization","sensebox/home","json","debug"} profile A decoding profile matching the payload format. For details and configuration see https://github.com/sensebox/ttn-osem-integration#decoding-profiles
34+
* @apiParam (TTNOption) {String="lora-serialization","sensebox/home","json","debug", "cayenne-lpp"} profile A decoding profile matching the payload format. For details and configuration see https://github.com/sensebox/ttn-osem-integration#decoding-profiles
3535
* @apiParam (TTNOption) {Array} [decodeOptions] A JSON Array containing decoder configuration, needed for some profiles.
3636
* @apiParam (TTNOption) {Number} [port] The TTN port to listen for messages. Optional, if not provided, all ports are used.
3737
*/

packages/models/src/box/integrations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ttnSchema = new mongoose.Schema({
1818
dev_id: { type: String, trim: true, required: true },
1919
app_id: { type: String, trim: true, required: true },
2020
port: { type: Number, min: 0 },
21-
profile: { type: String, trim: true, enum: ['json', 'debug', 'sensebox/home', 'lora-serialization'], required: true },
21+
profile: { type: String, trim: true, enum: ['json', 'debug', 'sensebox/home', 'lora-serialization', 'cayenne-lpp'], required: true },
2222
decodeOptions: [{}]
2323
}, { _id: false, usePushEach: true });
2424

@@ -50,7 +50,7 @@ const integrationSchema = new mongoose.Schema({
5050
/* eslint-disable func-name-matching */
5151
validator: function validTTNDecodeOptions (ttn) {
5252
/* eslint-enable func-name-matching */
53-
if (['debug', 'lora-serialization'].indexOf(ttn.profile) !== -1) {
53+
if (['debug', 'lora-serialization', 'cayenne-lpp'].indexOf(ttn.profile) !== -1) {
5454
return (ttn.decodeOptions && ttn.decodeOptions.constructor === Array);
5555
}
5656
},

0 commit comments

Comments
 (0)