Module: decoding/lora-serialization

This decoding can decode payloads constructed with lora-serialization.
License:
  • MIT
Source:

Methods

(private, inner) applyTimestamps(measurements)

transforms the measurements as onResult hook of the unixtime decoder IN PLACE
Parameters:
Name Type Description
measurements Array The generated measurements of the full payload prior to validation.
Source:

(inner) createBufferTransformer(box) → {Array}

returns a bufferTransfomer for transformation of a buffer to measurements. The box is required to have a an array of ttn.decodeOptions
Parameters:
Name Type Description
box Box The box to retrieve decodeOptions and sensorIds from
Source:
See:
Returns:
A bufferTransformer for the box
Type
Array
Example

decodeOptions format

ttn: {
  profile: 'lora-serialization',
  decodeOptions: [{
    sensor_id: '588876b67dd004f79259bd8a',
    decoder: 'temperature' // one of [temperature, humidity, uint8, uint16]
  }, {
    // sensor_type, sensor_title, sensor_unit is allowed as well
    sensor_type: '588876b67dd004f79259bd8b',
    decoder: 'VEML6070'
  }]
}