Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
429 changes: 429 additions & 0 deletions decoder.js

Large diffs are not rendered by default.

459 changes: 459 additions & 0 deletions decoder_ttn.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ioTracker/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
15 changes: 15 additions & 0 deletions ioTracker/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# For more information about the configurations used
# in this file, please see the EditorConfig documentation:
# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
16 changes: 16 additions & 0 deletions ioTracker/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'airbnb-base',
],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
},
};
2 changes: 2 additions & 0 deletions ioTracker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
node_modules/
25 changes: 25 additions & 0 deletions ioTracker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ioTracker Payload Decoder

This repository contains a sample implementation for a parser that can decode the
payload that is sent by the trackers.

*Note*: This is not the actual decoder that is run on the ioTracker backend; so
payloads may differ from the results you receive from the ioTracker API.

## Usage
The `Decoder` function in the `decoder.js` is a self contained function, that
takes a `Buffer` as it's input and returns an `Object` containing the decoded payload.

### TTN compatibility
For TTN, `decoder_ttn.js` is required to be used instead of `decoder.js`. The reason is that TTN requires an older javascript version.

To re-generate the `decoder_ttn.js` from the base file; run `npm run build-ttn`.

## Testing
Make sure you also have all dev-dependencies installed, then run `npm test`

## Commandline testing
Execute `node test.js <payload>`, e.g., `node test.js 17ecfb8b010b1100001d804000430031520f9f680032520b45090034520f9722` to see the parsed result commandline

## Info
For the latest version/information, please refer to https://github.com/ioTracker/decoder-js
Loading