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

Migration to new BLEK library #143

Open
wants to merge 320 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
f6cb834
Floating button to scan
himalia416 Sep 4, 2024
b71fe51
Changes according to new architecture
himalia416 Sep 4, 2024
2cd0c22
Changes according to new architecture
himalia416 Sep 4, 2024
910dbd9
Changes according to new architecture
himalia416 Sep 4, 2024
f78651b
Revert deletion of files
himalia416 Sep 9, 2024
553767d
Removed Singleton from service binding.
himalia416 Sep 11, 2024
0325f17
backup
himalia416 Sep 12, 2024
59a916d
Fixed static memory leak.
himalia416 Sep 12, 2024
32733dc
Rename
himalia416 Sep 13, 2024
d737db0
Get service data
himalia416 Sep 16, 2024
52f3b04
Removed file
himalia416 Sep 16, 2024
9413487
Ask permissions before start binding services.
himalia416 Sep 16, 2024
09efdd5
Click event, not fixed, just commiting
himalia416 Sep 16, 2024
7040110
Fixed onClick event
himalia416 Sep 17, 2024
180b9c3
Optimization
himalia416 Sep 17, 2024
af25c56
refactoring
himalia416 Sep 17, 2024
7e6a730
Excluding Scanner destination on back navigation.
himalia416 Sep 17, 2024
386ec5e
On back navigation
himalia416 Sep 17, 2024
9727998
Show connected devices on home view.
himalia416 Sep 17, 2024
d5f597c
Location is required only to scan.
himalia416 Sep 17, 2024
bb61ad2
Device disconnection action
himalia416 Sep 18, 2024
09cf8a7
Made Viewmodel scope instead of Singleton
himalia416 Sep 18, 2024
8d4d7b0
Removed duplicate params
himalia416 Sep 18, 2024
3edcb12
device disconnection
himalia416 Sep 18, 2024
54cc70a
Changed service connection style
himalia416 Sep 18, 2024
ea19aac
Fixed service connection and added comments.
himalia416 Sep 19, 2024
d88e9a7
Home view click event
himalia416 Sep 20, 2024
b1ab2e2
Implemented missing services state
himalia416 Sep 23, 2024
928d484
Extracted battery level flow from profile handlers
himalia416 Sep 23, 2024
e8b7945
Don't connect if the device was already connected
himalia416 Sep 23, 2024
1329b77
Code optimization
himalia416 Sep 23, 2024
6556d5b
Get device from viewmodel
himalia416 Sep 24, 2024
14b5654
Fixed auto-reconnect after device disconnect.
himalia416 Sep 24, 2024
2cf2743
Added comments
himalia416 Sep 24, 2024
5528cd2
Code optimization
himalia416 Sep 24, 2024
b861b67
Update the battery level if the peripheral is the same.
himalia416 Sep 24, 2024
8a7096e
Fixed missing services.
himalia416 Sep 24, 2024
8cab10b
Fixed battery level showing for all devices
himalia416 Sep 25, 2024
e10d9bb
Filter out peripherals with null or empty names.
himalia416 Sep 25, 2024
49b8c2c
Implemented HomeView on click event.
himalia416 Sep 25, 2024
7034293
Fixed padding
himalia416 Sep 25, 2024
cd396b6
Added connection option param.
himalia416 Sep 25, 2024
931950d
Fixed service resume after app restart.
himalia416 Sep 25, 2024
e868cb5
File moved to another module
himalia416 Sep 25, 2024
31feda7
Restructuring
himalia416 Sep 26, 2024
239dc5e
Removed unused codes.
himalia416 Sep 26, 2024
561a113
Fixed top app bar not displaying on Bluetooth permission request at a…
himalia416 Sep 27, 2024
99b18a0
Fix notification handling on service start/stop
himalia416 Sep 27, 2024
11affc7
Stop and unbind services on disconnection
himalia416 Sep 27, 2024
321bd21
refactoring
himalia416 Sep 27, 2024
4c351b1
Added logger event.
himalia416 Sep 30, 2024
ad6ec5e
Refactoring
himalia416 Oct 1, 2024
419c895
Added Heart Rate service
himalia416 Oct 2, 2024
fa43d4d
Restructured HTS files.
himalia416 Oct 2, 2024
f879196
Restructured HTS files.
himalia416 Oct 2, 2024
dcca4f8
Added body sensor data
himalia416 Oct 2, 2024
ebd0c85
File rename
himalia416 Oct 3, 2024
2adae29
Fixed padding
himalia416 Oct 3, 2024
7154c1b
Utilized generic types than Any.
himalia416 Oct 3, 2024
5e6e0d6
Added service data as a map.
himalia416 Oct 3, 2024
f02c6ed
Added battery in profile service.
himalia416 Oct 4, 2024
28c73c8
Fixed bodySensor location data.
himalia416 Oct 7, 2024
9c42077
Optimized data flow update.
himalia416 Oct 7, 2024
7abb73a
Added battery service view at the end.
himalia416 Oct 7, 2024
21c8eb8
Removed ConnectionState from Profile appbar.
himalia416 Oct 7, 2024
924e413
Updated to KotlinUuid.
himalia416 Oct 7, 2024
1147b98
Made it internal.
himalia416 Oct 8, 2024
3d5fd5c
Incorporated new connected state from BLEK.
himalia416 Oct 8, 2024
c16661d
Added BPS profile.
himalia416 Oct 9, 2024
f562852
Changed type.
himalia416 Oct 9, 2024
3e0b23f
Separated profile service data to a new file.
himalia416 Oct 14, 2024
b3daf2e
Show BPS profile in Home view.
himalia416 Oct 14, 2024
bbd4522
Removed unused variable.
himalia416 Oct 14, 2024
e26afb9
Fixed padding
himalia416 Oct 14, 2024
480f917
Removed duplicate view.
himalia416 Oct 15, 2024
5bf5885
Fixed issue with duplicate data on reconnection.
himalia416 Oct 15, 2024
b889ae4
Changed mapping type.
himalia416 Oct 15, 2024
0897807
Fixed duplicate launch.
himalia416 Oct 15, 2024
86259f7
Code optimization.
himalia416 Oct 16, 2024
4a2e265
Updated viewmodel
himalia416 Oct 16, 2024
c82d4a2
minor changes
himalia416 Oct 17, 2024
10cbcf3
Cancel jobs before reconnecting.
himalia416 Oct 18, 2024
0884daa
Show disconnection reason on Disconnected or Closed connection state.
himalia416 Oct 18, 2024
d9fa1f5
Proximity monitory data.
himalia416 Oct 18, 2024
d09dd11
Moved to each file
himalia416 Oct 18, 2024
cc100ae
Copy function replaced with update.
himalia416 Oct 21, 2024
3d33adb
Fixed hrs data collection.
himalia416 Oct 21, 2024
f39e068
Added glucose monitoring data.
himalia416 Oct 21, 2024
de87d47
Added glucose monitoring profile.
himalia416 Oct 21, 2024
c47c060
File rename
himalia416 Oct 21, 2024
1008f49
Get disconnection reason from the service.
himalia416 Oct 22, 2024
ac89e1c
Observe bluetooth adapter states.
himalia416 Oct 22, 2024
cbf98de
Removed unused state.
himalia416 Oct 22, 2024
428dbd9
Removed unused code and made internal.
himalia416 Oct 22, 2024
3e1e422
Removed duplicate peripheral connectionState call.
himalia416 Oct 23, 2024
4a6f85f
Added service discovery view
himalia416 Oct 23, 2024
795882c
Handle missing services when only battery service is available.
himalia416 Oct 23, 2024
db6587a
Updated comment.
himalia416 Oct 23, 2024
0b14983
minor changes
himalia416 Oct 24, 2024
65b8d56
Optimization
himalia416 Oct 24, 2024
4705200
Disconnection message when the reason is not available.
himalia416 Oct 24, 2024
59dbf37
Persisted data in repository to retain across ViewModel lifecycle.
himalia416 Oct 28, 2024
3d2cb56
Clear job on disconnection.
himalia416 Oct 28, 2024
7de7b91
Handled multiple service discovery on resume.
himalia416 Oct 29, 2024
7932498
Clear repository once data collection is completed.
himalia416 Oct 29, 2024
28f09ee
Repository to handle data independently for multiple devices.
himalia416 Oct 29, 2024
4c0a447
Repository for HTS profile.
himalia416 Oct 29, 2024
1284f38
Repository for Battery service.
himalia416 Oct 29, 2024
cc03aa5
Repository for BPS service.
himalia416 Oct 30, 2024
66f55c1
Removed log
himalia416 Oct 30, 2024
1ee760b
Repository for PRX service
himalia416 Oct 30, 2024
bac469d
Removed unused code.
himalia416 Oct 30, 2024
e0a5b17
Data separated into a new module.
himalia416 Oct 30, 2024
7cd1491
File rename.
himalia416 Oct 30, 2024
bf2b89e
File reorganization.
himalia416 Oct 31, 2024
0a65e1b
Added GLS profile.
himalia416 Nov 1, 2024
20965c6
bug fixes
himalia416 Nov 4, 2024
9d2f090
bug fixes on gls service
himalia416 Nov 5, 2024
466e923
Removed unnecessary bonding call.
himalia416 Nov 5, 2024
78de955
Fixed bugs on ui screen.
himalia416 Nov 5, 2024
33b296f
Show device name/address on app bar.
himalia416 Nov 5, 2024
448cdab
Run characteristic interactions in separate coroutines.
himalia416 Nov 5, 2024
8491556
Added preview.
himalia416 Nov 6, 2024
d834a7e
Changed appbar container color.
himalia416 Nov 6, 2024
b5eaa06
Reorganization
himalia416 Nov 6, 2024
05598dc
Changed to update
himalia416 Nov 6, 2024
e2072d8
Removed empty lines
himalia416 Nov 6, 2024
6f169a2
Added compatibility workaround for removeIf (API 24+).
himalia416 Nov 6, 2024
fa5ff3d
Fixed padding.
himalia416 Nov 6, 2024
53e147b
Added new module.
himalia416 Nov 7, 2024
97c5ec6
Code optimization.
himalia416 Nov 7, 2024
804b170
file rename
himalia416 Nov 7, 2024
defb589
Added onclick event on scanner page.
himalia416 Nov 7, 2024
12384c4
file reorganization
himalia416 Nov 7, 2024
314b9f0
minor bug fixes.
himalia416 Nov 11, 2024
b0a1785
File reorganization
himalia416 Nov 11, 2024
5b3a34e
Added CGM profile.
himalia416 Nov 11, 2024
05ee310
Supplied profile
himalia416 Nov 11, 2024
0da7c62
file rename
himalia416 Nov 11, 2024
bc19201
Made private.
himalia416 Nov 11, 2024
c22b89c
Managed the scenario where the READ property is not available.
himalia416 Nov 12, 2024
ccfe6b1
Naming consistency
himalia416 Nov 12, 2024
7b81b46
Removed multiple calls to api.
himalia416 Nov 12, 2024
c926198
Refactoring
himalia416 Nov 12, 2024
9d49b58
Refactoring
himalia416 Nov 12, 2024
1fca4be
File rename
himalia416 Nov 13, 2024
3a055a0
Added RSCS profile.
himalia416 Nov 13, 2024
cd95ab8
Separated click event by profiles.
himalia416 Nov 13, 2024
40a21bc
Added CSC profile
himalia416 Nov 14, 2024
fed3b37
Added data and parser for direction finder profile.
himalia416 Nov 19, 2024
9865fda
Added repository and services for direction finder.
himalia416 Nov 25, 2024
26cbbea
Added DFS Service data.
himalia416 Nov 26, 2024
46fdf58
Added direction finder profile events.
himalia416 Nov 26, 2024
ba8c2d1
Added distance control view.
himalia416 Nov 26, 2024
2adb1b0
Added azimuth view.
himalia416 Nov 26, 2024
1c112c5
Separated azimuthal view components.
himalia416 Nov 27, 2024
0255a98
Added elevation view.
himalia416 Nov 27, 2024
8a8f64f
Added linear, and chart view.
himalia416 Nov 28, 2024
2aed347
Added bluetooth, distance view.
himalia416 Nov 29, 2024
a6fdd3e
Updated range selection status.
himalia416 Dec 2, 2024
2095032
Added sensor data ext file.
himalia416 Dec 2, 2024
1c12a78
Fixed issues on DF screen and other views.
himalia416 Dec 3, 2024
8b607b1
Fixed more issues and implemented on click events.
himalia416 Dec 4, 2024
f2a4891
Fixed ui issue.
himalia416 Dec 4, 2024
eba338f
bug fix
himalia416 Dec 4, 2024
b7386bb
Read battery characteristics.
himalia416 Dec 6, 2024
3958efa
Show battery service even if its the only supported service
himalia416 Dec 6, 2024
249b9bb
Ui fixes.
himalia416 Dec 6, 2024
dac67eb
Ui changes
himalia416 Dec 6, 2024
5df0547
Ui changes battery service
himalia416 Dec 10, 2024
f4327e3
Refactoring files.
himalia416 Dec 11, 2024
f1d1f7e
Added rscs settings unit dropdown.
himalia416 Dec 12, 2024
d5fa6cc
update previous data if it exists
himalia416 Dec 12, 2024
04c0a2c
Added in same scope
himalia416 Dec 12, 2024
c2ae58f
Minor changes
himalia416 Dec 12, 2024
2994a37
Updated csc view.
himalia416 Dec 12, 2024
98a3193
Fixed premature emit of missing services.
himalia416 Dec 16, 2024
ba567ad
Fixed minor bugs.
himalia416 Dec 16, 2024
d92074f
Updated hts screen.
himalia416 Dec 16, 2024
253eaa0
Utilized string resources.
himalia416 Dec 16, 2024
7a42e6a
Removed unused code.
himalia416 Dec 16, 2024
99cf1cc
Enabled hand gesture in heart rate chart.
himalia416 Dec 17, 2024
e6b7f1d
Ui update.
himalia416 Dec 17, 2024
d8d20f3
Ui changes.
himalia416 Dec 17, 2024
e67d2fd
Removed duplicate string.
himalia416 Dec 17, 2024
5ca7814
Show disconnect option only if connected.
himalia416 Dec 17, 2024
1bb6e5f
Fixed appbar issues.
himalia416 Dec 18, 2024
38ebf71
Fixed disconnected view.
himalia416 Dec 18, 2024
c18851c
WIP: updates to gls screen.
himalia416 Jan 3, 2025
de9231b
Fixed glucose view
himalia416 Jan 6, 2025
d2a0db7
Removed gls detail destination.
himalia416 Jan 6, 2025
1f763f1
Removed unused codes
himalia416 Jan 6, 2025
517db49
TMP: Changed icon.
himalia416 Jan 6, 2025
7076829
Minor ui fixes
himalia416 Jan 8, 2025
8f5246e
Home view changes
himalia416 Jan 8, 2025
8ded3f7
Show entry color only if records are available.
himalia416 Jan 8, 2025
165d03d
Ui changes
himalia416 Jan 8, 2025
1dadf62
Updated cgm view
himalia416 Jan 8, 2025
f94eb66
Fixed cgm ui
himalia416 Jan 9, 2025
5cf4254
Updated views.
himalia416 Jan 9, 2025
69d019a
Date time parser with new blek
himalia416 Jan 10, 2025
5ef96fb
HTS parser with new blek
himalia416 Jan 10, 2025
a4a5f7a
Fix test cases bytearray.
himalia416 Jan 10, 2025
3d19e3a
Declared local Kotlin-Utils-Library
himalia416 Jan 10, 2025
0f67cb7
Updated HRS parser to New library
himalia416 Jan 10, 2025
f36f0ec
HRS parsing test cases.
himalia416 Jan 13, 2025
9156d16
Battery level parsing and it test cases.
himalia416 Jan 13, 2025
86c67a9
Bpm data parser with new ble library.
himalia416 Jan 13, 2025
1a64214
File rename
himalia416 Jan 13, 2025
f27aae0
Changed view.
himalia416 Jan 13, 2025
cf8d830
BPS parser test cases.
himalia416 Jan 14, 2025
bba24fc
Intermediate CuffPressure Parser and its test cases.
himalia416 Jan 14, 2025
1316abb
Added RSCS data parser using new BLE library.
himalia416 Jan 15, 2025
5455221
Added test cases to RSCS data parser.
himalia416 Jan 15, 2025
c320a3c
Updated RSCS view.
himalia416 Jan 15, 2025
01f24ee
gradle upgrade
himalia416 Jan 16, 2025
fe54c9c
Added GLS parser to new library.
himalia416 Jan 17, 2025
3ad987d
Changed to val.
himalia416 Jan 20, 2025
0fedc51
Added parser to CSCData for new library.
himalia416 Jan 20, 2025
a8d4ec4
Updated colors.
himalia416 Jan 20, 2025
c5d6afe
Fixed Gls test cases.
himalia416 Jan 20, 2025
e303c4f
Fixed CSC parser.
himalia416 Jan 20, 2025
0503164
Fixed CSC parser.
himalia416 Jan 20, 2025
9cc13e7
Made previous data null.
himalia416 Jan 21, 2025
3351a60
Test cases for CSC data parser.
himalia416 Jan 21, 2025
feb9b39
Added GLS and CGMS parsers.
himalia416 Jan 21, 2025
19bc6d0
Added CGMS feature parsers.
himalia416 Jan 21, 2025
0270775
Added direction finder parsers.
himalia416 Jan 22, 2025
e61211a
Removed unused dependency.
himalia416 Jan 22, 2025
1eba5e4
Cancel job on completion.
himalia416 Jan 23, 2025
7a9f598
Added throughput data parser.
himalia416 Jan 24, 2025
0cda06a
Added throughput data class.
himalia416 Jan 24, 2025
3627e4d
Added throughput repository class.
himalia416 Jan 24, 2025
302719e
Added throughput service uuid.
himalia416 Jan 24, 2025
860ac6e
Added throughput service data.
himalia416 Jan 24, 2025
3e42517
Added throughput service manager.
himalia416 Jan 24, 2025
4e3e893
Throughput service discovery.
himalia416 Jan 24, 2025
cf0e021
Added throughput profile.
himalia416 Jan 24, 2025
2dded4c
Throughput screen.
himalia416 Jan 24, 2025
62151f0
Send data to ui
himalia416 Jan 24, 2025
57366c4
Request mtu of highest possible value.
himalia416 Jan 24, 2025
f26871d
Handle ui events.
himalia416 Jan 24, 2025
0bab0c6
Throughput profile to home view.
himalia416 Jan 24, 2025
d7a9526
Fixed HTS dropdown view.
himalia416 Jan 27, 2025
ba2d48c
Removed todo comments.
himalia416 Jan 27, 2025
023d070
Renamed module.
himalia416 Jan 27, 2025
b19bc48
Removed unused dependency.
himalia416 Jan 27, 2025
e59a168
Renamed scanner module.
himalia416 Jan 27, 2025
ada1531
Removed unnecessary data.
himalia416 Jan 27, 2025
c2d3939
Separated parser into new module.
himalia416 Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 20 additions & 26 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
plugins {
alias(libs.plugins.nordic.application.compose)
alias(libs.plugins.nordic.hilt)
alias(libs.plugins.kotlin.parcelize)
}

if (getGradle().getStartParameter().getTaskRequests().toString().contains("Release")) {
Expand All @@ -43,40 +44,33 @@ android {
}

dependencies {
//Hilt requires to implement every module in the main app module
//https://github.com/google/dagger/issues/2123
implementation(project(":profile_bps"))
implementation(project(":profile_csc"))
implementation(project(":profile_cgms"))
implementation(project(":profile_gls"))
implementation(project(":profile_hrs"))
implementation(project(":profile_hts"))
implementation(project(":profile_prx"))
implementation(project(":profile_rscs"))

implementation(project(":profile_uart"))

implementation(project(":lib_analytics"))
implementation(project(":lib_ui"))
implementation(project(":lib_utils"))
implementation(project(":lib_profile"))
implementation(project(":lib_service"))
implementation(project(":lib_scanner"))
implementation(project(":scanner"))
implementation(project(":profile"))
implementation(project(":lib_core"))
implementation(project(":lib_ui"))

implementation(libs.nordic.core)
implementation(libs.nordic.theme)
implementation(libs.nordic.navigation)
implementation(libs.nordic.blek.uiscanner)
implementation(libs.nordic.uilogger)
implementation(libs.nordic.permissions.ble)
implementation(libs.nordic.theme)
implementation(libs.nordic.logger)
implementation(libs.nordic.analytics)

implementation(libs.nordic.blek.client)
implementation(libs.nordic.ui)
implementation(libs.nordic.core)
implementation(libs.nordic.permissions.ble)
implementation(libs.nordic.permissions.notification)

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.compose.runtime)

implementation(libs.androidx.hilt.navigation.compose)

// Timber & SLF4J
implementation (libs.slf4j.timber)

implementation("no.nordicsemi.kotlin.ble:client-android")
implementation("no.nordicsemi.kotlin:data")
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import no.nordicsemi.android.analytics.AppAnalytics
import no.nordicsemi.android.analytics.AppOpenEvent
import no.nordicsemi.android.gls.GLSServer
import no.nordicsemi.android.uart.UartServer
import timber.log.Timber
import javax.inject.Inject

@HiltAndroidApp
Expand All @@ -45,18 +44,11 @@ class NrfToolboxApplication : Application() {
@Inject
lateinit var analytics: AppAnalytics

@Inject
lateinit var uartServer: UartServer

@Inject
lateinit var glsServer: GLSServer

override fun onCreate() {
super.onCreate()

analytics.logEvent(AppOpenEvent)

uartServer.start(this)
glsServer.start(this)
Timber.plant(Timber.DebugTree())
}
}
7 changes: 7 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />

<queries>
<package android:name="no.nordicsemi.android.dfu" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,45 +31,10 @@

package no.nordicsemi.android.nrftoolbox

import no.nordicsemi.android.bps.view.BPSScreen
import no.nordicsemi.android.cgms.view.CGMScreen
import no.nordicsemi.android.common.navigation.createSimpleDestination
import no.nordicsemi.android.common.navigation.defineDestination
import no.nordicsemi.android.csc.view.CSCScreen
import no.nordicsemi.android.gls.main.view.GLSScreen
import no.nordicsemi.android.hrs.view.HRSScreen
import no.nordicsemi.android.hts.view.HTSScreen
import no.nordicsemi.android.nrftoolbox.view.HomeScreen
import no.nordicsemi.android.prx.view.PRXScreen
import no.nordicsemi.android.rscs.view.RSCSScreen
import no.nordicsemi.android.toolbox.scanner.ScannerDestination
import no.nordicsemi.android.uart.view.UARTScreen
import no.nordicsemi.android.nrftoolbox.view.HomeView

val HomeDestinationId = createSimpleDestination("home-destination")

val HomeDestinations = listOf(
defineDestination(HomeDestinationId) { HomeScreen() },
ScannerDestination
)

val CSCDestinationId = createSimpleDestination("csc-destination")
val HRSDestinationId = createSimpleDestination("hrs-destination")
val HTSDestinationId = createSimpleDestination("hts-destination")
val GLSDestinationId = createSimpleDestination("gls-destination")
val BPSDestinationId = createSimpleDestination("bps-destination")
val PRXDestinationId = createSimpleDestination("prx-destination")
val RSCSDestinationId = createSimpleDestination("rscs-destination")
val CGMSDestinationId = createSimpleDestination("cgms-destination")
val UARTDestinationId = createSimpleDestination("uart-destination")

val ProfileDestinations = listOf(
defineDestination(CSCDestinationId) { CSCScreen() },
defineDestination(HRSDestinationId) { HRSScreen() },
defineDestination(HTSDestinationId) { HTSScreen() },
defineDestination(GLSDestinationId) { GLSScreen() },
defineDestination(BPSDestinationId) { BPSScreen() },
defineDestination(PRXDestinationId) { PRXScreen() },
defineDestination(RSCSDestinationId) { RSCSScreen() },
defineDestination(CGMSDestinationId) { CGMScreen() },
defineDestination(UARTDestinationId) { UARTScreen() },
)
val HomeDestinations = defineDestination(HomeDestinationId) { HomeView() }
13 changes: 2 additions & 11 deletions app/src/main/java/no/nordicsemi/android/nrftoolbox/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,12 @@ import no.nordicsemi.android.common.analytics.view.AnalyticsPermissionRequestDia
import no.nordicsemi.android.common.navigation.NavigationView
import no.nordicsemi.android.common.theme.NordicActivity
import no.nordicsemi.android.common.theme.NordicTheme
import no.nordicsemi.android.gls.GLSDestination
import no.nordicsemi.android.nrftoolbox.repository.ActivitySignals
import no.nordicsemi.android.toolbox.profile.DeviceConnectionDestination
import no.nordicsemi.android.toolbox.scanner.ScannerDestination
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : NordicActivity() {

@Inject
lateinit var activitySignals: ActivitySignals

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand All @@ -62,16 +57,12 @@ class MainActivity : NordicActivity() {
color = MaterialTheme.colorScheme.surface,
modifier = Modifier.fillMaxSize()
) {
NavigationView(HomeDestinations + ProfileDestinations + ScannerDestination + GLSDestination)
NavigationView(HomeDestinations + ScannerDestination + DeviceConnectionDestination)
}

AnalyticsPermissionRequestDialog()
}
}
}

override fun onResume() {
super.onResume()
activitySignals.onResume()
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package no.nordicsemi.android.nrftoolbox
package no.nordicsemi.android.nrftoolbox.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob

@Module
@InstallIn(SingletonComponent::class)
class ApplicationScopeModule {

@Provides
fun applicationScope() = CoroutineScope(SupervisorJob())
fun applicationScope() = CoroutineScope(SupervisorJob() + Dispatchers.IO)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package no.nordicsemi.android.nrftoolbox.di

import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineScope
import no.nordicsemi.kotlin.ble.client.android.CentralManager
import no.nordicsemi.kotlin.ble.client.android.native

@Module
@InstallIn(SingletonComponent::class)
object CentralManagerModule {

@Provides
fun provideCentralManager(
@ApplicationContext context: Context,
scope: CoroutineScope
): CentralManager {
return CentralManager.Factory.native(context, scope)
}
}

This file was deleted.

Loading