aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--project/Build.scala4
-rw-r--r--samples/arduino/README1
-rw-r--r--samples/rwc/README1
-rw-r--r--samples/rwc/src/main/scala/com/github/jodersky/flow/example/Main.scala (renamed from samples/src/main/scala/com/github/jodersky/flow/example/Main.scala)4
-rw-r--r--samples/rwc/src/main/scala/com/github/jodersky/flow/example/SerialHandler.scala (renamed from samples/src/main/scala/com/github/jodersky/flow/example/SerialHandler.scala)0
6 files changed, 7 insertions, 5 deletions
diff --git a/README.md b/README.md
index 8c4448d..8897e00 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Since hardware is involved in serial communication, a Scala-only solution is not
## Build & usage
Run sbt in the root directory and switch to project 'flow', by typing 'project flow'. Running 'package' will compile both Scala and native sources and bundle them in the standard jar file. When using the jar in another application, the native library will be automatically extracted and loaded (i.e. no -Djava.library.path or other system parameters have to be set).
-To see an example, switch to project 'flow-samples' and then type 'run'. Don't forget to connect a serial device (such as an arduino) before runinng the example.
+To see an example, switch to project 'flow-rwc' and then type 'run'. Don't forget to connect a serial device (such as an arduino) before runinng the example.
The build currently only works on Linux.
diff --git a/project/Build.scala b/project/Build.scala
index a0f0baa..4026ba7 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -31,8 +31,8 @@ object FlowBuild extends Build {
) ++ Jni.defaultSettings)
lazy val samples = Project(
- id = "flow-samples",
- base = file("samples"),
+ id = "flow-rwc",
+ base = file("samples") / "rwc",
settings = buildSettings ++ runSettings ++ Seq(libraryDependencies ++= Dependencies.all)).dependsOn(main)
lazy val buildSettings = Defaults.defaultSettings ++ Seq(
diff --git a/samples/arduino/README b/samples/arduino/README
new file mode 100644
index 0000000..64c8a5c
--- /dev/null
+++ b/samples/arduino/README
@@ -0,0 +1 @@
+Code to run on an arduino for serial communication testing.
diff --git a/samples/rwc/README b/samples/rwc/README
new file mode 100644
index 0000000..843e38d
--- /dev/null
+++ b/samples/rwc/README
@@ -0,0 +1 @@
+This sample tests a read(loop)-write-close procedure.
diff --git a/samples/src/main/scala/com/github/jodersky/flow/example/Main.scala b/samples/rwc/src/main/scala/com/github/jodersky/flow/example/Main.scala
index 021f638..0a38618 100644
--- a/samples/src/main/scala/com/github/jodersky/flow/example/Main.scala
+++ b/samples/rwc/src/main/scala/com/github/jodersky/flow/example/Main.scala
@@ -27,7 +27,7 @@ object Main {
val baud = 115200
low.Serial.debug(true)
-
+
implicit val system = ActorSystem("flow")
val serial = system.actorOf(Props(classOf[SerialHandler], port, baud), name = "serial-handler")
@@ -37,7 +37,7 @@ object Main {
readLine()
serial ! "close"
readLine()
+
system.shutdown()
-
}
} \ No newline at end of file
diff --git a/samples/src/main/scala/com/github/jodersky/flow/example/SerialHandler.scala b/samples/rwc/src/main/scala/com/github/jodersky/flow/example/SerialHandler.scala
index 2f7dfc3..2f7dfc3 100644
--- a/samples/src/main/scala/com/github/jodersky/flow/example/SerialHandler.scala
+++ b/samples/rwc/src/main/scala/com/github/jodersky/flow/example/SerialHandler.scala