summaryrefslogtreecommitdiffstats
path: root/hcid/Bluetooth.cs
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/Bluetooth.cs')
-rw-r--r--hcid/Bluetooth.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/hcid/Bluetooth.cs b/hcid/Bluetooth.cs
index 36b17e50..96c4e9ed 100644
--- a/hcid/Bluetooth.cs
+++ b/hcid/Bluetooth.cs
@@ -30,6 +30,7 @@ namespace Bluetooth
internal abstract class ManagerProxy
{
[Method] public abstract string DefaultAdapter();
+ [Method] public abstract string FindAdapter(string pattern);
}
public delegate void RemoteDeviceFoundHandler(string address, Int16 rssi,
@@ -79,17 +80,17 @@ namespace Bluetooth
{
}
- public Adapter(string path)
+ public Adapter(string pattern)
{
connection = Bus.GetSystemBus();
service = Service.Get(connection, "org.bluez");
manager = (ManagerProxy) service.GetObject(typeof(ManagerProxy), "/org/bluez");
- if (path == "")
+ if (pattern == "")
path = manager.DefaultAdapter();
-
- this.path = path;
+ else
+ path = manager.FindAdapter(pattern);
adapter = (AdapterProxy) service.GetObject(typeof(AdapterProxy), path);