/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once
#include <fu-input-stream.h>
/**
 * FuUsbCmdId:
 */
typedef enum {
    /**
     * FU_USB_CMD_ID_INIT:
     */
    FU_USB_CMD_ID_INIT = 0xCC01,
    /**
     * FU_USB_CMD_ID_FIRMWARE_DOWNLOAD:
     */
    FU_USB_CMD_ID_FIRMWARE_DOWNLOAD = 0xCC03,
    /**
     * FU_USB_CMD_ID_READ_VERSION:
     */
    FU_USB_CMD_ID_READ_VERSION = 0xCC07,
}  FuUsbCmdId;
/**
 * FuUsbCmdStatus:
 */
typedef enum {
    /**
     * FU_USB_CMD_STATUS_OK:
     *
     * inferred
     */
    FU_USB_CMD_STATUS_OK = 0x0,
    /**
     * FU_USB_CMD_STATUS_REQ:
     */
    FU_USB_CMD_STATUS_REQ = 0xFFFF,
    /**
     * FU_USB_CMD_STATUS_INIT_REQ:
     */
    FU_USB_CMD_STATUS_INIT_REQ = 0xBEEF,
    /**
     * FU_USB_CMD_STATUS_INIT_REQ_ACK:
     */
    FU_USB_CMD_STATUS_INIT_REQ_ACK = 0x0999,
}  FuUsbCmdStatus;
/**
 * FuUsbImageState:
 */
typedef enum {
    /**
     * FU_USB_IMAGE_STATE_NEW:
     */
    FU_USB_IMAGE_STATE_NEW = 0x0,
    /**
     * FU_USB_IMAGE_STATE_VALID:
     */
    FU_USB_IMAGE_STATE_VALID = 0x1,
    /**
     * FU_USB_IMAGE_STATE_INVALID:
     */
    FU_USB_IMAGE_STATE_INVALID = 0x2,
}  FuUsbImageState;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAudioSerialNumber;

