Skip to content

Commit

Permalink
fix: minor adjustments to scan timeout (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: axi92 <[email protected]>
  • Loading branch information
mhochsto and axi92 authored Aug 26, 2024
1 parent 99cadcd commit 98c25b2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions example/src/BleScreenComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ const ScanResults = ({ props }) => {
(address: string) => {
console.log(`disconnected from Device =${address}`);
},
10_000,
);
})
.catch((e) => {
Expand Down
2 changes: 1 addition & 1 deletion ios/ble/AbrevvaBle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public class AbrevvaBle: RCTEventEmitter {
let name = optionsSwift["name"] as? String ?? nil
let namePrefix = optionsSwift["namePrefix"] as? String ?? nil
let allowDuplicates = optionsSwift["allowDuplicates"] as? Bool ?? false
let timeout = optionsSwift["timeout"] as? Int ?? 0
let timeout = optionsSwift["timeout"] as? Int ?? 10000

bleManager.startScan(
name,
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ export class AbrevvaBleModule implements AbrevvaBLEInterface {
onScanResultCallback: (result: ScanResult) => void,
onConnectCallback: (address: string) => void,
onDisconnectCallback: (address: string) => void,
timeout?: number,
services?: string[],
name?: string,
namePrefix?: string,
optionalServices?: string[],
allowDuplicates?: boolean,
scanMode?: ScanMode,
timeout?: number,
): Promise<void> {
if (this.listeners.get('onScanResult') !== undefined) {
return Promise.reject('scan already in progress');
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ export interface AbrevvaBLEInterface {
onScanResultCallback: (result: ScanResult) => void,
onConnectCallback: (address: string) => void,
onDisconnectCallback: (address: string) => void,
timeout?: number,
services?: string[],
name?: string,
namePrefix?: string,
optionalServices?: string[],
allowDuplicates?: boolean,
scanMode?: ScanMode,
timeout?: number,
): Promise<void>;
stopLEScan(): Promise<void>;
connect(options: DeviceIdOptions & TimeoutOptions): Promise<void>;
Expand Down

0 comments on commit 98c25b2

Please sign in to comment.