Skip to content

UDP Client using socket #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 26, 2021
Merged
Changes from 5 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
9 changes: 6 additions & 3 deletions adafruit_esp32spi/adafruit_esp32spi_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ def connect(self, address, conntype=None):
raise RuntimeError("Failed to connect to host", host)
self._buffer = b""

def send(self, data): # pylint: disable=no-self-use
"""Send some data to the socket"""
_the_interface.socket_write(self._socknum, data)
def send(self, data, conntype=None): # pylint: disable=no-self-use
"""Send some data to the socket. 'conntype' is an extra that may
indicate UDP or not, depending on the underlying interface"""
if conntype is None:
conntype = _the_interface.TCP_MODE
_the_interface.socket_write(self._socknum, data, conn_mode=conntype)
gc.collect()

def write(self, data):
Expand Down