{"action":"created","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6644","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6644/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6644/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6644/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/issues/6644","id":305896438,"number":6644,"title":"Bluetooth: Add reason parameter to L2CAP Channel disconnected callback","user":{"login":"MariuszSkamra","id":10126877,"avatar_url":"https://avatars3.githubusercontent.com/u/10126877?v=4","gravatar_id":"","url":"https://api.github.com/users/MariuszSkamra","html_url":"https://github.com/MariuszSkamra","followers_url":"https://api.github.com/users/MariuszSkamra/followers","following_url":"https://api.github.com/users/MariuszSkamra/following{/other_user}","gists_url":"https://api.github.com/users/MariuszSkamra/gists{/gist_id}","starred_url":"https://api.github.com/users/MariuszSkamra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariuszSkamra/subscriptions","organizations_url":"https://api.github.com/users/MariuszSkamra/orgs","repos_url":"https://api.github.com/users/MariuszSkamra/repos","events_url":"https://api.github.com/users/MariuszSkamra/events{/privacy}","received_events_url":"https://api.github.com/users/MariuszSkamra/received_events","type":"User","site_admin":false},"labels":[{"id":700751342,"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/labels/area:%20Bluetooth","name":"area: Bluetooth","color":"ededed","default":false},{"id":383053982,"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/labels/enhancement","name":"enhancement","color":"e99695","default":true}],"state":"closed","locked":false,"assignee":{"login":"jhedberg","id":1032570,"avatar_url":"https://avatars0.githubusercontent.com/u/1032570?v=4","gravatar_id":"","url":"https://api.github.com/users/jhedberg","html_url":"https://github.com/jhedberg","followers_url":"https://api.github.com/users/jhedberg/followers","following_url":"https://api.github.com/users/jhedberg/following{/other_user}","gists_url":"https://api.github.com/users/jhedberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jhedberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhedberg/subscriptions","organizations_url":"https://api.github.com/users/jhedberg/orgs","repos_url":"https://api.github.com/users/jhedberg/repos","events_url":"https://api.github.com/users/jhedberg/events{/privacy}","received_events_url":"https://api.github.com/users/jhedberg/received_events","type":"User","site_admin":false},"assignees":[{"login":"jhedberg","id":1032570,"avatar_url":"https://avatars0.githubusercontent.com/u/1032570?v=4","gravatar_id":"","url":"https://api.github.com/users/jhedberg","html_url":"https://github.com/jhedberg","followers_url":"https://api.github.com/users/jhedberg/followers","following_url":"https://api.github.com/users/jhedberg/following{/other_user}","gists_url":"https://api.github.com/users/jhedberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jhedberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhedberg/subscriptions","organizations_url":"https://api.github.com/users/jhedberg/orgs","repos_url":"https://api.github.com/users/jhedberg/repos","events_url":"https://api.github.com/users/jhedberg/events{/privacy}","received_events_url":"https://api.github.com/users/jhedberg/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-03-16T11:39:01Z","updated_at":"2018-03-20T17:48:42Z","closed_at":"2018-03-20T17:48:42Z","author_association":"COLLABORATOR","body":"PTS test L2CAP/LE/CFC/BV-01-C requires user to be informed about Command Reject reason (sent as response to LE Creadit Based Connection Request).\r\n\r\nCurrently, L2CAP connection related callbacks looks as follows:\r\n```\r\nstruct bt_l2cap_chan_ops {\r\n\tvoid (*connected)(struct bt_l2cap_chan *chan);\r\n\tvoid (*disconnected)(struct bt_l2cap_chan *chan);\r\n};\r\n```\r\nwould be nice to have disconnection reason parameter, just like in bt_conn_cb disconnected callback.\r\n```\r\nstruct bt_conn_cb {\r\n\tvoid (*connected)(struct bt_conn *conn, u8_t err);\r\n\tvoid (*disconnected)(struct bt_conn *conn, u8_t reason);\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/comments/374693448","html_url":"https://github.com/zephyrproject-rtos/zephyr/issues/6644#issuecomment-374693448","issue_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6644","id":374693448,"user":{"login":"MariuszSkamra","id":10126877,"avatar_url":"https://avatars3.githubusercontent.com/u/10126877?v=4","gravatar_id":"","url":"https://api.github.com/users/MariuszSkamra","html_url":"https://github.com/MariuszSkamra","followers_url":"https://api.github.com/users/MariuszSkamra/followers","following_url":"https://api.github.com/users/MariuszSkamra/following{/other_user}","gists_url":"https://api.github.com/users/MariuszSkamra/gists{/gist_id}","starred_url":"https://api.github.com/users/MariuszSkamra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariuszSkamra/subscriptions","organizations_url":"https://api.github.com/users/MariuszSkamra/orgs","repos_url":"https://api.github.com/users/MariuszSkamra/repos","events_url":"https://api.github.com/users/MariuszSkamra/events{/privacy}","received_events_url":"https://api.github.com/users/MariuszSkamra/received_events","type":"User","site_admin":false},"created_at":"2018-03-20T17:48:42Z","updated_at":"2018-03-20T17:48:42Z","author_association":"COLLABORATOR","body":"I'm looking at this now, I see it is not so trivial. L2CAP disconnected callback is common for i.a. Command Reject and LE Credit Based Connection Response. Those have conflicting error codes:\r\n```\r\n0x0000 Command not understood\r\n0x0001 Signaling MTU exceeded\r\n0x0002 Invalid CID in request\r\n```\r\nvs\r\n```\r\n0x0000 Connection successful\r\n0x0001 Reserved for Future Use\r\n0x0002 Connection refused – LE_PSM not supported\r\n```\r\nWhat comes to my mind is to use ECONNREFUSED from errno.h. But it is not what I wanted to achieve here, there will be not L2CAP error code still. \r\nSo probably I will use bluetooth testing API for this purpose."}}
{"actor":{"display_login":"MariuszSkamra"}}