{"action":"created","issue":{"url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/78","repository_url":"https://api.github.com/repos/nkolban/esp32-snippets","labels_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/78/comments","events_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/78/events","html_url":"https://github.com/nkolban/esp32-snippets/issues/78","id":259531280,"number":78,"title":"Example code for running a specific service on the BLE server","user":{"login":"JabberwockPL","id":24412050,"avatar_url":"https://avatars2.githubusercontent.com/u/24412050?v=4","gravatar_id":"","url":"https://api.github.com/users/JabberwockPL","html_url":"https://github.com/JabberwockPL","followers_url":"https://api.github.com/users/JabberwockPL/followers","following_url":"https://api.github.com/users/JabberwockPL/following{/other_user}","gists_url":"https://api.github.com/users/JabberwockPL/gists{/gist_id}","starred_url":"https://api.github.com/users/JabberwockPL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabberwockPL/subscriptions","organizations_url":"https://api.github.com/users/JabberwockPL/orgs","repos_url":"https://api.github.com/users/JabberwockPL/repos","events_url":"https://api.github.com/users/JabberwockPL/events{/privacy}","received_events_url":"https://api.github.com/users/JabberwockPL/received_events","type":"User","site_admin":false},"labels":[{"id":475842271,"url":"https://api.github.com/repos/nkolban/esp32-snippets/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"nkolban","id":3421732,"avatar_url":"https://avatars0.githubusercontent.com/u/3421732?v=4","gravatar_id":"","url":"https://api.github.com/users/nkolban","html_url":"https://github.com/nkolban","followers_url":"https://api.github.com/users/nkolban/followers","following_url":"https://api.github.com/users/nkolban/following{/other_user}","gists_url":"https://api.github.com/users/nkolban/gists{/gist_id}","starred_url":"https://api.github.com/users/nkolban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkolban/subscriptions","organizations_url":"https://api.github.com/users/nkolban/orgs","repos_url":"https://api.github.com/users/nkolban/repos","events_url":"https://api.github.com/users/nkolban/events{/privacy}","received_events_url":"https://api.github.com/users/nkolban/received_events","type":"User","site_admin":false},"assignees":[{"login":"nkolban","id":3421732,"avatar_url":"https://avatars0.githubusercontent.com/u/3421732?v=4","gravatar_id":"","url":"https://api.github.com/users/nkolban","html_url":"https://github.com/nkolban","followers_url":"https://api.github.com/users/nkolban/followers","following_url":"https://api.github.com/users/nkolban/following{/other_user}","gists_url":"https://api.github.com/users/nkolban/gists{/gist_id}","starred_url":"https://api.github.com/users/nkolban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkolban/subscriptions","organizations_url":"https://api.github.com/users/nkolban/orgs","repos_url":"https://api.github.com/users/nkolban/repos","events_url":"https://api.github.com/users/nkolban/events{/privacy}","received_events_url":"https://api.github.com/users/nkolban/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-09-21T15:10:48Z","updated_at":"2017-09-21T17:52:53Z","closed_at":null,"author_association":"NONE","body":"I am running the examples without problems, but I have a problem moving on. I would like ESP32 to run a specific BLE service (bike speed/cadence) and cannot even get the clients to recognize the service correctly... I am sending the service UUID as a char array with two values (18 and 16 for the UUID 0x1816) and it does not work. I am afraid that I will understand even less about sending specific values...\r\n\r\nIs there an example with code that runs a specific GATT service as described in BT specifications?"},"comment":{"url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/comments/331232678","html_url":"https://github.com/nkolban/esp32-snippets/issues/78#issuecomment-331232678","issue_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/78","id":331232678,"user":{"login":"nkolban","id":3421732,"avatar_url":"https://avatars0.githubusercontent.com/u/3421732?v=4","gravatar_id":"","url":"https://api.github.com/users/nkolban","html_url":"https://github.com/nkolban","followers_url":"https://api.github.com/users/nkolban/followers","following_url":"https://api.github.com/users/nkolban/following{/other_user}","gists_url":"https://api.github.com/users/nkolban/gists{/gist_id}","starred_url":"https://api.github.com/users/nkolban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkolban/subscriptions","organizations_url":"https://api.github.com/users/nkolban/orgs","repos_url":"https://api.github.com/users/nkolban/repos","events_url":"https://api.github.com/users/nkolban/events{/privacy}","received_events_url":"https://api.github.com/users/nkolban/received_events","type":"User","site_admin":false},"created_at":"2017-09-21T17:52:53Z","updated_at":"2017-09-21T17:52:53Z","author_association":"OWNER","body":"A certain number of BLE services and characteristics are \"prescribed\".  What that means is that they are pre-speced out so that multiple vendors can implement the same type of device and have it accessed the same way.\r\n\r\nA UUID is a unique identifier to a service or a characteristic.  A UUID is typically 128 bits of data ... but for some UUIDs, they need only be 16 bits of data.  These are the prescribed UUID.s  When we create a service, we must tell the service what UUID it is going to have.  The way we do that is to call the createService() method passing in a UUID.\r\n\r\nThere is an API function on BLEServer called `createService(BLEUUID uuid)`.\r\n\r\nIf we then look at the constructor for a BLEUUID we find that one of its constructors is:\r\n\r\nBLEUUID(uint16_t uuid)\r\n\r\nThis will create a UUID from the 16 bit value.\r\n\r\nPutting this together, your code would then become:\r\n\r\n```\r\nBLEService *pService = pServer->createService(BLEUUID((uint16_t)0x1816));\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"nkolban"}}