/* auto-generated, do not modify */
#pragma once
#include <fwupd-common.h>
typedef enum {
    FU_QC_OPCODE_START_REQ = 0x01,
    FU_QC_OPCODE_START_CFM = 0x02,
    FU_QC_OPCODE_DATA_BYTES_REQ = 0x03,
    FU_QC_OPCODE_DATA = 0x04,
    FU_QC_OPCODE_ABORT_REQ = 0x07,
    FU_QC_OPCODE_ABORT_CFM = 0x08,
    FU_QC_OPCODE_TRANSFER_COMPLETE_IND = 0x0B,
    FU_QC_OPCODE_TRANSFER_COMPLETE_RES = 0x0C,
    FU_QC_OPCODE_PROCEED_TO_COMMIT = 0x0E,
    FU_QC_OPCODE_COMMIT_REQ = 0x0F,
    FU_QC_OPCODE_COMMIT_CFM = 0x10,
    FU_QC_OPCODE_ERROR_IND = 0x11,
    FU_QC_OPCODE_COMPLETE_IND = 0x12,
    FU_QC_OPCODE_SYNC_REQ = 0x13,
    FU_QC_OPCODE_SYNC_CFM = 0x14,
    FU_QC_OPCODE_START_DATA_REQ = 0x15,
    FU_QC_OPCODE_IS_VALIDATION_DONE_REQ = 0x16,
    FU_QC_OPCODE_IS_VALIDATION_DONE_CFM = 0x17,
    FU_QC_OPCODE_HOST_VERSION_REQ = 0x19,
    FU_QC_OPCODE_HOST_VERSION_CFM = 0x1A,
    FU_QC_OPCODE_ERROR_RES = 0x1F,
} FuQcOpcode;
const gchar *fu_qc_opcode_to_string(FuQcOpcode val);
typedef enum {
    FU_QC_ACTION_PROCEED = 0,
    FU_QC_ACTION_NOT_PROCEED = 1,
} FuQcAction;
typedef enum {
    FU_QC_REQ_CONNECT = 0x02,
    FU_QC_REQ_DISCONNECT = 0x07,
} FuQcReq;
typedef enum {
    FU_QC_STATUS_SUCCESS = 0,
    FU_QC_STATUS_UNEXPECTED_ERROR,
    FU_QC_STATUS_ALREADY_CONNECTED_WARNING,
    FU_QC_STATUS_IN_PROGRESS,
    FU_QC_STATUS_BUSY,
    FU_QC_STATUS_INVALID_POWER_STATE,
} FuQcStatus;
const gchar *fu_qc_status_to_string(FuQcStatus val);
typedef enum {
    FU_QC_RESUME_POINT_START = 0,
    FU_QC_RESUME_POINT_PRE_VALIDATE,
    FU_QC_RESUME_POINT_PRE_REBOOT,
    FU_QC_RESUME_POINT_POST_REBOOT,
    FU_QC_RESUME_POINT_POST_COMMIT,
} FuQcResumePoint;
const gchar *fu_qc_resume_point_to_string(FuQcResumePoint val);
typedef enum {
    FU_QC_START_STATUS_SUCCESS = 0,
    FU_QC_START_STATUS_FAILURE = 1,
} FuQcStartStatus;
const gchar *fu_qc_start_status_to_string(FuQcStartStatus val);
typedef enum {
    FU_QC_MORE_DATA_MORE = 0,
    FU_QC_MORE_DATA_LAST = 1,
} FuQcMoreData;
typedef enum {
    FU_QC_COMMIT_ACTION_UPGRADE = 0,
    FU_QC_COMMIT_ACTION_ROLLBACK = 1,
} FuQcCommitAction;

GByteArray *fu_struct_qc_connect_req_new(void);
#define FU_STRUCT_QC_CONNECT_REQ_OFFSET_REQ 0x0
#define FU_STRUCT_QC_CONNECT_REQ_SIZE 0x1
#define FU_STRUCT_QC_CONNECT_REQ_DEFAULT_REQ FU_QC_REQ_CONNECT

GByteArray *fu_struct_qc_disconnect_req_new(void);
#define FU_STRUCT_QC_DISCONNECT_REQ_OFFSET_REQ 0x0
#define FU_STRUCT_QC_DISCONNECT_REQ_SIZE 0x1
#define FU_STRUCT_QC_DISCONNECT_REQ_DEFAULT_REQ FU_QC_REQ_DISCONNECT

