mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-21 16:34:23 +01:00
Add split write to nRF Toolbox
This commit is contained in:
@@ -51,6 +51,7 @@ dependencies {
|
||||
implementation(project(":lib_ui"))
|
||||
implementation(project(":lib_utils"))
|
||||
|
||||
implementation("no.nordicsemi.android.kotlin.ble:core:0.0.1")
|
||||
implementation("no.nordicsemi.android.kotlin.ble:client:0.0.1")
|
||||
implementation("no.nordicsemi.android.kotlin.ble:profile:0.0.1")
|
||||
|
||||
|
||||
@@ -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