Add a ping method
This commit is contained in:
@@ -38,6 +38,7 @@ enum Request<'a> {
|
|||||||
chroma: Chroma,
|
chroma: Chroma,
|
||||||
pattern: &'a [u8],
|
pattern: &'a [u8],
|
||||||
},
|
},
|
||||||
|
Ping,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
@@ -45,6 +46,7 @@ enum Response<'a> {
|
|||||||
GetIdentification { model: DeviceType, serial: &'a str },
|
GetIdentification { model: DeviceType, serial: &'a str },
|
||||||
UpdateDisplay,
|
UpdateDisplay,
|
||||||
SetPattern,
|
SetPattern,
|
||||||
|
Ping,
|
||||||
}
|
}
|
||||||
|
|
||||||
const PATTERN_SIZE: usize = 5000;
|
const PATTERN_SIZE: usize = 5000;
|
||||||
@@ -79,6 +81,7 @@ impl App {
|
|||||||
} => self.handle_set_pattern(from, to, chroma, pattern).await,
|
} => self.handle_set_pattern(from, to, chroma, pattern).await,
|
||||||
Request::UpdateDisplay => self.handle_update_display().await,
|
Request::UpdateDisplay => self.handle_update_display().await,
|
||||||
Request::GetIdentification => self.handle_get_identification().await,
|
Request::GetIdentification => self.handle_get_identification().await,
|
||||||
|
Request::Ping => self.write_response(Response::Ping).await,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user