back to index

BLE, Bluetooth Low Energy tags and fun
Terminology
      Pairing, bonding
Profiles
PROTOCOLS
      GAP, Generic Access Protocol
      GATT, Generic Attribute Protocol
            services
            characteristics
TOOLS
      installing bettercap
      btmon
      bluetoothctl
      hcitool, hciconfig, hcidump
      gatttool
Tile, Inc. "Tile 1.0"
      some listening
      bleah
      gatttool
      tile on bluetoothctl:
      bettercap
fitness tracker
selfie stick MP107
      bluetoothctl
      gatttool
      dmesg
      events
      bluetoothctl vs hcitool connect behavior
      multiple devices
            from /proc subsystem
      reinitializing
            udevadm monitor
            udevadm monitor -p
            udevadm monitor -p, new device after bluetooth restart
      udevadm /dev/input/input* interrogation
      input sensitivity
      parts
            ST17H26
      scope
      hidraw
            pin 7, hidraw
                  down
                  up
            pin 9, hidraw
                  down
                  up
            pin 10, hidraw
                  down
                  up
            pin 7
            pin 9
            pin 10
      /dev/hidrawX
      HID descriptor parsed by HIDRDD
            pin 7, hidraw
                  down
                  up
            pin 9, hidraw
                  down
                  up
            pin 10, hidraw
                  down
                  up
      libinput:
            list devices:
laptop
headset Jabra
      labels on charging base:
      labels on headset:
      control
      in default a2dp profile
      in hsp/hfp profile
      someone else's headset
      ofono/phonesim
      hcitool
      services discovery
      btclassify
      rfcomm communication
      HFP profiles
      HSP connection:
headset Nokia
BTLEjack
HID packets
      from two machines

BLE, Bluetooth Low Energy tags and fun

...if nno device on hcitool dev:

hciconfig hci0 up

Terminology


Pairing, bonding

https://piratecomm.wordpress.com/2014/01/19/ble-pairing-vs-bonding/
Pairing: exchange of the initial credentials, temporary keys used
Bonding: follows pairing, more secure keys stored in device
    no further key exchange needed to connect with a bonded device

Secure Simple Pairing (SSP). During SSP initially each device determines its capability for input and output (IO).
The input can be None, Yes/No, or Keyboard with Keyboard having the ability to input a number.
The output can be either None or Display with Display having the ability to display a 6-digit number.


Profiles

HSP - headset profile - basic bidirectional mono audio (and control?) link betweeen phone and headset
HFP - handsfree profile - HSP plus more command functions (originally car handsfree units)
A2DP - advanced audio distribution profile - unidirectional high-quality stereo audio
AVRCP - audio/video remote control profile - commands for A2DP

devices can support multiple profiles running in parallel (A2DP + AVRCP) or switching in between (A2DP/HSP)



PROTOCOLS


GAP, Generic Access Protocol

central devices: lots of power
peripheral devices: saving occurs here

peripherals send advertisings, every (say) 2 seconds. central then responds with scan response request

GATT, Generic Attribute Protocol


services

service is a container for characteristics
well-known services have 16-bit UUID
vendor-specific services have 128-bit UUID

characteristics

characteristic is a single-point data source/sink



TOOLS


installing bettercap

...bleah failed on interrogating the selfiestick tag

...need to install "bettercap", as "bleah" was folded into that and outdated
"apt-get install golang" worked but attempt to run make on bettercap failed, on constraint.go:378: undefined: sort.SliceStable ...needs go at least 1.10, raspbian is 1.7 (sheesh!)
...so, https://gist.github.com/random-robbie/1f7f94beda1221b8125b62abe35f45b6
install_go_pi.sh wget https://storage.googleapis.com/golang/go1.10.1.linux-armv6l.tar.gz sudo tar -C /usr/local -xvf go1.10.1.linux-armv6l.tar.gz cat >> ~/.bashrc << 'EOF' export GOPATH=$HOME/go export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin EOF source ~/.bashrc > ...and...
make gofmt -s -w core firewall log modules network packets session tls Makefile:59: recipe for target 'gomegacheck' failed make: *** [gomegacheck] Error 2 ...comment the functions using those out, just locally, and run make again...
fail, gofmt -s -w core firewall log modules network packets session tls Makefile:7: recipe for target 'deps' failed make: *** [deps] Error 1 ...so...
go version ...and we're the bloody apt-get installed 1.7 when we need the 1.10
so cd /usr/lib mv go-1.7 go-1.7.old ln -s /usr/local/go/ go-1.7 ...and get back to ~/go/src/github.com/bettercap/bettercap
run make fail on missing dep ln -s ~/go/bin/dep /usr/local/bin/ run make gofmt -s -w core firewall log modules network packets session tls Makefile:13: recipe for target 'build' failed make: *** [build] Error 2 KHAAAAAAAAAAAN!!! ...because it runs in /tmp and we got tmp in tmpfs in ram to not wear the card.
...so...
mkdir /tmp2 mount -B /tmp2 /tmp ...and wonder what fails now...
...AND IT WORKS!!!

btmon

nice bluetooth packet monitor

bluetoothctl

interactive console tool for interrogation, read, write, connect


hcitool, hciconfig, hcidump

hciconfig handles the interface itself:
hciconfig hci0 up
hciconfig hci0 down

hcidump packet-dumps the data

hcitool allows connection, disconnection, pairing for both LE and non-LE devices
hcitool scan
hcitool lescan

hcitool pscan|iscan|piscan     ...page/inquiry/page+inquiry scan

gatttool

for interrogation of the GATT protocol




Tile, Inc. "Tile 1.0"


some listening

Got: 'rsp=$scan addr=bDB040E003C77 type=h2 rssi=h44 flag=h0 d=b0201050303ECFE\n'
    Device (new): db:04:0e:00:3c:77 (random), -68 dBm
        Flags: <05>
        Complete 16b Services: 
Got: "rsp=$stat state=$disc mtu=h0 sec='low\n"

Got: 'rsp=$scan addr=bDB040E003C77 type=h2 rssi=h3B flag=h0 d=b0201050303ECFE\n'
    Device (new): db:04:0e:00:3c:77 (random), -59 dBm
        Flags: <05>
        Complete 16b Services: 


bleah

bleah -e
@ Connecting to db:04:0e:00:3c:77 ... connected.
@ Enumerating all the things .....

┌──────────────┬───────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────┬───────────────────────────────────────────────────┐
│ Handles      │ Service > Characteristics                                                             │ Properties              │ Data                                              │
├──────────────┼───────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────┼───────────────────────────────────────────────────┤
│ 0001 -> 0007 │ Generic Access ( 00001800-0000-1000-8000-00805f9b34fb )                               │                         │                                                   │
│ 0003         │   Device Name ( 00002a00-0000-1000-8000-00805f9b34fb )                                │ READ WRITE              │ u'Tile'                                           │
│ 0005         │   Appearance ( 00002a01-0000-1000-8000-00805f9b34fb )                                 │ READ                    │ Generic Keyring                                   │
│ 0007         │   Peripheral Preferred Connection Parameters ( 00002a04-0000-1000-8000-00805f9b34fb ) │ READ                    │ Connection Interval: 288 -> 304                   │
│              │                                                                                       │                         │ Slave Latency: 4                                  │
│              │                                                                                       │                         │ Connection Supervision Timeout Multiplier: 600    │
│              │                                                                                       │                         │                                                   │
│ 0008 -> 000b │ Generic Attribute ( 00001801-0000-1000-8000-00805f9b34fb )                            │                         │                                                   │
│ 000a         │   Service Changed ( 00002a05-0000-1000-8000-00805f9b34fb )                            │ INDICATE                │                                                   │
│              │                                                                                       │                         │                                                   │
│ 000c -> 000f │ Battery Service ( 0000180f-0000-1000-8000-00805f9b34fb )                              │                         │                                                   │
│ 000e         │   Battery Level ( 00002a19-0000-1000-8000-00805f9b34fb )                              │ NOTIFY READ             │ u'd'                                              │
│              │                                                                                       │                         │                                                   │
│ 0010 -> 0021 │ feed ( 0000feed-0000-1000-8000-00805f9b34fb )                                         │                         │                                                   │
│ 0012         │   9d410004-35d6-f4dd-ba60-e7bd8dc491c0                                                │ NOTIFY                  │                                                   │
│ 0015         │   9d410006-35d6-f4dd-ba60-e7bd8dc491c0                                                │ READ                    │ 'JE36404VPTA\x00\x00\x00\x00\x00\x00\x00\x00\x00' │
│ 0017         │   9d410007-35d6-f4dd-ba60-e7bd8dc491c0                                                │ READ                    │ "\x06\xf2\xeb\xd8'\xd4\r\x83"                     │
│ 0019         │   9d410005-35d6-f4dd-ba60-e7bd8dc491c0                                                │ READ                    │ '\xba'                                            │
│ 001b         │   9d410002-35d6-f4dd-ba60-e7bd8dc491c0                                                │ WRITE                   │                                                   │
│ 001d         │   9d410008-35d6-f4dd-ba60-e7bd8dc491c0                                                │ WRITE NO RESPONSE       │                                                   │
│ 001f         │   9d41000d-35d6-f4dd-ba60-e7bd8dc491c0                                                │ WRITE NO RESPONSE       │                                                   │
│ 0021         │   9d41000e-35d6-f4dd-ba60-e7bd8dc491c0                                                │ READ WRITE NO RESPONSE  │ '\xfe'                                            │
│              │                                                                                       │                         │                                                   │
│ 0022 -> ffff │ Device Information ( 0000180a-0000-1000-8000-00805f9b34fb )                           │                         │                                                   │
│ 0024         │   Manufacturer Name String ( 00002a29-0000-1000-8000-00805f9b34fb )                   │ READ                    │ u'Tile, Inc.'                                     │
│ 0026         │   Model Number String ( 00002a24-0000-1000-8000-00805f9b34fb )                        │ READ                    │ u'Tile 1.0'                                       │
│ 0028         │   Serial Number String ( 00002a25-0000-1000-8000-00805f9b34fb )                       │ READ                    │ u'JE36404VPTA'                                    │
│ 002a         │   Hardware Revision String ( 00002a27-0000-1000-8000-00805f9b34fb )                   │ READ                    │ u'1.0'                                            │
│ 002c         │   Firmware Revision String ( 00002a26-0000-1000-8000-00805f9b34fb )                   │ READ                    │ u'1.00.022'                                       │
│              │                                                                                       │                         │                                                   │
└──────────────┴───────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────┴───────────────────────────────────────────────────┘
/bettercap
ble.recon on » ble.enum DB:04:0E:00:3C:77 [16:49:18] [sys.log] [inf] ble.recon connecting to db:04:0e:00:3c:77 ... 10.0.0.0/24 > 10.0.0.110  » ┌──────────────┬───────────────────────────────────────────────────────┬──────────────┬────────────────────────────────────────────────┐ │ Handles │ Service > Characteristics │ Properties │ Data │ ├──────────────┼───────────────────────────────────────────────────────┼──────────────┼────────────────────────────────────────────────┤ │ 0001 -> 0007 │ Generic Access (1800) │ │ │ │ 0003  │ Device Name (2a00) │ READ, WRITE │ Tile │ │ 0005  │ Appearance (2a01) │ READ │ Generic Keyring │ │ 0007  │ Peripheral Preferred Connection Parameters (2a04) │ READ │ Connection Interval: 288 -> 304  │ │ │ │ │ Slave Latency: 4  │ │ │ │ │ Connection Supervision Timeout Multiplier: 600 │ │ │ │ │ │ │ 0008 -> 000b │ Generic Attribute (1801) │ │ │ │ 000a │ Service Changed (2a05) │ INDICATE │ │ │ │ │ │ │ │ 000c -> 000f │ Battery Service (180f) │ │ │ │ 000e │ Battery Level (2a19) │ READ, NOTIFY │ > │ │ │ │ │ │ │ 0010 -> 0021 │ feed │ │ │ │ 0012  │ 9d41000435d6f4ddba60e7bd8dc491c0  │ NOTIFY │ │ │ 0015  │ 9d41000635d6f4ddba60e7bd8dc491c0  │ READ │ JE36404VPTA000000000000000000  │ │ 0017  │ 9d41000735d6f4ddba60e7bd8dc491c0  │ READ │ 06òëØ'Ô0d83  │ │ 0019  │ 9d41000535d6f4ddba60e7bd8dc491c0  │ READ │ ¿ │ │ 001b │ 9d41000235d6f4ddba60e7bd8dc491c0  │ WRITE │ │ │ 001d │ 9d41000835d6f4ddba60e7bd8dc491c0  │ WRITE │ │ │ 001f │ 9d41000d35d6f4ddba60e7bd8dc491c0  │ WRITE │ │ │ 0021  │ 9d41000e35d6f4ddba60e7bd8dc491c0  │ READ, WRITE │ þ │ │ │ │ │ │ │ 0022 -> ffff │ Device Information (180a) │ │ │ │ 0024  │ Manufacturer Name String (2a29) │ READ │ Tile, Inc. │ │ 0026  │ Model Number String (2a24) │ READ │ Tile 1.0  │ │ 0028  │ Serial Number String (2a25) │ READ │ JE36404VPTA │ │ 002a │ Hardware Revision String (2a27) │ READ │ 1.0  │ │ 002c │ Firmware Revision String (2a26) │ READ │ 1.00.022  │ │ │ │ │ │ └──────────────┴───────────────────────────────────────────────────────┴──────────────┴────────────────────────────────────────────────┘ 0x19 == 0xbc..c6, fluctuating independently(?) 0x21 == 0xfe, can be modified 0x17 == 06 f2 eb d8 27 d4 0d 83 0x15 == 4a 45 33 36 34 30 34 56 50 54 41 00 00 00 00 00 00 00 00 00  (text string with serial no.)

gatttool

...needs "-t random" otherwise noninteractive attempt timeouts!

0012 NOTIFY: when enabled sends 0x01 on keyrelease on the TILE button enable by sending 0100 to handle 0x13 gatttool: char-write-req 0x1b 00 Characteristic value was written successfully char-write-req 0x1b 00 ...disconnects
char-write-req 0x21 fd Characteristic value was written successfully char-read-hnd 0x21 Characteristic value/descriptor: fd char-read-hnd 0x19 Characteristic value/descriptor: bb (fluctuates between a7..c9 or so) [DB:04:0E:00:3C:77][LE]> char-read-hnd 0x13 Characteristic value/descriptor: 00 00 [DB:04:0E:00:3C:77][LE]> char-write-req 0x13 0100 Characteristic value was written successfully [DB:04:0E:00:3C:77][LE]> char-read-hnd 0x13 Characteristic value/descriptor: 01 00 (keypresses on the device) Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 aNotification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 > char-write-req 0x1b XX Characteristic value was written successfully XX action 01  plays a long chirpy melody 02  plays melody 2 03  plays melody 3 04  plays melody 4 05  long long beep 06  quick chirp ...sometimes this requrest results in
(gatttool:31845): GLib-WARNING **: Invalid file descriptor. and loss of connection. that can take a while to remedy. Characteristic value was written successfully Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 Notification handle = 0x0012 value: 01 [db:04:0e:00:3c:77][LE]> primary Command Failed: Disconnected [db:04:0e:00:3c:77][LE]> services Error: services: command not found [db:04:0e:00:3c:77][LE]> connect Attempting to connect to db:04:0e:00:3c:77 Connection successful [db:04:0e:00:3c:77][LE]> primary attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb attr handle: 0x000c, end grp handle: 0x000f uuid: 0000180f-0000-1000-8000-00805f9b34fb attr handle: 0x0010, end grp handle: 0x0021 uuid: 0000feed-0000-1000-8000-00805f9b34fb attr handle: 0x0022, end grp handle: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb [db:04:0e:00:3c:77][LE]> help help Show this help exit Exit interactive mode quit Exit interactive mode connect [address [address type]] Connect to a remote device disconnect Disconnect from a remote device primary [UUID] Primary Service Discovery included [start hnd [end hnd]] Find Included Services characteristics [start hnd [end hnd [UUID]]] Characteristics Discovery char-desc [start hnd] [end hnd] Characteristics Descriptor Discovery char-read-hnd Characteristics Value/Descriptor Read by handle char-read-uuid [start hnd] [end hnd] Characteristics Value/Descriptor Read by UUID char-write-req Characteristic Value Write (Write Request) char-write-cmd Characteristic Value Write (No response) sec-level [low | medium | high] Set security level. Default: low mtu Exchange MTU for GATT/ATT [db:04:0e:00:3c:77][LE]> included No included services found for this range [db:04:0e:00:3c:77][LE]> characteristics handle: 0x0002, char properties: 0x0a, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb handle: 0x0009, char properties: 0x20, char value handle: 0x000a, uuid: 00002a05-0000-1000-8000-00805f9b34fb handle: 0x000d, char properties: 0x12, char value handle: 0x000e, uuid: 00002a19-0000-1000-8000-00805f9b34fb handle: 0x0011, char properties: 0x10, char value handle: 0x0012, uuid: 9d410004-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0014, char properties: 0x02, char value handle: 0x0015, uuid: 9d410006-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0016, char properties: 0x02, char value handle: 0x0017, uuid: 9d410007-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0018, char properties: 0x02, char value handle: 0x0019, uuid: 9d410005-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x001a, char properties: 0x08, char value handle: 0x001b, uuid: 9d410002-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x001c, char properties: 0x04, char value handle: 0x001d, uuid: 9d410008-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x001e, char properties: 0x04, char value handle: 0x001f, uuid: 9d41000d-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0020, char properties: 0x06, char value handle: 0x0021, uuid: 9d41000e-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0023, char properties: 0x02, char value handle: 0x0024, uuid: 00002a29-0000-1000-8000-00805f9b34fb handle: 0x0025, char properties: 0x02, char value handle: 0x0026, uuid: 00002a24-0000-1000-8000-00805f9b34fb handle: 0x0027, char properties: 0x02, char value handle: 0x0028, uuid: 00002a25-0000-1000-8000-00805f9b34fb handle: 0x0029, char properties: 0x02, char value handle: 0x002a, uuid: 00002a27-0000-1000-8000-00805f9b34fb handle: 0x002b, char properties: 0x02, char value handle: 0x002c, uuid: 00002a26-0000-1000-8000-00805f9b34fb [db:04:0e:00:3c:77][LE]> [db:04:0e:00:3c:77][LE]> char-desc handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb handle: 0x0006, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb handle: 0x0008, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0009, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x000a, uuid: 00002a05-0000-1000-8000-00805f9b34fb handle: 0x000b, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x000c, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x000d, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x000e, uuid: 00002a19-0000-1000-8000-00805f9b34fb handle: 0x000f, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0010, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0011, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0012, uuid: 9d410004-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0013, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0014, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0015, uuid: 9d410006-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0016, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0017, uuid: 9d410007-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0018, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0019, uuid: 9d410005-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x001a, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x001b, uuid: 9d410002-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x001c, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x001d, uuid: 9d410008-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x001e, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x001f, uuid: 9d41000d-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0020, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0021, uuid: 9d41000e-35d6-f4dd-ba60-e7bd8dc491c0 handle: 0x0022, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0023, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0024, uuid: 00002a29-0000-1000-8000-00805f9b34fb handle: 0x0025, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0026, uuid: 00002a24-0000-1000-8000-00805f9b34fb handle: 0x0027, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0028, uuid: 00002a25-0000-1000-8000-00805f9b34fb handle: 0x0029, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002a, uuid: 00002a27-0000-1000-8000-00805f9b34fb handle: 0x002b, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002c, uuid: 00002a26-0000-1000-8000-00805f9b34fb

tile on bluetoothctl:


[bluetooth]# info DB:04:0E:00:3C:77
Device DB:04:0E:00:3C:77
        Alias: DB-04-0E-00-3C-77
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: Tile, Inc.                (0000feec-0000-1000-8000-00805f9b34fb)
        RSSI: -77
[bluetooth]# connect DB:04:0E:00:3C:77
Attempting to connect to DB:04:0E:00:3C:77
[CHG] Device DB:04:0E:00:3C:77 Connected: yes
Connection successful
[DB-04-0E-00-3C-77]# info DB:04:0E:00:3C:77
Device DB:04:0E:00:3C:77
        Alias: DB-04-0E-00-3C-77
        Paired: no
        Trusted: no
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Tile, Inc.                (0000feec-0000-1000-8000-00805f9b34fb)
        RSSI: -77
[NEW] Primary Service
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0008
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0008/char0009
        00002a05-0000-1000-8000-00805f9b34fb
        Service Changed
[NEW] Descriptor
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0008/char0009/desc000b
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service000c
        0000180f-0000-1000-8000-00805f9b34fb
        Battery Service
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service000c/char000d
        00002a19-0000-1000-8000-00805f9b34fb
        Battery Level
[NEW] Descriptor
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service000c/char000d/desc000f
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010
        0000feed-0000-1000-8000-00805f9b34fb
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char0011
        9d410004-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Descriptor
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char0011/desc0013
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char0014
        9d410006-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char0016
        9d410007-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char0018
        9d410005-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char001a
        9d410002-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char001c
        9d410008-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char001e
        9d41000d-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0010/char0020
        9d41000e-35d6-f4dd-ba60-e7bd8dc491c0
        Vendor specific
[NEW] Primary Service
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0022
        0000180a-0000-1000-8000-00805f9b34fb
        Device Information
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0022/char0023
        00002a29-0000-1000-8000-00805f9b34fb
        Manufacturer Name String
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0022/char0025
        00002a24-0000-1000-8000-00805f9b34fb
        Model Number String
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0022/char0027
        00002a25-0000-1000-8000-00805f9b34fb
        Serial Number String
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0022/char0029
        00002a27-0000-1000-8000-00805f9b34fb
        Hardware Revision String
[NEW] Characteristic
        /org/bluez/hci0/dev_DB_04_0E_00_3C_77/service0022/char002b
        00002a26-0000-1000-8000-00805f9b34fb
        Firmware Revision String
[CHG] Device DB:04:0E:00:3C:77 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device DB:04:0E:00:3C:77 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device DB:04:0E:00:3C:77 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device DB:04:0E:00:3C:77 UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device DB:04:0E:00:3C:77 UUIDs: 0000feed-0000-1000-8000-00805f9b34fb
[CHG] Device DB:04:0E:00:3C:77 ServicesResolved: yes
[CHG] Device DB:04:0E:00:3C:77 Name: Tile
[CHG] Device DB:04:0E:00:3C:77 Alias: Tile
[CHG] Device DB:04:0E:00:3C:77 Appearance: 0x0240

bettercap

/bettercap
ble.recon on » ble.enum DB:04:0E:00:3C:77 [16:49:18] [sys.log] [inf] ble.recon connecting to db:04:0e:00:3c:77 ... 10.0.0.0/24 > 10.0.0.110  » ┌──────────────┬───────────────────────────────────────────────────────┬──────────────┬────────────────────────────────────────────────┐ │ Handles │ Service > Characteristics │ Properties │ Data │ ├──────────────┼───────────────────────────────────────────────────────┼──────────────┼────────────────────────────────────────────────┤ │ 0001 -> 0007 │ Generic Access (1800) │ │ │ │ 0003  │ Device Name (2a00) │ READ, WRITE │ Tile │ │ 0005  │ Appearance (2a01) │ READ │ Generic Keyring │ │ 0007  │ Peripheral Preferred Connection Parameters (2a04) │ READ │ Connection Interval: 288 -> 304  │ │ │ │ │ Slave Latency: 4  │ │ │ │ │ Connection Supervision Timeout Multiplier: 600 │ │ │ │ │ │ │ 0008 -> 000b │ Generic Attribute (1801) │ │ │ │ 000a │ Service Changed (2a05) │ INDICATE │ │ │ │ │ │ │ │ 000c -> 000f │ Battery Service (180f) │ │ │ │ 000e │ Battery Level (2a19) │ READ, NOTIFY │ > │ │ │ │ │ │ │ 0010 -> 0021 │ feed │ │ │ │ 0012  │ 9d41000435d6f4ddba60e7bd8dc491c0  │ NOTIFY │ │ │ 0015  │ 9d41000635d6f4ddba60e7bd8dc491c0  │ READ │ JE36404VPTA000000000000000000  │ │ 0017  │ 9d41000735d6f4ddba60e7bd8dc491c0  │ READ │ 06òëØ'Ô0d83  │ │ 0019  │ 9d41000535d6f4ddba60e7bd8dc491c0  │ READ │ ¿ │ │ 001b │ 9d41000235d6f4ddba60e7bd8dc491c0  │ WRITE │ │ │ 001d │ 9d41000835d6f4ddba60e7bd8dc491c0  │ WRITE │ │ │ 001f │ 9d41000d35d6f4ddba60e7bd8dc491c0  │ WRITE │ │ │ 0021  │ 9d41000e35d6f4ddba60e7bd8dc491c0  │ READ, WRITE │ þ │ │ │ │ │ │ │ 0022 -> ffff │ Device Information (180a) │ │ │ │ 0024  │ Manufacturer Name String (2a29) │ READ │ Tile, Inc. │ │ 0026  │ Model Number String (2a24) │ READ │ Tile 1.0  │ │ 0028  │ Serial Number String (2a25) │ READ │ JE36404VPTA │ │ 002a │ Hardware Revision String (2a27) │ READ │ 1.0  │ │ 002c │ Firmware Revision String (2a26) │ READ │ 1.00.022  │ │ │ │ │ │ └──────────────┴───────────────────────────────────────────────────────┴──────────────┴────────────────────────────────────────────────┘

fitness tracker

