Bluez関連のメモ

主に下のページを参考にさせてもらった。

http://ytomoweb.hp.infoseek.co.jp/sh2linux/dev/bt/bt.html

BLUEZ公式サイトより、ソースパッケージをダウンロード。

最新版は、

  • bluez-libs-3.29.tar.gz
  • bluez-utils-3.29.tar.gz

なんだけど、utilsのconfigureを実行したときに、libが見つからないとか言われるので、結局古いバージョンで試してます。

  • bluez-libs-2.25.tar.gz
  • bluez-utils-2.25.tar.gz
Bluez-libのmake

bluez-libs-2.25.tar.gzを解凍して、

# ./configure --prefix=/usr
# make
# make install

libxml, libxml2

http://iohack.sourceforge.jp/debian/binary-sh4/

から、以下のパッケージをダウンロード、インストール。

  • libxml-dev_1.8.17-10_sh4.deb
  • libxml1_1.8.17-10_sh4.deb
  • libxml2-dev_2.6.16-7_sh4.deb
  • libxml2_2.6.16-7_sh4.deb
dbus

http://iohack.sourceforge.jp/kogiidena/debian26/binary-sh4-etch/dbus/

から以下のパッケージをダウンロード、インストール。

  • dbus-1_0.23.4-1_sh4.deb
GLibc2

GLIBC_2.0が無ぇとか言われたので、

http://iohack.sourceforge.jp/kogiidena/debian26/binary-sh4-etch/glibc/

から、

  • libc6_2.3.5-8_sh4.deb

をダウンロードしてインストール。

bluez-utils

bluez-utils-2.25.tar.gzを解凍して、

# ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc -localstatedir=/var --libexecdir=/lib
# make
# make install

認識!

usl-5p:/home/landisk# hciconfig
hci0: Type: USB
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:0 acl:0 sco:0 commands:0 errors:0

起動

usl-5p:/home/landisk# hciconfig hci0 up
usl-5p:/home/landisk# hciconfig
hci0: Type: USB
BD Address: 00:13:EF:F0:DD:53 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:71 acl:0 sco:0 events:8 errors:0
TX bytes:31 acl:0 sco:0 commands:8 errors:0

スキャン

usl-5p:/home/landisk# hcitool scan
Scanning ...
00:1D:FE:01:45:91 Centro

l2ping

usl-5p:/home/landisk# l2ping -c 4 00:1D:FE:01:45:91
Ping: 00:1D:FE:01:45:91 from 00:13:EF:F0:DD:53 (data size 44) ...
0 bytes from 00:1D:FE:01:45:91 id 0 time 32.96ms
0 bytes from 00:1D:FE:01:45:91 id 1 time 35.72ms
0 bytes from 00:1D:FE:01:45:91 id 2 time 35.04ms
0 bytes from 00:1D:FE:01:45:91 id 3 time 31.03ms
4 sent, 4 received, 0% loss

"0 bytes"だけど、応答があるからいいのかな?

サービス問い合わせ

usl-5p:/home/landisk# sdptool browse 00:1D:FE:01:45:91
Browsing 00:1D:FE:01:45:91 ...
Service Name: Voice Gateway
Service RecHandle: 0x10000
Service Class ID List:
"Handfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 7
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0101

Service Name: AUDIO Gateway
Service RecHandle: 0x10002
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100

Service Name: OBEX Object Push
Service RecHandle: 0x10003
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x8cc
base_offset: 0x100