From 92f94fc2f2d443a5ffb2c6030bcedb08cc57ca5f Mon Sep 17 00:00:00 2001 From: pierantoniomerlino Date: Tue, 30 May 2017 11:23:56 +0200 Subject: Added getInterfaceName method Signed-off-by: pierantoniomerlino --- java/BluetoothAdapter.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/BluetoothAdapter.java b/java/BluetoothAdapter.java index 10c39a2d..2761b4bb 100644 --- a/java/BluetoothAdapter.java +++ b/java/BluetoothAdapter.java @@ -230,6 +230,14 @@ public class BluetoothAdapter extends BluetoothObject * @return The local ID of the adapter. */ public native String getModalias(); + + /** Returns the interface name of the adapter. + * @return The interface name of the adapter. + */ + public String getInterfaceName() { + String[] path = getObjectPath().split("/"); + return path[path.length-1]; + } private native void delete(); -- cgit v1.2.3