Skip to content

Commit

Permalink
* Fixed missing characteristic value caused by incorrectly parsed pro…
Browse files Browse the repository at this point in the history
…perties during GATT scan

* Adapted to higher version dependencies
* Updated README
  • Loading branch information
x committed Feb 3, 2023
1 parent 77350bb commit 1c29177
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 141 deletions.
48 changes: 26 additions & 22 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ Page 2
<span style="font-weight: bold; color: #7da9c7">A0:DE:0F:99:EF:78</span> incoming
CoD: 0x5a020c
Service Class: 0b1011010000
Telephony
Object Transfer
Capturing
Networking
Telephony
Object Transfer
Capturing
Networking
Major Device Class: 0b00010, <span style="font-weight: bold; color: #7da9c7">Phone</span>
link type: 0x01 - ACL
... ...
Expand Down Expand Up @@ -445,26 +445,32 @@ Number of services: 6

<span style="font-weight: bold; color: #7da9c7">Service</span> (0x0100 - 0x0112, 7 characteristics)
<span style="font-weight: bold; color: #7da9c7">Declaration</span>
Handle: 0x0100
Type: 2800 (Primary Service declaration)
Value: <span style="font-weight: bold; color: #9fab76">1812</span> (<span style="font-weight: bold; color: #9fab76">Human Interface Device</span>)
Permissions: Read (no authen/author)
Handle: 0x0100
Type: 2800 (Primary Service declaration)
Value: <span style="font-weight: bold; color: #9fab76">1812</span> (<span style="font-weight: bold; color: #9fab76">Human Interface Device</span>)
Permissions: Read (no authen/author)

<span style="font-weight: bold; color: #ecc179">Characteristic</span> (2 descriptors)
<span style="font-weight: bold; color: #ecc179">Declaration</span>
Handle: 0x010d
Type: 2803 (Characteristic declaration)
Value:
Properties: <span style="font-weight: bold; color: #9fab76"></span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010e</span>
UUID: <span style="font-weight: bold; color: #9fab76">2A4D</span> (<span style="font-weight: bold; color: #9fab76">Report</span>)
Permissions: Read (no authen/author)
Handle: 0x010d
Type: 2803 (Characteristic declaration)
Value:
Properties: <span style="font-weight: bold; color: #9fab76">Read, Write Without Response, Write, Notify</span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010e</span>
UUID: <span style="font-weight: bold; color: #9fab76">2A4D</span> (<span style="font-weight: bold; color: #9fab76">Report</span>)
Permissions: Read (no authen/author)

<span style="font-weight: bold; color: #ecc179">Value</span>
Handle: 0x0302
Type: 4A02 (Unknown)
Value: <span style="font-weight: bold; color: #c35956">Read Not Permitted</span>
Permissions: Higher layer specific

<span style="font-weight: bold; color: #ecc179">Descriptor</span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010f</span>
Type: <span style="font-weight: bold; color: #9fab76">2902</span> (<span style="font-weight: bold; color: #ecc179">Client Characteristic Configuration declaration</span>)
Value: <span style="font-weight: bold; color: #9fab76">b'\x00\x00'</span>
Permissions: Read (no authen/author), Write (higher layer specifies authen/author)
Handle: <span style="font-weight: bold; color: #9fab76">0x010f</span>
Type: <span style="font-weight: bold; color: #9fab76">2902</span> (<span style="font-weight: bold; color: #ecc179">Client Characteristic Configuration declaration</span>)
Value: <span style="font-weight: bold; color: #9fab76">b'\x00\x00'</span>
Permissions: Read (no authen/author), Write (higher layer specifies authen/author)
... ...
</pre>
</details>
Expand Down Expand Up @@ -512,11 +518,9 @@ Options:

#### `--collect-btsnoop-log`: 收集正在产生的 btsnoop log

<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log</code></summary>
<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log; <span style="font-weight: bold; color: #9fab76">file</span> btsnoop_hci.log</code></summary>

<pre>
$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log
$ <span style="font-weight: bold; color: #9fab76">file</span> btsnoop_hci.log
btsnoop_hci.log: BTSnoop version 1, HCI UART (H4)
</pre>
</details>
Expand Down
55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Number of service records: 18
</pre>
</details>

#### `--lmp-features` Read LMP features of a remote BR/EDR device
#### `--lmp-features`: Read LMP features of a remote BR/EDR device

<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">sudo bluing</span> br --lmp-features 6A:8D:99:33:56:AE</code></summary>

Expand Down Expand Up @@ -307,7 +307,7 @@ Page 2
</pre>
</details>

### `le`: command: Low Energy system
### `le` command: Low Energy system

<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">bluing</span> le --help</code></summary>

Expand Down Expand Up @@ -426,7 +426,7 @@ Responder Key Distribution: 0x01
</pre>
</details>

