def write_sensor_data_to_file(self, fp, buffer_size=1024):
        if self.logFile:
            self.logFile.seek(0)
            fp.write('[\n')
            while 1:
                copy_buffer = self.logFile.read(buffer_size)
                if copy_buffer:
                    fp.write(copy_buffer)
                else:
                    break
            fp.write(' ]\n')
            self.logFile.seek(0, 2)