From 81b93ee513375881d1142ff7257fc79a4395c8a0 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Sat, 19 Mar 2011 14:08:34 -0500 Subject: [PATCH] Fixed the issue with reading on osx. writing still needs to be tested, then I am going to remove the ROS dependency. --- serial/CMakeLists.txt | 6 +++++- serial/include/serial.h | 2 ++ serial/src/test_serial.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/serial/CMakeLists.txt b/serial/CMakeLists.txt index 12148c7..d10392b 100644 --- a/serial/CMakeLists.txt +++ b/serial/CMakeLists.txt @@ -28,4 +28,8 @@ rosbuild_add_boost_directories() rosbuild_link_boost(${PROJECT_NAME} system filesystem thread) rosbuild_add_executable(test_serial src/test_serial.cpp) target_link_libraries(test_serial serial) -# rosbuild_add_executable(boosttest src/boosttest.cpp) \ No newline at end of file + +# Check for OS X and if so disable kqueue support in asio +IF(CMAKE_SYSTEM_NAME MATCHES Darwin) + add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE) +ENDIF(CMAKE_SYSTEM_NAME MATCHES Darwin) diff --git a/serial/include/serial.h b/serial/include/serial.h index 8847184..e176a16 100644 --- a/serial/include/serial.h +++ b/serial/include/serial.h @@ -40,6 +40,8 @@ #include #include +// #define BOOST_ASIO_DISABLE_KQUEUE + #include #include #include diff --git a/serial/src/test_serial.cpp b/serial/src/test_serial.cpp index 5595425..186e255 100644 --- a/serial/src/test_serial.cpp +++ b/serial/src/test_serial.cpp @@ -30,7 +30,7 @@ int main(int argc, char **argv) ros::NodeHandle n; - std::string port("/dev/ttyUSB0"); + std::string port("/dev/tty.usbserial-A900cfJA"); // std::string port("/dev/tty.usbmodemfa141"); serial = new Serial(port, 9600, 250);