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

#pragma once
#include <fu-input-stream.h>
/**
 * FuAsusHidController:
 */
typedef enum {
    /**
     * FU_ASUS_HID_CONTROLLER_PRIMARY:
     */
    FU_ASUS_HID_CONTROLLER_PRIMARY,
    /**
     * FU_ASUS_HID_CONTROLLER_MAIN:
     */
    FU_ASUS_HID_CONTROLLER_MAIN,
}  FuAsusHidController;
#define FU_ASUS_HID_CONTROLLER_LAST 2
/**
 * FuAsusHidCommand:
 *
 * these are called with report ID 0x5A
 */
typedef enum {
    /**
     * FU_ASUS_HID_COMMAND_INIT_SEQUENCE:
     *
     * No idea
     */
    FU_ASUS_HID_COMMAND_INIT_SEQUENCE = 0x010101d1,
    /**
     * FU_ASUS_HID_COMMAND_PRE_UPDATE:
     */
    FU_ASUS_HID_COMMAND_PRE_UPDATE = 0x200005,
    /**
     * FU_ASUS_HID_COMMAND_PRE_UPDATE2:
     *
     * packet 265 in ally-x (Get report response in 268)
     */
    FU_ASUS_HID_COMMAND_PRE_UPDATE2 = 0x200907,
    /**
     * FU_ASUS_HID_COMMAND_PRE_UPDATE3:
     *
     * packet 269 in ally-x
     */
    FU_ASUS_HID_COMMAND_PRE_UPDATE3 = 0x200908,
    /**
     * FU_ASUS_HID_COMMAND_PRE_UPDATE4:
     *
     * packet 271 in ally-x (Get report response in 274)
     */
    FU_ASUS_HID_COMMAND_PRE_UPDATE4 = 0x260b07,
    /**
     * FU_ASUS_HID_COMMAND_PRE_UPDATE5:
     *
     * packet 275 in ally-x
     */
    FU_ASUS_HID_COMMAND_PRE_UPDATE5 = 0x260b08,
    /**
     * FU_ASUS_HID_COMMAND_PRE_UPDATE6:
     */
    FU_ASUS_HID_COMMAND_PRE_UPDATE6 = 0x9332e0,
    /**
     * FU_ASUS_HID_COMMAND_GET_FW_CONFIG:
     *
     * OEM_GetFWConfig
     */
    FU_ASUS_HID_COMMAND_GET_FW_CONFIG = 0x312005,
    /**
     * FU_ASUS_HID_COMMAND_FW_VERSION:
     *
     * OEM_GetFWVersion
     */
    FU_ASUS_HID_COMMAND_FW_VERSION = 0x00310305,
    /**
     * FU_ASUS_HID_COMMAND_MAIN_FW_VERSION:
     *
     * OEM_GetMainFWVersion
     */
    FU_ASUS_HID_COMMAND_MAIN_FW_VERSION = 0x00310405,
    /**
     * FU_ASUS_HID_COMMAND_FLASH_TASK_SOMETHING:
     */
    FU_ASUS_HID_COMMAND_FLASH_TASK_SOMETHING = 0xc000,
    /**
     * FU_ASUS_HID_COMMAND_FLASH_TASK_SOMETHING2:
     */
    FU_ASUS_HID_COMMAND_FLASH_TASK_SOMETHING2 = 0xd000,
    /**
     * FU_ASUS_HID_COMMAND_SWITCH_TO_ROM:
     *
     * OEM_MainSwitchToRom, doesn't appear in packet cap
     */
    FU_ASUS_HID_COMMAND_SWITCH_TO_ROM = 0xd2,
}  FuAsusHidCommand;
/**
 * FuAsusHidReportId:
 *
 * Info stuff happens on report ID 0x5A
 * Flashing seems to happen on report ID 0x0
 */
typedef enum {
    /**
     * FU_ASUS_HID_REPORT_ID_FLASHING:
     */
    FU_ASUS_HID_REPORT_ID_FLASHING = 0x00,
    /**
     * FU_ASUS_HID_REPORT_ID_INFO:
     */
    FU_ASUS_HID_REPORT_ID_INFO = 0x5A,
}  FuAsusHidReportId;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAsusManCommand;

