PyD2XX 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyD2XX
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A Python wrapper for the FTDI D2XX library.
5
5
  Keywords: FTDI,ftdichip,PyD2XX,D2XX,FTD2XX
6
6
  Author-Email: Hector Soto <hector.soto@ftdichip.com>
@@ -11,7 +11,7 @@ includes = [
11
11
 
12
12
  [project]
13
13
  name = "PyD2XX"
14
- version = "0.0.2"
14
+ version = "0.0.3"
15
15
  authors = [
16
16
  { name = "Hector Soto", email = "hector.soto@ftdichip.com" },
17
17
  ]
@@ -20,8 +20,8 @@ from sys import platform as Platform
20
20
 
21
21
  # ---| Python Library Specific Definitions |---
22
22
 
23
- VERSION = "0.0.2"
24
- VERSION_TEST = "0.0.4_mâner nou"
23
+ VERSION = "0.0.3"
24
+ VERSION_TEST = "0.0.5_legătură_sufletească"
25
25
 
26
26
  PRINT_NONE = int("00000", 2) # Print no messages.
27
27
  PRINT_ERROR_CRITICAL = int("00001", 2) # Print critical error messages.
@@ -339,7 +339,6 @@ def FT_GetDeviceInfoList(DeviceCount: int) -> tuple[int, list[FT_Device]] | tupl
339
339
  _Print(FT_STATUS_STR[Status] + " | ERROR: DeviceCount IS LESS THAN 1.", PRINT_ERROR_MINOR, False)
340
340
  return Status, "FT_OTHER_ERROR"
341
341
  DeviceList = (_FT_DEVICE_LIST_INFO_NODE * DeviceCount.value)()
342
- Handle = ctypes.c_void_p(0)
343
342
  Status = _DLL.FT_GetDeviceInfoList(ctypes.byref(DeviceList), ctypes.byref(DeviceCount))
344
343
  if(Status != FT_OK):
345
344
  _Print(FT_STATUS_STR[Status] + " | ERROR: FAILED TO GET DEVICE INFO LIST.", PRINT_ERROR_MAJOR, False)
@@ -354,8 +353,35 @@ def FT_GetDeviceInfoList(DeviceCount: int) -> tuple[int, list[FT_Device]] | tupl
354
353
  ReturnDeviceList[i].LocID = DeviceList[i].LocID
355
354
  ReturnDeviceList[i].SerialNumber = DeviceList[i].SerialNumber.decode("utf-8")
356
355
  ReturnDeviceList[i].Description = DeviceList[i].Description.decode("utf-8")
356
+ ReturnDeviceList[i].Handle = DeviceList[i].Handle.value if (DeviceList[i].Handle is not None) else 0
357
357
  return Status, ReturnDeviceList
358
358
 
359
+ def FT_GetDeviceInfoDetail(Index: int) -> tuple[int, FT_Device] | tuple[int, str]:
360
+ Status = FT_OK
361
+ Index = ctypes.c_ulong(Index)
362
+ Device = _FT_DEVICE_LIST_INFO_NODE()
363
+ Status = _DLL.FT_GetDeviceInfoDetail(Index,
364
+ ctypes.addressof(Device) + _FT_DEVICE_LIST_INFO_NODE.Flags.offset,
365
+ ctypes.addressof(Device) + _FT_DEVICE_LIST_INFO_NODE.Type.offset,
366
+ ctypes.addressof(Device) + _FT_DEVICE_LIST_INFO_NODE.ID.offset,
367
+ ctypes.addressof(Device) + _FT_DEVICE_LIST_INFO_NODE.LocID.offset,
368
+ ctypes.addressof(Device) + _FT_DEVICE_LIST_INFO_NODE.SerialNumber.offset,
369
+ ctypes.addressof(Device) + _FT_DEVICE_LIST_INFO_NODE.Description.offset,
370
+ ctypes.addressof(Device) + _FT_DEVICE_LIST_INFO_NODE.Handle.offset)
371
+ if(Status != FT_OK):
372
+ _Print(FT_STATUS_STR[Status] + " | ERROR: FAILED TO GET DEVICE INFO DETAIL.", PRINT_ERROR_MAJOR, False)
373
+ return Status, "FT_OTHER_ERROR"
374
+ ReturnDevice = _CreateDevice()
375
+ ReturnDevice.Handle = "FT_OTHER_ERROR"
376
+ ReturnDevice.Flags = Device.Flags
377
+ ReturnDevice.Type = Device.Type
378
+ ReturnDevice.ID = Device.ID
379
+ ReturnDevice.LocID = Device.LocID
380
+ ReturnDevice.SerialNumber = Device.SerialNumber.decode("utf-8")
381
+ ReturnDevice.Description = Device.Description.decode("utf-8")
382
+ ReturnDevice.Handle = Device.Handle.value if (Device.Handle is not None) else 0
383
+ return Status, ReturnDevice
384
+
359
385
  def FT_Open(Index: int, Device: FT_Device) -> int:
360
386
  Status = FT_OTHER_ERROR
361
387
  if(not(isinstance(Device, FT_Device))):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes