Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #33 from GauthamBanasandra/redundant-func
Browse files Browse the repository at this point in the history
Move getFirstDeviceAddress to BleClientImpl
  • Loading branch information
David Saff authored Dec 6, 2018
2 parents b23db50 + 0358a2d commit 2521c30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ public String getFirstDeviceAddress() {
if (bleService == null) {
return null;
}
return bleService.getBleDevices().getFirstDeviceAddress();
BleDevices bleDevices = bleService.getBleDevices();
if (bleDevices.devices.isEmpty()) {
return null;
}
return bleDevices.devices.keySet().iterator().next();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ public int getCount() {
return devices.size();
}

public String getFirstDeviceAddress() {
// TODO: is this function really necessary?
if (devices.isEmpty()) {
return null;
} else {
return devices.keySet().iterator().next();
}
}

/**
* Removes devices which haven't been seen since the last scan time and are not currently
Expand Down

0 comments on commit 2521c30

Please sign in to comment.