bluetooth.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 03 Jan 2021 23:37:00 +0200
changeset 2492 bd3d45148652
parent 2228 837f1337c59b
permissions -rw-r--r--
Fixed example.

.. -*- coding: utf-8; -*-

===========
 Bluetooth
===========
.. contents::
   :local:

Specification
=============

http://www.bluetooth.com/English/Technology/Building/Pages/Specification.aspx
  Download page
http://en.wikipedia.org/wiki/Bluetooth_profile
  Wiki page

Debian
======
::

  $ sudo apt-get install bluetooth
  $ sudo apt-get install bluez-utils

BlueZ
=====

BlueZ is official Linux Bluetooth protocol stack.

How find local bluetooth device?
================================
::

  $ hcitool dev
  Devices:
    hci0    00:03:C9:05:65:98
    hci1    00:1F:81:00:02:5A

or (hciconfig placed in /usr/sbin, so see you PATH!)::

  $ hciconfig -a
  hci0:   Type: USB
    BD Address: 00:03:C9:05:65:98 ACL MTU: 1017:8 SCO MTU: 64:0
    UP RUNNING PSCAN
    RX bytes:2517 acl:12 sco:0 events:64 errors:0
    TX bytes:756 acl:12 sco:0 commands:33 errors:0
    Features: 0xff 0xff 0x8d 0xfe 0x9b 0xfd 0x00 0x80
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF PARK
    Link mode: SLAVE ACCEPT
    Name: 'desktop-0'
    Class: 0x3e0100
    Service Classes: Networking, Rendering, Capturing, Object Transfer, Audio
    Device Class: Computer, Uncategorized
    HCI Ver: 2.0 (0x3) HCI Rev: 0x2000 LMP Ver: 2.0 (0x3) LMP Subver: 0x415c
    Manufacturer: Broadcom Corporation (15)

  hci1:   Type: USB
    BD Address: 00:1F:81:00:02:5A ACL MTU: 339:6 SCO MTU: 180:1
    UP RUNNING PSCAN
    RX bytes:398 acl:0 sco:0 events:18 errors:0
    TX bytes:317 acl:0 sco:0 commands:17 errors:0
    Features: 0xef 0x3e 0x09 0xf0 0x0b 0x08 0x00 0x00
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF PARK
    Link mode: SLAVE ACCEPT
    Name: 'desktop-1'
    Class: 0x3e0100
    Service Classes: Networking, Rendering, Capturing, Object Transfer, Audio
    Device Class: Computer, Uncategorized
    HCI Ver: 1.2 (0x2) HCI Rev: 0x2 LMP Ver: 1.2 (0x2) LMP Subver: 0x2
    Manufacturer: not assigned (74)

How find remote bluetooth device?
=================================
::

  $ hcitool scan
  Scanning ...
        00:22:66:D1:B7:20       Nokia 5320

In order to do this remote device must be set "visible".

How to set bluetooth dongle "visible"?
======================================
::

  $ hciconfig -a | grep hci.:
  hci0: Type: USB

  $ sudo hciconfig hci0 piscan

How to determine bluetooth dongle is "visible"?
===============================================

Run hciconfig -a and see for PSCAN and ISCAN keyword::

  $ hciconfig -a
  hci0: Type: USB
  ...
      UP RUNNING PSCAN ISCAN
  ...

then try from another host::

  $ hcitool scan

or use another device such as phone to search.

What version of Bluetooth support local device?
===============================================

HCI (Host/Controller Interface), LMP (Link Management Protocol)::

  $ sudo hciconfig -a
  hci0:   Type: USB
  ...
      HCI Ver: 2.0 (0x3) HCI Rev: 0x2000 LMP Ver: 2.0 (0x3) LMP Subver: 0x415c
  ...
  hci1:   Type: USB
  ...
      HCI Ver: 1.2 (0x2) HCI Rev: 0x2 LMP Ver: 1.2 (0x2) LMP Subver: 0x2
  ...

What version of Bluetooth support remote device?
================================================
::

  $ hcitool info 00:22:66:D1:B7:20 | grep LPM
  LPM Version: 2.0 (0x3) LPM Subversion: 0x7a6

What support remote device?
===========================
::

  $ sudo sdptool browse  00:22:66:D1:B7:20

  Browsing 00:22:66:D1:B7:20 ...
  Service Name: AVRCP Target
  Service Description: Audio Video Remote Control
  Service Provider: Symbian Software Ltd.
  Service RecHandle: 0x10000
  Service Class ID List:
    "AV Remote Target" (0x110c)
  Protocol Descriptor List:
    "L2CAP" (0x0100)
      PSM: 23
    "AVCTP" (0x0017)
      uint16: 0x100
  Profile Descriptor List:
    "AV Remote" (0x110e)
      Version: 0x0100
  ...

  00:1b:52:a8:f6:96

See:

http://www.bluez.org/
  bluez home page

Remote control throw mobile.
============================

* http://anyremote.sourceforge.net/docs.html

Spec
====

See:

* http://www.bluetooth.com/Bluetooth/Technology/Building/Specifications/

Bluetooth on Windows.
=====================

``bthprops.cpl`` used for administrating Bluetooth device in Windows XP.

``ipconfig`` used for see assigned IP address by PAN (Personal Area Networking).

``telephon.cpl`` used to add modem.

``fsquirt.exe`` used to send/recive file.

http://support.microsoft.com/kb/883259
  How to install and configure Bluetooth devices in Windows XP Service Pack 2
http://support.microsoft.com/kb/841803
  List of Bluetooth radio drivers that are included in Windows XP SP2