pub async fn start_and_serve<D: DeviceOps + 'static>(
    init_completer: impl FnOnce(Result<(), Status>) + 'static,
    device: D,
    buffer_provider: CBufferProvider
) -> Result<(), Status>
Expand description

Run the bridged wlansoftmac driver composed of the following servers:

  • WlanSoftmacIfcBridge server
  • MLME server
  • SME server

The WlanSoftmacIfcBridge server future executes on a parallel thread because otherwise synchronous calls from the MLME server into the vendor driver could deadlock if the vendor driver calls a WlanSoftmacIfcBridge method before returning from a synchronous call. For example, when the MLME server synchronously calls WlanSoftmac.StartActiveScan(), the vendor driver may call WlanSoftmacIfc.NotifyScanComplete() before returning from WlanSoftmac.StartActiveScan(). This can occur when the scan request results in immediate cancellation despite the request having valid arguments.

This function calls init_completer() when either MLME initialization completes successfully or an error occurs before MLME initialization completes.

The return value of this function is distinct from the value passed in init_completer(). This function returns in one of four cases:

  • An error occurred during initialization.
  • An error occurred while running.
  • An error occurred during shutdown.
  • Shutdown completed successfully.

Generally, errors during initializations will be returned immediately after this function calls init_completer() with the same error. Later errors can be returned after this functoin calls init_completer().