parameters: (
      module: AbstractModule,
      firmware_file: str,
      loop: Optional[asyncio.AbstractEventLoop],
  )
docstring: Apply update of given firmware file to given module.
  
      raises an UpdateError with the reason for the failure.
docstring_summary: Apply update of given firmware file to given module.
docstring_tokens: Apply update of given firmware file to given module .
function: async def update_firmware(
      module: AbstractModule,
      firmware_file: str,
      loop: Optional[asyncio.AbstractEventLoop],
  ):
      """Apply update of given firmware file to given module.
  
      raises an UpdateError with the reason for the failure.
      """
      flash_port = await module.prep_for_update()
      kwargs: Dict[str, Any] = {
          "stdout": asyncio.subprocess.PIPE,
          "stderr": asyncio.subprocess.PIPE,
          "loop": loop,
      }
      successful, res = await module.bootloader()(flash_port, firmware_file, kwargs)
      if not successful:
          log.info(f"Bootloader reponse: {res}")
          raise UpdateError(res)
function_tokens: async def update_firmware ( module : AbstractModule , firmware_file : str , loop : Optional [ asyncio . AbstractEventLoop ] , ) : flash_port = await module . prep_for_update ( ) kwargs : Dict [ str , Any ] = { "stdout" : asyncio . subprocess . PIPE , "stderr" : asyncio . subprocess . PIPE , "loop" : loop , } successful , res = await module . bootloader ( ) ( flash_port , firmware_file , kwargs ) if not successful : log . info ( f"Bootloader reponse: {res}" ) raise UpdateError ( res )