[issue7687] Bluetooth support untested
Changes by Tim Tisdall : -- nosy: +Tim.Tisdall ___ Python tracker <http://bugs.python.org/issue7687> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7834] socket.connect() no longer works with AF_BLUETOOTH L2CAP sockets
Changes by Tim Tisdall : -- nosy: +Tim.Tisdall ___ Python tracker <http://bugs.python.org/issue7834> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
New submission from Tim Tisdall: Currently https://docs.python.org/3.6/library/socket.html#socket-families only says "Certain other address families (AF_BLUETOOTH, AF_PACKET, AF_CAN) support specific representations." and there's a comment in the docs saying "document them!"... So, I'm documenting the AF_BLUETOOTH. I'm not sure about which versions this should be added to except for 3.6 so I'm listing the pertinent issues when changes were made: issue929192 seems to be where the current address format was added for L2CAP, RFCOMM, and SCO issue1432399 seems to be where HCI was added issue5510 seems to be where the alternate address format for HCI was added for NetBSD and DragonFlyBSD It seems SCO used to accept a regular string but at 23ab586c427a it was changed to use a `bytes`... I'm not sure the issue behind that. This is my first contribution to CPython so I figured a patch to the docs would be easiest. Please let me know if I'm doing anything wrong! -- assignee: docs@python components: Documentation files: bluetooth_socket_docs.patch keywords: patch messages: 249554 nosy: Tim.Tisdall, docs@python priority: normal severity: normal status: open title: document AF_BLUETOOTH socket address formats Added file: http://bugs.python.org/file40320/bluetooth_socket_docs.patch ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: I'm not sure the proper way to update the patch... I can't seem to edit the existing one or replace it. I'm uploading an updated one, but should I simply "unlink" (aka delete) the old one? -- Added file: http://bugs.python.org/file40339/bluetooth_socket_docs_2.patch ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: Martin, the odd thing with the SCO protocol is it's expecting an bluetooth address as a byte string (ex b'12:23:34:45:56:67' [note the `b`]) where the other 3 are expecting a regular string (ex '12:23:34:45:56:67'). I think it may have been a case of someone doing a blanket search-and-replace and missing the consequences there, but I'm really not sure. However, this is somewhat besides the point as right now I'm trying to focus on just documenting the actual behaviour. ;) The issue is, what versions have the changes from 23ab586c427a in it, and what versions come before that where it's probably expecting a regular string. Unfortunately I can't access the web interface for the repo at the moment so I can't even try to figure that out at right now. (Though, I haven't confirmed that the old method was looking at regular strings or not...) -- ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: I'm not really sure how to add a `versionadded` tag to specify that only the BSD-specific support was added in 3.2 (as general support was there prior to that). If I just add the plain tag below that bullet point it would imply that the whole protocol was added in 3.2 . Perhaps I should reword it to just list the original (prior to 3.2) documentation, then add the difference with BSD in a separate paragraph such that I can tag just that part? Or maybe I shouldn't bother? -- ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: I added a note to BTPROTO_SCO that it doesn't work in FreeBSD (I forgot to mention that). -- Added file: http://bugs.python.org/file40341/bluetooth_socket_docs_3.patch ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: changed "This protocol does not work under FreeBSD." to the more accurate "This protocol is not supported under FreeBSD." -- Added file: http://bugs.python.org/file40343/bluetooth_socket_docs_4.patch ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: Martin, looks good. Thanks for pointing out how to properly tag the version change, and thanks for adding me to the ACKS file. -- ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25041] document AF_PACKET socket address format
New submission from Tim Tisdall: As mentioned in #24984, I'm making another issue to document the address format for AF_PACKET. In this case there's already documentation in Modules/socketmodule.c that says: - an AF_PACKET socket address is a tuple containing a string specifying the ethernet interface and an integer specifying the Ethernet protocol number to be received. For example: ("eth0",0x1234). Optional 3rd,4th,5th elements in the tuple specify packet-type and ha-type/addr. But nothing has been added to Doc/library/socket.rst . The documentation needs to be confirmed with the code. (It probably should be altered somewhat to state how you "specify packet-type and ha-type/addr"... and maybe what a "ha-type/addr" is... A quick Google search found this very useful reference: https://books.google.ca/books?id=Chr1NDlUcI8C&pg=PA472&ots=OCEwyjdXJo&sig=PuNG72WIvv4-A924f9MvzPtgQDc&hl=en&sa=X&ved=0CE8Q6AEwCGoVChMI6IiTyoDqxwIVCTs-Ch3bCAXy#v=onepage&q&f=false ) -- assignee: docs@python components: Documentation messages: 250306 nosy: Tim.Tisdall, docs@python priority: normal severity: normal status: open title: document AF_PACKET socket address format type: enhancement versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue25041> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25041] document AF_PACKET socket address format
Tim Tisdall added the comment: Right now the docs say "Certain other address families (:const:`AF_PACKET`, :const:`AF_CAN`) support specific representations.". I was going to create a separate issue for AF_CAN, but it seems that it's already documented... When documentation is added for AF_PACKET, please remove the above mentioned line entirely as AF_CAN is already documented. -- ___ Python tracker <http://bugs.python.org/issue25041> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: I created #25041 to handle AF_PACKET. It seems AF_CAN is already in the docs, so the person making the change for AF_PACKET can just remove that mention of AF_CAN farther down. -- ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25043] document socket constants for Bluetooth
New submission from Tim Tisdall: further to #24984, I noticed there are constants that aren't mentioned in the docs. Also BDADDR_ALL is missing (which is defined in Bluez's bluetooth.h) so I added it. Now, I'm not totally clear on supplying multi-version patches... I know 3.5 is in "freeze" so I'm guessing adding the BDADDR_ALL constant is a no-no. I guess I checkout out the different version branches, make the changes, and then create a patch labelled for which version it's for? (I see the patch has the hash for which commit it's to be applied to, but not which branch) The repo is down right now, so I'll include a patch once I can update my local copy... :( -- assignee: docs@python components: Documentation, Library (Lib) messages: 250314 nosy: Tim.Tisdall, docs@python priority: normal severity: normal status: open title: document socket constants for Bluetooth type: enhancement versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue25043> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25044] bring BTPROTO_SCO inline with other Bluetooth protocols
New submission from Tim Tisdall: All of the BTPROTO_ protocols accept tuples with Bluetooth addresses as regular strings. SCO accepts a byte-string which represents a Bluetooth address. The change was made at 23ab586c427a With the current implementation we get this error: >>> import socket >>> x = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, >>> socket.BTPROTO_SCO) >>> x.bind(socket.BDADDR_ANY) Traceback (most recent call last): File "", line 1, in OSError: getsockaddrarg: wrong format This is because socket.BDADDR_ANY is a string while the bind() is expecting a binary string. So the workaround would be to call x.bind(socket.BDADDR_ANY.encode()) . Is it acceptable to change it to accept a regular string to match the other address methods and constants? This would be essentially a breaking change, however on something that wasn't really documented prior to #24984 . I'll submit a patch when the repo is back up... -- messages: 250316 nosy: Tim.Tisdall priority: normal severity: normal status: open title: bring BTPROTO_SCO inline with other Bluetooth protocols type: enhancement versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue25044> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25044] bring BTPROTO_SCO inline with other Bluetooth protocols
Changes by Tim Tisdall : -- components: +Extension Modules ___ Python tracker <http://bugs.python.org/issue25044> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25043] document socket constants for Bluetooth
Tim Tisdall added the comment: I'm not sure how to unit test a constant... it's just a string. If you're asking for a unit test for when you'd actually make use of the constant, I haven't been able to figure out that situation yet. It seems like in Bluez 4.101 it's used to issue a command to all interfaces (but in contexts I don't quite understand), but in Bluez 5.XX there's no example or documentation of its use (it remains as a constant, though). [looking through the Bluez git, I found where the constant was added in 2004 and the log message is simply "Add BDADDR_ALL constant"; http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=c7b26f3e5d03e1d54dfb945e5ca0c041da524348 ] -- ___ Python tracker <http://bugs.python.org/issue25043> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25043] document socket constants for Bluetooth
Changes by Tim Tisdall : -- keywords: +patch Added file: http://bugs.python.org/file40424/bdaddr_36_1.patch ___ Python tracker <http://bugs.python.org/issue25043> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25043] document socket constants for Bluetooth
Changes by Tim Tisdall : Added file: http://bugs.python.org/file40425/bdaddr_34_1.patch ___ Python tracker <http://bugs.python.org/issue25043> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25043] document socket constants for Bluetooth
Changes by Tim Tisdall : Added file: http://bugs.python.org/file40426/bdaddr_35_1.patch ___ Python tracker <http://bugs.python.org/issue25043> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24984] document AF_BLUETOOTH socket address formats
Tim Tisdall added the comment: oops. yeah, I got my terminology wrong. It accepts only a byte-string. -- ___ Python tracker <http://bugs.python.org/issue24984> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25044] bring BTPROTO_SCO inline with other Bluetooth protocols
Tim Tisdall added the comment: Yes, then any existing implementations will continue to work. One sticky issue with all of this... there's no existing tests as per #7687 . -- ___ Python tracker <http://bugs.python.org/issue25044> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7687] Bluetooth support untested
Changes by Tim Tisdall : -- versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/issue7687> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25056] no support for Bluetooth LE in socket
New submission from Tim Tisdall: When Bluetooth LE support was added to Bluez they expanded sockaddr_l2 (the struct for making L2CAP connections) to include a l2_bdaddr_type. Since the existing code initializes the struct with 0's the type is set to regular Bluetooth (BDADDR_BREDR). An additional optional argument is needed to allow it to also be set to BDADDR_LE_PUBLIC or BDADDR_LE_RANDOM which indicate it's a LE connection to be made. -- components: Library (Lib) messages: 250376 nosy: Tim.Tisdall priority: normal severity: normal status: open title: no support for Bluetooth LE in socket type: enhancement versions: Python 3.6 ___ Python tracker <http://bugs.python.org/issue25056> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25043] document socket constants for Bluetooth
Tim Tisdall added the comment: Okay, since there's currently no existing tests for the Bluetooth components of socket and the only example for BDADDR_ALL seems to be for something I'm not sure you can do in socket, I'm just going to not bother including it. I've attached a 3.6 patch without BDADDR_ALL. -- Added file: http://bugs.python.org/file40438/bdaddr_36_2.patch ___ Python tracker <http://bugs.python.org/issue25043> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25043] document socket constants for Bluetooth
Tim Tisdall added the comment: okay, I talked to one of the Bluez developers and he recommended leaving out BDADDR_ALL since it doesn't seem to correspond to anything in the kernel. -- ___ Python tracker <http://bugs.python.org/issue25043> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com