GATT feature API for bletiny

GATT(GENERIC ATTRIBUTE PROFILE) describes a service framework using the Attribute Protocol for discovering services, and for reading and writing characteristic values on a peer device. There are 11 features defined in the GATT Profile, and each of the features is mapped to procedures and sub-procedures:

Item No.FeatureSub-ProcedurenimBLE command
1Server ConfigurationExchange MTUb mtu
2Primary Service DiscoveryDiscover All Primary Servicesb disc svc conn=x
Discover Primary Services By Service UUIDb disc svc conn=x uuid=x
3Relationship DiscoveryFind Included Servicesb find inc_svcs conn=x start=x end=x
4Characteristic DiscoveryDiscover All Characteristic of a Serviceb disc chr conn=x start=x end=x
Discover Characteristic by UUIDb disc chr conn=x start=x end=x uuid=x
5Characteristic Descriptor DiscoveryDiscover All Characteristic Descriptorsb disc dsc conn=x start=x end=x
6Reading a Characteristic ValueRead Characteristic Valueb read conn=x attr=x
Read Using Characteristic UUIDb read conn=x start=x end=x uuid=x
Read Long Characteristic Valuesb read conn=x attr=x long=1
Read Multiple Characteristic Valuesb read conn=x attr=x attr=y attr=z
7Writing a Characteristic ValueWrite Without Responseb write conn=x value=0xXX:0xXX no_rsp=1
Signed Write Without ResponseNOT SUPPORTED
Write Characteristic Valueb write conn=x attr=x value=0xXX:0xXX
Write Long Characteristic Valuesb write conn=x attr=x value=0xXX:0xXX long=1
Characteristic Value Reliable Writesb write conn=x attr=x value=0xXX:0xXX attr=y value=0xYY:0xYY
8Notification of a Characteristic ValueNotificationsWrite 0x01:0x00 to CLIENT CONFIGURATION characteristic
9Indication of a Characteristic ValueIndicationsWrite 0x02:0x00 to CLIENT CONFIGURATION characteristic
10Reading a Characteristic DescriptorRead Characteristic Descriptorsb read conn=x attr=x
Read Long Characteristic Descriptorsb read conn=x attr=x long=1
11Writing a Characteristic DescriptorWrite Characteristic Descriptorsb write conn=x value=0xXX:0xXX
Write Long Characteristic Descriptorsb write conn=x value=0xXX:0xXX long=1

Using NimBLE commands

Assuming you have discovered and established a BLE connection with at least one peer device (as explained earlier in API for bletiny app, you can find out what characteristics and services are available over these connections. Here is a recap.

To show established connections:

b show conn

To show discovered services, characteristics, and descriptors:

b show chr

To show connection RSSI:

b show rssi conn=x