10.0.0.0/24 > 10.0.0.110  » [17:36:23] [ble.device.new] new BLE device honor Band 3-644 detected as B0:E1:7E:30:26:44 (Huawei Technologies Co.,Ltd) -86 dBm.
10.0.0.0/24 > 10.0.0.110  » [17:36:23] [ble.device.new] new BLE device detected as 7C:62:CD:D3:1B:98 (Google) -92 dBm.
10.0.0.0/24 > 10.0.0.110  » [17:36:24] [ble.device.new] new BLE device detected as 27:4C:0F:A7:75:0D (Apple, Inc.) -94 dBm.
10.0.0.0/24 > 10.0.0.110  » ble.recon on[17:36:28] [ble.device.new] new BLE device detected as 9C:8C:6E:D6:7D:5D (Samsung Electronics Co.,Ltd) -107 dBm.
10.0.0.0/24 > 10.0.0.110  » ble.enum B0:E1:7E:30:26:44
[17:36:33] [sys.log] [inf] ble.recon connecting to b0:e1:7e:30:26:44 ...
10.0.0.0/24 > 10.0.0.110  »
┌──────────────┬───────────────────────────────────────────────────────┬─────────────────────┬──────────────────────────────────────────────────────────────────────┐
│   Handles    │               Service > Characteristics               │     Properties      │                                 Data                                 │
├──────────────┼───────────────────────────────────────────────────────┼─────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ 0001 -> 0009 │ Generic Access (1800)                                 │                     │                                                                      │
│ 0003         │     Device Name (2a00)                                │ READ, WRITE         │ honor Band 3-644                                                     │
│ 0005         │     Appearance (2a01)                                 │ READ                │ Unknown                                                              │
│ 0007         │     Peripheral Preferred Connection Parameters (2a04) │ READ                │ Connection Interval: 32 -> 48                                        │
│              │                                                       │                     │ Slave Latency: 4                                                     │
│              │                                                       │                     │ Connection Supervision Timeout Multiplier: 500                       │
│ 0009         │     2aa6                                              │ READ                │ 01                                                                   │
│              │                                                       │                     │                                                                      │
│ 000a -> 000d │ Generic Attribute (1801)                              │                     │                                                                      │
│ 000c         │     Service Changed (2a05)                            │ INDICATE            │                                                                      │
│              │                                                       │                     │                                                                      │
│ 000e -> 0011 │ Battery Service (180f)                                │                     │                                                                      │
│ 0010         │     Battery Level (2a19)                              │ READ, NOTIFY        │ 2                                                                    │
│              │                                                       │                     │                                                                      │
│ 0012 -> 001c │ Device Information (180a)                             │                     │                                                                      │
│ 0014         │     Manufacturer Name String (2a29)                   │ READ                │ HUAWEI                                                               │
│ 0016         │     Model Number String (2a24)                        │ READ                │ HUAWEI                                                               │
│ 0018         │     Firmware Revision String (2a26)                   │ READ                │ 3.1.0                                                                │
│ 001a         │     Software Revision String (2a28)                   │ READ                │ 1.5.35                                                               │
│ 001c         │     PnP ID (2a50)                                     │ READ                │ Vendor ID: 0x027d (USB Implementer’s Forum assigned Vendor ID value) │
│              │                                                       │                     │ Product ID: 0xeeee                                                   │
│              │                                                       │                     │ Product Version: 0x0001                                              │
│              │                                                       │                     │                                                                      │
│ 001d -> 002e │ Human Interface Device (1812)                         │                     │                                                                      │
│ 001f         │     Protocol Mode (2a4e)                              │ READ, WRITE         │ 01                                                                   │
│ 0021         │     Report (2a4d)                                     │ READ, WRITE, NOTIFY │                                                                      │
│ 0025         │     Report Map (2a4b)                                 │ READ                │ 050c0901¡0185011500%01u01950809µ09¶09·09009Í09â09é09ê8102À           │
│ 0027         │     Boot Keyboard Input Report (2a22)                 │ READ, NOTIFY        │ 7fæßa0¢apg                                                           │
│ 002a         │     Boot Keyboard Output Report (2a32)                │ READ, WRITE         │ c                                                                    │
│ 002c         │     HID Information (2a4a)                            │ READ                │ 01010003                                                             │
│ 002e         │     HID Control Point (2a4c)                          │ WRITE               │                                                                      │
│              │                                                       │                     │                                                                      │
│ 002f -> 0034 │ Heart Rate (180d)                                     │                     │                                                                      │
│ 0031         │     Heart Rate Measurement (2a37)                     │ NOTIFY              │                                                                      │
│ 0034         │     Body Sensor Location (2a38)                       │ READ                │ 02                                                                   │
│              │                                                       │                     │                                                                      │
│ 0035 -> ffff │ fe86                                                  │                     │                                                                      │
│ 0037         │     fe01                                              │ WRITE               │                                                                      │
│ 0039         │     fe02                                              │ NOTIFY              │                                                                      │
│ 003c         │     fe03                                              │ WRITE               │                                                                      │
│ 003e         │     fe04                                              │ NOTIFY              │                                                                      │
│              │                                                       │                     │                                                                      │
└──────────────┴───────────────────────────────────────────────────────┴─────────────────────┴──────────────────────────────────────────────────────────────────────┘




selfie stick MP107

┌ ff:ff:c3:0f:03:5e (-71 dBm) ──────────────────────────────┐
│ Vendor                  │ ?                               │
│ Allows Connections      │ ✓                               │
│ Complete Local Name     │ MP107                           │
│ Incomplete 16b Services │ u'1218'                         │
│ Appearance              │ u'c103'                         │
│ Flags                   │ LE Limited Discoverable, BR/EDR │
└─────────────────────────┴─────────────────────────────────┘

/bettercap
ble.recon on » ble.enum FF:FF:C3:0F:03:5E [16:51:13] [sys.log] [inf] ble.recon connecting to ff:ff:c3:0f:03:5e ... 10.0.0.0/24 > 10.0.0.110  » ┌──────────────┬───────────────────────────────────────────────────────┬──────────────┬──────────────────────────────────────────────────────────────────────┐ │ Handles │ Service > Characteristics │ Properties │ Data │ ├──────────────┼───────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────────────────────────────────┤ │ 0001 -> 0004 │ Generic Attribute (1801) │ │ │ │ 0003  │ Service Changed (2a05) │ INDICATE │ │ │ │ │ │ │ │ 0005 -> 000b │ Generic Access (1800) │ │ │ │ 0007  │ Device Name (2a00) │ READ, NOTIFY │ MP107  │ │ 0009  │ Appearance (2a01) │ READ │ Unknown │ │ 000b │ Peripheral Preferred Connection Parameters (2a04) │ READ │ Connection Interval: 20 -> 40  │ │ │ │ │ Slave Latency: 0  │ │ │ │ │ Connection Supervision Timeout Multiplier: 1000  │ │ │ │ │ │ │ 000c -> 000e │ Device Information (180a) │ │ │ │ 000e │ PnP ID (2a50) │ READ │ Vendor ID: 0x248a (USB Implementer’s Forum assigned Vendor ID value) │ │ │ │ │ Product ID: 0x8266  │ │ │ │ │ Product Version: 0x0001  │ │ │ │ │ │ │ 000f -> 001f │ Human Interface Device (1812) │ │ │ │ 0011  │ Protocol Mode (2a4e) │ READ, WRITE │ 01  │ │ 0013  │ Report (2a4d) │ READ, NOTIFY │ 0000  │ │ 0017  │ Report (2a4d) │ READ, NOTIFY │ 0000  │ │ 001b │ Report Map (2a4b) │ READ │ 050c0901¡01850209é09ê09â0901501%0cu10  │ │ 001d │ HID Information (2a4a) │ READ │ 11010001  │ │ 001f │ HID Control Point (2a4c) │ WRITE │ │ │ │ │ │ │ │ 0020 -> 0022 │ Battery Service (180f) │ │ │ │ 0022  │ Battery Level (2a19) │ READ, NOTIFY │ c │ │ │ │ │ │ └──────────────┴───────────────────────────────────────────────────────┴──────────────┴──────────────────────────────────────────────────────────────────────┘ 10.0.0.0/24 > 10.0.0.110  » [21:18:49] [ble.device.new] new BLE device MP107  detected as FF:FF:C3:0F:03:5E -79 dBm. ...things seizing on enum of this one!
from hcidump: 2019-05-25 21:19:51.153469 < HCI Command: Disconnect (0x01|0x0006) plen 3 handle 64 reason 0x13 Reason: Remote User Terminated Connection 2019-05-25 21:19:51.154156 > HCI Event: Command Status (0x0f) plen 4 Disconnect (0x01|0x0006) status 0x00 ncmd 1 2019-05-25 21:19:51.162162 > HCI Event: Disconn Complete (0x05) plen 4 status 0x00 handle 64 reason 0x16 Reason: Connection Terminated by Local Host 2019-05-25 21:19:51.162438 < HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 0000: 01  . 2019-05-25 21:19:51.163438 > HCI Event: Command Complete (0x0e) plen 4 LE Set Advertise Enable (0x08|0x000a) ncmd 1 status 0x0c Error: Command Disallowed

bluetoothctl

[bluetooth]# connect FF:FF:C3:0F:03:5E
Attempting to connect to FF:FF:C3:0F:03:5E
[CHG] Device FF:FF:C3:0F:03:5E Connected: yes
Connection successful
[NEW] Primary Service
        /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0001
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
[NEW] Characteristic
        /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0001/char0002
        00002a05-0000-1000-8000-00805f9b34fb
        Service Changed
[NEW] Descriptor
        /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0001/char0002/desc0004
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service
        /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service000c
        0000180a-0000-1000-8000-00805f9b34fb
        Device Information
[NEW] Characteristic
        /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service000c/char000d
        00002a50-0000-1000-8000-00805f9b34fb
        PnP ID
[NEW] Primary Service
        /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0020
        0000180f-0000-1000-8000-00805f9b34fb
        Battery Service
[NEW] Characteristic
        /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0020/char0021
        00002a19-0000-1000-8000-00805f9b34fb
        Battery Level
[CHG] Device FF:FF:C3:0F:03:5E UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device FF:FF:C3:0F:03:5E UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device FF:FF:C3:0F:03:5E UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device FF:FF:C3:0F:03:5E UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device FF:FF:C3:0F:03:5E UUIDs: 00001812-0000-1000-8000-00805f9b34fb
[CHG] Device FF:FF:C3:0F:03:5E ServicesResolved: yes
[CHG] Device FF:FF:C3:0F:03:5E Paired: yes
[CHG] Device FF:FF:C3:0F:03:5E Icon is nil
[CHG] Device FF:FF:C3:0F:03:5E Appearance is nil
[CHG] Device FF:FF:C3:0F:03:5E Modalias: usb:v248Ap8266d0001

gatttool

[ff:ff:c3:0f:03:5e][LE]> connect
Attempting to connect to ff:ff:c3:0f:03:5e
Error: connect: Device or resource busy (16)
[ff:ff:c3:0f:03:5e][LE]> connect
Attempting to connect to ff:ff:c3:0f:03:5e
Error: connect: Device or resource busy (16)
[ff:ff:c3:0f:03:5e][LE]>
[ff:ff:c3:0f:03:5e][LE]> quit

...but we are online - attempt to connect to something else sends data through hcidump, here we see just the error

...and hcidump shows data from the device:
...onkeydown...
2019-05-25 21:33:36.382603 > ACL data: handle 64 flags 0x02 dlen 9 ATT: Handle notify (0x1b) handle 0x0017 value 0x00 0x28 2019-05-25 21:33:36.420123 > ACL data: handle 64 flags 0x02 dlen 9 ATT: Handle notify (0x1b) handle 0x0013 value 0x01 0x00 ...onkeyup...
2019-05-25 21:33:39.795134 > ACL data: handle 64 flags 0x02 dlen 9 ATT: Handle notify (0x1b) handle 0x0013 value 0x00 0x00 2019-05-25 21:33:39.870133 > ACL data: handle 64 flags 0x02 dlen 9 ATT: Handle notify (0x1b) handle 0x0017 value 0x00 0x00 ...and bluetoothctl is immediately connecting us to the device.
[NEW] Controller B8:27:EB:EA:B7:B8 BlueZ 5.47 [default] [NEW] Device FF:FF:C3:0F:03:5E MP107 [NEW] Primary Service /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0020 0000180f-0000-1000-8000-00805f9b34fb Battery Service [NEW] Characteristic /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0020/char0021 00002a19-0000-1000-8000-00805f9b34fb Battery Level [NEW] Primary Service /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service000c 0000180a-0000-1000-8000-00805f9b34fb Device Information [NEW] Characteristic /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service000c/char000d 00002a50-0000-1000-8000-00805f9b34fb PnP ID [NEW] Primary Service /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0001 00001801-0000-1000-8000-00805f9b34fb Generic Attribute Profile [NEW] Characteristic /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0001/char0002 00002a05-0000-1000-8000-00805f9b34fb Service Changed [NEW] Descriptor /org/bluez/hci0/dev_FF_FF_C3_0F_03_5E/service0001/char0002/desc0004 00002902-0000-1000-8000-00805f9b34fb Client Characteristic Configuration [NEW] Device DB:04:0E:00:3C:77 Tile Agent registered [MP107  ]# info Device FF:FF:C3:0F:03:5E Name: MP107 Alias: MP107 Paired: yes Trusted: no Blocked: no Connected: yes LegacyPairing: no 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: Human Interface Device (00001812-0000-1000-8000-00805f9b34fb) Modalias: usb:v248Ap8266d0001 [MP107  ]# disconnect Attempting to disconnect from FF:FF:C3:0F:03:5E [CHG] Device FF:FF:C3:0F:03:5E ServicesResolved: no Successful disconnected [CHG] Device FF:FF:C3:0F:03:5E Connected: no ...so, back to gatttool...
[ff:ff:c3:0f:03:5e][LE]> primary attr handle: 0x0001, end grp handle: 0x0004 uuid: 00001801-0000-1000-8000-00805f9b34fb attr handle: 0x0005, end grp handle: 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb attr handle: 0x000c, end grp handle: 0x000e uuid: 0000180a-0000-1000-8000-00805f9b34fb attr handle: 0x000f, end grp handle: 0x001f uuid: 00001812-0000-1000-8000-00805f9b34fb attr handle: 0x0020, end grp handle: 0x0022 uuid: 0000180f-0000-1000-8000-00805f9b34fb [ff:ff:c3:0f:03:5e][LE]> included No included services found for this range [ff:ff:c3:0f:03:5e][LE]> characteristics handle: 0x0002, char properties: 0x20, char value handle: 0x0003, uuid: 00002a05-0000-1000-8000-00805f9b34fb handle: 0x0006, char properties: 0x12, char value handle: 0x0007, uuid: 00002a00-0000-1000-8000-00805f9b34fb handle: 0x0008, char properties: 0x02, char value handle: 0x0009, uuid: 00002a01-0000-1000-8000-00805f9b34fb handle: 0x000a, char properties: 0x02, char value handle: 0x000b, uuid: 00002a04-0000-1000-8000-00805f9b34fb handle: 0x000d, char properties: 0x02, char value handle: 0x000e, uuid: 00002a50-0000-1000-8000-00805f9b34fb handle: 0x0010, char properties: 0x06, char value handle: 0x0011, uuid: 00002a4e-0000-1000-8000-00805f9b34fb handle: 0x0012, char properties: 0x12, char value handle: 0x0013, uuid: 00002a4d-0000-1000-8000-00805f9b34fb handle: 0x0016, char properties: 0x12, char value handle: 0x0017, uuid: 00002a4d-0000-1000-8000-00805f9b34fb handle: 0x001a, char properties: 0x02, char value handle: 0x001b, uuid: 00002a4b-0000-1000-8000-00805f9b34fb handle: 0x001c, char properties: 0x02, char value handle: 0x001d, uuid: 00002a4a-0000-1000-8000-00805f9b34fb handle: 0x001e, char properties: 0x04, char value handle: 0x001f, uuid: 00002a4c-0000-1000-8000-00805f9b34fb handle: 0x0021, char properties: 0x12, char value handle: 0x0022, uuid: 00002a19-0000-1000-8000-00805f9b34fb ...and we get on keydown:
Notification handle = 0x0017 value: 00 28 Notification handle = 0x0013 value: 01 00 ...and on keyup:
Notification handle = 0x0013 value: 00 00 Notification handle = 0x0017 value: 00 00

dmesg

[599901.257896] input: MP107              as /devices/virtual/misc/uhid/0005:248A:8266.0005/input/input4
[599901.258367] hid-generic 0005:248A:8266.0005: input,hidraw1: BLUETOOTH HID v0.01 Keyboard [MP107             ] on B8:27:EB:EA:B7:B8

(the MAC is "hci0")

events

  + B8:27:EB:EA:B7:B8  <= /dev/input/event1 (MP107             )
0L), ('KEY_0', 11L), ('KEY_MINUS', 12L), ('KEY_EQUAL', 13L), ('KEY_BACKSPACE', 14L), ('KEY_TAB', 15L), ('KEY_Q', 16L), ('KEY_W', 17L), ('KEY_E', 18L), ('KEY_R', 19L), ('KEY_T', 20L), ('KEY_Y', 21L), ('K
EY_U', 22L), ('KEY_I', 23L), ('KEY_O', 24L), ('KEY_P', 25L), ('KEY_LEFTBRACE', 26L), ('KEY_RIGHTBRACE', 27L), ('KEY_ENTER', 28L), ('KEY_LEFTCTRL', 29L), ('KEY_A', 30L), ('KEY_S', 31L), ('KEY_D', 32L), (
'KEY_F', 33L), ('KEY_G', 34L), ('KEY_H', 35L), ('KEY_J', 36L), ('KEY_K', 37L), ('KEY_L', 38L), ('KEY_SEMICOLON', 39L), ('KEY_APOSTROPHE', 40L), ('KEY_GRAVE', 41L), ('KEY_LEFTSHIFT', 42L), ('KEY_BACKSLAS
H', 43L), ('KEY_Z', 44L), ('KEY_X', 45L), ('KEY_C', 46L), ('KEY_V', 47L), ('KEY_B', 48L), ('KEY_N', 49L), ('KEY_M', 50L), ('KEY_COMMA', 51L), ('KEY_DOT', 52L), ('KEY_SLASH', 53L), ('KEY_RIGHTSHIFT', 54L
), ('KEY_KPASTERISK', 55L), ('KEY_LEFTALT', 56L), ('KEY_SPACE', 57L), ('KEY_CAPSLOCK', 58L), ('KEY_F1', 59L), ('KEY_F2', 60L), ('KEY_F3', 61L), ('KEY_F4', 62L), ('KEY_F5', 63L), ('KEY_F6', 64L), ('KEY_F
7', 65L), ('KEY_F8', 66L), ('KEY_F9', 67L), ('KEY_F10', 68L), ('KEY_NUMLOCK', 69L), ('KEY_SCROLLLOCK', 70L), ('KEY_KP7', 71L), ('KEY_KP8', 72L), ('KEY_KP9', 73L), ('KEY_KPMINUS', 74L), ('KEY_KP4', 75L),
 ('KEY_KP5', 76L), ('KEY_KP6', 77L), ('KEY_KPPLUS', 78L), ('KEY_KP1', 79L), ('KEY_KP2', 80L), ('KEY_KP3', 81L), ('KEY_KP0', 82L), ('KEY_KPDOT', 83L), ('KEY_ZENKAKUHANKAKU', 85L), ('KEY_102ND', 86L), ('K
EY_F11', 87L), ('KEY_F12', 88L), ('KEY_RO', 89L), ('KEY_KATAKANA', 90L), ('KEY_HIRAGANA', 91L), ('KEY_HENKAN', 92L), ('KEY_KATAKANAHIRAGANA', 93L), ('KEY_MUHENKAN', 94L), ('KEY_KPJPCOMMA', 95L), ('KEY_K
PENTER', 96L), ('KEY_RIGHTCTRL', 97L), ('KEY_KPSLASH', 98L), ('KEY_SYSRQ', 99L), ('KEY_RIGHTALT', 100L), ('KEY_HOME', 102L), ('KEY_UP', 103L), ('KEY_PAGEUP', 104L), ('KEY_LEFT', 105L), ('KEY_RIGHT', 106
L), ('KEY_END', 107L), ('KEY_DOWN', 108L), ('KEY_PAGEDOWN', 109L), ('KEY_INSERT', 110L), ('KEY_DELETE', 111L), (['KEY_MIN_INTERESTING', 'KEY_MUTE'], 113L), ('KEY_VOLUMEDOWN', 114L), ('KEY_VOLUMEUP', 115
L), ('KEY_POWER', 116L), ('KEY_KPEQUAL', 117L), ('KEY_PAUSE', 119L), ('KEY_KPCOMMA', 121L), (['KEY_HANGEUL', 'KEY_HANGUEL'], 122L), ('KEY_HANJA', 123L), ('KEY_YEN', 124L), ('KEY_LEFTMETA', 125L), ('KEY_
RIGHTMETA', 126L), ('KEY_COMPOSE', 127L), ('KEY_STOP', 128L), ('KEY_AGAIN', 129L), ('KEY_PROPS', 130L), ('KEY_UNDO', 131L), ('KEY_FRONT', 132L), ('KEY_COPY', 133L), ('KEY_OPEN', 134L), ('KEY_PASTE', 135
L), ('KEY_FIND', 136L), ('KEY_CUT', 137L), ('KEY_HELP', 138L), ('KEY_WWW', 150L), ('KEY_BACK', 158L), ('KEY_FORWARD', 159L), ('KEY_EJECTCD', 161L), ('KEY_NEXTSONG', 163L), ('KEY_PLAYPAUSE', 164L), ('KEY
_PREVIOUSSONG', 165L), ('KEY_STOPCD', 166L), ('KEY_KPLEFTPAREN', 179L), ('KEY_KPRIGHTPAREN', 180L), ('KEY_F13', 183L), ('KEY_F14', 184L), ('KEY_F15', 185L), ('KEY_F16', 186L), ('KEY_F17', 187L), ('KEY_F
18', 188L), ('KEY_F19', 189L), ('KEY_F20', 190L), ('KEY_F21', 191L), ('KEY_F22', 192L), ('KEY_F23', 193L), ('KEY_F24', 194L), ('KEY_UNKNOWN', 240L)], ('EV_SYN', 0L): [('SYN_REPORT', 0L), ('SYN_CONFIG',
1L), ('?', 4L), ('?', 20L)]}
                  ('KEY_1', 2L),
                  ('KEY_2', 3L),
                  ('KEY_3', 4L),
                  ('KEY_4', 5L),
                  ('KEY_5', 6L),
                  ('KEY_6', 7L),
                  ('KEY_7', 8L),
                  ('KEY_8', 9L),
                  ('KEY_9', 10L),
                  ('KEY_0', 11L),
                  ('KEY_MINUS', 12L),
                  ('KEY_EQUAL', 13L),
                  ('KEY_BACKSPACE', 14L),
                  ('KEY_TAB', 15L),
                  ('KEY_Q', 16L),
                  ('KEY_W', 17L),
                  ('KEY_E', 18L),
                  ('KEY_R', 19L),
                  ('KEY_T', 20L),
                  ('KEY_Y', 21L),
                  ('KEY_U', 22L),
                  ('KEY_I', 23L),
                  ('KEY_O', 24L),
                  ('KEY_P', 25L),
                  ('KEY_LEFTBRACE', 26L),
                  ('KEY_RIGHTBRACE', 27L),
                  ('KEY_ENTER', 28L),
                  ('KEY_LEFTCTRL', 29L),
                  ('KEY_A', 30L),
                  ('KEY_S', 31L),
                  ('KEY_D', 32L),
                  ('KEY_F', 33L),
                  ('KEY_G', 34L),
                  ('KEY_H', 35L),
                  ('KEY_J', 36L),
                  ('KEY_K', 37L),
                  ('KEY_L', 38L),
                  ('KEY_SEMICOLON', 39L),
                  ('KEY_APOSTROPHE', 40L),
                  ('KEY_GRAVE', 41L),
                  ('KEY_LEFTSHIFT', 42L),
                  ('KEY_BACKSLASH', 43L),
                  ('KEY_Z', 44L),
                  ('KEY_X', 45L),
                  ('KEY_C', 46L),
                  ('KEY_V', 47L),
                  ('KEY_B', 48L),
                  ('KEY_N', 49L),
                  ('KEY_M', 50L),
                  ('KEY_COMMA', 51L),
                  ('KEY_DOT', 52L),
                  ('KEY_SLASH', 53L),
                  ('KEY_RIGHTSHIFT', 54L),
                  ('KEY_KPASTERISK', 55L),
                  ('KEY_LEFTALT', 56L),
                  ('KEY_SPACE', 57L),
                  ('KEY_CAPSLOCK', 58L),
                  ('KEY_F1', 59L),
                  ('KEY_F2', 60L),
                  ('KEY_F3', 61L),
                  ('KEY_F4', 62L),
                  ('KEY_F5', 63L),
                  ('KEY_F6', 64L),
                  ('KEY_F7', 65L),
                  ('KEY_F8', 66L),
                  ('KEY_F9', 67L),
                  ('KEY_F10', 68L),
                  ('KEY_NUMLOCK', 69L),
                  ('KEY_SCROLLLOCK', 70L),
                  ('KEY_KP7', 71L),
                  ('KEY_KP8', 72L),
                  ('KEY_KP9', 73L),
                  ('KEY_KPMINUS', 74L),
                  ('KEY_KP4', 75L),
                  ('KEY_KP5', 76L),
                  ('KEY_KP6', 77L),
                  ('KEY_KPPLUS', 78L),
                  ('KEY_KP1', 79L),
                  ('KEY_KP2', 80L),
                  ('KEY_KP3', 81L),
                  ('KEY_KP0', 82L),
                  ('KEY_KPDOT', 83L),
                  ('KEY_ZENKAKUHANKAKU', 85L),
                  ('KEY_102ND', 86L),
                  ('KEY_F11', 87L),
                  ('KEY_F12', 88L),
                  ('KEY_RO', 89L),
                  ('KEY_KATAKANA', 90L),
                  ('KEY_HIRAGANA', 91L),
                  ('KEY_HENKAN', 92L),
                  ('KEY_KATAKANAHIRAGANA', 93L),
                  ('KEY_MUHENKAN', 94L),
                  ('KEY_KPJPCOMMA', 95L),
                  ('KEY_KPENTER', 96L),
                  ('KEY_RIGHTCTRL', 97L),
                  ('KEY_KPSLASH', 98L),
                  ('KEY_SYSRQ', 99L),
                  ('KEY_RIGHTALT', 100L),
                  ('KEY_HOME', 102L),
                  ('KEY_UP', 103L),
                  ('KEY_PAGEUP', 104L),
                  ('KEY_LEFT', 105L),
                  ('KEY_RIGHT', 106L),
                  ('KEY_END', 107L),
                  ('KEY_DOWN', 108L),
                  ('KEY_PAGEDOWN', 109L),
                  ('KEY_INSERT', 110L),
                  ('KEY_DELETE', 111L),
                  (['KEY_MIN_INTERESTING', 'KEY_MUTE'], 113L),
                  ('KEY_VOLUMEDOWN', 114L),
                  ('KEY_VOLUMEUP', 115L),
                  ('KEY_POWER', 116L),
                  ('KEY_KPEQUAL', 117L),
                  ('KEY_PAUSE', 119L),
                  ('KEY_KPCOMMA', 121L),
                  (['KEY_HANGEUL', 'KEY_HANGUEL'], 122L),
                  ('KEY_HANJA', 123L),
                  ('KEY_YEN', 124L),
                  ('KEY_LEFTMETA', 125L),
                  ('KEY_RIGHTMETA', 126L),
                  ('KEY_COMPOSE', 127L),
                  ('KEY_STOP', 128L),
                  ('KEY_AGAIN', 129L),
                  ('KEY_PROPS', 130L),
                  ('KEY_UNDO', 131L),
                  ('KEY_FRONT', 132L),
                  ('KEY_COPY', 133L),
                  ('KEY_OPEN', 134L),
                  ('KEY_PASTE', 135L),
                  ('KEY_FIND', 136L),
                  ('KEY_CUT', 137L),
                  ('KEY_HELP', 138L),
                  ('KEY_WWW', 150L),
                  ('KEY_BACK', 158L),
                  ('KEY_FORWARD', 159L),
                  ('KEY_EJECTCD', 161L),
                  ('KEY_NEXTSONG', 163L),
                  ('KEY_PLAYPAUSE', 164L),
                  ('KEY_PREVIOUSSONG', 165L),
                  ('KEY_STOPCD', 166L),
                  ('KEY_KPLEFTPAREN', 179L),
                  ('KEY_KPRIGHTPAREN', 180L),
                  ('KEY_F13', 183L),
                  ('KEY_F14', 184L),
                  ('KEY_F15', 185L),
                  ('KEY_F16', 186L),
                  ('KEY_F17', 187L),
                  ('KEY_F18', 188L),
                  ('KEY_F19', 189L),
                  ('KEY_F20', 190L),
                  ('KEY_F21', 191L),
                  ('KEY_F22', 192L),
                  ('KEY_F23', 193L),
                  ('KEY_F24', 194L),
                  ('KEY_UNKNOWN', 240L)],
 ('EV_MSC', 4L): [('MSC_SCAN', 4L)],
 ('EV_SYN', 0L): [('SYN_REPORT', 0L),
                  ('SYN_CONFIG', 1L),
                  ('?', 4L),
                  ('?', 20L)]}



