<commit_before>/*
 * Copyright (C) 2015-2018 <NAME> <<EMAIL>>
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */

#ifndef __FU_DEVICE_H
#define __FU_DEVICE_H

#include <glib-object.h>
#include <fwupd.h>

#include "fu-quirks.h"

G_BEGIN_DECLS

#define FU_TYPE_DEVICE (fu_device_get_type ())
G_DECLARE_DERIVABLE_TYPE (FuDevice, fu_device, FU, DEVICE, FwupdDevice)

struct _FuDeviceClass
{
	FwupdDeviceClass	 parent_class;
	void			 (*to_string)		(FuDevice	*self,
							 GString	*str);
	gboolean		 (*write_firmware)	(FuDevice	*self,
							 GBytes		*fw,
							 GError		**error);
	GBytes			*(*read_firmware)	(FuDevice	*self,
							 GError		**error);
	gboolean		 (*detach)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*attach)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*open)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*close)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*probe)		(FuDevice	*self,
							 GError		**error);
	GBytes			*(*prepare_firmware)	(FuDevice	*self,
							 GBytes		*fw,
							 GError		**error);
	gboolean		 (*set_quirk_kv)	(FuDevice	*self,
							 const gchar	*key,
							 const gchar	*value,
							 GError		**error);
	gboolean		 (*setup)		(FuDevice	*self,
							 GError		**error);
	void			 (*incorporate)		(FuDevice	*self,
							 FuDevice	*donor);
	gboolean		 (*poll)		(FuDevice	*self,
							 GError		**error);
	/*< private >*/
	gpointer	padding[20];
};

/**
 * FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE:
 *
 * The default removal delay for device re-enumeration taking into account a
 * chain of slow USB hubs. This should be used when the device is able to
 * reset itself between bootloader->runtime->bootloader.
 */
#define FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE		10000

/**
 * FU_DEVICE_REMOVE_DELAY_USER_REPLUG:
 *
 * The default removal delay for device re-plug taking into account humans
 * being slow and clumsy. This should be used when the user has to do something,
 * e.g. unplug, press a magic button and then replug.
 */
#define FU_DEVICE_REMOVE_DELAY_USER_REPLUG		20000

FuDevice	*fu_device_new				(void);

/* helpful casting macros */
#define fu_device_add_flag(d,v)			fwupd_device_add_flag(FWUPD_DEVICE(d),v)
#define fu_device_remove_flag(d,v)		fwupd_device_remove_flag(FWUPD_DEVICE(d),v)
#define fu_device_has_flag(d,v)			fwupd_device_has_flag(FWUPD_DEVICE(d),v)
#define fu_device_add_checksum(d,v)		fwupd_device_add_checksum(FWUPD_DEVICE(d),v)
#define fu_device_add_release(d,v)		fwupd_device_add_release(FWUPD_DEVICE(d),v)
#define fu_device_add_icon(d,v)			fwupd_device_add_icon(FWUPD_DEVICE(d),v)
#define fu_device_set_created(d,v)		fwupd_device_set_created(FWUPD_DEVICE(d),v)
#define fu_device_set_description(d,v)		fwupd_device_set_description(FWUPD_DEVICE(d),v)<commit_msg>trivial: Update FU_DEVICE_REMOVE_DELAY_USER_REPLUG from 20s to 40s (Fixes: #758)<commit_after>/*
 * Copyright (C) 2015-2018 <NAME> <<EMAIL>>
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */

#ifndef __FU_DEVICE_H
#define __FU_DEVICE_H

#include <glib-object.h>
#include <fwupd.h>

#include "fu-quirks.h"

G_BEGIN_DECLS

#define FU_TYPE_DEVICE (fu_device_get_type ())
G_DECLARE_DERIVABLE_TYPE (FuDevice, fu_device, FU, DEVICE, FwupdDevice)

struct _FuDeviceClass
{
	FwupdDeviceClass	 parent_class;
	void			 (*to_string)		(FuDevice	*self,
							 GString	*str);
	gboolean		 (*write_firmware)	(FuDevice	*self,
							 GBytes		*fw,
							 GError		**error);
	GBytes			*(*read_firmware)	(FuDevice	*self,
							 GError		**error);
	gboolean		 (*detach)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*attach)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*open)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*close)		(FuDevice	*self,
							 GError		**error);
	gboolean		 (*probe)		(FuDevice	*self,
							 GError		**error);
	GBytes			*(*prepare_firmware)	(FuDevice	*self,
							 GBytes		*fw,
							 GError		**error);
	gboolean		 (*set_quirk_kv)	(FuDevice	*self,
							 const gchar	*key,
							 const gchar	*value,
							 GError		**error);
	gboolean		 (*setup)		(FuDevice	*self,
							 GError		**error);
	void			 (*incorporate)		(FuDevice	*self,
							 FuDevice	*donor);
	gboolean		 (*poll)		(FuDevice	*self,
							 GError		**error);
	/*< private >*/
	gpointer	padding[20];
};

/**
 * FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE:
 *
 * The default removal delay for device re-enumeration taking into account a
 * chain of slow USB hubs. This should be used when the device is able to
 * reset itself between bootloader->runtime->bootloader.
 */
#define FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE		10000

/**
 * FU_DEVICE_REMOVE_DELAY_USER_REPLUG:
 *
 * The default removal delay for device re-plug taking into account humans
 * being slow and clumsy. This should be used when the user has to do something,
 * e.g. unplug, press a magic button and then replug.
 */
#define FU_DEVICE_REMOVE_DELAY_USER_REPLUG		40000

FuDevice	*fu_device_new				(void);

/* helpful casting macros */
#define fu_device_add_flag(d,v)			fwupd_device_add_flag(FWUPD_DEVICE(d),v)
#define fu_device_remove_flag(d,v)		fwupd_device_remove_flag(FWUPD_DEVICE(d),v)
#define fu_device_has_flag(d,v)			fwupd_device_has_flag(FWUPD_DEVICE(d),v)
#define fu_device_add_checksum(d,v)		fwupd_device_add_checksum(FWUPD_DEVICE(d),v)
#define fu_device_add_release(d,v)		fwupd_device_add_release(FWUPD_DEVICE(d),v)
#define fu_device_add_icon(d,v)			fwupd_device_add_icon(FWUPD_DEVICE(d),v)
#define fu_device_set_created(d,v)		fwupd_device_set_created(FWUPD_DEVICE(d),v)
#define fu_device_set_description(d,v)		fwupd_device_set_description(FWUPD_DEVICE(d),v)
{'fraction_non_alphanumeric': 0.11572169558218566, 'fraction_numerical': 0.009121802897513862, 'mean_word_length': 4.280453257790368, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4284816', 'n_tokens_mistral': 2577, 'n_tokens_neox': 2207, 'n_words': 459}