Skip to content

Commit

Permalink
Increases UDP max packet size to max.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcr3dr authored and LorenzMeier committed Dec 11, 2015
1 parent c0f1850 commit c89b121
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pymavlink/mavutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
from math import *
from .mavextra import *

# maximum packet length for a single receive call - use the UDP limit
UDP_MAX_PACKET_LEN = 65535

'''
Support having a $HOME/.pymavlink/mavextra.py for extra graphing functions
'''
Expand Down Expand Up @@ -817,7 +820,7 @@ def close(self):

def recv(self,n=None):
try:
data, self.last_address = self.port.recvfrom(300)
data, self.last_address = self.port.recvfrom(UDP_MAX_PACKET_LEN)
except socket.error as e:
if e.errno in [ errno.EAGAIN, errno.EWOULDBLOCK, errno.ECONNREFUSED ]:
return ""
Expand Down

0 comments on commit c89b121

Please sign in to comment.