Files
AnyPS5/docs/dev/debt/libSceBluetoothHid.md
T
Lindamea1andClaude Opus 5.5 b2b07ce33d feat(libSceBluetoothHid): implement sceBluetoothHidThreadParamInitialize
sceBluetoothHidThreadParamInitialize threw NotImplemented. It now fills
the thread parameter block that sceBluetoothHidRegisterCallback reads:
the 32-bit priority at offset 0, the 64-bit affinity mask at offset 8
and 0 in the 32 bits at offset 16, leaving bytes 4 to 7 and 20 to 23
as they were, and returns 0. A null block returns 0x81540001.

This follows BunnyFl's native x86-64 run of firmware 13.42's
libSceBluetoothHid, not a console:
https://github.com/boykopovar/AnyPS5/pull/11124#issuecomment-6416053242
The test checks the run's bytes for (700, 0x3f) and the null answer.
The run does not show the success value, range checks, bytes 20 to 23
or calls before sceBluetoothHidInit; the debt entry records them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 23:16:31 +00:00

2.8 KiB

libSceBluetoothHid technical debt

Silent stubs

  • libSceBluetoothHid: the host still has no device backend or event worker. Registration retains only lifecycle state and never delivers the recovered 104-byte callback events. Custom worker scheduling throws; device ioctl failures and resource exhaustion are not modeled.

Unknown function info

  • sceBluetoothHidGetDeviceName and sceBluetoothHidGetDeviceInfo: output pointers are forwarded to device ioctls without accessing the buffers. Their output sizes and layouts remain unresolved. Report APIs use 64-bit device handles; device-info and disconnect APIs use 32-bit device IDs.
  • sceBluetoothHidParamInitialize follows firmware 13.42's module as BunnyFl ran it natively (comment; not a console, and neither the kernel side of /dev/bt nor the event thread's work is covered): it writes its second argument at offset 0 of the 16-byte block, clears the 32-bit word at offset 8, leaves bytes 12 to 15 and returns 0, and a null block returns 0x81540001. SharpProspero types that argument as a 64-bit value; it is the address of a BluetoothHidThreadParam, since sceBluetoothHidRegisterCallback reads the event thread's priority and affinity through it.
  • sceBluetoothHidThreadParamInitialize: the success value, range checks of the priority or affinity mask, bytes 20 to 23 and calls before sceBluetoothHidInit are not covered by the run it follows (BunnyFl's native x86-64 run of firmware 13.42's module, not a console; comment). The run covers (700, 0x3f), stored as the 32-bit priority at offset 0 and the 64-bit mask at 8 with a 32-bit 0 at 16 and bytes 4 to 7 kept, and a null block, refused with 0x81540001. Here any values are stored unchecked, bytes 20 to 23 are kept, sceBluetoothHidInit is not needed, and 0 is returned, as sceBluetoothHidParamInitialize returns in that run and SharpProspero gives for every call on success.
  • sceBluetoothHidDebugGetVersion: returns a constant without reading arguments, so the supplied implementation does not establish whether the public prototype has unused parameters.