You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Connected state now carries the active connection CoroutineScope. Previously, the connection CoroutineScope was
only available from the return of the connect function, but now it is also available from the Connected state, for example:
peripheral.state
.filterIsInstance<State.Connected>()
.onEach { (connectionScope) ->// `connectionScope` is automatically cancelled on disconnect
connectionScope.launch {
// ..
}
}
.launchIn(peripheral.scope)
Standard library Uuid
Kable now uses UUIDs as provided by the Kotlin standard library. Be sure and update your imports
and Uuid usages appropriately, for example:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
🚀 Changes
Peripheral.scope
propertyTo be more explicit,
Peripheral
'sCoroutineScope
has been moved to thescope
property on thePeripheral
:peripheral.launch { // .. }
peripheral.scope.launch { // .. }
peripheral.close() // or.. peripheral.scope.cancel()
Peripheral
AutoCloseable
Peripheral
now implementsAutoCloseable
if you need to use aPeripheral
for a quick/short task:Connection scope on
Connected
stateThe
Connected
state now carries the active connectionCoroutineScope
. Previously, the connectionCoroutineScope
wasonly available from the return of the
connect
function, but now it is also available from theConnected
state, for example:Standard library
Uuid
Kable now uses UUIDs as provided by the Kotlin standard library. Be sure and update your
import
sand
Uuid
usages appropriately, for example:Common
onScanFailed
error codes asIllegalStateException
s (Propagate unknownonScanFailed
error codes asIllegalStateException
s #851), thanks to @mjordan-gpfw for reportingState.Connected
(Expose connection scope onState.Connected
#852)Peripheral
CoroutineScope
viascope
property (ProvidePeripheral
CoroutineScope
viascope
property #846)GattRequestRejectedException
to common (MoveGattRequestRejectedException
to common #838), thanks to @francismariano for reportingInt
onGattStatusException
(Expose Android GATT statusInt
onGattStatusException
#836), thanks to @joharei for reportingobservations
inObservers.onConnected
(Create copy ofobservations
inObservers.onConnected
#841), thanks to @eygraber for reportingGATT_INVALID_ATTRIBUTE_LENGTH
(Fix error string forGATT_INVALID_ATTRIBUTE_LENGTH
#831), thanks to @angusholder for the contributionUuid
from Kotlin standard library (UseUuid
from Kotlin standard library #758), thanks to @ykws for the contributionCBUUID
s (Support 32-bit (8 hex characters)CBUUID
s #834), thanks to @liamzhouacc for reporting🧰 Maintenance
kable-core
artifact (Update "maven central" badge to usekable-core
artifact #823)This discussion was created from the release 0.36.0.
Beta Was this translation helpful? Give feedback.
All reactions