Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My bluetooth keyboard shows in Bluetooth control panel but not with blueutil --paired #79

Open
timbyu opened this issue Jul 11, 2023 · 3 comments

Comments

@timbyu
Copy link

timbyu commented Jul 11, 2023

I have a Microsoft Bluetooth Ergonomic Keyboard that keeps going to sleep after 5-10 minutes of inactivity. I was hoping to find a bluetooth utility that would let me interact with the keyboard in hopes that it would keep it awake. Right off the bat when I run blueutil with --paired I see all of my paired devices except this keyboard. When I go into MacOS settings under bluetooth the keyboard is listed as "Ergonomic Keyboard" (it even shows battery life) but it does not show in the list from blueutil. I am running Ventura 13.4.1 on an M2 MacBook pro. Any help for suggestions for how I can keep my bluetooth keyboard from sleeping would be very very much appreciated!
image

@toy
Copy link
Owner

toy commented Jul 11, 2023

Thanks for opening the issue. Do you have this one? Tech specs tab shows that it is using Low Energy Bluetooth, not Classic Bluetooth. Currently blueutil only provides access to Classic devices (using IOBluetooth framework), as interface to Low Energy devices is in separate framework (Core Bluetooth).
After looking at specs of few modern Bluetooth keyboards, I see that decent part of them are using Low Energy, so a good idea to check feasibility of adding interface to them to blueutil.

@timbyu
Copy link
Author

timbyu commented Jul 12, 2023

I have this one https://www.microsoft.com/en-us/d/surface-ergonomic-keyboard/90pnc9ljwpx9 that says it is Bluetooth 4.0. I don't see anything about it being Low Energy but I guess it could be. If I were to get into the Core Bluetooth framework, what approach would you suggest to keep my keyboard from going to sleep?

@toy
Copy link
Owner

toy commented Jul 12, 2023

Bluetooth 4.0 can be both Classic and Low Energy, though tech specs tab from the link mentions «Bluetooth Low Energy compatible 4.0/4.1». After looking a bit at Core Bluetooth framework, I can say that unfortunately big part of it is not public.
I don't know what will help keeping the keyboard from going to sleep, is it on keyboard side or on os side, is there an app from microsoft for configuring it?
As an example of Core Bluetooth framework, here is an example for listing paired Low Energy devices:

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

int main() {
  @autoreleasepool {
    CBCentralManager *manager = [[CBCentralManager alloc] init];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
    id agent = [manager performSelector:@selector(sharedPairingAgent)];
    NSLog(@"%@", [agent performSelector:@selector(retrievePairedPeers)]);
#pragma clang diagnostic pop
  }
  return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants