kable icon indicating copy to clipboard operation
kable copied to clipboard

Feature request: Add maximumWriteValueLengthForType to iOS Peripheral

Open KotlyDev opened this issue 1 year ago • 1 comments

Hi, it would be great if you could add maximumWriteValueLengthForType to the CoreBluetoothPeripheral interface.

Sample:

    override fun maximumWriteValueLengthForType(writeType: WriteType): Int {
        val type = when (writeType) {
            WithResponse -> CBCharacteristicWriteWithResponse
            WithoutResponse -> CBCharacteristicWriteWithoutResponse
        }
        return cbPeripheral.maximumWriteValueLengthForType(type).toInt()
    }

KotlyDev avatar Aug 01 '24 18:08 KotlyDev

Thanks for the code snippet. This would be a good addition. I'll try to add it soon.

twyatt avatar Aug 01 '24 19:08 twyatt

Hey Travis @twyatt, I have a use-case that requires this functionality. Are there any plans to add this in the near future? Thank you for your support and for a solid KMP library.

matttbates avatar Nov 20 '24 00:11 matttbates

I would like to get to this sooner rather than later, but not sure I'll have much bandwidth in the near term. The biggest challenge (though it may not be that big) is to figure out a unified API across all supported platforms. I may be able to find some time after getting a final 0.35.0 release out.

twyatt avatar Nov 21 '24 22:11 twyatt

PRs are also welcome, and I try to prioritize them above most other work I have on my plate. 😉

twyatt avatar Nov 21 '24 22:11 twyatt

I made a PR implementing this. I haven't been able to test this properly, but as I'm only reading data I believe this should be fairly safe in any case.

ErikHellman avatar Dec 03 '24 12:12 ErikHellman