Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bobmcwhirter/fc835a71d02d80b6ff5663333a5a3067 to your computer and use it in GitHub Desktop.
Save bobmcwhirter/fc835a71d02d80b6ff5663333a5a3067 to your computer and use it in GitHub Desktop.
impl<'a,N:'static> ESP8266TcpSocket<'a, N>
where
N: ArrayLength<u8>,
{
fn new(id: u8) -> Self
{
let outbound = BBBuffer::new();
let (out_p, out_c) = outbound.try_split().unwrap();
let inbound = BBBuffer::new();
let (in_p, in_c) = inbound.try_split().unwrap();
ESP8266TcpSocket {
id: id,
outbound_producer: out_p,
outbound_consumer: out_c,
inbound_producer: in_p,
inbound_consumer: in_c,
is_connected: false,
is_open: false,
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment