REVERT THIS COMMIT LATER: Temporarily disable the device listing

This commit is contained in:
Lorenz Meier
2015-11-12 15:31:38 +01:00
parent 260eaa9d95
commit cc8f159bcc
2 changed files with 29 additions and 26 deletions
+7 -6
View File
@@ -550,13 +550,14 @@ void VDev::showDevices()
pthread_mutex_unlock(&devmutex); pthread_mutex_unlock(&devmutex);
PX4_INFO("DF Devices:"); PX4_INFO("DF Devices:");
// TODO NOT IMPLEMENTED
std::string devname; // std::string devname;
for (unsigned int index=0; i == 0; ++i) { // for (unsigned int index=0; i == 0; ++i) {
if (DevMgr::getNextDeviceName(index, devname) == 0) { // if (DevMgr::getNextDeviceName(index, devname) == 0) {
PX4_INFO(" %s", devname.c_str()); // PX4_INFO(" %s", devname.c_str());
} // }
} // }
} }
void VDev::showTopics() void VDev::showTopics()
+22 -20
View File
@@ -467,31 +467,33 @@ transition_result_t hil_state_transition(hil_state_t new_state, orb_advert_t sta
#else #else
std::string devname; // TODO NOT IMPLEMENTED
unsigned int index = 0;
for(;;) {
if (DevMgr::getNextDeviceName(index, devname) < 0) {
break;
}
/* skip mavlink */ // std::string devname;
if (!strcmp("/dev/mavlink", devname.c_str())) { // unsigned int index = 0;
continue; // for(;;) {
} // if (DevMgr::getNextDeviceName(index, devname) < 0) {
// break;
// }
DevHandle h; // /* skip mavlink */
DevMgr::getHandle(devname.c_str(), h); // if (!strcmp("/dev/mavlink", devname.c_str())) {
// continue;
// }
if (!h.isValid()) { // DevHandle h;
warn("failed opening device %s", devname.c_str()); // DevMgr::getHandle(devname.c_str(), h);
continue;
}
int block_ret = h.ioctl(DEVIOCSPUBBLOCK, (void *)1); // if (!h.isValid()) {
DevMgr::releaseHandle(h); // warn("failed opening device %s", devname.c_str());
// continue;
// }
printf("Disabling %s: %s\n", devname.c_str(), (block_ret == OK) ? "OK" : "ERROR"); // int block_ret = h.ioctl(DEVIOCSPUBBLOCK, (void *)1);
} // DevMgr::releaseHandle(h);
// printf("Disabling %s: %s\n", devname.c_str(), (block_ret == OK) ? "OK" : "ERROR");
// }
ret = TRANSITION_CHANGED; ret = TRANSITION_CHANGED;
mavlink_log_critical(mavlink_fd, "Switched to ON hil state"); mavlink_log_critical(mavlink_fd, "Switched to ON hil state");