Skip to content

Commit

Permalink
Merge pull request #138 from taks/rustc-check-cfg
Browse files Browse the repository at this point in the history
Added rustc-check-cfg to build.rs
  • Loading branch information
taks authored Jul 27, 2024
2 parents 292e119 + 6b761fc commit 4678e64
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -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\"))");
}
2 changes: 1 addition & 1 deletion src/ble_security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion src/server/ble_characteristic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/server/ble_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4678e64

Please sign in to comment.