diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-05-30 10:36:03 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-05-30 10:36:03 +0000 |
commit | 786cbd0c3e4b70976cf6777eac839d2e4b86641a (patch) | |
tree | 137ceb22a47a67d20f9fb76d7edd80c870590892 /hcid/Bluetooth.cs | |
parent | bf026c430c11a5bc5e7215cf5937e485663a05f0 (diff) |
Add FindAdapter method
Diffstat (limited to 'hcid/Bluetooth.cs')
-rw-r--r-- | hcid/Bluetooth.cs | 9 |
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); |