UDP Receiver

class gpype.backend.sources.udp_receiver.UDPReceiver[source]

Bases: EventSource

UDP network receiver for capturing remote trigger events.

Provides network-based event capture. Listens on specified IP/port for UDP packets containing numeric trigger values. Each trigger outputs the received value, followed immediately by a zero.

DEFAULT_IP = '127.0.0.1'

Default IP address for localhost binding

DEFAULT_PORT = 1000

Default UDP port number for listening

HOLD_TIME_MS = 10

Hold time in milliseconds before sending reset trigger

class Configuration[source]

Bases: Configuration

Configuration class for UDP receiver network parameters.

class Keys[source]

Bases: Keys

Configuration key constants for the UDP receiver.

IP = 'ip'

Configuration key for IP address binding

PORT = 'port'

Configuration key for UDP port number

__init__(ip='127.0.0.1', port=1000, **kwargs)[source]

Initialize UDP receiver.

Parameters:
  • ip (str) – IP address to bind socket to. Use “0.0.0.0” for all interfaces or “127.0.0.1” for localhost. Defaults to localhost.

  • port (int) – UDP port number to listen on. Defaults to 1000.

  • **kwargs – Additional parameters for EventSource base class.

start()[source]

Start UDP receiver and begin listening for messages.

Initializes background UDP listener thread and starts monitoring for incoming trigger messages.

stop()[source]

Stop UDP receiver and cleanup network resources.

Stops background listener thread, closes UDP socket, and waits for clean thread termination.