aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2015-09-09 13:35:10 +0200
committerJakob Odersky <jodersky@gmail.com>2015-09-12 22:37:15 +0200
commit66ebda90a80f7429ca34b6cce2826a6b132d77f0 (patch)
tree8078bee5ab17e255f7c3e214ae11904a9b0ff2aa /README.md
parent9b25ed521ad6ae7c54b83e47175b5589dae255cd (diff)
downloadakka-serial-66ebda90a80f7429ca34b6cce2826a6b132d77f0.tar.gz
akka-serial-66ebda90a80f7429ca34b6cce2826a6b132d77f0.tar.bz2
akka-serial-66ebda90a80f7429ca34b6cce2826a6b132d77f0.zip
update documentation
Diffstat (limited to 'README.md')
-rw-r--r--README.md52
1 files changed, 16 insertions, 36 deletions
diff --git a/README.md b/README.md
index afde776..beea949 100644
--- a/README.md
+++ b/README.md
@@ -10,41 +10,10 @@ Serial communication library for Scala, designed to be reactive, lightweight and
- Portable to POSIX systems
- Watchable ports: react to connection of new devices
-## Getting Started
-Flow uses sbt as build system. To get started, include a dependency to flow in your project:
-
- libraryDependencies += "com.github.jodersky" %% "flow" % "2.2.2"
-
-### Including Native Library
-*NOTICE: flow uses native libraries to back serial communication, therefore before you can run any application depending on flow you must include flow's native library! To do so, you have two options.*
-
-#### The easy way
-In case your OS/architecture combination is present in the below table, add a second dependency to your project:
-
- libraryDependencies += "com.github.jodersky" % "flow-native" % "2.2.2"
-
-| OS | Architecture | Notes |
-|-------------------|-----------------------------|---------------------------------------------------------------------------------|
-| Linux | x86<br/>x86_64<br/>ARM (v7) | A user accessing a serial port will probably need to be in the `dialout` group. |
-| Mac OS X | x86_64 | |
-
-This will add a jar to your classpath containing native libraries for various platforms. At run time, the correct library for the current platform is selected, extracted and loaded. This solution enables running applications seamlessly, as if they were pure JVM applications. However, since the JVM does not enable full determination of the current platform (only OS and rough architecture are known), only a couple of platforms can be supported through this solution at the same time.
-
-#### Maximum portability
-Do not include the second dependency above. Instead, for every end-user application that relies on flow, manually add the native library for the current platform to the JVM's library path. This can be achieved through various ways, notably:
-- Per application:
- Run your program with the command-line option ```-Djava.library.path=".:<folder containing libflow.so>"```. E.g. ```java -Djava.library.path=".:/home/<folder containing libflow.so>" -jar your-app.jar```
-
-- System- or user-wide:
- - Copy the native library to a place that is on the default java library path and run your application normally. Such places usually include /usr/lib and /usr/local/lib.
- - Use a provided installer (currently debian archive and mac .pkg, available in releases)
-
-The native library can either be obtained by building flow (see section Build) or by taking a pre-compiled one, found in releases in the github project. Native libraries need to be of major version 3 to work with this version of flow.
-
-It is recommended that you use the first option only for testing purposes or end-user applications. The second option is recomended for libraries, since it leaves more choice to the end-user.
-
## Usage
-See [Documentation](Documentation/README.md) for a guide on flow. For the impatient, here is a quick example.
+See [Documentation](Documentation/README.md) for a guide on flow.
+
+For the impatient, here is a quick example.
```scala
import akka.actor.{Actor, ActorLogging, ActorRef, Props, Terminated}
@@ -100,17 +69,28 @@ class Terminal(port: String, settings: SerialSettings) extends Actor with ActorL
}
object Terminal {
- def apply(port: String, settings: SerialSettings) = Props(classOf[Terminal], port, settings)
+ def apply(port: String, settings: SerialSettings) =
+ Props(classOf[Terminal], port, settings)
}
```
-More examples on flow's usage are located in the flow-samples directory. The examples may be run with sbt: `samples-<sample_name>/run`.
+More examples on flow's usage are located in the `flow-samples` directory. The examples may be run with sbt: `flow-samples-<sample_name>/run`.
Since flow integrates into the Akka-IO framework, a good resource on its general design is the framework's [documentation](http://doc.akka.io/docs/akka/2.3.13/scala/io.html).
## Native side
Since hardware is involved in serial communication, a Scala-only solution is not possible. Nevertherless, the native code is kept simple and minimalistic with the burden of dealing with threads left to Scala. The code aims to be POSIX compliant and therefore easily portable.
+## Directory Structure
+```
+flow/
+├── Documentation Documentation files.
+├── flow-main Main scala source files.
+├── flow-native C sources used to back serial communication.
+├── flow-samples Runnable example projects.
+└── project SBT configuration.
+```
+
## Build
See detailed documentation in [Documentation/building.md](Documentation/building.md) on how to build and install flow.