Skip to content

Commit

Permalink
May 16, 2024, 11:12 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
frohro committed May 16, 2024
1 parent ddc52c7 commit a905216
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Quisk_Files/quisk_conf_sdr-trx_UDP_16bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def establish_connection(self):
print("isConnected is: ", self.isConnected)
# Check if a connection is established
# Wait for data to arrive and set PICO_UDP_IP to the sender's IP
self.data_sock.settimeout(1) # Set a timeout of 1 second

while self.PICO_UDP_IP is None:
try:
print("Sending broadcast message...")
Expand All @@ -202,7 +204,7 @@ def establish_connection(self):
print("PICO_UDP_IP set to:", self.PICO_UDP_IP)
# if data == self.broadcast_message:
self.isConnected = True
except socket.error:
except (socket.error, socket.timeout):
if self.PICO_UDP_IP is not None:
break # Exit the loop if self.PICO_UDP_IP is not None
pass # No data available yet
Expand Down

0 comments on commit a905216

Please sign in to comment.