diff options
Diffstat (limited to 'scala/jssc/src/test/scala/com/github/jodersky/ace/jssc/test/Main.scala')
-rw-r--r-- | scala/jssc/src/test/scala/com/github/jodersky/ace/jssc/test/Main.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scala/jssc/src/test/scala/com/github/jodersky/ace/jssc/test/Main.scala b/scala/jssc/src/test/scala/com/github/jodersky/ace/jssc/test/Main.scala new file mode 100644 index 0000000..5251ce8 --- /dev/null +++ b/scala/jssc/src/test/scala/com/github/jodersky/ace/jssc/test/Main.scala @@ -0,0 +1,28 @@ +package com.github.jodersky.ace.jssc.test + +import com.github.jodersky.ace.Arq; +import com.github.jodersky.ace.Framer; +import com.github.jodersky.ace._ +import com.github.jodersky.ace.jssc._ +import scala.concurrent.ExecutionContext.Implicits.global +import _root_.jssc.SerialPort + + +object Main { + + def main(args: Array[String]): Unit = { + val serial = new Serial("/dev/ttyACM0") + val framer = new Framer + val arq = new Arq(200) + val app = new SimpleActionLayer((s: Seq[Int]) => println(s)) + + serial connect framer connect arq connect app + serial.begin() + + while (true) { + app.send(Console.readLine.getBytes().map(_.toInt)).map(sent => Console.println("> " + sent)) + } + + } + +}
\ No newline at end of file |