Skip to content

bledev.hid: mice, long report descriptors, and one keymap shared with usbif #93

Description

@bdbarnett

Left from PR #83:

  • Mice produce no events yet.
  • A board can't read a report descriptor longer than 246 bytes, because MicroPython has no long read. The Xbox controller's is 283.
  • usbif and bledev.hidreport each keep a copy of the same keyboard table; they should become one.

Activity

  1. bdbarnett commented on Sep 25, 2026

    @bdbarnett
    ContributorAuthor

    Two of the three items are in PRs: mice (#97) and one keyboard table (#97 plus PyDevices/usbif#45). The table now lives in pydevices' keys.py, which both decoders already import. Merge #97 first.

    The long Report Map is not addressed. A board can only read one ATT read's worth of the map (246 bytes at MTU 247), because MicroPython's gattc_read() has no long read, and the Xbox controller's map is 283 bytes. Fixing that needs a long read in MicroPython, either upstream or as a patch in micropython-pydevices, so I left it for that decision. This issue should stay open for it once #97 merges.

  2. bdbarnett commented on Sep 26, 2026

    @bdbarnett
    ContributorAuthor

    #97 is merged (2026-09-25), so mice and the shared keyboard table are done. What's left here is the long Report Map. At the 1.29 pin it's unchanged: extmod/nimble/modbluetooth_nimble.c:1465 calls ble_gattc_read, NimBLE's single read, and never ble_gattc_read_long. A map longer than one ATT read (246 bytes at MTU 247) is still cut off, and the Xbox controller's is 283.

    Which way do you want it?
    (a) A patch in micropython-pydevices that lets gattc_read do a long read through ble_gattc_read_long, which we'd carry on every build. I haven't sized it: a long read delivers the value in pieces, so how the read-result event reports them needs deciding.
    (b) An upstream MicroPython issue, drafted for you to post, and we wait for it.
    (c) Both: patch now, and draft the issue.

    I'd pick (c), matching the WebREPL Ctrl-C case.

  3. bdbarnett commented on Sep 26, 2026

    @bdbarnett
    ContributorAuthor

    Decided 2026-09-26: patch only. A micropython-pydevices patch gives gattc_read a long read through ble_gattc_read_long, carried on every build. No upstream issue. Open question for whoever takes it: how the read-result event reports the pieces.

  4. bdbarnett commented on Oct 8, 2026

    @bdbarnett
    ContributorAuthor

    Mice and the shared keyboard table landed in #97. The last part, reading report descriptors longer than one ATT read (246 bytes), is planned work now: https://github.com/PyDevices/pydevices/blob/main/ROADMAP.md#ble (line 20). Closing in favour of the roadmap entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions