Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dlt/dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ def __init__(self, **kwords):
raise RuntimeError("Could not initialize servIP for DLTClient")

if ip.ip_address(serv_ip.decode("utf8")).is_multicast:
logger.info("Initializing DLTClient using UDP")
self.is_udp_multicast = True
if "hostIP" in kwords:
host_ip = kwords.pop("hostIP")
Expand All @@ -892,7 +893,7 @@ def __init__(self, **kwords):

set_mode_state = dltlib.dlt_client_set_mode(ctypes.byref(self),
DLT_CLIENT_MODE_UDP_MULTICAST)

logger.info("DLTClient using UDP set mode state: %s", set_mode_state)
if set_mode_state == DLT_RETURN_ERROR:
raise RuntimeError("Could not initialize socket mode for DLTClient")

Expand Down Expand Up @@ -927,6 +928,7 @@ def connect(self, timeout=None):
connected = None
error_count = 0
if not self.is_udp_multicast:
logger.info("Connecting DLTClient using TCP Connection")
if timeout:
end_time = time.time() + timeout
while time.time() < end_time:
Expand Down Expand Up @@ -960,8 +962,10 @@ def connect(self, timeout=None):
logger.debug("Surpressed %d messages for failed connection attempts", error_count - MAX_LOG_IN_ROW)

else:
logger.info("Connecting DLTClient using UDP Connection")
connected = dltlib.dlt_client_connect(ctypes.byref(self), self.verbose)

logger.info("DLT Connection return: %s", connected)
return connected == DLT_RETURN_OK

def disconnect(self):
Expand Down