on pressing the key:

event at 1558814021.833572, code 04, type 04, val 458792
key event at 1558814021.833572, 28 (KEY_ENTER), down

from:  event1, B8:27:EB:EA:B7:B8:   MP107
DATA:  [115]
 !!!  ========================================================
 !!!  ERROR: unknown device 'B8:27:EB:EA:B7:B8'!
 !!!  Please add to the file 'evdev_readers.cfg
 !!!  ========================================================
queue: CODE=%5B115%5D&READER=B8%3A27%3AEB%3AEA%3AB7%3AB8&TIME=1558814021.8&troley=%5B115%5D&OVEN=unset&DIR=unset

synchronization event at 1558814021.833572, SYN_REPORT

event at 1558814021.871028, code 04, type 04, val 786665
key event at 1558814021.871028, 115 (KEY_VOLUMEUP), down
    > fd:5  scan:115  key:[115]  str:[115]
synchronization event at 1558814021.871028, SYN_REPORT
key event at 1558814022.129871, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.129871, SYN_REPORT
key event at 1558814022.179869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.179869, SYN_REPORT
key event at 1558814022.229868, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.229868, SYN_REPORT
key event at 1558814022.279867, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.279867, SYN_REPORT
key event at 1558814022.329880, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.329880, SYN_REPORT
key event at 1558814022.379871, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.379871, SYN_REPORT
key event at 1558814022.429892, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.429892, SYN_REPORT
key event at 1558814022.479873, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.479873, SYN_REPORT
key event at 1558814022.529869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1558814022.529869, SYN_REPORT
event at 1558814022.546024, code 04, type 04, val 786665
key event at 1558814022.546024, 115 (KEY_VOLUMEUP), up
synchronization event at 1558814022.546024, SYN_REPORT
event at 1558814022.621017, code 04, type 04, val 458792
key event at 1558814022.621017, 28 (KEY_ENTER), up
synchronization event at 1558814022.621017, SYN_REPORT

...after falling asleep...

on click: three blue blinks, no events next clicks: one short blue blink, event sent

bluetoothctl vs hcitool connect behavior

hcitool lecc FF:FF:C3:0F:03:5E
...creates ephemeral connection that ends at powercycle of the device

bluetoothctl "connect FF:FF:C3:0F:03:5E" ...creates persistent connection that lasts across power cycles

multiple devices

first device:  MAC FF:FF:C3:0F:03:5E (Button)
second device: MAC FF:FF:C3:0E:DA:48 (JeffPanocam)


both devices on /dev/input/event[01], both having the same name - HOW TO GET MAC??
Grabbing devices
  + MP107                (event1, B8:27:EB:EA:B7:B8)   =>  [ UNSPECIFIED DEVICE ]
  + MP107                (event0, B8:27:EB:EA:B7:B8)   =>  [ UNSPECIFIED DEVICE ]




[root@Octo:~/ble]$ hcitool leinfo FF:FF:C3:0F:03:5E
Requesting information ...
        Handle: 66 (0x0042)
        LMP Version: 1.2 (0x2) LMP Subversion: 0x8
        Manufacturer: not assigned (21580)
        Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
[root@Octo:~/ble]$ hcitool leinfo FF:FF:C3:0E:DA:48
Requesting information ...
        Handle: 66 (0x0042)
        LMP Version: 1.2 (0x2) LMP Subversion: 0x8
        Manufacturer: not assigned (21580)
        Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00


hcitool lecc FF:FF:C3:0F:03:5E
...connects, returns handle (for now say 64), LED stops blinking

hcitool ledc 64 ...disconnects, LED starts blinking unhappily
HOWEVER: if connected via bluetoothctl: hcitool ledc 64 reports no error, LED blinks shortly, but connnection stays on ...they stay there even after hciconfig hci0 down
No device specified, trying to scan all of /dev/input/event* Available devices: Select the device event number [0-1]: 0 Input driver version is 1.0.1 Input device ID: bus 0x5 vendor 0x248a product 0x8266 version 0x1 Input device name: "MP107  " Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 1 (KEY_ESC) Event code 2 (KEY_1) Event code 3 (KEY_2) ...
Event code 192 (KEY_F22) Event code 193 (KEY_F23) Event code 194 (KEY_F24) Event code 240 (KEY_UNKNOWN) Event type 4 (EV_MSC) Event code 4 (MSC_SCAN) Key repeat handling: Repeat type 20 (EV_REP) Repeat code 0 (REP_DELAY) Value 250 Repeat code 1 (REP_PERIOD) Value 33 Properties: Testing ... (interrupt to exit) Event: time 1558982072.523435, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028 Event: time 1558982072.523435, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1 Event: time 1558982072.523435, -------------- SYN_REPORT ------------ Event: time 1558982072.561036, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9 Event: time 1558982072.561036, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1 Event: time 1558982072.561036, -------------- SYN_REPORT ------------ Event: time 1558982072.712201, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9 Event: time 1558982072.712201, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0 Event: time 1558982072.712201, -------------- SYN_REPORT ------------ Event: time 1558982072.785932, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028 Event: time 1558982072.785932, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0 Event: time 1558982072.785932, -------------- SYN_REPORT ------------ Event: time 1558982091.198746, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028 Event: time 1558982091.198746, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1 Event: time 1558982091.198746, -------------- SYN_REPORT ------------ Event: time 1558982091.236107, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9 Event: time 1558982091.236107, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1 Event: time 1558982091.236107, -------------- SYN_REPORT ------------ Event: time 1558982091.489866, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.489866, -------------- SYN_REPORT ------------ Event: time 1558982091.539864, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.539864, -------------- SYN_REPORT ------------ Event: time 1558982091.589867, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.589867, -------------- SYN_REPORT ------------ Event: time 1558982091.639864, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.639864, -------------- SYN_REPORT ------------ Event: time 1558982091.689863, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.689863, -------------- SYN_REPORT ------------ Event: time 1558982091.739861, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.739861, -------------- SYN_REPORT ------------ Event: time 1558982091.789869, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.789869, -------------- SYN_REPORT ------------ Event: time 1558982091.839862, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.839862, -------------- SYN_REPORT ------------ Event: time 1558982091.889863, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.889863, -------------- SYN_REPORT ------------ Event: time 1558982091.939863, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2 Event: time 1558982091.939863, -------------- SYN_REPORT ------------ Event: time 1558982091.986120, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9 Event: time 1558982091.986120, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0 Event: time 1558982091.986120, -------------- SYN_REPORT ------------ Event: time 1558982092.061057, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028 Event: time 1558982092.061057, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0 Event: time 1558982092.061057, -------------- SYN_REPORT ------------

from /proc subsystem

...note the Handler, Phys and Uniq

I: Bus=0005 Vendor=248a Product=8266 Version=0001 N: Name="MP107  " P: Phys=B8:27:EB:EA:B7:B8 S: Sysfs=/devices/virtual/misc/uhid/0005:248A:8266.000B/input/input10 U: Uniq=FF:FF:C3:0E:DA:48 H: Handlers=sysrq kbd event1 B: PROP=0 B: EV=100013 B: KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe B: MSC=10 I: Bus=0005 Vendor=248a Product=8266 Version=0001 N: Name="MP107  " P: Phys=B8:27:EB:EA:B7:B8 S: Sysfs=/devices/virtual/misc/uhid/0005:248A:8266.000D/input/input12 U: Uniq=FF:FF:C3:0F:03:5E H: Handlers=sysrq kbd event0 B: PROP=0 B: EV=100013 B: KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe B: MSC=10 hwinfo: bus = 5, name = MP107 handlers = sysrq kbd event0 key = 0001000000000007ff98007ac04007fffebeffdfffeffffffffffffffffffffe mouse buttons = 0 mouse wheels = 0 is_mouse = 0 is_joystick = 0 bus = 5, name = MP107 handlers = sysrq kbd event1 key = 0001000000000007ff98007ac04007fffebeffdfffeffffffffffffffffffffe mouse buttons = 0 mouse wheels = 0 is_mouse = 0 is_joystick = 0 udevinfo: P: /devices/virtual/misc/uhid N: uhid E: DEVNAME=/dev/uhid E: DEVPATH=/devices/virtual/misc/uhid E: MAJOR=10 E: MINOR=239 E: SUBSYSTEM=misc P: /devices/virtual/misc/uhid/0005:248A:8266.000B E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000B E: DRIVER=hid-generic E: HID_ID=0005:0000248A:00008266 E: HID_NAME=MP107 E: HID_PHYS=B8:27:EB:EA:B7:B8 E: HID_UNIQ=FF:FF:C3:0E:DA:48 E: MODALIAS=hid:b0005g0001v0000248Ap00008266 E: SUBSYSTEM=hid P: /devices/virtual/misc/uhid/0005:248A:8266.000B/hidraw/hidraw1 N: hidraw1 E: DEVNAME=/dev/hidraw1 E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000B/hidraw/hidraw1 E: MAJOR=247 E: MINOR=1 E: SUBSYSTEM=hidraw P: /devices/virtual/misc/uhid/0005:248A:8266.000B/input/input10 E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000B/input/input10 E: EV=100013 E: ID_INPUT=1 E: ID_INPUT_KEY=1 E: ID_INPUT_KEYBOARD=1 E: ID_SERIAL=noserial E: KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe E: MODALIAS=input:b0005v248Ap8266e0001-e0,1,4,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,96,9E,9F,A1,A3,A4,A5,A6,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,lsfw E: MSC=10 E: NAME="MP107  " E: PHYS="B8:27:EB:EA:B7:B8" E: PRODUCT=5/248a/8266/1 E: PROP=0 E: SUBSYSTEM=input E: TAGS=:seat: E: UNIQ="FF:FF:C3:0E:DA:48" E: USEC_INITIALIZED=759401223288 P: /devices/virtual/misc/uhid/0005:248A:8266.000B/input/input10/event0 N: input/event0 E: DEVNAME=/dev/input/event0 E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000B/input/input10/event0 E: ID_INPUT=1 E: ID_INPUT_KEY=1 E: ID_INPUT_KEYBOARD=1 E: ID_SERIAL=noserial E: MAJOR=13 E: MINOR=64 E: SUBSYSTEM=input E: USEC_INITIALIZED=770930243710 P: /devices/virtual/misc/uhid/0005:248A:8266.000D E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000D E: DRIVER=hid-generic E: HID_ID=0005:0000248A:00008266 E: HID_NAME=MP107 E: HID_PHYS=B8:27:EB:EA:B7:B8 E: HID_UNIQ=FF:FF:C3:0F:03:5E E: MODALIAS=hid:b0005g0001v0000248Ap00008266 E: SUBSYSTEM=hid P: /devices/virtual/misc/uhid/0005:248A:8266.000D/hidraw/hidraw0 N: hidraw0 E: DEVNAME=/dev/hidraw0 E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000D/hidraw/hidraw0 E: MAJOR=247 E: MINOR=0 E: SUBSYSTEM=hidraw P: /devices/virtual/misc/uhid/0005:248A:8266.000D/input/input12 E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000D/input/input12 E: EV=100013 E: ID_INPUT=1 E: ID_INPUT_KEY=1 E: ID_INPUT_KEYBOARD=1 E: ID_SERIAL=noserial E: KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe E: MODALIAS=input:b0005v248Ap8266e0001-e0,1,4,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,96,9E,9F,A1,A3,A4,A5,A6,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,lsfw E: MSC=10 E: NAME="MP107  " E: PHYS="B8:27:EB:EA:B7:B8" E: PRODUCT=5/248a/8266/1 E: PROP=0 E: SUBSYSTEM=input E: TAGS=:seat: E: UNIQ="FF:FF:C3:0F:03:5E" E: USEC_INITIALIZED=761165732097 P: /devices/virtual/misc/uhid/0005:248A:8266.000D/input/input12/event1 N: input/event1 E: DEVNAME=/dev/input/event1 E: DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.000D/input/input12/event1 E: ID_INPUT=1 E: ID_INPUT_KEY=1 E: ID_INPUT_KEYBOARD=1 E: ID_SERIAL=noserial E: MAJOR=13 E: MINOR=65 E: SUBSYSTEM=input E: USEC_INITIALIZED=770930243902 in sysfs: hid-generic: /devices/virtual/misc/uhid/0005:248A:8266.000D hid-generic: /devices/virtual/misc/uhid/0005:248A:8266.000B

reinitializing

the /dev/input/event* devices vanish on /etc/init.d/bluetooth stop
they do not reappear on /etc/init.d/bluetooth start

udevadm monitor

...the buttons are connected via "bluetoothctl connect", they get claimed by the machine automatically and connected to

monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent ...on waking up the button...
KERNEL[776182.444936] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776182.454229] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) KERNEL[776185.298407] add /devices/virtual/misc/uhid/0005:248A:8266.000E (hid) KERNEL[776185.299563] add /devices/virtual/misc/uhid/0005:248A:8266.000E/input/input13 (input) KERNEL[776185.300569] add /devices/virtual/misc/uhid/0005:248A:8266.000E/input/input13/event0 (input) KERNEL[776185.300818] add /devices/virtual/misc/uhid/0005:248A:8266.000E/hidraw/hidraw0 (hidraw) UDEV [776185.308596] add /devices/virtual/misc/uhid/0005:248A:8266.000E (hid) UDEV [776185.321861] add /devices/virtual/misc/uhid/0005:248A:8266.000E/hidraw/hidraw0 (hidraw) UDEV [776185.331947] add /devices/virtual/misc/uhid/0005:248A:8266.000E/input/input13 (input) UDEV [776185.611587] add /devices/virtual/misc/uhid/0005:248A:8266.000E/input/input13/event0 (input) ...on waking up the other button...
KERNEL[776268.899967] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:65 (bluetooth) UDEV [776268.907312] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:65 (bluetooth) KERNEL[776271.816428] add /devices/virtual/misc/uhid/0005:248A:8266.000F (hid) KERNEL[776271.816883] add /devices/virtual/misc/uhid/0005:248A:8266.000F/input/input14 (input) KERNEL[776271.817188] add /devices/virtual/misc/uhid/0005:248A:8266.000F/input/input14/event1 (input) KERNEL[776271.817473] add /devices/virtual/misc/uhid/0005:248A:8266.000F/hidraw/hidraw1 (hidraw) UDEV [776271.824316] add /devices/virtual/misc/uhid/0005:248A:8266.000F (hid) UDEV [776271.831605] add /devices/virtual/misc/uhid/0005:248A:8266.000F/hidraw/hidraw1 (hidraw) UDEV [776271.849122] add /devices/virtual/misc/uhid/0005:248A:8266.000F/input/input14 (input) UDEV [776272.051311] add /devices/virtual/misc/uhid/0005:248A:8266.000F/input/input14/event1 (input) KERNEL[776272.790489] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776272.795310] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ...on reawakening the first one... (click, it blinks three times - no HID events issued)
KERNEL[776290.592577] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776290.599591] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ...on waiting for a while...
KERNEL[776359.190476] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:65 (bluetooth) UDEV [776359.194779] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:65 (bluetooth) KERNEL[776380.890538] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776380.896510] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ...on wakeup...
KERNEL[776488.877538] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776488.884735] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ...on physical power-off...
KERNEL[776557.470388] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776557.474866] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ...on physical power-on and waiting... (the timeout to disconnection happens always after 90 seconds)
KERNEL[776598.128325] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776598.139030] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) KERNEL[776688.440509] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) UDEV [776688.444828] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) dmesg: [776188.966629] input: MP107  as /devices/virtual/misc/uhid/0005:248A:8266.000E/input/input13 [776188.968075] hid-generic 0005:248A:8266.000E: input,hidraw0: BLUETOOTH HID v0.01 Keyboard [MP107  ] on B8:27:EB:EA:B7:B8 [776275.483103] input: MP107  as /devices/virtual/misc/uhid/0005:248A:8266.000F/input/input14 [776275.483679] hid-generic 0005:248A:8266.000F: input,hidraw1: BLUETOOTH HID v0.01 Keyboard [MP107  ] on B8:27:EB:EA:B7:B8

udevadm monitor -p

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[777001.571487] add      /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth)
ACTION=add
DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64
DEVTYPE=link
SEQNUM=138599
SUBSYSTEM=bluetooth

UDEV  [777001.580995] add      /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth)
ACTION=add
DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64
DEVTYPE=link
SEQNUM=138599
SUBSYSTEM=bluetooth
SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:64
SYSTEMD_WANTS=bluetooth.target
TAGS=:systemd:
USEC_INITIALIZED=777001577768



KERNEL[777091.881114] remove   /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth)
ACTION=remove
DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64
DEVTYPE=link
SEQNUM=138600
SUBSYSTEM=bluetooth

UDEV  [777091.886703] remove   /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth)
ACTION=remove
DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64
DEVTYPE=link
SEQNUM=138600
SUBSYSTEM=bluetooth
SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:64
SYSTEMD_WANTS=bluetooth.target
TAGS=:systemd:
USEC_INITIALIZED=777001577768


udevadm monitor -p, new device after bluetooth restart

KERNEL[777191.543260] add      /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth)
ACTION=add
DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64
DEVTYPE=link
SEQNUM=138611
SUBSYSTEM=bluetooth

UDEV  [777191.553603] add      /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth)
ACTION=add
DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64
DEVTYPE=link
SEQNUM=138611
SUBSYSTEM=bluetooth
SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:64
SYSTEMD_WANTS=bluetooth.target
TAGS=:systemd:
USEC_INITIALIZED=777191549626

KERNEL[777194.732535] add      /devices/virtual/misc/uhid/0005:248A:8266.0010 (hid)
ACTION=add
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010
HID_ID=0005:0000248A:00008266
HID_NAME=MP107
HID_PHYS=B8:27:EB:EA:B7:B8
HID_UNIQ=FF:FF:C3:0F:03:5E
MODALIAS=hid:b0005g0001v0000248Ap00008266
SEQNUM=138612
SUBSYSTEM=hid

KERNEL[777194.733065] add      /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15 (input)
ACTION=add
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15
EV=100013
KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe
MODALIAS=input:b0005v248Ap8266e0001-e0,1,4,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,96,9E,9F,A1,A3,A4,A5,A6,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,lsfw
MSC=10
NAME="MP107             "
PHYS="B8:27:EB:EA:B7:B8"
PRODUCT=5/248a/8266/1
PROP=0
SEQNUM=138613
SUBSYSTEM=input
UNIQ="FF:FF:C3:0F:03:5E"

KERNEL[777194.733507] add      /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0 (input)
ACTION=add
DEVNAME=/dev/input/event0
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0
MAJOR=13
MINOR=64
SEQNUM=138614
SUBSYSTEM=input

KERNEL[777194.733993] add      /devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0 (hidraw)
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0
MAJOR=247
MINOR=0
SEQNUM=138615
SUBSYSTEM=hidraw

UDEV  [777194.746620] add      /devices/virtual/misc/uhid/0005:248A:8266.0010 (hid)
ACTION=add
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010
HID_ID=0005:0000248A:00008266
HID_NAME=MP107
HID_PHYS=B8:27:EB:EA:B7:B8
HID_UNIQ=FF:FF:C3:0F:03:5E
MODALIAS=hid:b0005g0001v0000248Ap00008266
SEQNUM=138612
SUBSYSTEM=hid
USEC_INITIALIZED=777194744962

UDEV  [777194.757370] add      /devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0 (hidraw)
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0
MAJOR=247
MINOR=0
SEQNUM=138615
SUBSYSTEM=hidraw
USEC_INITIALIZED=777194756804

UDEV  [777194.777711] add      /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15 (input)
INPUT_CLASS=kbd
ACTION=add DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15 EV=100013 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_SERIAL=noserial KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe MODALIAS=input:b0005v248Ap8266e0001-e0,1,4,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,96,9E,9F,A1,A3,A4,A5,A6,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,lsfw MSC=10 NAME="MP107  " PHYS="B8:27:EB:EA:B7:B8" PRODUCT=5/248a/8266/1 PROP=0 SEQNUM=138613 SUBSYSTEM=input TAGS=:seat: UNIQ="FF:FF:C3:0F:03:5E" USEC_INITIALIZED=777194761873 UDEV [777194.950642] add /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0 (input) INPUT_CLASS=kbd
ACTION=add DEVNAME=/dev/input/event0 DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_SERIAL=noserial MAJOR=13 MINOR=64 SEQNUM=138614 SUBSYSTEM=input USEC_INITIALIZED=777194871806 ...after 90 seconds timeout...
KERNEL[777281.901817] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=remove DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138617 SUBSYSTEM=bluetooth UDEV [777281.904971] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=remove DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138617 SUBSYSTEM=bluetooth SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:64 SYSTEMD_WANTS=bluetooth.target TAGS=:systemd: USEC_INITIALIZED=777191549626 ...after manual wakeup...
KERNEL[777321.423465] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=add DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138618 SUBSYSTEM=bluetooth UDEV [777321.430656] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=add DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138618 SUBSYSTEM=bluetooth SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:64 SYSTEMD_WANTS=bluetooth.target TAGS=:systemd: USEC_INITIALIZED=777321429869 ...on bluetooth stop...
KERNEL[777321.423465] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=add DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138618 SUBSYSTEM=bluetooth UDEV [777321.430656] add /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=add DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138618 SUBSYSTEM=bluetooth SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:64 SYSTEMD_WANTS=bluetooth.target TAGS=:systemd: USEC_INITIALIZED=777321429869 KERNEL[777363.031719] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=remove DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138619 SUBSYSTEM=bluetooth UDEV [777363.033295] remove /devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 (bluetooth) ACTION=remove DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:64 DEVTYPE=link SEQNUM=138619 SUBSYSTEM=bluetooth SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:64 SYSTEMD_WANTS=bluetooth.target TAGS=:systemd: USEC_INITIALIZED=777321429869 KERNEL[777363.210384] remove /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0 (input) ACTION=remove DEVNAME=/dev/input/event0 DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0 MAJOR=13 MINOR=64 SEQNUM=138620 SUBSYSTEM=input UDEV [777363.212556] remove /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0 (input) ACTION=remove DEVNAME=/dev/input/event0 DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15/event0 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_SERIAL=noserial MAJOR=13 MINOR=64 SEQNUM=138620 SUBSYSTEM=input USEC_INITIALIZED=777194871806 KERNEL[777363.290433] remove /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15 (input) ACTION=remove DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15 EV=100013 KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe MODALIAS=input:b0005v248Ap8266e0001-e0,1,4,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,96,9E,9F,A1,A3,A4,A5,A6,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,lsfw MSC=10 NAME="MP107  " PHYS="B8:27:EB:EA:B7:B8" PRODUCT=5/248a/8266/1 PROP=0 SEQNUM=138621 SUBSYSTEM=input UNIQ="FF:FF:C3:0F:03:5E" KERNEL[777363.290715] remove /devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0 (hidraw) ACTION=remove DEVNAME=/dev/hidraw0 DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0 MAJOR=247 MINOR=0 SEQNUM=138622 SUBSYSTEM=hidraw KERNEL[777363.290928] remove /devices/virtual/misc/uhid/0005:248A:8266.0010 (hid) ACTION=remove DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010 HID_ID=0005:0000248A:00008266 HID_NAME=MP107 HID_PHYS=B8:27:EB:EA:B7:B8 HID_UNIQ=FF:FF:C3:0F:03:5E MODALIAS=hid:b0005g0001v0000248Ap00008266 SEQNUM=138624 SUBSYSTEM=hid UDEV [777363.293526] remove /devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0 (hidraw) ACTION=remove DEVNAME=/dev/hidraw0 DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/hidraw/hidraw0 MAJOR=247 MINOR=0 SEQNUM=138622 SUBSYSTEM=hidraw USEC_INITIALIZED=777363291431 UDEV [777363.293994] remove /devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15 (input) ACTION=remove DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010/input/input15 EV=100013 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_SERIAL=noserial KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe MODALIAS=input:b0005v248Ap8266e0001-e0,1,4,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,96,9E,9F,A1,A3,A4,A5,A6,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,lsfw MSC=10 NAME="MP107  " PHYS="B8:27:EB:EA:B7:B8" PRODUCT=5/248a/8266/1 PROP=0 SEQNUM=138621 SUBSYSTEM=input TAGS=:seat: UNIQ="FF:FF:C3:0F:03:5E" USEC_INITIALIZED=777194761873 UDEV [777363.294727] remove /devices/virtual/misc/uhid/0005:248A:8266.0010 (hid) ACTION=remove DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0010 HID_ID=0005:0000248A:00008266 HID_NAME=MP107 HID_PHYS=B8:27:EB:EA:B7:B8 HID_UNIQ=FF:FF:C3:0F:03:5E MODALIAS=hid:b0005g0001v0000248Ap00008266 SEQNUM=138624 SUBSYSTEM=hid USEC_INITIALIZED=777363292475

