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

#include "config.h"

#include <glib.h>

#include "fu-logitech-tap-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_logitech_tap_touch_hid_req_ref: (skip):
 **/
FuStructLogitechTapTouchHidReq *
fu_struct_logitech_tap_touch_hid_req_ref(FuStructLogitechTapTouchHidReq *st)
{
    g_return_val_if_fail(st != NULL, NULL);
    st->refcount++;
    return st;
}
/**
 * fu_struct_logitech_tap_touch_hid_req_unref: (skip):
 **/
void
fu_struct_logitech_tap_touch_hid_req_unref(FuStructLogitechTapTouchHidReq *st)
{
    g_return_if_fail(st != NULL);
    if (st->refcount == 0) {
        g_critical("FuStructLogitechTapTouchHidReq refcount already zero");
        return;
    }
    if (--st->refcount > 0)
        return;
    if (st->buf != NULL)
        g_byte_array_unref(st->buf);
    g_free(st);
}
/**
 * fu_struct_logitech_tap_touch_hid_req_new_internal: (skip):
 **/
static FuStructLogitechTapTouchHidReq *
fu_struct_logitech_tap_touch_hid_req_new_internal(void)
{
    FuStructLogitechTapTouchHidReq *st = g_new0(FuStructLogitechTapTouchHidReq, 1);
    st->refcount = 1;
    return st;
}

/* getters */

/* setters */
/**
 * fu_struct_logitech_tap_touch_hid_req_set_report_id: (skip):
 **/
static void
fu_struct_logitech_tap_touch_hid_req_set_report_id(FuStructLogitechTapTouchHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[0] = value;
}
/**
 * fu_struct_logitech_tap_touch_hid_req_set_res_size_supported_id: (skip):
 **/
static void
fu_struct_logitech_tap_touch_hid_req_set_res_size_supported_id(FuStructLogitechTapTouchHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[1] = value;
}
/**
 * fu_struct_logitech_tap_touch_hid_req_set_payload_len: (skip):
 **/
void
fu_struct_logitech_tap_touch_hid_req_set_payload_len(FuStructLogitechTapTouchHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[2] = value;
}
/**
 * fu_struct_logitech_tap_touch_hid_req_set_response_len: (skip):
 **/
void
fu_struct_logitech_tap_touch_hid_req_set_response_len(FuStructLogitechTapTouchHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[3] = value;
}
/**
 * fu_struct_logitech_tap_touch_hid_req_set_cmd: (skip):
 **/
void
fu_struct_logitech_tap_touch_hid_req_set_cmd(FuStructLogitechTapTouchHidReq *st, FuStructLogitechTapTouchHidCmd value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[4] = value;
}
/**
 * fu_struct_logitech_tap_touch_hid_req_new: (skip):
 **/
