#![allow(clippy::uninlined_format_args)]
#![no_std]
#[cfg(feature = "std")]
extern crate std;
#[cfg(all(feature = "defmt", feature = "log"))]
compile_error!("Features 'defmt' and 'log' are mutually exclusive. Enable only one for logging.");
#[cfg(not(any(feature = "defmt", feature = "log")))]
compile_error!("Must enable either 'defmt' or 'log' feature for logging support.");
#[cfg(feature = "defmt")]
pub(crate) use defmt::{debug, error, info, trace, warn};
#[cfg(feature = "log")]
pub(crate) use log::{debug, error, info, trace, warn};
mod client;
mod errors;
mod manager;
mod readwrite;
mod socket;
mod stack;
mod transfer;
pub use errors::CommError;
pub use transfer::Xfer as Transfer;
pub use client::PingResult;
pub use client::StackError;
pub use client::WincClient;
pub use manager::AuthType;
pub use manager::ConnectionInfo;
pub use manager::FirmwareInfo;
pub use manager::{
AccessPoint, Credentials, HostName, S8Password, S8Username, SocketOptions, Ssid, UdpSockOpts,
WifiChannel, WpaKey,
};
#[cfg(feature = "wep")]
pub use manager::{WepKey, WepKeyIndex};
#[cfg(feature = "ssl")]
pub use manager::{SslCertExpiryOpt, SslCipherSuite, SslSockConfig};
pub use manager::ScanResult;
pub use client::Handle;
#[cfg(feature = "async")]
mod async_client;
#[cfg(feature = "async")]
pub use async_client::AsyncClient;
pub(crate) struct HexWrap<'a> {
v: &'a [u8],
}
impl HexWrap<'_> {
pub fn new(v: &[u8]) -> HexWrap<'_> {
HexWrap { v }
}
}
impl core::fmt::LowerHex for HexWrap<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
for elem in self.v {
write!(f, " {:02x}", elem)?;
}
Ok(())
}
}
#[cfg(feature = "defmt")]
impl<'a> defmt::Format for HexWrap<'a> {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, " bytes: {=[u8]:#x}", self.v)
}
}
mod nonstd;
use nonstd::Ipv4AddrFormatWrapper;
mod net_ops;