-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '3aaee912eafe3cde73d5264ee288118f4e98e5fe' as 'src/exter…
…nal_dependencies/serial'
- Loading branch information
Showing
34 changed files
with
7,879 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.* | ||
.DS_Store | ||
*.coverage | ||
*.egg-info | ||
*.log | ||
*.swp | ||
*.pyc | ||
*.pyo | ||
*.zip | ||
*/files/* | ||
*/tmp/* | ||
*.hwm* | ||
*.cfg | ||
*.out | ||
.svn | ||
build | ||
bin | ||
lib | ||
cpp | ||
*/lib/* | ||
installed | ||
patched | ||
wiped | ||
msg_gen | ||
srv_gen | ||
doc/html | ||
*sublime-workspace | ||
*.user | ||
*.suo | ||
*.sdf | ||
*.opensdf | ||
ipch | ||
Debug | ||
Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
os: | ||
- linux | ||
- osx | ||
language: cpp | ||
install: | ||
- make install_deps | ||
- source setup.bash | ||
script: | ||
- mkdir build && cd build && cmake .. -DPYTHON_EXECUTABLE=$(which python2) && make && make tests && make run_tests | ||
- catkin_test_results . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Changelog for package serial | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
1.2.1 (2015-04-21) | ||
------------------ | ||
* Removed the use of a C++11 feature for compatibility with older browsers. | ||
* Fixed an issue with cross compiling with mingw on Windows. | ||
* Restructured Visual Studio project layout. | ||
* Added include of ``#include <AvailabilityMacros.h>`` on OS X (listing of ports). | ||
* Fixed MXE for the listing of ports on Windows. | ||
* Now closes file device if ``reconfigureDevice`` fails (Windows). | ||
* Added the MARK/SPACE parity bit option, also made it optional. | ||
Adding the enumeration values for MARK and SPACE was the only code change to an API header. | ||
It should not affect ABI or API. | ||
* Added support for 576000 baud on Linux. | ||
* Now releases iterator properly in listing of ports code for OS X. | ||
* Fixed the ability to open COM ports over COM10 on Windows. | ||
* Fixed up some documentation about exceptions in ``serial.h``. | ||
|
||
1.2.0 (2014-07-02) | ||
------------------ | ||
* Removed vestigial ``read_cache_`` private member variable from Serial::Serial | ||
* Fixed usage of scoped locks | ||
Previously they were getting destroyed immediately because they were not stored in a temporary scope variable | ||
* Added check of return value from close in Serial::SerialImpl::close () in unix.cc and win.cc | ||
* Added ability to enumerate ports on linux and windows. | ||
Updated serial_example.cc to show example of port enumeration. | ||
* Fixed compile on VS2013 | ||
* Added functions ``waitReadable`` and ``waitByteTimes`` with implemenations for Unix to support high performance reading | ||
* Contributors: Christopher Baker, Craig Lilley, Konstantina Kastanara, Mike Purvis, William Woodall | ||
|
||
1.1.7 (2014-02-20) | ||
------------------ | ||
* Improved support for mingw (mxe.cc) | ||
* Fix compilation warning | ||
See issue `#53 <https://github.com/wjwwood/serial/issues/53>`_ | ||
* Improved timer handling in unix implementation | ||
* fix broken ifdef _WIN32 | ||
* Fix broken ioctl calls, add exception handling. | ||
* Code guards for platform-specific implementations. (when not using cmake / catkin) | ||
* Contributors: Christopher Baker, Mike Purvis, Nicolas Bigaouette, William Woodall, dawid | ||
|
||
1.1.6 (2013-10-17) | ||
------------------ | ||
* Move stopbits_one_point_five to the end of the enum, so that it doesn't alias with stopbits_two. | ||
|
||
1.1.5 (2013-09-23) | ||
------------------ | ||
* Fix license labeling, I put BSD, but the license has always been MIT... | ||
* Added Microsoft Visual Studio 2010 project to make compiling on Windows easier. | ||
* Implemented Serial::available() for Windows | ||
* Update how custom baudrates are handled on OS X | ||
This is taken from the example serial program on Apple's developer website, see: | ||
http://free-pascal-general.1045716.n5.nabble.com/Non-standard-baud-rates-in-OS-X-IOSSIOSPEED-IOCTL-td4699923.html | ||
* Timout settings are now applied by reconfigurePort | ||
* Pass LPCWSTR to CreateFile in Windows impl | ||
* Use wstring for ``port_`` type in Windows impl | ||
|
||
1.1.4 (2013-06-12 00:13:18 -0600) | ||
--------------------------------- | ||
* Timing calculation fix for read and write. | ||
Fixes `#27 <https://github.com/wjwwood/serial/issues/27>`_ | ||
* Update list of exceptions thrown from constructor. | ||
* fix, by Thomas Hoppe <[email protected]> | ||
For SerialException's: | ||
* The name was misspelled... | ||
* Use std::string's for error messages to prevent corruption of messages on some platforms | ||
* alloca.h does not exist on OpenBSD either. | ||
|
||
1.1.3 (2013-01-09 10:54:34 -0800) | ||
--------------------------------- | ||
* Install headers | ||
|
||
1.1.2 (2012-12-14 14:08:55 -0800) | ||
--------------------------------- | ||
* Fix buildtool depends | ||
|
||
1.1.1 (2012-12-03) | ||
------------------ | ||
* Removed rt linking on OS X. Fixes `#24 <https://github.com/wjwwood/serial/issues/24>`_. | ||
|
||
1.1.0 (2012-10-24) | ||
------------------ | ||
* Previous history is unstructured and therefore has been truncated. See the commit messages for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(serial) | ||
|
||
# Find catkin | ||
find_package(catkin REQUIRED) | ||
|
||
if(APPLE) | ||
find_library(IOKIT_LIBRARY IOKit) | ||
find_library(FOUNDATION_LIBRARY Foundation) | ||
endif() | ||
|
||
if(UNIX AND NOT APPLE) | ||
# If Linux, add rt and pthread | ||
set(rt_LIBRARIES rt) | ||
set(pthread_LIBRARIES pthread) | ||
catkin_package( | ||
LIBRARIES ${PROJECT_NAME} | ||
INCLUDE_DIRS include | ||
DEPENDS rt pthread | ||
) | ||
else() | ||
# Otherwise normal call | ||
catkin_package( | ||
LIBRARIES ${PROJECT_NAME} | ||
INCLUDE_DIRS include | ||
) | ||
endif() | ||
|
||
## Sources | ||
set(serial_SRCS | ||
src/serial.cc | ||
include/serial/serial.h | ||
include/serial/v8stdint.h | ||
) | ||
if(APPLE) | ||
# If OSX | ||
list(APPEND serial_SRCS src/impl/unix.cc) | ||
list(APPEND serial_SRCS src/impl/list_ports/list_ports_osx.cc) | ||
elseif(UNIX) | ||
# If unix | ||
list(APPEND serial_SRCS src/impl/unix.cc) | ||
list(APPEND serial_SRCS src/impl/list_ports/list_ports_linux.cc) | ||
else() | ||
# If windows | ||
list(APPEND serial_SRCS src/impl/win.cc) | ||
list(APPEND serial_SRCS src/impl/list_ports/list_ports_win.cc) | ||
endif() | ||
|
||
## Add serial library | ||
add_library(${PROJECT_NAME} ${serial_SRCS}) | ||
if(APPLE) | ||
target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY}) | ||
elseif(UNIX) | ||
target_link_libraries(${PROJECT_NAME} rt pthread) | ||
else() | ||
target_link_libraries(${PROJECT_NAME} setupapi) | ||
endif() | ||
|
||
## Uncomment for example | ||
add_executable(serial_example examples/serial_example.cc) | ||
add_dependencies(serial_example ${PROJECT_NAME}) | ||
target_link_libraries(serial_example ${PROJECT_NAME}) | ||
|
||
## Include headers | ||
include_directories(include) | ||
|
||
## Install executable | ||
install(TARGETS ${PROJECT_NAME} | ||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} | ||
) | ||
|
||
## Install headers | ||
install(FILES include/serial/serial.h include/serial/v8stdint.h | ||
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial) | ||
|
||
## Tests | ||
if(CATKIN_ENABLE_TESTING) | ||
add_subdirectory(tests) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright (c) 2012 William Woodall, John Harrison | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
all: serial | ||
|
||
CMAKE_FLAGS := -DCMAKE_INSTALL_PREFIX=/tmp/usr/local | ||
UNAME := $(shell uname -s) | ||
|
||
install_deps: | ||
ifeq ($(UNAME),Darwin) | ||
brew tap ros/deps | ||
brew update | ||
brew outdated boost || brew upgrade boost || brew install boost | ||
brew outdated python || brew upgrade python || brew install python | ||
sudo -H python2 -m pip install -U pip setuptools | ||
sudo -H python2 -m pip install --force-reinstall --no-deps -U pip | ||
sudo -H python2 -m pip install rosinstall_generator wstool rosdep empy catkin_pkg | ||
sudo -H rosdep init | ||
rosdep update | ||
mkdir catkin_ws | ||
cd catkin_ws && rosinstall_generator catkin --rosdistro hydro --tar > catkin.rosinstall | ||
cd catkin_ws && wstool init src catkin.rosinstall | ||
cd catkin_ws && rosdep install --from-paths src --ignore-src -y | ||
cd catkin_ws && python2 ./src/catkin/bin/catkin_make -DPYTHON_EXECUTABLE=`which python2` install | ||
echo "source catkin_ws/install/setup.bash" > setup.bash | ||
else | ||
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list' | ||
wget http://packages.ros.org/ros.key -O - | sudo apt-key add - | ||
sudo apt-get update | ||
sudo apt-get install ros-hydro-catkin libboost-dev | ||
echo "source /opt/ros/hydro/setup.bash" > setup.bash | ||
endif | ||
|
||
install: | ||
cd build && make install | ||
|
||
serial: | ||
@mkdir -p build | ||
cd build && cmake $(CMAKE_FLAGS) .. | ||
ifneq ($(MAKE),) | ||
cd build && $(MAKE) | ||
else | ||
cd build && make | ||
endif | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf build | ||
|
||
.PHONY: doc | ||
doc: | ||
@doxygen doc/Doxyfile | ||
ifeq ($(UNAME),Darwin) | ||
@open doc/html/index.html | ||
endif | ||
|
||
.PHONY: test | ||
test: | ||
@mkdir -p build | ||
cd build && cmake $(CMAKE_FLAGS) .. | ||
ifneq ($(MAKE),) | ||
cd build && $(MAKE) run_tests | ||
else | ||
cd build && make run_tests | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Serial Communication Library | ||
|
||
[![Build Status](https://travis-ci.org/wjwwood/serial.svg?branch=master)](https://travis-ci.org/wjwwood/serial)*(Linux and OS X)* [![Build Status](https://ci.appveyor.com/api/projects/status/github/wjwwood/serial)](https://ci.appveyor.com/project/wjwwood/serial)*(Windows)* | ||
|
||
This is a cross-platform library for interfacing with rs-232 serial like ports written in C++. It provides a modern C++ interface with a workflow designed to look and feel like PySerial, but with the speed and control provided by C++. | ||
|
||
This library is in use in several robotics related projects and can be built and installed to the OS like most unix libraries with make and then sudo make install, but because it is a catkin project it can also be built along side other catkin projects in a catkin workspace. | ||
|
||
Serial is a class that provides the basic interface common to serial libraries (open, close, read, write, etc..) and requires no extra dependencies. It also provides tight control over timeouts and control over handshaking lines. | ||
|
||
### Documentation | ||
|
||
Website: http://wjwwood.github.io/serial/ | ||
|
||
API Documentation: http://wjwwood.github.io/serial/doc/1.1.0/index.html | ||
|
||
### Dependencies | ||
|
||
Required: | ||
* [catkin](http://www.ros.org/wiki/catkin) - cmake and Python based buildsystem | ||
* [cmake](http://www.cmake.org) - buildsystem | ||
* [Python](http://www.python.org) - scripting language | ||
* [empy](http://www.alcyone.com/pyos/empy/) - Python templating library | ||
* [catkin_pkg](http://pypi.python.org/pypi/catkin_pkg/) - Runtime Python library for catkin | ||
|
||
Optional (for documentation): | ||
* [Doxygen](http://www.doxygen.org/) - Documentation generation tool | ||
* [graphviz](http://www.graphviz.org/) - Graph visualization software | ||
|
||
### Install | ||
|
||
Get the code: | ||
|
||
git clone https://github.com/wjwwood/serial.git | ||
|
||
Build: | ||
|
||
make | ||
|
||
Build and run the tests: | ||
|
||
make test | ||
|
||
Build the documentation: | ||
|
||
make doc | ||
|
||
Install: | ||
|
||
make install | ||
|
||
### License | ||
|
||
[The MIT License](LICENSE) | ||
|
||
### Authors | ||
|
||
William Woodall <[email protected]> | ||
John Harrison <[email protected]> | ||
|
||
### Contact | ||
|
||
William Woodall <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 1.1.0 10-24-2012 | ||
|
||
* Converted the build system to catkin | ||
|
||
# v1.0.1 8-27-2012 | ||
|
||
* Added baudrates: 1000000, 11520000, 2000000, 2500000, 3000000, 3500000, and 4000000 | ||
* Linking related bug fixes on Linux and OS X | ||
* Custom baudrate bug fix. Closes issue #18. | ||
|
Oops, something went wrong.