From bcf2e1e481091bbedfbf3a0af78683e186a3fafa Mon Sep 17 00:00:00 2001 From: taks <857tn859@gmail.com> Date: Fri, 26 Jul 2024 17:27:08 +0900 Subject: [PATCH 1/2] Added rustc-check-cfg to build.rs --- build.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.rs b/build.rs index e86441c..3da9401 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,13 @@ fn main() { embuild::espidf::sysenv::output(); + + println!("cargo::rustc-check-cfg=cfg(esp32)"); + println!("cargo::rustc-check-cfg=cfg(esp32c3)"); + + println!("cargo::rustc-check-cfg=cfg(esp_idf_soc_esp_nimble_controller)"); + println!("cargo::rustc-check-cfg=cfg(esp_idf_bt_nimble_ext_adv)"); + + println!("cargo::rustc-check-cfg=cfg(esp_idf_version_major, values(\"4\", \"5\"))"); + println!("cargo::rustc-check-cfg=cfg(esp_idf_version_minor, values(\"2\"))"); + println!("cargo::rustc-check-cfg=cfg(esp_idf_version_patch, values(\"0\"))"); } From 6b761fc76db89206dd02df4cadb6b8555f9e5b91 Mon Sep 17 00:00:00 2001 From: taks <857tn859@gmail.com> Date: Fri, 26 Jul 2024 17:51:27 +0900 Subject: [PATCH 2/2] clippy --- src/ble_security.rs | 2 +- src/server/ble_characteristic.rs | 2 +- src/server/ble_server.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ble_security.rs b/src/ble_security.rs index 71c118a..c268a89 100644 --- a/src/ble_security.rs +++ b/src/ble_security.rs @@ -28,7 +28,7 @@ impl BLESecurity { /// Set the passkey the server will ask for when pairing. /// * The passkey will always be exactly 6 digits. Setting the passkey to 1234 - /// will require the user to provide '001234' + /// will require the user to provide '001234' /// * a dynamic passkey can also be set by [`crate::BLEServer::on_passkey_request`] pub fn set_passkey(&mut self, passkey: u32) -> &mut Self { debug_assert!( diff --git a/src/server/ble_characteristic.rs b/src/server/ble_characteristic.rs index 081f4e2..887c184 100644 --- a/src/server/ble_characteristic.rs +++ b/src/server/ble_characteristic.rs @@ -410,7 +410,7 @@ impl BLECharacteristic { /// Do not call `lock` on this characteristic inside the callback, use the first input instead. /// In the future, this characteristic could be locked while the callback executes. /// * `callback` - Function to call when a subscription event is recieved, including subscribe and unsubscribe events - /// see [`crate::NimbleSub`] for event type + /// see [`crate::NimbleSub`] for event type pub fn on_subscribe( &mut self, callback: impl FnMut(&Self, &BLEConnDesc, NimbleSub) + Send + Sync + 'static, diff --git a/src/server/ble_server.rs b/src/server/ble_server.rs index 476bc53..c1567b7 100644 --- a/src/server/ble_server.rs +++ b/src/server/ble_server.rs @@ -64,7 +64,7 @@ impl BLEServer { /// Set a callback fn for generating a passkey if required by the connection /// * The passkey will always be exactly 6 digits. Setting the passkey to 1234 - /// will require the user to provide '001234' + /// will require the user to provide '001234' /// * a static passkey can also be set by [`crate::BLESecurity::set_passkey`] pub fn on_passkey_request( &mut self, @@ -97,8 +97,8 @@ impl BLEServer { /// The callback function is called when the pairing procedure is complete. /// * callback first parameter: A reference to a `BLEConnDesc` instance. /// * callback second parameter: Indicates the result of the encryption state change attempt; - /// o 0: the encrypted state was successfully updated; - /// o BLE host error code: the encryption state change attempt failed for the specified reason. + /// o 0: the encrypted state was successfully updated; + /// o BLE host error code: the encryption state change attempt failed for the specified reason. pub fn on_authentication_complete( &mut self, callback: impl Fn(&BLEConnDesc, Result<(), BLEError>) + Send + Sync + 'static,