GByteArray *fu_struct_qc_update_status_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
FuQcStatus fu_struct_qc_update_status_get_status(const GByteArray *st);
#define FU_STRUCT_QC_UPDATE_STATUS_OFFSET_STATUS 0x0
#define FU_STRUCT_QC_UPDATE_STATUS_SIZE 0x1

GByteArray *fu_struct_qc_version_req_new(void);
#define FU_STRUCT_QC_VERSION_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_VERSION_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_VERSION_REQ_SIZE 0x3
#define FU_STRUCT_QC_VERSION_REQ_DEFAULT_OPCODE FU_QC_OPCODE_HOST_VERSION_REQ
#define FU_STRUCT_QC_VERSION_REQ_DEFAULT_DATA_LEN 0x00

GByteArray *fu_struct_qc_version_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint16 fu_struct_qc_version_get_major(const GByteArray *st);
guint16 fu_struct_qc_version_get_minor(const GByteArray *st);
guint16 fu_struct_qc_version_get_config(const GByteArray *st);
#define FU_STRUCT_QC_VERSION_OFFSET_STATUS 0x0
#define FU_STRUCT_QC_VERSION_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_VERSION_OFFSET_MAJOR 0x3
#define FU_STRUCT_QC_VERSION_OFFSET_MINOR 0x5
#define FU_STRUCT_QC_VERSION_OFFSET_CONFIG 0x7
#define FU_STRUCT_QC_VERSION_SIZE 0x9
#define FU_STRUCT_QC_VERSION_DEFAULT_STATUS FU_QC_OPCODE_HOST_VERSION_CFM
#define FU_STRUCT_QC_VERSION_DEFAULT_DATA_LEN 0x0006

GByteArray *fu_struct_qc_abort_req_new(void);
void fu_struct_qc_abort_req_set_data_len(GByteArray *st, guint16 value);
#define FU_STRUCT_QC_ABORT_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_ABORT_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_ABORT_REQ_SIZE 0x3
#define FU_STRUCT_QC_ABORT_REQ_DEFAULT_OPCODE FU_QC_OPCODE_ABORT_REQ
#define FU_STRUCT_QC_ABORT_REQ_DEFAULT_DATA_LEN 0x00

GByteArray *fu_struct_qc_abort_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint16 fu_struct_qc_abort_get_data_len(const GByteArray *st);
#define FU_STRUCT_QC_ABORT_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_ABORT_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_ABORT_SIZE 0x3
#define FU_STRUCT_QC_ABORT_DEFAULT_OPCODE FU_QC_OPCODE_ABORT_CFM
#define FU_STRUCT_QC_ABORT_DEFAULT_DATA_LEN 0x00

GByteArray *fu_struct_qc_sync_req_new(void);
void fu_struct_qc_sync_req_set_data_len(GByteArray *st, guint16 value);
void fu_struct_qc_sync_req_set_file_id(GByteArray *st, guint32 value);
#define FU_STRUCT_QC_SYNC_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_SYNC_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_SYNC_REQ_OFFSET_FILEID 0x3
#define FU_STRUCT_QC_SYNC_REQ_SIZE 0x7
#define FU_STRUCT_QC_SYNC_REQ_DEFAULT_OPCODE FU_QC_OPCODE_SYNC_REQ
#define FU_STRUCT_QC_SYNC_REQ_DEFAULT_DATA_LEN 0x04

GByteArray *fu_struct_qc_sync_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint16 fu_struct_qc_sync_get_data_len(const GByteArray *st);
FuQcResumePoint fu_struct_qc_sync_get_resume_point(const GByteArray *st);
guint32 fu_struct_qc_sync_get_file_id(const GByteArray *st);
guint8 fu_struct_qc_sync_get_protocol_version(const GByteArray *st);
#define FU_STRUCT_QC_SYNC_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_SYNC_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_SYNC_OFFSET_RESUME_POINT 0x3
#define FU_STRUCT_QC_SYNC_OFFSET_FILE_ID 0x4
#define FU_STRUCT_QC_SYNC_OFFSET_PROTOCOLVERSION 0x8
#define FU_STRUCT_QC_SYNC_SIZE 0x9
#define FU_STRUCT_QC_SYNC_DEFAULT_OPCODE FU_QC_OPCODE_SYNC_CFM
#define FU_STRUCT_QC_SYNC_DEFAULT_DATA_LEN 0x06

GByteArray *fu_struct_qc_start_req_new(void);
void fu_struct_qc_start_req_set_data_len(GByteArray *st, guint16 value);
#define FU_STRUCT_QC_START_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_START_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_START_REQ_SIZE 0x3
#define FU_STRUCT_QC_START_REQ_DEFAULT_OPCODE FU_QC_OPCODE_START_REQ
#define FU_STRUCT_QC_START_REQ_DEFAULT_DATA_LEN 0x00

GByteArray *fu_struct_qc_start_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint16 fu_struct_qc_start_get_data_len(const GByteArray *st);
FuQcStartStatus fu_struct_qc_start_get_status(const GByteArray *st);
guint16 fu_struct_qc_start_get_battery_level(const GByteArray *st);
#define FU_STRUCT_QC_START_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_START_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_START_OFFSET_STATUS 0x3
#define FU_STRUCT_QC_START_OFFSET_BATTERY_LEVEL 0x4
#define FU_STRUCT_QC_START_SIZE 0x6
#define FU_STRUCT_QC_START_DEFAULT_OPCODE FU_QC_OPCODE_START_CFM
#define FU_STRUCT_QC_START_DEFAULT_DATA_LEN 0x0003

GByteArray *fu_struct_qc_start_data_req_new(void);
void fu_struct_qc_start_data_req_set_data_len(GByteArray *st, guint16 value);
gboolean fu_struct_qc_start_data_req_set_data(GByteArray *st, const guint8 *buf, gsize bufsz, GError **error);
#define FU_STRUCT_QC_START_DATA_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_START_DATA_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_START_DATA_REQ_OFFSET_DATA 0x3
#define FU_STRUCT_QC_START_DATA_REQ_SIZE_DATA 0xFA
#define FU_STRUCT_QC_START_DATA_REQ_SIZE 0xFD
#define FU_STRUCT_QC_START_DATA_REQ_DEFAULT_OPCODE FU_QC_OPCODE_START_DATA_REQ
#define FU_STRUCT_QC_START_DATA_REQ_DEFAULT_DATA_LEN 0x00

GByteArray *fu_struct_qc_data_req_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint16 fu_struct_qc_data_req_get_data_len(const GByteArray *st);
guint32 fu_struct_qc_data_req_get_fw_data_len(const GByteArray *st);
guint32 fu_struct_qc_data_req_get_fw_data_offset(const GByteArray *st);
#define FU_STRUCT_QC_DATA_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_DATA_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_DATA_REQ_OFFSET_FW_DATA_LEN 0x3
#define FU_STRUCT_QC_DATA_REQ_OFFSET_FW_DATA_OFFSET 0x7
#define FU_STRUCT_QC_DATA_REQ_SIZE 0xB
#define FU_STRUCT_QC_DATA_REQ_DEFAULT_OPCODE FU_QC_OPCODE_DATA_BYTES_REQ
#define FU_STRUCT_QC_DATA_REQ_DEFAULT_DATA_LEN 0x0008

GByteArray *fu_struct_qc_data_new(void);
void fu_struct_qc_data_set_data_len(GByteArray *st, guint16 value);
void fu_struct_qc_data_set_last_packet(GByteArray *st, FuQcMoreData value);
gboolean fu_struct_qc_data_set_data(GByteArray *st, const guint8 *buf, gsize bufsz, GError **error);
#define FU_STRUCT_QC_DATA_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_DATA_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_DATA_OFFSET_LAST_PACKET 0x3
#define FU_STRUCT_QC_DATA_OFFSET_DATA 0x4
#define FU_STRUCT_QC_DATA_SIZE_DATA 0xF9
#define FU_STRUCT_QC_DATA_SIZE 0xFD
#define FU_STRUCT_QC_DATA_DEFAULT_OPCODE FU_QC_OPCODE_DATA

GByteArray *fu_struct_qc_validation_req_new(void);
void fu_struct_qc_validation_req_set_data_len(GByteArray *st, guint16 value);
#define FU_STRUCT_QC_VALIDATION_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_VALIDATION_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_VALIDATION_REQ_SIZE 0x3
#define FU_STRUCT_QC_VALIDATION_REQ_DEFAULT_OPCODE FU_QC_OPCODE_IS_VALIDATION_DONE_REQ
#define FU_STRUCT_QC_VALIDATION_REQ_DEFAULT_DATA_LEN 0x00

