'getData([indices]) -- retrieve data samples and return them as a
Numpy array, samples in rows(!). The \'indices\' argument is optional,
and if given, must be a tuple or list with inclusive, zero-based
start/end indices.'

def getData(self, index=None):

    if (index is None):
        request = struct.pack('HHI', VERSION, GET_DAT, 0)
    else:
        indS = int(index[0])
        indE = int(index[1])
        request = struct.pack('HHIII', VERSION, GET_DAT, 8, indS, indE)
    self.sendRaw(request)
    (status, bufsize, payload) = self.receiveResponse()
    if (status == GET_ERR):
        return None
    if (status != GET_OK):
        self.disconnect()
        raise IOError('Bad    response    from    buffer    server    -    disconnecting')
    if (bufsize < 16):
        self.disconnect()
        raise IOError('Invalid    DATA    packet    received    (too    few    bytes)')
    (nchans, nsamp, datype, bfsiz) = struct.unpack('IIII', payload[0:16])
    if ((bfsiz < (bufsize - 16)) or (datype >= len(numpyType))):
        raise IOError('Invalid    DATA    packet    received')
    raw = payload[16:(bfsiz + 16)]
    D = numpy.ndarray((nsamp, nchans), dtype=numpyType[datype], buffer=raw)
    return D
