Skip to content

Commit

Permalink
feat: Standartize config between targets
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrKovalenko committed May 28, 2024
1 parent 0654418 commit ae05b28
Show file tree
Hide file tree
Showing 16 changed files with 645 additions and 196 deletions.
172 changes: 153 additions & 19 deletions cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ tracing-subscriber = "0.3.17"
ratatui = "0.26.3"
uuid = "1.3.2"
regex = "1.10.4"
btleplug = { package = "btleplug-goose-fixed", version = "0.11.5" }
btleplug = { package = "btleplug-goose-fixed", version = "0.11.5" }

[build-dependencies]
cc = "1.0"
bindgen = "0.69.4"
13 changes: 13 additions & 0 deletions cli/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn main() {
println!("cargo:rerun-if-changed=../shared/conf.h");
let bindings = bindgen::Builder::default()
.header("../shared/conf.h")
.clang_arg("-I../shared") // Specify the include path for additional headers if needed
.generate()
.expect("Unable to generate bindings");

bindings
.write_to_file("src/config/raw_bindings.rs")
.expect("Couldn't write bindings!");
}

12 changes: 12 additions & 0 deletions cli/src/bindings.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* automatically generated by rust-bindgen 0.69.4 */

pub const BLE_MAIN_SERVICE_LOCAL_NAME: &[u8; 9] = b"co2nsole\0";
pub const BLE_MAIN_SENSOR_SERVICE: &[u8; 37] = b"0000FFE0-0000-1000-8000-00805F9B34FB\0";
pub const BLE_MAIN_SENSOR_STREAM_CHAR: &[u8; 37] = b"0000FFE0-0000-1000-8000-00805F9B34FB\0";
pub const BLE_MAIN_SENSOR_ACTION_CHAR: &[u8; 37] = b"beb5483e-36e1-4688-b7f5-ea07361b26a8\0";
pub const BLE_MAIN_SENSOR_CALIBRATE_CO2: &[u8; 15] = b"CalibrateMhZ19\0";
pub const BLE_MAIN_SENSOR_CALIBRATE_TEMPERATURE: &[u8; 21] = b"CalibrateTemperature\0";
pub const BLE_MAIN_SENSOR_CALIBRATE_HUMIDITY: &[u8; 18] = b"CalibrateHumidity\0";
pub const BLE_WINDOW_SERVICE_LOCAL_NAME: &[u8; 16] = b"co2nsole window\0";
pub const BLE_WINDOW_SENSOR_SERVICE: &[u8; 37] = b"19B10000-E8F2-537E-4F6C-D104768A1214\0";
pub const BLE_WINDOW_SENSOR_READ_CHAR: &[u8; 37] = b"a3b27688-3b9e-4214-970c-3db5f14c5d2b\0";
Loading

0 comments on commit ae05b28

Please sign in to comment.