forked from liamw9534/bt-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from __future__ import unicode_literals | ||
|
||
from device import BTGenericDevice | ||
|
||
|
||
class BTInput(BTGenericDevice): | ||
""" | ||
Wrapper around dbus to encapsulate the org.bluez.Input | ||
interface. | ||
:Properties: | ||
* **Connected(boolean) [readonly]**: | ||
Indicates if the device is connected. | ||
See also: :py:class:`.BTGenericDevice` for setup params. | ||
""" | ||
def __init__(self, *args, **kwargs): | ||
BTGenericDevice.__init__(self, addr='org.bluez.Input', | ||
*args, **kwargs) | ||
|
||
def connect(self): | ||
""" | ||
Connect to the input device. | ||
:return: | ||
:raises dbus.Exception: org.bluez.Error.AlreadyConnected | ||
:raises dbus.Exception: org.bluez.Error.ConnectionAttemptFailed | ||
""" | ||
return self._interface.Connect() | ||
|
||
def disconnect(self): | ||
""" | ||
Disconnect from the input device. | ||
To abort a connection attempt in case of errors or | ||
timeouts in the client it is fine to call this method. | ||
:return: | ||
:raises dbus.Exception: org.bluez.Error.Failed | ||
""" | ||
return self._interface.Disconnect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters