Skip to content

Commit

Permalink
* updated README with source path descriptions
Browse files Browse the repository at this point in the history
* updated xmodem receiver states to match diagram
  • Loading branch information
caseykelso committed Apr 18, 2017
1 parent 2c2d33a commit c88838b
Show file tree
Hide file tree
Showing 11 changed files with 367 additions and 260 deletions.
85 changes: 77 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Setup Environment - Ubuntu 16.10
sudo apt-get install build-essential socat lrzsz minicom ant git libgtest-dev cmake
```

Build and install libXMODEM
Build and install libXMODEM
--------------------------------
```bash
git clone [email protected]:caseykelso/xmodem.git
Expand All @@ -22,7 +22,7 @@ make install -j8
```

# Development
For developers looking to extend, bug fix, build, and test libXMODEM with dependencies and test infrastructure included in the source tree.
For developers looking to extend, bug fix, build, and test libXMODEM with dependencies and test infrastructure included in the source tree. The complete source tree grabs third party repos, standalone command line application code, serial port lib, and gtest.

Setup Environment - OSX
------------------------
Expand Down Expand Up @@ -76,7 +76,7 @@ make
```

Build Library - Bare Metal
--------------------------
--------------------------
TBD

# Tests
Expand All @@ -89,7 +89,11 @@ Build & Run Unit Tests
ant tests
```

Unit testing is implemented with Google's GTest.
## High-level Tests
Open a terminal
```bash
ant tests_system
```

### Transmit State Machine
All transitions are covered via unit tests.
Expand All @@ -101,9 +105,74 @@ All transitions are covered via unit tests.

<img src="documentation/xmodem_receive_fsm.png" />

## High-level Tests
Open a terminal

# Project Structure
## Source Directories
* /source - libxmodem source directory
* xmodem.h - common header (transmitter and receiver)
* xmodem.c - common implementation (transmitter and receiver)
* xmodem_receiver.h - receiver side header
* xmodem_receiver.c - receiver side implementation
* xmodem_transmitter.h - transmitter side header
* xmodem_transmitter.c - transmitter side implementation


* /app - application level source directory
* CMakeLists.txt - cmake build configuration for the commandline app
* main.cpp - main application source code file
* serialport.cpp - thin abstraction for asio serialport
* serialport.h - header for thin abstraction for asio serialport


* /tests
* CMakeLists.txt - cmake build configuration for the test runner
* test.cpp - libxmodem test implementation
* XModemTests.cpp - gtest test suite (implementation is in header)
* XModemTests.h - gtest test suite definition and SetUp() TearDown() implementation


* /tests.tmp - temporary folder for test files and virtual serial port nodes


* /
* build.xml - ant build configuration for aggregate project (only used for standalone dev purposes not integration). Allows for easy development in Linux, OSX, and Windows
* CMakeLists.txt - libxmodem cmake build configuration, used for integrators who wish to clone just the libxmodem source tree without using git-repo for aggregation.
* README.md - this file
* xmodem.xml - git-repo manifest definition to aggregate all project dependencies for libxmodem development purposes
* .gitignore - definitions of files and directories to be ignored by git


## Third Party Source Directories
* /asio - boost asynchronous IO standalone implementation
* /cmake - latest cmake build tool - tip of master branch
* /docopt - library for commandline switches
* /gtest - google test library

## Build Directories
* build - libxmodem library build directory
* build.app - application build directory
* build.docopt - libdocopt build directory
* build.tests - unit test runner build directory
* build.gtest - google test build directory

# Commandline Application Usage
```bash
ant tests_system
nanoXmodem:

Usage:
x --port=<port> --receive --file=<filename> [--baud=<baudrate>]
x --port=<port> --transmit --file=<filename> [--baud=<baudrate>]
x --enumerate
x (-h | --help)
x --version

Options:
-h --help Show this screen.
--version Show version.
--port=<comport> Path to comport.
--baud=<baudrate> Baudrate [default: 115200].
--receive Start transfer as receiver.
--transmit Start file transmission.
--enumerate Enumerate list of available ports.
--file=<filename> File to send.
```

Binary file modified documentation/xmodem_receive_fsm.pdf
Binary file not shown.
Binary file modified documentation/xmodem_receive_fsm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c88838b

Please sign in to comment.