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

Incorrect manufacturer detected for Bluetooth Apple Magic Keyboard #783

Open
schontz opened this issue Mar 10, 2023 · 4 comments · May be fixed by #784
Open

Incorrect manufacturer detected for Bluetooth Apple Magic Keyboard #783

schontz opened this issue Mar 10, 2023 · 4 comments · May be fixed by #784

Comments

@schontz
Copy link

schontz commented Mar 10, 2023

I have a Bluetooth Magic Keyboard, full size. bluetoothDevices() gives me the following:

[
  {
    device: '0x800020 < HID ACL >',
    name: 'FirstName LastName’s Keyboard',
    manufacturer: 'FirstName',
    macDevice: 'd4:dc:cd:83:d2:XX',
    macHost: '3c:06:30:3f:24:YY',
    batteryPercent: null,
    type: 'Keyboard',
    connected: true
  }
]

When I run system_profiler SPBluetoothDataType -json, I get:

{
  "SPBluetoothDataType" : [
    {
      "controller_properties" : {
        "controller_address" : "3C:06:30:3F:24:YY",
        "controller_chipset" : "BCM_4378",
        "controller_discoverable" : "attrib_off",
        "controller_firmwareVersion" : "20.1.500.3160",
        "controller_productID" : "0x4A01",
        "controller_state" : "attrib_on",
        "controller_supportedServices" : "0x382039 < HFP AVRCP A2DP HID Braille AACP GATT SerialPort >",
        "controller_transport" : "PCIe",
        "controller_vendorID" : "0x004C (Apple)"
      },
      "device_connected" : [
        {
          "FirstName LastName’s Keyboard" : {
            "device_address" : "D4:DC:CD:83:D2:XX",
            "device_batteryLevelMain" : "100%",
            "device_firmwareVersion" : "1.6.0",
            "device_minorType" : "Keyboard",
            "device_productID" : "0x026C",
            "device_rssi" : "-55",
            "device_services" : "0x800020 < HID ACL >",
            "device_vendorID" : "0x004C"
          }
        }
      ]
    }
  ]
}
@schontz
Copy link
Author

schontz commented Mar 10, 2023

I am on macOS Ventura 13.2.1. On versions < 5.12, I get no bluetooth devices. On version >= 5.12, I get my name as the manufacturer.

@schontz
Copy link
Author

schontz commented Mar 10, 2023

The issue is that if device_manufacturer is missing, it parses the manufacturer from the device_name. Instead, it should be parsing it from device_vendorID, e.g., as listed here.

@sebhildebrandt
Copy link
Owner

@schontz … will provide a fix for that. Thank you for your investigation.

@schontz
Copy link
Author

schontz commented Mar 10, 2023

I have a POC that uses that table. I'll submit a PR, and if it's useful you can merge it.

@schontz schontz linked a pull request Mar 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants