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

#pragma once
#include <fu-input-stream.h>
/**
 * FuEbitdoPktType:
 */
typedef enum {
    /**
     * FU_EBITDO_PKT_TYPE_USER_CMD:
     */
    FU_EBITDO_PKT_TYPE_USER_CMD = 0x00,
    /**
     * FU_EBITDO_PKT_TYPE_USER_DATA:
     */
    FU_EBITDO_PKT_TYPE_USER_DATA = 0x01,
    /**
     * FU_EBITDO_PKT_TYPE_MID_CMD:
     */
    FU_EBITDO_PKT_TYPE_MID_CMD = 0x02,
}  FuEbitdoPktType;
/**
 * FuEbitdoPktCmd:
 */
typedef enum {
    /**
     * FU_EBITDO_PKT_CMD_FW_UPDATE_DATA:
     *
     * update firmware data
     */
    FU_EBITDO_PKT_CMD_FW_UPDATE_DATA = 0x00,
    /**
     * FU_EBITDO_PKT_CMD_FW_UPDATE_HEADER:
     *
     * update firmware header
     */
    FU_EBITDO_PKT_CMD_FW_UPDATE_HEADER = 0x01,
    /**
     * FU_EBITDO_PKT_CMD_FW_UPDATE_OK:
     *
     * mark update as successful
     */
    FU_EBITDO_PKT_CMD_FW_UPDATE_OK = 0x02,
    /**
     * FU_EBITDO_PKT_CMD_FW_UPDATE_ERROR:
     *
     * update firmware error
     */
    FU_EBITDO_PKT_CMD_FW_UPDATE_ERROR = 0x03,
    /**
     * FU_EBITDO_PKT_CMD_FW_GET_VERSION:
     *
     * get cur firmware version
     */
    FU_EBITDO_PKT_CMD_FW_GET_VERSION = 0x04,
    /**
     * FU_EBITDO_PKT_CMD_FW_SET_VERSION:
     *
     * set firmware version
     */
    FU_EBITDO_PKT_CMD_FW_SET_VERSION = 0x05,
    /**
     * FU_EBITDO_PKT_CMD_FW_SET_ENCODE_ID:
     *
     * set app firmware encode ID
     */
    FU_EBITDO_PKT_CMD_FW_SET_ENCODE_ID = 0x06,
    /**
     * FU_EBITDO_PKT_CMD_ACK:
     *
     * acknowledge
     */
    FU_EBITDO_PKT_CMD_ACK = 0x14,
    /**
     * FU_EBITDO_PKT_CMD_NAK:
     *
     * negative acknowledge
     */
    FU_EBITDO_PKT_CMD_NAK = 0x15,
    /**
     * FU_EBITDO_PKT_CMD_UPDATE_FIRMWARE_DATA:
     *
     * update firmware data
     */
    FU_EBITDO_PKT_CMD_UPDATE_FIRMWARE_DATA = 0x16,
    /**
     * FU_EBITDO_PKT_CMD_TRANSFER_ABORT:
     *
     * aborts transfer
     */
    FU_EBITDO_PKT_CMD_TRANSFER_ABORT = 0x18,
    /**
     * FU_EBITDO_PKT_CMD_VERIFICATION_ID:
     *
     * verification id (only BT?)
     */
    FU_EBITDO_PKT_CMD_VERIFICATION_ID = 0x19,
    /**
     * FU_EBITDO_PKT_CMD_GET_VERIFICATION_ID:
     *
     * verification id (only BT)
     */
    FU_EBITDO_PKT_CMD_GET_VERIFICATION_ID = 0x1a,
    /**
     * FU_EBITDO_PKT_CMD_VERIFY_ERROR:
     *
     * verification error
     */
    FU_EBITDO_PKT_CMD_VERIFY_ERROR = 0x1b,
    /**
     * FU_EBITDO_PKT_CMD_VERIFY_OK:
     *
     * verification successful
     */
    FU_EBITDO_PKT_CMD_VERIFY_OK = 0x1c,
    /**
     * FU_EBITDO_PKT_CMD_TRANSFER_TIMEOUT:
     *
     * send or receive data timeout
     */
    FU_EBITDO_PKT_CMD_TRANSFER_TIMEOUT = 0x1d,
    /**
     * FU_EBITDO_PKT_CMD_GET_VERSION:
     *
     * get fw ver joystick mode
     */
    FU_EBITDO_PKT_CMD_GET_VERSION = 0x21,
    /**
     * FU_EBITDO_PKT_CMD_GET_VERSION_RESPONSE:
     *
     * get fw version response
     */
    FU_EBITDO_PKT_CMD_GET_VERSION_RESPONSE = 0x22,
}  FuEbitdoPktCmd;
const gchar *fu_ebitdo_pkt_cmd_to_string(FuEbitdoPktCmd val) G_GNUC_CONST;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructEbitdoHdr;

