/* auto-generated, do not modify */
#pragma once
#include <fwupd-common.h>
typedef enum {
    FU_USB_CMD_ID_INIT = 0xCC01,
    FU_USB_CMD_ID_FIRMWARE_DOWNLOAD = 0xCC03,
    FU_USB_CMD_ID_READ_VERSION = 0xCC07,
} FuUsbCmdId;
typedef enum {
    FU_USB_CMD_STATUS_OK = 0x0,
    FU_USB_CMD_STATUS_REQ = 0xFFFF,
    FU_USB_CMD_STATUS_INIT_REQ = 0xBEEF,
    FU_USB_CMD_STATUS_INIT_REQ_ACK = 0x0999,
} FuUsbCmdStatus;
typedef enum {
    FU_USB_IMAGE_STATE_NEW = 0x0,
    FU_USB_IMAGE_STATE_VALID = 0x1,
    FU_USB_IMAGE_STATE_INVALID = 0x2,
} FuUsbImageState;

GByteArray *fu_struct_audio_serial_number_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
const guint8 *fu_struct_audio_serial_number_get_mac_address(const GByteArray *st, gsize *bufsz);
guint16 fu_struct_audio_serial_number_get_pid(const GByteArray *st);
guint16 fu_struct_audio_serial_number_get_year(const GByteArray *st);
guint8 fu_struct_audio_serial_number_get_month(const GByteArray *st);
guint8 fu_struct_audio_serial_number_get_day(const GByteArray *st);
#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
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_SIZE_MAC_ADDRESS 0x6
#define FU_STRUCT_AUDIO_SERIAL_NUMBER_SIZE 0xC

GByteArray *fu_struct_usb_init_request_new(void);
#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
#define FU_STRUCT_USB_INIT_REQUEST_SIZE 0x8
#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

GByteArray *fu_struct_usb_init_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
#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
#define FU_STRUCT_USB_INIT_RESPONSE_SIZE 0x8
#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

GByteArray *fu_struct_usb_firmware_download_request_new(void);
void fu_struct_usb_firmware_download_request_set_len(GByteArray *st, guint32 value);
gboolean fu_struct_usb_firmware_download_request_set_fw_version(GByteArray *st, const gchar *value, GError **error);
#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
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_SIZE_FW_VERSION 0x10
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_REQUEST_SIZE 0x18
#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

GByteArray *fu_struct_usb_firmware_download_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint32 fu_struct_usb_firmware_download_response_get_len(const GByteArray *st);
#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
#define FU_STRUCT_USB_FIRMWARE_DOWNLOAD_RESPONSE_SIZE 0x8
#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

GByteArray *fu_struct_usb_read_version_request_new(void);
#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
#define FU_STRUCT_USB_READ_VERSION_REQUEST_SIZE 0x8
#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

GByteArray *fu_struct_usb_read_version_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
gchar *fu_struct_usb_read_version_response_get_fw_version(const GByteArray *st);
FuUsbImageState fu_struct_usb_read_version_response_get_img_state(const GByteArray *st);
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_OFFSET_FW_VERSION 0x0
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_OFFSET_IMG_STATE 0x10
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_SIZE_FW_VERSION 0x10
#define FU_STRUCT_USB_READ_VERSION_RESPONSE_SIZE 0x14

GByteArray *fu_struct_usb_progress_response_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint32 fu_struct_usb_progress_response_get_completed(const GByteArray *st);
#define FU_STRUCT_USB_PROGRESS_RESPONSE_OFFSET_COMPLETED 0x0
#define FU_STRUCT_USB_PROGRESS_RESPONSE_SIZE 0x4
