From c4685214d8db34166213ffa373a16af1a99401a5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 27 Jan 2015 21:23:50 +0100 Subject: o Adding 'recently seen' on BtDevice. Updated when scanning. o Removing BtScanResult, it was never used. o Getting MainActivity to listen on device property changed so the UI is properly updated. o Adding a status bar with color to indicate if the device is available, connected or not seen. --- app/src/main/java/io/trygvis/soilmoisture/SmDevice.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/io/trygvis/soilmoisture/SmDevice.java') diff --git a/app/src/main/java/io/trygvis/soilmoisture/SmDevice.java b/app/src/main/java/io/trygvis/soilmoisture/SmDevice.java index bf2b5f3..808cbb6 100644 --- a/app/src/main/java/io/trygvis/soilmoisture/SmDevice.java +++ b/app/src/main/java/io/trygvis/soilmoisture/SmDevice.java @@ -80,7 +80,7 @@ class SmDevice { return sensors; } - public Optional getSensorByIndex(int index) { + public Optional getSensorByNumber(int index) { if (!isUseful()) { throw new IllegalStateException("Not a useful device"); } @@ -95,7 +95,7 @@ class SmDevice { } void addSensor(SmSensor sensor) { - if (getSensorByIndex(sensor.index).isPresent()) { + if (getSensorByNumber(sensor.index).isPresent()) { throw new IllegalStateException("This device already contains a sensor with index=" + sensor.index); } -- cgit v1.2.3