aboutsummaryrefslogtreecommitdiffstats
path: root/java/jau/direct_bt/DBTAdapter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-09-15 16:03:45 +0200
committerSven Gothel <[email protected]>2021-09-15 16:03:45 +0200
commit6a2d7770ebb3a20366239d5c1127a90c5dde71f7 (patch)
tree92a2fa9b808c1d253852ed5cb9bcd5fab17cd1c9 /java/jau/direct_bt/DBTAdapter.java
parent96e212cee8b0164107d137fcce62f5c36a749f2e (diff)
BTAdapter/HCIHandler Refine advertising/discovery state validation
HCIHandler advertising: Allow start/enable/disable even if already advertising BTAdapter/HCIHandler start- or enable advertising: Fail start/enable if having open/pending connections or discovery is active, BTAdapter/HCIHandler disabling advertising always allowed. BTAdapter/HCIHandler start- or enable discovery: Fail start/enable if advertising is active. BTAdapter/HCIHandler disabling discovery always allowed. +++ BTAdapter::poweredOff(bool active) now used to align passive (active = false) state reset for methods if !isPowered(). +++ Rename C++ BTAdapter::[getDiscovering() -> isDiscovering()] Add Java BTAdapter::isDiscovering() (Aligned with isAdvertising())
Diffstat (limited to 'java/jau/direct_bt/DBTAdapter.java')
-rw-r--r--java/jau/direct_bt/DBTAdapter.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/java/jau/direct_bt/DBTAdapter.java b/java/jau/direct_bt/DBTAdapter.java
index c2fc66ac..440b4f8e 100644
--- a/java/jau/direct_bt/DBTAdapter.java
+++ b/java/jau/direct_bt/DBTAdapter.java
@@ -244,6 +244,11 @@ public class DBTAdapter extends DBTObject implements BTAdapter
}
@Override
+ public final boolean isDiscovering() {
+ return ScanType.NONE != currentMetaScanType.get();
+ }
+
+ @Override
public String toString() {
if( !isValid() ) {
return "Adapter" + "\u271D" + "["+addressAndType+", '"+name_cached+"', id "+dev_id+"]";