#### `--gatt` Discover GATT Profile hierarchy of a remote LE device
#### `--gatt`: Discover GATT Profile hierarchy of a remote LE device

<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">sudo bluing</span> le --gatt --addr-type=public 18:D9:8F:77:24:F1</code></summary>

Expand All @@ -439,32 +439,38 @@ Discovering all descriptors of characteristic 0x0002 <span style="font-weight: b
... ...
Reading value of the descriptor 0x0013 <span style="font-weight: bold"></span><span style="font-weight: bold; color: #00aaaa">⠴</span>
... ...
<!-- empty line -->

<span style="font-weight: bold; color: #7da9c7">----------------GATT Scan Result----------------</span>
Number of services: 6
<!-- empty line -->

<span style="font-weight: bold; color: #7da9c7">Service</span> (0x0100 - 0x0112, 7 characteristics)
<span style="font-weight: bold; color: #7da9c7">Declaration</span>
Handle: 0x0100
Type: 2800 (Primary Service declaration)
Value: <span style="font-weight: bold; color: #9fab76">1812</span> (<span style="font-weight: bold; color: #9fab76">Human Interface Device</span>)
Permissions: Read (no authen/author)
<!-- empty line -->
Handle: 0x0100
Type: 2800 (Primary Service declaration)
Value: <span style="font-weight: bold; color: #9fab76">1812</span> (<span style="font-weight: bold; color: #9fab76">Human Interface Device</span>)
Permissions: Read (no authen/author)

<span style="font-weight: bold; color: #ecc179">Characteristic</span> (2 descriptors)
<span style="font-weight: bold; color: #ecc179">Declaration</span>
Handle: 0x010d
Type: 2803 (Characteristic declaration)
Value:
Properties: <span style="font-weight: bold; color: #9fab76"></span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010e</span>
UUID: <span style="font-weight: bold; color: #9fab76">2A4D</span> (<span style="font-weight: bold; color: #9fab76">Report</span>)
Permissions: Read (no authen/author)
<!-- empty line -->
Handle: 0x010d
Type: 2803 (Characteristic declaration)
Value:
Properties: <span style="font-weight: bold; color: #9fab76">Read, Write Without Response, Write, Notify</span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010e</span>
UUID: <span style="font-weight: bold; color: #9fab76">2A4D</span> (<span style="font-weight: bold; color: #9fab76">Report</span>)
Permissions: Read (no authen/author)

<span style="font-weight: bold; color: #ecc179">Value</span>
Handle: 0x0302
Type: 4A02 (Unknown)
Value: <span style="font-weight: bold; color: #c35956">Read Not Permitted</span>
Permissions: Higher layer specific

<span style="font-weight: bold; color: #ecc179">Descriptor</span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010f</span>
Type: <span style="font-weight: bold; color: #9fab76">2902</span> (<span style="font-weight: bold; color: #ecc179">Client Characteristic Configuration declaration</span>)
Value: <span style="font-weight: bold; color: #9fab76">b'\x00\x00'</span>
Permissions: Read (no authen/author), Write (higher layer specifies authen/author)
Handle: <span style="font-weight: bold; color: #9fab76">0x010f</span>
Type: <span style="font-weight: bold; color: #9fab76">2902</span> (<span style="font-weight: bold; color: #ecc179">Client Characteristic Configuration declaration</span>)
Value: <span style="font-weight: bold; color: #9fab76">b'\x00\x00'</span>
Permissions: Read (no authen/author), Write (higher layer specifies authen/author)
... ...
</pre>
</details>
Expand Down Expand Up @@ -510,12 +516,11 @@ Options:
</pre>
</details>

#### `--collect-btsnoop-log` Collect the btsnoop log being generated
#### `--collect-btsnoop-log`: Collect the btsnoop log being generated

<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log</code></summary>
<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log; <span style="font-weight: bold; color: #9fab76">file</span> btsnoop_hci.log</code></summary>

<pre>
<!-- empty -->$ <span style="font-weight: bold; color: #9fab76">file</span> btsnoop_hci.log
btsnoop_hci.log: BTSnoop version 1, HCI UART (H4)
</pre>
</details>
Expand Down
50 changes: 27 additions & 23 deletions index-cn.html
Original file line number Diff line number Diff line change
Expand Up @@ -929,10 +929,10 @@ <h4 class="mume-header" id="--mon-incoming-conn%E6%89%93%E5%8D%B0%E9%99%84%E8%BF
<span style="font-weight: bold; color: #7da9c7">A0:DE:0F:99:EF:78</span> incoming
CoD: 0x5a020c
Service Class: 0b1011010000
Telephony
Object Transfer
Capturing
Networking
Telephony
Object Transfer
Capturing
Networking
Major Device Class: 0b00010, <span style="font-weight: bold; color: #7da9c7">Phone</span>
link type: 0x01 - ACL
... ...
Expand Down Expand Up @@ -1079,26 +1079,32 @@ <h4 class="mume-header" id="--gatt%E5%8F%91%E7%8E%B0%E8%BF%9C%E7%AB%AF-le-%E8%AE

