async def wait_for(self, cmd, value=None, timeout=<NUM_LIT>):
try:<EOL><INDENT>async with async_timeout(timeout * <NUM_LIT>):<EOL><INDENT>while True:<EOL><INDENT>msgs = await self.receive()<EOL>msg = check_messages(msgs, cmd, value=value)<EOL>if msg:<EOL><INDENT>return msg<EOL><DEDENT><DEDENT><DEDENT><DEDENT>except asyncio.TimeoutError:<EOL><INDENT>return OrderedDict()<EOL><DEDENT>
Hang until command is received.

        If value is supplied, it will hang until ``cmd:value`` is received.

        Parameters
        ----------
        cmd : string
            Command to wait for in bytestring from microscope CAM interface. If
            ``value`` is falsey, value of received command does not matter.
        value : string
            Wait until ``cmd:value`` is received.
        timeout : int
            Minutes to wait for command. If timeout is reached, an empty
            OrderedDict will be returned.

        Returns
        -------
        collections.OrderedDict
            Last received messsage or empty message if timeout is reached.