Skip to content

Commit

Permalink
Release-v2.9.1 package
Browse files Browse the repository at this point in the history
  • Loading branch information
SaravanKumarMS committed Jul 26, 2024
1 parent 5e2be2a commit af5a675
Show file tree
Hide file tree
Showing 83 changed files with 2,971 additions and 409 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Builds
.idea/
*.iml
/local.properties
*.apk
*.DS_Store
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Simplicity Connect includes many demos to test sample apps in the Silicon Labs G
- **Bluetooth Electronic Shelf Labels (ESL)**: Adds and commissions ESL tags to the system network by scanning the tag's QR code with the mobile device's camera and provides the user a UI to view the list commissioned tags and control them.
- **Matter**: Commission and control of the Matter devices over Thread and Wi-Fi.
- **Wi-Fi OTA Firmware Update**: The Wi-Fi OTA firmware update demo demonstrates how to update the SiWx91x user application firmware over Wi-Fi connection, by downloading the image from the mobile phone.
- **Wi-Fi 917 Sensors**: The Wi-Fi 917 Sensor demo demonstrates to read and display sensor data from 917 Dev Kit.

## Development Features
Simplicity Connect helps developers create and troubleshoot Bluetooth applications running on Silicon Labs’ BLE hardware. Here’s a rundown of some example functionalities.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
id("com.android.application") version "7.4.2" apply false
id("com.android.application") version "8.4.1" apply false
id("org.jetbrains.kotlin.android") version "1.7.21" apply false
id("org.jetbrains.kotlin.android.extensions") version "1.7.21" apply false
id("org.jetbrains.kotlin.kapt") version "1.7.21" apply false
Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 20 13:32:19 CEST 2020
#Thu Oct 26 16:56:57 EEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
75 changes: 48 additions & 27 deletions mobile/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.api.variant.Packaging

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
Expand All @@ -13,12 +15,12 @@ repositories {
}

