# Objects
- protocolRef :
object
References used to validate payloads
- types :
object
References used to identify sensor types
LPP_TYPE = IPSO_OBJECT_ID - 3200
- units :
object
References used to identify sensor units
# Functions
- getAnalogInput() ⇒
object
Return a float value and increment the buffer cursor
- getDigitalInput() ⇒
object
Return an integer value
- getLuminosity() ⇒
object
Return a luminosity in Lux and increment the buffer cursor
- getPresence() ⇒
object
Return an integer value
- getTemperature() ⇒
object
Return a temperature and increment the buffer cursor
- getRelativeHumidity() ⇒
object
Return a relative humidity value in percents and increment the buffer cursor
- getAccelerometer() ⇒
object
Return axis coordinates and increment the buffer cursor
- getBarometer() ⇒
object
Return a pressure and increment the buffer cursor
- getUnixTime() ⇒
object
Return a timestamp and increment the buffer cursor
- getGyrometer() ⇒
object
Return axis coordinates and increment the buffer cursor
- getLocation() ⇒
object
Return location coordinates and increment the buffer cursor
- cayenneBufferDecoder(packet) ⇒
object
|null
Decode LoraWan buffer containing a CayenneLPP payload
- cayenneToOmaObject(packet, protocol) ⇒
Array.<object>
|null
Find corresponding OMA Object to incoming CayenneLPP datas pattern - '+appEui/+type/+method/+gatewayId/#device'
- cayenneToOmaResources(packet, protocol) ⇒
Array.<object>
|null
Find corresponding OMA Resources to incoming CayenneLPP datas pattern - '+appEui/+type/+method/+gatewayId/#device'
- cayenneDecoder(packet, protocol) ⇒
functions
|null
Convert incoming CayenneLPP data to Aloes Client sensor instance pattern - "+prefixedDevEui/+nodeId/+sensorId/+method/+ack/+subType"
- cayennePatternDetector(payload) ⇒
object
|null
Check incoming MQTT packet.payload against CayenneLPP pattern '+appEui/+type/+method/+gatewayId/#device'
- validate(channel)
Validate chosen channel
- addAnalogInput(buffer, cursor, channel, value) ⇒
number
Creates a payload with type ANALOG_INPUT. unit = UNIT.UNDEFINED
- addDigitalInput(buffer, cursor, channel, value) ⇒
number
Creates a payload with type DIGITAL_INPUT. unit = UNIT.UNDEFINED
- addLuminosity(buffer, cursor, channel, value) ⇒
number
Creates a payload with type LUMINOSITY. unit = UNIT.LUX
- addPresence(buffer, cursor, channel, value) ⇒
number
Creates a payload with type PRESENCE.
- addTemperature(buffer, cursor, channel, value) ⇒
number
Creates a payload with type TEMPERATURE. unit = UNIT.CELSIUS
- addRelativeHumidity(buffer, cursor, channel, value) ⇒
number
Creates a payload with type HUMIDITY. unit = UNIT.PERCENT
- addAccelerometer(buffer, cursor, channel, value) ⇒
number
Creates a payload with type ACCELEROMETER. unit = UNIT.UNDEFINED
- addBarometer(buffer, cursor, channel, value) ⇒
number
Creates a payload with type BAROMETER. unit = UNIT.PRESSURE
- addUnixTime(buffer, cursor, channel, value) ⇒
number
Creates a payload with type UNIXTIME. unit = UNIT.UNDEFINED
- addGyrometer(buffer, cursor, channel, value) ⇒
number
Creates a payload with type GYROMETER. unit = UNIT.UNDEFINED
- addLocation(buffer, cursor, channel, value) ⇒
number
Creates a payload with type LOCATION. unit = UNIT.UNDEFINED
- getPayload(buffer, cursor) ⇒
object
Reading the composed buffer from 0 to the cursor position.
- cayenneBufferEncoder(buffer, type, channel, value) ⇒
object
|null
Filling the buffer with desired sensor parameters and value
- cayenneEncoder(instance) ⇒
object
|null
Convert incoming Aloes Client data to CayenneLPP pattern - '+appEui/+type/+method/+gatewayId/#device'
# External
- OmaObjects
Oma Object References.
- OmaResources
Oma Resources References.
- CayenneLPP
Cayenne Low Power Payload.
# protocolRef : object
References used to validate payloads
Kind: global namespace
Properties
Name | Type | Description |
---|---|---|
pattern | string | The pattern used by CayenneLPP devices. |
validators | object | Check inputs / build outputs |
validators.methods | array |
# types : object
References used to identify sensor types
LPP_TYPE = IPSO_OBJECT_ID - 3200
# units : object
References used to identify sensor units
# getAnalogInput() ⇒ object
Return a float value and increment the buffer cursor
# getDigitalInput() ⇒ object
Return an integer value
# getLuminosity() ⇒ object
Return a luminosity in Lux and increment the buffer cursor
# getPresence() ⇒ object
Return an integer value
# getTemperature() ⇒ object
Return a temperature and increment the buffer cursor
# getRelativeHumidity() ⇒ object
Return a relative humidity value in percents and increment the buffer cursor
# getAccelerometer() ⇒ object
Return axis coordinates and increment the buffer cursor
# getBarometer() ⇒ object
Return a pressure and increment the buffer cursor
# getUnixTime() ⇒ object
Return a timestamp and increment the buffer cursor
# getGyrometer() ⇒ object
Return axis coordinates and increment the buffer cursor
# getLocation() ⇒ object
Return location coordinates and increment the buffer cursor
# cayenneBufferDecoder(packet) ⇒ object
| null
Decode LoraWan buffer containing a CayenneLPP payload
Kind: global function
Returns: object
| null
- channels
Param | Type | Description |
---|---|---|
packet | buffer | Incoming Lora packet. |
# cayenneToOmaObject(packet, protocol) ⇒ Array.<object>
| null
Find corresponding OMA Object to incoming CayenneLPP datas pattern - '+appEui/+type/+method/+gatewayId/#device'
Kind: global function
Returns: Array.<object>
| null
- instances
Param | Type | Description |
---|---|---|
packet | buffer | Incoming MQTT (Lora) packet. |
protocol | object | Protocol paramters ( coming from patternDetector ). |
# cayenneToOmaResources(packet, protocol) ⇒ Array.<object>
| null
Find corresponding OMA Resources to incoming CayenneLPP datas pattern - '+appEui/+type/+method/+gatewayId/#device'
Kind: global function
Returns: Array.<object>
| null
- instances
Param | Type | Description |
---|---|---|
packet | buffer | Incoming MQTT (Lora) packet. |
protocol | object | Protocol paramters ( coming from patternDetector ). |
# cayenneDecoder(packet, protocol) ⇒ functions
| null
Convert incoming CayenneLPP data to Aloes Client sensor instance pattern - "+prefixedDevEui/+nodeId/+sensorId/+method/+ack/+subType"
Kind: global function
Returns: functions
| null
- cayenneToOmaObject | cayenneToOmaResources
Param | Type | Description |
---|---|---|
packet | object | Incoming MQTT (Lora) packet. |
protocol | object | Protocol paramters ( coming from patternDetector ). |
# cayennePatternDetector(payload) ⇒ object
| null
Check incoming MQTT packet.payload against CayenneLPP pattern '+appEui/+type/+method/+gatewayId/#device'
Kind: global function
Returns: object
| null
- pattern
Param | Type | Description |
---|---|---|
payload | object | The MQTT packet, including LoraWan PHYPayload. |
# validate(channel)
Validate chosen channel
Kind: global function
Throws:
Error
'Channels above 100 are reserved.'
Param | Type | Description |
---|---|---|
channel | int | The channel selected |
# addAnalogInput(buffer, cursor, channel, value) ⇒ number
Creates a payload with type ANALOG_INPUT. unit = UNIT.UNDEFINED
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | number | A floating point number accurate to two decimal place. lodash.floor(value, 2) |
# addDigitalInput(buffer, cursor, channel, value) ⇒ number
Creates a payload with type DIGITAL_INPUT. unit = UNIT.UNDEFINED
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | number | The value, unsigned int8, should be 0 or 1. |
# addLuminosity(buffer, cursor, channel, value) ⇒ number
Creates a payload with type LUMINOSITY. unit = UNIT.LUX
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | number | An unsigned int16 value. 0-65535. |
# addPresence(buffer, cursor, channel, value) ⇒ number
Creates a payload with type PRESENCE.
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | number | An unsigned value. 0-1 |
# addTemperature(buffer, cursor, channel, value) ⇒ number
Creates a payload with type TEMPERATURE. unit = UNIT.CELSIUS
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | number | A floating point number accurate to one decimal place. lodash.floor(value, 1) |
# addRelativeHumidity(buffer, cursor, channel, value) ⇒ number
Creates a payload with type HUMIDITY. unit = UNIT.PERCENT
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | number | A floating point number (%) accurate to one decimal place in 0.5 increments. Math.floor10(value, -1) |
# addAccelerometer(buffer, cursor, channel, value) ⇒ number
Creates a payload with type ACCELEROMETER. unit = UNIT.UNDEFINED
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | object | Object containing X, Y, Z value |
# addBarometer(buffer, cursor, channel, value) ⇒ number
Creates a payload with type BAROMETER. unit = UNIT.PRESSURE
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | number | A floating point number accurate to one decimal place. lodash.floor(value, 1) |
# addUnixTime(buffer, cursor, channel, value) ⇒ number
Creates a payload with type UNIXTIME. unit = UNIT.UNDEFINED
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | object | Date() object |
# addGyrometer(buffer, cursor, channel, value) ⇒ number
Creates a payload with type GYROMETER. unit = UNIT.UNDEFINED
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | object | Object containing X, Y, Z value |
# addLocation(buffer, cursor, channel, value) ⇒ number
Creates a payload with type LOCATION. unit = UNIT.UNDEFINED
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | number | Writing position. |
channel | number | The channel for this sensor. |
value | object | Object containing latitude and longitude value |
# getPayload(buffer, cursor) ⇒ object
Reading the composed buffer from 0 to the cursor position.
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
cursor | int | Writing position. |
# cayenneBufferEncoder(buffer, type, channel, value) ⇒ object
| null
Filling the buffer with desired sensor parameters and value
Kind: global function
Param | Type | Description |
---|---|---|
buffer | object | Empty buffer. |
type | number | CayenneLPP type. |
channel | number | CayenneLPP Channel ( max value: 99 ). |
value | number | object | sensor value. |
# cayenneEncoder(instance) ⇒ object
| null
Convert incoming Aloes Client data to CayenneLPP pattern - '+appEui/+type/+method/+gatewayId/#device'
Kind: global function
Throws:
Error
'Invalid instance'
Param | Type | Description |
---|---|---|
instance | object | Sensor instance. |
# OmaObjects
Oma Object References.
Kind: global external
See: https://aloes.io/app/api/omaObjects (opens new window)
# OmaResources
Oma Resources References.
Kind: global external
See: https://aloes.io/app/api/omaResources (opens new window)
# CayenneLPP
Cayenne Low Power Payload.
Kind: global external
See: https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload (opens new window)
← Readme