mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Update docs
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user