Example #1
0
    def close(self):
        if self.handle is not None:

            log_and_warn_on_error(
                sensel.stopScanning(self.handle),
                'stop scanning before close for {}'.format(self.serial_num))
            log_and_warn_on_error(
                sensel.freeFrameData(self.handle, self.frame),
                'free frame data before close for {}'.format(self.serial_num))
            log_and_warn_on_error(
                sensel.close(self.handle),
                'close handle for {} ({})'.format(self.serial_num,
                                                  self.handle))
            self.handle = None
        else:
            logger.debug(
                'Attempt to close Morph {} with None handle (already closed?)'.
                format(self.serial_num))
Example #2
0
def closeSensel(frame):
    error = sensel.freeFrameData(handle, frame)
    error = sensel.stopScanning(handle)
    error = sensel.close(handle)
Example #3
0
 def _closeSensel(self):
     self.is_running = False
     error = sensel.freeFrameData(self.handle, self._frame)
     error = sensel.stopScanning(self.handle)
     error = sensel.close(self.handle)