pub struct BleTransport { /* private fields */ }
Expand description

High level management interface for BLE transports

Be aware that only one BleTransport can exist per node, as it registers itself as a router for the BLE address type. Multiple calls to BleTransport::create will panic.

To register additional connections on an already initialised BleTransport, use ble.connect(). To listen for incoming connections use ble.listen()

use ockam_transport_ble::{BleClient, BleTransport};
use ockam_transport_ble::driver::btleplug::BleAdapter;
    // Create a ble_client
    let ble_adapter = BleAdapter::try_new().await?;
    let ble_client = BleClient::with_adapter(ble_adapter);

    // Initialize the BLE Transport.
    let ble = BleTransport::create(&ctx).await?;

    // Try to connect to BleServer
    ble.connect(ble_client, "ockam_ble_1".to_string()).await?;

Implementations

Create a new BLE transport and router for the current node

Establish an outgoing BLE connection on an existing transport

Starts a new pair of Ble connection workers

One worker handles outgoing messages, while another handles incoming messages. The local worker address is chosen based on the peer the worker is meant to be connected to.

Start listening to incoming connections on an existing transport

Trait Implementations

Try cloning a object and return an Err in case of failure.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more