You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open func stopLeScan(_ arg0:BluetoothAdapter.LeScanCallback?)
58
95
96
+
/// Returns a `BluetoothLeAdvertiser` object for Bluetooth LE Advertising operations, or `nil` if Bluetooth LE Advertising is not supported on this adapter.
97
+
///
98
+
/// - Returns: `BluetoothLeAdvertiser` instance, or `nil` if not supported.
99
+
/// - Since: API Level 21
100
+
@available(Android 21,*)
59
101
@JavaMethod
60
102
open func getBluetoothLeAdvertiser()->BluetoothLeAdvertiser!
61
103
104
+
/// Returns a `BluetoothLeScanner` object for Bluetooth LE scan operations.
105
+
///
106
+
/// - Returns: `BluetoothLeScanner` instance.
107
+
/// - Since: API Level 21
108
+
@available(Android 21,*)
62
109
@JavaMethod
63
110
open func getBluetoothLeScanner()-> BluetoothLeScanner!
64
111
112
+
/// Get the current discoverable timeout value.
113
+
///
114
+
/// - Returns: the discoverable timeout value in seconds.
115
+
/// - Since: API Level 33
116
+
@available(Android 33,*)
65
117
@JavaMethod
66
118
open func getDiscoverableTimeout()-> Duration!
67
119
@@ -74,21 +126,52 @@ open class BluetoothAdapter: JavaObject {
74
126
@JavaMethod
75
127
open func isOffloadedScanBatchingSupported()-> Bool
76
128
129
+
/// Returns whether LE Coded PHY feature is supported.
130
+
///
131
+
/// - Returns: `true` if chipset supports LE Coded PHY feature, `false` otherwise.
132
+
/// - Since: API Level 26
133
+
@available(Android 26,*)
77
134
@JavaMethod
78
135
open func isLeCodedPhySupported()-> Bool
79
136
137
+
/// Returns whether LE Extended Advertising feature is supported.
138
+
///
139
+
/// - Returns: `true` if chipset supports LE Extended Advertising feature, `false` otherwise.
140
+
/// - Since: API Level 26
141
+
@available(Android 26,*)
80
142
@JavaMethod
81
143
open func isLeExtendedAdvertisingSupported()-> Bool
82
144
145
+
/// Returns whether LE Periodic Advertising feature is supported.
146
+
///
147
+
/// - Returns: `true` if chipset supports LE Periodic Advertising feature, `false` otherwise.
148
+
/// - Since: API Level 26
149
+
@available(Android 26,*)
83
150
@JavaMethod
84
151
open func isLePeriodicAdvertisingSupported()-> Bool
85
152
153
+
/// Returns whether LE Audio Broadcast Source is supported.
154
+
///
155
+
/// - Returns: `FEATURE_SUPPORTED` if supported, `FEATURE_NOT_SUPPORTED` if not supported,
156
+
/// or an error code.
157
+
/// - Since: API Level 33
158
+
@available(Android 33,*)
86
159
@JavaMethod
87
160
open func isLeAudioBroadcastSourceSupported()-> Int32
88
161
162
+
/// Returns the maximum LE advertising data length in bytes, if LE Extended Advertising feature is supported.
163
+
///
164
+
/// - Returns: the maximum LE advertising data length.
165
+
/// - Since: API Level 26
166
+
@available(Android 26,*)
89
167
@JavaMethod
90
168
open func getLeMaximumAdvertisingDataLength()-> Int32
91
169
170
+
/// Returns the maximum number of connected audio devices.
171
+
///
172
+
/// - Returns: the maximum number of connected audio devices.
173
+
/// - Since: API Level 30
174
+
@available(Android 30,*)
92
175
@JavaMethod
93
176
open func getMaxConnectedAudioDevices()-> Int32
94
177
@@ -98,12 +181,30 @@ open class BluetoothAdapter: JavaObject {
@@ -15,15 +30,28 @@ open class BluetoothDevice: JavaObject {
15
30
@JavaMethod
16
31
open func writeToParcel(_ arg0:Parcel?, _ arg1:Int32)
17
32
18
-
/**
19
-
Returns the address type of this BluetoothDevice, one of ADDRESS_TYPE_PUBLIC, ADDRESS_TYPE_RANDOM, ADDRESS_TYPE_ANONYMOUS, or ADDRESS_TYPE_UNKNOWN.
20
-
*/
33
+
/// Returns the address type of this BluetoothDevice.
34
+
///
35
+
/// - Returns: One of `ADDRESS_TYPE_PUBLIC`, `ADDRESS_TYPE_RANDOM`, `ADDRESS_TYPE_ANONYMOUS`, or `ADDRESS_TYPE_UNKNOWN`.
36
+
/// - Since: API Level 31
37
+
@available(Android 31,*)
21
38
@JavaMethod
22
39
open func getAddressType()-> Int32
23
40
41
+
/// Get the locally modifiable name (alias) of the remote device.
42
+
///
43
+
/// - Returns: the locally modifiable name (alias) of the remote device, or `null` if not set.
44
+
/// - Since: API Level 31
45
+
@available(Android 31,*)
24
46
@JavaMethod
25
47
openfunc getAlias()-> String
26
48
49
+
/// Sets the locally modifiable name (alias) of the remote device.
50
+
///
51
+
/// - Parameter arg0: the alias to set, or `null` to remove the alias.
52
+
/// - Returns: status code indicating whether the operation succeeded.
53
+
/// - Since: API Level 31
54
+
@available(Android 31,*)
27
55
@JavaMethod
28
56
open func setAlias(_ arg0:String)-> Int32
29
57
@@ -45,25 +73,36 @@ open class BluetoothDevice: JavaObject {
45
73
@JavaMethod
46
74
open func setPin(_ arg0:[Int8])-> Bool
47
75
48
-
/**
49
-
Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations.
50
-
For apps targeting Build.VERSION_CODES.S or or higher, this requires the Manifest.permission.BLUETOOTH_CONNECT permission which can be gained with Activity.requestPermissions(String[], int).
51
-
52
-
Requires `Manifest.permission.BLUETOOTH_CONNECT`
53
-
*/
76
+
/// Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations.
77
+
/// For apps targeting Build.VERSION_CODES.S or or higher, this requires the Manifest.permission.BLUETOOTH_CONNECT permission which can be gained with Activity.requestPermissions(String[], int).
78
+
///
79
+
/// - Parameter context: The running app's context.
80
+
/// - Parameter autoConnect: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true).
81
+
/// - Parameter callback: GATT callback handler that will receive asynchronous callbacks.
82
+
/// - Returns: The `BluetoothGatt` instance.
83
+
/// - Throws: IllegalArgumentException if callback is null.
Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations.
63
-
For apps targeting `Build.VERSION_CODES.S` or or higher, this requires the `Manifest.permission.BLUETOOTH_CONNECT` permission which can be gained with Activity.requestPermissions(String[], int).
64
-
65
-
Requires `Manifest.permission.BLUETOOTH_CONNECT`
66
-
*/
94
+
/// Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations.
95
+
/// For apps targeting `Build.VERSION_CODES.S` or or higher, this requires the `Manifest.permission.BLUETOOTH_CONNECT` permission which can be gained with Activity.requestPermissions(String[], int).
96
+
///
97
+
/// - Parameter context: The running app's context.
98
+
/// - Parameter autoConnect: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true).
99
+
/// - Parameter callback: GATT callback handler that will receive asynchronous callbacks.
100
+
/// - Parameter transport: Preferred transport for GATT connections to remote dual-mode devices.
101
+
/// - Returns: The `BluetoothGatt` instance.
102
+
/// - Throws: IllegalArgumentException if callback is null.
@@ -75,31 +114,36 @@ open class BluetoothDevice: JavaObject {
75
114
/// Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations.
76
115
///
77
116
/// - Parameter context: The running app's context.
78
-
///
79
117
/// - Parameter autoConnect: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true).
80
-
///
81
118
/// - Parameter callback: GATT callback handler that will receive asynchronous callbacks.
82
-
///
83
119
/// - Parameter transport: Preferred transport for GATT connections to remote dual-mode devices
84
-
///
85
120
/// - Returns: The method returns a ``BluetoothGatt`` instance.
86
-
///
121
+
/// - Throws: IllegalArgumentException if callback is null.
Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations.
99
-
For apps targeting Build.VERSION_CODES.S or or higher, this requires the Manifest.permission.BLUETOOTH_CONNECT permission which can be gained with Activity.requestPermissions(String[], int).
100
-
101
-
Requires Manifest.permission.BLUETOOTH_CONNECT
102
-
*/
134
+
/// Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations.
135
+
/// For apps targeting Build.VERSION_CODES.S or or higher, this requires the Manifest.permission.BLUETOOTH_CONNECT permission which can be gained with Activity.requestPermissions(String[], int).
136
+
///
137
+
/// - Parameter context: The running app's context.
138
+
/// - Parameter autoConnect: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true).
139
+
/// - Parameter callback: GATT callback handler that will receive asynchronous callbacks.
140
+
/// - Parameter transport: Preferred transport for GATT connections to remote dual-mode devices.
141
+
/// - Parameter phy: preferred PHY for connections to remote LE device.
142
+
/// - Returns: The `BluetoothGatt` instance.
143
+
/// - Throws: IllegalArgumentException if callback is null.
@@ -119,15 +163,35 @@ open class BluetoothDevice: JavaObject {
119
163
_ handler: Handler?
120
164
) -> BluetoothGatt!
121
165
*/
166
+
/// Create an L2CAP Connection-oriented Channel (CoC) `BluetoothSocket` that can be used to start a secure outgoing connection to the remote device with the same dynamic protocol/service multiplexer (PSM) value.
167
+
///
168
+
/// - Parameter arg0: dynamic PSM value from remote device.
169
+
/// - Returns: a Bluetooth L2CAP CoC socket ready for outgoing connection.
170
+
/// - Throws: IOException on error, for example Bluetooth not available, or insufficient permissions.
171
+
/// - Since: API Level 29
172
+
@available(Android 29,*)
122
173
@JavaMethod
123
174
open func createL2capChannel(_ arg0:Int32)throws->BluetoothSocket!
124
175
176
+
/// Confirm passkey for BLUETOOTH_ADMIN_PERM.
177
+
///
178
+
/// - Parameter arg0: `true` to confirm the passkey, `false` to decline.
179
+
/// - Returns: `true` confirmation has been sent out, `false` for error.
180
+
/// - Since: API Level 19
181
+
@available(Android 19,*)
125
182
@JavaMethod
126
183
open func setPairingConfirmation(_ arg0:Bool)-> Bool
/// Create an L2CAP Connection-oriented Channel (CoC) `BluetoothSocket` that can be used to start an insecure outgoing connection to the remote device with the same dynamic protocol/service multiplexer (PSM) value.
189
+
///
190
+
/// - Parameter arg0: dynamic PSM value from remote device.
191
+
/// - Returns: a Bluetooth L2CAP CoC socket ready for outgoing connection.
192
+
/// - Throws: IOException on error, for example Bluetooth not available, or insufficient permissions.
193
+
/// - Since: API Level 29
194
+
@available(Android 29,*)
131
195
@JavaMethod
132
196
open func createInsecureL2capChannel(_ arg0:Int32)throws->BluetoothSocket!
0 commit comments