android {
compileSdk = 33
compileSdk = 34
namespace = "com.siliconlabs.bledemo"

defaultConfig {
minSdk = 29
targetSdk = 33
targetSdk = 34

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -58,8 +60,8 @@ android {
create("blueGecko") {
dimension = versionDim
applicationId = "com.siliconlabs.bledemo"
versionCode = 49
versionName = "2.9.0"
versionCode = 53
versionName = "2.9.1"
}
}

Expand All @@ -74,27 +76,40 @@ android {

buildFeatures {
viewBinding = true
buildConfig = true
}
}

dependencies {
implementation(fileTree(mapOf("include" to listOf("*.jar", "*.so"), "dir" to "libs")))

// This dependency is downloaded from the Google’s Maven repository.
// Make sure you also include that repository in your project's build.gradle file.
implementation("com.google.android.play:feature-delivery:2.1.0")
implementation("com.google.android.play:review:2.0.1")
implementation("com.google.android.play:app-update:2.1.0")


// For Kotlin users, also import the Kotlin extensions library for Play Feature Delivery:
implementation("com.google.android.play:feature-delivery-ktx:2.1.0")
implementation("com.google.android.play:review-ktx:2.0.1")
implementation("com.google.android.play:app-update-ktx:2.1.0")
// androidx
implementation("androidx.core:core-ktx:1.10.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.fragment:fragment:1.5.6")
implementation("androidx.core:core-splashscreen:1.0.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
implementation("androidx.activity:activity-ktx:1.6.0")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.fragment:fragment:1.8.1")
implementation("androidx.core:core-splashscreen:1.0.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2")
implementation("androidx.activity:activity-ktx:1.9.0")
implementation("com.google.android.material:material:1.12.0")

// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")

// UI components
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.recyclerview:recyclerview:1.3.0")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.gridlayout:gridlayout:1.0.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
Expand All @@ -106,12 +121,12 @@ dependencies {
//implementation("com.github.PhilJay:MPAndroidChart:v3.0.3")

// Navigation
implementation("androidx.navigation:navigation-fragment-ktx:2.5.3")
implementation("androidx.navigation:navigation-ui-ktx:2.5.3")
implementation("androidx.navigation:navigation-dynamic-features-fragment:2.5.3")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
implementation("androidx.navigation:navigation-dynamic-features-fragment:2.7.7")

// Dependency injection
implementation("com.google.dagger:hilt-android:2.45")
implementation("com.google.dagger:hilt-android:2.46.1")
kapt("com.google.dagger:hilt-android-compiler:2.45")

// View binding
Expand All @@ -123,7 +138,7 @@ dependencies {
// Parsing
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.opencsv:opencsv:5.6")
implementation("androidx.activity:activity:1.6.0-alpha05")
implementation("androidx.activity:activity:1.9.0")

// Only used for Int.pow() method in a couple of places
implementation("com.google.guava:guava:29.0-android")
Expand All @@ -135,16 +150,22 @@ dependencies {

// instrumented tests
testImplementation("junit:junit:4.13.2")
androidTestUtil("androidx.test:orchestrator:1.4.2")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestUtil("androidx.test:orchestrator:1.5.0")
androidTestImplementation("androidx.test:runner:1.6.1")
androidTestImplementation("androidx.test:rules:1.6.1")
androidTestImplementation("androidx.test.ext:junit:1.2.1")

//Matter
implementation("androidx.camera:camera-core:1.1.0")
implementation("androidx.camera:camera-camera2:1.1.0")
implementation("androidx.camera:camera-lifecycle:1.1.0")
implementation("androidx.camera:camera-view:1.1.0")
implementation("com.google.mlkit:barcode-scanning:17.0.2")
implementation("androidx.camera:camera-core:1.3.4")
implementation("androidx.camera:camera-camera2:1.3.4")
implementation("androidx.camera:camera-lifecycle:1.3.4")
implementation("androidx.camera:camera-view:1.3.4")
implementation("com.google.mlkit:barcode-scanning:17.2.0")
implementation("com.daimajia.swipelayout:library:1.2.0@aar")

//DevKitSensor917 Demo
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0")

}
29 changes: 19 additions & 10 deletions mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.NFC"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE"/>

<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true" />
Expand All @@ -33,13 +35,14 @@
<application
android:name=".application.SiliconLabsDemoApplication"
android:allowBackup="false"
android:enableOnBackInvokedCallback="true"
android:icon="@mipmap/si_launcher_round"
android:requestLegacyExternalStorage="true"
android:label="@string/app_name_simplicity_Connect"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
tools:replace="android:allowBackup"
android:enableOnBackInvokedCallback="true"
android:theme="@style/MainAppTheme">
android:theme="@style/MainAppTheme"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup">

<activity
android:name=".features.configure.gatt_configurator.activities.GattServerActivity"
Expand Down Expand Up @@ -80,6 +83,7 @@
android:exported="true" />
<service
android:name=".features.configure.advertiser.services.AdvertiserService"
android:foregroundServiceType="connectedDevice"
android:exported="true" />
<service
android:name=".features.scan.browser.services.ShareLogServices"
Expand Down Expand Up @@ -111,8 +115,13 @@
<activity
android:name=".features.demo.matter_demo.activities.MatterDemoActivity"
android:label="@string/matter_demo_title"
android:theme="@style/matter_theme"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait"
android:theme="@style/matter_theme" />
<activity
android:name=".features.demo.devkitsensor917.activities.DevKitSensor917Activity"
android:label="Dev kitSensor 917"
android:screenOrientation="portrait"
android:theme="@style/matter_theme" />

<provider
android:name="androidx.core.content.FileProvider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.appcompat.app.AppCompatActivity
import com.siliconlabs.bledemo.R
import com.siliconlabs.bledemo.base.dialogs.ProgressDialogWithSpinner
import timber.log.Timber

abstract class BaseActivity : AppCompatActivity() {
enum class ConnectionStatus {
CONNECTING, READING_DEVICE_STATE
Expand Down Expand Up @@ -60,6 +59,7 @@ abstract class BaseActivity : AppCompatActivity() {
} else {
Timber.e("Dialog is not visible, cannot dismiss")
}

}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.siliconlabs.bledemo.base.viewmodels

import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.siliconlabs.bledemo.bluetooth.ble.BluetoothDeviceInfo
import com.siliconlabs.bledemo.bluetooth.ble.ScanResultCompat
import com.siliconlabs.bledemo.bluetooth.parsing.ScanRecordParser
import com.siliconlabs.bledemo.bluetooth.services.BluetoothService

abstract class ScannerViewModel : ViewModel() {

Expand All @@ -16,7 +18,9 @@ abstract class ScannerViewModel : ViewModel() {
val isScanningOn: LiveData<Boolean> = _isScanningOn


abstract fun handleScanResult(result: ScanResultCompat)
abstract fun handleScanResult(result: ScanResultCompat,
connectType: BluetoothService.GattConnectType?,
context: Context?)


fun toggleScanningState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class BluetoothService : LocalService<BluetoothService>() {
IOP_TEST,
ESL_DEMO,
MATTER_DEMO,
WIFI_OTA_UPDATE
WIFI_OTA_UPDATE,
DEV_KIT_SENSOR
}

interface ScanListener {
Expand Down Expand Up @@ -280,7 +281,12 @@ class BluetoothService : LocalService<BluetoothService>() {
addAction(ACTION_GATT_SERVER_DEBUG_CONNECTION)
addAction(ACTION_GATT_SERVER_REMOVE_NOTIFICATION)
}
registerReceiver(gattServerBroadcastReceiver, filter)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(gattServerBroadcastReceiver, filter, RECEIVER_EXPORTED)
}else {
registerReceiver(gattServerBroadcastReceiver, filter)
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE
import android.os.Build
import android.os.IBinder
import androidx.core.content.ContextCompat
Expand Down Expand Up @@ -39,11 +40,16 @@ class AdvertiserService : Service() {

val filter = IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)
registerReceiver(receiver, filter)

}

override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val notification = prepareNotification()
startForeground(1, notification)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(1, notification, FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE)
} else {
startForeground(1, notification)
}

return START_STICKY
}
Expand All @@ -67,9 +73,9 @@ class AdvertiserService : Service() {
this, ADVERTISER_NOTIFICATION_REQUEST_CODE, notificationIntent, PendingIntent.FLAG_IMMUTABLE)

return Notification.Builder(this, CHANNEL_ID).apply {
setContentTitle("EFR Connect")
setContentTitle("Si Connect")
setContentText("Advertiser is running...")
setSmallIcon(R.mipmap.efr_redesign_launcher)
setSmallIcon(R.mipmap.si_launcher)
setContentIntent(pendingIntent)
setShowWhen(false)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.siliconlabs.bledemo.features.demo.devkitsensor917

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory


object APIClient {
val baseURL = "http://192.168.10.10"

fun getInstance(): Retrofit {
return Retrofit.Builder().baseUrl(baseURL)
.addConverterFactory(GsonConverterFactory.create())
.build()
}
}
Loading

0 comments on commit af5a675

Please sign in to comment.