FuStructEbitdoHdr *fu_struct_ebitdo_hdr_ref(FuStructEbitdoHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_hdr_unref(FuStructEbitdoHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructEbitdoHdr, fu_struct_ebitdo_hdr_unref)
FuStructEbitdoHdr *fu_struct_ebitdo_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructEbitdoHdr *fu_struct_ebitdo_hdr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ebitdo_hdr_get_version(const FuStructEbitdoHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ebitdo_hdr_get_destination_addr(const FuStructEbitdoHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ebitdo_hdr_get_destination_len(const FuStructEbitdoHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ebitdo_hdr_set_version(FuStructEbitdoHdr *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_hdr_set_destination_addr(FuStructEbitdoHdr *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_hdr_set_destination_len(FuStructEbitdoHdr *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_EBITDO_HDR_OFFSET_VERSION 0x0
#define FU_STRUCT_EBITDO_HDR_OFFSET_DESTINATION_ADDR 0x4
#define FU_STRUCT_EBITDO_HDR_OFFSET_DESTINATION_LEN 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EBITDO_HDR_SIZE 0x1C
#endif

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

FuStructEbitdoPkt *fu_struct_ebitdo_pkt_ref(FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_pkt_unref(FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructEbitdoPkt, fu_struct_ebitdo_pkt_unref)
FuStructEbitdoPkt *fu_struct_ebitdo_pkt_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructEbitdoPkt *fu_struct_ebitdo_pkt_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_ebitdo_pkt_get_pkt_len(const FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuEbitdoPktType fu_struct_ebitdo_pkt_get_type(const FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_ebitdo_pkt_get_subtype(const FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ebitdo_pkt_get_cmd_len(const FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuEbitdoPktCmd fu_struct_ebitdo_pkt_get_cmd(const FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ebitdo_pkt_get_payload_len(const FuStructEbitdoPkt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ebitdo_pkt_set_pkt_len(FuStructEbitdoPkt *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_pkt_set_type(FuStructEbitdoPkt *st, FuEbitdoPktType value) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_pkt_set_subtype(FuStructEbitdoPkt *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_pkt_set_cmd_len(FuStructEbitdoPkt *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_pkt_set_cmd(FuStructEbitdoPkt *st, FuEbitdoPktCmd value) G_GNUC_NON_NULL(1);
void fu_struct_ebitdo_pkt_set_payload_len(FuStructEbitdoPkt *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_EBITDO_PKT_OFFSET_PKT_LEN 0x0
#define FU_STRUCT_EBITDO_PKT_OFFSET_TYPE 0x1
#define FU_STRUCT_EBITDO_PKT_OFFSET_SUBTYPE 0x2
#define FU_STRUCT_EBITDO_PKT_OFFSET_CMD_LEN 0x3
#define FU_STRUCT_EBITDO_PKT_OFFSET_CMD 0x5
#define FU_STRUCT_EBITDO_PKT_OFFSET_PAYLOAD_LEN 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EBITDO_PKT_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#endif
