Skip to content

Commit

Permalink
Rfcomm: Change dbus type signature to an int
Browse files Browse the repository at this point in the history
Fixes: #2489
  • Loading branch information
infirit committed Sep 18, 2024
1 parent 625b3c2 commit e1c1bf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions blueman/plugins/mechanism/Rfcomm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

class Rfcomm(MechanismPlugin):
def on_load(self) -> None:
self.parent.add_method("OpenRFCOMM", ("d",), "", self._open_rfcomm)
self.parent.add_method("CloseRFCOMM", ("d",), "", self._close_rfcomm)
self.parent.add_method("OpenRFCOMM", ("n",), "", self._open_rfcomm)
self.parent.add_method("CloseRFCOMM", ("n",), "", self._close_rfcomm)

def _open_rfcomm(self, port_id: int) -> None:
subprocess.Popen([RFCOMM_WATCHER_PATH, f"/dev/rfcomm{port_id:d}"])
Expand Down
6 changes: 3 additions & 3 deletions blueman/services/meta/SerialService.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def try_replace_root_watcher(self, monitor: Gio.FileMonitor, path: str, port: in

logging.info(f'User was granted access to {path}')
logging.info('Replacing root watcher')
Mechanism().CloseRFCOMM('(d)', port)
Mechanism().CloseRFCOMM('(n)', port)
subprocess.Popen([RFCOMM_WATCHER_PATH, path])
if port in self._handlerids:
handler_id = self._handlerids.pop(port)
Expand Down Expand Up @@ -101,7 +101,7 @@ def connect(
channel)
filename = f"/dev/rfcomm{port_id:d}"
logging.info('Starting rfcomm watcher as root')
Mechanism().OpenRFCOMM('(d)', port_id)
Mechanism().OpenRFCOMM('(n)', port_id)
mon = Gio.File.new_for_path(filename).monitor_file(Gio.FileMonitorFlags.NONE)
self._handlerids[port_id] = mon.connect('changed', self.on_file_changed, port_id)
self.try_replace_root_watcher(mon, filename, port_id)
Expand All @@ -122,7 +122,7 @@ def disconnect(
error_handler: Optional[Callable[[str], None]] = None
) -> None:
try:
Mechanism().CloseRFCOMM('(d)', port_id)
Mechanism().CloseRFCOMM('(n)', port_id)
except GLib.Error as e:
if error_handler:
error_handler(e.message)
Expand Down

0 comments on commit e1c1bf6

Please sign in to comment.