parameters: (websocket, fw_file)
docstring: Read firmware file, divide it to chunks and send them
docstring_summary: Read firmware file, divide it to chunks and send them
docstring_tokens: Read firmware file divide it to chunks and send them
function: async def binary_send(websocket, fw_file):
      """Read firmware file, divide it to chunks and send them"""
      with open(fw_file, "rb") as binaryfile:
  
          while True:
              chunk = binaryfile.read(2048)
              if not chunk:
                  break
              try:
                  await websocket.send(chunk)
              except Exception as exception:
                  Logger.exception(exception)
                  return False
              time.sleep(0.2)
function_tokens: async def binary_send ( websocket , fw_file ) : with open ( fw_file , "rb" ) as binaryfile : while True : chunk = binaryfile . read ( 2048 ) if not chunk : break try : await websocket . send ( chunk ) except Exception as exception : Logger . exception ( exception ) return False time . sleep ( 0.2 )