Skip to content

Commit

Permalink
added functionality to all devices to get serial number
Browse files Browse the repository at this point in the history
  • Loading branch information
cversek committed Aug 25, 2012
1 parent 953642f commit 0e6af8b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/FLI/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@

import sys, time

from ctypes import pointer, POINTER, byref, c_char, c_char_p, c_long, c_ubyte, c_double
import ctypes
from ctypes import pointer, POINTER, byref, c_char, c_char_p, c_long, c_ubyte, c_double, c_size_t


import numpy

from lib import FLILibrary, FLIError, FLIWarning, flidomain_t, flidev_t,\
FLIDOMAIN_USB
###############################################################################
DEBUG = True
DEBUG = False
BUFFER_SIZE = 64
###############################################################################
class USBDevice(object):
""" base class for all FLI USB devices"""
Expand All @@ -37,6 +39,11 @@ def __init__(self, dev_name, model):

def __del__(self):
self._libfli.FLIClose(self._dev)

def get_serial_num(self):
serial = ctypes.create_string_buffer(BUFFER_SIZE)
self._libfli.FLIGetSerialString(self._dev,serial,c_size_t(BUFFER_SIZE))
return serial.value

@classmethod
def find_devices(cls):
Expand Down

0 comments on commit 0e6af8b

Please sign in to comment.