tetherd D-Bus API (session bus)
Normative contract between tetherd and its clients (tether GTK app,
tether-cli, future shell extensions). Bus name org.tether.Daemon.
All strings UTF-8. Timestamps are Unix milliseconds (t).
/org/tether/Daemon — interface org.tether.Daemon1
Properties
| Name | Type | Access | Meaning |
|---|---|---|---|
SelfId | s | read | this desktop’s device id (64 hex) |
SelfName | s | read/write | advertised name (defaults to hostname) |
Version | s | read | daemon version |
Discoverable | b | read/write | publish mDNS + UDP beacon |
ShowDesktopNotifications | b | read/write | mirror phone notifications to org.freedesktop.Notifications |
Methods
ListDevices() -> (ao paths)— all known devices (paired, connected or merely discovered).StartDiscovery(),StopDiscovery()— browsing is always on while the daemon runs; these are hints to burst beacons.AddManualAddress(s address)—hostorhost:port; dials immediately and remembers the address.GeneratePairingQr() -> (s uri)— returnstether://pair?...valid 5 minutes (see docs/reference/protocol.md). Calling again invalidates the previous one.CancelPairingQr()
Signals
DeviceAdded(o path),DeviceRemoved(o path)QrPairingStarted(o path)— a phone connected using the current QR; UI may show progress.
/org/tether/Devices/<id> — interface org.tether.Device1
<id> is the 64-hex device id (valid D-Bus path element).
Properties (all read-only; changes emitted via org.freedesktop.DBus.Properties.PropertiesChanged)
| Name | Type | Meaning |
|---|---|---|
Id | s | device id |
Name | s | peer name |
Kind | s | desktop / phone / tablet / unknown |
Paired | b | trusted record exists |
Connected | b | authenticated session up |
Reachable | b | seen via discovery in the last 30 s |
Addresses | as | last known ip:port list |
PairState | s | none / requested_by_us / requested_by_peer / confirming / paired |
PairingSas | s | 6 digits while PairState is requested_by_peer or confirming, else "" |
BatteryLevel | i | 0..100, -1 unknown |
BatteryCharging | b | |
Model | s | from DeviceInfo |
Manufacturer | s | |
OsVersion | s | |
Capabilities | as | peer’s Hello.capabilities |
LastSeen | t | ms since epoch |
Methods
RequestPair()— we initiate; emitsPairingSasonce the peer answers.ConfirmPair()— user confirmed the SAS on this side.RejectPair()Unpair()Connect()— dial known addresses now.Disconnect()GetNotifications() -> (aa{sv})— currently visible notifications (dicts described below).ActivateNotification(s key, i index, s reply_text)—index = -1opens on phone;reply_textused for remote-input actions.DismissNotification(s key)GetAppNotificationSettings() -> (a{sb})— package → enabled.SetAppNotificationsEnabled(s package, b enabled)
Signals
NotificationPosted(a{sv} notification)NotificationRemoved(s key)ReplyRequested(s key)— the user clicked a reply action on a desktop notification; the GTK app should open its reply box for that key. For the daemon’s own message notifications (M2)keyisthread:<thread_id>and the app should open that conversation’s composer instead.PairingFinished(b success, s reason)
Notification dict (a{sv})
| Key | Type | Notes |
|---|---|---|
key | s | |
package | s | |
app_name | s | |
title | s | |
text | s | |
big_text | s | |
sub_text | s | |
when_ms | t | |
category | s | |
ongoing | b | |
clearable | b | |
silent | b | |
conversation | b | |
conversation_title | s | |
icon_path | s | absolute path to cached PNG or "" |
app_icon_path | s | absolute path or "" |
has_content_intent | b | |
actions | a(usbs) | (index, title, remote_input, placeholder) |
messages | a(sstb) | (sender, text, ts_ms, from_self) |
Files
- Config:
$XDG_CONFIG_HOME/tether/config.toml(name,discoverable,show_desktop_notifications,manual_addresses,blocked_packagesper device). - Identity:
$XDG_DATA_HOME/tether/identity.key(PKCS#8 PEM, mode 0600),identity.crt(PEM). - Trusted devices:
$XDG_DATA_HOME/tether/trusted.toml—[[device]] id, name, kind, cert_pem, paired_at. - Icon cache:
$XDG_CACHE_HOME/tether/blobs/<sha256>.png. - Logs: journald via
tracing;RUST_LOGhonoured.
Milestone 2 additions
Everything below is additive. org.tether.Device1 gains properties, methods and
signals per feature; the daemon advertises what the peer supports through the
existing Capabilities property, and clients hide UI for missing capabilities.
Dicts (a{sv}) are described after the tables. Paths returned by methods are
absolute and owned by the daemon’s cache; clients copy rather than move them.
org.tether.Daemon1 additions
Properties
| Name | Type | Access | Meaning |
|---|---|---|---|
DownloadDir | s | read/write | where received files land, default ~/Downloads/Tether |
AutoAcceptFiles | b | read/write | accept FileOffers from paired devices without asking (default true) |
ClipboardSync | s | read/write | off / to_phone / from_phone / both (default both) |
MessageNotifications | b | read/write | post a desktop notification for new incoming messages (default true) |
Signals
FileOffered(o device, s transfer_id, a(sts) files)— only whenAutoAcceptFilesis false;files=(name, size, mime).
Methods
AcceptFileOffer(o device, s transfer_id, b accept)
org.tether.Device1 — connection
Properties
| Name | Type | Meaning |
|---|---|---|
Held | b | auto-reconnect paused after a Disconnect (either side); Connect() clears it |
Method semantics change: Disconnect() now sends Disconnect{hold_seconds = 0}
and holds; Connect() clears the hold and dials.
org.tether.Device1 — messages (messages, messages.mms)
Methods
GetConversations(u limit, u offset) -> (aa{sv})— newest first;limit = 0= all.GetMessages(s thread_id, t before_ms, u limit) -> (aa{sv})— newest first,before_ms = 0= newest page.GetMessage(s message_id) -> (a{sv})SendMessage(as addresses, s body, i sub_id, as attachment_paths) -> (s request_id)— result arrives asMessageSendResult.MarkThreadRead(s thread_id)— desktop-local read state.RequestAttachment(s part_id) -> (s path)— returns the cached path if present, else""and laterAttachmentReady.RefreshMessages()— force aConversationsRequestnow.SearchMessages(s query, u limit) -> (aa{sv})
Signals
ConversationsChanged()— thread list order/snippets changed; clients re-fetch. During the initial sync this fires once per stored page instead of oneMessageAddedper historical message.MessageAdded(a{sv} message)— new or updated message (incoming or sent).MessageRemoved(s message_id)MessageSendResult(s request_id, b ok, s error, s message_id)AttachmentReady(s part_id, s path)—pathempty on failure.
Conversation dict: thread_id s, addresses as, display_name s (contact names joined, falls back to numbers), snippet s, date_ms t, unread_count u (desktop-local), message_count u, archived b, photo_path s (first contact’s photo or "").
Message dict: id s, thread_id s, addresses as, body s, date_ms t, type s (inbox|sent|draft|outbox|failed|queued), read b (desktop-local), sub_id i, mms b, subject s, attachments aa{sv} (part_id s, mime s, size t, name s, width u, height u, path s cached file or ""), sender_name s (resolved contact or ""), pending b (sent from this desktop, no result yet).
org.tether.Device1 — contacts (contacts)
Methods
GetContacts() -> (aa{sv})— all cached contacts, sorted by display name.LookupContact(s address) -> (a{sv})— by phone number (normalised comparison) or email; empty dict if none.RefreshContacts()
Signals
ContactsChanged()
Contact dict: uid s, display_name s, phones a(ss) ((type, number)), emails a(ss), photo_path s, starred b.
org.tether.Device1 — media and volume (media, volume)
Methods
GetMediaSessions() -> (aa{sv})— first entry is the active session.MediaCommand(s session_id, s action, t position_ms)—action∈play|pause|toggle|next|prev|stop|seek.GetVolumes() -> (a(suub))—(stream, level, max, muted),stream∈music|ring|call|notification|alarm.SetVolume(s stream, u level)
Signals
MediaSessionsChanged(aa{sv} sessions)VolumesChanged(a(suub) volumes)
Media session dict: id s, package s, app_name s, title s, artist s, album s, art_path s, playing b, position_ms t, position_ts_ms t, duration_ms t, can_seek b, can_next b, can_prev b, can_pause b, can_play b, playback_speed d.
The daemon additionally exports an MPRIS player per connected phone that has an
active session: bus name org.mpris.MediaPlayer2.tether_<first 8 hex of id>,
Identity = "<phone name>", DesktopEntry = "org.tether.Tether", with
PlaybackStatus, Metadata (mpris:artUrl from art_path, xesam:title,
xesam:artist, xesam:album, mpris:length), Position, Play/Pause/ PlayPause/Next/Previous/Stop/Seek/SetPosition, CanControl and the Can*
flags, and Volume mapped to the music stream.
org.tether.Device1 — status and controls (dnd, ring, connectivity, clipboard)
Properties
| Name | Type | Meaning |
|---|---|---|
DndFilter | s | all (off) / priority / alarms / none / unknown |
DndCanChange | b | phone has notification-policy access |
Sims | a(issub) | (sub_id, carrier, network_type, level_0_4, data_active) |
WifiSsid | s | "" if not on Wi-Fi |
WifiLevel | i | 0..4, -1 unknown |
AirplaneMode | b | |
Ringing | b | find-my-phone in progress |
LastClipboard | s | last text received from the phone ("" if none) |
Methods
SetDnd(s filter)RingPhone(b start)SendClipboard(s text)— called by the GTK app on every desktop clipboard change (and by the daemon’s X11 poller while the app is closed).
Signals
ClipboardReceived(s text)— the GTK app sets the desktop clipboard; when the app is not on the bus the daemon sets it itself withwl-copy/xclip(ADR-0013 amendment).ShareReceived(s text, s url, b open)
org.tether.Device1 — files (files)
Methods
SendFiles(as paths) -> (s transfer_id)CancelTransfer(s transfer_id)GetTransfers() -> (aa{sv})— active and recently finished (last 20).
Signals
TransferUpdated(a{sv} transfer)FileReceived(s path)— one per completed incoming file.
Transfer dict: transfer_id s, direction s (in|out), files aa{sv} (name s, size t, mime s, bytes_done t, path s, state s), bytes_done t, bytes_total t, state s (offered|accepted|running|done|failed|cancelled|rejected), error s, started_ms t.
org.tether.Device1 — photos (photos)
Methods
GetMediaItems(s kind, u limit, t before_ms, s album) -> (aa{sv}, b more)—kind∈all|image|video|screenshot; served from the daemon’s index, which it fills from the phone on demand (first call triggers aMediaQuery, result arrives viaMediaItemsChanged).before_msis inclusive (as on the wire, so items sharing a boundary timestamp are never skipped): when paging with the last item’sdate_ms, the next page starts with that item again and clients de-duplicate byid.RequestThumbnail(s id, u max_px) -> (s path)— cached path or""+ laterThumbnailReady.FetchMedia(s id) -> (s request_id)— downloads the original into the daemon cache;MediaFetchedcarries the path. Clients copy it where the user wants (drag-out, Save as).DeleteMedia(as ids) -> (s request_id)GetAlbums() -> (as)
Signals
MediaItemsChanged()— index refreshed; clients re-query.ThumbnailReady(s id, s path)MediaFetched(s request_id, s id, s path)—pathempty on failure.MediaDeleted(s request_id, as deleted, as failed, b needs_confirmation)
Media item dict: id s, name s, mime s, date_ms t, size t, width u, height u, duration_ms t, album s, kind s, orientation u, thumb_path s (cached or "").
Files (M2)
- Per-device cache:
$XDG_DATA_HOME/tether/devices/<id>/cache.db(SQLite: threads, messages, attachments index, contacts, media index, transfers) and$XDG_CACHE_HOME/tether/devices/<id>/{attachments,thumbs,media,contacts}/. - Received files:
DownloadDir(default~/Downloads/Tether/). - Config additions in
config.toml:download_dir,auto_accept_files,clipboard_sync,message_notifications, per-devicesync_messages,sync_contacts,sync_photos(all default true).
Milestone 4 additions (enhanced tier)
Design: ADR-0016 (adb), ADR-0017 (helper), ADR-0018 (media). Wire protocol:
docs/reference/protocol.md “Enhanced tier”.
org.tether.Daemon1
| Member | Kind | Signature | Meaning |
|---|---|---|---|
AdbState | property | s | missing (no adb binary), too_old (< 34.0.0), ready |
AdbVersion | property | s | e.g. 34.0.4, empty when missing |
StartAdbPairing() | method | → (ss) | begins Wireless debugging pairing; returns the QR payload (WIFI:T:ADB;S:…;P:…;;) and the service name. Progress in AdbPairingChanged |
PairAdbWithCode(s code) | method | fallback: pair with the 6-digit code against the pairing service the phone currently advertises | |
CancelAdbPairing() | method | ||
AdbPairingChanged(s stage, s detail) | signal | waiting (for the phone to scan or show a code), pairing, connecting, linking, done, failed (detail = reason) |
Config keys: adb_server = "private" | "shared", adb_path (empty = search
PATH), per-device adb_serial.
org.tether.Device1
| Member | Kind | Signature | Meaning |
|---|---|---|---|
EnhancedState | property | s | unavailable (adb missing or too old), not_set_up (no adb device linked), debugging_off (linked, Wireless debugging off and no USB), offline (linked, device not reachable), unauthorized, starting (helper launching), ready, error |
EnhancedDetail | property | s | human-readable reason for error, unauthorized, debugging_off |
EnhancedAbilities | property | as | ShellHello.abilities while ready |
AdbSerial | property | s | linked adb serial, empty if none |
AdbTransport | property | s | usb, wifi or empty |
CanRearmAdb | property | b | the app can switch Wireless debugging on (AdbWifiState.can_change) |
Mirrors | property | aa{sv} | running mirrors: id, kind (main/app), package, screen_off |
SetUpEnhanced() | method | link an adb device that is already connected and authorised (USB, or Wi-Fi after pairing) to this phone and start the helper | |
RestartHelper() | method | ||
EnableWirelessDebugging() | method | AdbWifiRequest{enable = true}; fails unless CanRearmAdb | |
StartMirror(a{sv} options) | method | → (sh) | mirror id and the mirror connection as a Unix fd (shell.proto MIRROR framing, first record is MirrorMeta). Options: screen_off b, stay_awake b (default true), show_touches b, max_size u, max_fps u, bitrate u, codec s (h264) |
ConfigureMirror(s id, a{sv} options) | method | screen_off b, bitrate u, max_size u, request_keyframe b | |
StopMirror(s id) | method | closing the fd has the same effect | |
MirrorEnded(s id, s reason) | signal | ||
GetGrants() | method | → a(sbs) | name, granted, detail for every grant item |
ApplyGrants(as items) | method | → a(sbs) | empty list = all |
SetScreenPower(b on) | method |
M4.2 members of org.tether.Device1:
| Member | Kind | Signature | Meaning |
|---|---|---|---|
GetApps() | method | → aa{sv} | launchable apps from the phone: package s, label s, icon s (cached PNG path, empty until fetched), system b. Needs capability apps, not adb. The daemon caches the list per device and serves the cache while the phone is away |
AppsChanged() | signal | the list or an icon path changed; call GetApps() again | |
StartMirror options | additionally app s (package: open this app in its own virtual display), width u, height u, dpi u (size of that display; defaults 1080 x 1920, dpi from the phone). screen_off is ignored for app mirrors | ||
ConfigureMirror options | additionally width u, height u (resize an app mirror’s display) | ||
Mirrors entries | kind = app and package for app mirrors; display_id u | ||
StartApp(s package) | method | launch an app on the phone’s main display | |
PhoneAudio | property | b, read/write | play the phone’s audio on this PC. Stays requested across helper restarts; capture runs while EnhancedState = ready |
PhoneAudioState | property | s | off, starting, playing, unsupported, error |
PhoneAudioDetail | property | s | reason for error/unsupported; while playing, the source in use (output, playback, playback_dup) |
Config: phone_audio_source = "auto" | "output" | "playback" | "playback_dup"
(default auto: the first the helper supports in that order), per-device
phone_audio (remembers the switch).
tether-cli: apps <id>, app <id> <package> (opens the app window in the
GTK app: tether --app <device id> <package>), phone-audio <id> [on|off].
Implementation notes (M4.2, tetherd):
- Apps.
GetAppsserves the phone’s order fromcache.db(schema v3, tableapps) and works while the phone is away. Icons are fetched eight at a time;AppsChangedfires on a new list and again as icons arrive.iconcan go empty again if the blob cache evicts the file. - App mirrors.
appneeds abilitydisplay.new. Defaults 1080 x 1920, dpi 0 (the phone derives it; the GTK app always sends 160 x its scale factor).width/height/dpiwithoutappand a resize with only one ofwidth/heightanswerInvalidArgs.Mirrors[].display_idis 0: the id is only inMirrorMeta, which the daemon does not read. Up to eight mirrors per phone; starting a package that is already streamed moves it and ends the old mirror withapp_closed. StartAppneedsapps.start; an unknown package answersInvalidArgs.- Phone audio. The setter returns at once. With the switch on and
nothing capturing, the state is
offwith a reason in the detail (“Waiting for the enhanced tier…”, “Paused while a call is in progress”). Capture stops while any call exists on the phone, ringing included.unsupported: built without theaudiofeature, noaudio.*ability, or the configured source is unavailable. After a failure the daemon retries three times, 3 s apart, then showserroruntil the switch is toggled or the helper becomes ready again. Withautothe daemon picks the source from the abilities. Pipeline:appsrc ! opusdec ! audioconvert ! audioresample ! pulsesink(40 ms buffer;pipewiresink, thenautoaudiosinkas fallbacks), stream namedTether: <phone name>. - CLI.
apps <id> [--system];appandmirrorstart thetetherbinary next totether-cliif there is one, else the one onPATH(TETHER_APPoverrides).
M4.3 members (phone as webcam, ADR-0019).
org.tether.Daemon1 (the machine’s virtual camera device):
| Member | Kind | Signature | Meaning |
|---|---|---|---|
WebcamSetupState | property | s | unsupported (built without the webcam feature or no v4l2sink), not_installed (no v4l2loopback module for the running kernel), not_loaded, no_device (module loaded, no device labelled Tether Phone Camera and no usable webcam_device), ready |
WebcamSetupDetail | property | s | human-readable reason or next step (e.g. the install command, a Secure Boot key rejection, the last set-up error) |
WebcamDevice | property | s | device node in use, e.g. /dev/video42; empty unless ready |
WebcamPersistent | property | b | the load-at-boot files written by persist exist |
WebcamOwner | property | s | device id of the phone whose Webcam switch is on, or empty |
SetUpWebcam(s action) | method | load (create the device now), persist (load and create it at every boot), remove (delete the boot files; the loaded module stays until reboot). Runs /usr/libexec/tether/tether-webcam-setup <action> through pkexec; returns when it has finished. Errors: NotSupported, InvalidArgs, Failed (detail = the script’s last line; cancelled when the polkit prompt was dismissed) | |
RefreshWebcamSetup() | method | read the state again (after the user installed the package) |
org.tether.Device1:
| Member | Kind | Signature | Meaning |
|---|---|---|---|
Webcam | property | b, read/write | use this phone’s camera as the PC’s webcam. Stays requested across helper restarts; the camera runs while EnhancedState = ready and WebcamSetupState = ready. Setting it while another phone owns the webcam fails with Failed (busy) |
WebcamState | property | s | off, starting, streaming, unsupported, error |
WebcamDetail | property | s | reason for error/unsupported, or why the switch is on but nothing is streaming (e.g. “Waiting for the enhanced tier…”, “Set up the virtual camera first”, “The camera is in use on the phone”) |
WebcamInfo | property | a{sv} | while streaming: camera s (Camera2 id), facing s (front/back/external), width u, height u, fps u (what the phone sends), out_width u, out_height u, out_fps u (the V4L2 device format), decoder s |
Cameras | property | aa{sv} | the phone’s cameras while EnhancedState = ready (cached afterwards): id s, facing s, sensor_orientation u, sizes a(uu), fps au, torch b, max_zoom d |
WebcamSettings | property | a{sv} | camera s (front, back or a Camera2 id; default back), rotation u (0, 90, 180, 270 clockwise; default 0), flip b (mirror horizontally; default false), torch b, zoom d (1.0 = none). Stored per device, except torch, which is off at every start |
ConfigureWebcam(a{sv} settings) | method | change any of the WebcamSettings keys; applies to a running webcam at once (a camera change restarts the capture, the V4L2 device stays open) |
Config: webcam_size = "1280x720" (also 640x480, 1920x1080),
webcam_fps = 30, webcam_device (empty = the loopback device labelled
Tether Phone Camera); per-device webcam, webcam_camera,
webcam_rotation, webcam_flip, webcam_zoom.
tether-cli: webcam <id> [status|on|off|cameras|camera <front|back|id>|rotate <0|90|180|270>|flip <on|off>|torch <on|off>|zoom <x>],
webcam-setup [status|load|persist|remove].
Daemon behaviour: the capture is asked for at the listed camera size closest
to the output size. The output format never changes while the daemon holds
the device; the picture is letterboxed into it. After a failure the daemon
retries three times, 3 s apart, then shows error until the switch is
toggled or the helper becomes ready again; camera_disabled is not retried.
The webcam keeps running during calls.
Implementation notes (M4.3, tetherd):
- A dismissed polkit prompt fails with the message
cancelled.persistis safe to repeat and refuses when another modprobe.d file already sets options forv4l2loopback. UnderNoNewPrivilegesthe daemon runspkexecthroughsystemd-run --user. webcam_deviceis accepted only for a virtual video device.Webcam = trueis accepted before the set-up isreadyand triggers a new detection.WebcamOwneris the first paired device with the switch on.- Three retries (four attempts); the budget resets after 30 s of streaming,
on a toggle, on a camera change and on a new helper.
camera_disabledandnot_foundare not retried. torchis reset when the switch is written, not at every capture start.rotationis applied as given; the sensor orientation is not added.Camerasis cached per device (cameras.json) and refreshed from every new helper.TETHER_WEBCAM_SETUPoverrides the script path (build tree).
The daemon starts the helper whenever a linked device is authorised and the
phone is connected over Tether, restarts it with back-off when it exits, and
turns ClipboardWatch on while clipboard sync from the phone is enabled.
All methods that need the helper fail with org.tether.Error.NotReady unless
EnhancedState = ready.
tether-cli: enhance <id> [status|setup|pair|code <code>|grants [apply]|restart|rearm],
mirror <id> [--screen-off] (opens the app’s mirror window; refuses unless
the state is ready).
Implementation notes and deviations (M4.1, tetherd)
- Errors. M4 members answer
org.tether.Error.NotReady,NotSupported(adb missing or too old, ability missing, helper answeredunsupported,EnableWirelessDebuggingwithoutCanRearmAdb),InvalidArgs(bad option type, unknown codec or mirror id, code not six digits) orFailed. AdbSerialis the phone’s hardware serial (ro.serialno), stored as per-deviceadb_serial. Wi-Fi transport serials (ip:port) change and are mapped to it through the mDNS instance name orgetprop.- Two adb servers in private mode. The private server (port
adb_server_port, default 5038) carries Wi-Fi connections only. A phone attached by USB is reached through the user’s default server and key; the daemon watches that server and starts it only onSetUpEnhanced()or when a device has anadb_serial. USB is preferred when a transport is chosen; a running helper is not moved when a cable is plugged in later. AdbPairingChangeddetails.pairing=ip:port,connecting= guid,linking= hardware serial,done= the Tether device id that was linked,failed= reason (cancelledafterCancelAdbPairing).PairAdbWithCodereturns at once, starts a session if none runs and waits up to 20 s for the phone to advertise a pairing service. A session times out after 5 minutes;StartAdbPairingreplaces a running one.SetUpEnhancedneeds the phone connected over Tether, waits up to 10 s forAdbLink, and only refreshes when the linked serial is already authorised.EnhancedState.offlinealso covers “adb is fine but the phone is not connected over Tether”;erroralso covers USBno permissionsand stays shown while a failed helper start is retried;unauthorizedis also set whenadb connectfails to authenticate.- Helper. Hello timeout 20 s, request timeout 15 s, restart back-off 1 s
to 60 s (reset after 30 s of
ready). Its stderr is logged at debug level. StartMirrorhands the fd over in blocking mode;screen_offis dropped when the helper lacksmirror.screen_off. One mirror per phone in M4.1 (busy→Failed).StopMirroremitsMirrorEnded(id, "stopped")at once; a helper that goes away ends its mirrors withhelper_exited.- Re-arm. After
ApplyGrantsgrantswrite_secure_settingsthe daemon asks the app to report again, soCanRearmAdbupdates. An automaticEnableWirelessDebuggingis tried exactly once per Tether session when the state isdebugging_off. One UI switches the setting straight back off when the current Wi-Fi network was not allowed for Wireless debugging by the user (“Always allow on this network”), so the re-arm only works on such networks. - Connect port. Wireless debugging keeps its mDNS instance name and
changes its port on every toggle, which a browse does not report. The
daemon resolves the instance again before every
adb connect, and retries for 20 s after pairing. - Clipboard.
ShellClipboardequal to the last text sent to the phone or toLastClipboardis dropped as an echo. - The daemon always announces
enhance, also without adb.
Milestone 3 additions (calls)
org.tether.Device1 — calls (calls, calls.dial, calllog, bluetooth)
Properties
| Name | Type | Meaning |
|---|---|---|
Calls | aa{sv} | current calls (call dict below); empty when idle |
CanControlCalls | b | phone can answer/reject/hang up |
CanDial | b | phone can place calls |
BtAddress | s | the phone’s BlueZ address if known ("" otherwise) |
BtState | s | unavailable (no adapter/BlueZ), off (adapter powered off or rfkill), unpaired, paired (bonded, HFP not connected), connected (HFP connected, PC is hands-free) |
CallAudio | s | where call audio currently plays: phone, pc, none |
MissedCalls | u | unseen missed calls (desktop-local) |
Methods
AnswerCall(s call_id),RejectCall(s call_id),HangUpCall(s call_id),SilenceCall(s call_id)Dial(s number, i sub_id) -> (s request_id)SetCallMuted(s call_id, b muted)SetCallAudio(s call_id, s target)—target∈pc|phone|speaker;pcasks the phone to route to this PC over Bluetooth;phoneandspeakerroute back to the phone (see “SetCallAudio” below).GetCallLog(t before_ms, u limit) -> (aa{sv})— newest first;before_ms = 0= newest.MarkCallsSeen()— clearsMissedCalls.PairBluetooth()— starts the guided Bluetooth pairing (power on adapter if allowed, discover the phone, pair, trust, connect HFP). Progress viaBtStateandBluetoothPairing.ConnectBluetooth()/DisconnectBluetooth()
Signals
CallStateChanged(aa{sv} calls)— also reflected inCallsvia PropertiesChanged.CallCommandFailed(s request_id, s error)IncomingCall(a{sv} call)— emitted once per ringing call (the GTK app shows its banner).CallLogChanged()BluetoothPairing(s stage, s detail)—stage∈powering|discovering|pairing|confirm|connecting|done|failed; atconfirm,detailis the 6-digit passkey to compare.
Call dict: id s, number s, display_name s, photo_path s, status s (ringing|dialing|active|holding|ended), direction s (incoming|outgoing), start_ms t, connected_ms t, sub_id i, muted b, route s (phone|speaker|bluetooth), audio_on_pc b.
Call log dict: id s, number s, name s (contact name, falls back to the log’s cached name), photo_path s, type s (incoming|outgoing|missed|rejected|blocked|voicemail), date_ms t, duration_s u, sub_id i, new b.
Daemon behaviour during calls
- On
IncomingCallthe daemon posts a freedesktop notification with Answer and Decline actions (urgency critical, categorycall.incoming) and plays the ringtone (/usr/share/sounds/freedesktop/stereo/phone-incoming-call.ogathrough PipeWire) unless the phone is silenced or a desktop DND is active; both stop when the call leavesringing. - MPRIS players on the desktop (other than Tether’s own) are paused on
ringingand resumed when all calls ended, if they were playing before. - Call audio on the PC plays on the default sink and records from the default source (see “Call audio” below); the defaults are not changed.
- Missed calls post a notification (“Missed call from …”) with Call back.
Daemon properties
| Name | Type | Access | Meaning |
|---|---|---|---|
CallAudioOnPc | b | read/write | route call audio to the PC automatically on answer (default true when BtState = connected) |
CallRingtone | b | read/write | play a ringtone on the PC for incoming calls (default true) |
PauseMediaOnCall | b | read/write | pause desktop MPRIS players while ringing/in call (default true) |
Implementation notes and deviations (M3, tetherd)
These describe how the daemon implements the contract above; where they differ from the text above, this section wins.
- Empty
call_id.AnswerCall,RejectCall,SilenceCallwith""act on the ringing call;HangUpCall,SetCallMuted,SetCallAudioon the first non-ringing call. With no matching call the method fails (no call in progress). - Command results. Every call method sends a
CallCommandwith a fresh request id (onlyDialreturns it). ACallCommandResult{ok = false}, no result within 15 s, or a disconnect emitsCallCommandFailed(request_id, error). A failure of an action taken on a desktop notification (Answer / Decline / Call back) is reported with an emptyrequest_id. CallStateChangedvsCalls. The signal carries the phone’s list as sent, so a call that ended appears once withstatus = "ended". TheCallsproperty never contains ended calls (empty when idle).GetCallLog(before_ms, …).before_msis exclusive here, likeGetMessages: page with the last row’sdate_ms. The wire-levelCallLogRequest.before_msstays inclusive, and the daemon de-duplicates by id.MissedCallscounts cached log entries withtype = missed, the phone’snewflag set anddate_msafter the desktop’s seen mark.MarkCallsSeen()moves the mark to max(now, newest entry). It never changes the phone’s call log.- Call audio. The phone decides where a call’s audio goes by opening or
closing the Bluetooth SCO link to this PC. PipeWire creates the phone’s HFP
nodes only while that link is up, as streams (
Stream/Output/Audiofor the caller,Stream/Input/Audiofor our microphone,media.role = Communication), and WirePlumber links them to the default sink/source.CallAudio = pcmeans those nodes exist; the daemon checks once a second while a call is live, so the property also follows a switch made on the phone. 2.5 s after the nodes appear the daemon adds any link that is still missing between them and the default sink/source (pw-link, port by port) and never touches a direction the session manager linked elsewhere (for example to a headset). It does not change the default sink/source. If the phone’s card is not on a call profile (audio-gateway, fallbackheadset-head-unit) the daemon selects it and restores the previous one when the calls end.CallAudio = phonewhile a call exists without the nodes,nonewithout a call. - Echo cancellation. When the call uses the default sink and source (the
PC’s speakers and microphone, not a headset), the daemon runs PipeWire’s
module-echo-cancel(WebRTC, monitor mode) in a childpipewire -cprocess for the duration of the calls. It records the default source, uses the default sink’s monitor as reference and offers the sourcetether_call_mic; the phone’s HFP microphone node is pointed at it (pw-metadata … target.object). The caller’s voice keeps playing on the default sink. Otherwise the caller hears their own voice and the phone’s echo suppressor cuts the PC side. Config keycall_echo_cancel(default true). SetCallAudio. SendsROUTEto the phone.pcalso needsBtState = connected; withCallAudioOnPcthe daemon sendsROUTE bluetoothonce per call by itself when the phone did not pick the PC. If the phone refuses (route_unsupported: its in-call service is not bound, see docs/contributing/checklists/milestone-3.md),phoneis still carried out from the PC by closing the SCO link (the phone card is switched off for a moment, then back), whilespeakerandpcfail withCallCommandFailedand a readable reason: the PC cannot open the SCO link itself.BtState.unavailable: no system bus, noorg.bluezor no adapter.off: adapter not powered, whatever the reason (rfkill included).connected: the matched BlueZ device is bonded and connected, and the phone reportshfp_connected(when it sendsBtIdentity). The phone is matched by the remembered address (per-devicebt_addressinconfig.toml, saved once bonded), then byName/Aliasequal to the phone’sBtIdentity.nameor Tether name, preferring bonded devices.bluetoothis announced inHelloonly whenorg.bluezowns or can activate its name at daemon start.PairBluetooth. Runs in the background, one pairing at a time. Stagespowering(only when the adapter is off; if BlueZ refuses,failed“Bluetooth is blocked (rfkill)”; the daemon never touches rfkill),discovering(skipped when the phone is already bonded; up to 60 s, afterBtRequest{PAIR}),pairing(detail = address; anorg.bluez.Agent1withDisplayYesNois registered at/org/tether/BluezAgentfor this pairing only),confirm(6-digit passkey, auto-accepted on the PC for the matched phone only; the user confirms on the phone),connecting(Trusted = true,Device1.Connect(), thenBtRequest{CONNECT}),done(detail = address),failed(detail = reason). It fails at once without BlueZ.- Notifications. The incoming-call notification is keyed per call
(
call:<id>, replaces itself) with hintsurgency = 2,category = call.incoming,resident,suppress-sound, and is closed when the call leavesringing. Missed calls (incoming, ringing → ended without becoming active, not declined from this desktop) getcategory = call.unansweredand a Call back action when the number is known. Both honourShowDesktopNotifications. Whilecallsis active, mirrored phone notifications withcategory = "call"(the dialer’s own) are not posted, but theNotificationPostedsignal is still emitted. Desktop DND is not consulted for the ringtone yet. - Ringtone and media. One ringtone for the whole desktop:
pw-play(elsepaplay) loops the sound file while any phone has a ringing call that was not silenced (SilenceCallsilences the PC too). It is skipped when neither binary nor the file exists. MPRIS players other thanorg.mpris.MediaPlayer2.tether_*that arePlayingare paused while any call exists (ringing included), and resumed afterwards only if they are stillPaused. - Files.
cache.dbschema v2 addscall_log(id, number, name, type, date_ms, duration_s, sub_id, is_new).config.tomlgainscall_audio_on_pc,call_echo_cancel,call_ringtone,pause_media_on_call(all default true) and per-devicebt_address.