mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2026-01-09 09:44:22 +01:00
New discoveryServices() method
This commit is contained in:
@@ -130,7 +130,7 @@ internal class BPSViewModel @Inject constructor(
|
||||
.onEach { logAnalytics(it.state) }
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it) }
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
@@ -146,7 +146,7 @@ internal class CGMService : NotificationService() {
|
||||
.onEach { stopIfDisconnected(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
@@ -102,7 +102,7 @@ internal class CSCService : NotificationService() {
|
||||
.onEach { stopIfDisconnected(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
@@ -168,7 +168,7 @@ internal class GLSViewModel @Inject constructor(
|
||||
.onEach { logAnalytics(it) }
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device) }
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
@@ -104,7 +104,7 @@ internal class HRSService : NotificationService() {
|
||||
.onEach { stopIfDisconnected(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
@@ -102,7 +102,7 @@ internal class HTSService : NotificationService() {
|
||||
.onEach { stopIfDisconnected(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
@@ -172,7 +172,7 @@ internal class PRXService : NotificationService() {
|
||||
.onEach { stopIfDisconnected(it.state, it.status) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
@@ -102,7 +102,7 @@ internal class RSCSService : NotificationService() {
|
||||
.onEach { stopIfDisconnected(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
@@ -97,6 +97,10 @@ internal class UARTService : NotificationService() {
|
||||
|
||||
client = device.connect(this@UARTService, logger = logger)
|
||||
|
||||
Log.d("AAATESTAAA","connect finish")
|
||||
|
||||
client.requestMtu(Mtu.max)
|
||||
|
||||
repository.loggerEvent
|
||||
.onEach { logger.launch() }
|
||||
.launchIn(lifecycleScope)
|
||||
@@ -107,7 +111,7 @@ internal class UARTService : NotificationService() {
|
||||
.onEach { stopIfDisconnected(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.services
|
||||
client.discoverServices()
|
||||
.filterNotNull()
|
||||
.onEach { configureGatt(it, device, logger) }
|
||||
.launchIn(lifecycleScope)
|
||||
@@ -136,7 +140,7 @@ internal class UARTService : NotificationService() {
|
||||
.onEach { logger.log(10, "Sent: $it") }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
client.requestMtu(Mtu.max)
|
||||
|
||||
|
||||
repository.onInitComplete(device)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user