37 #include <glog/logging.h>
53 int sensorIndex = -1,
i = 0;
61 if (sensorIndex == -1) {
66 LOG(
INFO) <<
"Looking for sensors over network: " <<
m_ip;
68 std::unique_ptr<Network> net(
new Network(sensorIndex));
70 if (net->ServerConnect(
m_ip) != 0) {
73 return Status::UNREACHABLE;
76 net->send_buff[sensorIndex].set_func_name(
"FindSensors");
77 net->send_buff[sensorIndex].set_expect_reply(
true);
79 if (net->SendCommand() != 0) {
84 if (net->recv_server_data() != 0) {
86 return Status::GENERIC_ERROR;
89 if (net->recv_buff[sensorIndex].server_status() !=
90 payload::ServerStatus::REQUEST_ACCEPTED) {
91 LOG(
WARNING) <<
"API execution on Target Failed";
92 return Status::GENERIC_ERROR;
95 const payload::ServerResponse &msg = net->recv_buff[sensorIndex];
96 const payload::SensorsInfo &pbSensorsInfo = msg.sensors_info();
101 m_sdVersion = msg.card_image_version().sdversion();
104 status =
static_cast<Status>(net->recv_buff[sensorIndex].status());
110 std::vector<std::shared_ptr<DepthSensorInterface>> &depthSensors) {
112 depthSensors.clear();
116 depthSensors.emplace_back(sensor);