Skip to content

Unable to read MTU: Peripheral does not expose CBPeripheral.maximumWriteValueLength #4

@Borealin

Description

@Borealin

When using CoreBluetooth directly, you can obtain the current MTU (i.e. maximum writable data length) via:

let mtu = peripheral.maximumWriteValueLength(for: .withoutResponse)

However, in this library the Peripheral type fully encapsulates the underlying CBPeripheral and does not expose any API for reading its maximumWriteValueLength. Since Swift 6, it’s also no longer safe or supported to use unsafe casts to retrieve the hidden CBPeripheral instance.
Is there a recommended workaround for reading the MTU from the wrapped Peripheral? Are there plans to add native MTU support (i.e. maximumWriteValueLength) to the library’s public API? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions