Unifying improv packet names
This commit is contained in:
@@ -11,7 +11,7 @@ use hex;
|
||||
use improv_setup::improv::{
|
||||
RawPacket,
|
||||
ImprovPacket,
|
||||
RequestCurrentStateCommand,
|
||||
RequestCurrentStatePacket,
|
||||
RequestDeviceInformationPacket,
|
||||
};
|
||||
use improv_setup::serial;
|
||||
@@ -120,7 +120,7 @@ async fn main() -> Result<()>{
|
||||
Commands::Device {path, baud_rate, device_command} => {
|
||||
match &device_command.clone().unwrap_or_default() {
|
||||
DeviceCommands::State => {
|
||||
let request_current_state_packet = RequestCurrentStateCommand {};
|
||||
let request_current_state_packet = RequestCurrentStatePacket {};
|
||||
|
||||
let mut serial_interface = serial::SerialInterface::new(path, *baud_rate).context("Couldn't init serial interface")?;
|
||||
|
||||
@@ -129,7 +129,7 @@ async fn main() -> Result<()>{
|
||||
let result_bytes = serial_interface.recv_bytes().context("Couldn't receive any improv packet")?;
|
||||
let raw_packet = RawPacket::try_from_bytes(&result_bytes).context("Failed to deserialize packet")?;
|
||||
|
||||
if let ImprovPacket::CurrentStateResponse(current_state_response) = ImprovPacket::try_from_raw_packet(&raw_packet).context("Failed to read packet")? {
|
||||
if let ImprovPacket::CurrentState(current_state_response) = ImprovPacket::try_from_raw_packet(&raw_packet).context("Failed to read packet")? {
|
||||
println!("Current state: {}", ¤t_state_response.current_state);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user