Skip to content

Commit

Permalink
Upgrade ffigen 3.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: wangkun <[email protected]>
  • Loading branch information
wangkun committed Feb 7, 2022
1 parent a32b599 commit f071540
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
25 changes: 24 additions & 1 deletion lib/libusb32.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,30 @@ class libusb_ss_usb_device_capability_descriptor extends ffi.Struct {
/// A structure representing the Container ID descriptor.
/// This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification.
/// All multiple-byte fields, except UUIDs, are represented in host-endian format.
class libusb_container_id_descriptor extends ffi.Opaque {}
class libusb_container_id_descriptor extends ffi.Struct {
/// Size of this descriptor (in bytes)
@ffi.Uint8()
external int bLength;

/// Descriptor type. Will have value
/// \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
/// LIBUSB_DT_DEVICE_CAPABILITY in this context.
@ffi.Uint8()
external int bDescriptorType;

/// Capability type. Will have value
/// \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID
/// LIBUSB_BT_CONTAINER_ID in this context.
@ffi.Uint8()
external int bDevCapabilityType;

/// Reserved field
@ffi.Uint8()
external int bReserved;

@ffi.Array.multi([16])
external ffi.Array<ffi.Uint8> ContainerID;
}

/// \ingroup libusb_asyncio
/// Setup packet for control transfers.
Expand Down
25 changes: 24 additions & 1 deletion lib/libusb64.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,30 @@ class libusb_ss_usb_device_capability_descriptor extends ffi.Struct {
/// A structure representing the Container ID descriptor.
/// This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification.
/// All multiple-byte fields, except UUIDs, are represented in host-endian format.
class libusb_container_id_descriptor extends ffi.Opaque {}
class libusb_container_id_descriptor extends ffi.Struct {
/// Size of this descriptor (in bytes)
@ffi.Uint8()
external int bLength;

/// Descriptor type. Will have value
/// \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
/// LIBUSB_DT_DEVICE_CAPABILITY in this context.
@ffi.Uint8()
external int bDescriptorType;

/// Capability type. Will have value
/// \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID
/// LIBUSB_BT_CONTAINER_ID in this context.
@ffi.Uint8()
external int bDevCapabilityType;

/// Reserved field
@ffi.Uint8()
external int bReserved;

@ffi.Array.multi([16])
external ffi.Array<ffi.Uint8> ContainerID;
}

/// \ingroup libusb_asyncio
/// Setup packet for control transfers.
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ packages:
name: ffigen
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.2"
version: "3.0.0"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -359,4 +359,4 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.13.0 <3.0.0"
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.3.23+1
homepage: https://github.com/woodemi/libusb.dart

environment:
sdk: '>=2.12.0-259.9.beta <3.0.0' # ffi: ^1.0.0 required
sdk: '>=2.13.0 <3.0.0'

platforms:
linux:
Expand All @@ -16,7 +16,7 @@ dependencies:

dev_dependencies:
pedantic: ^1.10.0
ffigen: ^2.4.2
ffigen: ^3.0.0
test: ^1.16.3
convert: ^3.0.0

Expand Down

0 comments on commit f071540

Please sign in to comment.