manolofdez / AsyncBluetooth

A small library that adds concurrency to CoreBluetooth APIs.
MIT License
168 stars 31 forks source link

func writeValue(_ data: Data, for descriptor: Descriptor) async throws - infinite recursion #23

Closed ConfusedVorlon closed 1 year ago

ConfusedVorlon commented 1 year ago

SwiftLint thinks (and so do I) that there is an infinite recursion error in

    /// Writes the value of a characteristic descriptor.
    public func writeValue(_ data: Data, for descriptor: Descriptor) async throws {
        try await self.writeValue(data, for: descriptor)
    }

should it be

try await self.writeValue(data, for: descriptor.cbDescriptor)

??

manolofdez commented 1 year ago

oh, that's not great! yeah, it should be using the cbDescriptor. great catch!

manolofdez commented 1 year ago

fyi I just pushed a fix