Template Information

Trang

Android's Bluetooth Support on BeagleBoard

Thứ Hai, 18 tháng 7, 2011 / 21:37

Android

Android is a software stack for mobile devices that includes an operating system, middleware and key applications.

Android and Bluetooth




Modificatation on android source to support Bluetooth

Add 'BOARD_HAVE_BLUETOOTH :=true'
in the file 'ANDROIDSOURCE/build/target/board/generic/BoardConfig.mk'


Android uses 3.36 Bluez Package

Android's Bluetooth stack uses BlueZ version 3.36 for GAP, SDP, and RFCOMM profiles, and is a SIG-qualified Bluetooth 2.0 host stack.
Bluez is GPL licensed, so the Android framework interacts with userspace bluez code through D-BUS IPC to avoid proprietary code.
Headset and Handsfree (v1.5) profiles are implemented in the Android framework and are both tightly coupled with the Phone App. These profiles are also SIG qualified.

BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including:
hciconfig
hcitool
hcidump
sdptool
dbus-send
dbus-monitor

Using OBEX via bluetooth in Android

OBEX (abbreviation of OBject EXchange) is a communications protocol that facilitates the exchange of binary objects between devices
Openobex
The Openobex library provide free and open source impementation of Object Exchange protocol. OBEX is a session protocol and can be best described as a binary HTTP protocol .And the library can help you to transfer all kind of objects like files,pictures,calender entries vCal and business card vCard
obexpushd
It is used to receive files with Obex protocol.
obexftp
ObexFTP is a library bundling everything needed for OBEX transfers and exposing it via a simple interface. There is a sample command line client "obexftp" and a server "obexftpd" included. Besides FTP the ObexFTP library provides access to the PUSH, GOEP and SYNCH services.

Download "obexftp","obexpushd","openobex" packages at below given link...
"http://gitorious.org/android-obex"

Copy the extracted packages to path: 'ANDROIDSOURCE/external'

hciconfig
hciconfig is the equivalent of ifconfig for Bluetooth devices. This is the output of hciconfig on the board.

hci0:
Type: USB
BD Address: 00:E0:98:85:2C:70 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:99 acl:0 sco:0 events:13 errors:0
TX bytes:296 acl:0 sco:0 commands:12 errors:0

If the device is down you can start it with
hciconfig hci0 up


Starting Receive
obexpushd -n -d &

When it launchs an OBEX data server in Android, it would broadcast “OBEX Object Push” service from SDP server. If you use other BT devices to search OBEX service, it can discover Android Dev phone. Once you make a paired connection, you can send files to Android Dev phone via bluetooth. It will automatically store files to sdcard.

Now it's time to discover your mobile phone's bluetooth hardware address. Run:

hcitool scan

Scanning ...
00:80:37:FE:5F:72 MobilePhone

Testing Ping through bluetooth devices can be acheived by.this is similar to the ping command we use in ethernet

l2ping 00:80:37:FE:5F:72

File Transfers can be acheived by

obexftpd -d android.jpg 00:80:37:FE:5F:72 // kumar check ..


Bluetooth Applications ?

Bluetooth FAQ
ttp://sites.google.com/a/android.com/opensource/projects/bluetooth-faq

0 nhận xét:

Đăng nhận xét