diff --git a/Sources/BluetoothLinux/DeviceRequest.swift b/Sources/BluetoothLinux/DeviceRequest.swift index e7d527c..42170c3 100644 --- a/Sources/BluetoothLinux/DeviceRequest.swift +++ b/Sources/BluetoothLinux/DeviceRequest.swift @@ -385,12 +385,12 @@ internal func HCISendRequest (_ deviceDescriptor: CInt, else { fatalError("HCI Command 'RemoteNameRequest' was sent, but the event parameter data does not correspond to 'RemoteNameRequestParameter'") } // must be different, for some reason - guard commandParameter.address != parameter.address else { continue } + guard commandParameter.address == parameter.address else { continue } } // success! try done() - let dataLength = min(eventData.count - 1, eventParameterLength) + let dataLength = min(eventData.count, eventParameterLength) return Data(eventData.suffix(dataLength)) case .lowEnergyMeta: