async def METHOD_NAME(self, buf, timeout_ms=None):
    self._assert_connected()
    # Wait until the data_ready flag is set. This flag is only ever set by
    # the event and cleared by this function.
    with self._connection.timeout(timeout_ms):
        while not self._data_ready:
            await self._event.wait()
            self._assert_connected()
    self._assert_connected()
    # Extract up to len(buf) bytes from the channel buffer.
    n = ble.l2cap_recvinto(self._connection._conn_handle, self._cid, buf)
    # Check if there's still remaining data in the channel buffers.
    self._data_ready = ble.l2cap_recvinto(self._connection._conn_handle, self._cid, None) > 0
    return n