mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
Compare commits
No commits in common. "main" and "1.2.1" have entirely different histories.
@ -2,9 +2,11 @@ os:
|
|||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
language: cpp
|
language: cpp
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
- clang
|
||||||
install:
|
install:
|
||||||
- make install_deps
|
- make install_deps
|
||||||
- source setup.bash
|
- source setup.bash
|
||||||
script:
|
script:
|
||||||
- mkdir build && cd build && cmake .. -DPYTHON_EXECUTABLE=$(which python2) && make && make tests && make run_tests
|
- make && make test
|
||||||
- catkin_test_results .
|
|
||||||
|
|||||||
@ -11,8 +11,6 @@ endif()
|
|||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
# If Linux, add rt and pthread
|
# If Linux, add rt and pthread
|
||||||
set(rt_LIBRARIES rt)
|
|
||||||
set(pthread_LIBRARIES pthread)
|
|
||||||
catkin_package(
|
catkin_package(
|
||||||
LIBRARIES ${PROJECT_NAME}
|
LIBRARIES ${PROJECT_NAME}
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
@ -68,7 +66,6 @@ include_directories(include)
|
|||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME}
|
||||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||||
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
## Install headers
|
## Install headers
|
||||||
|
|||||||
7
LICENSE
7
LICENSE
@ -1,7 +0,0 @@
|
|||||||
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.
|
|
||||||
12
Makefile
12
Makefile
@ -8,17 +8,14 @@ ifeq ($(UNAME),Darwin)
|
|||||||
brew tap ros/deps
|
brew tap ros/deps
|
||||||
brew update
|
brew update
|
||||||
brew outdated boost || brew upgrade boost || brew install boost
|
brew outdated boost || brew upgrade boost || brew install boost
|
||||||
brew outdated python || brew upgrade python || brew install python
|
sudo pip install rosinstall_generator wstool rosdep empy catkin_pkg
|
||||||
sudo -H python2 -m pip install -U pip setuptools
|
sudo rosdep init
|
||||||
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
|
rosdep update
|
||||||
mkdir catkin_ws
|
mkdir catkin_ws
|
||||||
cd catkin_ws && rosinstall_generator catkin --rosdistro hydro --tar > catkin.rosinstall
|
cd catkin_ws && rosinstall_generator catkin --rosdistro hydro --tar > catkin.rosinstall
|
||||||
cd catkin_ws && wstool init src catkin.rosinstall
|
cd catkin_ws && wstool init src catkin.rosinstall
|
||||||
cd catkin_ws && rosdep install --from-paths src --ignore-src -y
|
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
|
cd catkin_ws && ./src/catkin/bin/catkin_make install
|
||||||
echo "source catkin_ws/install/setup.bash" > setup.bash
|
echo "source catkin_ws/install/setup.bash" > setup.bash
|
||||||
else
|
else
|
||||||
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
|
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
|
||||||
@ -31,6 +28,9 @@ endif
|
|||||||
install:
|
install:
|
||||||
cd build && make install
|
cd build && make install
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
cd build && make uninstall
|
||||||
|
|
||||||
serial:
|
serial:
|
||||||
@mkdir -p build
|
@mkdir -p build
|
||||||
cd build && cmake $(CMAKE_FLAGS) ..
|
cd build && cmake $(CMAKE_FLAGS) ..
|
||||||
|
|||||||
25
README.md
25
README.md
@ -10,23 +10,18 @@ Serial is a class that provides the basic interface common to serial libraries (
|
|||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
Website: http://wjwwood.github.io/serial/
|
Website: http://wjwwood.github.com/serial/
|
||||||
|
|
||||||
API Documentation: http://wjwwood.github.io/serial/doc/1.1.0/index.html
|
API Documentation: http://wjwwood.github.com/serial/doc/1.1.0/index.html
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
||||||
Required:
|
|
||||||
* [catkin](http://www.ros.org/wiki/catkin) - cmake and Python based buildsystem
|
* [catkin](http://www.ros.org/wiki/catkin) - cmake and Python based buildsystem
|
||||||
* [cmake](http://www.cmake.org) - buildsystem
|
* [cmake](http://www.cmake.org) - buildsystem
|
||||||
* [Python](http://www.python.org) - scripting language
|
* [Python](http://www.python.org) - scripting language
|
||||||
* [empy](http://www.alcyone.com/pyos/empy/) - Python templating library
|
* [empy](http://www.alcyone.com/pyos/empy/) - Python templating library
|
||||||
* [catkin_pkg](http://pypi.python.org/pypi/catkin_pkg/) - Runtime Python library for catkin
|
* [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
|
### Install
|
||||||
|
|
||||||
Get the code:
|
Get the code:
|
||||||
@ -43,15 +38,27 @@ Build and run the tests:
|
|||||||
|
|
||||||
Build the documentation:
|
Build the documentation:
|
||||||
|
|
||||||
make doc
|
make docs
|
||||||
|
|
||||||
Install:
|
Install:
|
||||||
|
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
make uninstall
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
[The MIT License](LICENSE)
|
The MIT License
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
### Authors
|
### Authors
|
||||||
|
|
||||||
|
|||||||
2498
doc/Doxyfile
2498
doc/Doxyfile
File diff suppressed because it is too large
Load Diff
@ -55,4 +55,10 @@ To install simply:
|
|||||||
sudo make install
|
sudo make install
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
To uninstall simply:
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
sudo make uninstall
|
||||||
|
</pre>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@ -450,8 +450,6 @@ public:
|
|||||||
* reading or writing is complete, when a timeout occurs, or when an
|
* reading or writing is complete, when a timeout occurs, or when an
|
||||||
* exception occurs.
|
* exception occurs.
|
||||||
*
|
*
|
||||||
* A timeout of 0 enables non-blocking mode.
|
|
||||||
*
|
|
||||||
* \param timeout A serial::Timeout struct containing the inter byte
|
* \param timeout A serial::Timeout struct containing the inter byte
|
||||||
* timeout, and the read and write timeout constants and multipliers.
|
* timeout, and the read and write timeout constants and multipliers.
|
||||||
*
|
*
|
||||||
@ -488,7 +486,7 @@ public:
|
|||||||
* 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 56000,
|
* 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 56000,
|
||||||
* 57600, 115200
|
* 57600, 115200
|
||||||
* Some other baudrates that are supported by some comports:
|
* Some other baudrates that are supported by some comports:
|
||||||
* 128000, 153600, 230400, 256000, 460800, 500000, 921600
|
* 128000, 153600, 230400, 256000, 460800, 921600
|
||||||
*
|
*
|
||||||
* \param baudrate An integer that sets the baud rate for the serial port.
|
* \param baudrate An integer that sets the baud rate for the serial port.
|
||||||
*
|
*
|
||||||
@ -719,7 +717,7 @@ public:
|
|||||||
virtual ~IOException() throw() {}
|
virtual ~IOException() throw() {}
|
||||||
IOException (const IOException& other) : line_(other.line_), e_what_(other.e_what_), errno_(other.errno_) {}
|
IOException (const IOException& other) : line_(other.line_), e_what_(other.e_what_), errno_(other.errno_) {}
|
||||||
|
|
||||||
int getErrorNumber () const { return errno_; }
|
int getErrorNumber () { return errno_; }
|
||||||
|
|
||||||
virtual const char* what () const throw () {
|
virtual const char* what () const throw () {
|
||||||
return e_what_.c_str();
|
return e_what_.c_str();
|
||||||
|
|||||||
@ -3,9 +3,7 @@
|
|||||||
<name>serial</name>
|
<name>serial</name>
|
||||||
<version>1.2.1</version>
|
<version>1.2.1</version>
|
||||||
<description>
|
<description>
|
||||||
Serial is a cross-platform, simple to use library for using serial ports on computers.
|
Serial is a cross-platform, simple to use library for using serial ports on computers. This library provides a C++, object oriented interface for interacting with RS-232 like devices on Linux and Windows.
|
||||||
This library provides a C++, object oriented interface for interacting with RS-232
|
|
||||||
like devices on Linux and Windows.
|
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<maintainer email="william@osrfoundation.org">William Woodall</maintainer>
|
<maintainer email="william@osrfoundation.org">William Woodall</maintainer>
|
||||||
@ -21,4 +19,6 @@
|
|||||||
|
|
||||||
<buildtool_depend>catkin</buildtool_depend>
|
<buildtool_depend>catkin</buildtool_depend>
|
||||||
|
|
||||||
|
<test_depend>boost</test_depend>
|
||||||
|
|
||||||
</package>
|
</package>
|
||||||
|
|||||||
@ -11,12 +11,14 @@
|
|||||||
{
|
{
|
||||||
"sublimeclang_options":
|
"sublimeclang_options":
|
||||||
[
|
[
|
||||||
"-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
|
|
||||||
"-I/usr/local/include",
|
|
||||||
"-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
|
|
||||||
"-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
|
|
||||||
"-I/usr/include",
|
"-I/usr/include",
|
||||||
|
"-I/usr/local/include",
|
||||||
"-I${folder:${project_path:serial.sublime-project}}/include",
|
"-I${folder:${project_path:serial.sublime-project}}/include",
|
||||||
|
"-I/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1",
|
||||||
|
"-I/usr/local/include",
|
||||||
|
"-I/Library/Developer/CommandLineTools/usr/bin/../lib/clang/6.1.0/include",
|
||||||
|
"-I/Library/Developer/CommandLineTools/usr/include",
|
||||||
|
"-I/usr/include"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -305,7 +305,6 @@ serial::list_ports()
|
|||||||
search_globs.push_back("/dev/ttyUSB*");
|
search_globs.push_back("/dev/ttyUSB*");
|
||||||
search_globs.push_back("/dev/tty.*");
|
search_globs.push_back("/dev/tty.*");
|
||||||
search_globs.push_back("/dev/cu.*");
|
search_globs.push_back("/dev/cu.*");
|
||||||
search_globs.push_back("/dev/rfcomm*");
|
|
||||||
|
|
||||||
vector<string> devices_found = glob( search_globs );
|
vector<string> devices_found = glob( search_globs );
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ MillisecondTimer::MillisecondTimer (const uint32_t millis)
|
|||||||
int64_t tv_nsec = expiry.tv_nsec + (millis * 1e6);
|
int64_t tv_nsec = expiry.tv_nsec + (millis * 1e6);
|
||||||
if (tv_nsec >= 1e9) {
|
if (tv_nsec >= 1e9) {
|
||||||
int64_t sec_diff = tv_nsec / static_cast<int> (1e9);
|
int64_t sec_diff = tv_nsec / static_cast<int> (1e9);
|
||||||
expiry.tv_nsec = tv_nsec % static_cast<int>(1e9);
|
expiry.tv_nsec = tv_nsec - static_cast<int> (1e9 * sec_diff);
|
||||||
expiry.tv_sec += sec_diff;
|
expiry.tv_sec += sec_diff;
|
||||||
} else {
|
} else {
|
||||||
expiry.tv_nsec = tv_nsec;
|
expiry.tv_nsec = tv_nsec;
|
||||||
@ -85,13 +85,13 @@ MillisecondTimer::timespec_now ()
|
|||||||
# ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
|
# ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
|
||||||
clock_serv_t cclock;
|
clock_serv_t cclock;
|
||||||
mach_timespec_t mts;
|
mach_timespec_t mts;
|
||||||
host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock);
|
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
|
||||||
clock_get_time(cclock, &mts);
|
clock_get_time(cclock, &mts);
|
||||||
mach_port_deallocate(mach_task_self(), cclock);
|
mach_port_deallocate(mach_task_self(), cclock);
|
||||||
time.tv_sec = mts.tv_sec;
|
time.tv_sec = mts.tv_sec;
|
||||||
time.tv_nsec = mts.tv_nsec;
|
time.tv_nsec = mts.tv_nsec;
|
||||||
# else
|
# else
|
||||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
clock_gettime(CLOCK_REALTIME, &time);
|
||||||
# endif
|
# endif
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
@ -269,9 +269,6 @@ Serial::SerialImpl::reconfigurePort ()
|
|||||||
#ifdef B460800
|
#ifdef B460800
|
||||||
case 460800: baud = B460800; break;
|
case 460800: baud = B460800; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef B500000
|
|
||||||
case 500000: baud = B500000; break;
|
|
||||||
#endif
|
|
||||||
#ifdef B576000
|
#ifdef B576000
|
||||||
case 576000: baud = B576000; break;
|
case 576000: baud = B576000; break;
|
||||||
#endif
|
#endif
|
||||||
@ -304,6 +301,36 @@ Serial::SerialImpl::reconfigurePort ()
|
|||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
custom_baud = true;
|
custom_baud = true;
|
||||||
|
// OS X support
|
||||||
|
#if defined(MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
|
||||||
|
// Starting with Tiger, the IOSSIOSPEED ioctl can be used to set arbitrary baud rates
|
||||||
|
// other than those specified by POSIX. The driver for the underlying serial hardware
|
||||||
|
// ultimately determines which baud rates can be used. This ioctl sets both the input
|
||||||
|
// and output speed.
|
||||||
|
speed_t new_baud = static_cast<speed_t> (baudrate_);
|
||||||
|
if (-1 == ioctl (fd_, IOSSIOSPEED, &new_baud, 1)) {
|
||||||
|
THROW (IOException, errno);
|
||||||
|
}
|
||||||
|
// Linux Support
|
||||||
|
#elif defined(__linux__) && defined (TIOCSSERIAL)
|
||||||
|
struct serial_struct ser;
|
||||||
|
|
||||||
|
if (-1 == ioctl (fd_, TIOCGSERIAL, &ser)) {
|
||||||
|
THROW (IOException, errno);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set custom divisor
|
||||||
|
ser.custom_divisor = ser.baud_base / static_cast<int> (baudrate_);
|
||||||
|
// update flags
|
||||||
|
ser.flags &= ~ASYNC_SPD_MASK;
|
||||||
|
ser.flags |= ASYNC_SPD_CUST;
|
||||||
|
|
||||||
|
if (-1 == ioctl (fd_, TIOCSSERIAL, &ser)) {
|
||||||
|
THROW (IOException, errno);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
throw invalid_argument ("OS does not currently support custom bauds");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (custom_baud == false) {
|
if (custom_baud == false) {
|
||||||
#ifdef _BSD_SOURCE
|
#ifdef _BSD_SOURCE
|
||||||
@ -413,41 +440,6 @@ Serial::SerialImpl::reconfigurePort ()
|
|||||||
// activate settings
|
// activate settings
|
||||||
::tcsetattr (fd_, TCSANOW, &options);
|
::tcsetattr (fd_, TCSANOW, &options);
|
||||||
|
|
||||||
// apply custom baud rate, if any
|
|
||||||
if (custom_baud == true) {
|
|
||||||
// OS X support
|
|
||||||
#if defined(MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
|
|
||||||
// Starting with Tiger, the IOSSIOSPEED ioctl can be used to set arbitrary baud rates
|
|
||||||
// other than those specified by POSIX. The driver for the underlying serial hardware
|
|
||||||
// ultimately determines which baud rates can be used. This ioctl sets both the input
|
|
||||||
// and output speed.
|
|
||||||
speed_t new_baud = static_cast<speed_t> (baudrate_);
|
|
||||||
// PySerial uses IOSSIOSPEED=0x80045402
|
|
||||||
if (-1 == ioctl (fd_, IOSSIOSPEED, &new_baud, 1)) {
|
|
||||||
THROW (IOException, errno);
|
|
||||||
}
|
|
||||||
// Linux Support
|
|
||||||
#elif defined(__linux__) && defined (TIOCSSERIAL)
|
|
||||||
struct serial_struct ser;
|
|
||||||
|
|
||||||
if (-1 == ioctl (fd_, TIOCGSERIAL, &ser)) {
|
|
||||||
THROW (IOException, errno);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set custom divisor
|
|
||||||
ser.custom_divisor = ser.baud_base / static_cast<int> (baudrate_);
|
|
||||||
// update flags
|
|
||||||
ser.flags &= ~ASYNC_SPD_MASK;
|
|
||||||
ser.flags |= ASYNC_SPD_CUST;
|
|
||||||
|
|
||||||
if (-1 == ioctl (fd_, TIOCSSERIAL, &ser)) {
|
|
||||||
THROW (IOException, errno);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
throw invalid_argument ("OS does not currently support custom bauds");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update byte_time_ based on the new settings.
|
// Update byte_time_ based on the new settings.
|
||||||
uint32_t bit_time_ns = 1e9 / baudrate_;
|
uint32_t bit_time_ns = 1e9 / baudrate_;
|
||||||
byte_time_ns_ = bit_time_ns * (1 + bytesize_ + parity_ + stopbits_);
|
byte_time_ns_ = bit_time_ns * (1 + bytesize_ + parity_ + stopbits_);
|
||||||
@ -625,17 +617,12 @@ Serial::SerialImpl::write (const uint8_t *data, size_t length)
|
|||||||
total_timeout_ms += timeout_.write_timeout_multiplier * static_cast<long> (length);
|
total_timeout_ms += timeout_.write_timeout_multiplier * static_cast<long> (length);
|
||||||
MillisecondTimer total_timeout(total_timeout_ms);
|
MillisecondTimer total_timeout(total_timeout_ms);
|
||||||
|
|
||||||
bool first_iteration = true;
|
|
||||||
while (bytes_written < length) {
|
while (bytes_written < length) {
|
||||||
int64_t timeout_remaining_ms = total_timeout.remaining();
|
int64_t timeout_remaining_ms = total_timeout.remaining();
|
||||||
// Only consider the timeout if it's not the first iteration of the loop
|
if (timeout_remaining_ms <= 0) {
|
||||||
// otherwise a timeout of 0 won't be allowed through
|
|
||||||
if (!first_iteration && (timeout_remaining_ms <= 0)) {
|
|
||||||
// Timed out
|
// Timed out
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
first_iteration = false;
|
|
||||||
|
|
||||||
timespec timeout(timespec_from_ms(timeout_remaining_ms));
|
timespec timeout(timespec_from_ms(timeout_remaining_ms));
|
||||||
|
|
||||||
FD_ZERO (&writefds);
|
FD_ZERO (&writefds);
|
||||||
@ -665,27 +652,14 @@ Serial::SerialImpl::write (const uint8_t *data, size_t length)
|
|||||||
// This will write some
|
// This will write some
|
||||||
ssize_t bytes_written_now =
|
ssize_t bytes_written_now =
|
||||||
::write (fd_, data + bytes_written, length - bytes_written);
|
::write (fd_, data + bytes_written, length - bytes_written);
|
||||||
|
|
||||||
// even though pselect returned readiness the call might still be
|
|
||||||
// interrupted. In that case simply retry.
|
|
||||||
if (bytes_written_now == -1 && errno == EINTR) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// write should always return some data as select reported it was
|
// write should always return some data as select reported it was
|
||||||
// ready to write when we get to this point.
|
// ready to write when we get to this point.
|
||||||
if (bytes_written_now < 1) {
|
if (bytes_written_now < 1) {
|
||||||
// Disconnected devices, at least on Linux, show the
|
// Disconnected devices, at least on Linux, show the
|
||||||
// behavior that they are always ready to write immediately
|
// behavior that they are always ready to write immediately
|
||||||
// but writing returns nothing.
|
// but writing returns nothing.
|
||||||
std::stringstream strs;
|
throw SerialException ("device reports readiness to write but "
|
||||||
strs << "device reports readiness to write but "
|
"returned no data (device disconnected?)");
|
||||||
"returned no data (device disconnected?)";
|
|
||||||
strs << " errno=" << errno;
|
|
||||||
strs << " bytes_written_now= " << bytes_written_now;
|
|
||||||
strs << " bytes_written=" << bytes_written;
|
|
||||||
strs << " length=" << length;
|
|
||||||
throw SerialException(strs.str().c_str());
|
|
||||||
}
|
}
|
||||||
// Update bytes_written
|
// Update bytes_written
|
||||||
bytes_written += static_cast<size_t> (bytes_written_now);
|
bytes_written += static_cast<size_t> (bytes_written_now);
|
||||||
|
|||||||
@ -24,11 +24,10 @@ inline wstring
|
|||||||
_prefix_port_if_needed(const wstring &input)
|
_prefix_port_if_needed(const wstring &input)
|
||||||
{
|
{
|
||||||
static wstring windows_com_port_prefix = L"\\\\.\\";
|
static wstring windows_com_port_prefix = L"\\\\.\\";
|
||||||
if (input.compare(0, windows_com_port_prefix.size(), windows_com_port_prefix) != 0)
|
if (input.compare(windows_com_port_prefix) != 0)
|
||||||
{
|
{
|
||||||
return windows_com_port_prefix + input;
|
return windows_com_port_prefix + input;
|
||||||
}
|
}
|
||||||
return input;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial::SerialImpl::SerialImpl (const string &port, unsigned long baudrate,
|
Serial::SerialImpl::SerialImpl (const string &port, unsigned long baudrate,
|
||||||
@ -39,10 +38,10 @@ Serial::SerialImpl::SerialImpl (const string &port, unsigned long baudrate,
|
|||||||
baudrate_ (baudrate), parity_ (parity),
|
baudrate_ (baudrate), parity_ (parity),
|
||||||
bytesize_ (bytesize), stopbits_ (stopbits), flowcontrol_ (flowcontrol)
|
bytesize_ (bytesize), stopbits_ (stopbits), flowcontrol_ (flowcontrol)
|
||||||
{
|
{
|
||||||
if (port_.empty () == false)
|
|
||||||
open ();
|
|
||||||
read_mutex = CreateMutex(NULL, false, NULL);
|
read_mutex = CreateMutex(NULL, false, NULL);
|
||||||
write_mutex = CreateMutex(NULL, false, NULL);
|
write_mutex = CreateMutex(NULL, false, NULL);
|
||||||
|
if (port_.empty () == false)
|
||||||
|
open ();
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial::SerialImpl::~SerialImpl ()
|
Serial::SerialImpl::~SerialImpl ()
|
||||||
@ -74,15 +73,15 @@ Serial::SerialImpl::open ()
|
|||||||
0);
|
0);
|
||||||
|
|
||||||
if (fd_ == INVALID_HANDLE_VALUE) {
|
if (fd_ == INVALID_HANDLE_VALUE) {
|
||||||
DWORD create_file_err = GetLastError();
|
DWORD errno_ = GetLastError();
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
switch (create_file_err) {
|
switch (errno_) {
|
||||||
case ERROR_FILE_NOT_FOUND:
|
case ERROR_FILE_NOT_FOUND:
|
||||||
// Use this->getPort to convert to a std::string
|
// Use this->getPort to convert to a std::string
|
||||||
ss << "Specified port, " << this->getPort() << ", does not exist.";
|
ss << "Specified port, " << this->getPort() << ", does not exist.";
|
||||||
THROW (IOException, ss.str().c_str());
|
THROW (IOException, ss.str().c_str());
|
||||||
default:
|
default:
|
||||||
ss << "Unknown error opening the serial port: " << create_file_err;
|
ss << "Unknown error opening the serial port: " << errno;
|
||||||
THROW (IOException, ss.str().c_str());
|
THROW (IOException, ss.str().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -239,19 +238,19 @@ Serial::SerialImpl::reconfigurePort ()
|
|||||||
// setup flowcontrol
|
// setup flowcontrol
|
||||||
if (flowcontrol_ == flowcontrol_none) {
|
if (flowcontrol_ == flowcontrol_none) {
|
||||||
dcbSerialParams.fOutxCtsFlow = false;
|
dcbSerialParams.fOutxCtsFlow = false;
|
||||||
dcbSerialParams.fRtsControl = RTS_CONTROL_DISABLE;
|
dcbSerialParams.fRtsControl = 0x00;
|
||||||
dcbSerialParams.fOutX = false;
|
dcbSerialParams.fOutX = false;
|
||||||
dcbSerialParams.fInX = false;
|
dcbSerialParams.fInX = false;
|
||||||
}
|
}
|
||||||
if (flowcontrol_ == flowcontrol_software) {
|
if (flowcontrol_ == flowcontrol_software) {
|
||||||
dcbSerialParams.fOutxCtsFlow = false;
|
dcbSerialParams.fOutxCtsFlow = false;
|
||||||
dcbSerialParams.fRtsControl = RTS_CONTROL_DISABLE;
|
dcbSerialParams.fRtsControl = 0x00;
|
||||||
dcbSerialParams.fOutX = true;
|
dcbSerialParams.fOutX = true;
|
||||||
dcbSerialParams.fInX = true;
|
dcbSerialParams.fInX = true;
|
||||||
}
|
}
|
||||||
if (flowcontrol_ == flowcontrol_hardware) {
|
if (flowcontrol_ == flowcontrol_hardware) {
|
||||||
dcbSerialParams.fOutxCtsFlow = true;
|
dcbSerialParams.fOutxCtsFlow = true;
|
||||||
dcbSerialParams.fRtsControl = RTS_CONTROL_HANDSHAKE;
|
dcbSerialParams.fRtsControl = 0x03;
|
||||||
dcbSerialParams.fOutX = false;
|
dcbSerialParams.fOutX = false;
|
||||||
dcbSerialParams.fInX = false;
|
dcbSerialParams.fInX = false;
|
||||||
}
|
}
|
||||||
@ -315,14 +314,14 @@ Serial::SerialImpl::available ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Serial::SerialImpl::waitReadable (uint32_t /*timeout*/)
|
Serial::SerialImpl::waitReadable (uint32_t timeout)
|
||||||
{
|
{
|
||||||
THROW (IOException, "waitReadable is not implemented on Windows.");
|
THROW (IOException, "waitReadable is not implemented on Windows.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Serial::SerialImpl::waitByteTimes (size_t /*count*/)
|
Serial::SerialImpl::waitByteTimes (size_t count)
|
||||||
{
|
{
|
||||||
THROW (IOException, "waitByteTimes is not implemented on Windows.");
|
THROW (IOException, "waitByteTimes is not implemented on Windows.");
|
||||||
}
|
}
|
||||||
@ -471,23 +470,17 @@ Serial::SerialImpl::flush ()
|
|||||||
void
|
void
|
||||||
Serial::SerialImpl::flushInput ()
|
Serial::SerialImpl::flushInput ()
|
||||||
{
|
{
|
||||||
if (is_open_ == false) {
|
THROW (IOException, "flushInput is not supported on Windows.");
|
||||||
throw PortNotOpenedException("Serial::flushInput");
|
|
||||||
}
|
|
||||||
PurgeComm(fd_, PURGE_RXCLEAR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Serial::SerialImpl::flushOutput ()
|
Serial::SerialImpl::flushOutput ()
|
||||||
{
|
{
|
||||||
if (is_open_ == false) {
|
THROW (IOException, "flushOutput is not supported on Windows.");
|
||||||
throw PortNotOpenedException("Serial::flushOutput");
|
|
||||||
}
|
|
||||||
PurgeComm(fd_, PURGE_TXCLEAR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Serial::SerialImpl::sendBreak (int /*duration*/)
|
Serial::SerialImpl::sendBreak (int duration)
|
||||||
{
|
{
|
||||||
THROW (IOException, "sendBreak is not supported on Windows.");
|
THROW (IOException, "sendBreak is not supported on Windows.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/* Copyright 2012 William Woodall and John Harrison */
|
/* Copyright 2012 William Woodall and John Harrison */
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
|
#if !defined(_WIN32) && !defined(__OpenBSD__)
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -132,16 +132,7 @@ Serial::read (std::vector<uint8_t> &buffer, size_t size)
|
|||||||
{
|
{
|
||||||
ScopedReadLock lock(this->pimpl_);
|
ScopedReadLock lock(this->pimpl_);
|
||||||
uint8_t *buffer_ = new uint8_t[size];
|
uint8_t *buffer_ = new uint8_t[size];
|
||||||
size_t bytes_read = 0;
|
size_t bytes_read = this->pimpl_->read (buffer_, size);
|
||||||
|
|
||||||
try {
|
|
||||||
bytes_read = this->pimpl_->read (buffer_, size);
|
|
||||||
}
|
|
||||||
catch (const std::exception &e) {
|
|
||||||
delete[] buffer_;
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer.insert (buffer.end (), buffer_, buffer_+bytes_read);
|
buffer.insert (buffer.end (), buffer_, buffer_+bytes_read);
|
||||||
delete[] buffer_;
|
delete[] buffer_;
|
||||||
return bytes_read;
|
return bytes_read;
|
||||||
@ -152,14 +143,7 @@ Serial::read (std::string &buffer, size_t size)
|
|||||||
{
|
{
|
||||||
ScopedReadLock lock(this->pimpl_);
|
ScopedReadLock lock(this->pimpl_);
|
||||||
uint8_t *buffer_ = new uint8_t[size];
|
uint8_t *buffer_ = new uint8_t[size];
|
||||||
size_t bytes_read = 0;
|
size_t bytes_read = this->pimpl_->read (buffer_, size);
|
||||||
try {
|
|
||||||
bytes_read = this->pimpl_->read (buffer_, size);
|
|
||||||
}
|
|
||||||
catch (const std::exception &e) {
|
|
||||||
delete[] buffer_;
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
buffer.append (reinterpret_cast<const char*>(buffer_), bytes_read);
|
buffer.append (reinterpret_cast<const char*>(buffer_), bytes_read);
|
||||||
delete[] buffer_;
|
delete[] buffer_;
|
||||||
return bytes_read;
|
return bytes_read;
|
||||||
@ -188,7 +172,6 @@ Serial::readline (string &buffer, size_t size, string eol)
|
|||||||
if (bytes_read == 0) {
|
if (bytes_read == 0) {
|
||||||
break; // Timeout occured on reading 1 byte
|
break; // Timeout occured on reading 1 byte
|
||||||
}
|
}
|
||||||
if(read_so_far < eol_len) continue;
|
|
||||||
if (string (reinterpret_cast<const char*>
|
if (string (reinterpret_cast<const char*>
|
||||||
(buffer_ + read_so_far - eol_len), eol_len) == eol) {
|
(buffer_ + read_so_far - eol_len), eol_len) == eol) {
|
||||||
break; // EOL found
|
break; // EOL found
|
||||||
@ -230,7 +213,6 @@ Serial::readlines (size_t size, string eol)
|
|||||||
}
|
}
|
||||||
break; // Timeout occured on reading 1 byte
|
break; // Timeout occured on reading 1 byte
|
||||||
}
|
}
|
||||||
if(read_so_far < eol_len) continue;
|
|
||||||
if (string (reinterpret_cast<const char*>
|
if (string (reinterpret_cast<const char*>
|
||||||
(buffer_ + read_so_far - eol_len), eol_len) == eol) {
|
(buffer_ + read_so_far - eol_len), eol_len) == eol) {
|
||||||
// EOL found
|
// EOL found
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
if(UNIX)
|
if(UNIX)
|
||||||
catkin_add_gtest(${PROJECT_NAME}-test unix_serial_tests.cc)
|
catkin_add_gtest(${PROJECT_NAME}-test unix_serial_tests.cc)
|
||||||
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
|
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} ${Boost_LIBRARIES})
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
target_link_libraries(${PROJECT_NAME}-test util)
|
target_link_libraries(${PROJECT_NAME}-test util)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT APPLE) # these tests are unreliable on macOS
|
|
||||||
catkin_add_gtest(${PROJECT_NAME}-test-timer unit/unix_timer_tests.cc)
|
catkin_add_gtest(${PROJECT_NAME}-test-timer unit/unix_timer_tests.cc)
|
||||||
target_link_libraries(${PROJECT_NAME}-test-timer ${PROJECT_NAME})
|
target_link_libraries(${PROJECT_NAME}-test-timer ${PROJECT_NAME})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|||||||
@ -20,6 +20,8 @@ void loop()
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
// Use FRIEND_TEST... its not as nasty, thats what friends are for
|
// Use FRIEND_TEST... its not as nasty, thats what friends are for
|
||||||
// // OMG this is so nasty...
|
// // OMG this is so nasty...
|
||||||
// #define private public
|
// #define private public
|
||||||
|
|||||||
@ -23,7 +23,6 @@
|
|||||||
<RootNamespace>serial</RootNamespace>
|
<RootNamespace>serial</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '14.0'">v140_xp</PlatformToolset>
|
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '12.0'">v120_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '12.0'">v120_xp</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '11.0'">v110_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '11.0'">v110_xp</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -71,7 +70,7 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -85,7 +84,7 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -101,7 +100,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -119,7 +118,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
|||||||
3
visual_studio/serial/serial.vcxproj.user
Normal file
3
visual_studio/serial/serial.vcxproj.user
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
||||||
@ -23,7 +23,6 @@
|
|||||||
<RootNamespace>test_serial</RootNamespace>
|
<RootNamespace>test_serial</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '14.0'">v140_xp</PlatformToolset>
|
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '12.0'">v120_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '12.0'">v120_xp</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '11.0'">v110_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '11.0'">v110_xp</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -71,7 +70,7 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -82,7 +81,7 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -95,7 +94,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -110,7 +109,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\include</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\serial\include</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user