Skip to content

Commit 3268e11

Browse files
committed
fix: android fixed advertisment serviceUuids reading
1 parent 17438b2 commit 3268e11

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/bluetooth.android.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function initLeScanCallback() {
253253
return this.txPowerLevel;
254254
}
255255
constructor(
256-
private serviceUuids: native.Array<number>[],
256+
private serviceUuids: string[],
257257
private manufacturerData: android.util.SparseArray<any[]>,
258258
private serviceData: { [k: string]: native.Array<number> },
259259
private advertiseFlags: number,
@@ -402,7 +402,7 @@ function initLeScanCallback() {
402402

403403
let currentPos = 0;
404404
let advertiseFlag = -1;
405-
let serviceUuids = [];
405+
let serviceUuids: string[] = [];
406406
let localName: string = null;
407407
let txPowerLevel = Number.MIN_VALUE;
408408
const manufacturerData: android.util.SparseArray<any[]> = new android.util.SparseArray();
@@ -658,7 +658,7 @@ function initScanCallback() {
658658
const serviceUuids = this.scanRecord.getServiceUuids();
659659
if (serviceUuids) {
660660
for (let i = 0; i < serviceUuids.size(); i++) {
661-
result.push(uuidToString(serviceUuids[i]));
661+
result.push(uuidToString(serviceUuids.get(i)));
662662
}
663663
}
664664

@@ -1610,7 +1610,6 @@ export class Bluetooth extends BluetoothCommon {
16101610
if (args.autoDiscoverAll !== false) {
16111611
return this.discoverAll({ peripheralUUID: pUUID });
16121612
}
1613-
return undefined;
16141613
})
16151614
.then((result) => {
16161615
const stateObject = this.connections[pUUID];

0 commit comments

Comments
 (0)