udevadm /dev/input/input* interrogation




Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/virtual/misc/uhid/0005:248A:8266.0013/input/input18/event0':
    KERNEL=="event0"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/virtual/misc/uhid/0005:248A:8266.0013/input/input18':
    KERNELS=="input18"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="MP107             "
    ATTRS{phys}=="B8:27:EB:EA:B7:B8"
    ATTRS{properties}=="0"
    ATTRS{uniq}=="FF:FF:C3:0F:03:5E"

  looking at parent device '/devices/virtual/misc/uhid/0005:248A:8266.0013':
    KERNELS=="0005:248A:8266.0013"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"

  looking at parent device '/devices/virtual/misc/uhid':
    KERNELS=="uhid"
    SUBSYSTEMS=="misc"
    DRIVERS==""


...env vars on call PROGRAM from udev rules:

ACTION=add DEVNAME=/dev/input/event0 DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0023/input/input34/event0 DIRSTACK=() ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_SERIAL=noserial MAJOR=13 MINOR=64 OPTERR=1 OPTIND=1 PWD=/ SEQNUM=138844 SUBSYSTEM=input UID=0 USEC_INITIALIZED=780152554422 ...MAC address:
cat /sys/$DEVPATH/../uniq

input sensitivity

the key input is very high impedance by the virtue of low power requiremets
a tongue lick on the contact is enough to register as "click"

unusable though, as the first click causes the udev add event on awakening but does not send any events themselves

parts

charger: SOT23-5, 3KAL marking
diode: T4, 1N4148, takes off 0.7 volt instead of using a stabilizer (cheapnese hack)
cpu: ST17H26, by Lenze

short Vcc to GND fries the diode; a bit of epoxy smell, diode got forward voltage of 150 mV both-sides
the cpu refused to start with the higher voltage right from the battery, resulting in about 350Hz oscillations with weird-shaped deformed sine curve
the diode resistance apparently prevented further damage
replacing the diode repaired the damage

ST17H26

http://www.lenzetech.com/specifs/ST17H26
http://www.lenzetech.com/specifs/ST17H29
also, ST17H29 (board silkscreened with this, populated with the above)
TSSOP16
1.9..3.6V Vcc
48MHz clock (12MHz xtal)
15mA Tx, 12mA Rx
10uA suspend, 0.6uA sleep
16kB OTP ROM, 6kb RAM
I2C, 9x GPIO, 4x PWM
ADC 10bit, mux 4 inputs
EEPROM support


pinout:
                vcc?  o  vv  o  antenna
                vcc?  o      o  GND
        BlueLED GPIO  o      o  Vcc (cap to GND) (shorting this fries the T4 diode, oops)
                GPIO? o      o  xtal
                vcc?  o      o  xtal
                gpio? o      o  GND
        cap w/ 1.75V  o      o  GPIO IN vol.dn
Enter,Vol.up GPIO IN  o      o  GPIO IN vol.up


  I2C SCL   PWM2  GPIO4  o d    o  antenna
  I2C SDA   PWM3  GPIO5  o d    o  GND
            PWM0  GPIO7  o d    o  VDD3
                    SWS  o      o  xtal2
            PWM1 GPIO10  o d    o  xtal1
               VPP6P75V  o    u o  GPIO23  Analog3   I2C SDA
                 VDDDEC  o    u o  GPIO22  Analog2   I2C SCL
        Analog0  GPIO17  o u  u o  GPIO18  Analog1


SWS = 1wire Slave or GPIO
VPP6P75V = 6.75V input for OTP programming
VDDDEC = 1.8V internal stabilizer
d = optional 100k pulldown resistor
u = optional 100k pulldown resistor or 10k/1M pullup

...also in beacons

BT-11: https://www.beaconzone.co.uk/BT-11

scope

about 112msec usual txinterval
4.5msec long, 2ms rx? 3.5ms tx?

led pulse usually 60.5 msec


pins:
1   H-vcc
2   H-vcc
3   L (LED?)
4   l, unpopulated pullup

5   H, hard (vcc?)
6   l?
7   1.75v mid, cap to gnd
8   H - enter-vol.up  - button connected here


9   H - vol.up [115]
10  H - vol.down [114]
11  gnd
12  xtal    weak L, mirrors dips at vcc but up

13  xtal
14  vcc?
15  gnd
16  antenna

hidraw

od -t x1 -A n /dev/hidraw0 -w3
packets come in series of three bytes, pin 7 sends two triads


pin 7, hidraw


down
 03 00 28
 02 01 00
up
 02 00 00
 03 00 00

pin 9, hidraw


down
 02 01 00
up
 02 00 00

pin 10, hidraw


down
 02 02 00
up
 02 00 00

10>L   02 02 00
 7>L   03 00 28
       02 01 00
 7>H   02 02 00
10>H   02 00 00
       03 00 00
7>L    03 00 28
       02 01 00
10>L
10>H   02 02 00
 7>H   02 00 00
       03 00 00

pin 7

event at 1559021118.907742, code 04, type 04, val 458792
key event at 1559021118.907742, 28 (KEY_ENTER), down
synchronization event at 1559021118.907742, SYN_REPORT
event at 1559021118.945471, code 04, type 04, val 786665
key event at 1559021118.945471, 115 (KEY_VOLUMEUP), down
    > fd:7  scan:115  key:[115]  str:[115]
synchronization event at 1559021118.945471, SYN_REPORT
key event at 1559021119.199866, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.199866, SYN_REPORT
key event at 1559021119.249868, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.249868, SYN_REPORT
key event at 1559021119.299870, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.299870, SYN_REPORT
key event at 1559021119.349863, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.349863, SYN_REPORT
key event at 1559021119.399868, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.399868, SYN_REPORT
key event at 1559021119.449878, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.449878, SYN_REPORT
key event at 1559021119.499868, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.499868, SYN_REPORT
key event at 1559021119.549867, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.549867, SYN_REPORT
key event at 1559021119.599868, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.599868, SYN_REPORT
key event at 1559021119.649869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021119.649869, SYN_REPORT
event at 1559021119.695244, code 04, type 04, val 786665
key event at 1559021119.695244, 115 (KEY_VOLUMEUP), up
synchronization event at 1559021119.695244, SYN_REPORT
event at 1559021119.770377, code 04, type 04, val 458792
key event at 1559021119.770377, 28 (KEY_ENTER), up
synchronization event at 1559021119.770377, SYN_REPORT


pin 9

event at 1559021154.345483, code 04, type 04, val 786665
key event at 1559021154.345483, 115 (KEY_VOLUMEUP), down
    > fd:7  scan:115  key:[115]  str:[115][115]
synchronization event at 1559021154.345483, SYN_REPORT
key event at 1559021154.599865, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.599865, SYN_REPORT
key event at 1559021154.649869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.649869, SYN_REPORT
key event at 1559021154.699869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.699869, SYN_REPORT
key event at 1559021154.749869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.749869, SYN_REPORT
key event at 1559021154.799866, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.799866, SYN_REPORT
key event at 1559021154.849869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.849869, SYN_REPORT
key event at 1559021154.899869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.899869, SYN_REPORT
key event at 1559021154.949872, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.949872, SYN_REPORT
key event at 1559021154.999891, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021154.999891, SYN_REPORT
key event at 1559021155.049871, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021155.049871, SYN_REPORT
key event at 1559021155.099869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021155.099869, SYN_REPORT
key event at 1559021155.149871, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021155.149871, SYN_REPORT
key event at 1559021155.199869, 115 (KEY_VOLUMEUP), hold
synchronization event at 1559021155.199869, SYN_REPORT
event at 1559021155.207786, code 04, type 04, val 786665
key event at 1559021155.207786, 115 (KEY_VOLUMEUP), up
synchronization event at 1559021155.207786, SYN_REPORT




pin 10

event at 1559021199.720720, code 04, type 04, val 786666
key event at 1559021199.720720, 114 (KEY_VOLUMEDOWN), down
    > fd:7  scan:114  key:[114]  str:[115][115][114]
synchronization event at 1559021199.720720, SYN_REPORT
key event at 1559021199.979890, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021199.979890, SYN_REPORT
key event at 1559021200.029893, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.029893, SYN_REPORT
key event at 1559021200.079889, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.079889, SYN_REPORT
key event at 1559021200.129889, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.129889, SYN_REPORT
key event at 1559021200.179896, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.179896, SYN_REPORT
key event at 1559021200.229893, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.229893, SYN_REPORT
key event at 1559021200.279891, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.279891, SYN_REPORT
key event at 1559021200.329890, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.329890, SYN_REPORT
key event at 1559021200.379894, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.379894, SYN_REPORT
key event at 1559021200.429898, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.429898, SYN_REPORT
key event at 1559021200.479894, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.479894, SYN_REPORT
key event at 1559021200.529892, 114 (KEY_VOLUMEDOWN), hold
synchronization event at 1559021200.529892, SYN_REPORT
event at 1559021200.545678, code 04, type 04, val 786666
key event at 1559021200.545678, 114 (KEY_VOLUMEDOWN), up
synchronization event at 1559021200.545678, SYN_REPORT


/dev/hidrawX


Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/virtual/misc/uhid/0005:248A:8266.0001/hidraw/hidraw0':
    KERNEL=="hidraw0"
    SUBSYSTEM=="hidraw"
    DRIVER==""

  looking at parent device '/devices/virtual/misc/uhid/0005:248A:8266.0001':
    KERNELS=="0005:248A:8266.0001"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"

  looking at parent device '/devices/virtual/misc/uhid':
    KERNELS=="uhid"
    SUBSYSTEMS=="misc"
    DRIVERS==""



Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/virtual/misc/uhid/0005:248A:8266.0001/input/input0/event0':
    KERNEL=="event0"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/virtual/misc/uhid/0005:248A:8266.0001/input/input0':
    KERNELS=="input0"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="MP107             "
    ATTRS{phys}=="B8:27:EB:EA:B7:B8"
    ATTRS{properties}=="0"
    ATTRS{uniq}=="FF:FF:C3:0F:03:5E"

  looking at parent device '/devices/virtual/misc/uhid/0005:248A:8266.0001':
    KERNELS=="0005:248A:8266.0001"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"

  looking at parent device '/devices/virtual/misc/uhid':
    KERNELS=="uhid"
    SUBSYSTEMS=="misc"
    DRIVERS==""


udev/rules.d:
SUBSYSTEM=="hidraw" PROGRAM="/root/bleudevrawtest.sh"

env vars at calling:

ACTION=remove
DEVNAME=/dev/hidraw0
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0001/hidraw/hidraw0
MAJOR=247
MINOR=0
SUBSYSTEM=hidraw

ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/virtual/misc/uhid/0005:248A:8266.0002/hidraw/hidraw0
MAJOR=247
MINOR=0
SUBSYSTEM=hidraw


(cf. barcode reader:)
ACTION=add
DEVNAME=/dev/hidraw1
DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.2/1-1.3.4.2:1.0/0003:0808:0606.0004/hidraw/hidraw1
MAJOR=247
MINOR=1
SUBSYSTEM=hidraw

(uevent:)
DRIVER=hid-generic
HID_ID=0003:00000808:00000606
HID_NAME=BLM103Virtual COM Port
HID_PHYS=usb-3f980000.usb-1.3.4.2/input0
HID_UNIQ=
MODALIAS=hid:b0003g0001v00000808p00000606


(barcode reader udevadm info on raw device:)

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.2/1-1.3.4.2:1.0/0003:0808:0606.0004/hidraw/hidraw1':
    KERNEL=="hidraw1"
    SUBSYSTEM=="hidraw"
    DRIVER==""

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.2/1-1.3.4.2:1.0/0003:0808:0606.0004':
    KERNELS=="0003:0808:0606.0004"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="21"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.2/1-1.3.4.2:1.0':
    KERNELS=="1-1.3.4.2:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceProtocol}=="01"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.2':
    KERNELS=="1-1.3.4.2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0200"
    ATTRS{bmAttributes}=="a0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="15"
    ATTRS{devpath}=="1.3.4.2"
    ATTRS{devspec}=="  (null)"
    ATTRS{idProduct}=="0606"
    ATTRS{idVendor}=="0808"
    ATTRS{ltm_capable}=="no"
    ATTRS{maxchild}=="0"
    ATTRS{product}=="BLM103Virtual COM Port  "
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{speed}=="12"
    ATTRS{urbnum}=="12"
    ATTRS{version}==" 1.10"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4':
    ...it's just a hub, nothing to see...






DRIVER=hid-generic
HID_ID=0005:0000248A:00008266
HID_NAME=MP107
HID_PHYS=B8:27:EB:EA:B7:B8
HID_UNIQ=FF:FF:C3:0F:03:5E
MODALIAS=hid:b0005g0001v0000248Ap00008266

DRIVER=hid-generic
HID_ID=0003:00000808:00000606
HID_NAME=BLM103Virtual COM Port
HID_PHYS=usb-3f980000.usb-1.3.4.2/input0
HID_UNIQ=
MODALIAS=hid:b0003g0001v00000808p00000606



I: Bus=0005 Vendor=248a Product=8266 Version=0001
N: Name="MP107             "
P: Phys=B8:27:EB:EA:B7:B8
S: Sysfs=/devices/virtual/misc/uhid/0005:248A:8266.0003/input/input2
U: Uniq=FF:FF:C3:0F:03:5E
H: Handlers=sysrq kbd event0
B: PROP=0
B: EV=100013
B: KEY=10000 7 ff98007a c04007ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10

I: Bus=0003 Vendor=0808 Product=0606 Version=0110
N: Name="BLM103Virtual COM Port  "
P: Phys=usb-3f980000.usb-1.3.4.2/input0
S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.2/1-1.3.4.2:1.0/0003:0808:0606.0004/input/input3
U: Uniq=
H: Handlers=sysrq kbd leds event1
B: PROP=0
B: EV=120013
B: KEY=e080ffdf 1cfffff ffffffff fffffffe
B: MSC=10
B: LED=1f






udevadm rules:
http://www.reactivated.net/writing_udev_rules.html#sysfsmatch

PROGRAM runs something that returns back data about the /dev node which is not created yet.
RUN runs something after creation of the node.
    Starting daemons or other long-running processes is not appropriate for udev; the forked processes, detached or not, will be unconditionally killed after the event handling has finished.

IMPORT{type}="something"
  builtin: "usb_id", "path_id", ...
  program: run a program, set env from its output
  file:    import a text file, in env var format
  db:      import single property from the current dev db (has to be populated by earlier events)
  cmdline: import single property from kernel command line
  parent:  import keys from parent device, argument is a shell glob pattern



context=Context()
dev=Device.from_device_file(context, '/dev/hidraw0')
print(dev.parent['HID_UNIQ'])

pp.pprint(locals())
pp.pprint(globals())

from inspect import getmembers
pp.pprint(getmembers(dev))


def var_dump(var, prefix=''):
    """
    You know you're a php developer when the first thing you ask for
    when learning a new language is 'Where's var_dump?????'
    """
    my_type = '[' + var.__class__.__name__ + '(' + str(len(var)) + ')]:'
    print(prefix, my_type, sep='')
    prefix += '    '
    for i in var:
        if type(i) in (list, tuple, dict, set):
            var_dump(i, prefix)
        else:
            if isinstance(var, dict):
                print(prefix, i, ': (', var[i].__class__.__name__, ') ', var[i], sep='')
            else:
                print(prefix, '(', i.__class__.__name__, ') ', i, '  =', sep='')

def dump(obj):
   for attr in dir(obj):
       if hasattr( obj, attr ):
           print( "obj.%32s = (%s) %s" % (attr, getattr(obj,attr).__class__.__name__, getattr(obj, attr)))


HID descriptor parsed by HIDRDD



05 0C        (GLOBAL) USAGE_PAGE         0x000C Consumer Device Page
09 01        (LOCAL)  USAGE              0x000C0001 Consumer Control (Application Collection)
A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x000C0001: Page=Consumer Device Page, Usage=Consumer Control, Type=Application Collection)
85 02          (GLOBAL) REPORT_ID          0x02 (2)
09 E9          (LOCAL)  USAGE              0x000C00E9 Volume Increment (Re-trigger Control)
09 EA          (LOCAL)  USAGE              0x000C00EA Volume Decrement (Re-trigger Control)
09 E2          (LOCAL)  USAGE              0x000C00E2 Mute (On/Off Control)
09 30          (LOCAL)  USAGE              0x000C0030 Power (On/Off Control)
15 01          (GLOBAL) LOGICAL_MINIMUM    0x01 (1)
25 0C          (GLOBAL) LOGICAL_MAXIMUM    0x0C (12)
75 10          (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field
95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields
81 00          (MAIN)   INPUT              0x00000000 (1 field x 16 bits) 0=Data 0=Array 0=Absolute
C0           (MAIN)   END_COLLECTION     Application
typedef struct
  uint8_t  reportId;                                 // Report ID = 0x02 (2)
                                                     // Collection: CA:ConsumerControl
  uint16_t CD_ConsumerControlPower;                  // Usage 0x000C0030: Power, Value = 1 to 12
} inputReport02_t;



