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

#pragma once
#include <fu-input-stream.h>
/**
 * FuPixartRfOtaSpecCheckResult:
 */
typedef enum {
    /**
     * FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_OK:
     */
    FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_OK = 1,
    /**
     * FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_FW_OUT_OF_BOUNDS:
     */
    FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_FW_OUT_OF_BOUNDS = 2,
    /**
     * FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_PROCESS_ILLEGAL:
     */
    FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_PROCESS_ILLEGAL = 3,
    /**
     * FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_RECONNECT:
     */
    FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_RECONNECT = 4,
    /**
     * FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_FW_IMG_VERSION_ERROR:
     */
    FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_FW_IMG_VERSION_ERROR = 5,
    /**
     * FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_DEVICE_LOW_BATTERY:
     */
    FU_PIXART_RF_OTA_SPEC_CHECK_RESULT_DEVICE_LOW_BATTERY = 6,
}  FuPixartRfOtaSpecCheckResult;
const gchar *fu_pixart_rf_ota_spec_check_result_to_string(FuPixartRfOtaSpecCheckResult val) G_GNUC_CONST;
/**
 * FuPixartRfWirelessModuleOtaRspCode:
 */
typedef enum {
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_OK:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_OK,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_FINISH:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_FINISH,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_FAIL:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_FAIL,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_ERROR:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_ERROR,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_WRITE_PKT_LEN_ERROR:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_WRITE_PKT_LEN_ERROR,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_WRITE_PKT_TOTAL_SIZE_ERROR:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_WRITE_PKT_TOTAL_SIZE_ERROR,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_READ_PKT_LEN_ERROR:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_READ_PKT_LEN_ERROR,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_NOT_READY:
     */
    FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_NOT_READY,
}  FuPixartRfWirelessModuleOtaRspCode;
#define FU_PIXART_RF_WIRELESS_MODULE_OTA_RSP_CODE_LAST 8
const gchar *fu_pixart_rf_wireless_module_ota_rsp_code_to_string(FuPixartRfWirelessModuleOtaRspCode val) G_GNUC_CONST;
/**
 * FuPixartRfOtaDisconnectReason:
 */
typedef enum {
    /**
     * FU_PIXART_RF_OTA_DISCONNECT_REASON_CODE_JUMP:
     */
    FU_PIXART_RF_OTA_DISCONNECT_REASON_CODE_JUMP = 1,
    /**
     * FU_PIXART_RF_OTA_DISCONNECT_REASON_UPDATE_DONE:
     */
    FU_PIXART_RF_OTA_DISCONNECT_REASON_UPDATE_DONE = 2,
    /**
     * FU_PIXART_RF_OTA_DISCONNECT_REASON_RESET:
     */
    FU_PIXART_RF_OTA_DISCONNECT_REASON_RESET,
}  FuPixartRfOtaDisconnectReason;
/**
 * FuPixartRfWirelessModuleType:
 *
 * OTA rsp code for wireless module
 */
typedef enum {
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_TYPE_MOUSE:
     */
    FU_PIXART_RF_WIRELESS_MODULE_TYPE_MOUSE,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_TYPE_KEYBOARD:
     */
    FU_PIXART_RF_WIRELESS_MODULE_TYPE_KEYBOARD,
    /**
     * FU_PIXART_RF_WIRELESS_MODULE_TYPE_RECEIVER:
     */
    FU_PIXART_RF_WIRELESS_MODULE_TYPE_RECEIVER,
}  FuPixartRfWirelessModuleType;
#define FU_PIXART_RF_WIRELESS_MODULE_TYPE_LAST 3
/**
 * FuPixartRfDeviceCmd:
 */
typedef enum {
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_INIT:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_INIT = 0x10,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_WRITE:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_WRITE = 0x17,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_UPGRADE:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_UPGRADE = 0x18,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_MCU_RESET:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_MCU_RESET = 0x22,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_GET_INFO:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_GET_INFO = 0x23,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OBJECT_CREATE:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OBJECT_CREATE = 0x25,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_INIT_NEW:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_INIT_NEW = 0x27,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_RETRANSMIT:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_RETRANSMIT = 0x28,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_DISCONNECT:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_DISCONNECT = 0x29,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_GET_NUM_OF_MODELS:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_GET_NUM_OF_MODELS = 0x2A,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_GET_MODEL:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_GET_MODEL = 0x2B,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_PAYLOAD_CONTENT:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_PAYLOAD_CONTENT = 0x40,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_CHECK_CRC:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_CHECK_CRC = 0x41,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_INIT_NEW_CHECK:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_INIT_NEW_CHECK = 0x42,
    /**
     * FU_PIXART_RF_DEVICE_CMD_FW_OTA_PRECEDING:
     */
    FU_PIXART_RF_DEVICE_CMD_FW_OTA_PRECEDING = 0x44,
}  FuPixartRfDeviceCmd;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructPixartRfOtaFwState;

FuStructPixartRfOtaFwState *fu_struct_pixart_rf_ota_fw_state_ref(FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1);
void fu_struct_pixart_rf_ota_fw_state_unref(FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructPixartRfOtaFwState, fu_struct_pixart_rf_ota_fw_state_unref)
FuStructPixartRfOtaFwState *fu_struct_pixart_rf_ota_fw_state_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_pixart_rf_ota_fw_state_get_status(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_pixart_rf_ota_fw_state_get_new_flow(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_pixart_rf_ota_fw_state_get_offset(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_pixart_rf_ota_fw_state_get_checksum(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_pixart_rf_ota_fw_state_get_max_object_size(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_pixart_rf_ota_fw_state_get_mtu_size(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_pixart_rf_ota_fw_state_get_prn_threshold(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_pixart_rf_ota_fw_state_get_spec_check_result(const FuStructPixartRfOtaFwState *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_STATUS 0x0
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_NEW_FLOW 0x1
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_OFFSET 0x2
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_CHECKSUM 0x4
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_MAX_OBJECT_SIZE 0x6
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_MTU_SIZE 0xA
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_PRN_THRESHOLD 0xC
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_OFFSET_SPEC_CHECK_RESULT 0xE
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_PIXART_RF_OTA_FW_STATE_SIZE 0xF
#endif

#ifndef __GI_SCANNER__
#endif
