Expand description
Communication with devices running Spade.
Issues commands to a device running Spade over a provided serial port. It can be used to upload games and check if the device is running a legacy Spade version. This crate is not thread safe.
First, get a Read + Write
r for the serial port connected to the device.
You can do this by using the
serialport crate; this example uses
the device at /dev/cu.usbmodem14101
.
use std::time::Duration;
let mut port = serialport::new("/dev/cu.usbmodem14101", 115200)
.timeout(Duration::from_millis(1000))
.open()?;
Then, pass it to methods in this crate.
let legacy = spade_serial::is_running_legacy(&mut port).unwrap_or(false);
Enums§
- Upload
Error - Represents the possible communication errors while trying to upload a game
with
spade_serial::upload_game
. - Upload
Result - Represents the possible responses from the device following an UPLOAD command, given the serial communication was successful.
Functions§
- is_
running_ legacy - Checks if the device is running a legacy Spade version.
- upload_
game - Uploads a game to a device running Spade.