Skip to content

Commit 1dd36f9

Browse files
committed
docs: update example for connect_bluetooth() and bump version
1 parent 8b2c6a0 commit 1dd36f9

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

nmrs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nmrs"
3-
version = "1.1.0"
3+
version = "2.0.0-dev"
44
authors = ["Akrm Al-Hakimi <alhakimiakrmj@gmail.com>"]
55
edition.workspace = true
66
rust-version = "1.78.0"

nmrs/src/api/network_manager.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,23 @@ impl NetworkManager {
174174
/// Connects to a bluetooth device using the provided identity.
175175
///
176176
/// # Example
177+
///
178+
/// ```no_run
179+
/// use nmrs::{NetworkManager, BluetoothIdentity, BluetoothNetworkRole};
180+
///
181+
/// # async fn example() -> nmrs::Result<()> {
182+
/// let nm = NetworkManager::new().await?;
183+
///
184+
/// let identity = BluetoothIdentity {
185+
/// bdaddr: "C8:1F:E8:F0:51:57".into(),
186+
/// bt_device_type: BluetoothNetworkRole::PanU,
187+
/// };
188+
///
189+
/// nm.connect_bluetooth("My Phone", &identity).await?;
190+
/// Ok(())
191+
/// }
192+
///
193+
/// ```
177194
pub async fn connect_bluetooth(&self, name: &str, identity: &BluetoothIdentity) -> Result<()> {
178195
connect_bluetooth(&self.conn, name, identity).await
179196
}
@@ -187,7 +204,7 @@ impl NetworkManager {
187204
///
188205
/// # Example
189206
///
190-
/// ```no_run
207+
/// ```rust
191208
/// use nmrs::{NetworkManager, VpnCredentials, VpnType, WireGuardPeer};
192209
///
193210
/// # async fn example() -> nmrs::Result<()> {

0 commit comments

Comments
 (0)