(feature: &Feature, value: f32)
| 850 | } |
| 851 | |
| 852 | fn output_set(feature: &Feature, value: f32) { |
| 853 | let mode = if value > 0.0 { 0x04u8 } else { 0x02u8 }; |
| 854 | |
| 855 | debug!("Setting output: mode 0x{:02x}", mode); |
| 856 | |
| 857 | let mut payload = [0u8; 65]; |
| 858 | payload[1] = 0x5a; |
| 859 | payload[2] = 0x2c; |
| 860 | payload[3] = 0x05; |
| 861 | payload[4] = 0x00; |
| 862 | payload[5] = mode; |
| 863 | payload[6] = 0x00; |
| 864 | payload[7] = 0x00; |
| 865 | payload[8] = 0x00; |
| 866 | |
| 867 | DEVICE_CONNECTION |
| 868 | .get() |
| 869 | .expect("Device connection must be initialized") |
| 870 | .lock() |
| 871 | .unwrap() |
| 872 | .write(&payload) |
| 873 | .expect("Failed to send write to device"); |
| 874 | |
| 875 | read_ack(); |
| 876 | } |
nothing calls this directly
no test coverage detected