38 #include <glog/logging.h>
65 sprintf(cmd,
"media-ctl -d %s --print-dot", video.c_str());
66 FILE *fp = popen(cmd,
"r");
73 buf = (
char *)malloc(128 * 1024);
85 size_t pos =
str.find(
"mxc_isi.0.capture");
86 if (pos != string::npos) {
87 dev_path =
str.substr(pos + strlen(
"mxc_isi.0.capture") + 2,
88 strlen(
"/dev/mediaX"));
93 if (
str.find(
"adsd3500") != string::npos) {
94 device_name =
"adsd3500";
95 pos =
str.find(
"adsd3500");
96 subdev_path =
str.substr(pos + strlen(
"adsd3500") + 9,
97 strlen(
"/dev/v4l-subdevX"));
109 LOG(
INFO) <<
"Looking for sensors on the target";
112 std::vector<std::string> videoPaths;
120 if (!strncmp(dp->
d_name, videoBaseName.c_str(),
121 videoBaseName.length())) {
123 videoPaths.emplace_back(fullvideoPath);
129 for (
const auto &video : videoPaths) {
130 DLOG(
INFO) <<
"Looking at: " << video <<
" for an eligible TOF camera";
138 LOG(
WARNING) <<
"failed to find device paths at video: " << video;
142 if (devPath.empty() || subdevPath.empty()) {
146 DLOG(
INFO) <<
"Considering: " << video <<
" an eligible TOF camera";
150 if (deviceName ==
"adsd3500") {
151 sInfo.
sensorType = SensorType::SENSOR_ADSD3500;
157 m_sensorsInfo.emplace_back(sInfo);