FuStructLogitechTapTouchHidReq *
fu_struct_logitech_tap_touch_hid_req_new(void)
{
    FuStructLogitechTapTouchHidReq *st = fu_struct_logitech_tap_touch_hid_req_new_internal();
    st->buf = g_byte_array_sized_new(5);
    fu_byte_array_set_size(st->buf, 5, 0x0);
    fu_struct_logitech_tap_touch_hid_req_set_report_id(st, 0x03);
    fu_struct_logitech_tap_touch_hid_req_set_res_size_supported_id(st, 0xA3);
    return st;
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_ref: (skip):
 **/
FuStructLogitechTapSensorHidReq *
fu_struct_logitech_tap_sensor_hid_req_ref(FuStructLogitechTapSensorHidReq *st)
{
    g_return_val_if_fail(st != NULL, NULL);
    st->refcount++;
    return st;
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_unref: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_req_unref(FuStructLogitechTapSensorHidReq *st)
{
    g_return_if_fail(st != NULL);
    if (st->refcount == 0) {
        g_critical("FuStructLogitechTapSensorHidReq refcount already zero");
        return;
    }
    if (--st->refcount > 0)
        return;
    if (st->buf != NULL)
        g_byte_array_unref(st->buf);
    g_free(st);
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_new_internal: (skip):
 **/
static FuStructLogitechTapSensorHidReq *
fu_struct_logitech_tap_sensor_hid_req_new_internal(void)
{
    FuStructLogitechTapSensorHidReq *st = g_new0(FuStructLogitechTapSensorHidReq, 1);
    st->refcount = 1;
    return st;
}

/* getters */

/* setters */
/**
 * fu_struct_logitech_tap_sensor_hid_req_set_cmd: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_req_set_cmd(FuStructLogitechTapSensorHidReq *st, FuLogitechTapSensorHidSetCmd value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[0] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_set_payload_byte1: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_req_set_payload_byte1(FuStructLogitechTapSensorHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[1] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_set_payload_byte2: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_req_set_payload_byte2(FuStructLogitechTapSensorHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[2] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_set_payload_byte3: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_req_set_payload_byte3(FuStructLogitechTapSensorHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[3] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_set_payload_byte4: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_req_set_payload_byte4(FuStructLogitechTapSensorHidReq *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[4] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_req_new: (skip):
 **/
FuStructLogitechTapSensorHidReq *
fu_struct_logitech_tap_sensor_hid_req_new(void)
{
    FuStructLogitechTapSensorHidReq *st = fu_struct_logitech_tap_sensor_hid_req_new_internal();
    st->buf = g_byte_array_sized_new(5);
    fu_byte_array_set_size(st->buf, 5, 0x0);
    fu_struct_logitech_tap_sensor_hid_req_set_payload_byte3(st, 0x0);
    fu_struct_logitech_tap_sensor_hid_req_set_payload_byte4(st, 0x0);
    return st;
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_ref: (skip):
 **/
FuStructLogitechTapSensorHidRes *
fu_struct_logitech_tap_sensor_hid_res_ref(FuStructLogitechTapSensorHidRes *st)
{
    g_return_val_if_fail(st != NULL, NULL);
    st->refcount++;
    return st;
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_unref: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_res_unref(FuStructLogitechTapSensorHidRes *st)
{
    g_return_if_fail(st != NULL);
    if (st->refcount == 0) {
        g_critical("FuStructLogitechTapSensorHidRes refcount already zero");
        return;
    }
    if (--st->refcount > 0)
        return;
    if (st->buf != NULL)
        g_byte_array_unref(st->buf);
    g_free(st);
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_new_internal: (skip):
 **/
static FuStructLogitechTapSensorHidRes *
fu_struct_logitech_tap_sensor_hid_res_new_internal(void)
{
    FuStructLogitechTapSensorHidRes *st = g_new0(FuStructLogitechTapSensorHidRes, 1);
    st->refcount = 1;
    return st;
}

/* getters */

/* setters */
/**
 * fu_struct_logitech_tap_sensor_hid_res_set_cmd: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_res_set_cmd(FuStructLogitechTapSensorHidRes *st, FuLogitechTapSensorHidGetCmd value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[0] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_set_payload_byte1: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_res_set_payload_byte1(FuStructLogitechTapSensorHidRes *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[1] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_set_payload_byte2: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_res_set_payload_byte2(FuStructLogitechTapSensorHidRes *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[2] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_set_payload_byte3: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_res_set_payload_byte3(FuStructLogitechTapSensorHidRes *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[3] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_set_payload_byte4: (skip):
 **/
void
fu_struct_logitech_tap_sensor_hid_res_set_payload_byte4(FuStructLogitechTapSensorHidRes *st, guint8 value)
{
    g_return_if_fail(st != NULL);
    st->buf->data[4] = value;
}
/**
 * fu_struct_logitech_tap_sensor_hid_res_new: (skip):
 **/
FuStructLogitechTapSensorHidRes *
fu_struct_logitech_tap_sensor_hid_res_new(void)
{
    FuStructLogitechTapSensorHidRes *st = fu_struct_logitech_tap_sensor_hid_res_new_internal();
    st->buf = g_byte_array_sized_new(5);
    fu_byte_array_set_size(st->buf, 5, 0x0);
    return st;
}
