- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2017-07-12T13:06:26+00:00","default:admin","admin")
*Bluetooth関連 [#i0064738]
**コマンド [#iaed4830]
#author("2017-07-13T12:43:43+00:00","default:admin","admin")
*コマンド [#iaed4830]
-hciattach - HCI UART driver initialization utility
-hciconfig - HCI device configuration utility
$ sudo hciconfig
-hcidump ... Bluetoothの通信をキャプチャ
--hcidump コマンドを実行した後に
$ hcidump
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
--"sudo l2ping -c 1 0F:02:17:42:61:16" を実行
> HCI Event: Command Status (0x0f) plen 4
Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
status 0x00 handle 12 bdaddr 0F:02:17:42:61:16 type ACL encrypt 0x00
> HCI Event: Command Status (0x0f) plen 4
Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
status 0x00 handle 12
Features: 0xff 0xfb 0x8f 0xf8 0x8b 0x85 0x51 0x83
> HCI Event: Command Status (0x0f) plen 4
Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> HCI Event: Read Remote Extended Features (0x23) plen 13
status 0x00 handle 12 page 1 max 0
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> HCI Event: Command Status (0x0f) plen 4
Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> HCI Event: Remote Name Req Complete (0x07) plen 255
status 0x00 bdaddr 0F:02:17:42:61:16 name 'BlueTooth Printer'
> HCI Event: Command Complete (0x0e) plen 7
Read RSSI (0x05|0x0005) ncmd 1
status 0x00 handle 12 rssi 0
> HCI Event: Command Complete (0x0e) plen 7
Read Link Quality (0x05|0x0003) ncmd 1
status 0x00 handle 12 lq 255
> HCI Event: Command Complete (0x0e) plen 7
Read Transmit Power Level (0x03|0x002d) ncmd 1
status 0x00 handle 12 level 12
> HCI Event: Command Complete (0x0e) plen 7
Read RSSI (0x05|0x0005) ncmd 1
status 0x00 handle 12 rssi 0
> HCI Event: Command Complete (0x0e) plen 7
Read Link Quality (0x05|0x0003) ncmd 1
status 0x00 handle 12 lq 255
> HCI Event: Command Complete (0x0e) plen 7
Read Transmit Power Level (0x03|0x002d) ncmd 1
status 0x00 handle 12 level 12
> HCI Event: Command Complete (0x0e) plen 7
Read RSSI (0x05|0x0005) ncmd 1
status 0x00 handle 12 rssi 0
> HCI Event: Command Complete (0x0e) plen 7
Read Link Quality (0x05|0x0003) ncmd 1
status 0x00 handle 12 lq 255
> HCI Event: Command Complete (0x0e) plen 7
Read Transmit Power Level (0x03|0x002d) ncmd 1
status 0x00 handle 12 level 12
> HCI Event: Command Status (0x0f) plen 4
Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
status 0x00 handle 12 reason 0x16
Reason: Connection Terminated by Local Host
-hcitool
--Bluetoothデバイスをスキャン
$ sudo hcitool scan
--Bluetoothデバイスの情報を表示
$ sudo hcitool info 98:05:10:0D:B2:43
Requesting information ...
BD Address: 98:05:10:0D:B2:43
Device Name: Anker A7721
LMP Version: 3.0 (0x5) LMP Subversion: 0x2211
Manufacturer: Broadcom Corporation (15)
Features page 0: 0xbf 0x06 0x86 0x78 0x18 0x1e 0x59 0x87
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <paging scheme> <power control>
<broadcast encrypt> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <AFH cap. slave>
<AFH class. slave> <sniff subrating> <pause encryption>
<AFH cap. master> <AFH class. master> <extended inquiry>
<simple pairing> <encapsulated PDU> <non-flush flag> <LSTO>
<inquiry TX power> <EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
-hidd
$ sudo hidd --search
-bluez-simple-agent
$ sudo bluez-simple-agent hci0 00:0D:B5:37:97:8F
-sdptool
--Bluetoothデバイスのスキャン
$ sudo sdptool browse
--サービスの強制確認
$ sudo sdptool records 00:0D:B5:37:97:8F
--全てのデバイスの中でシリアルポート機能のあるものを列挙
$ sudo sdptool search SP
-rfcomm
--バインド状況を確認
$ sudo rfcomm -a
--アンバインド
$ sudo rfcomm release 1
-rfkill
--PCに搭載されいる無線デバイスの一覧を表示
$ sudo rfkill list
--PCの無線デバイスを無効にする
$ sudo rfkill block <リスト番号>
-l2ping
$ sudo l2ping -c 4 0F:02:17:42:61:16
Ping: 0F:02:17:42:61:16 from B8:27:EB:78:D3:BF (data size 44) ...
0 bytes from 0F:02:17:42:61:16 id 0 time 50.72ms
0 bytes from 0F:02:17:42:61:16 id 1 time 43.25ms
0 bytes from 0F:02:17:42:61:16 id 2 time 19.89ms
0 bytes from 0F:02:17:42:61:16 id 3 time 52.33ms
4 sent, 4 received, 0% loss
**bluetoothctl [#jaf8d3c4]
-devices
-pair <MAC ADDR>
-trust <MAC ADDR>
-connect <MAC ADDR>
-info <MAC ADDR>
# info 0F:02:17:42:61:16
Device 0F:02:17:42:61:16
Name: BlueTooth Printer
Alias: BlueTooth Printer
Class: 0x000680
Icon: printer
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Serial Port (00001101-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: Battery Service (0000180f-0000-1000-8000-00805f9b34fb)
UUID: Unknown (000018f0-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (e7810a71-73ae-499d-8c15-faa9aef0c3f2)
Modalias: usb:v05ACp0239d0644
-disconnect <MAC ADDR>
*えとせとら [#m76b2693]
-[[/usr/sbin/lpinfo -v does not show network bluetooth, unable to add bluetooth printer:https://bugzilla.redhat.com/show_bug.cgi?id=1077253]]
-[[Bluetooth-Printer Success Howto:http://www.linuxquestions.org/questions/fedora-35/bluetooth-printer-success-howto-611173/#post3854021]]
-[[[SOLVED]Bluetooth didn't work!:https://bbs.archlinux.org/viewtopic.php?id=130995]]
-[[Raspberry Pi の最新 Raspberian OS (JESSIE) で bluez-utils が使えなくなっていた件:http://makers-with-myson.blog.so-net.ne.jp/2016-05-26]]
-[[Bluetooth RFCOMM - Jessie:https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=125922]]
-[[(Ubuntu) コマンドラインでのBluetoothシリアル受信:http://netlog.jpn.org/r271-635/2016/01/ubuntu_bluetooth_serial.html]]
-[[Linux と HOLUX m-241 を Bluetooth でつないで使う:http://nabetaro.hatenablog.com/entry/2013/04/18/220000]]
-[[rfcommをつかって、Bluetooth機器をシリアル通信機器のごとく扱う:http://shuzo-kino.hateblo.jp/entry/2015/01/18/234529]]
-[[Azure IoT Edge を使用して物理デバイス (Linux) に D2C メッセージを送信する:https://docs.microsoft.com/ja-jp/azure/iot-hub/iot-hub-iot-edge-physical-device]]
-[[Linux PCにBluetooth機器を接続する:http://qiita.com/shskwmt/items/fffabf521201f5835214]]