Comments (9)
[IOBluetoothDevice recentDevices]
returns empty. I made the following change to make connecting by name work, in function get_device
. could be a macOS bug (Intel only? I'm using Mac mini 2018 and MBP 2019). #58 #62 should be of the same cause.
diff --git blueutil.m blueutil.m
index 47aa91d..b5225d5 100644
--- blueutil.m
+++ blueutil.m
@@ -277,7 +277,7 @@ IOBluetoothDevice *get_device(char *id) {
exit(EXIT_FAILURE);
}
} else {
- NSArray *recentDevices = [IOBluetoothDevice recentDevices:0];
+ NSArray *recentDevices = [IOBluetoothDevice pairedDevices];
if (!recentDevices) {
eprintf("No recent devices to search for: %s\n", id);
from blueutil.
@fsonntag Sadly no, checking on the surface showed that methods are broken and I didn't yet have time to create environment to investigate deeply. For now I can suggest checking if blueutil --paired
or blueutil --connected
can be of help.
from blueutil.
Simplest way to check is by using a script in swift:
#!/usr/bin/env swift
import IOBluetooth
print(IOBluetoothDevice.favoriteDevices()!)
print(IOBluetoothDevice.recentDevices(3)!)
Can you check if it is related to permissions as in #60?
from blueutil.
The scripts returns two empty arrays:
$ ./test.swift
[]
[]
I've read Issue #60 and added the Terminal to the "Developer Tools" privacy section. This doesn’t affect the behaviour. Is there an elegant way to get the full system log using the Console.app or a similar tool?
from blueutil.
Can you try adding the Bluetooth privacy setting (and restart Terminal)?
For system log there is log
command, but it may be tricky to filter for such case. For example everything on all levels containing case insensitive blue: log stream --level debug --color always --timeout 10s | grep -i blue
.
from blueutil.
Alright. I added the Terminal (and also iTerm2 – my primary terminal) to the Bluetooth and the Developer Tools privacy settings. Then run blueutil --favorites
. Given your log
command I get the following output:
blueutil: (libsystem_info.dylib) Retrieve User by ID
bluetoothd: [com.apple.bluetooth:Server.Core] PowerManager power state is 1
bluetoothd: [com.apple.bluetooth:Server.Core] PowerManager power state is 1
bluetoothd: [com.apple.bluetooth:Server.A2DP] No corresponding device for DF963AC9 found in fA2dpHandleToDeviceMap (0 devices)
bluetoothd: [com.apple.bluetooth:Server.A2DP] isStreamingAudioToDevice: Unable to retrieve handle for device.
bluetoothd: [com.apple.bluetooth:Server.A2DP] No corresponding device for 994ABEEE found in fA2dpHandleToDeviceMap (0 devices)
bluetoothd: [com.apple.bluetooth:Server.A2DP] isStreamingAudioToDevice: Unable to retrieve handle for device.
bluetoothd: [com.apple.bluetooth:Server.MacCoex] Posting Bluetooth Status Notification <private>
studentd: (ClassroomKit) [com.apple.classroom:Bluetooth] entered finishedRescanInterval
PerfPowerServices: (CoreBluetooth) [com.apple.bluetooth:CoreBluetooth] -[CBClassicManager retrievePairedPeersWithOptions:] <private>
PerfPowerServices: (CoreBluetooth) [com.apple.bluetooth:CoreBluetooth] -[CBClassicManager retrievePairedPeersWithOptions:] <private>
PerfPowerServices: (CoreBluetooth) [com.apple.bluetooth:CoreBluetooth] Sending synchronous XPC message <private>: <private>
bluetoothd: [com.apple.bluetooth:Server.XPC] Received XPC message "CBMsgIdRetrievePairedPeersWithOptions" from session "com.apple.PerfPowerServices-classic-164-17"
bluetoothd: (CoreFoundation) [com.apple.defaults:User Defaults] looked up value <private> for key [SOME MAC] in CFPrefsPlistSource<0x7fb00020d020> (Domain: com.apple.MobileBluetooth.devices, User: kCFPreferencesCurrentUser, ByHost: No, Container: /Library/Bluetooth, Contents Need Refresh: No) via CFPrefsSearchListSource<0x7fb000115150> (Domain: com.apple.MobileBluetooth.devices, Container: /Library/Bluetooth)
bluetoothd: [com.apple.bluetooth:Server.Core] TagSet's class is not an NSArray, returning error for 69422B50
bluetoothd: [com.apple.bluetooth:Server.Security] 69422B50 hasTS: 0, res: 1
bluetoothd: (CoreFoundation) [com.apple.defaults:User Defaults] looked up value <private> for key [SOME MAC] in CFPrefsPlistSource<0x7fb00020d020> (Domain: com.apple.MobileBluetooth.devices, User: kCFPreferencesCurrentUser, ByHost: No, Container: /Library/Bluetooth, Contents Need Refresh: No) via CFPrefsSearchListSource<0x7fb000115150> (Domain: com.apple.MobileBluetooth.devices, Container: /Library/Bluetooth)
bluetoothd: [com.apple.bluetooth:Server.Core] TagSet's class is not an NSArray, returning error for 683AA17B
…
bluetoothd: [com.apple.bluetooth:Server.Security] 9C6B4312 hasTS: 0, res: 1
bluetoothd: [com.apple.bluetooth:Server.LE] Already tracking address "<private>" as device "[SOME MAC]"
bluetoothd: [com.apple.bluetooth:Server.Core] Get SDP record data from SDP attributes for device 69422B50
bluetoothd: [com.apple.bluetooth:Server.Core] SDP record cache size 1200 with 12 services
bluetoothd: [com.apple.bluetooth:Server.Core] Returning sdp record NSData: <private>
bluetoothd: [com.apple.bluetooth:Server.XPC] bluetoothd sending sdp data: <private>
bluetoothd: [com.apple.bluetooth:Server.LE] Already tracking address "<private>" as device "[SOME MAC]"
bluetoothd: [com.apple.bluetooth:Server.Core] Get SDP record data from SDP attributes for device 683AA17B
bluetoothd: [com.apple.bluetooth:Server.Core] sdp attributes is empty
from blueutil.
@toy Any updates on that? :)
from blueutil.
blueutil --paired
and blueutil --connected
work like a charm…
@fsonntag are you able to reproduce the bug? What device are you using? My speculation is that this bug only affects Intel based devices that run macOS 12.
from blueutil.
@friedrichweise
Sorry for the late reply, somehow missed this :/
Anyway, both commands run without an issue, no error output.
from blueutil.
Related Issues (20)
- [Localization] Support US spelling in list/add/remove favorite HOT 2
- Warn on actions requiring bluetooth to be on
- Wait for *multiple* devices to connect HOT 2
- Magic Mouse 2 doesn't connect HOT 5
- Read and write data HOT 2
- Pairing Issues on BigSur (previously working on Mojave) HOT 4
- [Feature Request] Output Vender and Product IDs
- Create man page
- "--disconnect" doesn't work on MacOS Monterey HOT 12
- Timeout on `--inquiry` does nothing HOT 1
- `--inquiry` not working, but Bluetooth Preferences MacOS GUI correctly discovering mouse - Catalina & Big Sur HOT 12
- Hope to get the battery power of the connected Bluetooth device HOT 2
- Can't connect/disconnect by device name on Monterey HOT 6
- --connect for device is not holding through blueutil, but connection can hold through the Mac GUI HOT 18
- will this allow RFCOMM like functionality on osx12 HOT 4
- Inquiry hanging in macOS 12.4 HOT 2
- Signing app for Gatekeeper HOT 3
- blueutil compatibility HOT 1
- Disconnect/wait-disconnect issues HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blueutil.