Skip to content

Commit

Permalink
display rssi and signal level, sort by rssi
Browse files Browse the repository at this point in the history
  • Loading branch information
r-cohen committed Mar 19, 2018
1 parent e7fca53 commit 638084f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions btscanselector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 12
versionName "1.0.11"
versionCode 13
versionName "1.1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ public void setRssi(int rssi) {
}

private void updateIconResId() {
if (rssi < -25 && rssi > -50) {
if (rssi > -50) {
iconResourceId = R.drawable.network_high;
return;
}
if (rssi <= -50 && rssi > -67) {
iconResourceId = R.drawable.network_medium;
return;
}
if (rssi <= -50 && rssi > -75) {
if (rssi <= -67 && rssi > -70) {
iconResourceId = R.drawable.network_low;
return;
}
if (rssi < -75) {
if (rssi <= -70) {
iconResourceId = R.drawable.network_no_signal;
return;
}
iconResourceId = R.drawable.network_high;
iconResourceId = R.drawable.network_null;
}

public int getIconResourceId() {
Expand Down

0 comments on commit 638084f

Please sign in to comment.