05 01        (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
09 06        (LOCAL)  USAGE              0x00010006 Keyboard (Application Collection)
A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x00010006: Page=Generic Desktop Page, Usage=Keyboard, Type=Application Collection)
85 03          (GLOBAL) REPORT_ID          0x03 (3)
05 07          (GLOBAL) USAGE_PAGE         0x0007 Keyboard/Keypad Page
19 E0          (LOCAL)  USAGE_MINIMUM      0x000700E0 Keyboard Left Control (Dynamic Value)
29 E7          (LOCAL)  USAGE_MAXIMUM      0x000700E7 Keyboard Right GUI (Dynamic Value)
15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0)  <-- Info: Consider replacing 15 00 with 14
25 01          (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)
75 01          (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field
95 08          (GLOBAL) REPORT_COUNT       0x08 (8) Number of fields
81 02          (MAIN)   INPUT              0x00000002 (8 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
75 08          (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field
95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields
15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0 <-- Info: Consider replacing 15 00 with 14
25 F4          (GLOBAL) LOGICAL_MAXIMUM    0xF4 (-12)
05 07          (GLOBAL) USAGE_PAGE         0x0007 Keyboard/Keypad Page <-- Redundant: USAGE_PAGE is already 0x0007
19 00          (LOCAL)  USAGE_MINIMUM      0x00070000 Keyboard No event indicated (Selector)  <-- Info: Consider replacing 19 00 with 18
29 F4          (LOCAL)  USAGE_MAXIMUM      0x000700F4 <-- Warning: Undocumented usage (document it by inserting 00F4 into file 0007.conf)
81 00          (MAIN)   INPUT              0x00000000 (1 field x 8 bits) 0=Data 0=Array 0=Absolute  <-- Error: LOGICAL_MAXIMUM (-12) is less than LOGICAL_MINIMUM (0)
C0           (MAIN)   END_COLLECTION     Application
typedef struct
  uint8_t  reportId;                                 // Report ID = 0x03 (3)
                                                     // Collection: CA:Keyboard
  uint8_t  KB_KeyboardKeyboardLeftControl : 1;       // Usage 0x000700E0: Keyboard Left Control, Value = 0 to 1
  uint8_t  KB_KeyboardKeyboardLeftShift : 1;         // Usage 0x000700E1: Keyboard Left Shift, Value = 0 to 1
  uint8_t  KB_KeyboardKeyboardLeftAlt : 1;           // Usage 0x000700E2: Keyboard Left Alt, Value = 0 to 1
  uint8_t  KB_KeyboardKeyboardLeftGui : 1;           // Usage 0x000700E3: Keyboard Left GUI, Value = 0 to 1
  uint8_t  KB_KeyboardKeyboardRightControl : 1;      // Usage 0x000700E4: Keyboard Right Control, Value = 0 to 1
  uint8_t  KB_KeyboardKeyboardRightShift : 1;        // Usage 0x000700E5: Keyboard Right Shift, Value = 0 to 1
  uint8_t  KB_KeyboardKeyboardRightAlt : 1;          // Usage 0x000700E6: Keyboard Right Alt, Value = 0 to 1
  uint8_t  KB_KeyboardKeyboardRightGui : 1;          // Usage 0x000700E7: Keyboard Right GUI, Value = 0 to 1
  uint8_t  Keyboard;                                 // Value = 0 to -12 (resp. 0xF4 or 244)
} inputReport03_t;


pin 7, hidraw


down
 03 00 28     ... report ID 0x03, no modifier bits, keyboard key 0x28
 02 01 00     ... report ID 0x02, ConsumerControlPower=1
up
 02 00 00
 03 00 00

pin 9, hidraw


down
 02 01 00
up
 02 00 00

pin 10, hidraw


down
 02 02 00
up
 02 00 00





libinput:

apt-get install libinput-tools

list devices:

Device:           BLM103Virtual COM Port
Kernel:           /dev/input/event1
Group:            1
Seat:             seat0, default
Capabilities:     keyboard
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           MP107
Kernel:           /dev/input/event0
Group:            2
Seat:             seat0, default
Capabilities:     keyboard
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a





laptop

bluetoothctl:
        Class: 0x000a010c
        Icon: computer
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        RSSI: -57
        TxPower: 8

...according to btclassify.py: class 0x000a01: Reserved:

Browsing 78:0C:B8:0A:EB:0E ... Service Name: Service Discovery Service Description: Publishes services to remote devices Service Provider: Microsoft Service RecHandle: 0x0 Service Class ID List: "SDP Server" (0x1000) Protocol Descriptor List: "L2CAP" (0x0100) PSM: 1 "SDP" (0x0001) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Browsing 78:0C:B8:0A:EB:0E ... Service Search failed: Invalid argument Service Name: Device ID Service Record Service Description: Device ID Service Record Service RecHandle: 0x10000 Service Class ID List: "PnP Information" (0x1200) Protocol Descriptor List: "L2CAP" (0x0100) PSM: 1 "SDP" (0x0001) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Browsing 78:0C:B8:0A:EB:0E ... Service Search failed: Invalid argument Service Name: Audio Video Remote Control Profile Service RecHandle: 0x10007 Service Class ID List: "AV Remote Target" (0x110c) Protocol Descriptor List: "L2CAP" (0x0100) PSM: 23 "AVCTP" (0x0017) uint16: 0x0104 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Profile Descriptor List: "AV Remote" (0x110e) Version: 0x0106 Service Name: Audio Source Service RecHandle: 0x10008 Service Class ID List: "Audio Source" (0x110a) Protocol Descriptor List: "L2CAP" (0x0100) PSM: 25 "AVDTP" (0x0019) uint16: 0x0102 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Profile Descriptor List: "Advanced Audio" (0x110d) Version: 0x0102 Service RecHandle: 0x10009 Service Class ID List: "AV Remote" (0x110e) "AV Remote Controller" (0x110f) Protocol Descriptor List: "L2CAP" (0x0100) PSM: 23 "AVCTP" (0x0017) uint16: 0x0104 Profile Descriptor List: "AV Remote" (0x110e) Version: 0x0106 Service Name: Personal Ad Hoc User Service Service Description: Personal Ad Hoc User Service Service RecHandle: 0x1000a Service Class ID List: "PAN User" (0x1115) Protocol Descriptor List: "L2CAP" (0x0100) PSM: 15 "BNEP" (0x000f) Version: 0x0100 SEQ8: 0 dd 6 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Profile Descriptor List: "PAN User" (0x1115) Version: 0x0100 Service Name: Voice Gateway Service RecHandle: 0x1000b Service Class ID List: "Handsfree Audio Gateway" (0x111f) "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: "Handsfree" (0x111e) Version: 0x0106 Service Name: CDP Proximal Transport Service RecHandle: 0x1000c Service Class ID List: UUID 128: c7f94713-891e-496a-a0e7-983a0946126e Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 2 Attempting to pair with 78:0C:B8:0A:EB:0E [CHG] Device 78:0C:B8:0A:EB:0E Connected: yes Request confirmation [agent] Confirm passkey 141321 (yes/no): yes [CHG] Device 78:0C:B8:0A:EB:0E Modalias: bluetooth:v0006p0001d0A00 [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: 00001000-0000-1000-8000-00805f9b34fb [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: 00001115-0000-1000-8000-00805f9b34fb [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: 0000111f-0000-1000-8000-00805f9b34fb [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Device 78:0C:B8:0A:EB:0E UUIDs: c7f94713-891e-496a-a0e7-983a0946126e [CHG] Device 78:0C:B8:0A:EB:0E ServicesResolved: yes [CHG] Device 78:0C:B8:0A:EB:0E Paired: yes Pairing successful [CHG] Device 78:0C:B8:0A:EB:0E ServicesResolved: no [CHG] Device 78:0C:B8:0A:EB:0E Connected: no [Jabra STONE]# info 78:0C:B8:0A:EB:0E Device 78:0C:B8:0A:EB:0E Name: SHLAP01 Alias: SHLAP01 Class: 0x000a010c Icon: computer Paired: yes Trusted: no Blocked: no Connected: no LegacyPairing: no UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: PANU (00001115-0000-1000-8000-00805f9b34fb) UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Vendor specific (c7f94713-891e-496a-a0e7-983a0946126e) Modalias: bluetooth:v0006p0001d0A00 RSSI: -54 TxPower: 8 [Jabra STONE]# connect 78:0C:B8:0A:EB:0E Attempting to connect to 78:0C:B8:0A:EB:0E [CHG] Device 78:0C:B8:0A:EB:0E Connected: yes Connection successful [CHG] Device 78:0C:B8:0A:EB:0E ServicesResolved: yes pacmd --list-cards index: 7 name: driver: owner module: 31 properties: device.description = "SHLAP01" device.string = "78:0C:B8:0A:EB:0E" device.api = "bluez" device.class = "sound" device.bus = "bluetooth" bluez.path = "/org/bluez/hci0/dev_78_0C_B8_0A_EB_0E" bluez.class = "0x0a010c" bluez.alias = "SHLAP01" device.icon_name = "audio-card-bluetooth" profiles: a2dp_source: High Fidelity Capture (A2DP Source) (priority 20, available: unknown) headset_audio_gateway: Headset Audio Gateway (HSP/HFP) (priority 10, available: unknown) off: Off (priority 0, available: yes) active profile: sources: bluez_source.78_0C_B8_0A_EB_0E.a2dp_source/#13: SHLAP01 ports: unknown-output: Bluetooth Output (priority 0, latency offset 0 usec, available: unknown) properties: unknown-input: Bluetooth Input (priority 0, latency offset 0 usec, available: unknown) properties:

headset Jabra


labels on charging base:

Type BTE2
Rated: 5V, 400mA

N256
Z302
Jabra

microUSB charging connector
4 pins on base-headset interface

labels on headset:

CE
GNMBTE2

004WWA0715
FCC ID: BCE-BTE2
IC: 2386C-BTE2
TYPE: BTE2

control

clicky button at the speaker end of the device

off: long-press on button, until blue+green blinks four times

on: long press to four-time green+blue blink

short click: when on, lights up green led (red if less than 10 min talk time)
when off, nothing happens
when call, answers

on-unpair: looooong press (first green+blue four quick blinks - on, then green shines blue blinks - ???, then green shines red+green blinks and device appears on available list)

[NEW] Device 00:23:78:D6:40:42 Jabra STONE
[bluetooth]# info 00:23:78:D6:40:42
Device 00:23:78:D6:40:42
        Name: Jabra STONE
        Alias: Jabra STONE
        Class: 0x00240404
        Icon: audio-card
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        RSSI: -66
[bluetooth]# pair 00:23:78:D6:40:42
Attempting to pair with 00:23:78:D6:40:42
[CHG] Device 00:23:78:D6:40:42 Connected: yes
[CHG] Device 00:23:78:D6:40:42 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 00:23:78:D6:40:42 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 00:23:78:D6:40:42 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 00:23:78:D6:40:42 ServicesResolved: yes
[CHG] Device 00:23:78:D6:40:42 Paired: yes
Pairing successful
[CHG] Device 00:23:78:D6:40:42 ServicesResolved: no
[CHG] Device 00:23:78:D6:40:42 Connected: no
...and blinking redgreen turns to blue, then all leds go off

[bluetooth]# trust 00:23:78:D6:40:42 [CHG] Device 00:23:78:D6:40:42 Trusted: yes Changing 00:23:78:D6:40:42 trust succeeded [bluetooth]# connect 00:23:78:D6:40:42 Attempting to connect to 00:23:78:D6:40:42 [CHG] Device 00:23:78:D6:40:42 Connected: yes Connection successful [CHG] Device 00:23:78:D6:40:42 ServicesResolved: yes [Jabra STONE]# info Device 00:23:78:D6:40:42 Name: Jabra STONE Alias: Jabra STONE Class: 0x00240404 Icon: audio-card Paired: yes Trusted: yes Blocked: no Connected: yes LegacyPairing: no UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) RSSI: -66 ...according to btclassify.py: class 0x002404: Audio/Video (Wearable Headset Device): Limited Discoverable Mode
[CHG] Device 00:23:78:D6:40:42 Connected: yes [CHG] Device 00:23:78:D6:40:42 Connected: no [CHG] Device 00:23:78:D6:40:42 Connected: yes [CHG] Device 00:23:78:D6:40:42 UUIDs: 00001108-0000-1000-8000-00805f9b34fb [CHG] Device 00:23:78:D6:40:42 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb [CHG] Device 00:23:78:D6:40:42 UUIDs: 0000110d-0000-1000-8000-00805f9b34fb [CHG] Device 00:23:78:D6:40:42 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb [CHG] Device 00:23:78:D6:40:42 Connected: no [CHG] Device 00:23:78:D6:40:42 Connected: yes [Jabra STONE]# info Device 00:23:78:D6:40:42 Name: Jabra STONE Alias: Jabra STONE Class: 0x00240404 Icon: audio-card Paired: yes Trusted: yes Blocked: no Connected: yes LegacyPairing: no UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb) // AdvancedAudioDistributionServiceClass UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) RSSI: -66 Jun 25 21:32:05 Octo bluetoothd[20064]: Unable to get io data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107) Jun 25 21:32:29 Octo bluetoothd[20064]: /org/bluez/hci0/dev_00_23_78_D6_40_42/fd5: fd(25) ready ofonod[25566]: src/handsfree-audio.c:am_agent_register() Agent :1.70 registered with the CODECs: CVSD ofonod[25566]: src/handsfree-audio.c:am_agent_register() Wideband speech disabled: no mSBC support ofonod[25566]: plugins/hfp_hf_bluez5.c:connect_handler() Registering External Profile handler ... ofonod[25566]: plugins/bluez5.c:bt_register_profile() Bluetooth: Registering 0000111e-0000-1000-8000-00805f9b34fb (hfp_hf) profile ofonod[25566]: plugins/bluez5.c:profile_register_cb() Requesting information ... BD Address: 00:23:78:D6:40:42 OUI Company: GN Netcom A/S (00-23-78) Device Name: Jabra STONE LMP Version: 2.1 (0x4) LMP Subversion: 0x189f Manufacturer: Cambridge Silicon Radio (10) Features page 0: 0xbf 0xfe 0x8f 0xfe 0x9b 0xff 0x59 0x83 <3-slot packets> <5-slot packets> <3-slot EDR ACL> <5-slot EDR ACL> <3-slot EDR eSCO> Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00

in default a2dp profile

    index: 3
        name: 
        driver: 
        owner module: 27
        properties:
                device.description = "Jabra STONE"
                device.string = "00:23:78:D6:40:42"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_23_78_D6_40_42"
                bluez.class = "0x240404"
                bluez.alias = "Jabra STONE"
                device.icon_name = "audio-headset-bluetooth"
                device.intended_roles = "phone"
        profiles:
                headset_head_unit: Headset Head Unit (HSP/HFP) (priority 30, available: unknown)
                a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 40, available: unknown)
                off: Off (priority 0, available: yes)
        active profile: 
        sinks:
                bluez_sink.00_23_78_D6_40_42.a2dp_sink/#3: Jabra STONE
        sources:
                bluez_sink.00_23_78_D6_40_42.a2dp_sink.monitor/#5: Monitor of Jabra STONE
        ports:
                headset-output: Headset (priority 0, latency offset 0 usec, available: unknown)
                        properties:

                headset-input: Headset (priority 0, latency offset 0 usec, available: unknown)
                        properties:

  * index: 3
        name: 
        driver: 
        flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9050
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max request: 5 KiB
        max rewind: 0 KiB
        monitor source: 5
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        fixed latency: 56.93 ms
        card: 3 
        module: 27
        properties:
                bluetooth.protocol = "a2dp_sink"
                device.description = "Jabra STONE"
                device.string = "00:23:78:D6:40:42"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_23_78_D6_40_42"
                bluez.class = "0x240404"
                bluez.alias = "Jabra STONE"
                device.icon_name = "audio-headset-bluetooth"
                device.intended_roles = "phone"
        ports:
                headset-output: Headset (priority 0, latency offset 0 usec, available: unknown)
                        properties:

        active port: 

  * index: 5
        name: 
        driver: 
        flags: DECIBEL_VOLUME LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 1050
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max rewind: 0 KiB
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        fixed latency: 56.93 ms
        monitor_of: 3
        card: 3 
        module: 27
        properties:
                device.description = "Monitor of Jabra STONE"
                device.class = "monitor"
                device.string = "00:23:78:D6:40:42"
                device.api = "bluez"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_23_78_D6_40_42"
                bluez.class = "0x240404"
                bluez.alias = "Jabra STONE"
                device.icon_name = "audio-headset-bluetooth"
                device.intended_roles = "phone"

in hsp/hfp profile

(card has index 3)

    index: 3
        name: 
        driver: 
        owner module: 27
        properties:
                device.description = "Jabra STONE"
                device.string = "00:23:78:D6:40:42"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_23_78_D6_40_42"
                bluez.class = "0x240404"
                bluez.alias = "Jabra STONE"
                device.icon_name = "audio-headset-bluetooth"
                device.intended_roles = "phone"
        profiles:
                headset_head_unit: Headset Head Unit (HSP/HFP) (priority 30, available: unknown)
                a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 40, available: unknown)
                off: Off (priority 0, available: yes)
        active profile: 
        sinks:
                bluez_sink.00_23_78_D6_40_42.headset_head_unit/#4: Jabra STONE
        sources:
                bluez_sink.00_23_78_D6_40_42.headset_head_unit.monitor/#6: Monitor of Jabra STONE
                bluez_source.00_23_78_D6_40_42.headset_head_unit/#7: Jabra STONE
        ports:
                headset-output: Headset (priority 0, latency offset 0 usec, available: unknown)
                        properties:

                headset-input: Headset (priority 0, latency offset 0 usec, available: unknown)
                        properties:

  * index: 4
        name: 
        driver: 
        flags: HARDWARE HW_VOLUME_CTRL LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9050
        volume: mono: 65536 / 100%
                balance 0.00
        base volume: 65536 / 100%
        volume steps: 16
        muted: no
        current latency: 0.00 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 6
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        used by: 0
        linked by: 0
        fixed latency: 28.00 ms
        card: 3 
        module: 27
        properties:
                bluetooth.protocol = "headset_head_unit"
                device.intended_roles = "phone"
                device.description = "Jabra STONE"
                device.string = "00:23:78:D6:40:42"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_23_78_D6_40_42"
                bluez.class = "0x240404"
                bluez.alias = "Jabra STONE"
                device.icon_name = "audio-headset-bluetooth"
        ports:
                headset-output: Headset (priority 0, latency offset 0 usec, available: unknown)
                        properties:

        active port: 


    index: 6
        name: 
        driver: 
        flags: DECIBEL_VOLUME LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 1050
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max rewind: 0 KiB
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        used by: 0
        linked by: 0
        fixed latency: 28.00 ms
        monitor_of: 4
        card: 3 
        module: 27
        properties:
                device.description = "Monitor of Jabra STONE"
                device.class = "monitor"
                device.string = "00:23:78:D6:40:42"
                device.api = "bluez"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_23_78_D6_40_42"
                bluez.class = "0x240404"
                bluez.alias = "Jabra STONE"
                device.icon_name = "audio-headset-bluetooth"
                device.intended_roles = "phone"
  * index: 7
        name: 
        driver: 
        flags: HARDWARE HW_VOLUME_CTRL LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9050
        volume: mono: 65536 / 100%
                balance 0.00
        base volume: 65536 / 100%
        volume steps: 16
        muted: no
        current latency: 0.00 ms
        max rewind: 0 KiB
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        used by: 0
        linked by: 0
        fixed latency: 28.00 ms
        card: 3 
        module: 27
        properties:
                bluetooth.protocol = "headset_head_unit"
                device.intended_roles = "phone"
                device.description = "Jabra STONE"
                device.string = "00:23:78:D6:40:42"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_23_78_D6_40_42"
                bluez.class = "0x240404"
                bluez.alias = "Jabra STONE"
                device.icon_name = "audio-headset-bluetooth"
        ports:
                headset-input: Headset (priority 0, latency offset 0 usec, available: unknown)
                        properties:

        active port: 



btmgmt:
[mgmt]# con
00:23:78:9E:58:17 type BR/EDR
00:23:78:D6:40:42 type BR/EDR







someone else's headset

74:5C:4B:62:26:B8

[bluetooth]# info 74:5C:4B:62:26:B8
Device 74:5C:4B:62:26:B8
        Name: Jabra Elite 45e
        Alias: Jabra Elite 45e
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        UUID: GN Netcom                 (0000feff-0000-1000-8000-00805f9b34fb)
        RSSI: -97


ofono/phonesim

apt-get install ofono-phonesim

[phonesim]
Driver=phonesim
Address=127.0.0.1
Port=12345

ofono-phonesim -p 12345 /usr/share/phonesim/default.xml
...cannot connect to X server

...so it won't work on console. OOPS...

hcitool

Connections:
        > ACL 00:23:78:D6:40:42 handle 11 state 1 lm SLAVE AUTH ENCRYPT

]$ hcitool info 00:23:78:D6:40:42
Requesting information ...
        BD Address:  00:23:78:D6:40:42
        OUI Company: GN Netcom A/S (00-23-78)
        Device Name: Jabra STONE
        LMP Version: 2.1 (0x4) LMP Subversion: 0x189f
        Manufacturer: Cambridge Silicon Radio (10)
        Features page 0: 0xbf 0xfe 0x8f 0xfe 0x9b 0xff 0x59 0x83
                <3-slot packets> <5-slot packets>  
                   
                   
                    
                  
                  
                  
                  
                 <3-slot EDR ACL> <5-slot EDR ACL>
                  
                  
                <3-slot EDR eSCO>  
                   
                
        Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Link quality: 255
Current transmit power level: 12
AFH map: 0xffffffffffffffff0f7c
Link policy settings: RSWITCH SNIFF
Link supervision timeout: 32000 slots (20000.00 msec)

apt-get install bluez-tools
(also installs bluez-obexd)

[00:23:78:D6:40:42]
  Name: Jabra STONE
  Alias: Jabra STONE [rw]
  Address: 00:23:78:D6:40:42
  Icon: audio-card
  Class: 0x240404
  Paired: 1
  Trusted: 1 [rw]
  Blocked: 0 [rw]
  Connected: 0
  UUIDs: [Headset, AudioSink, AdvancedAudioDistribution, Handsfree]

services discovery

Browsing 00:23:78:D6:40:42 ...
Service Name: Hands-Free unit
Service RecHandle: 0x10000
Service Class ID List:
  "Handsfree" (0x111e)
  "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:
  "Handsfree" (0x111e)
    Version: 0x0105

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

Service RecHandle: 0x10002
Service Class ID List:
  "Audio Sink" (0x110b)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 25
  "AVDTP" (0x0019)
    uint16: 0x0102
Profile Descriptor List:
  "Advanced Audio" (0x110d)
    Version: 0x0102



sdptool browse --raw --l2cap 00:23:78:D6:40:42
Sequence
        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010000
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x111e - Handsfree
                        UUID16 0x1203 - GenericAudio
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                        Sequence
                                UUID16 0x0003 - RFCOMM
                                UINT8 0x01
        Attribute 0x0006 - LanguageBaseAttributeIDList
                Sequence
                        UINT16 0x656e
                        UINT16 0x006a
                        UINT16 0x0100
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x111e - Handsfree
                                UINT16 0x0105
        Attribute 0x0100
                String Hands-Free unit^@
        Attribute 0x0311
                UINT16 0x001b
Sequence
        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010001
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x1108 - Headset
                        UUID16 0x1203 - GenericAudio
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                        Sequence
                                UUID16 0x0003 - RFCOMM
                                UINT8 0x02
        Attribute 0x0006 - LanguageBaseAttributeIDList
                Sequence
                        UINT16 0x656e
                        UINT16 0x006a
                        UINT16 0x0100
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x1108 - Headset
                                UINT16 0x0100
        Attribute 0x0100
                String Headset^@
        Attribute 0x0302
                Bool True
Sequence
        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010002
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x110b - AudioSink
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                                UINT16 0x0019
                        Sequence
                                UUID16 0x0019 - AVDTP
                                UINT16 0x0102
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x110d - AdvancedAudio
                                UINT16 0x0102
        Attribute 0x0311
                UINT16 0x0001



Service Name: Hands-Free unit
Service RecHandle: 0x10000
Service Class ID List:
  "Handsfree" (0x111e)
  "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:
  "Handsfree" (0x111e)
    Version: 0x0105

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

Service RecHandle: 0x10002
Service Class ID List:
  "Audio Sink" (0x110b)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 25
  "AVDTP" (0x0019)
    uint16: 0x0102
Profile Descriptor List:
  "Advanced Audio" (0x110d)
    Version: 0x0102



Attribute Identifier : 0x0 - ServiceRecordHandle
  Integer : 0x10000
Attribute Identifier : 0x1 - ServiceClassIDList
  Data Sequence
    UUID16 : 0x111e - Handsfree
    UUID16 : 0x1203 - GenericAudio
Attribute Identifier : 0x4 - ProtocolDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x0100 - L2CAP
    Data Sequence
      UUID16 : 0x0003 - RFCOMM
      Channel/Port (Integer) : 0x1
Attribute Identifier : 0x6 - LanguageBaseAttributeIDList
  Data Sequence
    Code ISO639 (Integer) : 0x656e
    Encoding (Integer) : 0x6a
    Base Offset (Integer) : 0x100
Attribute Identifier : 0x9 - BluetoothProfileDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x111e - Handsfree
      Version (Integer) : 0x105
Attribute Identifier : 0x100
  Data : 48 61 6e 64 73 2d 46 72 65 65 20 75 6e 69 74 00       // "Hands-Free unit"
Attribute Identifier : 0x311
  Integer : 0x1b

Attribute Identifier : 0x0 - ServiceRecordHandle
  Integer : 0x10001
Attribute Identifier : 0x1 - ServiceClassIDList
  Data Sequence
    UUID16 : 0x1108 - Headset
    UUID16 : 0x1203 - GenericAudio
Attribute Identifier : 0x4 - ProtocolDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x0100 - L2CAP
    Data Sequence
      UUID16 : 0x0003 - RFCOMM
      Channel/Port (Integer) : 0x2
Attribute Identifier : 0x6 - LanguageBaseAttributeIDList
  Data Sequence
    Code ISO639 (Integer) : 0x656e
    Encoding (Integer) : 0x6a
    Base Offset (Integer) : 0x100
Attribute Identifier : 0x9 - BluetoothProfileDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x1108 - Headset
      Version (Integer) : 0x100
Attribute Identifier : 0x100
  Data : 48 65 61 64 73 65 74 00                                // "Headset"
Attribute Identifier : 0x302 - Remote audio volume control
  Integer : 0x1

Attribute Identifier : 0x0 - ServiceRecordHandle
  Integer : 0x10002
Attribute Identifier : 0x1 - ServiceClassIDList
  Data Sequence
    UUID16 : 0x110b - AudioSink
Attribute Identifier : 0x4 - ProtocolDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x0100 - L2CAP
      Channel/Port (Integer) : 0x19
    Data Sequence
      UUID16 : 0x0019 - AVDTP
      Channel/Port (Integer) : 0x102
Attribute Identifier : 0x9 - BluetoothProfileDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x110d - AdvancedAudio
      Version (Integer) : 0x102
Attribute Identifier : 0x311
  Integer : 0x1


Sequence
        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010000
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x111e - Handsfree
                        UUID16 0x1203 - GenericAudio
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                        Sequence
                                UUID16 0x0003 - RFCOMM
                                UINT8 0x01
        Attribute 0x0006 - LanguageBaseAttributeIDList
                Sequence
                        UINT16 0x656e
                        UINT16 0x006a
                        UINT16 0x0100
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x111e - Handsfree
                                UINT16 0x0105
        Attribute 0x0100
                String Hands-Free unit
        Attribute 0x0311
                UINT16 0x001b
Sequence
        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010001
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x1108 - Headset
                        UUID16 0x1203 - GenericAudio
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                        Sequence
                                UUID16 0x0003 - RFCOMM
                                UINT8 0x02
        Attribute 0x0006 - LanguageBaseAttributeIDList
                Sequence
                        UINT16 0x656e
                        UINT16 0x006a
                        UINT16 0x0100
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x1108 - Headset
                                UINT16 0x0100
        Attribute 0x0100
                String Headset
        Attribute 0x0302
                Bool True
Sequence
        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010002
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x110b - AudioSink
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                                UINT16 0x0019
                        Sequence
                                UUID16 0x0019 - AVDTP
                                UINT16 0x0102
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x110d - AdvancedAudio
                                UINT16 0x0102
        Attribute 0x0311
                UINT16 0x0001



Searching for A2SNK on 00:23:78:D6:40:42 ...
Service RecHandle: 0x10002
Service Class ID List:
  "Audio Sink" (0x110b)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 25
  "AVDTP" (0x0019)
    uint16: 0x0102
Profile Descriptor List:
  "Advanced Audio" (0x110d)
    Version: 0x0102

Searching for HF on 00:23:78:D6:40:42 ...
Service Name: Hands-Free unit
Service RecHandle: 0x10000
Service Class ID List:
  "Handsfree" (0x111e)
  "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:
  "Handsfree" (0x111e)
    Version: 0x0105

Searching for HS on 00:23:78:D6:40:42 ...
Service Name: Headset
Service RecHandle: 0x10001
Service Class ID List:
  "Headset" (0x1108)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Headset" (0x1108)
    Version: 0x0100

btclassify

git clone https://github.com/mikeryan/btclassify

Usage: btclassify.py  [ ...]
    Class looks like: 0x112233. 0x optional




rfcomm communication

rfcomm connect hci0 00:23:78:D6:40:42 1

file:///C:/Users/user/Downloads/HFP_SPEC_V16.pdf
https://stackoverflow.com/questions/26342372/android-communicating-to-hfp-device-via-at-commands
https://gist.github.com/t-oster/68a568ac4c4e133f67ac


picocom -C -c --omap crcrlf,lfcrlf --imap hexmap,crcrlf /dev/rfcomm0

imap is        : crcrlf,hexmap
omap is        : crcrlf,lfcrlf
emap is        : crcrlf,delbs,hexmap
LF delay is    : 0
modem flags are: DTR+ RTS+ CTS+ dcd- DSR+ ri-
   DTR: toggle ^T, pulse ^P
   RTS: toggle ^R, pulse ^I


Terminal ready
AT+BRSF=27




after connection:
from handsfree: 
AT+BRSF=27
...answer:

