Added TODOs for safer sending

This commit is contained in:
Jonah Dahlquist 2020-11-07 23:56:50 -08:00
commit b1e83e3d05

View file

@ -18,6 +18,7 @@ impl<SpiBus: ActiveBus, NetworkImpl: Network, SocketImpl: Socket>
host: IpAddress, host: IpAddress,
port: u16, port: u16,
) -> Result<Self, SpiBus::Error> { ) -> Result<Self, SpiBus::Error> {
// TODO set interrupt mask to SendOk&Timeout
udp_socket udp_socket
.socket .socket
.set_destination_ip(&mut udp_socket.w5500.bus, host)?; .set_destination_ip(&mut udp_socket.w5500.bus, host)?;
@ -52,6 +53,8 @@ impl<SpiBus: ActiveBus, NetworkImpl: Network, SocketImpl: Socket>
.socket .socket
.command(&mut self.udp_socket.w5500.bus, socketn::Command::Send)?; .command(&mut self.udp_socket.w5500.bus, socketn::Command::Send)?;
loop { loop {
// TODO wait until TX pointers match first
// TODO check for Timeout interrupt
// wait until send is complete // wait until send is complete
if self if self
.udp_socket .udp_socket