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

#pragma once
#include <fu-input-stream.h>
/**
 * FuBlestechTpCmd:
 */
typedef enum {
    /**
     * FU_BLESTECH_TP_CMD_GET_CHECKSUM:
     */
    FU_BLESTECH_TP_CMD_GET_CHECKSUM = 0x3f,
    /**
     * FU_BLESTECH_TP_CMD_GET_FW_VER:
     */
    FU_BLESTECH_TP_CMD_GET_FW_VER = 0xb6,
    /**
     * FU_BLESTECH_TP_CMD_UPDATE_START_REQ:
     */
    FU_BLESTECH_TP_CMD_UPDATE_START_REQ = 0xb1,
    /**
     * FU_BLESTECH_TP_CMD_PROGRAM_PAGE:
     */
    FU_BLESTECH_TP_CMD_PROGRAM_PAGE = 0xb2,
    /**
     * FU_BLESTECH_TP_CMD_PROGRAM_PAGE_END:
     */
    FU_BLESTECH_TP_CMD_PROGRAM_PAGE_END = 0xb3,
    /**
     * FU_BLESTECH_TP_CMD_PROGRAM_CHECKSUM:
     */
    FU_BLESTECH_TP_CMD_PROGRAM_CHECKSUM = 0xb4,
    /**
     * FU_BLESTECH_TP_CMD_PROGRAM_END:
     */
    FU_BLESTECH_TP_CMD_PROGRAM_END = 0xb5,
}  FuBlestechTpCmd;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpSetHdr;

