Форум сайта python.su
Здравствуйте.
Задача у меня такая. Есть девайс АТОЛ Fprint-22ПТК подключенный к USB порту к Raspberry. Для него есть драйвер в виде библиотеки libfptr.so и есть пара классов для работы с ним в Python ( dto9base.py и dto9fptr.py ). Они работают с ним через ctypes. У меня не получается его подключить, так чтобы он работал.
Вот так я его пытаюсь подключить:
from dto9fptr import Fptr kkm = Fptr('./linux-armhf/libfptr.so', 9) #Передаю данные для подключения по USB kkm.put_DeviceSingleSetting('S_VID', 0x2912) kkm.put_DeviceSingleSetting('S_PID', 0x0005) #Пытаюсь считать только что переданные данные, но возвращается None print(kkm.get_DeviceSingleSetting('S_VID')) print(kkm.get_DeviceSingleSetting('S_PID'))
Офлайн
Добрый день!
Тоже занимаюсь разработкой интерфейса для драйвера Атол на питоне.
Вот мой код. настройки применяются и считываются.
f = Fptr("libfptr.so", 13) f.put_DeviceSingleSetting("Port", "TCPIP") f.put_DeviceSingleSetting("IPAddress", "х.х.х.х") f.put_DeviceSingleSetting("IPPort", "5555") f.put_DeviceSingleSetting("Model", 62) f.put_DeviceSingleSetting("Protocol", 0) f.put_DeviceSingleSetting("AccessPassword", "0") f.put_DeviceSingleSetting("UserPassword", "30") f.ApplySingleSettings() result = f.put_DeviceEnabled(True) print "put device enabled: " + repr(result).decode("unicode_escape") result = f.get_ResultCode() print "result code:" + repr(result).decode("unicode_escape") result = f.get_ResultDescription() print "result description:" + repr(result).decode("unicode_escape") result = f.GetStatus() print "get status: " + repr(result).decode("unicode_escape") result = f.get_DeviceSingleSetting("IPAddress") print "IP address :" + repr(result).decode("unicode_escape")
Офлайн