zhangmeng
2023-01-29 d8cb16e3a0d8d1483f89ca106b1e31fc7663b31d
bug fixed query_proc
4个文件已修改
19 ■■■■ 已修改文件
3rdparty/bus_nng/aarch64/libbus_nng.so 补丁 | 查看 | 原始文档 | blame | 历史
3rdparty/bus_nng/x86_64/libbus_nng.so 补丁 | 查看 | 原始文档 | blame | 历史
cbhomeclient.cpp 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
3rdparty/bus_nng/aarch64/libbus_nng.so
Binary files differ
3rdparty/bus_nng/x86_64/libbus_nng.so
Binary files differ
cbhomeclient.cpp
@@ -355,13 +355,16 @@
    void* rep = NULL;
    int repl = 0;
    //auto msg = to_bus<4,5>(ptr(handle), bus_query_procs, pbaddr.data(), pbaddr.size(),
    //    pbtopic.data(), pbtopic.size(), &rep, &repl, sndto);
    auto msg = to_bus<4,5>(ptr(handle), bus_query_procs, pbaddr.data(), pbaddr.size(),
       pbtopic.data(), pbtopic.size(), &rep, &repl, sndto);
    if (msg.empty()) return NULL;
    // bug 已修复, 在 bus_nng 中
    // bus_query_procs 获取数据失败, 暂时改用BHQueryProcs
    if (!BHQueryProcs(pbaddr.data(), pbaddr.size(), pbtopic.data(), pbtopic.size(), &rep, &repl, sndto)) {
        return NULL;
    }
    // if (!BHQueryProcs(pbaddr.data(), pbaddr.size(), pbtopic.data(), pbtopic.size(), &rep, &repl, sndto)) {
    //     return NULL;
    // }
    MsgQueryProcReply msgR;
    msgR.ParseFromArray(rep, repl);
main.cpp
@@ -62,6 +62,11 @@
        auto msg = bus_client_get_submsg(handle);
        printf("SUB msg topic [%s] data [%s]\n", msg->topic, msg->msg);
        free_submsg(msg);
        size_t count = 0;
        auto p = bus_client_query_procs(handle, &count);
        printf("bus_client_query_procs size %lu\n", count);
        free_query_procs(p, count);
    }
    bus_client_free(handle);
@@ -135,6 +140,7 @@
    printf("start RR\n");
    const char* rrtopic = "cbhomeclient_req_rep";
    thread([&]{ req(rrtopic); }).detach();
    reply(rrtopic);
    return 0;