Struct maia_httpd::httpd::Server
source · pub struct Server { /* private fields */ }
Expand description
HTTP server.
This HTTP server is the core of the functionality of maia-httpd. Most operations are performed as response to an HTTP request handled by this server.
Implementations§
source§impl Server
impl Server
sourcepub async fn new(
address: &SocketAddr,
ad9361: Arc<Mutex<Ad9361>>,
ip_core: Arc<Mutex<IpCore>>,
spectrometer_config: SpectrometerConfig,
waiter_recorder: InterruptWaiter,
waterfall_sender: Sender<Bytes>
) -> Result<Server>
pub async fn new( address: &SocketAddr, ad9361: Arc<Mutex<Ad9361>>, ip_core: Arc<Mutex<IpCore>>, spectrometer_config: SpectrometerConfig, waiter_recorder: InterruptWaiter, waterfall_sender: Sender<Bytes> ) -> Result<Server>
Creates a new HTTP server.
The address
parameter gives the address in which the server will
listen. The ad9361
and ip_core
parameters give the server shared
access to the AD9361 device and the Maia SDR FPGA IP core. The
spectrometer_samp_rate
parameter gives shared access to update the
sample rate of the spectrometer. The waiter_recorder
is the interrupt
waiter for the IQ recorder, which is contolled by the HTTP server. The
waterfall_sender
is used to obtain waterfall channel receivers for the
websocket server.
After calling this function, the server needs to be run by calling
Server::run
.