aboutsummaryrefslogtreecommitdiff
path: root/scala/ace/src/main/scala/com/github/jodersky/ace/serial/Serial.scala
blob: b688ec886deb7b6816f5fa6a405be4b5dda1a55e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package com.github.jodersky.ace.serial

import com.github.jodersky.ace.protocol.ReactiveLayer

trait Serial extends ReactiveLayer[Nothing, Seq[Int]] {
  protected def receive(nothing: Nothing) = throw new UnsupportedOperationException("A receive function cannot be called on the lowest layer.")
  
  def begin(): Unit
  def close(): Unit
  
}

object Serial {
  def open(port: String, baudRate: Int)(implicit provider: SerialProvider) = provider.open(port, baudRate)
}