aboutsummaryrefslogtreecommitdiff
path: root/flow-samples
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2014-04-08 09:42:39 +0200
committerJakob Odersky <jodersky@gmail.com>2014-04-08 09:42:39 +0200
commit3269612192e1e748fadc6c2124f28d13da7ed579 (patch)
tree65d9f47fcf4cfba9b9a266f52bec7e7a46351aa0 /flow-samples
parent916730f538b8f01da5c5a0b040a99a73b2c6a694 (diff)
downloadakka-serial-3269612192e1e748fadc6c2124f28d13da7ed579.tar.gz
akka-serial-3269612192e1e748fadc6c2124f28d13da7ed579.tar.bz2
akka-serial-3269612192e1e748fadc6c2124f28d13da7ed579.zip
remove broadcast example
Diffstat (limited to 'flow-samples')
-rw-r--r--flow-samples/flow-samples-broadcast/src/main/scala/com/github/jodersky/flow/samples/broadcast/Main.scala51
1 files changed, 0 insertions, 51 deletions
diff --git a/flow-samples/flow-samples-broadcast/src/main/scala/com/github/jodersky/flow/samples/broadcast/Main.scala b/flow-samples/flow-samples-broadcast/src/main/scala/com/github/jodersky/flow/samples/broadcast/Main.scala
deleted file mode 100644
index 5d37021..0000000
--- a/flow-samples/flow-samples-broadcast/src/main/scala/com/github/jodersky/flow/samples/broadcast/Main.scala
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.github.jodersky.flow.samples.broadcast
-
-import com.github.jodersky.flow.SerialSettings
-import com.github.jodersky.flow.internal.SerialConnection
-import com.github.jodersky.flow.Parity
-import java.nio.ByteBuffer
-import scala.concurrent._
-import scala.concurrent.ExecutionContext.Implicits.global
-import scala.util.Failure
-
-object Main {
-
- def ask(label: String, default: String) = {
- print(s"${label} [${default}]: ")
- val in = Console.readLine()
- println("")
- if (in.isEmpty) default else in
- }
-
- def main(args: Array[String]): Unit = {
- val port = ask("Device", "/dev/ttyACM0")
- val baud = ask("Baud rate", "115200").toInt
- val cs = ask("Char size", "8").toInt
- val tsb = ask("Use two stop bits", "false").toBoolean
- val parity = Parity(ask("Parity (0=None, 1=Odd, 2=Even)", "0").toInt)
-
- val settings = SerialSettings(baud, cs, tsb, parity)
-
- println("Opening...")
-
- SerialConnection.debug(true)
- val c = SerialConnection.open(port, settings)
-
- val buffer = ByteBuffer.allocate(1024)
-
- val read = future {
- c.read(buffer)
- }.onFailure{
- case ex => println(ex)
- }
-
- println("Opened")
- Console.readLine()
-
- c.close()
-
- //val system = ActorSystem("flow")
- //val terminal = system.actorOf(Terminal(settings), name = "terminal")
- //system.registerOnTermination(println("Stopped terminal system."))
- }
-} \ No newline at end of file