pyremoteplay.ddp module

Device Discovery Protocol for RP Hosts.

This module contains lower-level functions which don’t need to be called directly.

pyremoteplay.ddp.get_host_type(response)

Return host type.

Parameters

response (dict) – Response dict from host

Return type

str

pyremoteplay.ddp.get_ddp_message(msg_type, data=None)

Get DDP message.

Parameters
  • msg_type (str) – Message Type

  • data (Optional[dict]) – Extra data to add

pyremoteplay.ddp.parse_ddp_response(response, remote_address)

Parse the response.

Parameters
  • response (Union[str, bytes]) – Raw response from host

  • remote_address (str) – Remote address of host

pyremoteplay.ddp.get_ddp_search_message()

Get DDP search message.

Return type

str

pyremoteplay.ddp.get_ddp_wake_message(credential)

Get DDP wake message.

Parameters

credential (str) – User Credential from User Profile

Return type

str

pyremoteplay.ddp.get_ddp_launch_message(credential)

Get DDP launch message.

Parameters

credential (str) – User Credential from User Profile

Return type

str

pyremoteplay.ddp.get_socket(local_address='0.0.0.0', local_port=9303)

Return DDP socket.

Parameters
  • local_address (Optional[str]) – Local address to use

  • local_port (Optional[int]) – Local port to use

Return type

socket

pyremoteplay.ddp.get_sockets(local_port=0, directed=None)

Return list of sockets needed.

Parameters
  • local_port – Local port to use

  • directed – If True will use directed broadcast with all local interfaces.

pyremoteplay.ddp.search(host='255.255.255.255', local_port=9303, host_type='', sock=None, timeout=3, directed=None)

Return list of statuses for discovered devices.

Parameters
  • host – Remote host to send message to. Defaults to 255.255.255.255.

  • local_port – Local port to use. Defaults to any.

  • host_type – Host type. Specific host type to search for.

  • sock – Socket. Socket will not be closed if specified.

  • timeout – Timeout in seconds.

  • directed – If True will use directed broadcast with all local interfaces. Sock will be ignored.

pyremoteplay.ddp.get_status(host, local_port=9303, host_type='', sock=None)

Return host status dict.

Parameters
  • host (str) – Host address

  • local_port (int) – Local port to use

  • host_type (str) – Host type to use

  • sock (Optional[socket]) – Socket to use

Return type

dict

pyremoteplay.ddp.wakeup(host, credential, local_port=9303, host_type='PS4', sock=None)

Wakeup Host.

Parameters
  • host (str) – Host address

  • credential (str) – User Credential from User Profile

  • local_port (int) – Local port to use

  • host_type (str) – Host type to use

  • sock (Optional[socket]) – Socket to use

pyremoteplay.ddp.launch(host, credential, local_port=9303, host_type='PS4', sock=None)

Send Launch message.

Parameters
  • host (str) – Host address

  • credential (str) – User Credential from User Profile

  • local_port (int) – Local port to use

  • host_type (str) – Host type to use

  • sock (Optional[socket]) – Socket to use

async pyremoteplay.ddp.async_get_socket(local_address='0.0.0.0', local_port=0)

Return async socket.

Parameters
  • local_address (str) – Local address to use

  • local_port (int) – Local port to use

Return type

AsyncUDPSocket

async pyremoteplay.ddp.async_get_sockets(local_port=0, directed=False)

Return list of sockets needed.

Parameters
  • local_port – Local port to use

  • directed – If True will use directed broadcast with all local interfaces.

pyremoteplay.ddp.async_send_msg(sock, host, msg, host_type='', directed=False)

Send a ddp message using async socket.

Parameters
  • sock (AsyncUDPSocket) – Socket to use.

  • host (str) – Remote host to send message to.

  • msg (str) – Message to send.

  • host_type (str) – Host type.

  • directed (bool) – If True will use directed broadcast with all local interfaces

Return list of statuses for discovered devices.

Parameters
  • host – Remote host to send message to. Defaults to 255.255.255.255.

  • local_port – Local port to use. Defaults to any.

  • host_type – Host type. Specific host type to search for.

  • sock – Socket. Socket will not be closed if specified.

  • timeout – Timeout in seconds.

  • directed – If True will use directed broadcast with all local interfaces. Sock will be ignored.

async pyremoteplay.ddp.async_get_status(host, local_port=9303, host_type='', sock=None)

Return host status dict. Async.

Parameters
  • host (str) – Host address

  • local_port (int) – Local port to use

  • host_type (str) – Host type to use

  • sock (Optional[AsyncUDPSocket]) – Socket to use

Return type

dict