FuStructAsusManCommand *fu_struct_asus_man_command_ref(FuStructAsusManCommand *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_man_command_unref(FuStructAsusManCommand *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusManCommand, fu_struct_asus_man_command_unref)
FuStructAsusManCommand *fu_struct_asus_man_command_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_MAN_COMMAND_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ASUS_MAN_COMMAND_OFFSET_DATA 0x1
#define FU_STRUCT_ASUS_MAN_COMMAND_OFFSET_TERMINATOR 0xF
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_MAN_COMMAND_SIZE_DATA 0xE
#define FU_STRUCT_ASUS_MAN_COMMAND_N_ELEMENTS_DATA 14
#define FU_STRUCT_ASUS_MAN_COMMAND_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_MAN_COMMAND_DEFAULT_REPORT_ID FU_ASUS_HID_REPORT_ID_INFO
#define FU_STRUCT_ASUS_MAN_COMMAND_DEFAULT_DATA "ASUSTech.Inc."
#define FU_STRUCT_ASUS_MAN_COMMAND_DEFAULT_TERMINATOR 0
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAsusManResult;

FuStructAsusManResult *fu_struct_asus_man_result_ref(FuStructAsusManResult *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_man_result_unref(FuStructAsusManResult *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusManResult, fu_struct_asus_man_result_unref)
FuStructAsusManResult *fu_struct_asus_man_result_new(void) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_asus_man_result_get_data(const FuStructAsusManResult *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_asus_man_result_set_data(FuStructAsusManResult *st, const gchar *value, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_MAN_RESULT_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ASUS_MAN_RESULT_OFFSET_DATA 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_MAN_RESULT_SIZE_DATA 0x1F
#define FU_STRUCT_ASUS_MAN_RESULT_N_ELEMENTS_DATA 31
#define FU_STRUCT_ASUS_MAN_RESULT_SIZE 0x20
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_MAN_RESULT_DEFAULT_REPORT_ID FU_ASUS_HID_REPORT_ID_INFO
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAsusHidCommand;

FuStructAsusHidCommand *fu_struct_asus_hid_command_ref(FuStructAsusHidCommand *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_hid_command_unref(FuStructAsusHidCommand *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusHidCommand, fu_struct_asus_hid_command_unref)
FuStructAsusHidCommand *fu_struct_asus_hid_command_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_asus_hid_command_set_cmd(FuStructAsusHidCommand *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_asus_hid_command_set_length(FuStructAsusHidCommand *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_COMMAND_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ASUS_HID_COMMAND_OFFSET_CMD 0x1
#define FU_STRUCT_ASUS_HID_COMMAND_OFFSET_LENGTH 0x5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_COMMAND_SIZE 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_COMMAND_DEFAULT_REPORT_ID FU_ASUS_HID_REPORT_ID_INFO
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAsusHidResult;

FuStructAsusHidResult *fu_struct_asus_hid_result_ref(FuStructAsusHidResult *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_hid_result_unref(FuStructAsusHidResult *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusHidResult, fu_struct_asus_hid_result_unref)
FuStructAsusHidResult *fu_struct_asus_hid_result_new(void) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_asus_hid_result_set_data(FuStructAsusHidResult *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_ASUS_HID_RESULT_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ASUS_HID_RESULT_OFFSET_DATA 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_RESULT_SIZE_DATA 0x1F
#define FU_STRUCT_ASUS_HID_RESULT_N_ELEMENTS_DATA 31
#define FU_STRUCT_ASUS_HID_RESULT_SIZE 0x20
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_RESULT_DEFAULT_REPORT_ID FU_ASUS_HID_REPORT_ID_INFO
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAsusHidDesc;

FuStructAsusHidDesc *fu_struct_asus_hid_desc_ref(FuStructAsusHidDesc *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_hid_desc_unref(FuStructAsusHidDesc *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusHidDesc, fu_struct_asus_hid_desc_unref)
FuStructAsusHidDesc *fu_struct_asus_hid_desc_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_asus_hid_desc_get_fga(const FuStructAsusHidDesc *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_asus_hid_desc_get_product(const FuStructAsusHidDesc *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_asus_hid_desc_get_version(const FuStructAsusHidDesc *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_DESC_OFFSET_FGA 0x0
#define FU_STRUCT_ASUS_HID_DESC_OFFSET_PRODUCT 0x9
#define FU_STRUCT_ASUS_HID_DESC_OFFSET_VERSION 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_DESC_SIZE_FGA 0x8
#define FU_STRUCT_ASUS_HID_DESC_N_ELEMENTS_FGA 8
#define FU_STRUCT_ASUS_HID_DESC_SIZE_PRODUCT 0x6
#define FU_STRUCT_ASUS_HID_DESC_N_ELEMENTS_PRODUCT 6
#define FU_STRUCT_ASUS_HID_DESC_SIZE_VERSION 0x8
#define FU_STRUCT_ASUS_HID_DESC_N_ELEMENTS_VERSION 8
#define FU_STRUCT_ASUS_HID_DESC_SIZE 0x19
#endif

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

FuStructAsusHidFwInfo *fu_struct_asus_hid_fw_info_ref(FuStructAsusHidFwInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_hid_fw_info_unref(FuStructAsusHidFwInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusHidFwInfo, fu_struct_asus_hid_fw_info_unref)
FuStructAsusHidFwInfo *fu_struct_asus_hid_fw_info_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructAsusHidCommand *fu_struct_asus_hid_fw_info_get_header(const FuStructAsusHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructAsusHidDesc *fu_struct_asus_hid_fw_info_get_description(const FuStructAsusHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean
fu_struct_asus_hid_fw_info_set_header(FuStructAsusHidFwInfo *st, const FuStructAsusHidCommand *st_donor, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
gboolean
fu_struct_asus_hid_fw_info_set_description(FuStructAsusHidFwInfo *st, const FuStructAsusHidDesc *st_donor, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_FW_INFO_OFFSET_HEADER 0x0
#define FU_STRUCT_ASUS_HID_FW_INFO_OFFSET_DESCRIPTION 0x7
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_FW_INFO_SIZE 0x20
#endif

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

FuStructAsusHidPreUpdateCommand *fu_struct_asus_hid_pre_update_command_ref(FuStructAsusHidPreUpdateCommand *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_hid_pre_update_command_unref(FuStructAsusHidPreUpdateCommand *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusHidPreUpdateCommand, fu_struct_asus_hid_pre_update_command_unref)
FuStructAsusHidPreUpdateCommand *fu_struct_asus_hid_pre_update_command_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_asus_hid_pre_update_command_set_cmd(FuStructAsusHidPreUpdateCommand *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_asus_hid_pre_update_command_set_length(FuStructAsusHidPreUpdateCommand *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_asus_hid_pre_update_command_set_data(FuStructAsusHidPreUpdateCommand *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_ASUS_HID_PRE_UPDATE_COMMAND_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ASUS_HID_PRE_UPDATE_COMMAND_OFFSET_CMD 0x1
#define FU_STRUCT_ASUS_HID_PRE_UPDATE_COMMAND_OFFSET_LENGTH 0x5
#define FU_STRUCT_ASUS_HID_PRE_UPDATE_COMMAND_OFFSET_DATA 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_PRE_UPDATE_COMMAND_SIZE_DATA 0x3A
#define FU_STRUCT_ASUS_HID_PRE_UPDATE_COMMAND_N_ELEMENTS_DATA 58
#define FU_STRUCT_ASUS_HID_PRE_UPDATE_COMMAND_SIZE 0x40
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_HID_PRE_UPDATE_COMMAND_DEFAULT_REPORT_ID FU_ASUS_HID_REPORT_ID_INFO
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAsusFlashReset;

FuStructAsusFlashReset *fu_struct_asus_flash_reset_ref(FuStructAsusFlashReset *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_flash_reset_unref(FuStructAsusFlashReset *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusFlashReset, fu_struct_asus_flash_reset_unref)
FuStructAsusFlashReset *fu_struct_asus_flash_reset_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_FLASH_RESET_OFFSET_COMMAND 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_FLASH_RESET_SIZE 0x3F
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_FLASH_RESET_DEFAULT_COMMAND 0xc4
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAsusReadFlashCommand;

FuStructAsusReadFlashCommand *fu_struct_asus_read_flash_command_ref(FuStructAsusReadFlashCommand *st) G_GNUC_NON_NULL(1);
void fu_struct_asus_read_flash_command_unref(FuStructAsusReadFlashCommand *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAsusReadFlashCommand, fu_struct_asus_read_flash_command_unref)
FuStructAsusReadFlashCommand *fu_struct_asus_read_flash_command_new(void) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_asus_read_flash_command_get_offset(const FuStructAsusReadFlashCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_asus_read_flash_command_get_datasz(const FuStructAsusReadFlashCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_asus_read_flash_command_get_data(const FuStructAsusReadFlashCommand *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_asus_read_flash_command_set_offset(FuStructAsusReadFlashCommand *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_asus_read_flash_command_set_datasz(FuStructAsusReadFlashCommand *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_asus_read_flash_command_set_data(FuStructAsusReadFlashCommand *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_ASUS_READ_FLASH_COMMAND_OFFSET_COMMAND 0x0
#define FU_STRUCT_ASUS_READ_FLASH_COMMAND_OFFSET_OFFSET 0x1
#define FU_STRUCT_ASUS_READ_FLASH_COMMAND_OFFSET_DATASZ 0x4
#define FU_STRUCT_ASUS_READ_FLASH_COMMAND_OFFSET_DATA 0x5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_READ_FLASH_COMMAND_SIZE_DATA 0x3A
#define FU_STRUCT_ASUS_READ_FLASH_COMMAND_N_ELEMENTS_DATA 58
#define FU_STRUCT_ASUS_READ_FLASH_COMMAND_SIZE 0x3F
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ASUS_READ_FLASH_COMMAND_DEFAULT_COMMAND 0xd1
#endif
