Skip to content

Commit b467e7d

Browse files
committed
fix(ios): connect serviceUUIDs fix
1 parent 5e853bd commit b467e7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bluetooth.ios.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,8 @@ export class Bluetooth extends BluetoothCommon {
997997
let services, mtu = FIXED_IOS_MTU;
998998
if (args.autoDiscoverAll === true) {
999999
services = (await this.discoverAll({ peripheralUUID: connectingUUID }))?.services;
1000+
} else if(args.serviceUUIDs) {
1001+
services = (await this.discoverServices({ peripheralUUID: connectingUUID, serviceUUIDs:args.serviceUUIDs }))?.services;
10001002
}
10011003
if (!!args.autoMaxMTU) {
10021004
mtu = await this.requestMtu({ peripheralUUID: connectingUUID, value: FIXED_IOS_MTU }) ;
@@ -1553,7 +1555,7 @@ export class Bluetooth extends BluetoothCommon {
15531555
});
15541556
return Promise.reject(error);
15551557
}
1556-
return new Promise((resolve, reject) => {
1558+
return new Promise<any>((resolve, reject) => {
15571559
const subD = {
15581560
peripheralDidDiscoverServices: (peripheral: CBPeripheral, error?: NSError) => {
15591561
const UUID = NSUUIDToString(peripheral.identifier);

0 commit comments

Comments
 (0)