blob: 9b03ba0100bf70a865f392184c0e653c2bdea599 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package com.github.jodersky.flow
import akka.io._
import akka.actor.ExtensionKey
import akka.actor.Props
import akka.actor.ActorRef
import akka.util.ByteString
/** Defines messages used by serial IO layer. */
object Serial extends ExtensionKey[SerialExt] {
trait Command
trait Event
case class Open(handler: ActorRef, port: String, baud: Int) extends Command
case class Opened(port: String) extends Event
case class OpenFailed(port: String, reason: Throwable) extends Event
case class Received(data: ByteString) extends Event
case class Write(data: ByteString, ack: Boolean = false) extends Command
case class Wrote(data: ByteString) extends Event
case object Close extends Command
case object Closed extends Event
}
|