The Tridecadal Korean (astralblue) wrote,
The Tridecadal Korean
astralblue

  • Location:
  • Mood:

Setting up Mighty Mouse on FreeBSD 7

Again, this is more for future reference for myself than any, but in case some of you have the same issue:

  1. Add to /boot/loader.conf:

    ng_ubt_load="YES"
  2. Add to /etc/rc.conf:

    hcsecd_enable="YES"
    sdpd_enable="YES"
    bthidd_enable="YES"
  3. Reboot, or run:

    kldload ng_ubt
    /etc/rc.d/sdpd start
    /etc/rc.d/hcsecd start
  4. Figure out the name of the Bluetooth HCI node by running:

    hccontrol read_node_list

    The node name will be something like “ubt0hci”; replace all HCINODE below with this name.

  5. Figure out the EUI-48 address (“BD_ADDR” in the output, six hexadecimal bytes separated by colons) of the mouse by running this right after turning on the mouse:

    hccontrol -n HCINODE inquiry

    Replace all BDADDR below with the EUI-48 address.

    Note: Mighty Mouse goes into sleep mode in a minute or so if it can't find a computer that wants to control it.

  6. Optional: Set up a Bluetooth host alias in /etc/bluetooth/hosts by running:

    echo BDADDR BDHOST >> /etc/bluetooth/hosts

    Pick a suitable host name, e.g. “mightymouse”, for BDHOST.

  7. Register the device with bthidd(8) by running:

    bthidcontrol -a BDADDR query >> /etc/bluetooth/bthidd.conf
  8. Register the PIN for the mouse by adding this to /etc/bluetooth/hcsecd.conf:

    device {
            bdaddr  BDADDR;
            name    "Mighty Mouse";
            key     nokey;
            pin     "0000";
    }
  9. Restart hcsecd and bthidd:

    /etc/rc.d/hcsecd restart
    /etc/rc.d/bthidd restart
  10. Turn the mouse off and back on.

  11. If all went well, bthidd will emit messages like these in /var/log/messages:

    Feb 16 23:06:58 seerajeane bthidd[1906]: Accepted control connection from BDADDR
    Feb 16 23:06:58 seerajeane bthidd[1906]: Accepted interrupt connection from BDADDR

Note: Apparently bthidd talks directly to the console control device (/dev/consolectl) to inject mouse messages, without running moused.  Don't be alarmed if you don't see any moused running.  :D

Tags: bluetooth, freebsd
Subscribe

  • GPL, BSDL, SCL?  Move Over!

    Do What the Fuck You Want to Public License Version 2, December 2004 Copyright (C) 2004 Sam Hocevar 22 rue de Plaisance, 75014 Paris, France…

  • WTFLOL

    Playboy.com apparently offers a free community service for open-source geeks. The thing is, it's useful for female geeks too. And yes, it's totally…

  • Open-Source Shortsightitis, Case Study: GIMP

    vxjasonxv wrote in a comment: I never knew gimp didn't support CYMK.... You should hound the devs to add that in XD, that's pretty…

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 4 comments