xref: /nrf52832-nimble/packages/NimBLE-latest/docs/btshell/btshell_GATT.rst (revision 042d53a763ad75cb1465103098bb88c245d95138)
1GATT feature API for btshell
2============================
3
4GATT(GENERIC ATTRIBUTE PROFILE) describes a service framework using the Attribute Protocol for discovering services,
5and for reading and writing characteristic values on a peer device. There are 11 features defined in the GATT Profile,
6and each of the features is mapped to procedures and sub-procedures:
7
8Available commands
9~~~~~~~~~~~~~~~~~~
10
11Parameters default values (if applicable) are marked red.
12
13Configuration
14-------------
15
16+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
17| **Command**                        | **Parmeters**   | \*\* Possible values\*\*   | **Description**                                           |
18+====================================+=================+============================+===========================================================+
19| **gatt-discover-characteristic**   |                 |                            | Discover GATT characteristics                             |
20+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
21|                                    | conn            | [UINT16]                   | Connection handle                                         |
22+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
23|                                    | uuid            | [UINT16]                   | Characteristic UUID                                       |
24+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
25|                                    | start           | [UINT16]                   | Discovery start handle                                    |
26+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
27|                                    | end             | [UINT16]                   | Discovery end handle                                      |
28+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
29| **gatt-discover-descriptor**       |                 |                            | Discover GATT descriptors                                 |
30+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
31|                                    | conn            | [UINT16]                   | Connection handle                                         |
32+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
33|                                    | start           | [UINT16]                   | Discovery start handle                                    |
34+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
35|                                    | end             | [UINT16]                   | Discovery end handle                                      |
36+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
37| **gatt-discover-service**          |                 |                            | Discover services                                         |
38+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
39|                                    | conn            | [UINT16]                   | Connection handle                                         |
40+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
41|                                    | uuid16          | [UINT16]                   | Service UUID                                              |
42+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
43| **gatt-discover-full**             |                 |                            | Discover services, characteristic and descriptors         |
44+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
45|                                    | conn            | [UINT16]                   | Connection handle                                         |
46+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
47| **gatt-find-included-services**    |                 |                            | Find included services                                    |
48+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
49|                                    | conn            | [UINT16]                   | Connection handle                                         |
50+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
51|                                    | start           | [UINT16]                   | Discovery start handle                                    |
52+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
53|                                    | end             | [UINT16]                   | Discovery end handle                                      |
54+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
55| **gatt-exchange-mtu**              |                 |                            | Initiate ATT MTU exchange procedure                       |
56+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
57|                                    | conn            | [UINT16]                   | Connection handle                                         |
58+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
59| **gatt-read**                      |                 |                            | Read attribute                                            |
60+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
61|                                    | conn            | [UINT16]                   | Connection handle                                         |
62+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
63|                                    | long            | [``0``-1]                  | Long read                                                 |
64+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
65|                                    | attr            | [UINT16]                   | Attribute handle                                          |
66+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
67|                                    | offset          | [UINT16]                   | Long read offset value                                    |
68+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
69|                                    | uuid            | [UINT16]                   | Characteristic UUID                                       |
70+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
71|                                    | start           | [UINT16]                   | Discovery start handle                                    |
72+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
73|                                    | end             | [UINT16]                   | Discovery end handle                                      |
74+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
75| **gatt-notify**                    |                 |                            | Send notification or indication to all subscribed peers   |
76+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
77|                                    | attr            | [UINT16]                   | Attribute handle                                          |
78+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
79| **gatt-service-changed**           |                 |                            | Send Services Changed notification                        |
80+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
81|                                    | start           | [UINT16]                   | Start handle                                              |
82+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
83|                                    | end             | [UINT16]                   | End handle                                                |
84+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
85| **gatt-service-visibility**        |                 |                            | Set service visibility                                    |
86+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
87|                                    | handle          | [UINT16]                   | Service handle                                            |
88+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
89|                                    | visibility      | [``0``-1]                  | Service visibility                                        |
90+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
91| **gatt-show**                      |                 |                            | Show remote devices discovered databases structure        |
92+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
93| **gatt-show-local**                |                 |                            | Show local database structure                             |
94+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
95| **gatt-write**                     |                 |                            | Write attribute                                           |
96+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
97|                                    | conn            | [UINT16]                   | Connection handle                                         |
98+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
99|                                    | no\_rsp         | [``0``-1]                  | Use Write Without Response                                |
100+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
101|                                    | long            | [``0``-1]                  | Use Long Write procedure                                  |
102+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
103|                                    | attr            | [UINT16]                   | Attribute handle                                          |
104+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
105|                                    | offset          | [UINT16]                   | Long write offset value                                   |
106+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
107|                                    | value           | XX:XX:XX...                | Data to write                                             |
108+------------------------------------+-----------------+----------------------------+-----------------------------------------------------------+
109