+BRSF:27 OK features: 32bit bitmap, 8..31 reserved Bit Feature 0 EC and/or NR function 1 Call waiting or 3-way calling 2 CLI presentation capability 3 Voice recognition activation 4 Remote volume control 5 Enhanced call status 6 Enhanced call control 7 Codec negotiation 27=0x1B = 0001-1011 = remote volume + voice recog activation + call waiting + EC/NR response: 32bit bitmap, 10..31 reserved Bit Feature 0 Three-way calling 1 EC and/or NR function 2 Voice recognition function 3 In-band ring tone capability 4 Attach a number to a voice tag 5 Ability to reject a call 6 Enhanced call status 7 Enhanced call control 8 Extended Error Result Codes 9 Codec negotiation 01-1111-1110 = 1FE = 510 00-1100-0100 = 0C4 = 196 answer: +BRSF:510 OK (before and after line there has to be CRLF +BRSF:196 OK responds: AT+CIND=? +CIND: ("service",(0,1)),("call",(0,1)) OK AT+CIND? answer: +CIND: 1,0 OK responds: AT+CMER=3, 0, 0, 1 (activates indicator event reporting) OK ...for 3way calls:
AT+CHLD=?a +CHLD: 0 OK

HFP profiles

https://www.silabs.com/documents/login/presentations/Developing-Bluetooth-Audio.pdf
audio: 8kHz CVSD, 16kHz mSBC (in HFP 1.6), 20-30 msec typical delay
HSP: 8kHz CVSD, made obsolete by HFP
A2DP: 16..48 kHz, bitrate 127..345 kbps, typical delay 100-200 mec, SBC compression (alternatively aptX and AAC)
   SBC: mandatory for A2DP, low complexity, good at mid bitrates, sub-band coding
   mSBC: 16kHz mono version of SBC, also called wideband speech (WBS)
   aptX: optional higher quality than SBC, adopted by many androids
   AAC: optional higher quality, in Apple iOS
   aptX HD:
   LDAC: more modern, Sony
AVRCP: companion to A2DP, stream play/pause/skip, status control, metadata transfer

PBAP: phonebook access profile, trasfers vcard data from phone to peripheral (typ. car head unit)
MAP: message access profile, remote access to SMS and notifications

SPP: serial port profile, 0..500 kbps, android/linux/windows
iAP: apple flavor of SPP, only for MFI (made for iphone) lincencees

NFC pairing: tag has BT MAC address and supported profiles, not for apple


AG: audio gateway (phone, raspi)
HS: headset

incoming call:
AG sends unsolicited "RING" to HS, repeatedly
accept by button press, then HS sends "AT+CKPD" to AG which has to set up connection

outgoing:
button press, HS sends "AT+CKPD" to AG

AG to HS transfer: press a button, HS sends AT+CKPD

volume control from AG:
unsolicited codes +VGM: and +VGS: for microphone/speaker absolute volume, num=0..15


HSP connection:

rfcomm release 00:23:78:D6:40:42
rfcomm bind hci0 00:23:78:D6:40:42 2

on connect to port:

modem flags are: dtr- rts- cts- dcd- dsr- ri-
   DTR: toggle ^T, pulse ^P
   RTS: toggle ^R, pulse ^I


Terminal ready
[DTR+][RTS+][CTS+][DSR+]
HS-to-AG: AT+VGS=15
HS-to-AG: AT+XAPL=05AC-1702-0100,7
AG-to-HS: 
HS-to-AG: AT+CKPD=200
HS-to-AG: AT+CKPD=200
HS-to-AG: AT+CKPD=200
HS-to-AG: AT+CKPD=200
AG-to-HS: RING
AG-to-HS: 
AG-to-HS: RING
AG-to-HS: 
AG-to-HS: RING
AG-to-HS: 
AG-to-HS: RING
AG-to-HS: 
AG-to-HS: RING
AG-to-HS: 
HS-to-AG: AT+CKPD=200
AG-to-HS: +VGS:15
AG-to-HS: 
HS-to-AG: AT+CKPD=200
AG-to-HS: RING
AG-to-HS: 
AG-to-HS: +VGS:2
AG-to-HS: 
HS-to-AG: AT+VGS=02
AG-to-HS: RING
AG-to-HS: 
AG-to-HS: RING
AG-to-HS: 
AG-to-HS: 
AG-to-HS: +VGS:15
HS-to-AG: AT+VGS=15
AG-to-HS: 
AG-to-HS: RING
HS-to-AG: AT+XAPL=05AC-1702-0100,7

AG-initiated:
RING            : makes the HS beep briefly, has to be repeated
+VGS:<00..15>   : set speaker volume
+VGM:<00..15>   : set mic volume

HS-initiated:
AT+VGS=<00..15> : set speaker volume (or, indicate the locally set one)
AT+XAPL=05AC-1702-0100,7   : vendorID-productID-version,features; features: 0=reserved, 1=battery reporting, 2=docked or powered, 3=supports Siri status report, 4=noise-reduction status report
AT+CKPD=200     : button was pressed






headset Nokia

BH-212
HS-112W

Li-poly 75mAh (150mAh a real sample)
charging connector 2mm Nokia standard

range 10m
Bluetooth profile 2.1 w/ EDR
Headset profile 1.1
Handsfree profile 1.5

based on BCM2044 chip

bluetoothctl:
[NEW] Device 00:23:78:9E:58:17 00-23-78-9E-58-17
[CHG] Device 00:23:78:9E:58:17 LegacyPairing: no
[CHG] Device 00:23:78:9E:58:17 Name: Nokia BH-212
[CHG] Device 00:23:78:9E:58:17 Alias: Nokia BH-212
[CHG] Device 00:23:78:9E:58:17 LegacyPairing: yes

[bluetooth]# info 00:23:78:9E:58:17
Device 00:23:78:9E:58:17
        Name: Nokia BH-212
        Alias: Nokia BH-212
        Class: 0x00200404
        Icon: audio-card
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: yes
        RSSI: -63

...according to btclassify.py: class 0x002004: Miscellaneous: Limited Discoverable Mode

[bluetooth]# pair 00:23:78:9E:58:17 Attempting to pair with 00:23:78:9E:58:17 [CHG] Device 00:23:78:9E:58:17 Connected: yes [CHG] Device 00:23:78:9E:58:17 Modalias: bluetooth:v000Fp0000d0000 [CHG] Device 00:23:78:9E:58:17 UUIDs: 00001108-0000-1000-8000-00805f9b34fb [CHG] Device 00:23:78:9E:58:17 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb [CHG] Device 00:23:78:9E:58:17 UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Device 00:23:78:9E:58:17 ServicesResolved: yes [CHG] Device 00:23:78:9E:58:17 Paired: yes Pairing successful [CHG] Device 00:23:78:9E:58:17 ServicesResolved: no [CHG] Device 00:23:78:9E:58:17 Connected: no [bluetooth]# connect 00:23:78:9E:58:17 Attempting to connect to 00:23:78:9E:58:17 [CHG] Device 00:23:78:9E:58:17 Connected: yes [CHG] Device 00:23:78:9E:58:17 ServicesResolved: yes Failed to connect: org.bluez.Error.InProgress [CHG] Device 00:23:78:9E:58:17 ServicesResolved: no [CHG] Device 00:23:78:9E:58:17 Connected: no [bluetooth]# info 00:23:78:9E:58:17 Device 00:23:78:9E:58:17 Name: Nokia BH-212 Alias: Nokia BH-212 Class: 0x00200404 Icon: audio-card Paired: yes Trusted: no Blocked: no Connected: no LegacyPairing: yes UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) Modalias: bluetooth:v000Fp0000d0000 RSSI: -63 ...pulseaudio seems to be the culprit...
...so install newer than 10.0, in this case 12.2, from http://archive.kali.org/kali/pool/main/p/pulseaudio/, the .tar.xz file
download, unpack /configure
checking for intltool >= 0.35.0... found configure: error: Your intltool is too old. You need intltool 0.35.0 or later. ...hmmm...
apt-get install intltool ...12 megs of crap...
checking for library containing cap_init... no checking sys/capability.h usability... no checking sys/capability.h presence... no checking for sys/capability.h... no configure: error: *** sys/capability.h not found. Use --without-caps to disable capabilities support. [root@Octo:/usr/src/pulseaudio-12.2]$ ./configure --without-caps checking for LIBSNDFILE... no configure: error: Package requirements ( sndfile >= 1.0.20 ) were not met: No package 'sndfile' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBSNDFILE_CFLAGS and LIBSNDFILE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. [root@Octo:/usr/src/pulseaudio-12.2]$ apt-get install sndfile-tools same error, maybe -dev library is missing? /configure --without-caps
---{ pulseaudio 12.2 }--- prefix: /usr/local sysconfdir: ${prefix}/etc localstatedir: ${prefix}/var modlibexecdir: ${exec_prefix}/lib/pulse-12.2/modules System Runtime Path: /usr/local/var/run/pulse System State Path: /usr/local/var/lib/pulse System Config Path: /usr/local/var/lib/pulse Zsh completions directory: ${datarootdir}/zsh/site-functions Bash completions directory: ${datarootdir}/bash-completion/completions Compiler: gcc CFLAGS: -g -O2 -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmis sing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -W endif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto CPPFLAGS: -DFASTPATH -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 LIBS: -lpthread -lrt -ldl -lm Enable memfd shared memory: yes Enable X11: no Enable OSS Output: yes Enable OSS Wrapper: yes Enable EsounD: yes Enable Alsa: yes Enable CoreAudio: no Enable Solaris: no Enable WaveOut: no Enable GLib 2.0: yes Enable Gtk+ 3.0: no Enable GConf: no Enable GSettings: yes Enable Avahi: no Enable Jack: no Enable Async DNS: no Enable LIRC: no Enable D-Bus: yes Enable BlueZ 4: yes Enable BlueZ 5: yes Enable ofono headsets: yes Enable native headsets: yes Enable udev: yes Enable HAL->udev compat: yes Enable systemd Daemon (Socket Activation): no Login (Session Tracking): no Journal (Logging): no Enable TCP Wrappers: no Enable libsamplerate: no Enable IPv6: yes Enable OpenSSL (for Airtunes): no Enable fftw: no Enable orc: no Enable Adrian echo canceller: yes Enable speex (resampler, AEC): yes Enable soxr (resampler): no Enable WebRTC echo canceller: no Enable gcov coverage: no Enable unit tests: no Database tdb: no gdbm: no simple database: yes System User: pulse System Group: pulse Access Group: pulse-access Enable per-user EsounD socket: yes Force preopen: no Preopened modules: all Legacy Database Entry Support: yes ...so it runs and we're in business.
make make install ...and now we're running.
[bluetooth]# connect 00:23:78:9E:58:17 Attempting to connect to 00:23:78:9E:58:17 Failed to connect: org.bluez.Error.Failed [CHG] Device 00:23:78:9E:58:17 Connected: yes [CHG] Device 00:23:78:9E:58:17 Connected: no [bluetooth]# connect 00:23:78:9E:58:17 Attempting to connect to 00:23:78:9E:58:17 [CHG] Device 00:23:78:9E:58:17 Connected: yes [CHG] Device 00:23:78:9E:58:17 ServicesResolved: yes Failed to connect: org.bluez.Error.InProgress [CHG] Device 00:23:78:9E:58:17 ServicesResolved: no [CHG] Device 00:23:78:9E:58:17 Connected: no [CHG] Device 00:23:78:9E:58:17 Connected: yes [CHG] Device 00:23:78:9E:58:17 Connected: no [bluetooth]# connect 00:23:78:9E:58:17 Attempting to connect to 00:23:78:9E:58:17 Failed to connect: org.bluez.Error.Failed ...
[CHG] Controller B8:27:EB:EA:B7:B8 Class: 0x00280000 [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001112-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001801-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001800-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 Class: 0x002c0000 [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001112-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001801-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001800-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001112-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001801-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001800-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Controller B8:27:EB:EA:B7:B8 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb ...what's that???
...run pulseaudio
...and...
[bluetooth]# connect 00:23:78:9E:58:17 Attempting to connect to 00:23:78:9E:58:17 [CHG] Device 00:23:78:9E:58:17 Connected: yes Connection successful [CHG] Device 00:23:78:9E:58:17 ServicesResolved: yes [Nokia BH-212]# ...the device beeps
[Nokia BH-212]# info Device 00:23:78:9E:58:17 Name: Nokia BH-212 Alias: Nokia BH-212 Class: 0x00200404 Icon: audio-card Paired: yes Trusted: no Blocked: no Connected: yes LegacyPairing: yes UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) Modalias: bluetooth:v000Fp0000d0000 RSSI: -73 I: [pulseaudio] backend-native.c: doing listen I: [pulseaudio] module-card-restore.c: Restoring port latency offsets for card bluez_card.00_23_78_9E_58_17. I: [pulseaudio] card.c: Created 1 "bluez_card.00_23_78_9E_58_17" I: [pulseaudio] backend-native.c: doing connect I: [pulseaudio] module-bluez5-device.c: Transport /org/bluez/hci0/dev_00_23_78_9E_58_17/fd16 acquired: fd 22 I: [pulseaudio] module-device-restore.c: Restoring volume for sink bluez_sink.00_23_78_9E_58_17.headset_head_unit: mono: 65536 / 100% I: [pulseaudio] sink.c: Created sink 1 "bluez_sink.00_23_78_9E_58_17.headset_head_unit" with sample spec s16le 1ch 8000Hz and channel map mono I: [pulseaudio] sink.c: bluetooth.protocol = "headset_head_unit" I: [pulseaudio] sink.c: device.intended_roles = "phone" I: [pulseaudio] sink.c: device.description = "Nokia BH-212" I: [pulseaudio] sink.c: device.string = "00:23:78:9E:58:17" I: [pulseaudio] sink.c: device.api = "bluez" I: [pulseaudio] sink.c: device.class = "sound" I: [pulseaudio] sink.c: device.bus = "bluetooth" I: [pulseaudio] sink.c: device.form_factor = "headset" I: [pulseaudio] sink.c: bluez.path = "/org/bluez/hci0/dev_00_23_78_9E_58_17" I: [pulseaudio] sink.c: bluez.class = "0x200404" I: [pulseaudio] sink.c: bluez.alias = "Nokia BH-212" I: [pulseaudio] sink.c: device.icon_name = "audio-headset-bluetooth" I: [pulseaudio] source.c: Created source 1 "bluez_sink.00_23_78_9E_58_17.headset_head_unit.monitor" with sample spec s16le 1ch 8000Hz and channel map mono I: [pulseaudio] source.c: device.description = "Monitor of Nokia BH-212" I: [pulseaudio] source.c: device.class = "monitor" I: [pulseaudio] source.c: device.string = "00:23:78:9E:58:17" I: [pulseaudio] source.c: device.api = "bluez" I: [pulseaudio] source.c: device.bus = "bluetooth" I: [pulseaudio] source.c: device.form_factor = "headset" I: [pulseaudio] source.c: bluez.path = "/org/bluez/hci0/dev_00_23_78_9E_58_17" I: [pulseaudio] source.c: bluez.class = "0x200404" I: [pulseaudio] source.c: bluez.alias = "Nokia BH-212" I: [pulseaudio] source.c: device.icon_name = "audio-headset-bluetooth" I: [pulseaudio] source.c: device.intended_roles = "phone" I: [pulseaudio] module-device-restore.c: Restoring volume for source bluez_source.00_23_78_9E_58_17.headset_head_unit: mono: 56798 / 87% I: [pulseaudio] source.c: Created source 2 "bluez_source.00_23_78_9E_58_17.headset_head_unit" with sample spec s16le 1ch 8000Hz and channel map mono I: [pulseaudio] source.c: bluetooth.protocol = "headset_head_unit" I: [pulseaudio] source.c: device.intended_roles = "phone" I: [pulseaudio] source.c: device.description = "Nokia BH-212" I: [pulseaudio] source.c: device.string = "00:23:78:9E:58:17" I: [pulseaudio] source.c: device.api = "bluez" I: [pulseaudio] source.c: device.class = "sound" I: [pulseaudio] source.c: device.bus = "bluetooth" I: [pulseaudio] source.c: device.form_factor = "headset" I: [pulseaudio] source.c: bluez.path = "/org/bluez/hci0/dev_00_23_78_9E_58_17" I: [pulseaudio] source.c: bluez.class = "0x200404" I: [pulseaudio] source.c: bluez.alias = "Nokia BH-212" I: [pulseaudio] source.c: device.icon_name = "audio-headset-bluetooth" I: [bluetooth] core-util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5. I: [bluetooth] module-bluez5-device.c: Transport /org/bluez/hci0/dev_00_23_78_9E_58_17/fd16 resuming I: [pulseaudio] core.c: default_source: alsa_output.platform-soc_audio.analog-mono.monitor -> bluez_sink.00_23_78_9E_58_17.headset_head_unit.monitor I: [pulseaudio] core.c: default_sink: alsa_output.platform-soc_audio.analog-mono -> bluez_sink.00_23_78_9E_58_17.headset_head_unit I: [pulseaudio] core.c: default_source: bluez_sink.00_23_78_9E_58_17.headset_head_unit.monitor -> bluez_source.00_23_78_9E_58_17.headset_head_unit I: [pulseaudio] module.c: Loaded "module-bluez5-device" (index: #24; argument: "path=/org/bluez/hci0/dev_00_23_78_9E_58_17 autodetect_mtu=0"). I: [pulseaudio] module-suspend-on-idle.c: Source bluez_source.00_23_78_9E_58_17.headset_head_unit idle for too long, suspending ... I: [pulseaudio] module-suspend-on-idle.c: Sink bluez_sink.00_23_78_9E_58_17.headset_head_unit idle for too long, suspending ... I: [bluetooth] backend-native.c: Transport /org/bluez/hci0/dev_00_23_78_9E_58_17/fd16 released I: [pulseaudio] client.c: Created 0 "Native client (UNIX socket client)" I: [pulseaudio] protocol-native.c: Got credentials: uid=0 gid=0 success=1 I: [pulseaudio] client.c: Freed 0 "pactl" I: [pulseaudio] protocol-native.c: Connection died. I: [pulseaudio] core.c: We are idle, quitting... I: [pulseaudio] main.c: Daemon shutdown initiated. I: [pulseaudio] module.c: Unloading "module-bluez5-device" (index: #24). I: [pulseaudio] core.c: default_sink: bluez_sink.00_23_78_9E_58_17.headset_head_unit -> alsa_output.platform-soc_audio.analog-mono I: [pulseaudio] core.c: default_source: bluez_source.00_23_78_9E_58_17.headset_head_unit -> alsa_output.platform-soc_audio.analog-mono.monitor I: [pulseaudio] sink.c: Freeing sink 1 "bluez_sink.00_23_78_9E_58_17.headset_head_unit" I: [pulseaudio] source.c: Freeing source 1 "bluez_sink.00_23_78_9E_58_17.headset_head_unit.monitor" I: [pulseaudio] source.c: Freeing source 2 "bluez_source.00_23_78_9E_58_17.headset_head_unit" I: [pulseaudio] card.c: Freed 1 "bluez_card.00_23_78_9E_58_17" I: [pulseaudio] module.c: Unloaded "module-bluez5-device" (index: #24). I: [pulseaudio] module.c: Unloading "module-filter-apply" (index: #23). I: [pulseaudio] module.c: Unloaded "module-filter-apply" (index: #23). I: [pulseaudio] module.c: Unloading "module-filter-heuristics" (index: #22). I: [pulseaudio] module.c: Unloaded "module-filter-heuristics" (index: #22). I: [pulseaudio] module.c: Unloading "module-role-cork" (index: #21). I: [pulseaudio] module.c: Unloaded "module-role-cork" (index: #21). I: [pulseaudio] module.c: Unloading "module-position-event-sounds" (index: #20). I: [pulseaudio] module.c: Unloaded "module-position-event-sounds" (index: #20). I: [pulseaudio] module.c: Unloading "module-console-kit" (index: #19). I: [pulseaudio] module.c: Unloaded "module-console-kit" (index: #19). I: [pulseaudio] module.c: Unloading "module-suspend-on-idle" (index: #18). I: [alsa-sink-bcm2835 ALSA] alsa-sink.c: Trying resume... I: [alsa-sink-bcm2835 ALSA] alsa-util.c: Cannot disable ALSA period wakeups I: [alsa-sink-bcm2835 ALSA] alsa-util.c: ALSA period wakeups were not disabled I: [alsa-sink-bcm2835 ALSA] alsa-sink.c: Time scheduling watermark is 40.00ms I: [alsa-sink-bcm2835 ALSA] alsa-sink.c: Resumed successfully... I: [alsa-sink-bcm2835 ALSA] alsa-sink.c: Starting playback. I: [pulseaudio] module.c: Unloaded "module-suspend-on-idle" (index: #18). I: [pulseaudio] module.c: Unloading "module-intended-roles" (index: #17). I: [pulseaudio] module.c: Unloaded "module-intended-roles" (index: #17). I: [pulseaudio] module.c: Unloading "module-always-sink" (index: #16). I: [pulseaudio] module.c: Unloaded "module-always-sink" (index: #16). I: [pulseaudio] module.c: Unloading "module-rescue-streams" (index: #15). I: [pulseaudio] module.c: Unloaded "module-rescue-streams" (index: #15). I: [pulseaudio] module.c: Unloading "module-default-device-restore" (index: #14). I: [pulseaudio] module.c: Unloaded "module-default-device-restore" (index: #14). I: [pulseaudio] module.c: Unloading "module-gsettings" (index: #13). I: [pulseaudio] module.c: Unloaded "module-gsettings" (index: #13). I: [pulseaudio] module.c: Unloading "module-native-protocol-unix" (index: #12). I: [pulseaudio] module.c: Unloaded "module-native-protocol-unix" (index: #12). I: [pulseaudio] module.c: Unloading "module-esound-protocol-unix" (index: #11). I: [pulseaudio] module.c: Unloaded "module-esound-protocol-unix" (index: #11). I: [pulseaudio] module.c: Unloading "module-bluez4-discover" (index: #10). I: [pulseaudio] module.c: Unloaded "module-bluez4-discover" (index: #10). I: [pulseaudio] module.c: Unloading "module-bluez5-discover" (index: #9). I: [pulseaudio] module.c: Unloaded "module-bluez5-discover" (index: #9). I: [pulseaudio] module.c: Unloading "module-bluetooth-discover" (index: #8). I: [pulseaudio] module.c: Unloaded "module-bluetooth-discover" (index: #8). I: [pulseaudio] module.c: Unloading "module-bluetooth-policy" (index: #7). I: [pulseaudio] module.c: Unloaded "module-bluetooth-policy" (index: #7). I: [pulseaudio] module.c: Unloading "module-alsa-card" (index: #6). I: [pulseaudio] core.c: default_sink: alsa_output.platform-soc_audio.analog-mono -> (unset) I: [pulseaudio] core.c: default_source: alsa_output.platform-soc_audio.analog-mono.monitor -> (unset) I: [pulseaudio] sink.c: Freeing sink 0 "alsa_output.platform-soc_audio.analog-mono" I: [pulseaudio] source.c: Freeing source 0 "alsa_output.platform-soc_audio.analog-mono.monitor" I: [pulseaudio] card.c: Freed 0 "alsa_card.platform-soc_audio" I: [pulseaudio] module.c: Unloaded "module-alsa-card" (index: #6). I: [pulseaudio] module.c: Unloading "module-udev-detect" (index: #5). I: [pulseaudio] module.c: Unloaded "module-udev-detect" (index: #5). I: [pulseaudio] module.c: Unloading "module-switch-on-port-available" (index: #4). I: [pulseaudio] module.c: Unloaded "module-switch-on-port-available" (index: #4). I: [pulseaudio] module.c: Unloading "module-augment-properties" (index: #3). I: [pulseaudio] module.c: Unloaded "module-augment-properties" (index: #3). I: [pulseaudio] module.c: Unloading "module-card-restore" (index: #2). I: [pulseaudio] module.c: Unloaded "module-card-restore" (index: #2). I: [pulseaudio] module.c: Unloading "module-stream-restore" (index: #1). I: [pulseaudio] module.c: Unloaded "module-stream-restore" (index: #1). I: [pulseaudio] module.c: Unloading "module-device-restore" (index: #0). I: [pulseaudio] module.c: Unloaded "module-device-restore" (index: #0). I: [pulseaudio] main.c: Daemon terminated. Requesting information ... BD Address: 00:23:78:9E:58:17 OUI Company: GN Netcom A/S (00-23-78) Device Name: Nokia BH-212 LMP Version: 2.0 (0x3) LMP Subversion: 0x221d Manufacturer: Broadcom Corporation (15) Features: 0xbc 0xfe 0x8f 0xfe 0x1b 0xf8 0x00 0x80 <3-slot EDR eSCO> Link policy settings: RSWITCH SNIFF Connections: < eSCO 00:23:78:9E:58:17 handle 6 state 1 lm MASTER < ACL 00:23:78:9E:58:17 handle 11 state 1 lm MASTER AUTH ENCRYPT 2 card(s) available. index: 0 name: driver: owner module: 6 properties: alsa.card = "0" alsa.card_name = "bcm2835 ALSA" alsa.long_card_name = "bcm2835 ALSA" device.bus_path = "platform-soc:audio" sysfs.path = "/devices/platform/soc/soc:audio/bcm2835_alsa/sound/card0" device.string = "0" device.description = "bcm2835 ALSA" module-udev-detect.discovered = "1" device.icon_name = "audio-card" profiles: output:analog-mono: Analog Mono Output (priority 700, available: unknown) off: Off (priority 0, available: unknown) active profile: sinks: alsa_output.platform-soc_audio.analog-mono/#0: bcm2835 ALSA Analog Mono sources: alsa_output.platform-soc_audio.analog-mono.monitor/#0: Monitor of bcm2835 ALSA Analog Mono ports: analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown) properties: index: 2 name: driver: owner module: 26 properties: device.description = "Nokia BH-212" device.string = "00:23:78:9E:58:17" device.api = "bluez" device.class = "sound" device.bus = "bluetooth" device.form_factor = "headset" bluez.path = "/org/bluez/hci0/dev_00_23_78_9E_58_17" bluez.class = "0x200404" bluez.alias = "Nokia BH-212" device.icon_name = "audio-headset-bluetooth" device.intended_roles = "phone" profiles: headset_head_unit: Headset Head Unit (HSP/HFP) (priority 30, available: yes) off: Off (priority 0, available: yes) active profile: sinks: bluez_sink.00_23_78_9E_58_17.headset_head_unit/#2: Nokia BH-212 sources: bluez_sink.00_23_78_9E_58_17.headset_head_unit.monitor/#3: Monitor of Nokia BH-212 bluez_source.00_23_78_9E_58_17.headset_head_unit/#4: Nokia BH-212 ports: headset-output: Headset (priority 0, latency offset 0 usec, available: yes) properties: headset-input: Headset (priority 0, latency offset 0 usec, available: yes) properties:

BTLEjack

https://github.com/virtualabs/btlejack
monitoring, connection hijacking




HID packets

 -54 21:5d:5b:45:70:06 | 04:3e:23:02:01:03:01:06:70:45:5b:5d:21:17:16:ff:06:00:01:09:21:0a:51:ab:bb:fc:6b:b4:74:68:69:6e:6b:70:61:64:31:ca
 -66 21:5d:5b:45:70:06 | 04:3e:23:02:01:03:01:06:70:45:5b:5d:21:17:16:ff:06:00:01:09:21:0a:51:ab:bb:fc:6b:b4:74:68:69:6e:6b:70:61:64:31:be
 -61 21:5d:5b:45:70:06 | 04:3e:23:02:01:03:01:06:70:45:5b:5d:21:17:16:ff:06:00:01:09:21:0a:51:ab:bb:fc:6b:b4:74:68:69:6e:6b:70:61:64:31:c3
 -78 78:cb:96:37:a8:fc | 04:3e:1a:02:01:00:01:fc:a8:37:96:cb:78:0e:02:01:1a:02:0a:0c:07:ff:4c:00:10:02:02:00:b2
 -91 45:5f:52:16:19:87 | 04:3e:1d:02:01:00:01:87:19:16:52:5f:45:11:02:01:1a:02:0a:0c:0a:ff:4c:00:10:05:1e:18:74:1b:ca:a5
 -60 21:5d:5b:45:70:06 | 04:3e:23:02:01:03:01:06:70:45:5b:5d:21:17:16:ff:06:00:01:09:21:0a:51:ab:bb:fc:6b:b4:74:68:69:6e:6b:70:61:64:31:c4
 -61 7a:8f:0b:65:92:39 | 04:3e:10:02:01:02:01:39:92:65:0b:8f:7a:04:03:03:f3:fe:c3

 -61 7a:8f:0b:65:92:39 | 04:3e:10:02:01:02:01:39:92:65:0b:8f:7a:04:03:03:f3:fe:c3

04 - HCI Event (01=command, 04=event)
3e - LE Meta
10 - total length
 02 - LE adv report
  01 - num reports
  02 - event type
 01 - peer type addr (00=public, 01=random?)
  39:92:65:0b:8f:7a - MAC addr in inverted order
 04 - data length
  03:03:f3:fe - payload
 c3 - signed char, -61dB

from two machines

elint/ble/disp 2024-03-26T00:12:38.376045 04:3e:1b:02:01:00:00:7d:81:f0:38:c1:a4:0f:02:01:06:0b:16:d2:fc:40:00:c2:0c:92:0b:10:00:d1
({'packet': 194, 'voltage': 2.962, 'switch': 0, 'rssi': -47, 'mac': 'A4C138F0817D', 'type': 'BTHome', 'firmware': 'BTHome V2', 'data': True}, None)

elint/ble/door 2024-03-26T00:12:38.402842 04:3e:29:0d:01:13:00:00:7d:81:f0:38:c1:a4:01:00:ff:7f:a0:00:00:00:00:00:00:00:00:00:0f:02:01:06:0b:16:d2:fc:40:00:c2:0c:92:0b:10:00
({'packet': 194, 'voltage': 2.962, 'switch': 0, 'rssi': -96, 'mac': 'A4C138F0817D', 'type': 'BTHome', 'firmware': 'BTHome V2', 'data': True}, None)

04:3e: 1b: 02:01:00:    00:7d:81:f0:38:c1:a4:                                            0f:02:01:06:0b:16:d2:fc:40:00:c2:0c:92:0b:10:00: d1
04:3e: 29: 0d:01:13:00: 00:7d:81:f0:38:c1:a4: 01:00:ff:7f:a0:00:00:00:00:00:00:00:00:00: 0f:02:01:06:0b:16:d2:fc:40:00:c2:0c:92:0b:10:00


2024-03-26T01:14:42.140634
04:3e:31:
  0d:
    01:10:00:
    01:b8:f8:ba:b0:22:0f:01:00:ff:7f:
  9a:00:00:00:00:00:00:00:00:00:17:16:ff:06:00:01:09:21:0a:51:ab:bb:fc:6b:b4:74:68:69:6e:6b:70:61:64:31

2024-03-26T01:14:42.288907 04:3e:28:0d:01:13:00:01:4f:42:22:45:6d:7f:01:00:ff:7f:a0:00:00:00:00:00:00:00:00:00:0e:02:01:1a:02:0a:0c:07:ff:4c:00:10:02:02:00
2024-03-26T01:14:42.497675 04:3e:59:0d:02:13:00:01:94:f9:46:9f:27:6e:01:00:ff:7f:a2:00:00:00:00:00:00:00:00:00:11:02:01:1a:02:0a:08:0a:ff:4c:00:10:05:37:1c:92:05:ef:13:00:01:5e:63:c4:90:cd:6f:01:00:ff:7f:a2:00:00:00:00:00:00:00:00:00:16:02:01:02:0e:ff:75:00:01:00:02:00:01:03:ff:00:00:43:09:03:19:c0:00

https://blog.51cto.com/u_11866419/4762603
https://fuchsia.googlesource.com/garnet/+/66e1924c2a18c92594644cfa392bf02cb568984d/drivers/bluetooth/lib/hci/hci.h
04:3e:
      29: length
         0d: subevent=extended adv
            01: num reports
               13:00: event type bitfield
                     00: 0=pub, 1=random, 2=Private with public fallback, 3=Private with random fallback
                        7d:81:f0:38:c1:a4: mac
                                          01: primary broadcast channel bandwidth, 1=LE 1Mbit
                                             00: secondary broadcast channel bandwidth, 0=unused
                                                ff: broadcast SID (ff=unavailable)
                                                   7f: Tx power (7F=unavailable)
                                                      a0: RSSI
                                                         00:00: periodic broadcast interval
                                                               00: direct addr type
                                                                  00:00:00:00:00:00: target direct dev addr
                                                                                    0f: payload length
                                                                                       02:01:06:0b:16:d2:fc:40:00:c2:0c:92:0b:10:00 payload

0..5 - header (for splitting multi, adjust length!)
payload:
0..22 - header
23: payload length
24..24+payload length: payload


elint/ble/door 2024-03-26T03:50:50.986003 04:3e:56:0d:02:13:00:01:5e:63:c4:90:cd:6f:01:00:ff:7f:a6:00:00:00:00:00:00:00:00:00:16:02:01:02:0e:ff:75:00:01:00:02:00:01:03:ff:00:00:43:09:03:19:c0:00:13:00:01:08:eb:98:86:fb:68:01:00:ff:7f:a4:00:00:00:00:00:00:00:00:00:0e:02:01:1a:02:0a:0c:07:ff:4c:00:10:02:02:00
(None, None)
04:3e:
      56:
         0d:
            02:
               13:00:
                     01:
                        5e:63:c4:90:cd:6f:
                                          01:00:ff:
                                                   7f:
                                                      a6:
                                                         00:00:
                                                               00:
                                                                  00:00:00:00:00:00:
                                                                                    16:
                                                                                       02:01:02:0e:ff:75:00:01: 00:02:00:01:03:ff:00:00:
                                                                                       43:09:03:19:c0:00:13:00: 01:08:eb:98:86:fb:68:01:
                                                                                       00:ff:7f:a4:00:00:00:00: 00:00:00:00:00:0e:02:01:
                                                                                       1a:02:0a:0c:07:ff:4c:00: 10:02:02:00


elint/ble/disp 2024-03-27T13:37:49.215869 04:3e:2a:02:01:00:00:0f:80:41:7b:03:cc:1e:02:01:06:1a:ff:4c:00:02:15:74:27:8b:da:b6:44:45:20:8f:0c:72:0e:af:05:99:35:00:00:47:bd:c5:b5
({'type': 'iBeacon', 'packet': 'no packet id', 'firmware': 'iBeacon', 'data': True, 'rssi': -75, 'mac': 'CC037B41800F', 'uuid': '74278bdab64445208f0c720eaf059935', 'tracker_id': b"t'\x8b\xda\xb6DE \x8f\x0cr\x0e\xaf\x05\x995", 'major': 0, 'minor': 18365, 'measured power': -59, 'cypress temperature': 82.88078125000001, 'cypress humidity': 28.66796875}, None)

elint/ble/disp 2024-03-27T13:37:49.234954 04:3e:2a:02:01:00:00:0f:80:41:7b:03:cc:1e:02:01:06:1a:ff:4c:00:02:15:74:27:8b:da:b6:44:45:20:8f:0c:72:0e:af:05:99:35:00:00:47:bd:c5:b2
({'type': 'iBeacon', 'packet': 'no packet id', 'firmware': 'iBeacon', 'data': True, 'rssi': -78, 'mac': 'CC037B41800F', 'uuid': '74278bdab64445208f0c720eaf059935', 'tracker_id': b"t'\x8b\xda\xb6DE \x8f\x0cr\x0e\xaf\x05\x995", 'major': 0, 'minor': 18365, 'measured power': -59, 'cypress temperature': 82.88078125000001, 'cypress humidity': 28.66796875}, None)

04:3e:37:0d:01:13:00:01:47:52:33:32:39:ce:01:00:ff:7f:a0:00:00:00:00:00:00:00:00:00:1d:02:01:06:03:03:27:18:15:16:27:18:a8:01:71:0e:01:00:00:47:52:33:32:39:ce:00:00:00:00:00
: 01 [ 3]  06
: 03 [ 4]  27:18
: 16 [22]  27:18:a8:01:71:0e:01:00:00:47:52:33:32:39:ce:00:00:00:00:00
: uuid16:  1827 = Mesh Provisioning

04:3e:38:0d:01:13:00:01:46:52:33:32:39:ce:01:00:ff:7f:9c:00:00:00:00:00:00:00:00:00:1e:02:01:06:11:09:47:6f:76:65:65:5f:48:36:31:37:38:5f:35:32:34:36:08:ff:02:88:ec:00:0a:02:01
cloc: Govee_H6178_5246
: 01 [ 3]  06
: 09 [18]  47:6f:76:65:65:5f:48:36:31:37:38:5f:35:32:34:36
: ff [ 9]  02:88:ec:00:0a:02:01 = unknown:34818

04:3e:2d:0d:01:13:00:01:91:3b:e9:93:81:d3:01:00:ff:7f:98:00:00:00:00:00:00:00:00:00:13:02:01:0a:05:03:c0:ff:c2:fd:09:ff:da:01:16:03:00:00:00:00
: 01 [ 3]  0a
: 03 [ 6]  c0:ff:c2:fd
: ff [10]  da:01:16:03:00:00:00:00 = Logitech International SA
: uuid16:  ffc0 = unknown:0000FFC0

043e310d01100001c66b880766310100ff7fcc0000000000000000001716ff06000109210a51abbbfc6bb47468696e6b70616431
::evtype 1001 ADV_DIRECT_IND Connectable
: ff [23]  06:00:01:09:21:0a:51:ab:bb:fc:6b:b4:74:68:69:6e:6b:70:61:64:31 = Microsoft
HCI: {'mac': '31:66:07:88:6b:c6', 'mact': 1, 'rssi': -52, 'subtype': 13, 'evtype': 4097, 'bwpri': 1, 'bwsec': 0, 'payload': b'\x16\xff\x06\x00\x01\t!\nQ\xab\xbb\xfck\xb4thinkpad1'}
BLE: {'mac': '31:66:07:88:6b:c6', 'mact': 1, 'rssi': -52, 'mfg': ['06:00:01:09:21:0a:51:ab:bb:fc:6b:b4:74:68:69:6e:6b:70:61:64:31']}

RAW: sigint/ble/behemoth:1 2024-04-15T20:53:22.811616  04:3e:2d:0d:01:13:00:00:9e:d6:50:19:32:18:01:00:ff:7f:9e:00:00:00:00:00:00:00:00:00:13:02:01:06:0b:09:55:41:20:46:50:20:44:36:39:45:03:02:14:18
::evtype 0013 ADV_NONCONN_IND Connectable Scannable Legacy
: 01 [ 3]  06  LEgenDisc BREDR
: 09 [12]  55:41:20:46:50:20:44:36:39:45 = UA FP D69E
: 02 [ 4]  14:18 (partial)
: uuid16:  1814 = Running Speed and Cadence

RAW: sigint/ble/disp:2 2024-04-17T13:43:27.424030  04:3e:30:0d:01:13:00:01:3c:90:6c:52:45:6a:01:00:ff:7f:a2:00:00:00:00:00:00:00:00:00:16:02:01:18:02:0a:f7:0f:16:2c:fe:00:40:84:12:42:20:11:55:33:50:7f:7f
::evtype 0013 ADV_NONCONN_IND Connectable Scannable Legacy
: 01 [ 3]  18  LEBREDRctlr LEBREDRhost
: 0a [ 3]  f7
: 16 [16]  2c:fe:00:40:84:12:42:20:11:55:33:50:7f:7f = {'uuid': 65068, 'name': 'Google LLC'}
HCI: {'mac': '6a:45:52:6c:90:3c', 'mact': 1, 'rssi': -94, 'subtype': 13, 'evtype': 19, 'bw': [1, 0], 'payload': b'\x02\x01\x18\x02\n\xf7\x0f\x16,\xfe\x00@\x84\x12B \x11U3P\x7f\x7f'}
BLE: {'mac': '6a:45:52:6c:90:3c', 'mact': 1, 'rssi': -94, 'flags': '18', 'Tx': -119, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:84:12:42:20:11:55:33:50:7f:7f'}]}
RAW: sigint/ble/disp:2 2024-04-17T13:43:33.435673  04:3e:28:0d:01:1b:00:01:3c:90:6c:52:45:6a:01:00:ff:7f:a2:00:00:00:00:00:00:00:00:00:0e:0d:ff:27:17:08:03:02:50:5f:cb:40:b5:0b:08
::evtype 001b ADV_NONCONN_IND Connectable Scannable ScanResp Legacy
: ff [14]  27:17:08:03:02:50:5f:cb:40:b5:0b:08 = unknown:1727
HCI: {'mac': '6a:45:52:6c:90:3c', 'mact': 1, 'rssi': -94, 'subtype': 13, 'evtype': 27, 'bw': [1, 0], 'payload': b"\r\xff'\x17\x08\x03\x02P_\xcb@\xb5\x0b\x08"}
BLE: {'mac': '6a:45:52:6c:90:3c', 'mact': 1, 'rssi': -94, 'mfg': ['27:17:08:03:02:50:5f:cb:40:b5:0b:08']}

RAW: sigint/ble/behemoth:1 2024-04-19T12:00:29.735033   04:3e:39:0d:01:1b:00:01:b4:2c:b2:cc:de:74:01:00:ff:7f:a2:00:00:00:00:00:00:00:00:00:1f:1e:ff:75:00:01:12:65:6e:c3:ad:20:53:32:30:20:46:45:20:75:c5:be:69:76:61:74:65:6c:65:20:4a:61
::evtype 001b ADV_NONCONN_IND Connectable Scannable ScanResp Legacy
: ff [31]  75:00:01:12:65:6e:c3:ad:20:53:32:30:20:46:45:20:75:c5:be:69:76:61:74:65:6c:65:20:4a:61 = Samsung Electronics Co. Ltd.
HCI: {'mac': '74:de:cc:b2:2c:b4', 'mact': 1, 'rssi': -94, 'subtype': 13, 'evtype': 27, 'bw': [1, 0], 'payload': b'\x1e\xffu\x00\x01\x12en\xc3\xad S20 FE u\xc5\xbeivatele Ja'}
BLE: {'mac': '74:de:cc:b2:2c:b4', 'mact': 1, 'rssi': -94, 'mfg': ['75:00:01:12:65:6e:c3:ad:20:53:32:30:20:46:45:20:75:c5:be:69:76:61:74:65:6c:65:20:4a:61']}






FE2C fast-pair requests

'Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '10:30:00:00:00:21:d3:5f:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '10:30:00:00:00:21:d3:5f:14:32'}]}
'Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '10:30:00:00:00:21:d3:5f:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '10:30:00:00:00:21:d3:5f:14:32'}]}
'flags': '18', 'Tx': -118, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:07:08:04:44:11:f5:34:64:5a:5a'}]}
flags': '18', 'Tx': -118, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:07:08:04:44:11:f5:34:64:5a:5a'}]}
flags': '18', 'Tx': -118, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:07:08:04:44:11:f5:34:64:5a:5a'}]}
flags': '18', 'Tx': -118, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:07:08:04:44:11:f5:34:64:5a:5a'}]}
flags': '18', 'Tx': -118, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:07:08:04:44:11:f5:34:64:5a:5a'}]}
Tx': -112, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:40:62:03:50:01:21:a4:ed'}]}
'Tx': -112, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:40:62:03:50:01:21:a4:ed'}]}
Tx': -125, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:00:68:90:20:11:69'}]}
Tx': -125, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:00:68:90:20:11:69'}]}
Tx': -125, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:00:68:90:20:11:69'}]}
'Tx': -125, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:00:68:90:20:11:69'}]}
Tx': -112, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:50:21:40:3c:27:20:21:5f:54'}]}
'Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:49:b0:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:49:b0:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:49:b0:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:49:b0:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:49:b0:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:49:b0:14:32'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:49:b0:14:32'}]}
flags': '06', 'Tx': -117, 'servdata': [{'uuid': 'fe2c', 'data': '00:00'}]}
Tx': -107, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '10:30:00:00:00:21:28:7c:34:47:47:13'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:44:62:7e:b3:02:29:be:10:7a'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
Tx': -122, 'servdata': [{'uuid': 'fe2c', 'data': '10:50:11:0a:c6:42:a8:21:ec:0c:46:ca:a7:c9:1c'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
Tx': -122, 'servdata': [{'uuid': 'fe2c', 'data': '10:50:11:0a:c6:42:a8:21:ec:0c:46:ca:a7:c9:1c'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:90:92:4a:15:08:d0:08:40:cb:01'}]}
Tx': -117, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:05:10:4d:20:11:8b:33:7f:5a:51'}]}
Tx': -117, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:05:10:4d:20:11:8b:33:7f:5a:51'}]}
'Tx': -109, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:11:f8'}]}
Tx': -117, 'unknown16': '03:fe', 'servdata': [{'uuid': 'fe2c', 'data': '00:40:05:10:4d:20:11:8b:33:7f:5a:51'}]}
Tx': -109, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:11:f8'}]}
'Tx': -117, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:05:10:4d:20:11:8b:33:7f:5a:51'}]}
'Tx': -109, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:11:f8'}]}
'flags': '18', 'Tx': -119, 'servdata': [{'uuid': 'fe2c', 'data': '00:40:25:84:44:80:11:55:33:64:64:7f'}]}
Tx': -112, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:21:30:eb'}]}
Tx': -121, 'servdata': [{'uuid': 'fe2c', 'data': '10:40:00:50:72:30:21:7d:55:14:28:46:03:ed:93:ae'}]}
Tx': -117, 'unknown16': '03:fe', 'servdata': [{'uuid': 'fe2c', 'data': '00:70:00:60:00:84:00:51:00:33:64:64:4d'}]}
Tx': -107, 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:11:c8'}]}
flags': '02', 'Tx': -108, 'servdata': [{'uuid': 'fe2c', 'data': '00:70:6a:2c:44:50:f9:aa:b0:11:f7'}], 'mfg': ['cb:0e:12:1f:00:aa:52']}
flags': '02', 'Tx': -108, 'servdata': [{'uuid': 'fe2c', 'data': '00:70:6a:2c:44:50:f9:aa:b0:11:f7'}], 'mfg': ['cb:0e:12:1f:00:aa:52']}
Tx': -117, 'unknown16': '03:fe', 'servdata': [{'uuid': 'fe2c', 'data': '00:70:00:60:00:84:00:51:00:33:64:64:4d'}]}
flags': '02', 'Tx': -108, 'servdata': [{'uuid': 'fe2c', 'data': '00:70:6a:2c:44:50:f9:aa:b0:11:f7'}], 'mfg': ['cb:0e:12:1f:00:aa:52']}
Tx': -117, 'servdata': [{'uuid': 'fe2c', 'data': '00:70:00:60:00:84:00:51:00:33:64:64:4d'}]}
Tx': -112, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:40:72:02:21:80:21:38:97'}]}
Tx': -112, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:40:72:02:21:80:21:38:97'}]}
flags': '06', 'Tx': -117, 'servdata': [{'uuid': 'fddf', 'data': '33:20:00:ee:f6'}, {'uuid': 'fe2c', 'data': '00:90:90:58:c9:29:00:28:a1:48:41'}]}
Tx': -116, 'uuid16': ['fd82'], 'servdata': [{'uuid': 'fe2c', 'data': '00:30:00:00:00:11:70:14:44'}]}
'flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:50:41:38:c0:20:a1'}]}
Tx': -122, 'servdata': [{'uuid': 'fe2c', 'data': '10:00:21:92:7a'}]}
'Tx': -122, 'servdata': [{'uuid': 'fe2c', 'data': '10:00:21:92:7a'}]}
flags': '06', 'Tx': -114, 'servdata': [{'uuid': 'fe2c', 'data': '00:50:41:38:c0:20:a1'}]}
Tx': -122, 'servdata': [{'uuid': 'fe2c', 'data': '10:00:21:92:7a'}]}
Tx': -122, 'servdata': [{'uuid': 'fe2c', 'data': '10:00:21:92:7a'}]}



