Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mtuSize variable for BluetoothPeripheral #140

Merged
merged 6 commits into from
Sep 10, 2024

Conversation

carillem
Copy link
Contributor

@carillem carillem commented Sep 6, 2024

After the changeMTU call, mtuSize is returned as a string but not stored in BluetoothPeripheral. This change allows the user to access the negotiated mtuSize in the BluetoothPeripheral class.

EDIT: After a lot of internet sleuthing, the function name for the CoreBluetooth CBPeripheral library turned out to be maximumWriteValueLengthForType: https://forums.developer.apple.com/forums/thread/73871. Also updated for int conversion.

@Reedyuk
Copy link
Owner

Reedyuk commented Sep 6, 2024

looks good but you will need to put in the actuals for other platforms too

jsMain and api main. - Given the nature of this change, just put the actuals in, you dont need to implement the method/updates.

@Reedyuk
Copy link
Owner

Reedyuk commented Sep 8, 2024

Seems to be failing on the CI.

e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:43 Unresolved reference 'maximumWriteValueLength'.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:67 Only expressions are allowed here.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:70 Syntax error: Expecting '(' to open a loop range.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:72 Syntax error: Expecting an expression.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:73 Unresolved reference 'withResponse'.

@carillem
Copy link
Contributor Author

carillem commented Sep 9, 2024

Seems to be failing on the CI.

e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:43 Unresolved reference 'maximumWriteValueLength'.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:67 Only expressions are allowed here.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:70 Syntax error: Expecting '(' to open a loop range.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:72 Syntax error: Expecting an expression.
e: file:///Users/runner/work/blue-falcon/blue-falcon/library/src/appleMain/kotlin/dev/bluefalcon/BlueFalcon.kt:183:73 Unresolved reference 'withResponse'.

Just updated the PR with the change. The maximumWriteValueLength belongs to CBPeripheral based on their documentation: https://developer.apple.com/documentation/corebluetooth/cbperipheral/maximumwritevaluelength(for:). Hopefully this resolves it.

@Reedyuk Reedyuk merged commit 2e40d0e into Reedyuk:master Sep 10, 2024
2 checks passed
@carillem carillem deleted the feature/mtuSize-variable branch September 10, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants