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

#pragma once
#include <fu-input-stream.h>
/**
 * FuLegionHidUpgradeStep:
 */
typedef enum {
    /**
     * FU_LEGION_HID_UPGRADE_STEP_START:
     */
    FU_LEGION_HID_UPGRADE_STEP_START = 0x50,
    /**
     * FU_LEGION_HID_UPGRADE_STEP_QUERY_SIZE:
     */
    FU_LEGION_HID_UPGRADE_STEP_QUERY_SIZE,
    /**
     * FU_LEGION_HID_UPGRADE_STEP_WRITE_DATA:
     */
    FU_LEGION_HID_UPGRADE_STEP_WRITE_DATA,
    /**
     * FU_LEGION_HID_UPGRADE_STEP_VERIFY:
     */
    FU_LEGION_HID_UPGRADE_STEP_VERIFY,
}  FuLegionHidUpgradeStep;
/**
 * FuLegionHidResponseStatus:
 */
typedef enum {
    /**
     * FU_LEGION_HID_RESPONSE_STATUS_OK:
     */
    FU_LEGION_HID_RESPONSE_STATUS_OK = 0x00,
    /**
     * FU_LEGION_HID_RESPONSE_STATUS_FAIL:
     */
    FU_LEGION_HID_RESPONSE_STATUS_FAIL,
    /**
     * FU_LEGION_HID_RESPONSE_STATUS_BUSY:
     */
    FU_LEGION_HID_RESPONSE_STATUS_BUSY,
}  FuLegionHidResponseStatus;
/**
 * FuLegionHidDeviceId:
 */
typedef enum {
    /**
     * FU_LEGION_HID_DEVICE_ID_UNKNOWN:
     */
    FU_LEGION_HID_DEVICE_ID_UNKNOWN,
    /**
     * FU_LEGION_HID_DEVICE_ID_RX:
     */
    FU_LEGION_HID_DEVICE_ID_RX,
    /**
     * FU_LEGION_HID_DEVICE_ID_DONGLE:
     */
    FU_LEGION_HID_DEVICE_ID_DONGLE,
    /**
     * FU_LEGION_HID_DEVICE_ID_GAMEPAD_L:
     */
    FU_LEGION_HID_DEVICE_ID_GAMEPAD_L,
    /**
     * FU_LEGION_HID_DEVICE_ID_GAMEPAD_R:
     */
    FU_LEGION_HID_DEVICE_ID_GAMEPAD_R,
    /**
     * FU_LEGION_HID_DEVICE_ID_GAMEPAD_L2:
     */
    FU_LEGION_HID_DEVICE_ID_GAMEPAD_L2,
    /**
     * FU_LEGION_HID_DEVICE_ID_GAMEPAD_R2:
     */
    FU_LEGION_HID_DEVICE_ID_GAMEPAD_R2,
    /**
     * FU_LEGION_HID_DEVICE_ID_GAMEPAD_L3:
     */
    FU_LEGION_HID_DEVICE_ID_GAMEPAD_L3,
    /**
     * FU_LEGION_HID_DEVICE_ID_GAMEPAD_R3:
     */
    FU_LEGION_HID_DEVICE_ID_GAMEPAD_R3,
}  FuLegionHidDeviceId;
#define FU_LEGION_HID_DEVICE_ID_LAST 9
/**
 * FuLegionHidCmdConstant:
 */
typedef enum {
    /**
     * FU_LEGION_HID_CMD_CONSTANT_SN:
     */
    FU_LEGION_HID_CMD_CONSTANT_SN = 0x01,
    /**
     * FU_LEGION_HID_CMD_CONSTANT_UPGRADE_SEND_CMD:
     */
    FU_LEGION_HID_CMD_CONSTANT_UPGRADE_SEND_CMD = 0x01,
    /**
     * FU_LEGION_HID_CMD_CONSTANT_UPGRADE_SEND_DATA:
     */
    FU_LEGION_HID_CMD_CONSTANT_UPGRADE_SEND_DATA = 0x02,
    /**
     * FU_LEGION_HID_CMD_CONSTANT_OUTPUT_REPORT_ID:
     */
    FU_LEGION_HID_CMD_CONSTANT_OUTPUT_REPORT_ID = 0x05,
}  FuLegionHidCmdConstant;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructLegionHidUpgradeCmd;

FuStructLegionHidUpgradeCmd *fu_struct_legion_hid_upgrade_cmd_ref(FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_cmd_unref(FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructLegionHidUpgradeCmd, fu_struct_legion_hid_upgrade_cmd_unref)
FuStructLegionHidUpgradeCmd *fu_struct_legion_hid_upgrade_cmd_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidCmdConstant fu_struct_legion_hid_upgrade_cmd_get_report_id(const FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_cmd_get_length(const FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_cmd_get_main_id(const FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_cmd_get_sub_id(const FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidDeviceId fu_struct_legion_hid_upgrade_cmd_get_device_id(const FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidCmdConstant fu_struct_legion_hid_upgrade_cmd_get_param(const FuStructLegionHidUpgradeCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_legion_hid_upgrade_cmd_get_data(const FuStructLegionHidUpgradeCmd *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_legion_hid_upgrade_cmd_set_report_id(FuStructLegionHidUpgradeCmd *st, FuLegionHidCmdConstant value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_cmd_set_length(FuStructLegionHidUpgradeCmd *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_cmd_set_main_id(FuStructLegionHidUpgradeCmd *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_cmd_set_sub_id(FuStructLegionHidUpgradeCmd *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_cmd_set_device_id(FuStructLegionHidUpgradeCmd *st, FuLegionHidDeviceId value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_cmd_set_param(FuStructLegionHidUpgradeCmd *st, FuLegionHidCmdConstant value) G_GNUC_NON_NULL(1);
gboolean fu_struct_legion_hid_upgrade_cmd_set_data(FuStructLegionHidUpgradeCmd *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_OFFSET_LENGTH 0x1
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_OFFSET_MAIN_ID 0x2
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_OFFSET_SUB_ID 0x3
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_OFFSET_DEVICE_ID 0x4
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_OFFSET_PARAM 0x5
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_OFFSET_DATA 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_SIZE_DATA 0x3A
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_N_ELEMENTS_DATA 58
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_SIZE 0x40
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_DEFAULT_REPORT_ID FU_LEGION_HID_CMD_CONSTANT_OUTPUT_REPORT_ID
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_DEFAULT_MAIN_ID 0x53
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_DEFAULT_SUB_ID 0x11
#define FU_STRUCT_LEGION_HID_UPGRADE_CMD_DEFAULT_PARAM FU_LEGION_HID_CMD_CONSTANT_UPGRADE_SEND_CMD
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructLegionHidUpgradeRsp;

FuStructLegionHidUpgradeRsp *fu_struct_legion_hid_upgrade_rsp_ref(FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_rsp_unref(FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructLegionHidUpgradeRsp, fu_struct_legion_hid_upgrade_rsp_unref)
FuStructLegionHidUpgradeRsp *fu_struct_legion_hid_upgrade_rsp_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_rsp_get_report_id(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_rsp_get_length(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_rsp_get_main_id(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_rsp_get_sub_id(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidDeviceId fu_struct_legion_hid_upgrade_rsp_get_id(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_rsp_get_param(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_rsp_get_data_length(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_rsp_get_step(const FuStructLegionHidUpgradeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_LENGTH 0x1
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_MAIN_ID 0x2
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_SUB_ID 0x3
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_ID 0x4
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_PARAM 0x5
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_DATA_LENGTH 0x6
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_STEP 0x7
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_OFFSET_RESPONSE 0x9
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_SIZE 0xA
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_RSP_DEFAULT_RESPONSE FU_LEGION_HID_RESPONSE_STATUS_OK
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructLegionHidUpgradeQuerySizeRsp;

FuStructLegionHidUpgradeQuerySizeRsp *fu_struct_legion_hid_upgrade_query_size_rsp_ref(FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_query_size_rsp_unref(FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructLegionHidUpgradeQuerySizeRsp, fu_struct_legion_hid_upgrade_query_size_rsp_unref)
FuStructLegionHidUpgradeQuerySizeRsp *fu_struct_legion_hid_upgrade_query_size_rsp_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_report_id(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_length(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_main_id(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_sub_id(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidDeviceId fu_struct_legion_hid_upgrade_query_size_rsp_get_id(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_param(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_data_length(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_step(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_query_size_rsp_get_response(const FuStructLegionHidUpgradeQuerySizeRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_LENGTH 0x1
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_MAIN_ID 0x2
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_SUB_ID 0x3
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_ID 0x4
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_PARAM 0x5
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_DATA_LENGTH 0x6
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_STEP 0x7
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_OFFSET_RESPONSE 0x9
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_QUERY_SIZE_RSP_SIZE 0xA
#endif

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

FuStructLegionHidUpgradeStartParam *fu_struct_legion_hid_upgrade_start_param_ref(FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_start_param_unref(FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructLegionHidUpgradeStartParam, fu_struct_legion_hid_upgrade_start_param_unref)
FuStructLegionHidUpgradeStartParam *fu_struct_legion_hid_upgrade_start_param_new(void) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_start_param_get_length(const FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidUpgradeStep fu_struct_legion_hid_upgrade_start_param_get_step(const FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_upgrade_start_param_get_flag(const FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_legion_hid_upgrade_start_param_get_crc16(const FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_legion_hid_upgrade_start_param_get_size(const FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidCmdConstant fu_struct_legion_hid_upgrade_start_param_get_sn(const FuStructLegionHidUpgradeStartParam *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_legion_hid_upgrade_start_param_set_length(FuStructLegionHidUpgradeStartParam *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_start_param_set_step(FuStructLegionHidUpgradeStartParam *st, FuLegionHidUpgradeStep value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_start_param_set_flag(FuStructLegionHidUpgradeStartParam *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_start_param_set_crc16(FuStructLegionHidUpgradeStartParam *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_start_param_set_size(FuStructLegionHidUpgradeStartParam *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_start_param_set_sn(FuStructLegionHidUpgradeStartParam *st, FuLegionHidCmdConstant value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_OFFSET_LENGTH 0x0
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_OFFSET_STEP 0x1
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_OFFSET_FLAG 0x2
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_OFFSET_CRC16 0x3
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_OFFSET_SIZE 0x5
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_OFFSET_SN 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_SIZE 0x9
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_DEFAULT_LENGTH 0x08
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_DEFAULT_STEP FU_LEGION_HID_UPGRADE_STEP_START
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_DEFAULT_FLAG 0x00
#define FU_STRUCT_LEGION_HID_UPGRADE_START_PARAM_DEFAULT_SN FU_LEGION_HID_CMD_CONSTANT_SN
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructLegionHidUpgradePacket;

FuStructLegionHidUpgradePacket *fu_struct_legion_hid_upgrade_packet_ref(FuStructLegionHidUpgradePacket *st) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_upgrade_packet_unref(FuStructLegionHidUpgradePacket *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructLegionHidUpgradePacket, fu_struct_legion_hid_upgrade_packet_unref)
FuStructLegionHidUpgradePacket *fu_struct_legion_hid_upgrade_packet_new(void) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_legion_hid_upgrade_packet_set_data(FuStructLegionHidUpgradePacket *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_legion_hid_upgrade_packet_set_sn(FuStructLegionHidUpgradePacket *st, FuLegionHidCmdConstant value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_PACKET_OFFSET_DATA 0x0
#define FU_STRUCT_LEGION_HID_UPGRADE_PACKET_OFFSET_SN 0x20
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_PACKET_SIZE_DATA 0x20
#define FU_STRUCT_LEGION_HID_UPGRADE_PACKET_N_ELEMENTS_DATA 32
#define FU_STRUCT_LEGION_HID_UPGRADE_PACKET_SIZE 0x21
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_UPGRADE_PACKET_DEFAULT_SN FU_LEGION_HID_CMD_CONSTANT_SN
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructLegionHidNormalCmd;

FuStructLegionHidNormalCmd *fu_struct_legion_hid_normal_cmd_ref(FuStructLegionHidNormalCmd *st) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_normal_cmd_unref(FuStructLegionHidNormalCmd *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructLegionHidNormalCmd, fu_struct_legion_hid_normal_cmd_unref)
FuStructLegionHidNormalCmd *fu_struct_legion_hid_normal_cmd_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidCmdConstant fu_struct_legion_hid_normal_cmd_get_report_id(const FuStructLegionHidNormalCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_normal_cmd_get_length(const FuStructLegionHidNormalCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_normal_cmd_get_main_id(const FuStructLegionHidNormalCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_legion_hid_normal_cmd_get_sub_id(const FuStructLegionHidNormalCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuLegionHidDeviceId fu_struct_legion_hid_normal_cmd_get_device_id(const FuStructLegionHidNormalCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_legion_hid_normal_cmd_get_data(const FuStructLegionHidNormalCmd *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_legion_hid_normal_cmd_set_report_id(FuStructLegionHidNormalCmd *st, FuLegionHidCmdConstant value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_normal_cmd_set_length(FuStructLegionHidNormalCmd *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_normal_cmd_set_main_id(FuStructLegionHidNormalCmd *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_normal_cmd_set_sub_id(FuStructLegionHidNormalCmd *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_normal_cmd_set_device_id(FuStructLegionHidNormalCmd *st, FuLegionHidDeviceId value) G_GNUC_NON_NULL(1);
gboolean fu_struct_legion_hid_normal_cmd_set_data(FuStructLegionHidNormalCmd *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_OFFSET_LENGTH 0x1
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_OFFSET_MAIN_ID 0x2
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_OFFSET_SUB_ID 0x3
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_OFFSET_DEVICE_ID 0x4
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_OFFSET_DATA 0x5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_SIZE_DATA 0x3B
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_N_ELEMENTS_DATA 59
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_SIZE 0x40
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_NORMAL_CMD_DEFAULT_REPORT_ID FU_LEGION_HID_CMD_CONSTANT_OUTPUT_REPORT_ID
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructLegionHidBinHeader;

FuStructLegionHidBinHeader *fu_struct_legion_hid_bin_header_ref(FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_bin_header_unref(FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructLegionHidBinHeader, fu_struct_legion_hid_bin_header_unref)
FuStructLegionHidBinHeader *fu_struct_legion_hid_bin_header_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_legion_hid_bin_header_get_mcu_size(const FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_legion_hid_bin_header_get_mcu_version(const FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_legion_hid_bin_header_get_left_size(const FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_legion_hid_bin_header_get_left_version(const FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_legion_hid_bin_header_get_right_size(const FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_legion_hid_bin_header_get_right_version(const FuStructLegionHidBinHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_legion_hid_bin_header_set_mcu_size(FuStructLegionHidBinHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_bin_header_set_mcu_version(FuStructLegionHidBinHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_bin_header_set_left_size(FuStructLegionHidBinHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_bin_header_set_left_version(FuStructLegionHidBinHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_bin_header_set_right_size(FuStructLegionHidBinHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_legion_hid_bin_header_set_right_version(FuStructLegionHidBinHeader *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_BIN_HEADER_OFFSET_MCU_SIZE 0x0
#define FU_STRUCT_LEGION_HID_BIN_HEADER_OFFSET_MCU_VERSION 0x4
#define FU_STRUCT_LEGION_HID_BIN_HEADER_OFFSET_LEFT_SIZE 0x8
#define FU_STRUCT_LEGION_HID_BIN_HEADER_OFFSET_LEFT_VERSION 0xC
#define FU_STRUCT_LEGION_HID_BIN_HEADER_OFFSET_RIGHT_SIZE 0x10
#define FU_STRUCT_LEGION_HID_BIN_HEADER_OFFSET_RIGHT_VERSION 0x14
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_LEGION_HID_BIN_HEADER_SIZE 0x18
#endif

#ifndef __GI_SCANNER__
#endif
