Skip to content

Provide default implementation of centralManager(_:didFailToConnect:error:) in BaseGattProxyBearer #655

@marczeugs

Description

@marczeugs

Target

Library

Describe the feature

In BaseGattProxyBearer there is no implementation of centralManager(_:didFailToConnect:error:). This means that when a connection to the device fails (as it did in my case with a "MIC failure") and when using the GattBearer class, my logic got stuck as neither bearerDidOpen(_ bearer: Bearer) nor bearer(_ bearer: Bearer, didClose error: Error?) were ever called. Only by eventually manually implementing the didFailToConnect method in a class extending GattBearer and after a lot of trial and error did I see why the connection got stuck.

I am not sure if such an error should call the didClose callback, but I think it would be reasonable if BaseGattProxyBearer provided a default implementation that logs the error. If not, then GattBearer should at least mention that it is expected that code using the library handles certain callbacks itself.

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