Skip to content

Commit

Permalink
comms_manager cleanup:
Browse files Browse the repository at this point in the history
 * Add classdoc
 * Skip network interfaces that don't have netmasks
  • Loading branch information
Tariq Abusheikh committed Dec 7, 2019
1 parent 3598042 commit 389b5f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion comms_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


class CommsManager:
""" Handles all communication with the Tello drones. """

#
# CLASS INIT & SETUP
Expand Down Expand Up @@ -197,7 +198,11 @@ def _get_subnets():
# Get IPv4 info
ip_info = addrs[socket.AF_INET][0]
address = ip_info['addr']
netmask = ip_info['netmask']
# Get the netmask, and skip network interfaces that don't have one
if 'netmask' in ip_info:
netmask = ip_info['netmask']
else:
continue

# Avoid searching when on very large subnets
if netmask != '255.255.255.0':
Expand Down

0 comments on commit 389b5f7

Please sign in to comment.