'Checks that the correct number of data bytes have been recieved and that the reply is a reply to the sent command'

def checkReply(self, expectedBytes, expectedCommand):

    if (len(self.dataBytes) != expectedBytes):
        raise RepRapError('Reply    contains    wrong    number    of    bytes')
    if (self.dataBytes[0] != expectedCommand):
        raise RepRapError('Reply    is    for    wrong    command')
    return True
