All Classes Namespaces Files Functions Variables Enumerations Enumerator
libs/range_sensor/UrgUsbCom.cpp
Go to the documentation of this file.
00001 
00010 #include "UrgUsbCom.h"
00011 #include "DetectOS.h"
00012 #include "isUsingComDriver.h"
00013 
00014 using namespace qrk;
00015 using namespace std;
00016 
00017 
00018 UrgUsbCom::UrgUsbCom(void)
00019 {
00020 }
00021 
00022 
00023 vector<string> UrgUsbCom::baseNames(void)
00024 {
00025   vector<string> ports;
00026 #if defined(LINUX_OS)
00027   // Linux の場合
00028   ports.push_back("/dev/ttyACM");
00029 
00030 #elif defined(MAC_OS)
00031   // MacOS の場合
00032   ports.push_back("/dev/tty.usbmodem");
00033 #endif
00034   return ports;
00035 }
00036 
00037 
00038 bool UrgUsbCom::isUsbCom(const char* com_port)
00039 {
00040   // "URG Series USB Device Driver (COMx)" や
00041   // "URG-X002 USB Device Driver (COMx)" が Value に含まれているか検索
00042   if (isUsingComDriver(com_port, "URG Series USB Device Driver") ||
00043       isUsingComDriver(com_port, "URG-X002 USB Device Driver")) {
00044     return true;
00045 
00046   } else {
00047     return false;
00048   }
00049 }