提交 15db32bf authored 作者: blu's avatar blu

mqtt api: minior bugfix

上级 c31440ba
......@@ -385,7 +385,7 @@ void my_on_msg1(MqttHelper *hlp, const void * const data, int len, string topic)
memcpy(msg.data(), data, len);
msg.data()[len] = 0;
spdlog::info("I1 recv on {}: {}", topic, msg);
(*hlp)[to_string(atoi(topic.data()) + 1)]("hello ack", 10);
(*hlp)[to_string(atoi(topic.data()) + 1)]("hello ack1", 11);
}
void my_on_msg2(MqttHelper *hlp, const void * const data, int len, string topic){
......@@ -394,7 +394,7 @@ void my_on_msg2(MqttHelper *hlp, const void * const data, int len, string topic)
memcpy(msg.data(), data, len);
msg.data()[len] = 0;
spdlog::info("I2 recv on {}: {}", topic, msg);
(*hlp)[to_string(atoi(topic.data()) + 1)]("hello ack", 10);
(*hlp)[to_string(atoi(topic.data()) + 1)]("hello ack2", 11);
}
int main(){
......@@ -426,7 +426,6 @@ int main(){
}
this_thread::sleep_for(chrono::seconds(2));
return 0;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论