btshell_GATT.rst 14 KB

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