Please don't use ALL CAPS subjects. It is bad list etiquette.
Anyway to answer your questions...
Right now these are included in framework.jar, so they are part of the project
platform/frameworks/base.git
in locations such as
frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
frameworks/base/core/java/android/bluetooth/BluetoothHeadset.java
Often these API (well-not-quite-yet) classes are just proxies for the
real service that executes in the System Server. For example
frameworks/base/core/java/android/server/BluetoothDeviceService.java
frameworks/base/core/java/android/server/BluetoothEventLoop.java
The JNI that backs the system server implementations is in
libandroid_runtime.so, and part of the same project, and can be found
in locations such as
frameworks/base/core/jni/android_server_BluetoothDeviceService.cpp
frameworks/base/core/jni/android_server_BluetoothEventLoop.cpp
You didn't ask, but the HFP and HSP profile implementations are
actually included in the Phone application right now. For example
packages/apps/Phone/src/com/android/phone/BluetoothHeadsetService.java
packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
I really recommend checking out the entire Android codebase using
repo. Then you can quickly use
find . -name FILENAME
to find the locations of these files.
Nick
On Thu, Jan 8, 2009 at 11:46 AM, dec...@shanaghy.com
<dec...@shanaghy.com> wrote:
>
> Thanks for the info.
> I am interested in jumping in on some bluetooth development also.
Great!
> I'd like to add support for the HID profile.
There's actually not far to go. I've already set up the Android
Makefile for the bluez HID plugin
external/bluez/utils/input/Android.mk
so the module is already compiled. You can even use HID support right
now by talking directly to the bluez HID plugin with dbus. Try
dbus-send and dbus-monitor etc.
Whats needed is to plumb through this API up in the Android Java
framework. Also the Android framework needs better support for
alternative input methods such as mice and keyboards with different
keymaps. I haven't really investigated this side of things yet,
hopefully it is easier now in cupcake with the Input Method Framework.
> I'd like some more info on the feasibility of this making it into a
> release.
To actually release this in a product like the T-Mobile G1 we need to
pass Bluetooth qualification. But first step is to get the support
into the platform.
>
> What im wondering is do the releases stick to an approved roadmap or
> can unscheduled/unexpected contributions make it into a release fairly
> easily.
Unscheduled / unexpected contributions to the platform are very
welcome! We cannot guarantee they will make it into a device release
since thats up to the OEM's and carriers, and specifically in the case
of Bluetooth we need to pass qualification. But we should always
include as many profiles as possible in the open source codebase.
> Also can i make my own branch for this feature or would it be assigned
> to a specifi branch by someone?
This would go into our master branch.
Nick
DUN and PAN are a similar situation to HID, except they run as there
own daemons. Bluez already has these daemons, and these are already
compiled and installed in the cupcake codebase.
There is some work required to plumb Java API's to the dbus interfaces
of these daemons, and automatically set up the network path via pppd
and iptables.
And of course qualification before it could be officially released in a product.
On Thu, Jan 8, 2009 at 11:34 PM, coolio <justi...@gmail.com> wrote:
>
> Hi Nick,
>
> As you may remember that I have build release-1.0 based code running
> on G1. I managed to have a green check mark on enabling BT. However,
> the scanning comes up empty.
>
> It is nice that hci command is build in with adb so that I have played
> with it a little bit.
>
> hcitool devices will return the BT address, that is good. However,
> hcitool scan or hcitool inq always come up empty. I put some message
> in hci_inquiry which scan or inq use. The following are the parameters
> that were passed into the function,
> dev_id = -1, len = 8, nrsp = 0, flags = 0 and the three bytes of lap
> are 0x33, 0x8b and 0x9e, which are all normal.
>
> The file descriptor returned by socket() is 3.
> ioctl() returns 0, no error.
>
> However, hci_inquiry still returns 0.
>
> I suspect that the RF of BT on G1 is not on. Set BT to discoverable,
> other BT devices can not find G1 either.
>
> WiFi can not turn on either.
>
> Any quick pointers?
Some random hints...
You can run
adb shell hcidump -XVt
In one window to monitor all HCI traffic with the Bluetooth chip. If
you see data going both ways '<' and '>' then you know the HCI UART
link is good,
I usually run
adb shell hciconfig -a
To check if we can talk to the BT chip, because it will always send an
HCI command or two and needs a response. It does not do anything over
RF. Sounds like you've found a few other commands like hcitool that
will also confirm this.
It sounds like you do have HCI communication if you can get hold of
the local BT address. Yes hcitool scan or inq would be the next things
i'd try. I know its stupid but make absolutely sure your other devices
really are in discoverable mode. You could also try l2ping.
Are hciattach and hcid running?
Try running hciattach and hcid under logwrapper (edit init.rc and
init.trout.rc) so that you can view there STDOUT through logcat. Maybe
there is some error.
It is very strange if you can talk HCI to the BT chip but you cannot
do anything that involves RF. This should just work.
I wonder if you have a bad firmware file? This could affect RF but not
HCI. hciattach loads the firmware, would be good to view its logs.
Looks like the firmware file brf6300.bin is not in the open source
codebase, you would have to pull it from a stock G1.
Nick
Glad that fixed your issue.
Yes, Ideally a system.img for a G1 contains the firmware file. I'll
look into getting brf6300.bin into the open source codebase. Hopefully
it is not there for some technical issue.
On Sat, Jan 10, 2009 at 4:50 PM, Declan Shanaghy <dec...@shanaghy.com> wrote:
> Just saw your suggestion to hun the services thru logwrapper and did so.
>
> Seems that libril.so is crashing.
This should not prevent Bluetooth from working.
> I saw a post elsewhere that the HTC proprietary binaries (primarily for ril)
> are out of date with respect to the latest code on the main branch, is this
> really so?
>
> I have attached a bugreport.
Your bugreport does not show you starting Bluetooth. What do the logs
shows when you do this?
>
> On Sat, Jan 10, 2009 at 3:37 PM, Declan Shanaghy <dec...@shanaghy.com>
> wrote:
>>
>> OK well i managed to get the BT binaries to build by setting
>> BOARD_HAVE_BLUETOOTH:=true in mydroid/buildspec.mk
This is correct.
>> I pushed up brf6300.bin to /system/etc/firmware but
>> bluetooth still wont start from the setting dialog.
Nick
This is strange. I would suggest adding some logging to
BluetoothDeviceService.java:enable(), or breakpointing, to see what is
going on.
BTW, I have started a Bluetooth FAQ that covers a lot of the answers I
have already given, and some other useful information. It will get
fleshed out as time goes on.
http://source.android.com/projects/bluetooth-faq
Nick
Regards,
Syam Sidhardhan
-----Original Message-----
From: android-...@googlegroups.com [mailto:android-...@googlegroups.com] On Behalf Of coolio
Sent: Friday, January 09, 2009 1:05 PM
To: android-platform
Subject: Re: BLUETOOTH CODE ORGANISATION IN CUPCAKE RELEASE
Thats using the low speed uart driver. Should work though.
>
> and have the brf6300.bin file in /system/etc/firmware.
>
> ls -l /dev/ gives the following:
> crw------- bluetooth bluetooth 250, 0 2009-01-15 15:44 ttyHS0
> crw------- bluetooth bluetooth 251, 0 2009-01-15 15:44 ttyMSM0
Ok so you have a kernel with the old uart driver and the new high
speed uart driver - good.
>
> Anyone has an idea why "device" isn't readable?
>
Sounds like you are trying to start Bluetooth manually. The first step
is to turn on power to the BT chip.
adb shell "echo 1 > /sys/class/rfkill/rfkill0/state"
I think this will fix your issue. If not it is probably permissions
related. Try running hciattach via an init.rc for so that it gets the
right user and groups. For example:
service hciattach /system/bin/hciattach \
-n -s 115200 /dev/ttyHS0 texas 4000000 flow
user bluetooth
group bluetooth net_bt_admin
disabled
Let me know how it goes.
Nick
Yes. We've been running 4Mbps in cupcake for many weeks now.