---
name: "libkyhwinfo"
section: "3"
platform: "linux"
package: "libkysdk-system"
version: "3.0.1.4-1"
release: "Arch Linux 2026-11-07"
platforms: ["linux"]
url: "https://carta.tech/man/libkyhwinfo"
---

# libkyhwinfo(3)

获取键盘，鼠标，声卡，光驱，usb和电源硬件信息

## NAME

kdk\_hw\_get\_hwinfo, kdk\_hw\_free\_hw, kdk\_hw\_get\_powerinfo, kdk\_hw\_free\_power\_info - 获取键盘，鼠标，声卡，光驱，usb和电源硬件信息

## SYNOPSIS

```
#include <libkyhw.h>

extern struct HWInfo *kdk_hw_get_hwinfo(int type);

extern void kdk_hw_free_hw(struct HWInfo *list);

extern struct Power *kdk_hw_get_powerinfo();

extern void kdk_hw_free_power_info(struct Power *info);

Link with -lkyhwinfo.
```

## Detailed Description

This library contains keyboard, mouse, sound card, optical drive, USB and power supply hardware information.

## DATA STRUCTURES

Structure **HWInfo** contains information related to a keyboard, mouse, sound card, optical drive, USB hardware information:

**struct HWInfo {**\
\
 	**char model\[ATTRSIZE\];**\
     **char vendor\[ATTRSIZE\];**\
     **char device\[ATTRSIZE\];**\
     **char driver\[ATTRSIZE\];**\
     **char revision\[ATTRSIZE\];**\
     **char busid\[ATTRSIZE\];**\
     **char devicenum\[ATTRSIZE\];**\
     **char width\[8\];**\
     **char clock\[8\];**\
     **struct HWInfo \*next;**\
 **};**

There are other members not documented here, which are only meant for libkyhwinfo internal use.

Structure **Power** contains information related to a power supply information:

**struct Power {**\
\
 	**char daemon\_version\[32\];**\
     **bool on\_battery;**\
     **bool lid\_is\_closed;**\
     **bool lid\_is\_present;**\
     **char critical\_action\[32\];**\
     **struct power\_device \*devices;**\
 **};**

There are other members not documented here, which are only meant for libkyhwinfo internal use.

Structure **power\_device** contains information related to a power supply specific information:

**struct power\_device {**\
\
 	**char name\[256\];**\
     **char native\_path\[32\];**\
     **bool power\_supply;**\
     **char updated\[64\];**\
     **bool has\_history;**\
     **bool has\_statistics;**\
     **bool is\_persent;**\
     **bool is\_rechargeable;**\
     **char state\[32\];**\
     **char warning\_level\[32\];**\
     **double energy;**\
     **double energy\_empty;**\
     **double energy\_full;**\
     **double energy\_full\_design;**\
     **double energy\_rate;**\
     **double voltage;**\
     **long time\_to\_empty;**\
     **long time\_to\_full;**\
     **double percentage;**\
     **double temperature;**\
     **double capacity;**\
     **char technology\[32\];**\
     **bool online;**\
     **char icon\_name\[64\];**\
     **struct power\_device \*next;**\
 **};**

There are other members not documented here, which are only meant for libkyhwinfo internal use.

## RETURN VALUE

The return value is generally specific to the individual function called.

## CONFORMING TO

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: **kdk\_hw\_get\_hwinfo**(), **kdk\_hw\_free\_hw**(), **kdk\_hw\_get\_powerinfo**() and **kdk\_hw\_free\_power\_info**().

## SEE ALSO

[**kdk\_hw\_get\_hwinfo**(3)](/man/kdk_hw_get_hwinfo/3.md), [**kdk\_hw\_free\_hw**(3)](/man/kdk_hw_free_hw/3.md), [**kdk\_hw\_get\_powerinfo**(3)](/man/kdk_hw_get_powerinfo/3.md) and [**kdk\_hw\_free\_power\_info**(3)](/man/kdk_hw_free_power_info/3.md).
