<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NRF52840 BLE Generic Attribute Service and Generic Access Service, Usage Recommendations.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99015/nrf52840-ble-generic-attribute-service-and-generic-access-service-usage-recommendations</link><description>Hi There, 
 
 I have implemented a BLE peripheral device using the NRF52840 and NCS 2.2.0, currently the device exposes: 
 
 1. Custom service. 
 2. Device information Service. 
 3. SMP service for DFU-OTA. 
 4. Generic Attribute Service (By default)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 23 Apr 2023 10:21:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99015/nrf52840-ble-generic-attribute-service-and-generic-access-service-usage-recommendations" /><item><title>RE: NRF52840 BLE Generic Attribute Service and Generic Access Service, Usage Recommendations.</title><link>https://devzone.nordicsemi.com/thread/421894?ContentTypeID=1</link><pubDate>Sun, 23 Apr 2023 10:21:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a3fad8f-2a3b-4fd0-b31d-310617d0eb13</guid><dc:creator>Emil Lenngren</dc:creator><description>&lt;p&gt;The relevant information about mandatory to implemented services can be found in the Bluetooth Core specification as follows.&lt;/p&gt;
&lt;p&gt;For the Generic Access Service GATT service, this is defined in Vol 3, Part C (GAP) chapter 12. It says: &amp;quot;The GATT Server shall contain the GAP service as defined in the GAP Service Requirements in Table 12.1. A device shall have only one instance of the GAP service in the GATT Server.&amp;quot;. Table 12.1 shows that LE Centrals and LE Peripherals must implement this.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;mandatory characteristics for this service for a BLE Peripheral are Device Name and Appearance. So even if your application doesn&amp;#39;t really use these, your device must still be interoperable with other GAtTT clients that are interested in showing the device name for a user, e.g. in a settings UI of bonded devices.&lt;/p&gt;
&lt;p&gt;For the Generic Attribute Profile GATT service, this is defined in Vol 3, Part G (GATT) chapter 7. There is no mention here that the service itself is mandatory, but in some cases some characteristics are mandatory. If at least one characteristic turns out to be mandatory, then the service containing these (i.e. the Generic Attribute Profile GATT service) must of course be present.&lt;/p&gt;
&lt;p&gt;There are four defined characteristics for this service as of Bluetooth version 5.4: Service Changed, Client Supported Features, Database Hash, Server Supported Features. The Client Supported Features contains a bitfield (written by the client) of Robust Caching, Enhanced ATT Bearer, Multiple Handle Value Notifications. The Server Supported Features contains a bitfield of EATT Supported. Generally, each characteristic here is mandatory if the corresponding feature is implemented. The Service Changed characteristic is mandatory if services on the server can be added, changed or removed, otherwise optional.&lt;/p&gt;
&lt;p&gt;So, if you make a device that promises to never change&amp;nbsp;its GATT database, you can exclude the Service Changed characteristic. If you also don&amp;#39;t support any of the GATT features that would require any of the other characteristics to be present, you can exclude the Generic&amp;nbsp;Attribute Profile GATT service entirely.&lt;/p&gt;
&lt;p&gt;From what I can see in Zephyr, the API/SDK does not seem to include a way to entirely remove the Generic Attribute Profile GATT service, except if you modify its source code. It however seems you can make it empty by setting the Kconfig option BT_GATT_SERVICE_CHANGED to n.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>