forked from M-Labs/thermostat
Compare commits
No commits in common. "d19111a93df58a427aa2d23100b5fe567e88410b" and "44e9130010a0eb74c94a10a934eed1032d0c0aef" have entirely different histories.
d19111a93d
...
44e9130010
@ -51,20 +51,20 @@
|
|||||||
in {
|
in {
|
||||||
packages.x86_64-linux = {
|
packages.x86_64-linux = {
|
||||||
inherit thermostat;
|
inherit thermostat;
|
||||||
default = thermostat;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hydraJobs = {
|
hydraJobs = {
|
||||||
inherit thermostat;
|
inherit thermostat;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.x86_64-linux.default = pkgs.mkShellNoCC {
|
devShell.x86_64-linux = pkgs.mkShell {
|
||||||
name = "thermostat-dev-shell";
|
name = "thermostat-dev-shell";
|
||||||
packages = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
rust openocd dfu-util
|
rust openocd dfu-util
|
||||||
] ++ (with python3Packages; [
|
] ++ (with python3Packages; [
|
||||||
numpy matplotlib
|
numpy matplotlib
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
defaultPackage.x86_64-linux = thermostat;
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -1,8 +1,18 @@
|
|||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::num::ParseIntError;
|
use core::num::ParseIntError;
|
||||||
use core::str::{from_utf8, Utf8Error, SplitAsciiWhitespace};
|
use core::str::{from_utf8, Utf8Error};
|
||||||
use nom::error::ErrorKind;
|
use nom::{
|
||||||
use num_traits::ParseFloatError;
|
IResult,
|
||||||
|
branch::alt,
|
||||||
|
bytes::complete::{is_a, tag, take_while1},
|
||||||
|
character::{is_digit, complete::{char, one_of}},
|
||||||
|
combinator::{complete, map, opt, value},
|
||||||
|
sequence::preceded,
|
||||||
|
multi::{fold_many0, fold_many1},
|
||||||
|
error::ErrorKind,
|
||||||
|
Needed,
|
||||||
|
};
|
||||||
|
use num_traits::{Num, ParseFloatError};
|
||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
|
|
||||||
@ -183,76 +193,425 @@ pub enum Command {
|
|||||||
ShowHWRev,
|
ShowHWRev,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load(tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn end(input: &[u8]) -> IResult<&[u8], ()> {
|
||||||
tokens.next();
|
complete(
|
||||||
Err(Error::Incomplete)
|
fold_many0(
|
||||||
|
one_of("\r\n\t "),
|
||||||
|
(), |(), _| ()
|
||||||
|
)
|
||||||
|
)(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn save(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn whitespace(input: &[u8]) -> IResult<&[u8], ()> {
|
||||||
Err(Error::Incomplete)
|
fold_many1(char(' '), (), |(), _| ())(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ipv4(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn unsigned(input: &[u8]) -> IResult<&[u8], Result<u32, Error>> {
|
||||||
Err(Error::Incomplete)
|
take_while1(is_digit)(input)
|
||||||
|
.map(|(input, digits)| {
|
||||||
|
let result =
|
||||||
|
from_utf8(digits)
|
||||||
|
.map_err(|e| e.into())
|
||||||
|
.and_then(|digits| u32::from_str_radix(digits, 10)
|
||||||
|
.map_err(|e| e.into())
|
||||||
|
);
|
||||||
|
(input, result)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn report(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn float(input: &[u8]) -> IResult<&[u8], Result<f64, Error>> {
|
||||||
Err(Error::Incomplete)
|
let (input, sign) = opt(is_a("-"))(input)?;
|
||||||
|
let negative = sign.is_some();
|
||||||
|
let (input, digits) = take_while1(|c| is_digit(c) || c == '.' as u8)(input)?;
|
||||||
|
let result =
|
||||||
|
from_utf8(digits)
|
||||||
|
.map_err(|e| e.into())
|
||||||
|
.and_then(|digits| f64::from_str_radix(digits, 10)
|
||||||
|
.map_err(|e| e.into())
|
||||||
|
)
|
||||||
|
.map(|result: f64| if negative { -result } else { result });
|
||||||
|
Ok((input, result))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pwm(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn off_on(input: &[u8]) -> IResult<&[u8], bool> {
|
||||||
Err(Error::Incomplete)
|
alt((value(false, tag("off")),
|
||||||
|
value(true, tag("on"))
|
||||||
|
))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn center(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn channel(input: &[u8]) -> IResult<&[u8], usize> {
|
||||||
Err(Error::Incomplete)
|
map(one_of("01"), |c| (c as usize) - ('0' as usize))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pid(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn report(input: &[u8]) -> IResult<&[u8], Command> {
|
||||||
Err(Error::Incomplete)
|
preceded(
|
||||||
|
tag("report"),
|
||||||
|
alt((
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
preceded(
|
||||||
|
tag("mode"),
|
||||||
|
alt((
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
// `report mode <on | off>` - Switch repoting mode
|
||||||
|
map(off_on, Command::Reporting)
|
||||||
|
),
|
||||||
|
// `report mode` - Show current reporting state
|
||||||
|
value(Command::Show(ShowCommand::Reporting), end)
|
||||||
|
))
|
||||||
|
)),
|
||||||
|
// `report` - Report once
|
||||||
|
value(Command::Show(ShowCommand::Input), end)
|
||||||
|
))
|
||||||
|
)(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn s_h(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn pwm_setup(input: &[u8]) -> IResult<&[u8], Result<(PwmPin, f64), Error>> {
|
||||||
Err(Error::Incomplete)
|
let result_with_pin = |pin: PwmPin|
|
||||||
|
move |result: Result<f64, Error>|
|
||||||
|
result.map(|value| (pin, value));
|
||||||
|
|
||||||
|
alt((
|
||||||
|
map(
|
||||||
|
preceded(
|
||||||
|
tag("i_set"),
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
float
|
||||||
|
)
|
||||||
|
),
|
||||||
|
result_with_pin(PwmPin::ISet)
|
||||||
|
),
|
||||||
|
map(
|
||||||
|
preceded(
|
||||||
|
tag("max_i_pos"),
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
float
|
||||||
|
)
|
||||||
|
),
|
||||||
|
result_with_pin(PwmPin::MaxIPos)
|
||||||
|
),
|
||||||
|
map(
|
||||||
|
preceded(
|
||||||
|
tag("max_i_neg"),
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
float
|
||||||
|
)
|
||||||
|
),
|
||||||
|
result_with_pin(PwmPin::MaxINeg)
|
||||||
|
),
|
||||||
|
map(
|
||||||
|
preceded(
|
||||||
|
tag("max_v"),
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
float
|
||||||
|
)
|
||||||
|
),
|
||||||
|
result_with_pin(PwmPin::MaxV)
|
||||||
|
))
|
||||||
|
)(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn postfilter(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
/// `pwm <0-1> pid` - Set PWM to be controlled by PID
|
||||||
Err(Error::Incomplete)
|
fn pwm_pid(input: &[u8]) -> IResult<&[u8], ()> {
|
||||||
|
value((), tag("pid"))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fan(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn pwm(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
Err(Error::Incomplete)
|
let (input, _) = tag("pwm")(input)?;
|
||||||
|
alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, channel) = channel(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, result) = alt((
|
||||||
|
|input| {
|
||||||
|
let (input, ()) = pwm_pid(input)?;
|
||||||
|
Ok((input, Ok(Command::PwmPid { channel })))
|
||||||
|
},
|
||||||
|
|input| {
|
||||||
|
let (input, config) = pwm_setup(input)?;
|
||||||
|
match config {
|
||||||
|
Ok((pin, value)) =>
|
||||||
|
Ok((input, Ok(Command::Pwm { channel, pin, value }))),
|
||||||
|
Err(e) =>
|
||||||
|
Ok((input, Err(e))),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
))(input)?;
|
||||||
|
end(input)?;
|
||||||
|
Ok((input, result))
|
||||||
|
},
|
||||||
|
value(Ok(Command::Show(ShowCommand::Pwm)), end)
|
||||||
|
))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fcurve(_tokens: &mut SplitAsciiWhitespace) -> Result<Command, Error> {
|
fn center_point(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
Err(Error::Incomplete)
|
let (input, _) = tag("center")(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, channel) = channel(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, center) = alt((
|
||||||
|
value(Ok(CenterPoint::Vref), tag("vref")),
|
||||||
|
|input| {
|
||||||
|
let (input, value) = float(input)?;
|
||||||
|
Ok((input, value.map(|value| CenterPoint::Override(value as f32))))
|
||||||
|
}
|
||||||
|
))(input)?;
|
||||||
|
end(input)?;
|
||||||
|
Ok((input, center.map(|center| Command::CenterPoint {
|
||||||
|
channel,
|
||||||
|
center,
|
||||||
|
})))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `pid <0-1> <parameter> <value>`
|
||||||
|
fn pid_parameter(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, channel) = channel(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, parameter) =
|
||||||
|
alt((value(PidParameter::Target, tag("target")),
|
||||||
|
value(PidParameter::KP, tag("kp")),
|
||||||
|
value(PidParameter::KI, tag("ki")),
|
||||||
|
value(PidParameter::KD, tag("kd")),
|
||||||
|
value(PidParameter::OutputMin, tag("output_min")),
|
||||||
|
value(PidParameter::OutputMax, tag("output_max")),
|
||||||
|
))(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, value) = float(input)?;
|
||||||
|
let result = value
|
||||||
|
.map(|value| Command::Pid { channel, parameter, value });
|
||||||
|
Ok((input, result))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `pid` | `pid <pid_parameter>`
|
||||||
|
fn pid(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("pid")(input)?;
|
||||||
|
alt((
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
pid_parameter
|
||||||
|
),
|
||||||
|
value(Ok(Command::Show(ShowCommand::Pid)), end)
|
||||||
|
))(input)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `s-h <0-1> <parameter> <value>`
|
||||||
|
fn steinhart_hart_parameter(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, channel) = channel(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, parameter) =
|
||||||
|
alt((value(ShParameter::T0, tag("t0")),
|
||||||
|
value(ShParameter::B, tag("b")),
|
||||||
|
value(ShParameter::R0, tag("r0"))
|
||||||
|
))(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, value) = float(input)?;
|
||||||
|
let result = value
|
||||||
|
.map(|value| Command::SteinhartHart { channel, parameter, value });
|
||||||
|
Ok((input, result))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `s-h` | `s-h <steinhart_hart_parameter>`
|
||||||
|
fn steinhart_hart(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("s-h")(input)?;
|
||||||
|
alt((
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
steinhart_hart_parameter
|
||||||
|
),
|
||||||
|
value(Ok(Command::Show(ShowCommand::SteinhartHart)), end)
|
||||||
|
))(input)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn postfilter(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("postfilter")(input)?;
|
||||||
|
alt((
|
||||||
|
preceded(
|
||||||
|
whitespace,
|
||||||
|
|input| {
|
||||||
|
let (input, channel) = channel(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
alt((
|
||||||
|
value(Ok(Command::PostFilter {
|
||||||
|
channel,
|
||||||
|
rate: None,
|
||||||
|
}), tag("off")),
|
||||||
|
move |input| {
|
||||||
|
let (input, _) = tag("rate")(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, rate) = float(input)?;
|
||||||
|
let result = rate
|
||||||
|
.map(|rate| Command::PostFilter {
|
||||||
|
channel,
|
||||||
|
rate: Some(rate as f32),
|
||||||
|
});
|
||||||
|
Ok((input, result))
|
||||||
|
}
|
||||||
|
))(input)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
value(Ok(Command::Show(ShowCommand::PostFilter)), end)
|
||||||
|
))(input)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn load(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("load")(input)?;
|
||||||
|
let (input, channel) = alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, channel) = channel(input)?;
|
||||||
|
let (input, _) = end(input)?;
|
||||||
|
Ok((input, Some(channel)))
|
||||||
|
},
|
||||||
|
value(None, end)
|
||||||
|
))(input)?;
|
||||||
|
|
||||||
|
let result = Ok(Command::Load { channel });
|
||||||
|
Ok((input, result))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn save(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("save")(input)?;
|
||||||
|
let (input, channel) = alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, channel) = channel(input)?;
|
||||||
|
let (input, _) = end(input)?;
|
||||||
|
Ok((input, Some(channel)))
|
||||||
|
},
|
||||||
|
value(None, end)
|
||||||
|
))(input)?;
|
||||||
|
|
||||||
|
let result = Ok(Command::Save { channel });
|
||||||
|
Ok((input, result))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn ipv4_addr(input: &[u8]) -> IResult<&[u8], Result<[u8; 4], Error>> {
|
||||||
|
let (input, a) = unsigned(input)?;
|
||||||
|
let (input, _) = tag(".")(input)?;
|
||||||
|
let (input, b) = unsigned(input)?;
|
||||||
|
let (input, _) = tag(".")(input)?;
|
||||||
|
let (input, c) = unsigned(input)?;
|
||||||
|
let (input, _) = tag(".")(input)?;
|
||||||
|
let (input, d) = unsigned(input)?;
|
||||||
|
let address = move || Ok([a? as u8, b? as u8, c? as u8, d? as u8]);
|
||||||
|
Ok((input, address()))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn ipv4(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("ipv4")(input)?;
|
||||||
|
alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, address) = ipv4_addr(input)?;
|
||||||
|
let (input, _) = tag("/")(input)?;
|
||||||
|
let (input, mask_len) = unsigned(input)?;
|
||||||
|
let (input, gateway) = alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, gateway) = ipv4_addr(input)?;
|
||||||
|
Ok((input, gateway.map(Some)))
|
||||||
|
},
|
||||||
|
value(Ok(None), end),
|
||||||
|
))(input)?;
|
||||||
|
|
||||||
|
let result = move || {
|
||||||
|
Ok(Command::Ipv4(Ipv4Config {
|
||||||
|
address: address?,
|
||||||
|
mask_len: mask_len? as u8,
|
||||||
|
gateway: gateway?,
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
Ok((input, result()))
|
||||||
|
},
|
||||||
|
value(Ok(Command::Show(ShowCommand::Ipv4)), end),
|
||||||
|
))(input)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fan(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("fan")(input)?;
|
||||||
|
alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
|
||||||
|
let (input, result) = alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = tag("auto")(input)?;
|
||||||
|
Ok((input, Ok(Command::FanAuto)))
|
||||||
|
},
|
||||||
|
|input| {
|
||||||
|
let (input, value) = unsigned(input)?;
|
||||||
|
Ok((input, Ok(Command::FanSet { fan_pwm: value.unwrap_or(0)})))
|
||||||
|
},
|
||||||
|
))(input)?;
|
||||||
|
Ok((input, result))
|
||||||
|
},
|
||||||
|
value(Ok(Command::ShowFan), end)
|
||||||
|
))(input)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fan_curve(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
let (input, _) = tag("fcurve")(input)?;
|
||||||
|
alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, result) = alt((
|
||||||
|
|input| {
|
||||||
|
let (input, _) = tag("default")(input)?;
|
||||||
|
Ok((input, Ok(Command::FanCurveDefaults)))
|
||||||
|
},
|
||||||
|
|input| {
|
||||||
|
let (input, k_a) = float(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, k_b) = float(input)?;
|
||||||
|
let (input, _) = whitespace(input)?;
|
||||||
|
let (input, k_c) = float(input)?;
|
||||||
|
if k_a.is_ok() && k_b.is_ok() && k_c.is_ok() {
|
||||||
|
Ok((input, Ok(Command::FanCurve { k_a: k_a.unwrap() as f32, k_b: k_b.unwrap() as f32, k_c: k_c.unwrap() as f32 })))
|
||||||
|
} else {
|
||||||
|
Err(nom::Err::Incomplete(Needed::Size(3)))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
))(input)?;
|
||||||
|
Ok((input, result))
|
||||||
|
},
|
||||||
|
value(Err(Error::Incomplete), end)
|
||||||
|
))(input)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn command(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
alt((value(Ok(Command::Quit), tag("quit")),
|
||||||
|
load,
|
||||||
|
save,
|
||||||
|
value(Ok(Command::Reset), tag("reset")),
|
||||||
|
ipv4,
|
||||||
|
map(report, Ok),
|
||||||
|
pwm,
|
||||||
|
center_point,
|
||||||
|
pid,
|
||||||
|
steinhart_hart,
|
||||||
|
postfilter,
|
||||||
|
value(Ok(Command::Dfu), tag("dfu")),
|
||||||
|
fan,
|
||||||
|
fan_curve,
|
||||||
|
value(Ok(Command::ShowHWRev), tag("hwrev")),
|
||||||
|
))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Command {
|
impl Command {
|
||||||
pub fn parse(input: &[u8]) -> Result<Self, Error> {
|
pub fn parse(input: &[u8]) -> Result<Self, Error> {
|
||||||
let mut tokens = from_utf8(input).unwrap().split_ascii_whitespace();
|
match command(input) {
|
||||||
match tokens.next() {
|
Ok((input_remain, result)) if input_remain.len() == 0 =>
|
||||||
Some(keyword) => {
|
result,
|
||||||
match keyword {
|
Ok((input_remain, _)) =>
|
||||||
"quit" => Ok(Command::Quit),
|
Err(Error::UnexpectedInput(input_remain[0])),
|
||||||
"load" => load(&mut tokens),
|
Err(e) =>
|
||||||
"save" => save(&mut tokens),
|
Err(e.into()),
|
||||||
"reset" => Ok(Command::Reset),
|
|
||||||
"ipv4" => ipv4(&mut tokens),
|
|
||||||
"report" => report(&mut tokens),
|
|
||||||
"pwm" => pwm(&mut tokens),
|
|
||||||
"center" => center(&mut tokens),
|
|
||||||
"pid" => pid(&mut tokens),
|
|
||||||
"s-h" => s_h(&mut tokens),
|
|
||||||
"postfilter" => postfilter(&mut tokens),
|
|
||||||
"dfu" => Ok(Command::Dfu),
|
|
||||||
"fan" => fan(&mut tokens),
|
|
||||||
"fcurve" => fcurve(&mut tokens),
|
|
||||||
"hwrev" => Ok(Command::ShowHWRev),
|
|
||||||
_ => Err(Error::Incomplete),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None => Err(Error::Incomplete),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user