client

package
v1.12.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package client implements the local IPC client for kcdctl.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	SocketPath string
	Timeout    time.Duration
}

Client connects to the kcd daemon via Unix socket.

func (*Client) Battery

func (c *Client) Battery(deviceID string) (int, bool, error)

Battery queries the daemon for a device's battery state.

func (*Client) BroadcastStart added in v1.10.0

func (c *Client) BroadcastStart() error

BroadcastStart asks the daemon to begin UDP/mDNS broadcasting.

func (*Client) BroadcastStop added in v1.10.0

func (c *Client) BroadcastStop() error

BroadcastStop asks the daemon to stop UDP/mDNS broadcasting.

func (*Client) Call

func (c *Client) Call(cmd string, payload interface{}) (*ipc.Response, error)

Call dialed the daemon, sends a request, and returns the response.

func (*Client) CallMute

func (c *Client) CallMute(deviceID string) error

CallMute requests the daemon to mute an incoming call on the remote device.

func (*Client) ClipboardPush

func (c *Client) ClipboardPush(deviceID string) error

ClipboardPush triggers an outgoing clipboard sync from desktop to device.

func (*Client) Connect added in v1.0.1

func (c *Client) Connect(ip string) error

Connect requests the daemon to manually connect to a device by IP.

func (*Client) Devices

func (c *Client) Devices() ([]device.DeviceInfo, error)

Devices queries the daemon for all known devices.

func (*Client) FindMyPhone

func (c *Client) FindMyPhone(deviceID string) error

FindMyPhone requests the remote device to ring loudly.

func (*Client) Lock

func (c *Client) Lock(deviceID string) error

Lock requests the daemon to lock the session.

func (*Client) MprisAction added in v1.11.0

func (c *Client) MprisAction(deviceID, player, action string) error

MprisAction sends a media control action to a remote device. deviceID may be empty to auto-select the first connected device.

func (*Client) MprisRemote added in v1.11.0

func (c *Client) MprisRemote() (*ipc.MprisRemoteResponse, error)

MprisRemote returns the list of remote MPRIS players with their current state.

func (*Client) MprisSeek added in v1.11.0

func (c *Client) MprisSeek(deviceID, player string, seek int64) error

MprisSeek sends a seek command to a remote device's player.

func (*Client) MprisStatus added in v1.10.0

func (c *Client) MprisStatus() (*ipc.MprisStatusResponse, error)

MprisStatus returns MPRIS plugin debug information.

func (*Client) MprisVolume added in v1.11.0

func (c *Client) MprisVolume(deviceID, player string, volume int) error

MprisVolume sends a volume change to a remote device's player.

func (*Client) NotifyReply

func (c *Client) NotifyReply(deviceID, replyID, message string) error

NotifyReply requests the daemon to send a reply to an Android notification.

func (*Client) Pair

func (c *Client) Pair(deviceID string) error

Pair requests the daemon to pair with a specific device.

func (*Client) PairListen added in v1.10.0

func (c *Client) PairListen() (*ipc.PairListenResult, error)

PairListen enters listen mode: waits for an incoming pair request, auto-accepts it, and returns the paired device info. Blocks up to 60 seconds.

func (*Client) Ping

func (c *Client) Ping(deviceID string) error

Ping sends a ping packet to a specific device.

func (*Client) RunExec

func (c *Client) RunExec(deviceID string, key string) error

RunExec requests the remote device to execute a specific command key.

func (*Client) RunList

func (c *Client) RunList(deviceID string) error

RunList requests the remote device to send its command list.

func (*Client) SendSMS

func (c *Client) SendSMS(deviceID, phoneNumber, message string) error

SendSMS requests the remote device to send an SMS.

func (*Client) SftpInfo added in v1.10.0

func (c *Client) SftpInfo(deviceID string) (*ipc.SftpInfoResponse, error)

SftpInfo returns the cached SFTP connection details for a device.

func (*Client) SftpMount

func (c *Client) SftpMount(deviceID string) error

SftpMount requests the daemon to initiate an SFTP connection to the remote device.

func (*Client) SftpMountLocal

func (c *Client) SftpMountLocal(deviceID string) (string, error)

SftpMountLocal requests the daemon to request SFTP credentials from the phone, wait for the response, mount via sshfs, and open the result in the default file manager. Returns the local browse path on success.

func (*Client) SftpUnmount added in v1.0.5

func (c *Client) SftpUnmount(deviceID string) error

SftpUnmount cleanly unmounts a previously mounted phone filesystem.

func (*Client) SftpVolumes added in v1.10.0

func (c *Client) SftpVolumes(deviceID string) ([]ipc.StorageVolumeResponse, error)

SftpVolumes returns the list of available storage volumes from a device.

func (*Client) ShareFile

func (c *Client) ShareFile(deviceID string, filePath string) error

ShareFile requests the daemon to send a local file to the remote device.

func (*Client) SmsRequestAttachment added in v1.11.0

func (c *Client) SmsRequestAttachment(deviceID string, partID int64, uniqueIdentifier string) error

SmsRequestAttachment asks a device to send an MMS attachment file.

func (*Client) SmsRequestConversation added in v1.11.0

func (c *Client) SmsRequestConversation(deviceID string, threadID int64) error

SmsRequestConversation asks a device to send messages from a specific thread.

func (*Client) SmsRequestConversations added in v1.11.0

func (c *Client) SmsRequestConversations(deviceID string) error

SmsRequestConversations asks a device to send a list of all SMS conversations.

func (*Client) Status added in v1.0.5

func (c *Client) Status() (*ipc.StatusResponse, error)

Status returns runtime status information from the daemon.

func (*Client) Unlock

func (c *Client) Unlock(deviceID string) error

Unlock requests the daemon to unlock the session.

func (*Client) Unpair

func (c *Client) Unpair(deviceID string) error

Unpair requests the daemon to unpair and forget a specific device.

func (*Client) Watch

func (c *Client) Watch(ctx context.Context, filter []string, ch chan<- events.Event) error

WatchFile subscribes to daemon events and streams them to the given channel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL