View Single Post
Old 07-27-2016, 11:16 AM   #9
Euphoric
Member
Euphoric began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2016
Device: KT3W
Sure, this is much clearer than the original post, no arguing possible...

It's also more generic since I was only interested in a bluetooth keyboard, but you're right : other bluetooth devices could be of interest (e.g elm327 OBD for cars, bluetooth GPS, ...).

(I've always thought that when you're not a native speaker, you cannot be on a par in a discussion, but I'm starting to wonder if that was not an excuse for a different problem... )

Anyway, I guess all of you don't have the same Kindle device, so I've started to look into some places (no need to answer, there's no question in this post (yet...), I'm just trying to tease a bluetooth guru...):

- sources provided by Amazon (more exactly the parts needed for them to conform with GPL) : no bluetooth-concerned application module or library... However, the 3.10.53 Linux kernel has a bluetooth driver...

- couldn't find the BlueZ commands so tried a 'find' of files with names starting with bluetooth in the filesystem : except two PNG images in the webkit's assets, it only returns a bluetooth directory in /proc and another one in /opt/brcm4343w/ (but since I have not opened my Kindle, I cannot affirm this Avnet BCM4343W module (combining a Broadcom Wifi + Bluetooth SoC with an STM32F411 Cortex M4 mcu) is really responsible of the wireless capabilities of the Kindle 8).

- so /proc/bluetooth/ contains a btenable "file", and a sleep directory that contains asleep | btwake | hostwake | proto | uart_clk entries. Also, a cat of /proc/btmac-addr or /proc/device-tree/chosen/btmac returns the MAC address of the kindle, starting with 44650D which correctly is the vendor signature of Amazon Technologies Inc.

- tried to find files starting with 'bt' : another bunch of three entries in /proc/device-tree/bt_pwr_ctrl : bt_host_wake, bt_dev_wake and bt_rst. But also a few entries in the SysFS.

- As for executable programs, it seems there's only three in /usr/bin : btui, btconnectionhelper and btd. The later one surely is the Bluetooth daemon. I was expecting btui to be a graphical program, but instead it's a text-only user interface. I will report experiments with these programs in a second answer in order to keep this one short (ahem).

- finally, there are bluetooth javascripts in /usr/share/webkit-1.0/pillow/javascripts, called by the three bluetooth html dialogs in /usr/share/webkit-1.0/pillow ( bt_forget_dialog.html, bt_paired_device_wizard.html, bt_switch_dialog.html). I'm not a javascript developer, and the scripts are several kilobytes long on a single line without a single whitespace, but it seems the actions on the bluetooth are done by the setLipcProperty method, like in
Code:
nativeBridge.setLipcProperty("com.lab126.btmd","Connect",e.bdAddress)
.
I have also seen this setLipcProperty method displayed in a 'strings /usr/bin/btd', but for now am clueless about how this works...
Euphoric is offline   Reply With Quote