WifiAwareTransport class
High-throughput Wi-Fi Aware (Neighbor Awareness Networking) implementation of P2PTransport
for Android 8+ (WifiAwareManager) and iOS 26+ (WiFiAware framework, iPhone 12+) (v0.2).
- Implemented types
Constructors
- WifiAwareTransport({WifiAwareRadioBridge? bridge, String serviceId = 'msgp2p_bulk', TransportCapabilities capabilities = const TransportCapabilities(transportName: 'wifi_aware', defaultMtu: 1400, maxConnections: 4, supportsBulk: true)})
Properties
-
activeLinks
→ Map<
String, WifiAwarePeerLink> -
no setter
- bridge → WifiAwareRadioBridge
-
final
- capabilities → TransportCapabilities
-
Radio capabilities (MTU, bulk support, max connections).
final
-
discovered
→ Stream<
PeerAdvert> -
Stream of nearby peer advertisements detected by scanning.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
-
incoming
→ Stream<
PeerLink> -
Stream of incoming connection requests accepted by this transport.
no setteroverride
- isPublishing → bool
-
no setter
- isSubscribing → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceId → String
-
final
Methods
-
connect(
PeerAdvert peer) → Future< PeerLink> -
Establishes a point-to-point connection to a discovered peer.
override
-
dispose(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startAdvertising(
Uint8List token) → Future< void> -
Starts broadcasting an anonymous rotating beacon token.
override
-
startScanning(
[ScanPolicy policy = const ScanPolicy()]) → Future< void> -
Starts scanning for nearby peer advertisements.
override
-
stop(
) → Future< void> -
Stops both advertising and scanning, terminating all active operations.
override
-
stopAdvertising(
) → Future< void> -
Stops broadcasting advertisement beacons.
override
-
stopScanning(
) → Future< void> -
Stops scanning for peer advertisements.
override
-
teardownAfterTransfer(
) → Future< void> - Tears down all active Wi-Fi Aware data paths and publish/subscribe sessions immediately after a bulk transfer completes to preserve battery.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited