# Objects
- protocolRef :
object
References used to validate payloads
- convertValueFromResourceTypes :
object
References of OMAResources types
used to cast incoming sensor value to the correct type
# Functions
- aloesClientPatternDetector(packet) ⇒
object
|null
Check incoming MQTT packet against AloesClient API
collectionPattern - '+userId/+collection/+method'
instancePattern - '+userId/+collection/+method/+modelId'
- aloesClientEncoder(options) ⇒
object
|null
Try to convert incoming route to AloesClient routing
collectionPattern - '+userId/+collection/+method'
instancePattern - '+userId/+collection/+method/+modelId'
- setResourceValue(value) ⇒
any
Cast incoming sensor value based on its OMAResource type
- updateAloesSensors(sensor, resource, value) ⇒
object
|null
Update and validate AloesClient Sensor instance
# External
- OmaObjects
Oma Object References.
- OmaResources
Oma Resources References.
# protocolRef : object
References used to validate payloads
Kind: global namespace
Properties
Name | Type | Description |
---|---|---|
collectionPattern | string | The pattern used by Aloes Client Collection []. |
instancePattern | string | The pattern used by Aloes Client instance. |
validators | object | Check inputs / build outputs |
validators.userId | array | |
validators.collection | array | |
validators.methods | array | [0, 1, 2, 3, 4]. |
# convertValueFromResourceTypes : object
References of OMAResources types
used to cast incoming sensor value to the correct type
Kind: global namespace
Properties
Name | Type | Description |
---|---|---|
Float | function | convert value to number |
Integer | function | convert value to number |
String | function | convert value to string |
Boolean | function | convert value to boolean |
Time | function | convert value to number |
Opaque | function | convert value to buffer |
null | function | convert value to null |
# aloesClientPatternDetector(packet) ⇒ object
| null
Check incoming MQTT packet against AloesClient API
collectionPattern - '+userId/+collection/+method'
instancePattern - '+userId/+collection/+method/+modelId'
Kind: global function
Returns: object
| null
- pattern
Param | Type | Description |
---|---|---|
packet | object | The MQTT packet. |
# aloesClientEncoder(options) ⇒ object
| null
Try to convert incoming route to AloesClient routing
collectionPattern - '+userId/+collection/+method'
instancePattern - '+userId/+collection/+method/+modelId'
Kind: global function
Returns: object
| null
- MQTT topic and payload to send
Throws:
Error
'Wrong protocol input'
Param | Type | Description |
---|---|---|
options | object | Protocol parameters ( coming from patternDetector ). |
# setResourceValue(value) ⇒ any
Cast incoming sensor value based on its OMAResource type
Kind: global function
Param | Type | Description |
---|---|---|
value | any | value to cast |
# updateAloesSensors(sensor, resource, value) ⇒ object
| null
Update and validate AloesClient Sensor instance
Kind: global function
Returns: object
| null
- sensor
Param | Type | Description |
---|---|---|
sensor | object | sensor instance formatted as AloesClient protocol |
resource | number | OMA Resources ID to update |
value | string | new value to update sensor with |
# OmaObjects
Oma Object References.
Kind: global external
See: https://aloes.io/app/api/omaObjects
# OmaResources
Oma Resources References.
Kind: global external
See: https://aloes.io/app/api/omaResources
← Readme