Skip to content

Commit 2285aa1

Browse files
committed
fix(android): connect transport set to TRANSPORT_AUTO. Allow to pass custom one
1 parent ef78731 commit 2285aa1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/bluetooth.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ export class Bluetooth extends BluetoothCommon {
17181718
ad.getApplicationContext(), // context
17191719
false, // autoconnect
17201720
this.bluetoothGattCallback,
1721-
android.bluetooth.BluetoothDevice.TRANSPORT_LE // 2
1721+
args.transport !== undefined ? args.transport : android.bluetooth.BluetoothDevice.TRANSPORT_AUTO
17221722
);
17231723
}
17241724
Object.assign(this.connections[pUUID], {

src/bluetooth.common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ export interface ConnectOptions {
347347
* Selects maximum BLE MTU (247) (Android only)
348348
*/
349349
autoMaxMTU?: boolean;
350+
/**
351+
* transport selection (Android only)
352+
*/
353+
transport?: number;
350354
}
351355

352356
export interface AdvertismentData {

0 commit comments

Comments
 (0)