mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2026-01-21 15:44:25 +01:00
Add split write to nRF Toolbox
This commit is contained in:
@@ -97,8 +97,6 @@ internal class UARTService : NotificationService() {
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.requestMtu(517)
|
||||
}
|
||||
|
||||
private suspend fun configureGatt(services: BleGattServices, device: ServerDevice) {
|
||||
@@ -118,7 +116,7 @@ internal class UARTService : NotificationService() {
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
repository.command
|
||||
.onEach { rxCharacteristic.write(it.toByteArray(), getWriteType(rxCharacteristic)) }
|
||||
.onEach { rxCharacteristic.splitWrite(it.toByteArray(), getWriteType(rxCharacteristic)) }
|
||||
.onEach { repository.onNewMessageSent(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ fun UARTScreen() {
|
||||
when (state.uartManagerState.connectionState) {
|
||||
GattConnectionState.STATE_CONNECTING -> PaddingBox { DeviceConnectingView { NavigateUpButton(navigateUp) } }
|
||||
GattConnectionState.STATE_DISCONNECTED,
|
||||
GattConnectionState.STATE_DISCONNECTING -> DeviceDisconnectedView(Reason.UNKNOWN) { NavigateUpButton(navigateUp) }
|
||||
GattConnectionState.STATE_DISCONNECTING -> PaddingBox { DeviceDisconnectedView(Reason.UNKNOWN) { NavigateUpButton(navigateUp) } }
|
||||
GattConnectionState.STATE_CONNECTED -> SuccessScreen()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user