FuStructAudioSerialNumber *fu_struct_audio_serial_number_ref(FuStructAudioSerialNumber *st) G_GNUC_NON_NULL(1);
void fu_struct_audio_serial_number_unref(FuStructAudioSerialNumber *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAudioSerialNumber, fu_struct_audio_serial_number_unref)
FuStructAudioSerialNumber *fu_struct_audio_serial_number_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_audio_serial_number_get_mac_address(const FuStructAudioSerialNumber *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_audio_serial_number_get_pid(const FuStructAudioSerialNumber *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_audio_serial_number_get_year(const FuStructAudioSerialNumber *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_audio_serial_number_get_month(const FuStructAudioSerialNumber *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_audio_serial_number_get_day(const FuStructAudioSerialNumber *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_OFFSET_MAC_ADDRESS 0x0
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_OFFSET_PID 0x6
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_OFFSET_YEAR 0x8
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_OFFSET_MONTH 0xA
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_OFFSET_DAY 0xB
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_SIZE_MAC_ADDRESS 0x6
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_N_ELEMENTS_MAC_ADDRESS 6
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_SIZE 0xC
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsbInitRequest;

FuStructUsbInitRequest *fu_struct_usb_init_request_ref(FuStructUsbInitRequest *st) G_GNUC_NON_NULL(1);
void fu_struct_usb_init_request_unref(FuStructUsbInitRequest *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsbInitRequest, fu_struct_usb_init_request_unref)
FuStructUsbInitRequest *fu_struct_usb_init_request_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_INIT_REQUEST_OFFSET_ID 0x0
#define FU_STRUCT_USB_INIT_REQUEST_OFFSET_STATUS 0x2
#define FU_STRUCT_USB_INIT_REQUEST_OFFSET_LEN 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_INIT_REQUEST_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_INIT_REQUEST_DEFAULT_ID FU_USB_CMD_ID_INIT
#define FU_STRUCT_USB_INIT_REQUEST_DEFAULT_STATUS FU_USB_CMD_STATUS_INIT_REQ
#define FU_STRUCT_USB_INIT_REQUEST_DEFAULT_LEN 0
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsbInitResponse;

FuStructUsbInitResponse *fu_struct_usb_init_response_ref(FuStructUsbInitResponse *st) G_GNUC_NON_NULL(1);
void fu_struct_usb_init_response_unref(FuStructUsbInitResponse *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsbInitResponse, fu_struct_usb_init_response_unref)
FuStructUsbInitResponse *fu_struct_usb_init_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_INIT_RESPONSE_OFFSET_ID 0x0
#define FU_STRUCT_USB_INIT_RESPONSE_OFFSET_STATUS 0x2
#define FU_STRUCT_USB_INIT_RESPONSE_OFFSET_LEN 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_INIT_RESPONSE_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_INIT_RESPONSE_DEFAULT_ID FU_USB_CMD_ID_INIT
#define FU_STRUCT_USB_INIT_RESPONSE_DEFAULT_STATUS FU_USB_CMD_STATUS_INIT_REQ_ACK
#define FU_STRUCT_USB_INIT_RESPONSE_DEFAULT_LEN 0
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsbFirmwareDownloadRequest;

FuStructUsbFirmwareDownloadRequest *fu_struct_usb_firmware_download_request_ref(FuStructUsbFirmwareDownloadRequest *st) G_GNUC_NON_NULL(1);
void fu_struct_usb_firmware_download_request_unref(FuStructUsbFirmwareDownloadRequest *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsbFirmwareDownloadRequest, fu_struct_usb_firmware_download_request_unref)
FuStructUsbFirmwareDownloadRequest *fu_struct_usb_firmware_download_request_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_usb_firmware_download_request_set_len(FuStructUsbFirmwareDownloadRequest *st, guint32 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_usb_firmware_download_request_set_fw_version(FuStructUsbFirmwareDownloadRequest *st, const gchar *value, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_OFFSET_ID 0x0
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_OFFSET_STATUS 0x2
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_OFFSET_LEN 0x4
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_OFFSET_FW_VERSION 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_SIZE_FW_VERSION 0x10
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_N_ELEMENTS_FW_VERSION 16
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_SIZE 0x18
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_DEFAULT_ID FU_USB_CMD_ID_FIRMWARE_DOWNLOAD
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_DEFAULT_STATUS FU_USB_CMD_STATUS_REQ
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsbFirmwareDownloadResponse;

FuStructUsbFirmwareDownloadResponse *fu_struct_usb_firmware_download_response_ref(FuStructUsbFirmwareDownloadResponse *st) G_GNUC_NON_NULL(1);
void fu_struct_usb_firmware_download_response_unref(FuStructUsbFirmwareDownloadResponse *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsbFirmwareDownloadResponse, fu_struct_usb_firmware_download_response_unref)
FuStructUsbFirmwareDownloadResponse *fu_struct_usb_firmware_download_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_usb_firmware_download_response_get_len(const FuStructUsbFirmwareDownloadResponse *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_RESPONSE_OFFSET_ID 0x0
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_RESPONSE_OFFSET_STATUS 0x2
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_RESPONSE_OFFSET_LEN 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_RESPONSE_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_RESPONSE_DEFAULT_ID FU_USB_CMD_ID_FIRMWARE_DOWNLOAD
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_RESPONSE_DEFAULT_STATUS FU_USB_CMD_STATUS_OK
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsbReadVersionRequest;

FuStructUsbReadVersionRequest *fu_struct_usb_read_version_request_ref(FuStructUsbReadVersionRequest *st) G_GNUC_NON_NULL(1);
void fu_struct_usb_read_version_request_unref(FuStructUsbReadVersionRequest *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsbReadVersionRequest, fu_struct_usb_read_version_request_unref)
FuStructUsbReadVersionRequest *fu_struct_usb_read_version_request_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_READ_VERSION_REQUEST_OFFSET_ID 0x0
#define FU_STRUCT_USB_READ_VERSION_REQUEST_OFFSET_STATUS 0x2
#define FU_STRUCT_USB_READ_VERSION_REQUEST_OFFSET_LEN 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_READ_VERSION_REQUEST_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_READ_VERSION_REQUEST_DEFAULT_ID FU_USB_CMD_ID_READ_VERSION
#define FU_STRUCT_USB_READ_VERSION_REQUEST_DEFAULT_STATUS FU_USB_CMD_STATUS_REQ
#define FU_STRUCT_USB_READ_VERSION_REQUEST_DEFAULT_LEN 0
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsbReadVersionResponse;

FuStructUsbReadVersionResponse *fu_struct_usb_read_version_response_ref(FuStructUsbReadVersionResponse *st) G_GNUC_NON_NULL(1);
void fu_struct_usb_read_version_response_unref(FuStructUsbReadVersionResponse *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsbReadVersionResponse, fu_struct_usb_read_version_response_unref)
FuStructUsbReadVersionResponse *fu_struct_usb_read_version_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_usb_read_version_response_get_fw_version(const FuStructUsbReadVersionResponse *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuUsbImageState fu_struct_usb_read_version_response_get_img_state(const FuStructUsbReadVersionResponse *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_OFFSET_FW_VERSION 0x0
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_OFFSET_IMG_STATE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_SIZE_FW_VERSION 0x10
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_N_ELEMENTS_FW_VERSION 16
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_SIZE 0x14
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsbProgressResponse;

FuStructUsbProgressResponse *fu_struct_usb_progress_response_ref(FuStructUsbProgressResponse *st) G_GNUC_NON_NULL(1);
void fu_struct_usb_progress_response_unref(FuStructUsbProgressResponse *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsbProgressResponse, fu_struct_usb_progress_response_unref)
FuStructUsbProgressResponse *fu_struct_usb_progress_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_usb_progress_response_get_completed(const FuStructUsbProgressResponse *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_PROGRESS_RESPONSE_OFFSET_COMPLETED 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USB_PROGRESS_RESPONSE_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#endif
