bt_addr is opened
/sys/devices/virtual/switch/dock/bt_addr is accessed/read
bt_addr is closed
/sys/devices/virtual/switch/dock/bt_pin is modified
bt_pin is opened
/sys/devices/virtual/switch/dock/bt_pin is modified
/sys/devices/virtual/switch/dock/bt_pin is written and closed
I'm not entirely sure what the magic recipe is, but my N1 dock is working for A2DP at the moment, playing music from my stock Galaxy S 4.
I poked around a bit; with sshdroid running on my (rooted/CM) N1, here are the approximate-ish steps I took. These steps may not be an exact reproduction of what I did, and contain no timing information.
- N1: in docking station (paired, connected)
- N1: cd /sys/devices/virtual/switch/dock
- N1: cat bt_addr -> valid dock BT addr -> looks good
- N1: cat bt_pin -> cat: read error: I/O error
- N1: echo 0000 > bt_pin
- N1: disable bluetooth (still in dock)
- S4: enable bluetooth & scan
- S4: magic! the N1 dock showed up; I paired with it, connected to it...
unplugged it, moved it to my room with a stereo, and I was able to connect to it from my S4 with no problem.
I'm not actually convinced that writing to the pin did anything. It may have just been the act of scanning for it while the N1 was docked... or a lucky guess. I tend to have good luck with embedded devices. Either way, I'm not going to mess with it further at this point.
-g
It works with the Nexus Car Dock too. I managed to pair my Nexus 7 2013 with both docks. A dock can only have one device connected at a time, but the pairing remains functional for both (Nexus One, Nexus 7 2013).
The steps you gave are pretty much all needed. The only one that can be skipped would be "cat bt_pin". I can't see how to improve on that.
The last hurdle to overcome is to enable the pairing without needing a working Nexus One.
guys can i have more information on what kernel/image you were using at the time?
mine has stock kernel i guess, and CM7 (latest nightly they released)
i did the steps. did have to get root to write to bt_pin tho.
and nothing works.
trying to connect a nexus 5. nothing shows up when i disable bluetooth on the N1 still on the dock.
---------
Edit:
Success! some more information.
to read the original pin, not really usefull, you have to implement the interface on the kernel. http://stackoverflow.com/questions/...ice-attribute-fails-with-error-invalid-length
There is a setting "fast connect" under bluetooth, that must be off.
and it only worked for me after:
1. N1 on dock
2. bluetooth on
3. set pin to 0000 (i used terminal emulator. and i have to `su` before i can write the file)
4. turn bluetooth off
5. set pin to 0000 again.
only after i set the pin AFTER bluetooth off, i was able to see the bt_addr device on the N5.
also one caveat to pay attention. i tried setting the pin AFTER removing the phone from the dock. after that i can't pair it even with the N1. but it resolved after a reboot (thankfully /sys is read only that is why i try setting the pin before turning bt off. may not be necessary, but doesn't hurt and i was trying to avoid yet another reboot...
thanks everyone for this thread