go-ble / ble

Bluetooth Low Energy for Linux / macOS
BSD 3-Clause "New" or "Revised" License
305 stars 109 forks source link

ReadLongCharacteristic() uses RxMtu() #111

Open sschulz-t opened 9 months ago

sschulz-t commented 9 months ago

I think ReadLongCharacteristic() should use RxMTU() to decide if the read length hints to a follow up transfer: https://github.com/go-ble/ble/blob/8c5522f543335a80e18fc70e704b104cf3fcc606/linux/gatt/client.go#L234-L239

Testcase: Call client.ExchangeMTU(200) to limit the MTU on our side. Then trigger a long read. You will notice that the date length returned matches this 200.