Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Inconsistency in handling Bluetooth addresses #132099

Closed
Assignees
serhiy-storchaka
Labels
docsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error
@serhiy-storchaka

Description

@serhiy-storchaka

Bug report

  1. The format accepted by BTPROTO_HCI protocol is incorrectly documented.
    • it accepts a bytes objectbdaddr, not a tuple.
    • bdaddr is a bytes object, not a string.
  2. Some protocols acceptbdaddr as a string, others accept it as a bytes object.getsockname() returns it as a string or a bytes object, and this is not always consistent with the accepted type.
  3. getsockname() not always return an address in the acceptable format. It returnsdevice_id when the acceptable format is a tuple(device_id,), can return a string when the acceptable format is a bytes object.

First problem should be solved by updating the documentation.

For second problem, I propose to make both string and bytes be accepted as a Bluetooth address. Also, if a 1-tuple is accepted, then its element should be accepted, and ifbdaddr is accepted, then a 1-tuple(bdaddr,) should be accepted.

The third problem cannot be resolved in backward compatible way. The solution for the second problem formally fixes incompatibility between input and output formats, but formats are still inconsistent between protocols. And after adding support forhci_channel (see#70145), the type of thegetsockname() result will depend on thehci_channel value.

Linked PRs

Metadata

Metadata

Labels

docsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp