Update docs

This commit is contained in:
Christian
2018-04-17 20:16:00 +02:00
parent 98fbbc2864
commit 41df5cdd8b
2 changed files with 7 additions and 6 deletions
@@ -3,13 +3,13 @@ _mqttClient.subscribe("MQTTnet.RPC/+/ping");
_mqttClient.subscribe("MQTTnet.RPC/+/do_something");
// It is not allowed to change the structure of the topic. Otherwise RPC will not work. So method names can be separated using
// an _ or . but no +, # or /.. If it is required to distinguish between devices own rules can be defined like the following.
// an _ or . but no +, # or . If it is required to distinguish between devices own rules can be defined like the following.
_mqttClient.subscribe("MQTTnet.RPC/+/deviceA.ping");
_mqttClient.subscribe("MQTTnet.RPC/+/deviceB.ping");
_mqttClient.subscribe("MQTTnet.RPC/+/deviceC.getTemperature");
// Within the callback of the mqtt client the topic must be checked if it belongs to MQTTnet RPC. The following code shows one
// possible way.
// Within the callback of the MQTT client the topic must be checked if it belongs to MQTTnet RPC. The following code shows one
// possible way of doing this.
void mqtt_Callback(char *topic, byte *payload, unsigned int payloadLength)
{
String topicString = String(topic);
@@ -24,5 +24,6 @@ void mqtt_Callback(char *topic, byte *payload, unsigned int payloadLength)
}
}
// Do not send response message with the _retain_ flag set to true.
// All required data for a RPC call and the result must be placed into the payload.
// Important notes:
// ! Do not send response message with the _retain_ flag set to true.
// ! All required data for a RPC call and the result must be placed into the payload.