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
use super::{Command, CommandType, Response};
use connector::Connector;
use session::{Session, SessionError};
pub fn blink<C: Connector>(session: &mut Session<C>, num_seconds: u8) -> Result<(), SessionError> {
session.send_encrypted_command(BlinkCommand { num_seconds })?;
Ok(())
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct BlinkCommand {
pub num_seconds: u8,
}
impl Command for BlinkCommand {
type ResponseType = BlinkResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct BlinkResponse {}
impl Response for BlinkResponse {
const COMMAND_TYPE: CommandType = CommandType::Blink;
}