{"action":"opened","issue":{"url":"https://api.github.com/repos/mjg59/python-tikteck/issues/2","repository_url":"https://api.github.com/repos/mjg59/python-tikteck","labels_url":"https://api.github.com/repos/mjg59/python-tikteck/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mjg59/python-tikteck/issues/2/comments","events_url":"https://api.github.com/repos/mjg59/python-tikteck/issues/2/events","html_url":"https://github.com/mjg59/python-tikteck/issues/2","id":166210174,"number":2,"title":"Porting to GO.","user":{"login":"roylee17","id":97372,"avatar_url":"https://avatars.githubusercontent.com/u/97372?v=3","gravatar_id":"","url":"https://api.github.com/users/roylee17","html_url":"https://github.com/roylee17","followers_url":"https://api.github.com/users/roylee17/followers","following_url":"https://api.github.com/users/roylee17/following{/other_user}","gists_url":"https://api.github.com/users/roylee17/gists{/gist_id}","starred_url":"https://api.github.com/users/roylee17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roylee17/subscriptions","organizations_url":"https://api.github.com/users/roylee17/orgs","repos_url":"https://api.github.com/users/roylee17/repos","events_url":"https://api.github.com/users/roylee17/events{/privacy}","received_events_url":"https://api.github.com/users/roylee17/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-18T22:40:44Z","updated_at":"2016-07-18T22:40:44Z","closed_at":null,"body":"Hi,\r\n\r\nI've been working on a BLE library in GO language, and is trying to port the python-tikteck to it.\r\nWrote up equivelent / similar code, but haven't got it work yet. Also having problem to get the BluetoothSocket.py work, otherwise, it'd be helpful to debug by comparision the hcidump or in program logs.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./bb.py\", line 10, in <module>\r\n    bulb.connect()\r\n  File \"/mnt/roylee17/git_repo/python-tikteck/tikteck/__init__.py\", line 104, in connect\r\n    self.sock.connect_l2(0, dest, cid=4, addr_type=BDAddr.TYPE_LE_PUBLIC)\r\n  File \"/mnt/roylee17/git_repo/python-tikteck/tikteck/BluetoothSocket.py\", line 101, in connect_l2\r\n    self._connect(sa_str)\r\n  File \"/mnt/roylee17/git_repo/python-tikteck/tikteck/BluetoothSocket.py\", line 96, in _connect\r\n    raise IOError(get_errno(), os.strerror(get_errno()))\r\nIOError: [Errno 111] Connection refused\r\n```\r\n\r\nI'm wondering if you'd take a look and see if any obvious point missing?\r\n\r\nhttps://github.com/currantlabs/ble/tree/master/examples/devices/tikteck\r\n\r\n```\r\n2016/07/18 15:30:57 found pair char 000102030405060708090A0B0C0D1914, h: 0x1A, vh: 0x1B\r\n2016/07/18 15:30:57 pairing req: E0 D0 84 06 56 85 14 8B A7 3E 29 01 A2 8E 84 97\r\n2016/07/18 15:30:57 pairing pkt: 0C 00 01 02 03 04 05 06 07 E0 D0 84 06 56 85 14 8B\r\n2016/07/18 15:30:57 pairing rsp: 0D E0 C7 A4 8C C1 6A D3 00 44 AE 2A 30 F7 65 A8 95\r\n2016/07/18 15:30:57 sk: B7 C3 0D 25 BC 6C 8D 4A 17 2E D5 85 EC DC 1D BB\r\n2016/07/18 15:30:57 packet: [ DC 07 00 00 00 FF FF C1 69 69 FF 00 00 80 00 00 00 00 00 00 ]\r\n2016/07/18 15:30:57 enc_packet: [ DC 07 00 EB A3 F9 1B BB 50 D6 D9 20 5C 4C 6E 27 CA DE 94 A1 ]\r\n2016/07/18 15:30:57 found command char 000102030405060708090A0B0C0D1912, h: 0x14, vh: 0x15\r\n```\r\n\r\nWrite request to pair char\r\n```\r\n< ACL data: handle 64 flags 0x00 dlen 24\r\n    ATT: Write req (0x12)\r\n      handle 0x001b value  0x0c 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0xe0 0xd0 0x84 0x06 0x56 0x85 0x14 0x8b\r\n> ACL data: handle 64 flags 0x02 dlen 5\r\n    ATT: Write resp (0x13)\r\n< ACL data: handle 64 flags 0x00 dlen 7\r\n```\r\n\r\nRead  response from pair char\r\n```\r\n    ATT: Read req (0x0a)\r\n      handle 0x001b\r\n> HCI Event: Number of Completed Packets (0x13) plen 5\r\n    handle 64 packets 2\r\n> ACL data: handle 64 flags 0x02 dlen 22\r\n    ATT: Read resp (0x0b)\r\n      0000: 0d e0 c7 a4 8c c1 6a d3  00 44 ae 2a 30 f7 65 a8  ......j..D.*0.e.\r\n      0010: 95                                                .\r\n```\r\n\r\nWrite to command char\r\n```\r\n< ACL data: handle 64 flags 0x00 dlen 27\r\n    ATT: Write req (0x12)\r\n      handle 0x0015 value  0xdc 0x07 0x00 0xeb 0xa3 0xf9 0x1b 0xbb 0x50 0xd6 0xd9 0x20 0x5c 0x4c 0x6e 0x27 0xca 0xde 0x94 0xa1\r\n> ACL data: handle 64 flags 0x02 dlen 5\r\n    ATT: Write resp (0x13)\r\n```\r\n\r\n```\r\n< HCI Command: Disconnect (0x01|0x0006) plen 3\r\n    handle 64 reason 0x13\r\n    Reason: Remote User Terminated Connection\r\n> HCI Event: Command Status (0x0f) plen 4\r\n    Disconnect (0x01|0x0006) status 0x00 ncmd 1\r\n```"}}
{"actor":{"display_login":"roylee17"}}