{"action":"created","issue":{"url":"https://api.github.com/repos/crownstone/bluenet/issues/52","repository_url":"https://api.github.com/repos/crownstone/bluenet","labels_url":"https://api.github.com/repos/crownstone/bluenet/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/crownstone/bluenet/issues/52/comments","events_url":"https://api.github.com/repos/crownstone/bluenet/issues/52/events","html_url":"https://github.com/crownstone/bluenet/issues/52","id":258821074,"node_id":"MDU6SXNzdWUyNTg4MjEwNzQ=","number":52,"title":"Generic Attribute Service","user":{"login":"mrquincle","id":1428585,"node_id":"MDQ6VXNlcjE0Mjg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/1428585?v=4","gravatar_id":"","url":"https://api.github.com/users/mrquincle","html_url":"https://github.com/mrquincle","followers_url":"https://api.github.com/users/mrquincle/followers","following_url":"https://api.github.com/users/mrquincle/following{/other_user}","gists_url":"https://api.github.com/users/mrquincle/gists{/gist_id}","starred_url":"https://api.github.com/users/mrquincle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrquincle/subscriptions","organizations_url":"https://api.github.com/users/mrquincle/orgs","repos_url":"https://api.github.com/users/mrquincle/repos","events_url":"https://api.github.com/users/mrquincle/events{/privacy}","received_events_url":"https://api.github.com/users/mrquincle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-19T13:30:25Z","updated_at":"2019-06-20T13:24:12Z","closed_at":"2019-06-20T13:24:12Z","author_association":"MEMBER","body":"Smartphone manufacturers choose to cache services/characteristics. \r\n\r\nThe mere presence of the Generic Attribute Service which has a [Service Changed](https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gatt.service_changed.xml) characteristic (`0x2A05`) influences caching behavior on different smartphones.\r\n\r\nIn theory, this characteristic should only be used if services are updated **while** being connected. It can then notify the connected smartphone of the updated handles. For example, in a firmware update procedure, the handles might be changed during the process. On the other hand, it is often stated that this characteristic is used for **paired** or **bonded** devices. IMHO the caching of attribute handles has nothing to do with the device being trusted or not, but we rely on the implementation of the vendors here.\r\n\r\n# Generic Attribute Service\r\n\r\nAt [punchthrough](https://punchthrough.com/blog/posts/attribute-caching-in-ble-advantages-and-pitfalls) it is stated that:\r\n`\r\niOS and OS X do not cache the attribute table of the connected BLE device if the Generic Attribute Service is present in their attribute table.`\r\n\r\nApparently if the Generic Attribute Service is absent, it allows iOS to cache the attribute handles! \r\n\r\nNote. It might be the case that just the absence of the Service Changed characteristic is sufficient. It might not need to be the absence of the complete Generic Attribute Service.\r\n\r\n# What is cached?\r\n\r\nOf course, the Crownstones actually **do** change the GATT table during a DFU process. Hence, it is important that the Generic Attribute Service is present at the DFU and setup modes.\r\n\r\nQuestions:\r\n\r\n* Does removing the Generic Attribute Service speed up the connection process on certain phones?\r\n* If the Generic Attribute Service is present at DFU, will it be picked up by iPhones? Or do they also \"cache\" the absence of the Generic Attribute Service itself?\r\n\r\nNote. If a Crownstone has an updated GATT table due to another user, it is important that the iPhone does a discovery process manually. This needs to be communicated somehow, either via the cloud or via advertisements / scan responses."},"comment":{"url":"https://api.github.com/repos/crownstone/bluenet/issues/comments/504024274","html_url":"https://github.com/crownstone/bluenet/issues/52#issuecomment-504024274","issue_url":"https://api.github.com/repos/crownstone/bluenet/issues/52","id":504024274,"node_id":"MDEyOklzc3VlQ29tbWVudDUwNDAyNDI3NA==","user":{"login":"mrquincle","id":1428585,"node_id":"MDQ6VXNlcjE0Mjg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/1428585?v=4","gravatar_id":"","url":"https://api.github.com/users/mrquincle","html_url":"https://github.com/mrquincle","followers_url":"https://api.github.com/users/mrquincle/followers","following_url":"https://api.github.com/users/mrquincle/following{/other_user}","gists_url":"https://api.github.com/users/mrquincle/gists{/gist_id}","starred_url":"https://api.github.com/users/mrquincle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrquincle/subscriptions","organizations_url":"https://api.github.com/users/mrquincle/orgs","repos_url":"https://api.github.com/users/mrquincle/repos","events_url":"https://api.github.com/users/mrquincle/events{/privacy}","received_events_url":"https://api.github.com/users/mrquincle/received_events","type":"User","site_admin":false},"created_at":"2019-06-20T13:24:12Z","updated_at":"2019-06-20T13:24:12Z","author_association":"MEMBER","body":"This is being solved in a completely different manner. The latency when setting up a connection can only be partly attributed to the discovery process. Setting up the connection will still be slow even if this gets resolved. Hence, switching to a connectionless method (beacon based) will actually improve the underlying perceptible delay from clicking on something and having a light respond in such way that it is basically instantaneous."}}
{"actor":{"display_login":"mrquincle"}}