pax_global_header00006660000000000000000000000064150017334040014507gustar00rootroot0000000000000052 comment=bf81ec9775eddcd8bf077b3c1e2efdd3dd58169f libserial-master/000077500000000000000000000000001500173340400143125ustar00rootroot00000000000000libserial-master/.gitignore000066400000000000000000000037361500173340400163130ustar00rootroot00000000000000# backup files *~ \#* .\#* *.swp *.bak *.o *.lo *.la # build directories build # lincense files COPYING # tag files GPATH GRTAGS GTAGS TAGS # Data points to plot w/ gnuplot *.dat gtest # Sublime workspace *.sublime-workspace cmake_install.cmake CMakeCache.txt CMakeFiles .deps .libs # Docs docs/doxygen/ docs/html/ docs/.doctrees/ # Files resulting from make build Makefile Makefile.in aclocal.m4 autom4te.cache compile config.guess config.h config.h.in config.log config.status config.sub configure depcomp doxygen.conf install-sh libserial.pc libserial.spec libtool ltmain.sh missing stamp-h1 # Examples examples/main_page_example examples/serial_port_read examples/serial_port_read_write examples/serial_port_write examples/serial_stream_read examples/serial_stream_read_write examples/serial_stream_write m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 # Python files sip/Makefile.sip sip/configure.py sip/libserial.exp sip/libserial.sbf sip/libserial.so sip/sipAPIlibserial.h sip/siplibserialcmodule.cpp sip/siplibserialLibSerial.cpp sip/siplibserialLibSerialBaudRate.cpp sip/siplibserialLibSerialCharacterSize.cpp sip/siplibserialLibSerialFlowControl.cpp sip/siplibserialLibSerialParity.cpp sip/siplibserialLibSerialStopBits.cpp sip/siplibserialSerialPort.cpp sip/siplibserialSerialPortAlreadyOpen.cpp sip/siplibserialSerialPortNotOpen.cpp sip/siplibserialSerialPortOpenFailed.cpp sip/siplibserialSerialPortReadTimeout.cpp sip/siplibserialSerialPortUnsupportedBaudRate.cpp sip/siplibserialstd.cpp sip/siplibserialstdexception.cpp sip/siplibserialstdinvalid_argument.cpp sip/siplibserialstdios_base.cpp sip/siplibserialstdios_baseopenmode.cpp sip/siplibserialstdlogic_error.cpp sip/siplibserialstdruntime_error.cpp sip/siplibserialstdstring.cpp sip/siplibserialstdvector1300.cpp sip/siplibserialstdvector1800.cpp sip/siplibserialstdvector1900.cpp sip/siplibserialstdvector2400.cpp # Test files test/MakeFile test/MakeFile.in test/UnitTests test/unit_tests Testing/ libserial-master/.vimrc000066400000000000000000000004301500173340400154300ustar00rootroot00000000000000let g:ale_cpp_clang_options="-std=c++14 -Wall -Isrc -Weffc++" let g:ale_cpp_clangtidy_options=g:ale_cpp_clang_options let g:ale_cpp_clangtidy_checks=['*', '-fuchsia-default-arguments', '-google-runtime-int', '-llvm-header-guard'] let g:ale_cpp_gcc_options=g:ale_cpp_clang_options libserial-master/.ycm_extra_conf.py000066400000000000000000000005551500173340400177470ustar00rootroot00000000000000#! /usr/bin/env python3 import ycm_core def FlagsForFile( filename, **kwargs ): flags = [ '-Wall', '-Wextra', '-Werror', '-std=c++14', '-x', 'c++', '-I', '.', '-I', 'src' ] return { 'flags': flags, 'do_cache': True } libserial-master/AUTHORS000066400000000000000000000002571500173340400153660ustar00rootroot00000000000000Manish P. Pagey Crayzee Wulf Jay Sachdev Jan Wedekind libserial-master/CMakeLists.txt000066400000000000000000000130141500173340400170510ustar00rootroot00000000000000# # Minimum version is 3.5 (this supports Ubuntu 16.04 and later, for example) # CMAKE_MINIMUM_REQUIRED(VERSION 3.5) # # Project version numbering using semantic versioning. See: # https://semver.org/ # # These are used to set VERSION and SOVERSION properties of the LibSerial # libarary. See: # - https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html # - https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html # PROJECT(LibSerial LANGUAGES C CXX VERSION 1.0.0) option(LIBSERIAL_ENABLE_TESTING "Enables building unit tests" ON) option(LIBSERIAL_BUILD_EXAMPLES "Enables building example programs" ON) option(LIBSERIAL_PYTHON_ENABLE "Enables building the library with Python SIP bindings" ON) option(LIBSERIAL_BUILD_DOCS "Build the Doxygen docs" ON) # # Project specific options and variables # OPTION(INSTALL_STATIC "Install static library." ON) OPTION(INSTALL_SHARED "Install shared object library." ON) # # LibSerial requies a C++ compiler that supports at least C++14 standard # SET(CMAKE_CXX_STANDARD 14) SET(CMAKE_STANDARD_REQUIRES ON) INCLUDE(ExternalProject) if (LIBSERIAL_ENABLE_TESTING) ENABLE_TESTING() endif() SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # # Create compile_commands.json file so that it may be used by various # editors/plugins/IDEs that support it. # SET(CMAKE_EXPORT_COMPILE_COMMANDS 1) # # Use GNU standard installation directories. CMake will use /usr/local # as the default install directory. Users may override this by setting # CMAKE_INSTALL_PREFIX. For example: # # cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr .. # INCLUDE(GNUInstallDirs) # # Prefer -pthread compiler and linker flag when using libpthread. This must # be set before call to FIND_PACKAGE(Threads). # SET(THREADS_HAVE_PTHREAD_ARG 1) if (LIBSERIAL_BUILD_DOCS) FIND_PACKAGE(Doxygen REQUIRED) endif() if (LIBSERIAL_ENABLE_TESTING) FIND_PACKAGE(Boost COMPONENTS unit_test_framework REQUIRED) endif() if (LIBSERIAL_PYTHON_ENABLE) FIND_PACKAGE(PythonLibs REQUIRED) endif() #FIND_PACKAGE(SIP REQUIRED) FIND_PACKAGE(Threads REQUIRED) # # Use -DCMAKE_BUILD_TYPE=Release or -DCMAKE_BUILD_TYPE=Debug to let CMake # decide whether to use debug or optimization flags. We should not hard-code # them here. Similarly, let CMake handle flags needed for shared object files # (such as -fPIC). Additionally, "-pthread" flag will also be handled by CMake # via the use of CMAKE_THREAD_LIBS_INIT (cmake < 3.1) or Threads::Threads. # ADD_DEFINITIONS( -Wall -Wcast-align -Wchar-subscripts -Wdouble-promotion -Wextra -Wfatal-errors -Wformat -Wformat-security -Wlogical-op -Wno-format-extra-args -Wno-long-long -Wno-parentheses -Wno-psabi -Wno-variadic-macros -Woverlength-strings -Wpacked -Wpointer-arith -Wunused-local-typedefs -Wwrite-strings -fstrict-aliasing -fno-check-new -fno-common -fvisibility=default -pedantic ) if (LIBSERIAL_ENABLE_TESTING) SET(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gtest") EXTERNALPROJECT_ADD(GTestExternal PREFIX "${GTEST_PREFIX}" URL https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz URL_HASH SHA1=bfa4b5131b6eaac06962c251742c96aab3f7aa78 INSTALL_COMMAND "" ) SET(LIBPREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}") SET(LIBSUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}") SET(GTEST_LOCATION "${GTEST_PREFIX}/src/GTestExternal-build/lib") SET(GTEST_LIBRARY "${GTEST_LOCATION}/${LIBPREFIX}gtest${LIBSUFFIX}") SET(GTEST_MAINLIB "${GTEST_LOCATION}/${LIBPREFIX}gtest_main${LIBSUFFIX}") ADD_LIBRARY(GTest IMPORTED STATIC GLOBAL) SET_TARGET_PROPERTIES(GTest PROPERTIES IMPORTED_LOCATION "${GTEST_LIBRARY}" IMPORTED_LINK_INTERFACE_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}" ) ADD_LIBRARY(GTestMain IMPORTED STATIC GLOBAL) SET_TARGET_PROPERTIES(GTestMain PROPERTIES IMPORTED_LOCATION "${GTEST_MAINLIB}" IMPORTED_LINK_INTERFACE_LIBRARIES "${GTEST_LIBRARY};${CMAKE_THREAD_LIBS_INIT}" ) ADD_DEPENDENCIES(GTest GTestExternal) ADD_DEPENDENCIES(GTestMain GTestExternal) EXTERNALPROJECT_GET_PROPERTY(GTestExternal source_dir) INCLUDE_DIRECTORIES( BEFORE ${GTEST_PREFIX}/src/GTestExternal/googletest/include ${Boost_INCLUDE_DIRS} ) endif() SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) SET(CMAKE_INSTALL_MESSAGE ALWAYS) if (LIBSERIAL_BUILD_EXAMPLES) ADD_SUBDIRECTORY(examples) endif() if (LIBSERIAL_PYTHON_ENABLE) ADD_SUBDIRECTORY(sip) endif() ADD_SUBDIRECTORY(src) if (LIBSERIAL_ENABLE_TESTING) ADD_SUBDIRECTORY(test) endif() # # Create pkg-config file for cmake builds as well as autotool builds # set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX}) set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) set(VERSION ${PROJECT_VERSION}) configure_file(libserial.pc.in libserial.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libserial.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) if (LIBSERIAL_BUILD_DOCS) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf.in ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf.in @ONLY ) ADD_CUSTOM_TARGET(docs ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf.in WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM ) endif() # # Packaging support # if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) add_subdirectory(packaging) endif() libserial-master/ChangeLog000066400000000000000000000022721500173340400160670ustar00rootroot000000000000002005-09-19 * configure.in: Released version 0.5.0. * src/PosixSignalDispatcher.cpp (Repository): Formatting changes only. No logical changes. * src/PosixSignalDispatcher.h (Repository): Formatting changes only. No logical changes. * src/SerialPort.cpp (Repository): Formatting changes only. No logical changes. 2005-09-18 * src/SerialPort.h (class SerialPort): The constructor for the class is now "explicit" to make sure that a std::string does not get converted to a SerialPort object through implicit conversion. The destructor is not virtual anymore as this class is not designed to be polymorphic. 2005-09-06 Jan Wedekind * examples/write_port.cpp: An example for writing commands to the serial port was added. * src/SerialStream.h: Functions for adjusting the port's VTIME- and VMIN-parameter where added. * src/SerialStreamBuf.cc: Missing return statement was added. 2003-12-30 Manish P. Pagey * src/SerialStreamBuf.cc: Interchanged "case 1" and "case 2" in SerialStreamBuf::SetNumOfStopBits() to make sure that stop bits are set correctly. This bug was pointed out by Olivier Chambard. libserial-master/INSTALL000066400000000000000000000366141500173340400153550ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. libserial-master/LICENSE.txt000066400000000000000000000027651500173340400161470ustar00rootroot00000000000000BSD 3-Clause License Copyright (c) 2018, LibSerial Development Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.libserial-master/LibSerial.sublime-project000066400000000000000000000000551500173340400212060ustar00rootroot00000000000000{ "folders": [ { "path": "." } ] } libserial-master/Makefile.am000066400000000000000000000004541500173340400163510ustar00rootroot00000000000000SUBDIRS = src examples docs if PYTHON SUBDIRS += sip endif if TESTS SUBDIRS += test endif ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = doxygen.conf.in Makefile.dist libserial.spec libserial.pc docs: make dox dox: doxygen doxygen.conf pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libserial.pc libserial-master/Makefile.dist000066400000000000000000000001161500173340400167120ustar00rootroot00000000000000all: mkdir -pv m4 autoreconf -i --force --verbose configure: ./configure libserial-master/NEWS000066400000000000000000000000001500173340400147770ustar00rootroot00000000000000libserial-master/README000066400000000000000000000000001500173340400151600ustar00rootroot00000000000000libserial-master/README.md000066400000000000000000000122701500173340400155730ustar00rootroot00000000000000# Libserial Thanks for checking out LibSerial! LibSerial provides a convenient, object oriented approach to accessing serial ports on Linux operating system. After you get to know LibSerial a bit, if you find that you have ideas for improvement, please be sure to let us know! If you simply want to use LibSerial and you already utilize a Debian Linux distribution, use apt to install the current release package: ```sh sudo apt install libserial-dev ``` > > Note that the above command may install an older version of LibSerial (e.g. 0.6.0 on Ubuntu 18.04). > In order to use the latest features and the example project mentioned below, please build the > library from source code as described in > [here](https://github.com/crayzeewulf/libserial#developers). We are working to > release updated versions of the library from package repositories of major Linux distribution > in the mean time and apologize for the inconvenience. > Example code to demonstrate how to use the library can be found in the [`examples`](https://github.com/crayzeewulf/libserial/tree/master/examples) directory. A self-contained example project demonstrating the use of CMake and GNU Autotools (make) can be found in [`examples/example_project`](https://github.com/crayzeewulf/libserial/tree/master/examples/example_project) directory. ## Developers If you are a developer and would like to make use of the latest code, you will need to have a few packages installed to build LibSerial: a recent g++ release (anything after gcc-3.2 should work), autotools, cmake, doxygen, sphinx, the python3 sip library, the boost unit test library, pkg-config, and Google Test (gtest). The following commands should install the required packages for Debian/Ubuntu users: ```sh sudo apt update sudo apt install g++ git autogen autoconf build-essential cmake graphviz \ libboost-dev libboost-test-dev libgtest-dev libtool \ python3-sip-dev doxygen python3-sphinx pkg-config \ python3-sphinx-rtd-theme ``` If you get the source code from github and would like to install the library, there are a few steps you will need to accomplish: ### Building Using CMake If you are using CMake, to build the library you can simply run the `compile.sh` script: ```sh ./compile.sh ``` To install the library: ```sh cd build sudo make install ``` You can specify an installation directory different from the default, (/usr/local/), by replacing the `cmake ..` command in the `compile.sh` script. For example, to install under `/usr` instead of the `/usr/local` directory, use the following: ```sh cmake -DCMAKE_INSTALL_PREFIX=/usr .. ``` ### Building Using GNU Autotools GNU Autotools is currently configured to built all unit tests, so first you will need to compile the GTest library object files and copy `libgtest.a` and `libgtest_main.a` into your `/usr/lib/` directory which you can accomplish by running the `gtest.sh` convenience script: ```sh ./gtest.sh ``` To generate the configure script: ```sh make -f Makefile.dist ``` To execute the `configure` script, first create a build directory, then run the script from the build directory as follows: ```sh ../configure ``` You can specify an installation directory different from the default, (`/usr/local/`), by adding `--prefix=/installation/directory/path/` to the configure command. For example, to install into the top level include directory as the package manager would accomplish, you can simply run the following: ```sh ./configure --prefix=/usr/ ``` Once you have executed the `configure` script, you can build the library with `make` and install with `make install`: ```sh make sudo make install ``` ## Example Code and Unit Tests If you are interested in running the unit tests or example code, ensure serial port names are appropriate for your hardware configuration in the `examples/` directory files and in the `test/UnitTests.h` file as such: ```cpp constexpr const char* const SERIAL_PORT_1 = "/dev/ttyUSB0" ; constexpr const char* const SERIAL_PORT_2 = "/dev/ttyUSB1" ; ``` Example code and Unit test executables are easily built using the cmake compile script and can be run from the `build` directory: ```sh ./compile ``` ```sh ./build/bin/UnitTests ``` ```sh ./build/bin/SerialPortReadWriteExample ``` Unit test executables built using make can be run from the `build` directory in the following manner: ```sh ctest -V . ``` ## Hardware and Software Considerations If needed, you can grant user permissions to utilize the hardware ports in the following manner, (afterwards a reboot is required): ```sh sudo usermod -a -G dialout $USER sudo usermod -a -G plugdev $USER ``` ## Socat Socat is a useful tool to allow hardware ports to communicate on the same system via a software pipe. As an example, to allow hardware UART port `/dev/ttyS0` to communicate via software with hardware UART port `/dev/ttyS1`: ```sh socat -d -d pty,raw,echo=0,link=/dev/ttyS0 pty,raw,echo=0,link=/dev/ttyS1 ``` ## Documentation Complete documentation is available [here](http://libserial.readthedocs.io/en/latest/index.html). > Let us know that this repository was useful to you by clicking the "star" in > the upper right corner of the LibSerial Github home page! libserial-master/compile.sh000077500000000000000000000002611500173340400163000ustar00rootroot00000000000000#!/bin/bash set -e set -x mkdir -p build cd build cmake .. #cmake -DCMAKE_INSTALL_PREFIX=/usr .. make cd .. make -j3 -C build sphinx-build -b html docs/user_manual/ docs/html/ libserial-master/configure.ac000066400000000000000000000030611500173340400166000ustar00rootroot00000000000000dnl Indicate the package name and the version to automake AC_INIT([libserial], [1.0.0]) dnl Indicate the configuration revision number AC_REVISION($Revision: 1.15 $) dnl Input and Output configuration information AC_CONFIG_SRCDIR([src/SerialStream.cpp]) AM_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_LN_S AC_PROG_MAKE_SET dnl LibSerial now requires at least C++14 features in the compiler. AX_CXX_COMPILE_STDCXX(14, noext, mandatory) AC_CHECK_PROG(DOCBOOK2PDF, docbook2pdf, docbook2pdf, no) if test "x$DOCBOOK2PDF" == "xno"; then AC_MSG_WARN([Could not find docbook2pdf. Disabling creation of user manual.]) HAVE_DOCBOOK2PDF="no" else HAVE_DOCBOOK2PDF="yes" fi AC_SUBST(DOCBOOK2PDF) AM_CONDITIONAL(HAVE_DOCBOOK2PDF, test x$HAVE_DOCBOOK2PDF = xyes) dnl Checks for header files. AC_CHECK_HEADERS(fcntl.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_ARG_WITH([python3], AS_HELP_STRING([--without-python3], [Disable Python bindings]), [], [with_python3=yes]) AM_CONDITIONAL([PYTHON], [test "${with_python3}" != "no"]) AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests], [Disable tests]), [], [enable_tests=yes]) AM_CONDITIONAL([TESTS], [test "${enable_tests}" != "no"]) AC_OUTPUT([Makefile doxygen.conf libserial.spec docs/UML/Makefile docs/Makefile examples/Makefile sip/configure.py sip/Makefile src/Makefile src/libserial/Makefile test/Makefile libserial.pc]) libserial-master/dockerfiles/000077500000000000000000000000001500173340400166045ustar00rootroot00000000000000libserial-master/dockerfiles/centos/000077500000000000000000000000001500173340400200775ustar00rootroot00000000000000libserial-master/dockerfiles/centos/7/000077500000000000000000000000001500173340400202455ustar00rootroot00000000000000libserial-master/dockerfiles/centos/7/Dockerfile000066400000000000000000000027751500173340400222520ustar00rootroot00000000000000# # Run the following command from top-level folder of libserial source code # to build the libserial image for CentOS-7: # # docker build -t libserial:centos-7 -f dockerfiles/centos/7/Dockerfile . # # ------------------------------------------------------------------------------ # base # ------------------------------------------------------------------------------ FROM centos:7 AS base RUN yum install -y centos-release-scl \ && yum install -y devtoolset-7-gcc-c++ \ && yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ && yum install -y \ boost-devel \ cmake3 \ doxygen \ graphviz \ make \ rpm-build \ python-devel # ------------------------------------------------------------------------------ # build # ------------------------------------------------------------------------------ FROM base AS build ENV CC /opt/rh/devtoolset-7/root/bin/gcc ENV CXX /opt/rh/devtoolset-7/root/bin/g++ COPY . /usr/src/libserial RUN cd /usr/src/libserial \ && rm -rf build \ && mkdir -p build \ && cd build \ && cmake3 -DCMAKE_INSTALL_PREFIX=/usr .. \ && make -j$(nproc) \ && make install \ && cpack3 -G RPM # ------------------------------------------------------------------------------ # release # ------------------------------------------------------------------------------ FROM centos:7 AS release COPY --from=build /usr/src/libserial/build/libserial*.rpm /usr/src/ RUN rpm -ivh /usr/src/libserial*.rpm libserial-master/dockerfiles/debian/000077500000000000000000000000001500173340400200265ustar00rootroot00000000000000libserial-master/dockerfiles/debian/buster/000077500000000000000000000000001500173340400213325ustar00rootroot00000000000000libserial-master/dockerfiles/debian/buster/Dockerfile000066400000000000000000000027261500173340400233330ustar00rootroot00000000000000# # Run the following command from top-level folder of libserial source code # to build the libserial image for Debian-buster: # # docker build -t libserial:debian-buster -f dockerfiles/debian/buster/Dockerfile . # # ------------------------------------------------------------------------------ # base # ------------------------------------------------------------------------------ FROM debian:buster AS base ENV DEBIAN_FRONTEND=noninteractive RUN apt-get -yq update && apt-get install -yq --no-install-recommends \ build-essential \ cmake \ coreutils \ doxygen \ g++ \ graphviz \ libboost-test-dev \ libgtest-dev \ libpython-dev \ && apt-get autoremove -y \ && apt-get clean -y # ------------------------------------------------------------------------------ # build # ------------------------------------------------------------------------------ FROM base AS build COPY . /usr/src/libserial RUN cd /usr/src/libserial \ && rm -rf build \ && mkdir -p build \ && cd build \ && cmake -DCMAKE_INSTALL_PREFIX=/usr .. \ && make -j$(nproc) \ && make install \ && cpack -G DEB # ------------------------------------------------------------------------------ # release # ------------------------------------------------------------------------------ FROM debian:buster AS release COPY --from=build /usr/src/libserial/build/libserial*.deb /usr/src/ RUN dpkg -i /usr/src/libserial*.deb libserial-master/dockerfiles/ubuntu/000077500000000000000000000000001500173340400201265ustar00rootroot00000000000000libserial-master/dockerfiles/ubuntu/16.04/000077500000000000000000000000001500173340400205765ustar00rootroot00000000000000libserial-master/dockerfiles/ubuntu/16.04/Dockerfile000066400000000000000000000027211500173340400225720ustar00rootroot00000000000000# # Run the following command from top-level folder of libserial source code # to build the libserial image for Ubuntu 16.04: # # docker build -t libserial:ubuntu-16.04 -f dockerfiles/ubuntu/16.04/Dockerfile . # # ------------------------------------------------------------------------------ # base # ------------------------------------------------------------------------------ FROM ubuntu:16.04 AS base ENV DEBIAN_FRONTEND=noninteractive RUN apt-get -yq update && apt-get install -yq --no-install-recommends \ build-essential \ cmake \ coreutils \ doxygen \ g++ \ graphviz \ libboost-test-dev \ libgtest-dev \ libpython-dev \ && apt-get autoremove -y \ && apt-get clean -y # ------------------------------------------------------------------------------ # build # ------------------------------------------------------------------------------ FROM base AS build COPY . /usr/src/libserial RUN cd /usr/src/libserial \ && rm -rf build \ && mkdir -p build \ && cd build \ && cmake -DCMAKE_INSTALL_PREFIX=/usr .. \ && make -j$(nproc) \ && make install \ && cpack -G DEB # ------------------------------------------------------------------------------ # release # ------------------------------------------------------------------------------ FROM ubuntu:16.04 AS release COPY --from=build /usr/src/libserial/build/libserial*.deb /usr/src/ RUN dpkg -i /usr/src/libserial*.deb libserial-master/dockerfiles/ubuntu/18.04/000077500000000000000000000000001500173340400206005ustar00rootroot00000000000000libserial-master/dockerfiles/ubuntu/18.04/Dockerfile000066400000000000000000000027211500173340400225740ustar00rootroot00000000000000# # Run the following command from top-level folder of libserial source code # to build the libserial image for Ubuntu 18.04: # # docker build -t libserial:ubuntu-18.04 -f dockerfiles/ubuntu/18.04/Dockerfile . # # ------------------------------------------------------------------------------ # base # ------------------------------------------------------------------------------ FROM ubuntu:18.04 AS base ENV DEBIAN_FRONTEND=noninteractive RUN apt-get -yq update && apt-get install -yq --no-install-recommends \ build-essential \ cmake \ coreutils \ doxygen \ g++ \ graphviz \ libboost-test-dev \ libgtest-dev \ libpython-dev \ && apt-get autoremove -y \ && apt-get clean -y # ------------------------------------------------------------------------------ # build # ------------------------------------------------------------------------------ FROM base AS build COPY . /usr/src/libserial RUN cd /usr/src/libserial \ && rm -rf build \ && mkdir -p build \ && cd build \ && cmake -DCMAKE_INSTALL_PREFIX=/usr .. \ && make -j$(nproc) \ && make install \ && cpack -G DEB # ------------------------------------------------------------------------------ # release # ------------------------------------------------------------------------------ FROM ubuntu:18.04 AS release COPY --from=build /usr/src/libserial/build/libserial*.deb /usr/src/ RUN dpkg -i /usr/src/libserial*.deb libserial-master/docs/000077500000000000000000000000001500173340400152425ustar00rootroot00000000000000libserial-master/docs/.cvsignore000066400000000000000000000000441500173340400172400ustar00rootroot00000000000000Makefile Makefile.in UserManual.pdf libserial-master/docs/MAINPAGE.md000066400000000000000000000022321500173340400167440ustar00rootroot00000000000000\mainpage Welcome to LibSerial === LibSerial provides a collection of C++ classes that allow object oriented access to serial ports on POSIX systems. The SerialPort class is available to simplified access to serial port settings along with a set of convenient read/write methods.
This class is useful for embedded systems where a complete C++ STL may not be available. The SerialStream class allows access to serial ports in the same manner as standard C++ iostream objects. Member functions are provided in both classes for setting serial port parameters such as baud rate, character size, flow control, etc. LibSerial exists to simplify serial port programming on POSIX systems.
Here is short example using libserial: \include main_page_example.cpp In addition to the C++ programming languge, LibSerial releases after version 0.6.0 also provide bindings to several scripting languages such as Python, Perl, PHP, Java, and Ruby. This provides developers a wide range languages to select when writing applications that need access to serial ports on POSIX compatible operating systems. LibSerial has received most extensive testing under Linux operating system. libserial-master/docs/Makefile.am000066400000000000000000000000151500173340400172720ustar00rootroot00000000000000SUBDIRS=UML libserial-master/docs/UML/000077500000000000000000000000001500173340400156775ustar00rootroot00000000000000libserial-master/docs/UML/.cvsignore000066400000000000000000000000261500173340400176750ustar00rootroot00000000000000Makefile Makefile.in libserial-master/docs/UML/Makefile.am000066400000000000000000000000011500173340400177220ustar00rootroot00000000000000 libserial-master/docs/UML/libserial_class_diagram.dia000066400000000000000000000203601500173340400231760ustar00rootroot00000000000000‹í]ýoâH¶ý½ÿ DK»ïÍKÜþä#½™U’îìDJ7yIzV»z* ÏcIÓZÍßþÊÆ!€ÌAšLEݪò½÷œ:®*ÿíïßGVå‰:®Éìóª"ÉÕ µ»¬gÚƒóê·ÇëÓFõï?¿û[Ï$gâ¿CFñ ÛõÞW‡œÏ>|x~~–¬©K8s$ËœH.ýð'±,òAúPýù]¥²XApâ}|J8wÌ΄ӊMFô¼Ú!Ýߛؽê¬TP®Ë,æTžˆu^}ß^ÕAE–jÚRû˜ hÇ¡ä÷Í•ËâÕl&«|LÕŠGc暢ŸŽCE6Ôãý](”rE!{ðóû[Ê9uÞÏš|øZߺÆn4ÄGĘvØ–!k6ªdhMïUS†&«uíe\v7×)ÖœU¬9§Xs¦Û3‡;Ääa“Æ,Jì™UîLhr;n—XÂŶuKI^{ßäœE´¿O,7NfÏ#n×è8fo{ð.•ØPKo*þovs½$ÏfÛßsº$³Ú§9ÕþdºfÇ¢ëZoÚ<³ê§ÙT¿ê>N¼þ<¥ÇÍjÛD½5¨‘ˆ³GÝg^.³¡¦aPìCÔ¸¯–K94=Ó[dº½ «…6ÔElnŠF\ÚË(ÓlJ•6Ÿrvº’'rÈÉ!ÖùvsNÿCö\@‡<+]fÛ¢;‚‰žŽ™ˆV7“q=qöÑ Iõ­ £NÐÒËWzZ ’MÐ’JÐ~²ðÝyzy·àî³ ¸ñ·/·•ÓÊ•E\·úÊÅ7{çÕ–¼«#'j< Çþé®~¢¯Æex6ÕÝé¬Víx}´ ª¯IMãD>†T«'º&éF2‹Ô¢£v—9v˜$gÒ#¿~à½z7­!Õ½ùúJÓ—!5C¾ÅXSÒå…—šÌÖÊŒai¾ð@‘þ¸0:ºœô×Nv±åŠÙežën²˜Ú„Öµynõ“Žø-é† lƒ†h2;ÔuÛó/ÜÜM11±$^òÌÍÔ ·ŠÙ©åôœÄPÌ.¥7ø[n#÷ìqþ½ñ­¾ÏvwHB tž>59YýÁ(µÅt¶-jÂYt!E§³ÁÉ`°<ëÌô‚ËbÏm7æ­ø6²¤ÈË/%…±åÅqK–_ç»Ùè›–mcUÛͧßyÞý°™3"V»ÏÂã}Vé‹)¼5=¯Ž˜ÍÜ1é &çò©Gë+›UqÅ&ŽI„îàO’4+M8½dV¯Õ±Ì?’&Ž1³¦#指f7Q‹V”ª1]{ÿŒnŠKD.·b~i~¡Öåf—ø#“ò %nNc}sÒMwlJ¸%©Z±=‘üV–+éMÏÆG‹³¼¬Å™]v¼H»J¦~ž—¹EŽ1”µæò«–°“ 몢4YóÂaõ!ò>ÍÊ<åêñþ¶ý¿îÔl‘H6!ãò”+d®+¨%¯xÔ/3“â:L¶Ú”¿+JfÖÂÓ¾xS¿D=ó¨¿i™|ºÎµ'£à–͢´»™53͘Òc‚áóB¸ívÙz7ÙªmìÖégEFÐCÙ#HC!‚rŠ ÑÝ„{K*®²têÈ8*4‚J=J9£gso!|.žˆiywv ‹!o¸Cˆ¡ÄеiÑOÔí:昳âPÈ´9tøôéóõÅ·ÛÇöåÅ·OÏ….ɤwO8ý,|Á”I0ɘ½Xºúåâ¾ýpóïÏ”7{0  På ¨¯ß¾´[×í‡ÇÖ]ûòæ±hÑÎ2tUž€º»¸¿yüWÁatGá'ÄR©béú¶õÏöUëëã}ë¶àˆº¶Øó³¹Ã,„ªTaõë—›¯ày"Qš z¼ùòQ„(*[í´Õlãæˆ5A8/œ>ãlŽJ2Òk7Iåç«…*((ŠŒó"д‡Âá8±»´½éše¶rê u¦‡|Ïmã1+Žø¿07¼ûw(Ï0‹ü‰4‚4‚4‚4’.˜þ.^»¬Ù#ÛmÈ %Ë ;L8@Ö»b™³Ç Åú ™™¤Œ\dµ5Icþƒ•òñGÈûú¦E¿Šr½0¢c»DvȸË{gÁ›Ìí¯“'ãÇ^R«ëã=»¿›vo“Ñ+z#mDµ‚ÔC¸/¬·G'5™Ûî—žymåÑ–X»ÒÓ®ü§²ÚÀ ‡['uëìîeHðºs)Ô¦Ô·¾øÝ¼Qì퓉ÅËš\2Ý †|‚|‚|Î'/»ÅÊšDòÙ ‡l‚lýé}'*yä9µÙ 0S‹†€B@! 7u3áÕ/›ÆËšLòÙd^ ^íÆ·5yäÉ«cE6x5xuìa…€B@!xu¼úëdÔê?p6¾4¹[ÖŒ’ñ^O¤°j°ê÷v¬Ô‘ëj´­q N N ƒ€A0j0êlV”‰˜(kÉãt<$ðiðé÷c?´……½é‘ F F ƒ€AðiðéÔ|záôزf“ÜÈEJ³³~߯½Ñë¸1Ž Ž€F@#Øv†lû×/¦û_È × ×ñÈõÓÈ´õÈ'–€€L0™òùÀÁSpçGsD‘BB@žAžc’g.RØ3ØóÁ³g`°ôô9aþp)ï”÷©Q/g»S2êìãX_©4ºä|\Nú}êì…F{æ}ú \ú°¸t±Ç;úº·ƒh@ÈÍ£ pÕã›ö}w”ÛG@ÛÜ,Ümmmûù=›ðñ„ƒ¸ AÜ@Ü@ÜŠÔÛ†ìyDìiÜ Ü Ü ò}ºt2±{Ôñ¶Y•øáY¾¿" ä—GCCCCRäq‡tïÓBAAÿ¶ ÷r‡÷‚½}‘«Â'âÅä®ß€³3ÊúÿõßÐüJv³V88n֎ǃ[cÇl—WpÃ7lqîz|ä=á xxxÛ®‹ì‚ÄA{GªkK„"-ëÁgW—åÝ2X8*ÀAà`™q‹ ¹wc%{ý…ŒÆ‹€ÅôóC¿*朗wŠ€$@ H$†õÆ6¹ð,ó¹Ø]–ç:½=Aðx<Î…¦*_Ht4¶_ìDd’Ô?o÷ìǬóíòà“ׂ¼÷íËmå´rå qµò$:-òŸw$\ÅìW[Ju«EQS[ŒÇj‡ÆLä„Yw´æÉi#Yw¼Ê;ÕºÑtb,Ôßš†0!ÉÆG½&©ºxW“ #™MjÑQ»Ë{‰ëdØ)ßÀ³ÙãÃpLj5«¾.©Z]o¾¾ÒØRs0ä›)’Ö\~%3¶‚ˆ[N%[›Yw1µÿ¢“÷.&‘mýk@!ÓTàNÆc‡Š¬9ÿÂÍÝÔœ>åfÊg- S/–ŠëSàq¹Ùyvȸ€îøfH_DhÛ[BµjfžBu9YýÁ0µ-Ó¦m‹Úƒp"ÛPêélp2ˆøÎk¨ˆe±ç¶óGŽVüŠYRäå—’ÂX—Y,táýgÖÞÏLôûÉlôMËŠ¶Ñ^I™Ôwžw?l挈Õî³0ÌxŸUúddZÓóêˆÙÌ“.­V\>µ¨OÎfU\±‰c ¦ò! %iA£±Ò„ÓKfõZËüc’ÐOÇÌšŽ˜3šÝD-ZmPªÆø3ïŸÑMq‰H¦óVÌ/Í/Ôz¢ÜìdR^¡ÄÍi¬oNº± ²ãŽM ·$U+¢'’âÊRc%½éÙøhq–—‚µ8³ËŽ=—ÈÔÏó2·èÀ1†²¶2=ª%ìä+gý°}ÚûÊÑ>ªœð*&Оü9“S_u%ÐÔ´º‚®J5¥Q÷çúz³¦å)1Ô$Õdqùµº&éµFãD“„;$ä˜#ÊI5B’î™b‚˜¬_¶ýÑJ6†[ÊŠÜâAc[a1bšìØ.…ÅhêIGÓï/¸†¤ šñ¶G lþÝÎm"Î6‰Òåcý³R]Agñ‰öÞ(°o½00O*&9Î*ö3Ý˲G]fÛ"{ªóå›ÊؽÀ8óuêÊë·Ûüý[%ø­¼üÛfèò†Z”^W×Òâ_M¤b=GЫÕ|]]÷tõº.éº*Þ©9ëê):OWךª‘Þíߌ®~I&½{ÁÐ6>°ª:Tu¨êoDUOÎò ªCT‡¨Q¢:DuˆêÕ!ª£¨þ‰Ž©Ý£vwºFP×Ó †!ÕãD—ê9ª ˆQ3NN5©n|¬yóñ¦oÒ8\}ݸ­Q6In¨ZÜbb€¶ªñž:£7•r™+æ1Uñm¿ƒbž±‰žCžÛÄqØsNI’|’üЬ®ï"ÉkåüÜy# E^Í_‘WE^V½Û«ùëñj~z¼èP}Éçk®Ç{çÞxgÁA‡=z<ôxèñÐã¡ÇC‡=z<ôø£Ñãk¥Ç+¯¯xKÎcó]¯¯!B<„øÃâåßjñõ „x9^öuxU å‰"p3g^ÎO…7¤e^V\…¿#ŽÉ§Ðà¡ÁCƒ‡ <4xhðÐà¡ÁCƒ‡ þh4øÆ!i𲤾,‰¯aI|¸˜QÌ__[.:½!¨ñPã¡ÆC‡5j<Ôx¨ñeUã#4ÙÉÈš^(oÊš§ŒnZ—“~Ÿ:k',[z±—g]['zÂôO™d²Õrf–Âs¿ülùüß´L>]gnƒ¤¼»™5ÓÍX\3ÑðyqÜv»l½£$6÷"oñ’HLÚ8Z†óÂéÃ0RýH2ÎkUü<µ0CqCBNé¦Fy‘ágÚCámœØ]ÚÞtÍ^QMgL08gzÈIe×#Žø¿0wIš_ŸBBBB6¦5ÖÖ$‹ùVÊÇO!ïë›ý*ÊmôˆŽíÉ!ã.ïo2·¿n2?ö’Z]ïùÛýÝ´{›Œnœ"DÛˆf;©ˆGû ëíÑIMæ¶;Ä¥gg^[Fy´%–þ4Fü±+ÿ©¼¾egNêÌ»N(Aç@ç@ç@ç@ç@ç@çvvÒ™ôî ß“®Ü}8;» Z³qxînjÒ§Ï×ßnÛ—ß>µï/?ñ±»ÁsöÞ†cG>õoŽ}õËÅ}ûáæßpìÃpì±tõ£°ð6\;â(íý9öÝÅýÍã¿àÕáÕ¢­þgãK“»ûaÌCæð7æÂ_[íÖuûá±u×¾¼y|€/„/÷_4z;i:Î)KûsôëÛÖ?ÛW­¯÷­[xy©´Ó?!žB<…xŠå4)rHkLí²¦Ž'fö>>pï÷^pïKiŽy)MИ¥õ4/ Ä¢š’M ¯,æRLÁèÀè0!Ü1wܸežz×  dC¯–O|AþH´ —_F­|‚®„$] Ë%¡4É”¼ì˜˜,‚–`Ü`Üé÷UÔ’l0n$0n0nìãã>–›`%ÇÄd°ããNϸ¿ÆÚUÚLÚ ÚýxàØeäØG‚ÛÃ0B BžPÏ;“F ““Æy- ×ÇN®ËˆI¢@ ® ®žk/œXÂ< Âã·@½A½_†õ2qÐgÐg™ÖT„³™;&]Z­¸|jQïª\±‰p,'…õ!5CNÄ LjÈË/=…µ.³D‹ÃyÃbÎÌÜû™~?™Ë´iûÙìñá¶)+=RR˺G‚!Ù"k hqCu¾|S»øgözýú¼ª…2Æš+Áååß*ÚjCCMÊ 1µ7˜uUR›Íæ‰,©/) 2åí%İÕuØêÀL`&0˜Y.̬/ÿ¶Qdêo25ɨ5´“SE%0óµ„m+hê’¬ÌNj5š@Ír¡¦±/Ô45›MU?9Õ€šË¨©E¢¦®Ï¨ Ôj5K†šÚ¾P³ööQSमÔON  æ2j¨iHzs6p@M &P¨Y2Ôl懚WÞºÁÀ”_³ž0ëú‰¡æ<Ë4N Eüý¨ÈuI­' Uª%LjÑ‘pǦN>ò D8¾¦Iªj¤÷{ßVTÞÐd©¶cµì1d¶:ònÓþÂ7†&á5ÙÖ¿f™s¦hîNÆc‡ºn{þ…›»©ùž€ÜLùëÝ-·SɱþÅPÌ.¥7ø[n#÷ìqþ½ñ­¾϶÷tãU+óÜ©'dÂÁ(µ}0·¨=gй ¥žÎ'ƒî¼.±,öÜqcþÈÑÊ~(VŽœ±oZV´~ðJI~sì‡Íœ±ö7xÁŸ$-h4Všpzɬ^«c™$McfMGÌÍn¢­6(Ucü 4Þ?£›â‘Kç­˜_š_¨õD¹Ù%þȤ¼B‰›ÓXßœtcdÇ›nIªV,DOqsâU-ÎòR°gvÙñ"í*™úy^æ8ÆP֚˯„£Í„u͹yáô{kG¯³®›ÑØ*xË«göìl¹ ?e·ùuÍf¸|ö¤¹ÿµ -½En³ÍkCj»ò6ψŠ8æ.ËÖŽý"…=îeÞãîÎSÆW2¢{ÜæîòÞYðv¹ã˜lñO "ñ-"¢D<Œs[cjãišH Ô Ô±u‡Lz÷„ï‡J_æe<y^”ç./¾}jú|}ñíö¤:)©.Ôs½{ëæ}>væ;W¢!"íÒ|ZË•¯~¹¸o?Üüûó‘ú°| >,ª dÏ1žyñß”ý¸ïÝÅýÍã¿Êw]ÎÆ—&w÷î¹y5$‹xlݵ/oà¾å¾ýO×.ʃ¯slK,'¾¾mý³}Õúúxߺ…—R[¾qˬ ySshCІb-憲œ \YÌ¥–‘> -#${`n¤Ü‹,‚,‚,‚ToæÕÒ-¢½Þ¬Âl¼T³ñ” wŠ #¦è˜¢§§ØWQ7ÅA±‘D@±A±±’<û8xvÙ!q÷N‚lƒl§'ÛKæ@µ‘B@µAµ±à,»ô,»ÜX¸CÜŒX-’»þ:µú‘kûA²‘JJ@²½ÏŽ•9Žc{˜vÙ˜öQàb(€n2ì+pz6w˜qÇÙ†¾<¾ ¾­Ô ÜGB¸w %"wú#>N.žˆi‘ŽEq62 æîH$»'’{Jz—Óòn%›Ø®9°i¯â­TG*A*Áô=ÃéûÈ}4G”Mø^&ïóØ6mŽ;f와!äkàðø ÿzb~9é÷©³wõúÓ¼)x¨TQx¨è¶þ*'oÖç)o“AÜÂQ}~?-ßãÖ´K«¶…p‰f˜qˆGÆÜ,rÔ™6ál?³ã­w|ruÒ¿þŸýWøi©˜Û?zÒ2ß(…> ¶¶–‡><ÝÓ Ôñ–>@î‚@ x7Hgz$n“‹€EÀ"`ñíÀâÃödùÃâÂm: +C€a‡A|âÐh4ÆCCî<ð}=§oëS€o‡ãJ |؉ àÛÒ+ìÄ΂8ßã´bägç˜ÄÙá.ˆ3ˆóáçˆ3€Ä9ïu"   $î\wÈÈȉ„»—å…eÍ!…çùÂ]‰…;ÆÅ…Œ‘7Š\õÐô²ÄYUÌ9/ÿ3¶ àðx<7”_ïDt4¶_¼z‘™¤þùp'ã±C˜áænj>)ÈÍ”Oy-Z@§^,×§Àãr³óìqÜî,ë¼;[!} mï ‘U+ó<ªËÉêF©íÖ¶¨=gÓ¹ ¥žÎ'ƒï¼.±,öÜ‘cþÈÑŠ?P¨#KмüRRë2‹….¼ÿáÌÚû™‰~?™¾iYÑ6úÁ+)›úÎóî‡Íœ±Ú}Fï³JŸŒLkz^1›¹cҥՊ˧õ Ú¬Š+6qLAW>¤A $-h4Všpzɬ^«c™$McfMGÌÍn¢­6(UcüY´÷Ï覸DäÒy+æ—æj=Qnv‰?2)¯Pâæ4Ö7'ÝØÙqǦ„[’ª ÑÉse©±’Þôl|´8ËKÁZœÙeÇ‹žPdêçy™[tàCY[™#Õvò•²~Ø>ó}¥hJ')4³´ü%Õ— ©ÙTÅ;½QAËQTP¤¦®êå®Ä,Cäê<˜? ,@Y€²eÊ”( P ,@Y€²eÊBé•UN«,(Šv¢ç)-(Ч*œè¾¶ ¨ªT«‹wyk iºG\hJ5Õ(‘žð•ñÖ˜ÚP $@I€’%á8•„~¿JBº~@I€’%J”( G£$(¬QЛ¹¯QÐþUÒuDîkôf~2BCÒ´º‘>¼IMáŽ8&ŸBR€¤I’$,NÀâH  )@R€¤I¡ô’‚š…¤PÏ_R¨Û¼5…z®›äF‰4„kÁš¯Dè:h…!B„  $@H€!B„ e´Lv9Ô ØåP›írФz½‘¿˜¦[1Ïe¬«‹ë”I Þ~‡kbZ´eÊ”( P°ë» ,@Y€²eÊ”…Ò+ z&ÊB³e¡1StÉ;6Q.BXhæºLA/ÓqŒ–°Ý›âˆ  &@L€˜1bĈ  &@L8 1ÁÈBLÈõÑ‘˜0{v¤¢6¤¦¦åÿôÈ4ÝŠ¥&R£QÖ'=|³½)¨ø'íáI’ 1@b€Ä‰$H  1@b€Äp4C-“õ Fëô—õ þójE,X0r]°P®>ÜSÒ{4G”M8äÈ  '@N€œ9räÈ  '@N(‹œð‰Ž©Ý£vwº )(/šB=µ¦ ×%U5¼…¹ž± Ì(ž˜ IªñQÌø%Ý7™pZ>¢œ„éÄHtÕefÃ×3Å”0Y>lûc´ûÈ­+×”zìrbˆ¶— D-ñóºÇ²‡A‡Ú“Q¬¡&¼~§lùNNÑ&2áÌa“ˆ0L>¡Ú¦¯‚ÒsÈs›8{Îi€|®¾7í[/ çó’IŽ'¾ígÆ8ÉpªÕe¶-R¹‡¡¡:_¾© ‰Ý ü€3KJ½Zyýú¼ª‡Æš+ÁUyùÇ¡#qCMÊ L‡¦ÆLcBÓ¦¢Æ.'Æ(Mµ•2€R@) PZ(­-ÿX+ J›‡¥uÌK£æ¥õxóÒ:À` 0˜– Lµ=ÍK5ùÐÀ´‰yiä¼´c^Ú”J¥€Ò²A©¾§y©¦”ʼTä4TN‰5)].$’I¤e@Rc_“ÒÔˆ­ëyƒhÍÛÀÔhân]—äƒŸŽ†mM9N‘(5×{¤®:»ãDΫý€N@çn=Ê:µ SÝtjŠÔÔêõ@Êt.Ag„t[S%­1;@' Ð è,t*û‚Ný ST¯Ï¥Û:5àf¤V[Ó$¥Y?b±¸ Ün–7•ÆF©7gÜ47 ÉÐg·õØÔ%3NQD‹k›Moè4 'È ä,r6ó›q~e"»„ÏkÔRŸ×hÔN45GÄ4 om‹¦ø§5Ê IÓë'š÷¬É·™ñ΂L1dqŽ‚X«6ë=m¢&5–;1’'¥¨ë²Rf#9ËÇ£…àèqH+¯GMVüSdD0ºRMºÃJ‡ri•‹»›ŠˆPÿ›¥veÄZé‡ö'–5}×£®9°iÏ/dŽÆb¸³ðÞ»¯é¢`Ov`ê‹AùeçÑå¤?³O]éÝõDêxfN*¦]‘%Cú.e1^aýJbû±O,“O½B}0ÝÅv¼U,Ú¶¤ÊãÐôËÙ¢Ná¨^°I•ÏVMúþ?'•ãÃ--žUónÂMËüA— ÎÚÐé¶ë ”ëwê=dÞtWZK¶8ËæcÝ–Á:ö¹_òº“ȳôîM ÅÈÚãSÕtF–³ðú´"i"Sjþ #±Õ£ì6Âi³¹§IL oØ+G§FÑò-V^€2Èe¢.É'œ8Éâ ÄUÒ1{o‘)u~~7{#þˆìöó»ÿô`òôlibserial-master/docs/user_manual/000077500000000000000000000000001500173340400175555ustar00rootroot00000000000000libserial-master/docs/user_manual/Makefile.am000066400000000000000000000151661500173340400216220ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/LibSerial.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/LibSerial.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/LibSerial" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/LibSerial" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." libserial-master/docs/user_manual/api_documentation.rst000066400000000000000000000011361500173340400240120ustar00rootroot00000000000000API Documentation ================= The API documentation generated by doxygen is available `here `_. To generate a new set of docs using Sphinx, simply run: .. code-block:: bash sphinx-build -b html docs/user_manual/ docs/html/ The Sphinx output will be located in the */libserial/docs/html/* directory. To generate a new set of doxygen documentation, you can run the compile.sh script or simply invoke doxygen directly: .. code-block:: bash doxygen doxygen.conf.in The doxygen output will be located in the */libserial/build/docs/html/* directory.libserial-master/docs/user_manual/conf.py000066400000000000000000000114051500173340400210550ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # LibSerial documentation build configuration file, created by # sphinx-quickstart on Sun Sep 17 10:46:50 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] # The master toctree document. master_doc = 'index' # General information about the project. project = u'LibSerial' copyright = u'2004-2018, LibSerial Development Team' title = u'LibSerial Documentation' author = u'LibSerial Development Team' description = u'LibSerial provides a convenient, object oriented approach to accessing serial ports on POSIX systems.' category = u'Serial Communication' library_name = u'LibSerial' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = u'1.0' # The full version, including alpha/beta/rc tags. release = u'1.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'LibSerialdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'LibSerial.tex', title, author, 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, library_name, title, author, 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, library_name, title, author, 'LibSerial', description, category), ] libserial-master/docs/user_manual/description.rst000066400000000000000000000042111500173340400226300ustar00rootroot00000000000000Description =========== LibSerial was created to simplify serial port programming on POSIX systems through a collection of object oriented C++ classes. The `SerialPort` class allows simplified access to serial port settings and usage through a convenient set of methods. This class is useful for embedded systems where a complete C++ STL may not be available. The `SerialStream` class allows access to serial ports in the same manner as standard C++ iostream objects. Methods are provided for setting serial port parameters such as baud rate, character size, flow control, etc. Here is short example using libserial: .. code-block:: c++ #include #include using namespace LibSerial; int main() { // Instantiate a Serial Port and a Serial Stream object. SerialPort serial_port; SerialStream serial_stream; // Open the hardware serial ports. serial_port.Open( "/dev/ttyUSB0" ); serial_stream.Open( "/dev/ttyUSB1" ); // Set the baud rates. serial_port.SetBaudRate( BaudRate::BAUD_115200 ); serial_stream.SetBaudRate( BaudRate::BAUD_115200 ); char write_byte_1 = 'a'; char write_byte_2 = 'b'; char read_byte_1 = 'A'; char read_byte_2 = 'B'; // Write a character. serial_port.Write(&write_byte_1, 1); serial_stream << write_byte_2; // Read a character. serial_port.Read(read_byte_1, 1); serial_stream >> read_byte_2; std::cout << "serial_port read: " << read_byte_1 << std::endl; std::cout << "serial_stream read: " << read_byte_2 << std::endl; // Close the Serial Port and Serial Stream. serial_port.Close(); serial_stream.Close(); } In addition to the C++ programming languge, LibSerial releases after version 0.6.0 also provide bindings to several scripting languages such as Python, Perl, PHP, Java, and Ruby. This provides developers a wide range languages to select when writing applications that need access to serial ports on POSIX compatible operating systems. LibSerial has received the most extensive testing on (Debian) Linux operating systems. libserial-master/docs/user_manual/design_documentation.rst000066400000000000000000000075631500173340400245240ustar00rootroot00000000000000Design Documentation ==================== LibSerial's Coding standards ---------------------------- Try to utilize these guidelines if you are contributing the LibSerial as a developer. Although we attempt to maintain these standards wherever practical, on occasion you might still discover a few deviations. Please familiarize yourselves with `C++ Core Guidelines `_ and try to follow these guidelines. LibSerial uses ISO standard C++ based on the C++14 standard. Use Doxygen style comments (with @ commands) for every: * Class * Data Member * Function * @brief command for every function * @param command (if not void) for every parameter * @return command (if not void) * File * @file command, (except @example files) * @copyright command Allman (BSD) indentation style Classes/Namespace/Structure/Enumeration names: CamelCase Class methods: CamelCase Class members: mCamelCase Arguments to methods/functions: camelCase (lower case first word) Naming Convention ----------------- Use CamelCase for Files, Classes, Namespace, Structures, Enumerations, Functions, Procedures, and Member Variables. Filenames are the name of the class or namespace within -- one class per file. Classes, Namespaces, Structures, Enumerations, and Functions start with a capitalized letter and are nouns: (e.g. SerialPort, SerialStream, etc.). Inhertied functions may be exceptions. Function names are a description of the return value, and Procedure names are a strong verb followed by an object. (See Code Complete 2 §7.6 for the difference between a function and a procedure verb.) Function arguments start with a lowercase letter and are nouns; (e.g. numberOfBytes, etc.) Member Variables start with a lowercase letter "m" and are nouns; (e.g. mFileDescriptor, etc.). Use underscores for non-member functions and local variables, lower case with an underscore to separate words; (e.g. lower_case, short_names). Constants and Globals are named identically to variables. Do not use abbreviations and be as precise and descriptive with naming as possible. Indentation ----------- Indentation shall be 4 space characters, not tabs. Braces shall begin and end on the indentation level. Namespaces are NOT indented. Case statements are NOT indented. Class visibility statements are NOT indented (public, protected, private). One statement per line -- this includes variable declarations. Do not put short if() ...; statements on one line. If the constructor initializers don't fit on a single line, put constructor initializer list items one per line, starting with the comma and aligned with the colon separator. For example: .. code-block:: c++ Class::Class() : var1(1) , var2(2) , var3(3) { ... } The purpose of this indentation policy, which can feel "incorrect" at times is to ensure that changes are isolated to the minimum number of lines. Our tools, (compilers, editors, diff viewers, and source code repository), all operate on a line-by-line basis. When someone makes a change that affects a portion anywhere in the line, the tools consider the entire line changed. This can lead to nasty issues like complex merge conflicts, or, worse, obscure the developer activity. Include Headers --------------- A good practice is to include headers in the order most local to least local and alphabetize your lists to avoid duplications. The purpose for this is to ensure that a proper dependency chain is maintained. As the project grows larger, these compilation failures sometimes can be difficult to identify and resolve. This means that header files have includes alphabetized in the order: * project includes * project dependency includes * system includes Source files have the includes in the order: * definition includes * project includes * project dependency includes * system includes libserial-master/docs/user_manual/download.rst000066400000000000000000000003441500173340400221170ustar00rootroot00000000000000Download ======== The latest version of LibSerial is 1.0.0. You can find the source code for LibSerial-1.0.0 `here `_. Older versions of LibSerial may also be found at the above site. libserial-master/docs/user_manual/feature_summary.rst000066400000000000000000000003571500173340400235240ustar00rootroot00000000000000Feature Summary =============== * Simplified serial port programming in C++ under POSIX operating systems. * Support for USB-serial converters. * Access serial ports from scripting languages such as PHP, Python, Perl, Ruby, and Java. libserial-master/docs/user_manual/index.rst000066400000000000000000000011001500173340400214060ustar00rootroot00000000000000.. LibSerial documentation master file, created by sphinx-quickstart on Sun Sep 17 10:46:50 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to LibSerial's documentation! ===================================== Contents: .. toctree:: :maxdepth: 2 :caption: Contents: feature_summary description download install tutorial api_documentation design_documentation links Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` libserial-master/docs/user_manual/install.rst000066400000000000000000000024141500173340400217560ustar00rootroot00000000000000Install ======= To install LibSerial the current release package on many Linux distributions you may simply use the package manager associated with your distribution: For Debian distrbutions: .. code-block:: bash sudo apt install libserial-dev For Arch Linux distributions: .. code-block:: bash sudo pacman -S libserial-dev To install LibSerial from source, first clone the repository at https://github.com/crayzeewulf/libserial Using https: .. code-block:: bash git clone https://github.com/crayzeewulf/libserial.git Using ssh: .. code-block:: bash git clone git@github.com:crayzeewulf/libserial.git Next, using make, execute the following commands from your libserial directory: .. code-block:: bash make -F Makefile.dist ./configure make To install the build to your /usr/local/ directory your may simply: .. code-block:: bash sudo make install To install to another directory, simply use the *prefix* argument in the configure step above: .. code-block:: bash ./configure --prefix= The code is also easily built using `CMake` via a bash script: .. code-block:: bash ./compile.sh To install, change directories to the build directory and proceed as with make: .. code-block:: bash cd build/ sudo make installlibserial-master/docs/user_manual/links.rst000066400000000000000000000002431500173340400214260ustar00rootroot00000000000000Links ===== `LibSerial-1.0.0rc1 `_ `Documentation `_ libserial-master/docs/user_manual/tutorial.rst000066400000000000000000000124241500173340400221550ustar00rootroot00000000000000Tutorial ======== Opening a Serial Port I/O Stream -------------------------------- A serial port instance, SerialPort, or an I/O stream instance, SerialStream, can be created and opened by providing the name of the serial port device to the constructor: .. code-block:: c++ #include #include using namespace LibSerial ; // Create and open the serial port for communication. SerialPort my_serial_port( "/dev/ttyS0" ); SerialStream my_serial_stream( "/dev/ttyUSB0" ) ; In certain applications, the name of the serial port device may not be known when the SerialStream instance is created. In such cases, the same effect as above can be achieved as follows: .. code-block:: c++ // Create a object instance. SerialPort my_serial_port; SerialStream my_serial_stream; // Obtain the serial port name from user input. std::cout << "Please enter the name of the serial device, (e.g. /dev/ttyUSB0): " << std::flush; std::string serial_port_name; std::cin >> serial_port_name; // Open the serial port for communication. my_serial_port.Open( serial_port_name ); my_serial_stream.Open( serial_port_name ); Setting the Baud Rate --------------------- The baud rate for the SerialStream can be set using the SerialStream::SetBaudRate() member function. .. code-block:: c++ // Set the desired baud rate using a SetBaudRate() method call. // Available baud rate values are defined in SerialStreamConstants.h. my_serial_port.SetBaudRate( BAUD_115200 ); my_serial_stream.SetBaudRate( BAUD_115200 ); Setting the Character Size -------------------------- .. code-block:: c++ // Set the desired character size using a SetCharacterSize() method call. // Available character size values are defined in SerialStreamConstants.h. my_serial_port.SetCharacterSize( CHAR_SIZE_8 ); my_serial_stream.SetCharacterSize( CHAR_SIZE_8 ); Setting the Flow-Control Type ----------------------------- .. code-block:: c++ // Set the desired flow control type using a SetFlowControl() method call. // Available flow control types are defined in SerialStreamConstants.h. my_serial_port.SetFlowControl( FLOW_CONTROL_HARD ); my_serial_stream.SetFlowControl( FLOW_CONTROL_HARD ); Setting the Parity Type ----------------------- .. code-block:: c++ // Set the desired parity type using a SetParity() method call. // Available parity types are defined in SerialStreamConstants.h. my_serial_port.SetParity( PARITY_ODD ); my_serial_stream.SetParity( PARITY_ODD ); Setting the Number of Stop Bits ------------------------------- .. code-block:: c++ // Set the number of stop bits using a SetNumOfStopBits() method call. // Available stop bit values are defined in SerialStreamConstants.h. my_serial_port.SetStopBits( STOP_BITS_1 ) ; my_serial_stream.SetStopBits( STOP_BITS_1 ) ; Reading Characters ------------------ Characters can be read from serial port instances using Read(), ReadByte(), and Readline() methods. For example: .. code-block:: c++ // Read one character from the serial port within the timeout allowed. int timeout_ms = 25; // timeout value in milliseconds char next_char; // variable to store the read result my_serial_port.ReadByte( next_char, timeout_ms ); my_serial_stream.read( next_char ); Characters can be read from serial streams using standard iostream operators. For example: .. code-block:: c++ // Read one character from the serial port. char next_char; my_serial_stream >> next_char; // You can also read other types of values from the serial port in a similar fashion. int data_size; my_serial_stream >> data_size; Other methods of standard C++ iostream objects could be used as well. For example, one can read characters from the serial stream using the get() method: .. code-block:: c++ // Read one byte from the serial port. char next_byte; my_serial_stream.get( next_byte ); Writing Characters ------------------ .. code-block:: c++ // Write a single character to the serial port. my_serial_port.WriteByte( 'U' ); my_serial_stream << 'U' ; // You can easily write strings. std::string my_string = "Hello, Serial Port." my_serial_port.Write( my_string ); my_serial_stream << my_string << std::endl ; // And, with serial stream objects, you can easily write any type // of object that is supported by a "<<" operator. double radius = 2.0 ; double area = M_PI * 2.0 * 2.0 ; my_serial_stream << area << std::endl ; Reading Blocks of Data ---------------------- .. code-block:: c++ // Read a whole array of data from the serial port. const int BUFFER_SIZE = 256; char input_buffer[BUFFER_SIZE]; my_serial_port.Read( input_buffer, BUFFER_SIZE ); my_serial_stream.read( input_buffer, BUFFER_SIZE ); Writing Blocks of Data ---------------------- .. code-block:: c++ // Write an array of data from the serial port. const int BUFFER_SIZE = 256; char output_buffer[BUFFER_SIZE]; for( int i=0; i