The idea generally is to have the mouse working with windows, and then copied its credentials to linux.
My OSs are windows 10 64bit and Ubuntu 16.04 64bit with 4.10 kernel;
Mouse is Microsoft 3600
- have bluez and blueman installed in linux (so it works with BLE mouse)
- pair the mouse with linux and then windows. (so it is working in windows)
- extract credentials from registry. (use "psexec -s -i regedit", find and export as txt: "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys\<MAC of BT adapter>\<MAC of BT mouse>")
- Fill the credentials to Linux ("/var/lib/bluetooth/<MAC of BT adapter>/<MAC of BT mouse>/info")
- Restart BT service ("/etc/init.d/bluetooth restart")
Below are detailed mapping and manipulation for step 4 above:
- Make sure the MAC of BT mouse is correct in Linux. If they are different, rename the directory in linux to match the MAC found in Windows. (Examine it character by character. This file for mine was always off by one bit by default in linux)
- "LTK" -> "Key" under [LongTermKey]. Remove anything other than hex character (e.g. whitespace and dash), and convert to upper case.
- "ERand" -> "Rand" under [LongTermKey]. Do BYTE-WISE reverse and then convert hex to dec. (e.g., "12 AB" -> "AB 12" -> "43794")
- "EDIV" -> "EDiv" under [LongTermKey]. Convert hex to dec.
- "IRK" -> "Key" under [IdentityResolvingKey]. Remove anything other than hex character
- "CSRK" -> "Key" under [LocalSignatureKey]. Remove anything other than hex character
- Leave "EncSize" and "Authenticated" unchanged