| | |
| | |
|
| | | 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);
|
| | |
| | | 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); |
| | |
| | | printf("start RR\n"); |
| | | const char* rrtopic = "cbhomeclient_req_rep"; |
| | | thread([&]{ req(rrtopic); }).detach(); |
| | | |
| | | reply(rrtopic); |
| | | |
| | | return 0; |