aboutsummaryrefslogtreecommitdiffstats
path: root/java/org
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-11-24 08:00:16 +0100
committerSven Gothel <[email protected]>2023-11-24 08:00:16 +0100
commitcf3d5a2c7e5bd54b9af514061e7d8375a0c4d9da (patch)
treea8a7998012215297f65019f5211c4d2f53b9124e /java/org
parent2c9afcdb852ccdb9155d5a8e6bfdea6cb4544674 (diff)
BTDevice::setSMPKeyBin: Align C++/Java code using setSMPKeyBin()
Diffstat (limited to 'java/org')
-rw-r--r--java/org/direct_bt/BTRole.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/org/direct_bt/BTRole.java b/java/org/direct_bt/BTRole.java
index 7e6ecfba..01d8c91a 100644
--- a/java/org/direct_bt/BTRole.java
+++ b/java/org/direct_bt/BTRole.java
@@ -74,4 +74,14 @@ public enum BTRole {
BTRole(final byte v) {
value = v;
}
+
+ /** Returns reversed roled */
+ public final BTRole reverse() {
+ switch(value) {
+ case 0x01: return BTRole.Slave;
+ case 0x02: return BTRole.Master;
+ default: return BTRole.None;
+ }
+ }
+
}