@@ -8,7 +8,7 @@ use embassy_net::{MulticastError, Stack};
8
8
9
9
use embedded_io_async:: { ErrorKind , ErrorType } ;
10
10
11
- use crate :: { to_net_socket, Pool } ;
11
+ use crate :: { to_emb_bind_socket , to_emb_socket , to_net_socket, Pool } ;
12
12
13
13
/// A struct that implements the `UdpBind` factory trait from `edge-nal`
14
14
/// Capable of managing up to N concurrent connections with TX and RX buffers according to TX_SZ and RX_SZ, and packet metadata according to `M`.
@@ -49,7 +49,7 @@ impl<const N: usize, const TX_SZ: usize, const RX_SZ: usize, const M: usize> Udp
49
49
async fn bind ( & self , local : SocketAddr ) -> Result < Self :: Socket < ' _ > , Self :: Error > {
50
50
let mut socket = UdpSocket :: new ( self . stack , self . buffers ) ?;
51
51
52
- socket. socket . bind ( local) ?;
52
+ socket. socket . bind ( to_emb_bind_socket ( local) ) ?;
53
53
54
54
Ok ( socket)
55
55
}
@@ -125,7 +125,7 @@ impl<const N: usize, const TX_SZ: usize, const RX_SZ: usize, const M: usize> Udp
125
125
for UdpSocket < ' _ , N , TX_SZ , RX_SZ , M >
126
126
{
127
127
async fn send ( & mut self , remote : SocketAddr , data : & [ u8 ] ) -> Result < ( ) , Self :: Error > {
128
- self . socket . send_to ( data, remote) . await ?;
128
+ self . socket . send_to ( data, to_emb_socket ( remote) ) . await ?;
129
129
130
130
Ok ( ( ) )
131
131
}
0 commit comments