mirror of
https://github.com/janishutz/mqtt-remote-gpio.git
synced 2026-10-08 20:56:22 +02:00
fix: char conversion
This commit is contained in:
1 parent
788be33dc9
commit
0d74c46b4e
1 file changed
+2
-4
+2
-4
@@ -6,7 +6,6 @@ use crate::conf::{PinMode, Topic};
|
||||
|
||||
pub struct InputPin {
|
||||
pub gpio: gpio::InputPin,
|
||||
pub id: u8,
|
||||
pub topic: String,
|
||||
}
|
||||
|
||||
@@ -43,7 +42,6 @@ pub fn split_topics_and_configure_pins(topics: Vec<Topic>) -> (Vec<InputPin>, Ve
|
||||
.get(topic.pin)
|
||||
.expect(&format!("Unable to find GPIO pin {}", topic.pin))
|
||||
.into_input(),
|
||||
id: topic.pin,
|
||||
});
|
||||
in_used.push(topic.pin)
|
||||
} else {
|
||||
@@ -133,8 +131,8 @@ impl GPIOController {
|
||||
.expect("Failed to load pins data");
|
||||
println!("Hello World, pin {}", pin.id);
|
||||
let mut instr = "".to_string();
|
||||
for char in &instruction.payload {
|
||||
instr.push_str(&char.to_string())
|
||||
for c in &instruction.payload {
|
||||
instr.push(*c as char)
|
||||
}
|
||||
println!("{}", instr);
|
||||
if pin.off_timeout > 0 {
|
||||
|
||||
Reference in new issue
Block a user