FuBlestechTpSetHdr *fu_blestech_tp_set_hdr_ref(FuBlestechTpSetHdr *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_set_hdr_unref(FuBlestechTpSetHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpSetHdr, fu_blestech_tp_set_hdr_unref)
FuBlestechTpSetHdr *fu_blestech_tp_set_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_blestech_tp_set_hdr_set_report_id(FuBlestechTpSetHdr *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_blestech_tp_set_hdr_set_pack_len(FuBlestechTpSetHdr *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_blestech_tp_set_hdr_set_checksum(FuBlestechTpSetHdr *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_blestech_tp_set_hdr_set_write_len(FuBlestechTpSetHdr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_blestech_tp_set_hdr_set_read_len(FuBlestechTpSetHdr *st, guint16 value) G_GNUC_NON_NULL(1);
gboolean fu_blestech_tp_set_hdr_set_data(FuBlestechTpSetHdr *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_SET_HDR_OFFSET_REPORT_ID 0x0
#define FU_BLESTECH_TP_SET_HDR_OFFSET_PACK_LEN 0x1
#define FU_BLESTECH_TP_SET_HDR_OFFSET_CHECKSUM 0x2
#define FU_BLESTECH_TP_SET_HDR_OFFSET_FRAME_FLAG 0x3
#define FU_BLESTECH_TP_SET_HDR_OFFSET_WRITE_LEN 0x4
#define FU_BLESTECH_TP_SET_HDR_OFFSET_READ_LEN 0x6
#define FU_BLESTECH_TP_SET_HDR_OFFSET_DATA 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_SET_HDR_SIZE_DATA 0x19
#define FU_BLESTECH_TP_SET_HDR_N_ELEMENTS_DATA 25
#define FU_BLESTECH_TP_SET_HDR_SIZE 0x21
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_SET_HDR_DEFAULT_FRAME_FLAG 0
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpUpdateStartReq;

FuBlestechTpUpdateStartReq *fu_blestech_tp_update_start_req_ref(FuBlestechTpUpdateStartReq *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_update_start_req_unref(FuBlestechTpUpdateStartReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpUpdateStartReq, fu_blestech_tp_update_start_req_unref)
FuBlestechTpUpdateStartReq *fu_blestech_tp_update_start_req_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_UPDATE_START_REQ_OFFSET_CMD 0x0
#define FU_BLESTECH_TP_UPDATE_START_REQ_OFFSET_MAGIC_NUM 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_UPDATE_START_REQ_SIZE 0x9
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_UPDATE_START_REQ_DEFAULT_CMD FU_BLESTECH_TP_CMD_UPDATE_START_REQ
#define FU_BLESTECH_TP_UPDATE_START_REQ_DEFAULT_MAGIC_NUM 0x7565554563756933
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpSwitchBootReq;

FuBlestechTpSwitchBootReq *fu_blestech_tp_switch_boot_req_ref(FuBlestechTpSwitchBootReq *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_switch_boot_req_unref(FuBlestechTpSwitchBootReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpSwitchBootReq, fu_blestech_tp_switch_boot_req_unref)
FuBlestechTpSwitchBootReq *fu_blestech_tp_switch_boot_req_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_SWITCH_BOOT_REQ_OFFSET_CMD 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_SWITCH_BOOT_REQ_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_SWITCH_BOOT_REQ_DEFAULT_CMD 0xffff5aa5
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpGetFwVerReq;

FuBlestechTpGetFwVerReq *fu_blestech_tp_get_fw_ver_req_ref(FuBlestechTpGetFwVerReq *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_get_fw_ver_req_unref(FuBlestechTpGetFwVerReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpGetFwVerReq, fu_blestech_tp_get_fw_ver_req_unref)
FuBlestechTpGetFwVerReq *fu_blestech_tp_get_fw_ver_req_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_GET_FW_VER_REQ_OFFSET_CMD 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_GET_FW_VER_REQ_SIZE 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_GET_FW_VER_REQ_DEFAULT_CMD FU_BLESTECH_TP_CMD_GET_FW_VER
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpGetFwVerRes;

FuBlestechTpGetFwVerRes *fu_blestech_tp_get_fw_ver_res_ref(FuBlestechTpGetFwVerRes *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_get_fw_ver_res_unref(FuBlestechTpGetFwVerRes *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpGetFwVerRes, fu_blestech_tp_get_fw_ver_res_unref)
FuBlestechTpGetFwVerRes *fu_blestech_tp_get_fw_ver_res_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_blestech_tp_get_fw_ver_res_get_val(const FuBlestechTpGetFwVerRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_GET_FW_VER_RES_OFFSET_VAL 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_GET_FW_VER_RES_SIZE 0x7
#endif

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

FuBlestechTpProgramEndReq *fu_blestech_tp_program_end_req_ref(FuBlestechTpProgramEndReq *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_program_end_req_unref(FuBlestechTpProgramEndReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpProgramEndReq, fu_blestech_tp_program_end_req_unref)
FuBlestechTpProgramEndReq *fu_blestech_tp_program_end_req_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_END_REQ_OFFSET_CMD 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_END_REQ_SIZE 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_END_REQ_DEFAULT_CMD FU_BLESTECH_TP_CMD_PROGRAM_END
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpProgramChecksumReq;

FuBlestechTpProgramChecksumReq *fu_blestech_tp_program_checksum_req_ref(FuBlestechTpProgramChecksumReq *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_program_checksum_req_unref(FuBlestechTpProgramChecksumReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpProgramChecksumReq, fu_blestech_tp_program_checksum_req_unref)
FuBlestechTpProgramChecksumReq *fu_blestech_tp_program_checksum_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_blestech_tp_program_checksum_req_set_val(FuBlestechTpProgramChecksumReq *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_CHECKSUM_REQ_OFFSET_CMD 0x0
#define FU_BLESTECH_TP_PROGRAM_CHECKSUM_REQ_OFFSET_VAL 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_CHECKSUM_REQ_SIZE 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_CHECKSUM_REQ_DEFAULT_CMD FU_BLESTECH_TP_CMD_PROGRAM_CHECKSUM
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpProgramChecksumRes;

FuBlestechTpProgramChecksumRes *fu_blestech_tp_program_checksum_res_ref(FuBlestechTpProgramChecksumRes *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_program_checksum_res_unref(FuBlestechTpProgramChecksumRes *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpProgramChecksumRes, fu_blestech_tp_program_checksum_res_unref)
FuBlestechTpProgramChecksumRes *fu_blestech_tp_program_checksum_res_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_blestech_tp_program_checksum_res_get_val(const FuBlestechTpProgramChecksumRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_CHECKSUM_RES_OFFSET_VAL 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_CHECKSUM_RES_SIZE 0x4
#endif

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

FuBlestechTpProgramPageEndReq *fu_blestech_tp_program_page_end_req_ref(FuBlestechTpProgramPageEndReq *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_program_page_end_req_unref(FuBlestechTpProgramPageEndReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpProgramPageEndReq, fu_blestech_tp_program_page_end_req_unref)
FuBlestechTpProgramPageEndReq *fu_blestech_tp_program_page_end_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_blestech_tp_program_page_end_req_set_page(FuBlestechTpProgramPageEndReq *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_END_REQ_OFFSET_CMD 0x0
#define FU_BLESTECH_TP_PROGRAM_PAGE_END_REQ_OFFSET_PAGE 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_END_REQ_SIZE 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_END_REQ_DEFAULT_CMD FU_BLESTECH_TP_CMD_PROGRAM_PAGE_END
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuBlestechTpProgramPageEndRes;

FuBlestechTpProgramPageEndRes *fu_blestech_tp_program_page_end_res_ref(FuBlestechTpProgramPageEndRes *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_program_page_end_res_unref(FuBlestechTpProgramPageEndRes *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpProgramPageEndRes, fu_blestech_tp_program_page_end_res_unref)
FuBlestechTpProgramPageEndRes *fu_blestech_tp_program_page_end_res_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_blestech_tp_program_page_end_res_get_checksum(const FuBlestechTpProgramPageEndRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_END_RES_OFFSET_CHECKSUM 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_END_RES_SIZE 0x3
#endif

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

FuBlestechTpProgramPageReq *fu_blestech_tp_program_page_req_ref(FuBlestechTpProgramPageReq *st) G_GNUC_NON_NULL(1);
void fu_blestech_tp_program_page_req_unref(FuBlestechTpProgramPageReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuBlestechTpProgramPageReq, fu_blestech_tp_program_page_req_unref)
FuBlestechTpProgramPageReq *fu_blestech_tp_program_page_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_blestech_tp_program_page_req_set_data(FuBlestechTpProgramPageReq *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_REQ_OFFSET_CMD 0x0
#define FU_BLESTECH_TP_PROGRAM_PAGE_REQ_OFFSET_DATA 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_REQ_SIZE_DATA 0x18
#define FU_BLESTECH_TP_PROGRAM_PAGE_REQ_N_ELEMENTS_DATA 24
#define FU_BLESTECH_TP_PROGRAM_PAGE_REQ_SIZE 0x19
#endif

#ifndef __GI_SCANNER__
#define FU_BLESTECH_TP_PROGRAM_PAGE_REQ_DEFAULT_CMD FU_BLESTECH_TP_CMD_PROGRAM_PAGE
#endif
