Skip to content

Commit 5d34161

Browse files
ST BLE Sensor 4.4.3 Source code
add demos support for the SensorTile.box
1 parent d851489 commit 5d34161

124 files changed

Lines changed: 5628 additions & 480 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BlueMS/build.gradle

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ android {
6060
defaultConfig {
6161

6262
minSdkVersion rootProject.ext.minSdkVersion
63-
versionCode 30
64-
versionName '4.3.0'
65-
applicationId "com.st.bluems"
6663
targetSdkVersion rootProject.ext.targetSdkVersion
64+
versionCode 34
65+
versionName '4.4.3'
66+
applicationId "com.st.bluems"
6767
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
6868
vectorDrawables.useSupportLibrary = true
6969
multiDexEnabled true
@@ -115,10 +115,7 @@ android {
115115
}
116116

117117
ext {
118-
leakcanaryVersion = '1.5.4'
119-
retrofitVersion = '2.4.0'
120-
roomVersion = "1.1.1"
121-
archLifecycleVersion = '1.1.1'
118+
leakcanaryVersion = '1.6.3'
122119
}
123120

124121
repositories {
@@ -134,8 +131,6 @@ dependencies {
134131

135132
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
136133

137-
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
138-
139134
implementation 'com.android.support:multidex:1.0.3'
140135

141136
implementation group: 'com.android.support', name: 'design', version: "$rootProject.supportLibraryVersion"
@@ -145,8 +140,8 @@ dependencies {
145140
implementation group: 'com.android.support', name: 'cardview-v7', version: "$rootProject.supportLibraryVersion"
146141
implementation group: 'com.android.support.constraint', name: 'constraint-layout', version: "$rootProject.constraintLayoutVersion"
147142

148-
implementation "android.arch.persistence.room:runtime:$roomVersion"
149-
annotationProcessor "android.arch.persistence.room:compiler:$roomVersion"
143+
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
144+
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
150145

151146
// Lifecycle components
152147
implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
@@ -155,9 +150,8 @@ dependencies {
155150
// ibm speech to text
156151
implementation group: 'com.ibm.watson.developer_cloud', name: 'speech-to-text', version: '6.12.0'
157152

158-
//generic websocket speech to cloud
159-
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.13.1'
160-
153+
//generic websocket speech to cloud, keep 3.12.x to be compatible with device < api 21
154+
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.12.2'
161155

162156
//memory leak detector
163157
debugImplementation group: 'com.squareup.leakcanary', name: 'leakcanary-android', version: "$leakcanaryVersion"
@@ -172,5 +166,4 @@ dependencies {
172166
androidTestImplementation "com.android.support.test:runner:$rootProject.runnerVersion"
173167
androidTestImplementation "com.android.support.test:rules:$rootProject.rulesVersion"
174168
androidTestImplementation "com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion"
175-
}
176-
169+
}

BlueMS/src/main/AndroidManifest.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
<uses-permission android:name="android.permission.BLUETOOTH" />
4141
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- needed for the BlueVoice demos -->
4242
<uses-permission android:name="android.permission.INTERNET" />
43-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Memes Sensor Fusion vibrate when a free fall is detected -->
43+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
44+
<!-- Memes Sensor Fusion vibrate when a free fall is detected -->
4445
<uses-permission android:name="android.permission.VIBRATE" />
4546

4647
<uses-feature
@@ -57,6 +58,11 @@
5758
android:label="@string/app_name"
5859
android:logo="@drawable/app_logo"
5960
android:theme="@style/AppTheme">
61+
<!-- thanks to iFlytek library
62+
https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p
63+
-->
64+
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
65+
6066
<service
6167
android:name=".demos.fftAmpitude.FFTExportedService"
6268
android:exported="false"></service>
@@ -165,9 +171,6 @@
165171
</intent-filter>
166172
</receiver>
167173

168-
<service
169-
android:name=".demos.Cloud.DownloadFwFileService"
170-
android:exported="false" />
171174
<service
172175
android:name=".demos.aiDataLog.SessionAnnotationLoggingService"
173176
android:exported="false" />

BlueMS/src/main/java/com/st/BlueMS/DemosActivity.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
import android.content.Context;
4141
import android.content.Intent;
42+
import android.os.Bundle;
4243
import android.support.annotation.NonNull;
4344
import android.view.Menu;
4445
import android.view.MenuItem;
@@ -57,6 +58,7 @@
5758
import com.st.BlueMS.demos.SDLog.SDLogFragment;
5859
import com.st.BlueMS.demos.aiDataLog.AIDataLogDemoFragment;
5960
import com.st.BlueMS.demos.fftAmpitude.FFTAmplitudeFragment;
61+
import com.st.BlueMS.demos.fitnessActivity.FitnessActivityFragment;
6062
import com.st.BlueMS.demos.memsSensorFusion.CompassFragment;
6163
import com.st.BlueMS.demos.EnvironmentalSensorsFragment;
6264
import com.st.BlueMS.demos.HeartRateFragment;
@@ -69,12 +71,14 @@
6971
import com.st.BlueMS.demos.ProximityGestureRecognitionFragment;
7072
import com.st.BlueMS.demos.Audio.DirOfArrival.SourceLocFragment;
7173
import com.st.BlueMS.demos.SwitchFragment;
74+
import com.st.BlueMS.demos.motionAlgorithm.MotionAlgorithmFragment;
7275
import com.st.BlueMS.preference.nucleo.SettingsWithNucleoConfiguration;
7376
import com.st.BlueSTSDK.Debug;
7477
import com.st.BlueSTSDK.Node;
7578
import com.st.BlueSTSDK.Utils.ConnectionOption;
7679
import com.st.BlueSTSDK.gui.demos.DemoDescriptionAnnotation;
7780
import com.st.BlueSTSDK.gui.demos.DemoFragment;
81+
import com.st.BlueSTSDK.gui.fwUpgrade.download.DownloadFwFileCompletedReceiver;
7882
import com.st.STM32WB.fwUpgrade.feature.RebootOTAModeFeature;
7983
import com.st.STM32WB.p2pDemo.feature.FeatureControlLed;
8084
import com.st.STM32WB.p2pDemo.feature.FeatureSwitchStatus;
@@ -124,7 +128,7 @@ public static class LedButtonControlFragment extends com.st.STM32WB.p2pDemo.LedB
124128
* for the demo it will displayed
125129
*/
126130
@SuppressWarnings("unchecked")
127-
private final static Class<? extends DemoFragment> ALL_DEMOS[] = new Class[]{
131+
private final static Class<? extends DemoFragment>[] ALL_DEMOS = new Class[]{
128132
EnvironmentalSensorsFragment.class,
129133
MemsSensorFusionFragment.class,
130134
FFTAmplitudeFragment.class,
@@ -152,18 +156,15 @@ public static class LedButtonControlFragment extends com.st.STM32WB.p2pDemo.LedB
152156
AIDataLogDemoFragment.class,
153157
CloudLogFragment.class,
154158
PredictiveMaintenanceFragment.class,
159+
MotionAlgorithmFragment.class,
160+
FitnessActivityFragment.class,
155161
NodeStatusFragment.class
156162
//FeatureDebugFragment.class
157163
};
158164

159165
@SuppressWarnings("unchecked")
160166
@Override
161167
protected Class<? extends DemoFragment>[] getAllDemos() {
162-
if(getNode().getType() == Node.Type.STEVAL_BCN002V1){
163-
ArrayList<Class<? extends DemoFragment>> demoList = new ArrayList<>(Arrays.asList(ALL_DEMOS));
164-
demoList.remove(SpeechToTextFragment.class);
165-
return demoList.toArray(new Class[demoList.size()]);
166-
}
167168
return ALL_DEMOS;
168169
}
169170

BlueMS/src/main/java/com/st/BlueMS/NodeListActivity.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
package com.st.BlueMS;
3939

40+
import android.support.annotation.NonNull;
41+
4042
import com.st.BlueNRG.fwUpgrade.BlueNRGAdvertiseFilter;
4143
import com.st.BlueNRG.fwUpgrade.feature.BlueNRGOTASupport;
4244
import com.st.BlueSTSDK.Features.standardCharacteristics.StdCharToFeatureMap;
@@ -56,7 +58,7 @@
5658
public class NodeListActivity extends com.st.BlueSTSDK.gui.NodeListActivity {
5759

5860
@Override
59-
public boolean displayNode(Node n) {
61+
public boolean displayNode(@NonNull Node n) {
6062
return true;
6163
}
6264

@@ -68,7 +70,7 @@ protected List<AdvertiseFilter> buildAdvertiseFilter() {
6870
}
6971

7072
@Override
71-
public void onNodeSelected(Node n) {
73+
public void onNodeSelected(@NonNull Node n) {
7274

7375
ConnectionOption.ConnectionOptionBuilder optionsBuilder = ConnectionOption.builder()
7476
.resetCache(clearCacheIsSelected())
@@ -88,7 +90,7 @@ public void onNodeSelected(Node n) {
8890
else if(n.getType()== Node.Type.STEVAL_WESU1)
8991
startActivity(DemosActivityWesu.getStartIntent(this,n,options));
9092
else if (STM32OTASupport.isOTANode(n)){
91-
startActivity(FwUpgradeSTM32WBActivity.getStartIntent(this, n,null,null));
93+
startActivity(FwUpgradeSTM32WBActivity.getStartIntent(this, n,null,null,null));
9294
}else {
9395
startActivity(DemosActivity.getStartIntent(this, n, options));
9496
}

BlueMS/src/main/java/com/st/BlueMS/demos/AccEvent/AccEventFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private static DetectableEvent[] getDetectableEvent(Node.Type type){
131131
case BLUE_COIN:
132132
case NUCLEO:
133133
return NUCLEO_SUPPORTED_EVENT;
134-
case SENSOR_TILE_101:
134+
case SENSOR_TILE_BOX:
135135
return SENSORTILE101_SUPPORTED_EVENT;
136136
default:
137137
return new DetectableEvent[0];
@@ -154,7 +154,7 @@ private static DetectableEvent getDefaultEvent(Node.Type type){
154154
case SENSOR_TILE:
155155
case BLUE_COIN:
156156
case NUCLEO:
157-
case SENSOR_TILE_101:
157+
case SENSOR_TILE_BOX:
158158
return DetectableEvent.ORIENTATION;
159159
default:
160160
return DetectableEvent.NONE;

BlueMS/src/main/java/com/st/BlueMS/demos/ActivityRecognition/ActivityView.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
/*
2+
* Copyright (c) 2019 STMicroelectronics – All rights reserved
3+
* The STMicroelectronics corporate logo is a trademark of STMicroelectronics
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* - Redistributions of source code must retain the above copyright notice, this list of conditions
9+
* and the following disclaimer.
10+
*
11+
* - Redistributions in binary form must reproduce the above copyright notice, this list of
12+
* conditions and the following disclaimer in the documentation and/or other materials provided
13+
* with the distribution.
14+
*
15+
* - Neither the name nor trademarks of STMicroelectronics International N.V. nor any other
16+
* STMicroelectronics company nor the names of its contributors may be used to endorse or
17+
* promote products derived from this software without specific prior written permission.
18+
*
19+
* - All of the icons, pictures, logos and other images that are provided with the source code
20+
* in a directory whose title begins with st_images may only be used for internal purposes and
21+
* shall not be redistributed to any third party or modified in any way.
22+
*
23+
* - Any redistributions in binary form shall not include the capability to display any of the
24+
* icons, pictures, logos and other images that are provided with the source code in a directory
25+
* whose title begins with st_images.
26+
*
27+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
28+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
29+
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
30+
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35+
* OF SUCH DAMAGE.
36+
*/
37+
138
package com.st.BlueMS.demos.ActivityRecognition;
239

340
import android.content.Context;

BlueMS/src/main/java/com/st/BlueMS/demos/ActivityRecognition/HumanActivityRecognitionGMPView.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
/*
2+
* Copyright (c) 2019 STMicroelectronics – All rights reserved
3+
* The STMicroelectronics corporate logo is a trademark of STMicroelectronics
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* - Redistributions of source code must retain the above copyright notice, this list of conditions
9+
* and the following disclaimer.
10+
*
11+
* - Redistributions in binary form must reproduce the above copyright notice, this list of
12+
* conditions and the following disclaimer in the documentation and/or other materials provided
13+
* with the distribution.
14+
*
15+
* - Neither the name nor trademarks of STMicroelectronics International N.V. nor any other
16+
* STMicroelectronics company nor the names of its contributors may be used to endorse or
17+
* promote products derived from this software without specific prior written permission.
18+
*
19+
* - All of the icons, pictures, logos and other images that are provided with the source code
20+
* in a directory whose title begins with st_images may only be used for internal purposes and
21+
* shall not be redistributed to any third party or modified in any way.
22+
*
23+
* - Any redistributions in binary form shall not include the capability to display any of the
24+
* icons, pictures, logos and other images that are provided with the source code in a directory
25+
* whose title begins with st_images.
26+
*
27+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
28+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
29+
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
30+
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35+
* OF SUCH DAMAGE.
36+
*/
37+
138
package com.st.BlueMS.demos.ActivityRecognition;
239

340
import android.content.Context;

BlueMS/src/main/java/com/st/BlueMS/demos/ActivityRecognition/HumanActivityRecognitionIGNView.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
/*
2+
* Copyright (c) 2019 STMicroelectronics – All rights reserved
3+
* The STMicroelectronics corporate logo is a trademark of STMicroelectronics
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* - Redistributions of source code must retain the above copyright notice, this list of conditions
9+
* and the following disclaimer.
10+
*
11+
* - Redistributions in binary form must reproduce the above copyright notice, this list of
12+
* conditions and the following disclaimer in the documentation and/or other materials provided
13+
* with the distribution.
14+
*
15+
* - Neither the name nor trademarks of STMicroelectronics International N.V. nor any other
16+
* STMicroelectronics company nor the names of its contributors may be used to endorse or
17+
* promote products derived from this software without specific prior written permission.
18+
*
19+
* - All of the icons, pictures, logos and other images that are provided with the source code
20+
* in a directory whose title begins with st_images may only be used for internal purposes and
21+
* shall not be redistributed to any third party or modified in any way.
22+
*
23+
* - Any redistributions in binary form shall not include the capability to display any of the
24+
* icons, pictures, logos and other images that are provided with the source code in a directory
25+
* whose title begins with st_images.
26+
*
27+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
28+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
29+
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
30+
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35+
* OF SUCH DAMAGE.
36+
*/
137
package com.st.BlueMS.demos.ActivityRecognition;
238

339
import android.content.Context;

BlueMS/src/main/java/com/st/BlueMS/demos/ActivityRecognition/MotionARView.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
/*
2+
* Copyright (c) 2019 STMicroelectronics – All rights reserved
3+
* The STMicroelectronics corporate logo is a trademark of STMicroelectronics
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* - Redistributions of source code must retain the above copyright notice, this list of conditions
9+
* and the following disclaimer.
10+
*
11+
* - Redistributions in binary form must reproduce the above copyright notice, this list of
12+
* conditions and the following disclaimer in the documentation and/or other materials provided
13+
* with the distribution.
14+
*
15+
* - Neither the name nor trademarks of STMicroelectronics International N.V. nor any other
16+
* STMicroelectronics company nor the names of its contributors may be used to endorse or
17+
* promote products derived from this software without specific prior written permission.
18+
*
19+
* - All of the icons, pictures, logos and other images that are provided with the source code
20+
* in a directory whose title begins with st_images may only be used for internal purposes and
21+
* shall not be redistributed to any third party or modified in any way.
22+
*
23+
* - Any redistributions in binary form shall not include the capability to display any of the
24+
* icons, pictures, logos and other images that are provided with the source code in a directory
25+
* whose title begins with st_images.
26+
*
27+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
28+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
29+
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
30+
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35+
* OF SUCH DAMAGE.
36+
*/
137
package com.st.BlueMS.demos.ActivityRecognition;
238

339
import android.content.Context;

0 commit comments

Comments
 (0)