Commit da2ae639 by 李维杰

修改回调返回值

parent 3cb8c8f5
......@@ -135,8 +135,8 @@ namespace offcn
}
int MqttWrapper::mqttRecvMessage(char *topicName, int topicNameLen, MQTTAsync_message *message)
{
if (dst_topic_.compare(topicName) != 0) return 0;
if (message->payloadlen <= 0) return 0;
if (dst_topic_.compare(topicName) != 0) return 1;
if (message->payloadlen <= 0) return 1;
std::string topic;
topic.append(topicName, topicNameLen);
......@@ -152,6 +152,6 @@ namespace offcn
MQTTAsync_freeMessage(&message);
MQTTAsync_free(topicName);
return 0;
return 1;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment