Commit 7000a079fbbc041989f6243c09474956a80c0836

Authored by Geoffrey Hunter
1 parent 3aa966ca

Fixed the incorrect build commands in the README. Changed the README from reStru…

…cturedText to markdown.
Showing 2 changed files with 98 additions and 64 deletions
README.md 0 → 100644
  1 +# CppLinuxSerial
  2 +
  3 +Serial port library written in C++
  4 +
  5 +[![Build Status](https://travis-ci.org/gbmhunter/CppLinuxSerial.svg?branch=master)](https://travis-ci.org/gbmhunter/CppLinuxSerial)
  6 +
  7 +## Description
  8 +
  9 +Library for communicating with COM ports on a Linux system.
  10 +
  11 +Uses fstream to the file I/O.
  12 +
  13 +## Installation
  14 +
  15 +### Linux, MacOS, Windows
  16 +
  17 +1. Make sure you have `cmake` installed.
  18 +
  19 +1. Clone the git repo onto your local storage.
  20 +
  21 +1. Change into root repo directory:
  22 +
  23 + ```
  24 + $ cd CppLinuxSerial
  25 + ```
  26 +
  27 +1. Create a new build directory and change into it:
  28 +
  29 + ```bash
  30 + $ mkdir build
  31 + $ cd build
  32 + ```
  33 +
  34 +1. Run cmake on the parent directory to generate makefile:
  35 +
  36 + ```bash
  37 + $ cmake ..
  38 + ```
  39 +
  40 +1. Run make on the generated makefile to generate the static library `libCppLinuxSerial.a` and an unit test executable:
  41 +
  42 + ```bash
  43 + $ make
  44 + ```
  45 +
  46 +1. To install the headers on your system:
  47 +
  48 + ```bash
  49 + $ sudo make install
  50 + ```
  51 +
  52 +1. To run the unit tests (NOTE: because this uses virtual serial ports via `stty`, this only works on Linux!):
  53 +
  54 + ```bash
  55 + $ make run_unit_tests
  56 + ```
  57 +
  58 + If you get errors such as `Could not open device /dev/ttyS10. Is the device name correct and do you have read/write permission?" thrown in the test fixture's constructor.`, it is probably an issue with either creating the virtual serial ports or permissions to access them.
  59 +
  60 +
  61 +## Dependencies
  62 +
  63 +The following table lists all of the libraries dependencies.
  64 +
  65 +<table>
  66 + <thead>
  67 + <tr>
  68 + <td>Dependency</td>
  69 + <td>Comments</td>
  70 + </tr>
  71 + </thead>
  72 + <tbody>
  73 + <tr>
  74 + <td>C++14</td>
  75 + <td>C++14 used for strongly typed enums, `std::chrono` and literals.</td>
  76 + </tr>
  77 + <tr>
  78 + <td>stdio.h</td>
  79 + <td>snprintf()</td>
  80 + </tr>
  81 + <tr>
  82 + <td>stty</td>
  83 + <td>Used in unit tests to verify the serial port is configured correctly.</td>
  84 + </tr>
  85 + </tbody>
  86 +</table>
  87 +
  88 +## Issues
  89 +
  90 +See GitHub Issues.
  91 +
  92 +## FAQ
  93 +
  94 +1. My code stalls when calling functions like `SerialPort::Read()`. This is probably because the library is set up to do a blocking read, and not enough characters have been received to allow `SerialPort::Read()` to return. Use `SerialPort::SetNumCharsToWait()` to determine how many characters to wait for before returning (set to 0 for non-blocking mode).
  95 +
  96 +## Changelog
  97 +
  98 +See CHANGELOG.md.
0 99 \ No newline at end of file
... ...
README.rst deleted
1   -==============
2   -CppLinuxSerial
3   -==============
4   -
5   -----------------------------------
6   -Serial port library written in C++
7   -----------------------------------
8   -
9   -.. image:: https://travis-ci.org/gbmhunter/CppLinuxSerial.svg?branch=master
10   - :target: https://travis-ci.org/gbmhunter/CppLinuxSerial
11   -
12   -.. role:: bash(code)
13   - :language: bash
14   -
15   -Description
16   -===========
17   -
18   -Library for communicating with COM ports on a Linux system.
19   -
20   -Uses fstream to the file I/O.
21   -
22   -Installation
23   -============
24   -
25   -1. Clone the git repo onto your local storage.
26   -
27   -2. Run `make all` to compile and run unit tests. Do not worry about error messages being printed when unit tests are run, the unit tests are designed to specifically cause errors to test the response.
28   -
29   -3. To include serial-port-cpp into your embedded (or otherwise) firmware/software project, copy the repo into your project folder (or other suitable place), include the file "/api/SerialPortApi.hpp" from your C++ code, and make sure to compile all the files within "/src/".
30   -
31   -
32   -Dependencies
33   -============
34   -
35   -The following table lists all of the libraries dependencies.
36   -
37   -====================== ======================================================================
38   -Dependency Comments
39   -====================== ======================================================================
40   -C++14 C++14 used for strongly typed enums, std::chrono and literals.
41   -<stdio.h> snprintf()
42   -stty Used in unit tests to verify the serial port is configured correctly.
43   -====================== ======================================================================
44   -
45   -Issues
46   -======
47   -
48   -See GitHub Issues.
49   -
50   -Usage
51   -=====
52   -
53   -Nothing here yet...
54   -
55   -FAQ
56   -===
57   -
58   -1. My code stalls when calling functions like :code:`SerialPort::Read()`. This is probably because the library is set up to do a blocking read, and not enough characters have been received to allow :code:`SerialPort::Read()` to return. Use :code:`SerialPort::SetNumCharsToWait()` to determine how many characters to wait for before returning (set to 0 for non-blocking mode).
59   -
60   -
61   -Changelog
62   -=========
63   -
64   -See CHANGELOG.md.
65 0 \ No newline at end of file