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

#include "config.h"

#include <glib.h>

#include "fu-framework-qmk-struct.h"
#include "fu-byte-array.h"
#include "fu-bytes.h"
#include "fu-mem-private.h"
#include "fu-string.h"

#ifdef G_LOG_DOMAIN
  #undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "FuStruct"

/**
 * fu_struct_framework_qmk_reset_request_ref: (skip):
 **/
FuStructFrameworkQmkResetRequest *
fu_struct_framework_qmk_reset_request_ref(FuStructFrameworkQmkResetRequest *st)
{
    g_return_val_if_fail(st != NULL, NULL);
    st->refcount++;
    return st;
}
/**
 * fu_struct_framework_qmk_reset_request_unref: (skip):
 **/
void
fu_struct_framework_qmk_reset_request_unref(FuStructFrameworkQmkResetRequest *st)
{
    g_return_if_fail(st != NULL);
    if (st->refcount == 0) {
        g_critical("FuStructFrameworkQmkResetRequest refcount already zero");
        return;
    }
    if (--st->refcount > 0)
        return;
    if (st->buf != NULL)
        g_byte_array_unref(st->buf);
    g_free(st);
}
/**
 * fu_struct_framework_qmk_reset_request_new_internal: (skip):
 **/
static FuStructFrameworkQmkResetRequest *
fu_struct_framework_qmk_reset_request_new_internal(void)
{
    FuStructFrameworkQmkResetRequest *st = g_new0(FuStructFrameworkQmkResetRequest, 1);
    st->refcount = 1;
    return st;
}

/* getters */

/* setters */
/**
 * fu_struct_framework_qmk_reset_request_set_report_id: (skip):
 **/
static void
fu_struct_framework_qmk_reset_request_set_report_id(FuStructFrameworkQmkResetRequest *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[0] = value;
}
/**
 * fu_struct_framework_qmk_reset_request_set_cmd: (skip):
 **/
static void
fu_struct_framework_qmk_reset_request_set_cmd(FuStructFrameworkQmkResetRequest *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[1] = value;
}
/**
 * fu_struct_framework_qmk_reset_request_new: (skip):
 **/
FuStructFrameworkQmkResetRequest *
fu_struct_framework_qmk_reset_request_new(void)
{
    FuStructFrameworkQmkResetRequest *st = fu_struct_framework_qmk_reset_request_new_internal();
    st->buf = g_byte_array_sized_new(32);
    fu_byte_array_set_size(st->buf, 32, 0x0);
    fu_struct_framework_qmk_reset_request_set_report_id(st, 0x00);
    fu_struct_framework_qmk_reset_request_set_cmd(st, 0x0B);
    memcpy(st->buf->data + 0x2, "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", 30); /* nocheck:blocked */
    return st;
}
