Skip to content

Commit

Permalink
Merge pull request #66 from RaphaelKn/fix-inquiry
Browse files Browse the repository at this point in the history
Fix device inquiry not finishing in Monterey and later
  • Loading branch information
toy authored Apr 28, 2024
2 parents dfe7fb2 + 6ee4f4b commit 4fa975f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Document macOS >= 12 silently ignoring favourites and recent access date [#63](https://github.com/toy/blueutil/issues/63) [#84](https://github.com/toy/blueutil/issues/84) [#89](https://github.com/toy/blueutil/issues/89) [@toy](https://github.com/toy)
* In addition to recent devices, paired devices will also be searched when connect, disconnect, get information about, and check connected state of device by name [#62](https://github.com/toy/blueutil/issues/62) [#88](https://github.com/toy/blueutil/pull/88) [@azuwis](https://github.com/azuwis)
* Fix device inquiry not finishing in Monterey and later [#66](https://github.com/toy/blueutil/pull/66) [@RaphaelKn](https://github.com/RaphaelKn)

## v2.9.1 (2023-01-14)

Expand Down
9 changes: 6 additions & 3 deletions blueutil.m
Original file line number Diff line number Diff line change
Expand Up @@ -847,11 +847,14 @@ int main(int argc, char *argv[]) {
DeviceInquiryRunLoopStopper *stopper = [[[DeviceInquiryRunLoopStopper alloc] init] autorelease];
IOBluetoothDeviceInquiry *inquirer = [IOBluetoothDeviceInquiry inquiryWithDelegate:stopper];

[inquirer setInquiryLength:args->duration];

[inquirer start];

// inquiry length seems to be ingored starting with Monterey
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, args->duration * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[inquirer stop];
});

CFRunLoopRun();
[inquirer stop];

list_devices([inquirer foundDevices], false);
}
Expand Down

0 comments on commit 4fa975f

Please sign in to comment.