Virtual HID Keyboard for OS X

I am trying to create a bluetooth virtual client for Mac OS. that means my mac will serve as BT KB. I read about the bluetooth API in OS X (in ObjC) and I also found the HID API for Mac (in C)

To do this work, I understand that I need to declare a hidden keyboard service that should be broadcast on SDP requests.

  • If I declare a HID service using the HID API, is my service visible / broadcast via Bluetooth too? (the docs appear to be HID only for USB). - Are HID services visible on both Bluetooth and USB interfaces, and is the underlying connection transparent to me?
  • Is there any code that will help me with this you know? I prefer ObjC, but it looks like the HID API is only C :: (

Thanks...

+6
source share
2 answers

As I understand it, the HID device driver is a local device for the OS and OS for various other components. It is not used to โ€œstreamโ€ to USB and Bluetooth. As far as I know, OS X does not include the Bluetooth HID service, and OS X and USB chipsets on the Mac do not support USB device mode - or at least they do not disclose it.

You want to write a bluetooth service. I did not do this, but the documentation seems to be extensive. As I understand it, you will somehow have to implement your HID service based on the basic Bluetooth protocol L2CAP.

Since I have not studied either Bluetooth or Bluetooth support for Mac, I cannot provide more help. I looked at the HID protocol specifications and even played with them. The HID is relatively trivial to implement, but first a little work will be done to implement the Bluetooth service.

+1
source

It seems that similar tools exist for Linux and may have useful source code. See this thread for links.

0
source

Source: https://habr.com/ru/post/895922/


All Articles