Hi Nick,
When would this be merged to the master branch?
Perfect! Just what I need. Thank you.
Anders
On May 29, 2009 5:46 PM, "Nick Pelly" <npe...@google.com> wrote:On Thu, May 28, 2009 at 2:43 AM, Sumanth <suman...@gmail.com> wrote: > > > Hi Nick, > > When woul...
Nick --~--~---------~--~----~------------~-------~--~----~ You received this message because you ar...
Hi Nick
In the current implementation of BluetoothInputStream and
> InputStream and OutputStream are used for the data path.
BluetoothOutputStream only reading and writing of a single byte is
supported which seems like an inefficient API. Why isn't there a read/
write function supporting large chunks of data?
If the Bluetooth stack complies with the Bluetooth 3.0 HS
specification it would properly be hard to utilize its potential due
to the high number of jni/system calls required for reading and
writing.
Other Bluetooth API doesn't really expose MTU settings since the
> Are there other socket options that may be useful? L2CAP MTU for example. If
> so please explain the use case.
optimal settings for this depends on the actual Bluetooth chip and the
capabilites of remote peer. It might be difficult for the user to set
an optimal value and even so there isn't any guarantee that it would
be honored.
Speaking of efficiency: Has anyone on this list built a firmware+sdk
and used it to create a working RFCOMM Bluetooth application yet?
(Never mind performance of the app.)
I made a quick stab about a week ago, but after about 6 hours of
compilation realized that I had too new JRE and since then I've been
too busy with other things. With a bit of "luck" it will rain all
through my upcoming holidays - that should give me the time I need...
;-)
Best / Jonas
The same could to some extend apply to L2CAP, but since PSMs work a
bit differently than RFCOMM channel a direct value might be useful if
you are trying to implement an official Bluetooth profile in java.
Still I believe this could still be identified by UUID's instead.
Specific value could also be used to identify automatically assignment
such as:
BLUETOOTH_RFCOMM_CHANNEL_AUTOASSIGN = -1;
BLUETOOTH_L2CAP_PSM_AUTOASSIGN = -1;
Some interface for extracting the assigned value would be required for
the registering the SDP record.
Too fully evalute the suggested API might require some more details on
how you are planning to handle SDP since it is such a vital part of
connection establishment.
One feature I'm missing from either this API of the BluetoothDevice
implementation is the controlling of the low power mode. I'm unsure if
BlueZ is capable of handling low power mode without external control.
Hi Nick
Given the discussion about simplifying the API I thought about the
parameters for the functions above. One idea could be to change the
API to something like this:
String serviceUuid) throws IOException;
public static BluetoothSocket createRfcommSocket(String address,
public static BluetoothSocket createInsecureRfcommSocket(Stringaddress, String serviceUuid) throws IOException;
public static BluetoothSocket createScoSocket(String address) throwspublic static BluetoothSocket createL2capSocket(String address, String
IOException;
serviceUuid) throws IOException;
public static BluetoothSocket createInsecureL2capSocket(Stringaddress, String serviceUuid) throws IOException;
Yeah these are neat ideas - and been developed by many people before.
See Bluedating etc.
Leaving a phone in Bluetooth discoverable mode is not a big issue for
power consumption. BT is very power friendly, and discoverable is a
passive mode.
But it does raise questions of privacy. We would need to make the user
aware that by being always discoverable people can detect they are in
the area - even for example several rooms away. So it is unlikely we
would make the Android platform discoverable by default.
We will have two levels of Bluetooth permission for applications.
BLUETOOTH and BLUETOOTH_ADMIN. At this stage we will probably make
turning discoverability on/off a BLUETOOTH_ADMIN permission.
Nick
See http://source.android.com/projects/bluetooth-faq and next time
please keep your questions on topic to the thread.
Nick
Now that 1.6 is more or less done. Any chance of spilling the beans on
the current state of the Bluetooth Socket API in Donut?
There are many of us eagerly waiting for any way at all to transfer
data over bluetooth. Ideally using an official API, but if that is not
an option then going over the NDK or using a reflection or similar
would be better than nothing. At best the result could be contributed.
Best / Jonas
It's just too bad that it's such a closed process. Correct me if I am
wrong, but since there is no access to radio stuff, the community
can't test or develop and just has to wait until you get it done.
I mean you say "solid" but linux itself was developed more openly and
benefited by many people being able to test the code. I am not
suggesting your work won't be solid, but just that the closed nature
of the project seems less than ideal. I concede that may be the
reality working with handset vendors but ... it seems less than ideal.
Shawn
On Thu, Sep 17, 2009 at 18:32, Qwavel <qwa...@gmail.com> wrote:
> On Sep 16, 3:23 pm, Jonas Petersson <catel...@gmail.com> wrote:
>> There are many of us eagerly waiting for any way at all to transfer
>> data over bluetooth. Ideally using an official API, but if that is not
>> an option then going over the NDK or using a reflection or similar
>> would be better than nothing. At best the result could be contributed.
>
> I haven't actually looked at the NDK, but I highly doubt that it
> allows access to Bluez or any other 'internal' API's of Android. I
> don't think that's what it was meant for.
Feel free to doubt, but by requesting the two Bluetooth permissions it
is quite possible to use the system libraries for bluez - it currently
fails on Hero and Galaxy, presumably since their firmwares are not
quite the same. Note: I'm not taking any credit at all for this,
please check the Bluecove project and Mina's Androbex app (on the
Market).
Also, Stefano Sanna has managed to get the hidden APIs working for all
devices except Hero. However, it seems that this route might be closed
in 1.6 due to restructuring of the code, but there may be
alternatives...
True, neither route is perfect, they both prove that the possibility is there.
> I believe that the Android Java Bluetooth API will be the only way for
> you to do what you want.
That will certainly be the BEST way to do it once it exists. In the
mean time we can either patiently wait or impatiently poke around. It
would seem that you belong to the former group while Mina and Stefano
are in the latter and I'd like to do my best to help them out as best
I can. Glory to the brave ;-)
Best / Jonas
On Thu, Sep 17, 2009 at 20:51, Qwavel <qwa...@gmail.com> wrote:
>> > [...]
>> > I believe that the Android Java Bluetooth API will be the only way for
>> > you to do what you want.
>>
>> That will certainly be the BEST way to do it once it exists. In the
>> mean time we can either patiently wait or impatiently poke around. It
>> would seem that you belong to the former group while Mina and Stefano
>> are in the latter and I'd like to do my best to help them out as best
>> I can. Glory to the brave ;-)
>
> That's interesting. I'll have to take a closer look. Getting access
> at that level would be great.
>
> I take it, however, that you are talking about 'unofficial' API's, and
> I'd be concerned about using those for the obvious reasons.
You are not alone: Dianne has put multiple, big frowns on this ;-)
Still, some of us are currently more concerned about getting a bit of Bluetooth
working in the short term than worrying about the occassional frown.
Personally, I can see that working around the hidden api deserves a frown
(but it also gives best potential compatiblity on 1.5), but the NDK route is
IMHO not particularly naughty - just trickier... It may very well be that what
has been found IS broken for the nonworking devices and that is part of the
reason for Nick's message about a solid, stable API.
Best / Jonas
Personally, I can see that working around the hidden api deserves a frown
(but it also gives best potential compatiblity on 1.5), but the NDK route is
IMHO not particularly naughty - just trickier... It may very well be that what
has been found IS broken for the nonworking devices and that is part of the
reason for Nick's message about a solid, stable API.