Skip to content

Connection

This module provides classes for handling connections to serial and socket devices.

FUNCTION DESCRIPTION
get_addresses

Get the appropriate addresses for current machine

get_host

Get the host IP address for current machine

get_node

Get the unique identifier for current machine

get_node_linux

Get the unique identifier for Linux machine

get_node_macos

Get the unique identifier for macOS machine

get_node_windows

Get the unique identifier for Windows machine

get_ports

Get available serial ports connected to current machine

match_current_ip_address

Match the current IP address of the machine

Documentation last updated: 2025-06-11

get_addresses

get_addresses(
    registry: dict | None, mac_address: bool = True
) -> dict | None

Get the appropriate addresses for current machine

PARAMETER DESCRIPTION
registry

dictionary with serial port addresses and camera ids

TYPE: dict | None

mac_address

whether to use MAC address for node id, defaults to True

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
dict | None

dict|None: dictionary of serial port addresses and camera ids for current machine, if available

get_host

get_host() -> str

Get the host IP address for current machine

RETURNS DESCRIPTION
str

machine host IP address

TYPE: str

get_node

get_node(mac_address: bool = True) -> str

Get the unique identifier for current machine

PARAMETER DESCRIPTION
mac_address

whether to use MAC address for node id, defaults to True

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
str

machine unique identifier

TYPE: str

get_node_linux

get_node_linux() -> str

Get the unique identifier for Linux machine

RETURNS DESCRIPTION
str

machine unique identifier

TYPE: str

get_node_macos

get_node_macos() -> str

Get the unique identifier for macOS machine

RETURNS DESCRIPTION
str

machine unique identifier

TYPE: str

get_node_windows

get_node_windows() -> str

Get the unique identifier for Windows machine

RETURNS DESCRIPTION
str

machine unique identifier

TYPE: str

get_ports

get_ports() -> list[str]

Get available serial ports connected to current machine

RETURNS DESCRIPTION
list[str]

list[str]: list of connected serial ports

match_current_ip_address

match_current_ip_address(ip_address: str) -> bool

Match the current IP address of the machine

PARAMETER DESCRIPTION
ip_address

IP address to match against the current machine's IP addresses

TYPE: str

RETURNS DESCRIPTION
bool

whether the IP address matches the current machine

TYPE: bool