https://www.instagram.com/chafingarmor/p/C504jZjrbN_/


                    if (advertisement_uuid == "['00003082-0000-1000-8000-00805f9b34fb']"): # White Flipper
                    if (advertisement_uuid == "['00003081-0000-1000-8000-00805f9b34fb']"): # Black Flipper
                    if (advertisement_uuid == "['00003083-0000-1000-8000-00805f9b34fb']"): # Transparent Flipper


Apple decoder:
https://hexway.io/research/apple-bleee/
https://github.com/hexway/apple_bleee/
Apple msg format:
https://arxiv.org/pdf/1904.10600.pdf

lego:
https://htmlpreview.github.io/?https://github.com/LEGO/lego-ble-wireless-protocol-docs/blob/master/docs/index.html

https://github.com/aprosvetova/xiaomi-kettle
https://github.com/xevilmaxx/BlePeripheral

ble tracking of windows and apple and fitbit across addr randomization:
https://petsymposium.org/popets/2019/popets-2019-0036.pdf

google fast pair:
https://developers.google.com/nearby/fast-pair/specifications/characteristics


blescan, with local names
< HCI Command: LE Set Random Address (0x08|0x0005) plen 6
    bdaddr 1E:FF:30:C0:A5:D4
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Random Address (0x08|0x0005) ncmd 1
    status 0x00
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
    type 0x01 (active)
    interval 11.250ms window 11.250ms
    own address: 0x01 (Random) policy: All
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 1
    status 0x00
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x01 (scanning enabled)
    filter duplicates 0x01 (enabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00

bleraw.py, without local names (passive)
< HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0
> HCI Event: Command Complete (0x0e) plen 68
    Read Local Supported Commands (0x04|0x0002) ncmd 1
    status 0x00
    Commands: ffffff03ccffefffffffec1ff20fe8fe3ff78fff1c00040061f7ffff7ff8ffff
              ffff0708000000000008
< HCI Command: LE Read Local Supported Features (0x08|0x0003) plen 0
> HCI Event: Command Complete (0x0e) plen 12
    LE Read Local Supported Features (0x08|0x0003) ncmd 1
    status 0x00 features 0x3f00000800000000 (Link Layer supports LE Encryption)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
    type 0x00 (passive)
    interval 10.000ms window 10.000ms
    own address: 0x00 (Public) policy: All
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 1
    status 0x00
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x01 (scanning enabled)
    filter duplicates 0x00 (disabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
> HCI Event: LE Meta Event (0x3e) plen 16
    LE Advertising Report
      ADV_SCAN_IND - Scannable undirected advertising (2)
      bdaddr 61:62:AA:97:9D:07 (Random)
      Complete service classes: 0xfef3
      RSSI: -67
> HCI Event: LE Meta Event (0x3e) plen 16
    LE Advertising Report
      ADV_SCAN_IND - Scannable undirected advertising (2)
      bdaddr 61:62:AA:97:9D:07 (Random)
      Complete service classes: 0xfef3
      RSSI: -67
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x00 (scanning disabled)
    filter duplicates 0x00 (disabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Advertise Enable (0x08|0x000a) ncmd 1
    status 0x0c
    Error: Command Disallowed

GATT characteristics:
    Connecting to a4:c1:38:f0:81:7d:
        0001: Service 
        0003:    Characteristic                                 READ NOTIFY  'ATC_F0817D'
        0005:    Characteristic                                  READ         
        0007:    Characteristic  READ         
        0008: Service 
        000a:    Characteristic                             INDICATE
        000b:     <0000>
        000c: Service 
        000e:    Characteristic                         READ         
        0010:    Characteristic                        READ         
        0012:    Characteristic                    READ         
        0014:    Characteristic                    READ         
        0016:    Characteristic                    READ         
        0018:    Characteristic                    READ         
        0019: Service 
        001b:    Characteristic                               READ NOTIFY  
        001c:     <0000>
        001d: Service 
        001f:    Characteristic <2a1f>                                       READ NOTIFY  
        0020:     <0000>
        0022:    Characteristic                                 READ NOTIFY  
        0023:     <0000>
        0025:    Characteristic                                    READ NOTIFY  
        0026:     <0000>
        0027: Service 
        0029:    Characteristic <00010203-0405-0607-0809-0a0b0c0d2b12>       READ WRITE NO RESPONSE  
        002a:     <4f5441>
        002b: Service 
        002d:    Characteristic <1f1f>                                       READ WRITE NO RESPONSE NOTIFY  
        002e:     <0000>
        002f: Service 


decode fail in aioblescanner:
Fatal error: protocol.data_received() call failed.
protocol: 
transport: <_SelectorSocketTransport fd=6 read=polling write=>
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 870, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 1855, in data_received
    self.process(packet)
  File "/root/ble/bleraw.py", line 71, in my_process
    xx = ev.decode(data)
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 1303, in decode
    data = ev.decode(data)
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 1350, in decode
    data = ev.decode(data)
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 833, in decode
    data = field.decode(data)
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 1379, in decode
    data = ad.decode(data)
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 1649, in decode
    val.decode(data[: length.val - len(type)])
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 664, in decode
    data = mynbyte.decode(data)
  File "/usr/local/lib/python3.9/dist-packages/aioblescan/aioblescan.py", line 623, in decode
    self.val = unpack(">%ds" % self.length, data[: self.length])[0][::-1]
struct.error: unpack requires a buffer of 4 bytes


from https://docs.zephyrproject.org/apidoc/latest/hci__types_8h.html

HCI command groups (OGF, Opcode Group Field), 6-bit

BT_HCI_OP_INQUIRY                        BT_OP(BT_OGF_LINK_CTRL, 0x0001)     /* 0x0401 */
BT_HCI_OP_INQUIRY_CANCEL                 BT_OP(BT_OGF_LINK_CTRL, 0x0002)     /* 0x0402 */
BT_HCI_OP_CONNECT                        BT_OP(BT_OGF_LINK_CTRL, 0x0005)     /* 0x0405 */
BT_HCI_OP_DISCONNECT                     BT_OP(BT_OGF_LINK_CTRL, 0x0006)     /* 0x0406 */
BT_HCI_OP_CONNECT_CANCEL                 BT_OP(BT_OGF_LINK_CTRL, 0x0008)     /* 0x0408 */
BT_HCI_OP_ACCEPT_CONN_REQ                BT_OP(BT_OGF_LINK_CTRL, 0x0009)     /* 0x0409 */
BT_HCI_OP_REJECT_CONN_REQ                BT_OP(BT_OGF_LINK_CTRL, 0x000a)     /* 0x040a */
BT_HCI_OP_LINK_KEY_REPLY                 BT_OP(BT_OGF_LINK_CTRL, 0x000b)     /* 0x040b */
BT_HCI_OP_LINK_KEY_NEG_REPLY             BT_OP(BT_OGF_LINK_CTRL, 0x000c)     /* 0x040c */
BT_HCI_OP_PIN_CODE_REPLY                 BT_OP(BT_OGF_LINK_CTRL, 0x000d)     /* 0x040d */
BT_HCI_OP_PIN_CODE_NEG_REPLY             BT_OP(BT_OGF_LINK_CTRL, 0x000e)     /* 0x040e */
BT_HCI_OP_AUTH_REQUESTED                 BT_OP(BT_OGF_LINK_CTRL, 0x0011)     /* 0x0411 */
BT_HCI_OP_SET_CONN_ENCRYPT               BT_OP(BT_OGF_LINK_CTRL, 0x0013)     /* 0x0413 */
BT_HCI_OP_REMOTE_NAME_REQUEST            BT_OP(BT_OGF_LINK_CTRL, 0x0019)     /* 0x0419 */
BT_HCI_OP_REMOTE_NAME_CANCEL             BT_OP(BT_OGF_LINK_CTRL, 0x001a)     /* 0x041a */
BT_HCI_OP_READ_REMOTE_FEATURES           BT_OP(BT_OGF_LINK_CTRL, 0x001b)     /* 0x041b */
BT_HCI_OP_READ_REMOTE_EXT_FEATURES       BT_OP(BT_OGF_LINK_CTRL, 0x001c)     /* 0x041c */
BT_HCI_OP_READ_REMOTE_VERSION_INFO       BT_OP(BT_OGF_LINK_CTRL, 0x001d)     /* 0x041d */
BT_HCI_OP_SETUP_SYNC_CONN                BT_OP(BT_OGF_LINK_CTRL, 0x0028)     /* 0x0428 */
BT_HCI_OP_ACCEPT_SYNC_CONN_REQ           BT_OP(BT_OGF_LINK_CTRL, 0x0029)     /* 0x0429 */
BT_HCI_OP_IO_CAPABILITY_REPLY            BT_OP(BT_OGF_LINK_CTRL, 0x002b)     /* 0x042b */
BT_HCI_OP_USER_CONFIRM_REPLY             BT_OP(BT_OGF_LINK_CTRL, 0x002c)     /* 0x042c */
BT_HCI_OP_USER_CONFIRM_NEG_REPLY         BT_OP(BT_OGF_LINK_CTRL, 0x002d)     /* 0x042d */
BT_HCI_OP_USER_PASSKEY_REPLY             BT_OP(BT_OGF_LINK_CTRL, 0x002e)     /* 0x042e */
BT_HCI_OP_USER_PASSKEY_NEG_REPLY         BT_OP(BT_OGF_LINK_CTRL, 0x002f)     /* 0x042f */
BT_HCI_OP_IO_CAPABILITY_NEG_REPLY        BT_OP(BT_OGF_LINK_CTRL, 0x0034)     /* 0x0434 */

BT_HCI_OP_SET_EVENT_MASK                 BT_OP(BT_OGF_BASEBAND, 0x0001)      /* 0x0c01 */
BT_HCI_OP_RESET                          BT_OP(BT_OGF_BASEBAND, 0x0003)      /* 0x0c03 */
BT_HCI_OP_WRITE_LOCAL_NAME               BT_OP(BT_OGF_BASEBAND, 0x0013)      /* 0x0c13 */
BT_HCI_OP_READ_CONN_ACCEPT_TIMEOUT       BT_OP(BT_OGF_BASEBAND, 0x0015)      /* 0x0c15 */
BT_HCI_OP_WRITE_CONN_ACCEPT_TIMEOUT      BT_OP(BT_OGF_BASEBAND, 0x0016)      /* 0x0c16 */
BT_HCI_OP_WRITE_PAGE_TIMEOUT             BT_OP(BT_OGF_BASEBAND, 0x0018)      /* 0x0c18 */
BT_HCI_OP_WRITE_SCAN_ENABLE              BT_OP(BT_OGF_BASEBAND, 0x001a)      /* 0x0c1a */
BT_HCI_OP_WRITE_CLASS_OF_DEVICE          BT_OP(BT_OGF_BASEBAND, 0x0024)      /* 0x0c24 */
BT_HCI_OP_READ_TX_POWER_LEVEL            BT_OP(BT_OGF_BASEBAND, 0x002d)      /* 0x0c2d */
BT_HCI_OP_SET_CTL_TO_HOST_FLOW           BT_OP(BT_OGF_BASEBAND, 0x0031)      /* 0x0c31 */
BT_HCI_OP_HOST_BUFFER_SIZE               BT_OP(BT_OGF_BASEBAND, 0x0033)      /* 0x0c33 */
BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS     BT_OP(BT_OGF_BASEBAND, 0x0035)      /* 0x0c35 */
BT_HCI_OP_WRITE_INQUIRY_MODE             BT_OP(BT_OGF_BASEBAND, 0x0045)      /* 0x0c45 */
BT_HCI_OP_WRITE_SSP_MODE                 BT_OP(BT_OGF_BASEBAND, 0x0056)      /* 0x0c56 */
BT_HCI_OP_SET_EVENT_MASK_PAGE_2          BT_OP(BT_OGF_BASEBAND, 0x0063)      /* 0x0c63 */
BT_HCI_OP_LE_WRITE_LE_HOST_SUPP          BT_OP(BT_OGF_BASEBAND, 0x006d)      /* 0x0c6d */
BT_HCI_OP_WRITE_SC_HOST_SUPP             BT_OP(BT_OGF_BASEBAND, 0x007a)      /* 0x0c7a */
BT_HCI_OP_READ_AUTH_PAYLOAD_TIMEOUT      BT_OP(BT_OGF_BASEBAND, 0x007b)      /* 0x0c7b */
BT_HCI_OP_WRITE_AUTH_PAYLOAD_TIMEOUT     BT_OP(BT_OGF_BASEBAND, 0x007c)      /* 0x0c7c */
BT_HCI_OP_CONFIGURE_DATA_PATH            BT_OP(BT_OGF_BASEBAND, 0x0083)      /* 0x0c83 */

BT_HCI_OP_READ_LOCAL_VERSION_INFO        BT_OP(BT_OGF_INFO, 0x0001)          /* 0x1001 */
BT_HCI_OP_READ_SUPPORTED_COMMANDS        BT_OP(BT_OGF_INFO, 0x0002)          /* 0x1002 */
BT_HCI_OP_READ_LOCAL_FEATURES            BT_OP(BT_OGF_INFO, 0x0003)          /* 0x1003 */
BT_HCI_OP_READ_LOCAL_EXT_FEATURES        BT_OP(BT_OGF_INFO, 0x0004)          /* 0x1004 */
BT_HCI_OP_READ_BUFFER_SIZE               BT_OP(BT_OGF_INFO, 0x0005)          /* 0x1005 */
BT_HCI_OP_READ_BD_ADDR                   BT_OP(BT_OGF_INFO, 0x0009)          /* 0x1009 */
BT_HCI_OP_READ_CODECS                    BT_OP(BT_OGF_INFO, 0x000b)          /* 0x100b */
BT_HCI_OP_READ_CODECS_V2                 BT_OP(BT_OGF_INFO, 0x000d)          /* 0x100d */
BT_HCI_OP_READ_CODEC_CAPABILITIES        BT_OP(BT_OGF_INFO, 0x000e)          /* 0x100e */
BT_HCI_OP_READ_CTLR_DELAY                BT_OP(BT_OGF_INFO, 0x000f)          /* 0x100f */

BT_HCI_OP_READ_RSSI                      BT_OP(BT_OGF_STATUS, 0x0005)        /* 0x1405 */
BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE       BT_OP(BT_OGF_STATUS, 0x0008)        /* 0x1408 */

BT_HCI_OP_LE_SET_EVENT_MASK              BT_OP(BT_OGF_LE, 0x0001)            /* 0x2001 */
BT_HCI_OP_LE_READ_BUFFER_SIZE            BT_OP(BT_OGF_LE, 0x0002)            /* 0x2002 */
BT_HCI_OP_LE_READ_LOCAL_FEATURES         BT_OP(BT_OGF_LE, 0x0003)            /* 0x2003 */
BT_HCI_OP_LE_SET_RANDOM_ADDRESS          BT_OP(BT_OGF_LE, 0x0005)            /* 0x2005 */
BT_HCI_OP_LE_SET_ADV_PARAM               BT_OP(BT_OGF_LE, 0x0006)            /* 0x2006 */
BT_HCI_OP_LE_READ_ADV_CHAN_TX_POWER      BT_OP(BT_OGF_LE, 0x0007)            /* 0x2007 */
BT_HCI_OP_LE_SET_ADV_DATA                BT_OP(BT_OGF_LE, 0x0008)            /* 0x2008 */
BT_HCI_OP_LE_SET_SCAN_RSP_DATA           BT_OP(BT_OGF_LE, 0x0009)            /* 0x2009 */
BT_HCI_OP_LE_SET_ADV_ENABLE              BT_OP(BT_OGF_LE, 0x000a)            /* 0x200a */
BT_HCI_OP_LE_SET_SCAN_PARAM              BT_OP(BT_OGF_LE, 0x000b)            /* 0x200b */
BT_HCI_OP_LE_SET_SCAN_ENABLE             BT_OP(BT_OGF_LE, 0x000c)            /* 0x200c */
BT_HCI_OP_LE_CREATE_CONN                 BT_OP(BT_OGF_LE, 0x000d)            /* 0x200d */
BT_HCI_OP_LE_CREATE_CONN_CANCEL          BT_OP(BT_OGF_LE, 0x000e)            /* 0x200e */
BT_HCI_OP_LE_READ_FAL_SIZE               BT_OP(BT_OGF_LE, 0x000f)            /* 0x200f */
BT_HCI_OP_LE_CLEAR_FAL                   BT_OP(BT_OGF_LE, 0x0010)            /* 0x2010 */
BT_HCI_OP_LE_ADD_DEV_TO_FAL              BT_OP(BT_OGF_LE, 0x0011)            /* 0x2011 */
BT_HCI_OP_LE_REM_DEV_FROM_FAL            BT_OP(BT_OGF_LE, 0x0012)            /* 0x2012 */
BT_HCI_OP_LE_CONN_UPDATE                 BT_OP(BT_OGF_LE, 0x0013)            /* 0x2013 */
BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF       BT_OP(BT_OGF_LE, 0x0014)            /* 0x2014 */
BT_HCI_OP_LE_READ_CHAN_MAP               BT_OP(BT_OGF_LE, 0x0015)            /* 0x2015 */
BT_HCI_OP_LE_READ_REMOTE_FEATURES        BT_OP(BT_OGF_LE, 0x0016)            /* 0x2016 */
BT_HCI_OP_LE_ENCRYPT                     BT_OP(BT_OGF_LE, 0x0017)            /* 0x2017 */
BT_HCI_OP_LE_RAND                        BT_OP(BT_OGF_LE, 0x0018)            /* 0x2018 */
BT_HCI_OP_LE_START_ENCRYPTION            BT_OP(BT_OGF_LE, 0x0019)            /* 0x2019 */
BT_HCI_OP_LE_LTK_REQ_REPLY               BT_OP(BT_OGF_LE, 0x001a)            /* 0x201a */
BT_HCI_OP_LE_LTK_REQ_NEG_REPLY           BT_OP(BT_OGF_LE, 0x001b)            /* 0x201b */
BT_HCI_OP_LE_READ_SUPP_STATES            BT_OP(BT_OGF_LE, 0x001c)            /* 0x201c */
BT_HCI_OP_LE_RX_TEST                     BT_OP(BT_OGF_LE, 0x001d)            /* 0x201d */
BT_HCI_OP_LE_TX_TEST                     BT_OP(BT_OGF_LE, 0x001e)            /* 0x201e */
BT_HCI_OP_LE_TEST_END                    BT_OP(BT_OGF_LE, 0x001f)            /* 0x201f */
BT_HCI_OP_LE_CONN_PARAM_REQ_REPLY        BT_OP(BT_OGF_LE, 0x0020)            /* 0x2020 */
BT_HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY    BT_OP(BT_OGF_LE, 0x0021)            /* 0x2021 */
BT_HCI_OP_LE_SET_DATA_LEN                BT_OP(BT_OGF_LE, 0x0022)            /* 0x2022 */
BT_HCI_OP_LE_READ_DEFAULT_DATA_LEN       BT_OP(BT_OGF_LE, 0x0023)            /* 0x2023 */
BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN      BT_OP(BT_OGF_LE, 0x0024)            /* 0x2024 */
BT_HCI_OP_LE_P256_PUBLIC_KEY             BT_OP(BT_OGF_LE, 0x0025)            /* 0x2025 */
BT_HCI_OP_LE_GENERATE_DHKEY              BT_OP(BT_OGF_LE, 0x0026)            /* 0x2026 */
BT_HCI_OP_LE_ADD_DEV_TO_RL               BT_OP(BT_OGF_LE, 0x0027)            /* 0x2027 */
BT_HCI_OP_LE_REM_DEV_FROM_RL             BT_OP(BT_OGF_LE, 0x0028)            /* 0x2028 */
BT_HCI_OP_LE_CLEAR_RL                    BT_OP(BT_OGF_LE, 0x0029)            /* 0x2029 */
BT_HCI_OP_LE_READ_RL_SIZE                BT_OP(BT_OGF_LE, 0x002a)            /* 0x202a */
BT_HCI_OP_LE_READ_PEER_RPA               BT_OP(BT_OGF_LE, 0x002b)            /* 0x202b */
BT_HCI_OP_LE_READ_LOCAL_RPA              BT_OP(BT_OGF_LE, 0x002c)            /* 0x202c */
BT_HCI_OP_LE_SET_ADDR_RES_ENABLE         BT_OP(BT_OGF_LE, 0x002d)            /* 0x202d */
BT_HCI_OP_LE_SET_RPA_TIMEOUT             BT_OP(BT_OGF_LE, 0x002e)            /* 0x202e */
BT_HCI_OP_LE_READ_MAX_DATA_LEN           BT_OP(BT_OGF_LE, 0x002f)            /* 0x202f */
BT_HCI_OP_LE_READ_PHY                    BT_OP(BT_OGF_LE, 0x0030)            /* 0x2030 */
BT_HCI_OP_LE_SET_DEFAULT_PHY             BT_OP(BT_OGF_LE, 0x0031)            /* 0x2031 */
BT_HCI_OP_LE_SET_PHY                     BT_OP(BT_OGF_LE, 0x0032)            /* 0x2032 */
BT_HCI_OP_LE_ENH_RX_TEST                 BT_OP(BT_OGF_LE, 0x0033)            /* 0x2033 */
BT_HCI_OP_LE_ENH_TX_TEST                 BT_OP(BT_OGF_LE, 0x0034)            /* 0x2034 */
BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR     BT_OP(BT_OGF_LE, 0x0035)            /* 0x2035 */
BT_HCI_OP_LE_SET_EXT_ADV_PARAM           BT_OP(BT_OGF_LE, 0x0036)            /* 0x2036 */
BT_HCI_OP_LE_SET_EXT_ADV_DATA            BT_OP(BT_OGF_LE, 0x0037)            /* 0x2037 */
BT_HCI_OP_LE_SET_EXT_SCAN_RSP_DATA       BT_OP(BT_OGF_LE, 0x0038)            /* 0x2038 */
BT_HCI_OP_LE_SET_EXT_ADV_ENABLE          BT_OP(BT_OGF_LE, 0x0039)            /* 0x2039 */
BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN       BT_OP(BT_OGF_LE, 0x003a)            /* 0x203a */
BT_HCI_OP_LE_READ_NUM_ADV_SETS           BT_OP(BT_OGF_LE, 0x003b)            /* 0x203b */
BT_HCI_OP_LE_REMOVE_ADV_SET              BT_OP(BT_OGF_LE, 0x003c)            /* 0x203c */
BT_HCI_OP_CLEAR_ADV_SETS                 BT_OP(BT_OGF_LE, 0x003d)            /* 0x203d */
BT_HCI_OP_LE_SET_PER_ADV_PARAM           BT_OP(BT_OGF_LE, 0x003e)            /* 0x203e */
BT_HCI_OP_LE_SET_PER_ADV_DATA            BT_OP(BT_OGF_LE, 0x003f)            /* 0x203f */
BT_HCI_OP_LE_SET_PER_ADV_ENABLE          BT_OP(BT_OGF_LE, 0x0040)            /* 0x2040 */
BT_HCI_OP_LE_SET_EXT_SCAN_PARAM          BT_OP(BT_OGF_LE, 0x0041)            /* 0x2041 */
BT_HCI_OP_LE_SET_EXT_SCAN_ENABLE         BT_OP(BT_OGF_LE, 0x0042)            /* 0x2042 */
BT_HCI_OP_LE_EXT_CREATE_CONN             BT_OP(BT_OGF_LE, 0x0043)            /* 0x2043 */
BT_HCI_OP_LE_PER_ADV_CREATE_SYNC         BT_OP(BT_OGF_LE, 0x0044)            /* 0x2044 */
BT_HCI_OP_LE_PER_ADV_CREATE_SYNC_CANCEL  BT_OP(BT_OGF_LE, 0x0045)            /* 0x2045 */
BT_HCI_OP_LE_PER_ADV_TERMINATE_SYNC      BT_OP(BT_OGF_LE, 0x0046)            /* 0x2046 */
BT_HCI_OP_LE_ADD_DEV_TO_PER_ADV_LIST     BT_OP(BT_OGF_LE, 0x0047)            /* 0x2047 */
BT_HCI_OP_LE_REM_DEV_FROM_PER_ADV_LIST   BT_OP(BT_OGF_LE, 0x0048)            /* 0x2048 */
BT_HCI_OP_LE_CLEAR_PER_ADV_LIST          BT_OP(BT_OGF_LE, 0x0049)            /* 0x2049 */
BT_HCI_OP_LE_READ_PER_ADV_LIST_SIZE      BT_OP(BT_OGF_LE, 0x004a)            /* 0x204a */
BT_HCI_OP_LE_READ_TX_POWER               BT_OP(BT_OGF_LE, 0x004b)            /* 0x204b */
BT_HCI_OP_LE_READ_RF_PATH_COMP           BT_OP(BT_OGF_LE, 0x004c)            /* 0x204c */
BT_HCI_OP_LE_WRITE_RF_PATH_COMP          BT_OP(BT_OGF_LE, 0x004d)            /* 0x204d */
BT_HCI_OP_LE_SET_PRIVACY_MODE            BT_OP(BT_OGF_LE, 0x004e)            /* 0x204e */
BT_HCI_OP_LE_RX_TEST_V3                  BT_OP(BT_OGF_LE, 0x004f)            /* 0x204f */
BT_HCI_OP_LE_TX_TEST_V3                  BT_OP(BT_OGF_LE, 0x0050)            /* 0x2050 */
BT_HCI_OP_LE_SET_CL_CTE_TX_PARAMS        BT_OP(BT_OGF_LE, 0x0051)            /* 0x2051 */
BT_HCI_OP_LE_SET_CL_CTE_TX_ENABLE        BT_OP(BT_OGF_LE, 0x0052)            /* 0x2052 */
BT_HCI_OP_LE_SET_CL_CTE_SAMPLING_ENABLE  BT_OP(BT_OGF_LE, 0x0053)            /* 0x2053 */
BT_HCI_OP_LE_SET_CONN_CTE_RX_PARAMS      BT_OP(BT_OGF_LE, 0x0054)            /* 0x2054 */
BT_HCI_OP_LE_SET_CONN_CTE_TX_PARAMS      BT_OP(BT_OGF_LE, 0x0055)            /* 0x2055 */
BT_HCI_OP_LE_CONN_CTE_REQ_ENABLE         BT_OP(BT_OGF_LE, 0x0056)            /* 0x2056 */
BT_HCI_OP_LE_CONN_CTE_RSP_ENABLE         BT_OP(BT_OGF_LE, 0x0057)            /* 0x2057 */
BT_HCI_OP_LE_READ_ANT_INFO               BT_OP(BT_OGF_LE, 0x0058)            /* 0x2058 */
BT_HCI_OP_LE_SET_PER_ADV_RECV_ENABLE     BT_OP(BT_OGF_LE, 0x0059)            /* 0x2059 */
BT_HCI_OP_LE_PER_ADV_SYNC_TRANSFER       BT_OP(BT_OGF_LE, 0x005a)            /* 0x205a */
BT_HCI_OP_LE_PER_ADV_SET_INFO_TRANSFER   BT_OP(BT_OGF_LE, 0x005b)            /* 0x205b */
BT_HCI_OP_LE_PAST_PARAM                  BT_OP(BT_OGF_LE, 0x005c)            /* 0x205c */
BT_HCI_OP_LE_DEFAULT_PAST_PARAM          BT_OP(BT_OGF_LE, 0x005d)            /* 0x205d */
BT_HCI_OP_LE_GENERATE_DHKEY_V2           BT_OP(BT_OGF_LE, 0x005e)            /* 0x205e */
BT_HCI_OP_LE_READ_BUFFER_SIZE_V2         BT_OP(BT_OGF_LE, 0x0060)            /* 0x2060 */
BT_HCI_OP_LE_READ_ISO_TX_SYNC            BT_OP(BT_OGF_LE, 0x0061)            /* 0x2061 */
BT_HCI_OP_LE_SET_CIG_PARAMS              BT_OP(BT_OGF_LE, 0x0062)            /* 0x2062 */
BT_HCI_OP_LE_SET_CIG_PARAMS_TEST         BT_OP(BT_OGF_LE, 0x0063)            /* 0x2063 */
BT_HCI_OP_LE_CREATE_CIS                  BT_OP(BT_OGF_LE, 0x0064)            /* 0x2064 */
BT_HCI_OP_LE_REMOVE_CIG                  BT_OP(BT_OGF_LE, 0x0065)            /* 0x2065 */
BT_HCI_OP_LE_ACCEPT_CIS                  BT_OP(BT_OGF_LE, 0x0066)            /* 0x2066 */
BT_HCI_OP_LE_REJECT_CIS                  BT_OP(BT_OGF_LE, 0x0067)            /* 0x2067 */
BT_HCI_OP_LE_CREATE_BIG                  BT_OP(BT_OGF_LE, 0x0068)            /* 0x2068 */
BT_HCI_OP_LE_CREATE_BIG_TEST             BT_OP(BT_OGF_LE, 0x0069)            /* 0x2069 */
BT_HCI_OP_LE_TERMINATE_BIG               BT_OP(BT_OGF_LE, 0x006a)            /* 0x206a */
BT_HCI_OP_LE_BIG_CREATE_SYNC             BT_OP(BT_OGF_LE, 0x006b)            /* 0x206b */
BT_HCI_OP_LE_BIG_TERMINATE_SYNC          BT_OP(BT_OGF_LE, 0x006c)            /* 0x206c */
BT_HCI_OP_LE_REQ_PEER_SC                 BT_OP(BT_OGF_LE, 0x006d)            /* 0x206d */
BT_HCI_OP_LE_SETUP_ISO_PATH              BT_OP(BT_OGF_LE, 0x006e)            /* 0x206e */
BT_HCI_OP_LE_REMOVE_ISO_PATH             BT_OP(BT_OGF_LE, 0x006f)            /* 0x206f */
BT_HCI_OP_LE_ISO_TRANSMIT_TEST           BT_OP(BT_OGF_LE, 0x0070)            /* 0x2070 */
BT_HCI_OP_LE_ISO_RECEIVE_TEST            BT_OP(BT_OGF_LE, 0x0071)            /* 0x2071 */
BT_HCI_OP_LE_ISO_READ_TEST_COUNTERS      BT_OP(BT_OGF_LE, 0x0072)            /* 0x2072 */
BT_HCI_OP_LE_ISO_TEST_END                BT_OP(BT_OGF_LE, 0x0073)            /* 0x2073 */
BT_HCI_OP_LE_SET_HOST_FEATURE            BT_OP(BT_OGF_LE, 0x0074)            /* 0x2074 */
BT_HCI_OP_LE_READ_ISO_LINK_QUALITY       BT_OP(BT_OGF_LE, 0x0075)            /* 0x2075 */
BT_HCI_OP_LE_ENH_READ_TX_POWER_LEVEL     BT_OP(BT_OGF_LE, 0x0076)            /* 0x2076 */
BT_HCI_OP_LE_READ_REMOTE_TX_POWER_LEVEL  BT_OP(BT_OGF_LE, 0x0077)            /* 0x2077 */
BT_HCI_OP_LE_SET_TX_POWER_REPORT_ENABLE  BT_OP(BT_OGF_LE, 0x007A)            /* 0x207A */
BT_HCI_OP_LE_TX_TEST_V4                  BT_OP(BT_OGF_LE, 0x007B)            /* 0x207B */
BT_HCI_OP_LE_SET_PER_ADV_SUBEVENT_DATA   BT_OP(BT_OGF_LE, 0x0082)            /* 0x2082 */
BT_HCI_OP_LE_SET_PER_ADV_RESPONSE_DATA   BT_OP(BT_OGF_LE, 0x0083)            /* 0x2083 */
BT_HCI_OP_LE_SET_PER_ADV_SYNC_SUBEVENT   BT_OP(BT_OGF_LE, 0x0084)            /* 0x2084 */
BT_HCI_OP_LE_EXT_CREATE_CONN_V2          BT_OP(BT_OGF_LE, 0x0085)            /* 0x2085 */
BT_HCI_OP_LE_SET_PER_ADV_PARAM_V2        BT_OP(BT_OGF_LE, 0x0086)            /* 0x2086 */

BLE HID H4 dissector for Broadcom test modes: https://github.com/seemoo-lab/h4bcm_wireshark_dissector?tab=readme-ov-file


If you have any comments or questions about the topic, please let me know here:
Your name:
Your email:
Spambait
Leave this empty!
Only spambots enter stuff here.
Feedback: