diff --git a/ais_shell.py b/ais_shell.py index 72d679ba8405697fcc9808435e0716db0ce6a198..2945121c9bfc3b15344820dd8c248050c18b3cee 100644 --- a/ais_shell.py +++ b/ais_shell.py @@ -6,16 +6,13 @@ """ -__program_version = '4.0.7.17 ' +__program_version = '4.0.7.18 ' """ - replace global dev(DEV_HND) structure with local structure; + """ - - - import calendar import datetime import os @@ -355,9 +352,9 @@ def log_by_time(start_time, end_time, devHnd): def get_unread_log_one(choise, dev): - log_available = c_uint32() - r_log = c_int + def u_log_info(): + r_log = c_int res_log, res_rrte = "", "" r_log = mySO.AIS_ReadLog_Count(dev) if r_log: @@ -630,8 +627,7 @@ def PrintLOG(dev): logNfcUid = (c_uint8 * NFC_UID_MAX_LEN)() logNfcUidLen = c_int() logTimeStamp = c_uint64() - nfcuid = str() - + while True: # dev.status dev.status = mySO.AIS_ReadLog(dev.hnd, byref(logIndex), byref(logAction), byref(logReaderId), byref(logCardId), byref(logSystemId), logNfcUid, byref(logNfcUidLen), byref(logTimeStamp)) @@ -645,8 +641,7 @@ def PrintLOG(dev): dev.log.log_nfc_uid_len = logNfcUidLen.value dev.log.log_timestamp = logTimeStamp.value - if dev.status != 0: # dev.status - # return wr_status('AIS_ReadLog()', dev.status) #dev.status + if dev.status != 0: break nfc_uid = '' @@ -665,7 +660,7 @@ def PrintLOG(dev): def RTEListen(max_sec): - res = "" + pass stop_time = c_uint64() stop_time = time.time() + max_sec # 10 dev = device_list.S_DEVICE @@ -709,8 +704,7 @@ def ListDevices(): def GetListInformation(): - res_0, res_1, res = "", "", "" - idx = c_int() + res_0, res_1 = "", "" hnd = c_void_p() devSerial = c_char_p() devType = c_int() @@ -917,8 +911,8 @@ def config_file_rd(devHnd, fname=None): file_name = file_name + ".config" f_print = "AIS_Config_Read(file: %s)\n" % file_name configDataSize = c_int() - dev.status = mySO.AIS_Configuration_Read(devHnd, PASS, file_name.encode(), configDataSize) - return f_print + wr_status("AIS_Config_Read", dev.status) + devstatus = mySO.AIS_Configuration_Read(devHnd, PASS, file_name.encode(), configDataSize) + return f_print + wr_status("AIS_Config_Read", devstatus) def config_file_wr(devHnd, fname=None): @@ -934,8 +928,8 @@ def config_file_wr(devHnd, fname=None): if fname: file_name = fname f_print = "AIS_Config_Send(file: %s)\n" % file_name - dev.status = mySO.AIS_Config_Send(devHnd, file_name.encode()) - return f_print + wr_status("AIS_Config_Send", dev.status) + devstatus = mySO.AIS_Config_Send(devHnd, file_name.encode()) + return f_print + wr_status("AIS_Config_Send", devstatus) def add_device(device_type, device_id):