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
28
29
30
31
32
33
34
35
36
37
38
39
40
use Duration;
use serial_core as serial;
use *;
/// Configures the given serial port appropriately for use with Luminator signs.
///
/// Specifically, the signs require 8N1 format at 19200 baud. Also sets the provided timeout value.
///
/// # Errors
///
/// Returns the underlying [`serial_core::Error`] if configuration fails.
///
/// # Examples
///
/// ```no_run
/// use std::time::Duration;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// #
/// let mut port = serial::open("COM3")?;
/// flipdot_serial::configure_port(&mut port, Duration::from_secs(5))?;
/// // Now ready for communication with a sign (8N1 19200 baud).
/// #
/// # Ok(()) }
/// ```