GByteArray *fu_struct_qc_validation_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
FuQcOpcode fu_struct_qc_validation_get_opcode(const GByteArray *st);
guint16 fu_struct_qc_validation_get_data_len(const GByteArray *st);
guint16 fu_struct_qc_validation_get_delay(const GByteArray *st);
#define FU_STRUCT_QC_VALIDATION_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_VALIDATION_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_VALIDATION_OFFSET_DELAY 0x3
#define FU_STRUCT_QC_VALIDATION_SIZE 0x5

GByteArray *fu_struct_qc_transfer_complete_new(void);
void fu_struct_qc_transfer_complete_set_data_len(GByteArray *st, guint16 value);
void fu_struct_qc_transfer_complete_set_action(GByteArray *st, FuQcAction value);
#define FU_STRUCT_QC_TRANSFER_COMPLETE_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_TRANSFER_COMPLETE_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_TRANSFER_COMPLETE_OFFSET_ACTION 0x3
#define FU_STRUCT_QC_TRANSFER_COMPLETE_SIZE 0x4
#define FU_STRUCT_QC_TRANSFER_COMPLETE_DEFAULT_OPCODE FU_QC_OPCODE_TRANSFER_COMPLETE_RES
#define FU_STRUCT_QC_TRANSFER_COMPLETE_DEFAULT_DATA_LEN 0x01

GByteArray *fu_struct_qc_proceed_to_commit_new(void);
void fu_struct_qc_proceed_to_commit_set_data_len(GByteArray *st, guint16 value);
void fu_struct_qc_proceed_to_commit_set_action(GByteArray *st, FuQcAction value);
#define FU_STRUCT_QC_PROCEED_TO_COMMIT_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_PROCEED_TO_COMMIT_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_PROCEED_TO_COMMIT_OFFSET_ACTION 0x3
#define FU_STRUCT_QC_PROCEED_TO_COMMIT_SIZE 0x4
#define FU_STRUCT_QC_PROCEED_TO_COMMIT_DEFAULT_OPCODE FU_QC_OPCODE_PROCEED_TO_COMMIT
#define FU_STRUCT_QC_PROCEED_TO_COMMIT_DEFAULT_DATA_LEN 0x01

GByteArray *fu_struct_qc_commit_req_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint16 fu_struct_qc_commit_req_get_data_len(const GByteArray *st);
#define FU_STRUCT_QC_COMMIT_REQ_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_COMMIT_REQ_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_COMMIT_REQ_SIZE 0x3
#define FU_STRUCT_QC_COMMIT_REQ_DEFAULT_OPCODE FU_QC_OPCODE_COMMIT_REQ
#define FU_STRUCT_QC_COMMIT_REQ_DEFAULT_DATA_LEN 0x00

GByteArray *fu_struct_qc_commit_cfm_new(void);
void fu_struct_qc_commit_cfm_set_data_len(GByteArray *st, guint16 value);
void fu_struct_qc_commit_cfm_set_action(GByteArray *st, FuQcCommitAction value);
#define FU_STRUCT_QC_COMMIT_CFM_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_COMMIT_CFM_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_COMMIT_CFM_OFFSET_ACTION 0x3
#define FU_STRUCT_QC_COMMIT_CFM_SIZE 0x4
#define FU_STRUCT_QC_COMMIT_CFM_DEFAULT_OPCODE FU_QC_OPCODE_COMMIT_CFM
#define FU_STRUCT_QC_COMMIT_CFM_DEFAULT_DATA_LEN 0x01

GByteArray *fu_struct_qc_complete_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint16 fu_struct_qc_complete_get_data_len(const GByteArray *st);
#define FU_STRUCT_QC_COMPLETE_OFFSET_OPCODE 0x0
#define FU_STRUCT_QC_COMPLETE_OFFSET_DATA_LEN 0x1
#define FU_STRUCT_QC_COMPLETE_SIZE 0x3
#define FU_STRUCT_QC_COMPLETE_DEFAULT_OPCODE FU_QC_OPCODE_COMPLETE_IND
#define FU_STRUCT_QC_COMPLETE_DEFAULT_DATA_LEN 0x00
