mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Add AWDL in HelloConnection
PiperOrigin-RevId: 745025636
This commit is contained in:
@@ -27,7 +27,7 @@ public class Advertiser {
|
||||
|
||||
/// The set of all mediums that can be used for advertising.
|
||||
let allMediums: Set<Medium> = [
|
||||
.bluetooth, .ble, .webRTC, .wifiLAN, .wifiHotspot, .wifiDirect,
|
||||
.bluetooth, .ble, .webRTC, .wifiLAN, .wifiHotspot, .wifiDirect, .awdl
|
||||
]
|
||||
|
||||
lazy var connection: InternalConnection? = {
|
||||
@@ -86,7 +86,8 @@ public class Advertiser {
|
||||
webRTC: mediums.contains(.webRTC),
|
||||
wifiLAN: mediums.contains(.wifiLAN),
|
||||
wifiHotspot: mediums.contains(.wifiHotspot),
|
||||
wifiDirect: mediums.contains(.wifiDirect)
|
||||
wifiDirect: mediums.contains(.wifiDirect),
|
||||
awdl: mediums.contains(.awdl)
|
||||
)
|
||||
|
||||
// Start advertising with the options
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Discoverer {
|
||||
|
||||
/// The set of all mediums that can be used for discovering and connecting.
|
||||
let allMediums: Set<Medium> = [
|
||||
.bluetooth, .ble, .webRTC, .wifiLAN, .wifiHotspot, .wifiDirect,
|
||||
.bluetooth, .ble, .webRTC, .wifiLAN, .wifiHotspot, .wifiDirect, .awdl
|
||||
]
|
||||
|
||||
lazy var connection: InternalConnection? = {
|
||||
@@ -81,7 +81,8 @@ public class Discoverer {
|
||||
webRTC: mediums.contains(.webRTC),
|
||||
wifiLAN: mediums.contains(.wifiLAN),
|
||||
wifiHotspot: mediums.contains(.wifiHotspot),
|
||||
wifiDirect: mediums.contains(.wifiDirect)
|
||||
wifiDirect: mediums.contains(.wifiDirect),
|
||||
awdl: mediums.contains(.awdl)
|
||||
)
|
||||
|
||||
GNCCoreAdapter.shared.startDiscovery(
|
||||
@@ -134,7 +135,8 @@ public class Discoverer {
|
||||
webRTC: mediums.contains(.webRTC),
|
||||
wifiLAN: mediums.contains(.wifiLAN),
|
||||
wifiHotspot: mediums.contains(.wifiHotspot),
|
||||
wifiDirect: mediums.contains(.wifiDirect)
|
||||
wifiDirect: mediums.contains(.wifiDirect),
|
||||
awdl: mediums.contains(.awdl)
|
||||
)
|
||||
|
||||
GNCCoreAdapter.shared.requestConnection(
|
||||
|
||||
@@ -21,4 +21,5 @@ public enum Medium {
|
||||
case wifiLAN
|
||||
case wifiHotspot
|
||||
case wifiDirect
|
||||
case awdl
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ using ::nearby::connections::BooleanMediumSelector;
|
||||
selector.wifi_lan = self.wifiLAN;
|
||||
selector.wifi_hotspot = self.wifiHotspot;
|
||||
selector.wifi_direct = self.wifiDirect;
|
||||
selector.awdl = self.awdl;
|
||||
|
||||
return selector;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,13 @@
|
||||
@implementation GNCSupportedMediums
|
||||
|
||||
- (instancetype)initWithAllMediumsEnabled {
|
||||
return [self initWithBluetooth:YES ble:YES webRTC:YES wifiLAN:YES wifiHotspot:YES wifiDirect:YES];
|
||||
return [self initWithBluetooth:YES
|
||||
ble:YES
|
||||
webRTC:YES
|
||||
wifiLAN:YES
|
||||
wifiHotspot:YES
|
||||
wifiDirect:YES
|
||||
awdl:YES];
|
||||
}
|
||||
|
||||
- (instancetype)initWithBluetooth:(BOOL)bluetooth
|
||||
@@ -25,7 +31,8 @@
|
||||
webRTC:(BOOL)webRTC
|
||||
wifiLAN:(BOOL)wifiLAN
|
||||
wifiHotspot:(BOOL)wifiHotspot
|
||||
wifiDirect:(BOOL)wifiDirect {
|
||||
wifiDirect:(BOOL)wifiDirect
|
||||
awdl:(BOOL)awdl {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_bluetooth = bluetooth;
|
||||
@@ -34,6 +41,7 @@
|
||||
_wifiLAN = wifiLAN;
|
||||
_wifiHotspot = wifiHotspot;
|
||||
_wifiDirect = wifiDirect;
|
||||
_awdl = awdl;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+3
-1
@@ -28,7 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
webRTC:(BOOL)webRTC
|
||||
wifiLAN:(BOOL)wifiLAN
|
||||
wifiHotspot:(BOOL)wifiHotspot
|
||||
wifiDirect:(BOOL)wifiDirect NS_DESIGNATED_INITIALIZER;
|
||||
wifiDirect:(BOOL)wifiDirect
|
||||
awdl:(BOOL)awdl NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@property(nonatomic) BOOL bluetooth;
|
||||
@property(nonatomic) BOOL ble;
|
||||
@@ -36,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic) BOOL wifiLAN;
|
||||
@property(nonatomic) BOOL wifiHotspot;
|
||||
@property(nonatomic) BOOL wifiDirect;
|
||||
@property(nonatomic) BOOL awdl;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user