-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
716 changed files
with
48,042 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-parcelize' | ||
|
||
android { | ||
compileSdkVersion rootProject.compileSdkVersion | ||
buildToolsVersion rootProject.buildToolsVersion | ||
|
||
defaultConfig { | ||
minSdkVersion rootProject.ext.minSdkVersion | ||
targetSdkVersion rootProject.ext.targetSdkVersion | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables.useSupportLibrary = true | ||
multiDexEnabled true | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled true | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
buildFeatures { | ||
viewBinding true | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = rootProject.ext.javaVersion.toString() | ||
} | ||
|
||
sourceSets { | ||
all { | ||
res.srcDirs += ['st_images'] | ||
} | ||
} | ||
namespace 'com.st.assetTracking.threshold' | ||
|
||
} | ||
|
||
dependencies { | ||
implementation project(path: ':BlueSTSDK') | ||
implementation project(path: ':UI') | ||
|
||
implementation group: 'androidx.appcompat', name: 'appcompat', version: "$rootProject.androidx_appCompatVersion" | ||
implementation group: 'com.google.android.material', name: 'material', version: "$rootProject.androidx_materialVersion" | ||
|
||
implementation group: 'androidx.recyclerview', name: 'recyclerview', version: "$rootProject.androidx_recycleViewVersion" | ||
implementation group: 'androidx.constraintlayout', name: 'constraintlayout', version: "$rootProject.androidx_constraintLayoutVersion" | ||
implementation group: 'androidx.fragment', name: 'fragment-ktx', version: "$rootProject.androidx_fragmentKtx" | ||
implementation group: 'androidx.lifecycle', name: 'lifecycle-extensions', version: "$rootProject.lifeCycleExtensionVersion" | ||
implementation group: 'androidx.lifecycle', name: 'lifecycle-viewmodel-ktx', version: "$rootProject.androidx_lifecycleKtx" | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
...gThreshold/src/androidTest/java/com/st/assetTracking/threshold/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.st.assetTracking.threshold | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.st.assetTracking.threshold.test", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" /> |
82 changes: 82 additions & 0 deletions
82
...hreshold/src/main/java/com/st/assetTracking/threshold/comunication/CloudTrackerConsole.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright (c) 2019 STMicroelectronics – All rights reserved | ||
* The STMicroelectronics corporate logo is a trademark of STMicroelectronics | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* - Redistributions of source code must retain the above copyright notice, this list of conditions | ||
* and the following disclaimer. | ||
* | ||
* - Redistributions in binary form must reproduce the above copyright notice, this list of | ||
* conditions and the following disclaimer in the documentation and/or other materials provided | ||
* with the distribution. | ||
* | ||
* - Neither the name nor trademarks of STMicroelectronics International N.V. nor any other | ||
* STMicroelectronics company nor the names of its contributors may be used to endorse or | ||
* promote products derived from this software without specific prior written permission. | ||
* | ||
* - All of the icons, pictures, logos and other images that are provided with the source code | ||
* in a directory whose title begins with st_images may only be used for internal purposes and | ||
* shall not be redistributed to any third party or modified in any way. | ||
* | ||
* - Any redistributions in binary form shall not include the capability to display any of the | ||
* icons, pictures, logos and other images that are provided with the source code in a directory | ||
* whose title begins with st_images. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR | ||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY | ||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER | ||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | ||
* OF SUCH DAMAGE. | ||
*/ | ||
|
||
package com.st.assetTracking.threshold.comunication | ||
|
||
import com.st.BlueSTSDK.Debug | ||
import com.st.BlueSTSDK.Node | ||
import com.st.assetTracking.threshold.model.SamplingSettings | ||
|
||
/** | ||
* interface used to save and read the SampleSettings | ||
*/ | ||
interface CloudTrackerConsole { | ||
|
||
/** | ||
* save the [settings], call [SaveCallback.onSuccess] when the load is completed or | ||
* [SaveCallback.onError] when it fails | ||
*/ | ||
fun save(settings: SamplingSettings, callback: SaveCallback) | ||
|
||
/** | ||
* load the settings, call [LoadCallback.onSuccess] with the new settings when the read finish | ||
* [LoadCallback.onError] where the read fails | ||
*/ | ||
fun load(callback: LoadCallback) | ||
|
||
interface SaveCallback { | ||
fun onSuccess() | ||
fun onError() | ||
} | ||
|
||
interface LoadCallback { | ||
fun onSuccess(settings: SamplingSettings) | ||
fun onError() | ||
} | ||
|
||
companion object { | ||
/** | ||
* create a console for store/load the settings into [node] using the ble protocol | ||
* @return console to use to store/load the settings or null if the node is not compatible | ||
*/ | ||
fun buildForNode(node: Node): CloudTrackerConsole? { | ||
val console: Debug = node.debug ?: return null | ||
return CloudTrackerNucleoConsole(console) | ||
} | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.