Communication
Declaring adapters in a model
attributes:
temperature: 21.5
communication:
- modbus_slave:
host: 0.0.0.0
port: 5020
mapping:
temperature: { address: [0, 1], group: h_r, type: float }
- http_endpoint:
host: 0.0.0.0
port: 8001
endpoints:
"/v1/temperature":
method: GET
response:
temperature: "#attr(temperature)"{
"attributes": {
"temperature": 21.5
},
"communication": [
{
"modbus_slave": {
"host": "0.0.0.0",
"port": 5020,
"mapping": {
"temperature": { "address": [0, 1], "group": "h_r", "type": "float" }
}
}
},
{
"http_endpoint": {
"host": "0.0.0.0",
"port": 8001,
"endpoints": {
"/v1/temperature": {
"method": "GET",
"response": {
"temperature": "#attr(temperature)"
}
}
}
}
}
]
}Implementing a custom protocol
Managing children and teardown
SDK vs. server adapters
Best practices
Last updated