<span style="font-weight: bold; color: #7da9c7">Service</span> (0x0100 - 0x0112, 7 characteristics)
<span style="font-weight: bold; color: #7da9c7">Declaration</span>
Handle: 0x0100
Type: 2800 (Primary Service declaration)
Value: <span style="font-weight: bold; color: #9fab76">1812</span> (<span style="font-weight: bold; color: #9fab76">Human Interface Device</span>)
Permissions: Read (no authen/author)
Handle: 0x0100
Type: 2800 (Primary Service declaration)
Value: <span style="font-weight: bold; color: #9fab76">1812</span> (<span style="font-weight: bold; color: #9fab76">Human Interface Device</span>)
Permissions: Read (no authen/author)

<span style="font-weight: bold; color: #ecc179">Characteristic</span> (2 descriptors)
<span style="font-weight: bold; color: #ecc179">Declaration</span>
Handle: 0x010d
Type: 2803 (Characteristic declaration)
Value:
Properties: <span style="font-weight: bold; color: #9fab76"></span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010e</span>
UUID: <span style="font-weight: bold; color: #9fab76">2A4D</span> (<span style="font-weight: bold; color: #9fab76">Report</span>)
Permissions: Read (no authen/author)
Handle: 0x010d
Type: 2803 (Characteristic declaration)
Value:
Properties: <span style="font-weight: bold; color: #9fab76">Read, Write Without Response, Write, Notify</span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010e</span>
UUID: <span style="font-weight: bold; color: #9fab76">2A4D</span> (<span style="font-weight: bold; color: #9fab76">Report</span>)
Permissions: Read (no authen/author)

<span style="font-weight: bold; color: #ecc179">Value</span>
Handle: 0x0302
Type: 4A02 (Unknown)
Value: <span style="font-weight: bold; color: #c35956">Read Not Permitted</span>
Permissions: Higher layer specific

<span style="font-weight: bold; color: #ecc179">Descriptor</span>
Handle: <span style="font-weight: bold; color: #9fab76">0x010f</span>
Type: <span style="font-weight: bold; color: #9fab76">2902</span> (<span style="font-weight: bold; color: #ecc179">Client Characteristic Configuration declaration</span>)
Value: <span style="font-weight: bold; color: #9fab76">b&apos;\x00\x00&apos;</span>
Permissions: Read (no authen/author), Write (higher layer specifies authen/author)
Handle: <span style="font-weight: bold; color: #9fab76">0x010f</span>
Type: <span style="font-weight: bold; color: #9fab76">2902</span> (<span style="font-weight: bold; color: #ecc179">Client Characteristic Configuration declaration</span>)
Value: <span style="font-weight: bold; color: #9fab76">b&apos;\x00\x00&apos;</span>
Permissions: Read (no authen/author), Write (higher layer specifies authen/author)
... ...
</pre>
</details>
Expand Down Expand Up @@ -1139,10 +1145,8 @@ <h3 class="mume-header" id="-android-%E5%91%BD%E4%BB%A4-android-%E8%93%9D%E7%89%
</details>
<h4 class="mume-header" id="--collect-btsnoop-log-%E6%94%B6%E9%9B%86%E6%AD%A3%E5%9C%A8%E4%BA%A7%E7%94%9F%E7%9A%84-btsnoop-log"><code>--collect-btsnoop-log</code>: &#x6536;&#x96C6;&#x6B63;&#x5728;&#x4EA7;&#x751F;&#x7684; btsnoop log</h4>

<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log</code></summary>
<pre>$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log
$ <span style="font-weight: bold; color: #9fab76">file</span> btsnoop_hci.log
btsnoop_hci.log: BTSnoop version 1, HCI UART (H4)
<details><summary><code>$ <span style="font-weight: bold; color: #9fab76">bluing</span> android -t 3 --collect-btsnoop-log -o btsnoop_hci.log; <span style="font-weight: bold; color: #9fab76">file</span> btsnoop_hci.log</code></summary>
<pre>btsnoop_hci.log: BTSnoop version 1, HCI UART (H4)
</pre>
</details>
<h3 class="mume-header" id="-plugin-%E5%91%BD%E4%BB%A4%E6%8F%92%E4%BB%B6%E7%AE%A1%E7%90%86"><code>plugin</code> &#x547D;&#x4EE4;&#xFF1A;&#x63D2;&#x4EF6;&#x7BA1;&#x7406;</h3>
Expand Down
Loading

0 comments on commit 1c29177

Please sign in to comment.