Skip to content

Commit

Permalink
1.0.27 (2024-02-05)
Browse files Browse the repository at this point in the history
-------------------
- | The API has been fully updated to version 1.0.27 (libusb v.1.0.27
  | is fully backward compatible with v.1.0.26).
- | For Windows the shared library binaries have been updated to version
  | 1.0.27. For Linux and macOS, the shared library binaries remain at
  | version 1.0.26.
- Bugfixes for options -i and -w in examples/xusb.py
  • Loading branch information
Adam Karpierz committed Feb 5, 2024
1 parent 1d5e73e commit 45e37e0
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 12 deletions.
14 changes: 12 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
Changelog
=========

1.0.27 (2024-02-05)
-------------------
- | The API has been fully updated to version 1.0.27 (libusb v.1.0.27
| is fully backward compatible with v.1.0.26).
- | For Windows the shared library binaries have been updated to version
| 1.0.27. For Linux and macOS, the shared library binaries remain at
| version 1.0.26.
- Bugfixes for options -i and -w in examples/xusb.py

1.0.26 (2024-02-05)
-------------------
- API partially updated from 1.0.27 but still supports only 1.0.26.
- | The API has been partially updated to version 1.0.27, but still
| only supports version 1.0.26.
- Improvements and some little bugfixes.
- Examples and tests are upgraded from 1.0.27.
- Examples and tests are upgraded to 1.0.27.

1.0.26rc4 (2024-01-25)
----------------------
Expand Down
5 changes: 5 additions & 0 deletions examples/xusb.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,8 @@ def read_ms_winsub_feature_descriptors(handle, bRequest, iface_number):

# Read the MS WinUSB Feature Descriptors, that are used on Windows 8 for automated driver installation

global force_device_request

MAX_OS_FD_LENGTH = 256

#int r;
Expand Down Expand Up @@ -892,6 +894,7 @@ def print_device_cap(dev_cap):
def test_device(vid, pid) -> int:

global test_mode
global extra_info

#int r;

Expand Down Expand Up @@ -1125,6 +1128,8 @@ def main(argv=sys.argv):
global test_mode
global binary_dump
global binary_name
global extra_info
global force_device_request

show_help = False # bool
debug_mode = False # bool
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires = ['setuptools>=68.2.2', 'wheel>=0.42.0', 'packaging>=23.2.0', 'tox>=4.

[project]
name = 'libusb'
version = '1.0.26'
version = '1.0.27'
description = 'Python binding for the libusb C library.'
urls.Homepage = 'https://pypi.org/project/libusb/'
urls.Documentation = 'https://libusb.readthedocs.io/'
Expand Down
16 changes: 10 additions & 6 deletions src/libusb/_libusb.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def LIBUSB_DEPRECATED_FOR(f): pass
# <li>libusb version 1.0.27: LIBUSB_API_VERSION = 0x0100010A
# </ul>

LIBUSB_API_VERSION = 0x01000109
LIBUSB_API_VERSION = 0x0100010A

# \def LIBUSBX_API_VERSION
# \ingroup libusb_misc
Expand Down Expand Up @@ -1908,7 +1908,7 @@ class _Value(ct.Union):
free_interface_association_descriptors = CFUNC(None,
ct.POINTER(interface_association_descriptor_array))(
("libusb_free_interface_association_descriptors", dll), (
(1, "iad_array")))
(1, "iad_array"),))
except: pass # noqa: E722


Expand Down Expand Up @@ -1944,17 +1944,20 @@ class _Value(ct.Union):
set_configuration = CFUNC(ct.c_int,
ct.POINTER(device_handle), ct.c_int)(
("libusb_set_configuration", dll), (
(1, "dev_handle"), (1, "configuration")))
(1, "dev_handle"),
(1, "configuration")))

claim_interface = CFUNC(ct.c_int,
ct.POINTER(device_handle), ct.c_int)(
("libusb_claim_interface", dll), (
(1, "dev_handle"), (1, "interface_number")))
(1, "dev_handle"),
(1, "interface_number")))

release_interface = CFUNC(ct.c_int,
ct.POINTER(device_handle), ct.c_int)(
("libusb_release_interface", dll), (
(1, "dev_handle"), (1, "interface_number")))
(1, "dev_handle"),
(1, "interface_number")))


open_device_with_vid_pid = CFUNC(ct.POINTER(device_handle),
Expand Down Expand Up @@ -2155,7 +2158,8 @@ def fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex, wLength)
transfer_set_stream_id = CFUNC(None,
ct.POINTER(transfer), ct.c_uint32)(
("libusb_transfer_set_stream_id", dll), (
(1, "transfer"), (1, "stream_id")))
(1, "transfer"),
(1, "stream_id")))

# \ingroup libusb::asyncio
# Helper function to populate the required \ref libusb.transfer fields
Expand Down
Binary file modified src/libusb/_platform/_windows/x64/libusb-1.0.dll
Binary file not shown.
Binary file modified src/libusb/_platform/_windows/x86/libusb-1.0.dll
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/tman_init_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def test_init_context_log_cb() -> test_result:
testlib.EXPECT_SUCCESS(test_ctx, usb.init_context(ct.byref(test_ctx), options, 1))

if defined("ENABLE_LOGGING") and not defined("ENABLE_DEBUG_LOGGING"):
testlib.EXPECT_EQ(test_ctx, test_ctx.contents.log_handler, test_log_cb)
testlib.EXPECT_EQ(test_ctx, ct.cast(test_ctx.contents.log_handler, ct.c_void_p).value,
ct.cast(test_log_cb, ct.c_void_p).value)

return testlib.TEST_CLEAN_EXIT(test_ctx, test_result.TEST_STATUS_SUCCESS)
else:
Expand Down
6 changes: 4 additions & 2 deletions tests/tman_set_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def test_set_log_cb() -> test_result:
test_log_cb))

# check that debug level came from the default
testlib.EXPECT_EQ(test_ctx, test_ctx.contents.log_handler, test_log_cb)
testlib.EXPECT_EQ(test_ctx, ct.cast(test_ctx.contents.log_handler, ct.c_void_p).value,
ct.cast(test_log_cb, ct.c_void_p).value)

usb.exit(test_ctx)
test_ctx = ct.POINTER(usb.context)()
Expand All @@ -189,7 +190,8 @@ def test_set_log_cb() -> test_result:
test_log_cb))
testlib.EXPECT_SUCCESS(test_ctx, usb.init_context(ct.byref(test_ctx), None, 0))

testlib.EXPECT_EQ(test_ctx, test_ctx.contents.log_handler, test_log_cb)
testlib.EXPECT_EQ(test_ctx, ct.cast(test_ctx.contents.log_handler, ct.c_void_p).value,
ct.cast(test_log_cb, ct.c_void_p).value)

return testlib.TEST_CLEAN_EXIT(test_ctx, test_result.TEST_STATUS_SUCCESS)
else:
Expand Down

0 comments on commit 45e37e0

Please sign in to comment.