Merge branch 'openkylin/nile' into upstream

This commit is contained in:
shaozhimin 2023-10-11 15:34:14 +08:00
commit 3817203d41
353 changed files with 40857 additions and 1207 deletions

View File

@ -0,0 +1,5 @@
Name: libkysdk-imageproc
Description: kysdk system layer image processment component
Version: 2.0.0
Libs: -lkysdk-imageproc
Cflags: -I/usr/include/kysdk/kysdk-system/

View File

@ -1,6 +1,6 @@
Name: libkysdk-system
Description: kysdk system layer
Requires: kysdk-disk kysdk-filesystem kysdk-hardware kysdk-package kysdk-proc kysdk-sysinfo kysdk-location kysdk-net kysdk-realtime
Requires: kysdk-disk kysdk-filesystem kysdk-hardware kysdk-package kysdk-proc kysdk-sysinfo kysdk-location kysdk-net kysdk-realtime kysdk-imageproc
Version: 2.0.0
Libs: -L/usr/lib/*/ -lkysdk-disk -lkysdk-filesystem -lkysdk-hardware -lkysdk-package -lkysdk-sysinfo -lkysdk-proc -lkysdk-location -lkysdk-net -lkysdk-realtime -Wl,-rpath=/usr/lib/*/
Libs: -L/usr/lib/*/ -lkysdk-disk -lkysdk-filesystem -lkysdk-hardware -lkysdk-package -lkysdk-sysinfo -lkysdk-proc -lkysdk-location -lkysdk-net -lkysdk-realtime -lkysdk-imageproc -Wl,-rpath=/usr/lib/*/
Cflags: -I/usr/include/kysdk/kysdk-system/

2567
doxygen/doxy_config Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
.TH "KDK_FREE_DISKLIST" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_disklist - 释放由kdk_get_disklist返回的磁盘列表
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern void kdk_free_disklist(char** "disklist ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
The main function of the interface is to recycle a list of strings of type char **;
.PP
The argument
.I ptr
is a list of strings of type char **.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
int main()
{
char **disklist = kdk_get_disklist();
for (int i = 0; disklist[i]; i ++)
{
printf("%s\n", disklist[i]);
}
kdk_free_disklist(disklist);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_diskinfo (),
.BR kdk_get_hard_disk (),
and
.BR kdk_get_hard_disk_size ().
.SH "SEE ALSO"
.BR kdk_get_disklist (3),
.BR kdk_get_diskinfo (3),
.BR kdk_free_diskinfo (3)

140
man/disk/kdk_get_diskinfo.3 Normal file
View File

@ -0,0 +1,140 @@
.TH "KDK_GET_DISKINFO" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_diskinfo - 获取指定磁盘的磁盘信息
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern kdk_diskinfo *kdk_get_diskinfo(const char *"diskname ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
Based on the specified disk name
.I diskname,
such as absolute path such as
.I /dev/sda,
or
.BR kdk_get_disklist()
function returns an element from a value to obtain disk information.
.SH "RETURN VALUE"
kdk_diskinfo is a structure that stores disk information, as follows:
typedef struct _kdk_diskinfo{
char *name; // 绝对路径
char *vendor; // 制造商
char *model; // 型号
char *serial; // 序列号
kdk_disk_type disk_type; // 磁盘类型,固态 or 机械 or 混合
kdk_disk_interface_type inter_type; // 接口类型
unsigned int rpm; // 转速,注意固态是没有转速概念的
unsigned long long sectors_num; // 扇区数量
unsigned int sector_size; // 每个扇区的字节数
float total_size_MiB; // 磁盘容量MiB为单位
unsigned int partition_nums; // 该磁盘/分区下的子分区数量
char *uuid; // UUID
short mounted; // 是否已挂载
char *mount_path; // 挂载路径
kdk_disk_format format; // 格式化类型
kdk_disk_partition_type part_type; // 分区类型
char *fwrev; //固件版本信息
}kdk_diskinfo;
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_disklist (),
.BR kdk_get_hard_disk (),
and
.BR kdk_get_hard_disk_size ().
.SH "SEE ALSO"
.BR kdk_get_disklist (3),
.BR kdk_free_disklist (3),
.BR kdk_free_diskinfo (3)

View File

@ -0,0 +1,48 @@
.TH "KDK_GET_DISKLISK" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_disklist - 获取磁盘列表信息
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char** kdk_get_disklist();"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
The
.BR kdk_get_disklist()
function obtains disk list information during the call process.
.SH "RETURN VALUE"
The return value is a char** type, with each string representing the absolute path of a disk and ending with a NULL character.
.PP
After completion,
.BR kdk_free_disklist()
function releases a list of disk information.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
int main()
{
char **disklist = kdk_get_disklist();
for (int i = 0; disklist[i]; i ++)
{
printf("%s\n", disklist[i]);
}
kdk_free_disklist(disklist);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_diskinfo (),
.BR kdk_get_hard_disk (),
and
.BR kdk_get_hard_disk_size ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_diskinfo (3),
.BR kdk_free_diskinfo (3)

View File

@ -0,0 +1,125 @@
.TH "KDK_GET_HARD_DISK" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_hard_disk - 获取系统接入所有硬盘
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char** kdk_get_hard_disk();"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
The
.BR kdk_get_hard_disk()
function obtains the system access hard disk list information during the call process.
.SH "RETURN VALUE"
The return value is a char** type, with each string representing the absolute path of a disk and ending with a NULL character.
.PP
After completion,
.BR kdk_free_disklist()
function releases a list of disk information.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_free_disklist (),
.BR kdk_get_hard_fwrev (),
.BR kdk_get_hard_type (),
.BR kdk_get_hard_model (),
.BR kdk_get_hard_serial (),
.BR kdk_get_hard_disk_size (),
.BR kdk_get_hard_vendor (),
and
.BR kdk_get_hard_disk_size ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_hard_fwrev (3),
.BR kdk_get_hard_type (3),
.BR kdk_get_hard_model (3),
.BR kdk_get_hard_serial (3),
.BR kdk_get_hard_vendor (3),
.BR kdk_get_hard_disk_size (3).

View File

@ -0,0 +1,128 @@
.TH "KDK_GET_HARD_DISK_SIZE" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_hard_disk_size - 获取硬盘大小
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char* kdk_get_hard_disk_size(const char *"diskname ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
Based on the specified disk name
.I diskname,
such as absolute path such as
.I /dev/sda,
or
.BR kdk_get_hard_disk()
function returns an element in the value to obtain hard disk size information.
.SH "RETURN VALUE"
On success, returns the hard disk size of type char*, in MIB; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_hard_disk (),
.BR kdk_free_disklist (),
.BR kdk_get_hard_fwrev (),
.BR kdk_get_hard_type (),
.BR kdk_get_hard_model (),
.BR kdk_get_hard_serial (),
and
.BR kdk_get_hard_vendor ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_hard_fwrev (3),
.BR kdk_get_hard_type (3),
.BR kdk_get_hard_model (3),
.BR kdk_get_hard_serial (3),
.BR kdk_get_hard_vendor (3),
.BR kdk_get_hard_disk (3).

View File

@ -0,0 +1,128 @@
.TH "KDK_GET_HARD_FWREV" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_hard_fwrev - 获取硬盘固态版本
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char* kdk_get_hard_fwrev(const char *"diskname ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
Based on the specified disk name
.I diskname,
such as absolute path such as
.I /dev/sda,
or
.BR kdk_get_hard_disk()
function returns an element in the value to obtain the firmware version information of the hard drive.
.SH "RETURN VALUE"
On success, return to the hard drive firmware version; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_hard_disk (),
.BR kdk_free_disklist (),
.BR kdk_get_hard_disk_size (),
.BR kdk_get_hard_type (),
.BR kdk_get_hard_model (),
.BR kdk_get_hard_serial (),
and
.BR kdk_get_hard_vendor ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_hard_disk_size (3),
.BR kdk_get_hard_type (3),
.BR kdk_get_hard_model (3),
.BR kdk_get_hard_serial (3),
.BR kdk_get_hard_vendor (3),
.BR kdk_get_hard_disk (3).

View File

@ -0,0 +1,128 @@
.TH "KDK_GET_HARD_MODEL" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_hard_model - 获取硬盘型号
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char* kdk_get_hard_model(const char *"diskname ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
Based on the specified disk name
.I diskname,
such as absolute path such as
.I /dev/sda,
or
.BR kdk_get_hard_disk()
function returns an element in the value to obtain hard drive model information.
.SH "RETURN VALUE"
On success, Returns the model of hard drive; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_hard_disk (),
.BR kdk_free_disklist (),
.BR kdk_get_hard_disk_size (),
.BR kdk_get_hard_fwrev (),
.BR kdk_get_hard_type (),
.BR kdk_get_hard_serial (),
and
.BR kdk_get_hard_vendor ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_hard_disk_size (3),
.BR kdk_get_hard_fwrev (3),
.BR kdk_get_hard_type (3),
.BR kdk_get_hard_serial (3),
.BR kdk_get_hard_vendor (3),
.BR kdk_get_hard_disk (3).

View File

@ -0,0 +1,128 @@
.TH "KDK_GET_HARD_SERIAL" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_hard_serial - 获取硬盘序列号
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char* kdk_get_hard_serial(const char *"diskname ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
Based on the specified disk name
.I diskname,
such as absolute path such as
.I /dev/sda,
or
.BR kdk_get_hard_disk()
function returns an element in the value to obtain hard drive serial number information.
.SH "RETURN VALUE"
On success, Returns the serial number of hard drive; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_hard_disk (),
.BR kdk_free_disklist (),
.BR kdk_get_hard_disk_size (),
.BR kdk_get_hard_fwrev (),
.BR kdk_get_hard_type (),
.BR kdk_get_hard_model (),
and
.BR kdk_get_hard_vendor ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_hard_disk_size (3),
.BR kdk_get_hard_fwrev (3),
.BR kdk_get_hard_type (3),
.BR kdk_get_hard_model (3),
.BR kdk_get_hard_vendor (3),
.BR kdk_get_hard_disk (3).

View File

@ -0,0 +1,128 @@
.TH "KDK_GET_HARD_TYPE" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_hard_type - 获取硬盘类型
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char* kdk_get_hard_type(const char *"diskname ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
Based on the specified disk name
.I diskname,
such as absolute path such as
.I /dev/sda,
or
.BR kdk_get_hard_disk()
function returns an element in the value to obtain hard disk type information.
.SH "RETURN VALUE"
On success, Returns the type of hard drive, such as 机械 or 固态; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_hard_disk (),
.BR kdk_free_disklist (),
.BR kdk_get_hard_disk_size (),
.BR kdk_get_hard_fwrev (),
.BR kdk_get_hard_model (),
.BR kdk_get_hard_serial (),
and
.BR kdk_get_hard_vendor ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_hard_disk_size (3),
.BR kdk_get_hard_fwrev (3),
.BR kdk_get_hard_model (3),
.BR kdk_get_hard_serial (3),
.BR kdk_get_hard_vendor (3),
.BR kdk_get_hard_disk (3).

View File

@ -0,0 +1,128 @@
.TH "KDK_GET_HARD_VENDOR" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_hard_vendor - 获取硬盘序列号
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char* kdk_get_hard_vendor(const char *"diskname ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
Based on the specified disk name
.I diskname,
such as absolute path such as
.I /dev/sda,
or
.BR kdk_get_hard_disk()
function returns an element in the value to obtain hard drive manufacturer information.
.SH "RETURN VALUE"
On success, Returns the manufacturer of hard drive; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydiskinfo.h"
#include <stdio.h>
#include <stdlib.h>
static void display_disk_info(kdk_diskinfo *di)
{
printf("---------------%s------------------\n", di->name);
printf("Disk Sectors:\t%llu\n", di->sectors_num);
printf("Disk Sector Size:\t%u\n", di->sector_size);
printf("Disk Size:\t%f MiB\n", di->total_size_MiB);
printf("Disk Model:\t%s\n", di->model ? di->model : "None");
printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None");
printf("Disk Partition Number:\t%u\n", di->partition_nums);
printf("Disk Type:\t%d\n", di->disk_type);
printf("Disk fwrev:\t%s\n", di->fwrev);
}
static void display_disk_list(char **disklist)
{
int count = 0;
while (disklist[count])
{
printf("No. %d\t %s\n", count + 1, disklist[count]);
count ++;
}
}
int main()
{
char **disklist = kdk_get_disklist();
// display_disk_list(disklist);
for (int i = 0; disklist[i]; i++)
{
kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]);
if (!sdainfo)
{
printf("[%s]Get disk info error.\n", disklist[i]);
continue;
}
display_disk_info(sdainfo);
kdk_free_diskinfo(sdainfo);
}
kdk_free_disklist(disklist);
char **di = kdk_get_hard_disk();
size_t num = 0;
while (di[num])
{
printf("No. %ld\t %s\n", num + 1, di[num]);
char *res = kdk_get_hard_disk_size(di[num]);
printf("容量 = %s\n", res);
free(res);
res = kdk_get_hard_fwrev(di[num]);
printf("固态版本 = %s\n", res);
free(res);
res = kdk_get_hard_vendor(di[num]);
printf("厂商 = %s\n", res);
free(res);
res = kdk_get_hard_type(di[num]);
printf("类型 = %s\n", res);
free(res);
res = kdk_get_hard_model(di[num]);
printf("型号 = %s\n", res);
free(res);
res =kdk_get_hard_serial(di[num]);
printf("序列号 = %s\n", res);
free(res);
num ++;
}
kdk_free_disklist(di);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_hard_disk (),
.BR kdk_free_disklist (),
.BR kdk_get_hard_disk_size (),
.BR kdk_get_hard_fwrev (),
.BR kdk_get_hard_type (),
.BR kdk_get_hard_model (),
and
.BR kdk_get_hard_serial ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_hard_disk_size (3),
.BR kdk_get_hard_fwrev (3),
.BR kdk_get_hard_type (3),
.BR kdk_get_hard_model (3),
.BR kdk_get_hard_serial (3),
.BR kdk_get_hard_disk (3).

78
man/disk/libkydiskinfo.3 Normal file
View File

@ -0,0 +1,78 @@
.TH "LIBKYDISKINFO" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_get_disklist, kdk_free_disklist, kdk_get_diskinfo, kdk_get_hard_disk, kdk_get_hard_disk_size, kdk_get_hard_fwrev, kdk_get_hard_type, kdk_get_hard_model, kdk_get_hard_serial, kdk_get_hard_vendor, kdk_free_diskinfo - 获取磁盘信息
.SH SYNOPSIS
.nf
.B #include <libkydiskinfo.h>
.sp
.BI "extern char** kdk_get_disklist();"
.sp
.BI "extern void kdk_free_disklist(char** "disklist ");"
.sp
.BI "extern kdk_diskinfo *kdk_get_diskinfo(const char *"diskname ");"
.sp
.BI "extern char** kdk_get_hard_disk();"
.sp
.BI "extern char* kdk_get_hard_disk_size(const char *"hardname ");"
.sp
.BI "extern char* kdk_get_hard_fwrev(const char *"hardname ");"
.sp
.BI "extern char* kdk_get_hard_type(const char "*hardname ");"
.sp
.BI "extern char* kdk_get_hard_model(const char *"hardname ");"
.sp
.BI "extern char* kdk_get_hard_serial(const char *"hardname ");"
.sp
.BI "extern char* kdk_get_hard_vendor(const char *"hardname ");"
.sp
.BI "extern void kdk_free_diskinfo(kdk_diskinfo *"disk ");"
.sp
Link with \fI\-lkydiskinfo\fP.
.SH "Detailed Description"
This library contains disk information.
.SH DATA STRUCTURES
Structure \fBkdk_diskinfo\fR contains information related to a disk:
\fBtypedef struct _kdk_diskinfo {
.br
char *name; // 绝对路径
char *vendor; // 制造商
char *model; // 型号
char *serial; // 序列号
kdk_disk_type disk_type; // 磁盘类型,固态 or 机械 or 混合
kdk_disk_interface_type inter_type; // 接口类型
unsigned int rpm; // 转速,注意固态是没有转速概念的
unsigned long long sectors_num; // 扇区数量
unsigned int sector_size; // 每个扇区的字节数
float total_size_MiB; // 磁盘容量MiB为单位
unsigned int partition_nums; // 该磁盘/分区下的子分区数量
char *uuid; // UUID
short mounted; // 是否已挂载
char *mount_path; // 挂载路径
kdk_disk_format format; // 格式化类型
kdk_disk_partition_type part_type; // 分区类型
char *fwrev; //固件版本信息
.br
}kdk_diskinfo;\fP
There are other members not documented here, which are only meant for
libkydiskinfo internal use.
.SH "RETURN VALUE"
The return value is generally specific to the individual function called.
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_get_disklist (),
.BR kdk_get_diskinfo (),
.BR kdk_get_hard_disk (),
and
.BR kdk_get_hard_disk_size ().
.SH "SEE ALSO"
.BR kdk_free_disklist (3),
.BR kdk_get_diskinfo (3),
.BR kdk_free_diskinfo (3)
.BR kdk_get_disklist (3)

View File

@ -0,0 +1,63 @@
.TH "KYSDK_FILEWATCHER::FileWatcher" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KYSDK_FILEWATCHER::FileWatcher \- 文件管理类 主要用来增加需要监听的文件路径,增加需要监听的文件列表,从监听列表中移除指定的文件,清空监听列表,暂停文件监听,恢复文件监听
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <libkyfilewatcher\&.hpp>\fP
.PP
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "QStringList \fBaddWatchTargetRecursive\fP (QString url, FileWatcherType type=PERIODIC, int attr=OPEN|CLOSE|MODIFY|DELETE, int maxdepth=5, int recurType=DIR|REGULAR)"
.br
.RI "增加需要监听的文件路径,对于目录,默认启用递归监听子目录 "
.ti -1c
.RI "QStringList \fBaddWatchTargetListRecursive\fP (QStringList urlList, FileWatcherType type=PERIODIC, int attr=OPEN|CLOSE|MODIFY|DELETE, int maxdepth=5, int recurType=DIR|REGULAR)"
.br
.RI "增加需要监听的文件列表 "
.ti -1c
.RI "QStringList \fBremoveWatchTargetRecursive\fP (QString url, int maxdepth=5, int recurType=ALLFILE)"
.br
.RI "从监听列表中移除指定的文件 "
.ti -1c
.RI "void \fBclearWatchList\fP ()"
.br
.RI "清空监听列表 "
.ti -1c
.RI "void \fBpauseWatcher\fP ()"
.br
.RI "暂停文件监听 "
.ti -1c
.RI "void \fBrestartWatcher\fP ()"
.br
.RI "恢复文件监听 "
.ti -1c
.in -1c
.SH "Detailed Description"
.PP
文件管理类 主要用来增加需要监听的文件路径,增加需要监听的文件列表,从监听列表中移除指定的文件,清空监听列表,暂停文件监听,恢复文件监听
.PP
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR addWatchTargetRecursive (),
.BR addWatchTargetListRecursive (),
.BR removeWatchTargetRecursive (),
.BR clearWatchList (),
.BR pauseWatcher ()
and
.BR restartWatcher ().
.SH "SEE ALSO"
.BR addWatchTargetRecursive (3),
.BR addWatchTargetListRecursive (3),
.BR removeWatchTargetRecursive (3),
.BR clearWatchList (3),
.BR pauseWatcher (3)
and
.BR restartWatcher (3).

View File

@ -0,0 +1,128 @@
.TH "addWatchTargetListRecursive" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
addWatchTargetListRecursive - 增加需要监听的文件列表
.SH SYNOPSIS
.nf
.B #include <libkyfilewatcher.hpp>
.sp
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP"
.in -1c
.sp
.SS "Functions"
.in +1c
.ti -1c
.RI "QStringList addWatchTargetListRecursive(QStringList urlList, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR);"
.in -1c
.sp
Link with \fI\-lkyfilewatcher\fP.
.SH "Detailed Description"
The main function of the interface is to add a list of files that need to be monitored.
.PP
The argument
.I urlList
is a list of file paths.
.PP
The argument
.I type
is the file watcher typewhich is an enumeration type. The content is as follows:
.PP
enum FileWatcherType{
ONESHOT = 0, // 仅报送一次事件。请注意事件发生后监听符号会从监听列表中移除下次再用需要重新add
PERIODIC,
NEVER
};
.PP
The argument
.I attr
is the file watcher attributewhich is an enumeration type. The content is as follows:
.PP
enum FileWatcherAttribute{
ACCESS = IN_ACCESS,
CREATE = IN_CREATE,
MODIFY = IN_MODIFY,
DELETE = IN_DELETE | IN_DELETE_SELF,
ATTRIB = IN_ATTRIB,
MOVE = IN_MOVE | IN_MOVE_SELF,
OPEN = IN_OPEN,
CLOSE = IN_CLOSE,
ALL = IN_ALL_EVENTS
};
.PP
The argument
.I maxdepth
is the maximum depth specified for traversal search.
.PP
The argument
.I recurType
is the recursive typewhich is an enumeration type. The content is as follows:
.PP
enum RecursiveType{
DIR = 1 << 0,
REGULAR = 1 << 1,
HIDDEN = 1 << 2,
TMPFILE = 1 << 3, //认为那些以~开头的是临时文件
ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR
};
.SH "RETURN VALUE"
.SH EXAMPLES
.EX
#include <QCoreApplication>
#include <QDebug>
#include "libkyfilewatcher.hpp"
using namespace KYSDK_FILEWATCHER;
int main(int argc, char *argv[])
{
KYSDK_FILEWATCHER::FileWatcher watcher;
watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR);
getchar();
// qDebug() << "update attr test";
// watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE);
// getchar();
// qDebug() << "re-add test";
// watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL);
// getchar();
// qDebug() << "update oneshot test";
// watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT);
// getchar();
// qDebug() << "remove target test";
// watcher.removeWatchTarget("/data/testcode/test.c");
// getchar();
watcher.clearWatchList();
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR addWatchTargetRecursive (),
.BR removeWatchTargetRecursive (),
.BR clearWatchList (),
.BR pauseWatcher ()
and
.BR restartWatcher ().
.SH "SEE ALSO"
.BR addWatchTargetRecursive (3),
.BR removeWatchTargetRecursive (3),
.BR clearWatchList (3),
.BR pauseWatcher (3)
and
.BR restartWatcher (3).

View File

@ -0,0 +1,128 @@
.TH "addWatchTargetRecursive" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
addWatchTargetRecursive - 增加需要监听的文件路径,对于目录,默认启用递归监听子目录
.SH SYNOPSIS
.nf
.B #include <libkyfilewatcher.hpp>
.sp
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP"
.in -1c
.sp
.SS "Functions"
.in +1c
.ti -1c
.RI "QStringList addWatchTargetRecursive(QString url, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR);"
.in -1c
.sp
Link with \fI\-lkyfilewatcher\fP.
.SH "Detailed Description"
The main function of the interface is to add file paths that need to be listened to, and for directories, recursive listening subdirectories are enabled by default.
.PP
The argument
.I url
is the file path.
.PP
The argument
.I type
is the file watcher typewhich is an enumeration type. The content is as follows:
.PP
enum FileWatcherType{
ONESHOT = 0, // 仅报送一次事件。请注意事件发生后监听符号会从监听列表中移除下次再用需要重新add
PERIODIC,
NEVER
};
.PP
The argument
.I attr
is the file watcher attributewhich is an enumeration type. The content is as follows:
.PP
enum FileWatcherAttribute{
ACCESS = IN_ACCESS,
CREATE = IN_CREATE,
MODIFY = IN_MODIFY,
DELETE = IN_DELETE | IN_DELETE_SELF,
ATTRIB = IN_ATTRIB,
MOVE = IN_MOVE | IN_MOVE_SELF,
OPEN = IN_OPEN,
CLOSE = IN_CLOSE,
ALL = IN_ALL_EVENTS
};
.PP
The argument
.I maxdepth
is the maximum depth specified for traversal search.
.PP
The argument
.I recurType
is the recursive typewhich is an enumeration type. The content is as follows:
.PP
enum RecursiveType{
DIR = 1 << 0,
REGULAR = 1 << 1,
HIDDEN = 1 << 2,
TMPFILE = 1 << 3, //认为那些以~开头的是临时文件
ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR
};
.SH "RETURN VALUE"
.SH EXAMPLES
.EX
#include <QCoreApplication>
#include <QDebug>
#include "libkyfilewatcher.hpp"
using namespace KYSDK_FILEWATCHER;
int main(int argc, char *argv[])
{
KYSDK_FILEWATCHER::FileWatcher watcher;
watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR);
getchar();
// qDebug() << "update attr test";
// watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE);
// getchar();
// qDebug() << "re-add test";
// watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL);
// getchar();
// qDebug() << "update oneshot test";
// watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT);
// getchar();
// qDebug() << "remove target test";
// watcher.removeWatchTarget("/data/testcode/test.c");
// getchar();
watcher.clearWatchList();
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR addWatchTargetListRecursive (),
.BR removeWatchTargetRecursive (),
.BR clearWatchList (),
.BR pauseWatcher ()
and
.BR restartWatcher ().
.SH "SEE ALSO"
.BR addWatchTargetListRecursive (3),
.BR removeWatchTargetRecursive (3),
.BR clearWatchList (3),
.BR pauseWatcher (3)
and
.BR restartWatcher (3).

View File

@ -0,0 +1,82 @@
.TH "clearWatchList" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
clearWatchList - 清空监听列表
.SH SYNOPSIS
.nf
.B #include <libkyfilewatcher.hpp>
.sp
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP"
.in -1c
.sp
.SS "Functions"
.in +1c
.ti -1c
.RI "void clearWatchList();"
.in -1c
.sp
Link with \fI\-lkyfilewatcher\fP.
.SH "Detailed Description"
The main function of the interface is to clear listening list.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include <QCoreApplication>
#include <QDebug>
#include "libkyfilewatcher.hpp"
using namespace KYSDK_FILEWATCHER;
int main(int argc, char *argv[])
{
KYSDK_FILEWATCHER::FileWatcher watcher;
watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR);
getchar();
// qDebug() << "update attr test";
// watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE);
// getchar();
// qDebug() << "re-add test";
// watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL);
// getchar();
// qDebug() << "update oneshot test";
// watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT);
// getchar();
// qDebug() << "remove target test";
// watcher.removeWatchTarget("/data/testcode/test.c");
// getchar();
watcher.clearWatchList();
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR addWatchTargetRecursive (),
.BR addWatchTargetListRecursive (),
.BR removeWatchTargetRecursive (),
.BR pauseWatcher ()
and
.BR restartWatcher ().
.SH "SEE ALSO"
.BR addWatchTargetRecursive (3),
.BR addWatchTargetListRecursive (3),
.BR removeWatchTargetRecursive (3),
.BR pauseWatcher (3)
and
.BR restartWatcher (3).

View File

@ -0,0 +1,124 @@
.TH "libkyfilewatcher" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
libkyfilewatcher - 文件管理功能
.SH SYNOPSIS
.br
.PP
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP"
.br
.RI "文件管理类 主要用来增加需要监听的文件路径,增加需要监听的文件列表,从监听列表中移除指定的文件,清空监听列表,暂停文件监听,恢复文件监听 "
.in -1c
.SS "Enumerations"
.in +1c
.ti -1c
.RI "enum \fBFileWatcherType\fP { \fBONESHOT\fP = 0, \fBPERIODIC\fP, \fBNEVER\fP }"
.br
.ti -1c
.RI "enum \fBFileWatcherAttribute\fP { \fBACCESS\fP = IN_ACCESS, \fBCREATE\fP = IN_CREATE, \fBMODIFY\fP = IN_MODIFY, \fBDELETE\fP = IN_DELETE | IN_DELETE_SELF, \fBATTRIB\fP = IN_ATTRIB, \fBMOVE\fP = IN_MOVE | IN_MOVE_SELF, \fBOPEN\fP = IN_OPEN, \fBCLOSE\fP = IN_CLOSE, \fBALL\fP = IN_ALL_EVENTS }"
.br
.ti -1c
.RI "enum \fBRecursiveType\fP { \fBDIR\fP = 1 << 0, \fBREGULAR\fP = 1 << 1, \fBHIDDEN\fP = 1 << 2, \fBTMPFILE\fP = 1 << 3, \fBALLFILE\fP = HIDDEN | TMPFILE | DIR | REGULAR }"
.br
.in -1c
.SS "Functions"
.in +1c
.ti -1c
.RI "QStringList \fBKYSDK_FILEWATCHER::FileWatcher::addWatchTargetRecursive\fP (QString url, FileWatcherType type=PERIODIC, int attr=OPEN|CLOSE|MODIFY|DELETE, int maxdepth=5, int recurType=DIR|REGULAR)"
.br
.RI "增加需要监听的文件路径,对于目录,默认启用递归监听子目录 "
.ti -1c
.RI "QStringList \fBKYSDK_FILEWATCHER::FileWatcher::addWatchTargetListRecursive\fP (QStringList urlList, FileWatcherType type=PERIODIC, int attr=OPEN|CLOSE|MODIFY|DELETE, int maxdepth=5, int recurType=DIR|REGULAR)"
.br
.RI "增加需要监听的文件列表 "
.ti -1c
.RI "QStringList \fBKYSDK_FILEWATCHER::FileWatcher::removeWatchTargetRecursive\fP (QString url, int maxdepth=5, int recurType=ALLFILE)"
.br
.RI "从监听列表中移除指定的文件 "
.ti -1c
.RI "void \fBKYSDK_FILEWATCHER::FileWatcher::clearWatchList\fP ()"
.br
.RI "清空监听列表 "
.ti -1c
.RI "void \fBKYSDK_FILEWATCHER::FileWatcher::pauseWatcher\fP ()"
.br
.RI "暂停文件监听 "
.ti -1c
.RI "void \fBKYSDK_FILEWATCHER::FileWatcher::restartWatcher\fP ()"
.br
.RI "恢复文件监听 "
.ti -1c
.in -1c
.SH "Detailed Description"
此库的主要功能是提供文件管理接口和类
.PP
.SH "Function Documentation"
.PP
.SS "QStringList KYSDK_FILEWATCHER::FileWatcher::addWatchTargetListRecursive (QStringList urlList, FileWatcherType type = \fCPERIODIC\fP, int attr = \fCOPEN|CLOSE|MODIFY|DELETE\fP, int maxdepth = \fC5\fP, int recurType = \fCDIR|REGULAR\fP)"
.PP
增加需要监听的文件列表
.PP
\fBParameters\fP
.RS 4
\fIurlList\fP 需要监听的文件列表
.br
\fItype\fP 文件监听类型
.br
\fIattr\fP 文件监听属性
.br
\fImaxdepth\fP 指定遍历搜索的最大深度
.br
\fIrecurType\fP 递归类型
.RE
.PP
.SS "QStringList KYSDK_FILEWATCHER::FileWatcher::addWatchTargetRecursive (QString url, FileWatcherType type = \fCPERIODIC\fP, int attr = \fCOPEN|CLOSE|MODIFY|DELETE\fP, int maxdepth = \fC5\fP, int recurType = \fCDIR|REGULAR\fP)"
.PP
增加需要监听的文件路径,对于目录,默认启用递归监听子目录
.PP
\fBParameters\fP
.RS 4
\fIurl\fP 文件路径
.br
\fItype\fP 文件监听类型
.br
\fIattr\fP 文件监听属性
.br
\fImaxdepth\fP 指定遍历搜索的最大深度
.br
\fIrecurType\fP 递归类型
.RE
.PP
.PP
\fBExamples\fP
.in +1c
\fBkysdk\-system/src/filesystem/filewatcher/test/kyfilewatcher\-test\&.cpp\fP\&.
.SS "QStringList KYSDK_FILEWATCHER::FileWatcher::removeWatchTargetRecursive (QString url, int maxdepth = \fC5\fP, int recurType = \fCALLFILE\fP)"
.PP
从监听列表中移除指定的文件
.PP
\fBParameters\fP
.RS 4
\fIurl\fP 指定的文件的路径
.br
\fImaxdepth\fP 指定遍历搜索的最大深度
.br
\fIrecurType\fP 递归类型
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for libkyfilewatcher.hpp from the source code\&.

View File

@ -0,0 +1,82 @@
.TH "pauseWatcher" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
pauseWatcher - 暂停文件监听
.SH SYNOPSIS
.nf
.B #include <libkyfilewatcher.hpp>
.sp
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP"
.in -1c
.sp
.SS "Functions"
.in +1c
.ti -1c
.RI "void pauseWatcher();"
.in -1c
.sp
Link with \fI\-lkyfilewatcher\fP.
.SH "Detailed Description"
The main function of the interface is to pause file listening.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include <QCoreApplication>
#include <QDebug>
#include "libkyfilewatcher.hpp"
using namespace KYSDK_FILEWATCHER;
int main(int argc, char *argv[])
{
KYSDK_FILEWATCHER::FileWatcher watcher;
watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR);
getchar();
// qDebug() << "update attr test";
// watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE);
// getchar();
// qDebug() << "re-add test";
// watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL);
// getchar();
// qDebug() << "update oneshot test";
// watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT);
// getchar();
// qDebug() << "remove target test";
// watcher.removeWatchTarget("/data/testcode/test.c");
// getchar();
watcher.clearWatchList();
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR addWatchTargetRecursive (),
.BR addWatchTargetListRecursive (),
.BR removeWatchTargetRecursive (),
.BR clearWatchList ()
and
.BR restartWatcher ().
.SH "SEE ALSO"
.BR addWatchTargetRecursive (3),
.BR addWatchTargetListRecursive (3),
.BR removeWatchTargetRecursive (3),
.BR clearWatchList (3)
and
.BR restartWatcher (3).

View File

@ -0,0 +1,102 @@
.TH "removeWatchTargetRecursive" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
removeWatchTargetRecursive - 从监听列表中移除指定的文件
.SH SYNOPSIS
.nf
.B #include <libkyfilewatcher.hpp>
.sp
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP"
.in -1c
.sp
.SS "Functions"
.in +1c
.ti -1c
.RI "QStringList removeWatchTargetRecursive(QString url, int maxdepth = 5, int recurType = ALLFILE);"
.in -1c
.sp
Link with \fI\-lkyfilewatcher\fP.
.SH "Detailed Description"
The main function of the interface is to remove the specified file from the listening list.
.PP
The argument
.I url
is the file path.
.PP
The argument
.I maxdepth
is the maximum depth specified for traversal search.
.PP
The argument
.I recurType
is the recursive typewhich is an enumeration type. The content is as follows:
.PP
enum RecursiveType{
DIR = 1 << 0,
REGULAR = 1 << 1,
HIDDEN = 1 << 2,
TMPFILE = 1 << 3, //认为那些以~开头的是临时文件
ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR
};
.SH "RETURN VALUE"
.SH EXAMPLES
.EX
#include <QCoreApplication>
#include <QDebug>
#include "libkyfilewatcher.hpp"
using namespace KYSDK_FILEWATCHER;
int main(int argc, char *argv[])
{
KYSDK_FILEWATCHER::FileWatcher watcher;
watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR);
getchar();
// qDebug() << "update attr test";
// watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE);
// getchar();
// qDebug() << "re-add test";
// watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL);
// getchar();
// qDebug() << "update oneshot test";
// watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT);
// getchar();
// qDebug() << "remove target test";
// watcher.removeWatchTarget("/data/testcode/test.c");
// getchar();
watcher.clearWatchList();
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR addWatchTargetRecursive (),
.BR addWatchTargetListRecursive (),
.BR clearWatchList (),
.BR pauseWatcher ()
and
.BR restartWatcher ().
.SH "SEE ALSO"
.BR addWatchTargetRecursive (3),
.BR addWatchTargetListRecursive (3),
.BR clearWatchList (3),
.BR pauseWatcher (3)
and
.BR restartWatcher (3).

View File

@ -0,0 +1,82 @@
.TH "restartWatcher" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
restartWatcher - 恢复文件监听
.SH SYNOPSIS
.nf
.B #include <libkyfilewatcher.hpp>
.sp
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP"
.in -1c
.sp
.SS "Functions"
.in +1c
.ti -1c
.RI "void restartWatcher();"
.in -1c
.sp
Link with \fI\-lkyfilewatcher\fP.
.SH "Detailed Description"
The main function of the interface is to recover file listening.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include <QCoreApplication>
#include <QDebug>
#include "libkyfilewatcher.hpp"
using namespace KYSDK_FILEWATCHER;
int main(int argc, char *argv[])
{
KYSDK_FILEWATCHER::FileWatcher watcher;
watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR);
getchar();
// qDebug() << "update attr test";
// watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE);
// getchar();
// qDebug() << "re-add test";
// watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL);
// getchar();
// qDebug() << "update oneshot test";
// watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT);
// getchar();
// qDebug() << "remove target test";
// watcher.removeWatchTarget("/data/testcode/test.c");
// getchar();
watcher.clearWatchList();
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR addWatchTargetRecursive (),
.BR addWatchTargetListRecursive (),
.BR removeWatchTargetRecursive (),
.BR clearWatchList ()
and
.BR pauseWatcher ().
.SH "SEE ALSO"
.BR addWatchTargetRecursive (3),
.BR addWatchTargetListRecursive (3),
.BR removeWatchTargetRecursive (3),
.BR clearWatchList (3)
and
.BR pauseWatcher (3).

View File

@ -0,0 +1,49 @@
.TH "KDK_BIOS_FREE" 3 "Thu Aug 14 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bios_free - 释放内存
.SH SYNOPSIS
.nf
.B #include <libkybios.h>
.sp
.BI "extern void kdk_bios_free(char *info);"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of this interface is to release the string returned by the bios module interface.
.PP
The argument
.I info
is the return value of the
.BI kdk_bios_get_vendor
or
.BI kdk_bios_get_version
of the functions
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "stdio.h"
#include "libkybios.h"
#include <stdlib.h>
.PP
int main()
{
char *vendor = kdk_bios_get_vendor();
char *version = kdk_bios_get_version();
printf("vendor: %s", vendor);
printf("version: %s",version);
kdk_bios_free(vendor);
kdk_bios_free(version);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bios_get_version ().
and
.BR kdk_bios_get_vendor ().
.SH "SEE ALSO"
.BR kdk_bios_get_version (3).
and
.BR kdk_bios_get_vendor (3).

View File

@ -0,0 +1,44 @@
.TH "KDK_BIOS_GET_VENDOR" 3 "Thu Aug 14 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bios_get_vendor - 获取bios厂商
.SH SYNOPSIS
.nf
.B #include <libkybios.h>
.sp
.BI "extern const char* kdk_bios_get_vendor();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain bios manufacturer
.SH "RETURN VALUE"
On success, returns the bios manufacturer of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include <stdio.h>
#include "libkybios.h"
#include <stdlib.h>
.PP
int main()
{
char *vendor = kdk_bios_get_vendor();
char *version = kdk_bios_get_version();
printf("vendor: %s", vendor);
printf("version: %s",version);
free(vendor);
free(version);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bios_get_version ().
and
.BR kdk_bios_free ().
.SH "SEE ALSO"
.BR kdk_bios_get_version (3).
and
.BR kdk_bios_free (3).

View File

@ -0,0 +1,44 @@
.TH "KDK_BIOS_GET_VERSION" 3 "Thu Aug 14 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bios_get_version - 获取bios版本
.SH SYNOPSIS
.nf
.B #include <libkybios.h>
.sp
.BI "extern const char* kdk_bios_get_version();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain bios version
.SH "RETURN VALUE"
On success, returns the bios version of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include <stdio.h>
#include "libkybios.h"
#include <stdlib.h>
.PP
int main()
{
char *vendor = kdk_bios_get_vendor();
char *version = kdk_bios_get_version();
printf("vendor: %s", vendor);
printf("version: %s",version);
free(vendor);
free(version);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bios_get_vendor ().
and
.BR kdk_bios_free ().
.SH "SEE ALSO"
.BR kdk_bios_get_vendor (3).
and
.BR kdk_bios_free (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_ADDRESS" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_address - 获取蓝牙的地址
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_address(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the address of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth address of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_ALCMTU" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_alcmtu - 获取蓝牙的ALC MTU
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_alcmtu(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the ALC MTU of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth ALC MTU of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_BUS" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_bus - 获取蓝牙的总线
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_bus(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the bus of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth bus of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_DEV_VERSION" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_dev_version - 获取蓝牙的设备id
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_dev_version(int "num ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the device version of Bluetooth.
.PP
The argument
.I num
is the number of Bluetooth devices, starting from 0, 0 represents 1, and so on.
.SH "RETURN VALUE"
On success, returns the device Bluetooth version of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,98 @@
.TH "KDK_BLUETOOTH_GET_DEVICE_ID" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_device_id - 获取蓝牙的设备id
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern int** kdk_bluetooth_get_device_id();"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the device ID for Bluetooth.
.SH "RETURN VALUE"
On success, returns the device ID of Bluetooth.
.PP
On error, return
.BR 0.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_FEATURES" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_features - 获取蓝牙的功能
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_features(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the features of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth features of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu ()
and
.BR kdk_bluetooth_get_packettype ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3)
and
.BR kdk_bluetooth_get_packettype (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_LINK_MODE" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_link_mode - 获取蓝牙的链接模式
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_link_mode(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the link mode of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth link mode of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_LINK_POLICY" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_link_policy - 获取蓝牙的链接策略
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_link_policy(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the link policy of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth link policy of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_MANUFACTURER" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_manufacturer - 获取蓝牙的设备id
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_manufacturer(int "num ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the manufacturer of Bluetooth.
.PP
The argument
.I num
is the number of Bluetooth devices, starting from 0, 0 represents 1, and so on.
.SH "RETURN VALUE"
On success, returns the Bluetooth manufacturer of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_NAME" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_name - 获取蓝牙的名称
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_name(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the name of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth name of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_PACKETTYPE" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_packettype - 获取蓝牙的数据包类型
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_packettype(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the packet type of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth packet type of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_scomtu (),
.BR kdk_bluetooth_get_alcmtu ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_scomtu (3),
.BR kdk_bluetooth_get_alcmtu (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_BLUETOOTH_GET_SCOMTU" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_bluetooth_get_scomtu - 获取蓝牙的SCO MTU
.SH SYNOPSIS
.nf
.B #include <libkybluetooth.h>
.sp
.BI "extern char* kdk_bluetooth_get_scomtu(int "id ");"
.sp
Link with \fI\-lkybluetooth\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the SCO MTU of Bluetooth.
.PP
The argument
.I id
is the device ID of Bluetooth.
.SH "RETURN VALUE"
On success, returns the Bluetooth SCO MTU of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
char *manufacturer = "\0";
char *version = "\0";
char *name = "\0";
char *address = "\0";
char *link_mode ="\0";
char *link_policy ="\0";
char *scomtu = "\0";
char *alcmtu = "\0";
char *packettype = "\0";
char *features = "\0";
char *bus = "\0";
int **id = kdk_bluetooth_get_device_id();
do
{
printf("id = %d\n",id[i]);
manufacturer = kdk_bluetooth_get_manufacturer(i);
printf("manufacturer: %s\n", manufacturer);
free(manufacturer);
version = kdk_bluetooth_get_dev_version(i);
printf("version: %s\n", version);
free(version);
name = kdk_bluetooth_get_name(id[i]);
printf("name: %s\n", name);
address = kdk_bluetooth_get_address(id[i]);
printf("address: %s\n", address);
link_mode = kdk_bluetooth_get_link_mode(id[i]);
printf("link_mode: %s\n", link_mode);
link_policy = kdk_bluetooth_get_link_policy(id[i]);
printf("link_policy: %s\n", link_policy);
scomtu = kdk_bluetooth_get_scomtu(id[i]);
printf("scomtu: %s\n", scomtu);
alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
printf("alcmtu: %s\n", alcmtu);
packettype = kdk_bluetooth_get_packettype(id[i]);
printf("packettype: %s\n", packettype);
features = kdk_bluetooth_get_features(id[i]);
printf("features: %s\n", features);
bus = kdk_bluetooth_get_bus(id[i]);
printf("bus: %s\n", bus);
i++;
}while(id[i]);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_bluetooth_get_device_id (),
.BR kdk_bluetooth_get_manufacturer (),
.BR kdk_bluetooth_get_dev_version (),
.BR kdk_bluetooth_get_name (),
.BR kdk_bluetooth_get_address (),
.BR kdk_bluetooth_get_link_mode (),
.BR kdk_bluetooth_get_link_policy (),
.BR kdk_bluetooth_get_bus (),
.BR kdk_bluetooth_get_alcmtu (),
.BR kdk_bluetooth_get_packettype ()
and
.BR kdk_bluetooth_get_features ().
.SH "SEE ALSO"
.BR kdk_bluetooth_get_device_id (3),
.BR kdk_bluetooth_get_manufacturer (3),
.BR kdk_bluetooth_get_dev_version (3),
.BR kdk_bluetooth_get_name (3),
.BR kdk_bluetooth_get_address (3),
.BR kdk_bluetooth_get_link_mode (3),
.BR kdk_bluetooth_get_link_policy (3),
.BR kdk_bluetooth_get_bus (3),
.BR kdk_bluetooth_get_alcmtu (3),
.BR kdk_bluetooth_get_packettype (3)
and
.BR kdk_bluetooth_get_features (3).

View File

@ -0,0 +1,59 @@
.TH "KDK_BOARD_FREE" 3 "Thu Aug 14 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_board_free - 释放内存
.SH SYNOPSIS
.nf
.B #include <libkybios.h>
.sp
.BI "extern void kdk_board_free(char *info);"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of this interface is to release the string returned by the mainboard module interface.
.PP
The argument
.I info
is the return value of the
.BI kdk_board_get_name,
.BI kdk_board_get_vendor,
.BI kdk_board_get_serial,
or
.BI kdk_board_get_date
of the functions
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "stdio.h"
#include "libkyboard.h"
int main()
{
char *name = kdk_board_get_name();
char *vendor = kdk_board_get_vendor();
char *date = kdk_board_get_date();
char *serial = kdk_board_get_serial();
printf("name : %s", name);
printf("vendor : %s", vendor);
printf("date : %s", date);
printf("serial : %s", serial);
kdk_board_free(name);
kdk_board_free(vendor);
kdk_board_free(date);
kdk_board_free(serial);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_board_get_serial (),
.BR kdk_board_get_date (),
.BR kdk_board_get_name ()
and
.BR kdk_board_get_vendor ().
.SH "SEE ALSO"
.BR kdk_board_get_serial (3),
.BR kdk_board_get_date (3),
.BR kdk_board_get_name (3)
and
.BR kdk_board_get_vendor (3).

View File

@ -0,0 +1,55 @@
.TH "KDK_BOARD_GET_DATE" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_board_get_date - 获取主板生产日期
.SH SYNOPSIS
.nf
.B #include <libkyboard.h>
.sp
.BI "extern const char* kdk_board_get_date();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the production date of the mainboard
.SH "RETURN VALUE"
On success, return the production date of the mainboard of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "stdio.h"
#include "libkyboard.h"
int main()
{
char *name = kdk_board_get_name();
char *vendor = kdk_board_get_vendor();
char *date = kdk_board_get_date();
char *serial = kdk_board_get_serial();
printf("name : %s", name);
printf("vendor : %s", vendor);
printf("date : %s", date);
printf("serial : %s", serial);
free(name);
free(vendor);
free(date);
free(serial);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_board_get_vendor (),
.BR kdk_board_get_name (),
.BR kdk_board_get_serial ()
and
.BR kdk_board_free ().
.SH "SEE ALSO"
.BR kdk_board_get_vendor (3),
.BR kdk_board_get_name (3),
.BR kdk_board_get_serial (3)
and
.BR kdk_board_free (3).

View File

@ -0,0 +1,55 @@
.TH "KDK_BOARD_GET_NAME" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_board_get_name - 获取主板型号
.SH SYNOPSIS
.nf
.B #include <libkyboard.h>
.sp
.BI "extern const char* kdk_board_get_name();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain mainboard model
.SH "RETURN VALUE"
On success, returns the mainboard model of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "stdio.h"
#include "libkyboard.h"
int main()
{
char *name = kdk_board_get_name();
char *vendor = kdk_board_get_vendor();
char *date = kdk_board_get_date();
char *serial = kdk_board_get_serial();
printf("name : %s", name);
printf("vendor : %s", vendor);
printf("date : %s", date);
printf("serial : %s", serial);
free(name);
free(vendor);
free(date);
free(serial);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_board_get_vendor (),
.BR kdk_board_get_date (),
.BR kdk_board_get_serial ()
and
.BR kdk_board_free ().
.SH "SEE ALSO"
.BR kdk_board_get_vendor (3),
.BR kdk_board_get_date (3),
.BR kdk_board_get_serial (3)
and
.BR kdk_board_free (3).

View File

@ -0,0 +1,55 @@
.TH "KDK_BOARD_GET_SERIAL" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_board_get_serial - 获取主板序列号
.SH SYNOPSIS
.nf
.B #include <libkyboard.h>
.sp
.BI "extern const char* kdk_board_get_serial();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain mainboard serial number
.SH "RETURN VALUE"
On success, returns the mainboard serial number of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "stdio.h"
#include "libkyboard.h"
int main()
{
char *name = kdk_board_get_name();
char *vendor = kdk_board_get_vendor();
char *date = kdk_board_get_date();
char *serial = kdk_board_get_serial();
printf("name : %s", name);
printf("vendor : %s", vendor);
printf("date : %s", date);
printf("serial : %s", serial);
free(name);
free(vendor);
free(date);
free(serial);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_board_get_vendor (),
.BR kdk_board_get_date (),
.BR kdk_board_get_name ()
and
.BR kdk_board_free ().
.SH "SEE ALSO"
.BR kdk_board_get_vendor (3),
.BR kdk_board_get_date (3),
.BR kdk_board_get_name (3)
and
.BR kdk_board_free (3).

View File

@ -0,0 +1,55 @@
.TH "KDK_BOARD_GET_VENDOR" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_board_get_vendor - 获取主板厂商
.SH SYNOPSIS
.nf
.B #include <libkyboard.h>
.sp
.BI "extern const char* kdk_board_get_vendor();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain mainboard manufacturer
.SH "RETURN VALUE"
On success, returns the mainboard manufacturer of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "stdio.h"
#include "libkyboard.h"
int main()
{
char *name = kdk_board_get_name();
char *vendor = kdk_board_get_vendor();
char *date = kdk_board_get_date();
char *serial = kdk_board_get_serial();
printf("name : %s", name);
printf("vendor : %s", vendor);
printf("date : %s", date);
printf("serial : %s", serial);
free(name);
free(vendor);
free(date);
free(serial);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_board_get_serial (),
.BR kdk_board_get_date (),
.BR kdk_board_get_name ()
and
.BR kdk_board_free ().
.SH "SEE ALSO"
.BR kdk_board_get_serial (3),
.BR kdk_board_get_date (3),
.BR kdk_board_get_name (3)
and
.BR kdk_board_free (3).

View File

@ -0,0 +1,53 @@
.TH "KDK_CPU_GET_ARCH" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_cpu_get_arch - 获取CPU架构
.SH SYNOPSIS
.nf
.B #include <libkycpu.h>
.sp
.BI "extern const char* kdk_cpu_get_arch();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain CPU architecture
.SH "RETURN VALUE"
On success, returns the CPU architecture of type char*, such as "x86_64"; The return is const char*, do not
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkycpu.h"
#include <stdio.h>
int main()
{
printf("架构:%s\en", kdk_cpu_get_arch());
printf("生产厂商:%s\en", kdk_cpu_get_vendor());
printf("CPU 型号:%s\en", kdk_cpu_get_model());
printf("CPU 主频:%s MHz\en", kdk_cpu_get_freq_MHz());
printf("CPU 单核核心数量:%u\en", kdk_cpu_get_corenums());
printf("CPU 虚拟化支持:%s\en", kdk_cpu_get_virt());
printf("CPU 线程数:%u\en", kdk_cpu_get_process());
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_cpu_get_vendor (),
.BR kdk_cpu_get_model (),
.BR kdk_cpu_get_freq_MHz (),
.BR kdk_cpu_get_corenums (),
.BR kdk_cpu_get_virt ()
and
.BR kdk_cpu_get_process ().
.SH "SEE ALSO"
.BR kdk_cpu_get_vendor (3),
.BR kdk_cpu_get_model (3),
.BR kdk_cpu_get_freq_MHz (3),
.BR kdk_cpu_get_corenums (3),
.BR kdk_cpu_get_virt (3)
and
.BR kdk_cpu_get_process (3).

View File

@ -0,0 +1,52 @@
.TH "KDK_CPU_GET_CORENUMS" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_cpu_get_corenums - 获取CPU核心数量
.SH SYNOPSIS
.nf
.B #include <libkycpu.h>
.sp
.BI "extern unsigned int kdk_cpu_get_corenums()"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the number of CPU cores
.SH "RETURN VALUE"
On success, returns the number of all available CPU cores of type int.
.PP
On error, return
.BR 0.
.SH EXAMPLES
.EX
#include "libkycpu.h"
#include <stdio.h>
int main()
{
printf("架构:%s\en", kdk_cpu_get_arch());
printf("生产厂商:%s\en", kdk_cpu_get_vendor());
printf("CPU 型号:%s\en", kdk_cpu_get_model());
printf("CPU 主频:%s MHz\en", kdk_cpu_get_freq_MHz());
printf("CPU 单核核心数量:%u\en", kdk_cpu_get_corenums());
printf("CPU 虚拟化支持:%s\en", kdk_cpu_get_virt());
printf("CPU 线程数:%u\en", kdk_cpu_get_process());
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_cpu_get_vendor (),
.BR kdk_cpu_get_model (),
.BR kdk_cpu_get_freq_MHz (),
.BR kdk_cpu_get_arch (),
.BR kdk_cpu_get_virt ()
and
.BR kdk_cpu_get_process ().
.SH "SEE ALSO"
.BR kdk_cpu_get_vendor (3),
.BR kdk_cpu_get_model (3),
.BR kdk_cpu_get_freq_MHz (3),
.BR kdk_cpu_get_arch (3),
.BR kdk_cpu_get_virt (3)
and
.BR kdk_cpu_get_process (3).

View File

@ -0,0 +1,53 @@
.TH "KDK_CPU_GET_FREQ_MHZ" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_cpu_get_freq_MHz - 获取CPU额定主频
.SH SYNOPSIS
.nf
.B #include <libkycpu.h>
.sp
.BI "extern const char* kdk_cpu_get_freq_MHz();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain CPU Clock Speed
.SH "RETURN VALUE"
On success, returns the CPU Clock Speed of type char*, such as "1794.742" unit is MHz; The return is const char*, do not
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkycpu.h"
#include <stdio.h>
int main()
{
printf("架构:%s\en", kdk_cpu_get_arch());
printf("生产厂商:%s\en", kdk_cpu_get_vendor());
printf("CPU 型号:%s\en", kdk_cpu_get_model());
printf("CPU 主频:%s MHz\en", kdk_cpu_get_freq_MHz());
printf("CPU 单核核心数量:%u\en", kdk_cpu_get_corenums());
printf("CPU 虚拟化支持:%s\en", kdk_cpu_get_virt());
printf("CPU 线程数:%u\en", kdk_cpu_get_process());
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_cpu_get_vendor (),
.BR kdk_cpu_get_arch (),
.BR kdk_cpu_get_model (),
.BR kdk_cpu_get_corenums (),
.BR kdk_cpu_get_virt ()
and
.BR kdk_cpu_get_process ().
.SH "SEE ALSO"
.BR kdk_cpu_get_vendor (3),
.BR kdk_cpu_get_arch (3),
.BR kdk_cpu_get_model (3),
.BR kdk_cpu_get_corenums (3),
.BR kdk_cpu_get_virt (3)
and
.BR kdk_cpu_get_process (3).

View File

@ -0,0 +1,53 @@
.TH "KDK_CPU_GET_MODEL" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_cpu_get_model - 获取CPU型号
.SH SYNOPSIS
.nf
.B #include <libkycpu.h>
.sp
.BI "extern const char* kdk_cpu_get_model();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain CPU model
.SH "RETURN VALUE"
On success, returns the CPU model of type char*, such as "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz"; The return is const char*, do not
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkycpu.h"
#include <stdio.h>
int main()
{
printf("架构:%s\en", kdk_cpu_get_arch());
printf("生产厂商:%s\en", kdk_cpu_get_vendor());
printf("CPU 型号:%s\en", kdk_cpu_get_model());
printf("CPU 主频:%s MHz\en", kdk_cpu_get_freq_MHz());
printf("CPU 单核核心数量:%u\en", kdk_cpu_get_corenums());
printf("CPU 虚拟化支持:%s\en", kdk_cpu_get_virt());
printf("CPU 线程数:%u\en", kdk_cpu_get_process());
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_cpu_get_vendor (),
.BR kdk_cpu_get_arch (),
.BR kdk_cpu_get_freq_MHz (),
.BR kdk_cpu_get_corenums (),
.BR kdk_cpu_get_virt ()
and
.BR kdk_cpu_get_process ().
.SH "SEE ALSO"
.BR kdk_cpu_get_vendor (3),
.BR kdk_cpu_get_arch (3),
.BR kdk_cpu_get_freq_MHz (3),
.BR kdk_cpu_get_corenums (3),
.BR kdk_cpu_get_virt (3)
and
.BR kdk_cpu_get_process (3).

View File

@ -0,0 +1,52 @@
.TH "KDK_CPU_GET_PROCESS" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_cpu_get_process - 获取CPU线程数
.SH SYNOPSIS
.nf
.B #include <libkycpu.h>
.sp
.BI "extern unsigned int kdk_cpu_get_process()"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the number of CPU thread
.SH "RETURN VALUE"
On success, returns the number of all available CPU thread of type int.
.PP
On error, return
.BR 0.
.SH EXAMPLES
.EX
#include "libkycpu.h"
#include <stdio.h>
int main()
{
printf("架构:%s\en", kdk_cpu_get_arch());
printf("生产厂商:%s\en", kdk_cpu_get_vendor());
printf("CPU 型号:%s\en", kdk_cpu_get_model());
printf("CPU 主频:%s MHz\en", kdk_cpu_get_freq_MHz());
printf("CPU 单核核心数量:%u\en", kdk_cpu_get_corenums());
printf("CPU 虚拟化支持:%s\en", kdk_cpu_get_virt());
printf("CPU 线程数:%u\en", kdk_cpu_get_process());
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_cpu_get_vendor (),
.BR kdk_cpu_get_model (),
.BR kdk_cpu_get_freq_MHz (),
.BR kdk_cpu_get_arch (),
.BR kdk_cpu_get_virt ()
and
.BR kdk_cpu_get_corenums ().
.SH "SEE ALSO"
.BR kdk_cpu_get_vendor (3),
.BR kdk_cpu_get_model (3),
.BR kdk_cpu_get_freq_MHz (3),
.BR kdk_cpu_get_arch (3),
.BR kdk_cpu_get_virt (3)
and
.BR kdk_cpu_get_corenums (3).

View File

@ -0,0 +1,53 @@
.TH "KDK_CPU_GET_VENDOR" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_cpu_get_vendor - 获取CPU制造厂商
.SH SYNOPSIS
.nf
.B #include <libkycpu.h>
.sp
.BI "extern const char* kdk_cpu_get_vendor();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain CPU manufacturer
.SH "RETURN VALUE"
On success, returns the CPU manufacturer of type char*, such as "GenuineIntel"; The return is const char*, do not
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkycpu.h"
#include <stdio.h>
int main()
{
printf("架构:%s\en", kdk_cpu_get_arch());
printf("生产厂商:%s\en", kdk_cpu_get_vendor());
printf("CPU 型号:%s\en", kdk_cpu_get_model());
printf("CPU 主频:%s MHz\en", kdk_cpu_get_freq_MHz());
printf("CPU 单核核心数量:%u\en", kdk_cpu_get_corenums());
printf("CPU 虚拟化支持:%s\en", kdk_cpu_get_virt());
printf("CPU 线程数:%u\en", kdk_cpu_get_process());
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_cpu_get_arch (),
.BR kdk_cpu_get_model (),
.BR kdk_cpu_get_freq_MHz (),
.BR kdk_cpu_get_corenums (),
.BR kdk_cpu_get_virt ()
and
.BR kdk_cpu_get_process ().
.SH "SEE ALSO"
.BR kdk_cpu_get_arch (3),
.BR kdk_cpu_get_model (3),
.BR kdk_cpu_get_freq_MHz (3),
.BR kdk_cpu_get_corenums (3),
.BR kdk_cpu_get_virt (3)
and
.BR kdk_cpu_get_process (3).

View File

@ -0,0 +1,50 @@
.TH "KDK_CPU_GET_VIRT" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_cpu_get_virt - 获取CPU对虚拟化的支持
.SH SYNOPSIS
.nf
.B #include <libkycpu.h>
.sp
.BI "extern const char* kdk_cpu_get_virt();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain CPU support for virtualization
.SH "RETURN VALUE"
If the CPU supports virtualization, return virtualization technology, such as "vmx"; If not supported, return NULL; The return is const char*, do not
.I free
.SH EXAMPLES
.EX
#include "libkycpu.h"
#include <stdio.h>
int main()
{
printf("架构:%s\en", kdk_cpu_get_arch());
printf("生产厂商:%s\en", kdk_cpu_get_vendor());
printf("CPU 型号:%s\en", kdk_cpu_get_model());
printf("CPU 主频:%s MHz\en", kdk_cpu_get_freq_MHz());
printf("CPU 单核核心数量:%u\en", kdk_cpu_get_corenums());
printf("CPU 虚拟化支持:%s\en", kdk_cpu_get_virt());
printf("CPU 线程数:%u\en", kdk_cpu_get_process());
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_cpu_get_arch (),
.BR kdk_cpu_get_model (),
.BR kdk_cpu_get_freq_MHz (),
.BR kdk_cpu_get_corenums (),
.BR kdk_cpu_get_vendor ()
and
.BR kdk_cpu_get_process ().
.SH "SEE ALSO"
.BR kdk_cpu_get_arch (3),
.BR kdk_cpu_get_model (3),
.BR kdk_cpu_get_freq_MHz (3),
.BR kdk_cpu_get_corenums (3),
.BR kdk_cpu_get_vendor (3)
and
.BR kdk_cpu_get_process (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_BUS_INFO" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_bus_info - 获取显卡的总线地址
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_bus_info();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the bus address of the Video card
.SH "RETURN VALUE"
On success, returns the Video card bus address of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_vendor (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_CAPABILITIES" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_capabilities - 获取显卡的功能
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_capabilities();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the capabilities of the Video card
.SH "RETURN VALUE"
On success, returns the Video card capabilities of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_vendor (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_CLOCK" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_clock - 获取显卡的频率
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_clock();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the frequency of the Video card
.SH "RETURN VALUE"
On success, returns the Video card frequency of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_vendor (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_CONFIGURATION" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_configuration - 获取显卡的配置
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_configuration();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the configuration of the Video card
.SH "RETURN VALUE"
On success, returns the Video card configuration of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_vendor (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_DESCRIPTION" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_description - 获取显卡的说明
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_description();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain Video card description
.SH "RETURN VALUE"
On success, returns the Video card description of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_vendor (),
.BR kdk_display_get_product (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_product (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_PHYSICAL_ID" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_physical_id - 获取显卡的物理id
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_physical_id();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the physical ID of the Video card
.SH "RETURN VALUE"
On success, returns the physical ID of the Video card of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_vendor (),
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_PRODUCT" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_product - 获取显卡的型号
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_product();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain Video card model
.SH "RETURN VALUE"
On success, returns the Video card model of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_vendor (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_CONFIGURATION" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_resources - 获取显卡的资源
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_resources();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the resources of the Video card
.SH "RETURN VALUE"
On success, returns the Video card resources of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_vendor (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities ()
and
.BR kdk_display_get_configuration ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3)
and
.BR kdk_display_get_configuration (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_VENDOR" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_vendor - 获取显卡的制造商
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_vendor();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain Video card manufacturer
.SH "RETURN VALUE"
On success, returns the Video card manufacturer of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_version (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_VERSION" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_version - 获取显卡的设备版本
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_version();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the device version of the Video card
.SH "RETURN VALUE"
On success, returns the Video card device version of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_vendor (),
.BR kdk_display_get_width (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_width (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,87 @@
.TH "KDK_DISPLAY_GET_WIDTH" 3 "Thu Aug 24 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_display_get_width - 获取显卡的数据宽度
.SH SYNOPSIS
.nf
.B #include <libkydisplay.h>
.sp
.BI "extern char* kdk_display_get_width();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the data width of the Video card
.SH "RETURN VALUE"
On success, returns the Video card data width of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkydisplay.h"
#include <stdio.h>
int main()
{
char *vendor = kdk_display_get_vendor();
printf("生产厂商:%s\en", vendor);
free(vendor);
char *product = kdk_display_get_product();
printf("型号:%s\en", product);
free(product);
char *description = kdk_display_get_description();
printf("设备类型:%s\en", description);
free(description);
char *id = kdk_display_get_physical_id();
printf("物理id%s\en", id);
free(id);
char *bus = kdk_display_get_bus_info();
printf("总线地址:%s\en", bus);
free(bus);
char *version = kdk_display_get_version();
printf("设备版本:%s\en", version);
free(version);
char *width = kdk_display_get_width();
printf("数据宽度:%s\en", width);
free(width);
char *clock = kdk_display_get_clock();
printf("频率:%s\en", clock);
free(clock);
char *capabilities = kdk_display_get_capabilities();
printf("功能:%s\en", capabilities);
free(capabilities);
char *configuration = kdk_display_get_configuration();
printf("配置:%s\en", configuration);
free(configuration);
char *resources = kdk_display_get_resources();
printf("资源:%s\en", resources);
free(resources);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_display_get_product (),
.BR kdk_display_get_description (),
.BR kdk_display_get_physical_id (),
.BR kdk_display_get_bus_info (),
.BR kdk_display_get_vendor (),
.BR kdk_display_get_version (),
.BR kdk_display_get_clock (),
.BR kdk_display_get_capabilities (),
.BR kdk_display_get_configuration ()
and
.BR kdk_display_get_resources ().
.SH "SEE ALSO"
.BR kdk_display_get_product (3),
.BR kdk_display_get_description (3),
.BR kdk_display_get_physical_id (3),
.BR kdk_display_get_bus_info (3),
.BR kdk_display_get_vendor (3),
.BR kdk_display_get_version (3),
.BR kdk_display_get_clock (3),
.BR kdk_display_get_capabilities (3),
.BR kdk_display_get_configuration (3)
and
.BR kdk_display_get_resources (3).

View File

@ -0,0 +1,105 @@
.TH "KDK_EDID_FREEALL" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_freeall - 用于回收字符串列表
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern inline void kdk_edid_freeall(char **"ptr ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to recycle a list of strings of type char **.
.PP
The argument
.I ptr
is a list of strings of type char **.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio ()
and
.BR kdk_edid_get_character ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3)
and
.BR kdk_edid_get_character (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_CHARACTER" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_character - 获取显示器edid未解析的字符串
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char* kdk_edid_get_character(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the string that the screen edid has not parsed.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the string that the screen edid has not parsed of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,108 @@
.TH "KDK_EDID_GET_GAMMA" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_gamma - 获取显示器的伽马值
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern float kdk_edid_get_gamma(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the gamma value of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the screen gamma value of type float.
.PP
On error, return
.BR 0.00.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_INTERFACE" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_interface - 获取显示器的当前接口
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char** kdk_edid_get_interface();"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the current interface name of the screen.
.SH "RETURN VALUE"
On success, returns a list of current interface name of the screen, ending with a
.BR NULL
string; Generated by
.I alloc
and needs to be recycled by
.BR kdk_edid_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_MANUFACTURER" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_manufacturer - 获取显示器的厂商
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char* kdk_edid_get_manufacturer(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the manufacturer of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the screen manufacturer of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_MAX_RESOLUTION" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_max_resolution - 获取显示器的最大分辨率
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char* kdk_edid_get_max_resolution(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the maximum resolution of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the maximum resolution of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_MODEL" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_model - 获取显示器的显示器型号
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char* kdk_edid_get_model(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the model of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the screen model of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,107 @@
.TH "KDK_EDID_GET_PRIMARY" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_primary - 获取是否是主显示器(是/否)
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern int kdk_edid_get_primary(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to determine whether it is the main screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns 1, which is the primary screen; Returns 0, not the primary screen.
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_RATIO" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_ratio - 获取图像高宽比
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char* kdk_edid_get_ratio(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the image aspect ratio of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the image aspect ratio of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_RESOLUTION" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_resolution - 获取分辨率
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char* kdk_edid_get_resolution(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the resolution of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the resolution of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,108 @@
.TH "KDK_EDID_GET_SIZE" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_size - 获取显示器的屏幕尺寸(英寸)
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern float kdk_edid_get_size(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the screen size of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the screen size of type float.
.PP
On error, return
.BR 0.00.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,109 @@
.TH "KDK_EDID_GET_VISIBLE_AREA" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_visible_area - 获取显示器的可视面积
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern char* kdk_edid_get_visible_area(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the visible area of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the screen visible area of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,107 @@
.TH "KDK_EDID_GET_WEEK" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_week - 获取显示器的生产日期/周
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern int kdk_edid_get_week(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the manufacturing date(week) of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the screen manufacturing date(week) of type int.
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_year (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_year (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,107 @@
.TH "KDK_EDID_GET_YEAR" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_edid_get_year - 获取显示器的生产日期/年
.SH SYNOPSIS
.nf
.B #include <libkyedid.h>
.sp
.BI "extern int kdk_edid_get_year(char *"name ");"
.sp
Link with \fI\-lkyedid\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the manufacturing date(year) of the screen.
.PP
The argument
.I name
is the current interface of the screen.
.SH "RETURN VALUE"
On success, returns the screen manufacturing date(year) of type int.
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkyedid.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** name = kdk_edid_get_interface();
size_t count = 0;
while (name[count])
{
printf("当前接口 = %s\n", name[count]);
float gamma = kdk_edid_get_gamma(name[count]);
printf("gamma = %0.2f\n", gamma);
float size = kdk_edid_get_size(name[count]);
printf("size = %0.1f\n", size);
char *max_resolution = kdk_edid_get_max_resolution(name[count]);
printf("max_resolution = %s\n", max_resolution);
free(max_resolution);
char *model = kdk_edid_get_model(name[count]);
printf("model = %s\n", model);
free(model);
char *area = kdk_edid_get_visible_area(name[count]);
printf("area = %s\n", area);
free(area);
char *manufacturer = kdk_edid_get_manufacturer(name[count]);
printf("manufacturer = %s\n", manufacturer);
free(manufacturer);
int week = kdk_edid_get_week(name[count]);
printf("week = %d\n", week);
int year = kdk_edid_get_year(name[count]);
printf("year = %d\n", year);
int primary = kdk_edid_get_primary(name[count]);
printf("%s\n", primary == 1 ? "是" : "否");
char *resolution = kdk_edid_get_resolution(name[count]);
printf("resolution = %s\n", resolution);
free(resolution);
char *ratio = kdk_edid_get_ratio(name[count]);
printf("ratio = %s\n", ratio);
free(ratio);
char *character = kdk_edid_get_character(name[count]);
printf("character = %s\n", character);
free(character);
printf("---------------------------------------\n");
count ++;
}
kdk_edid_freeall(name);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_edid_get_interface (),
.BR kdk_edid_get_gamma (),
.BR kdk_edid_get_size (),
.BR kdk_edid_get_max_resolution (),
.BR kdk_edid_get_model (),
.BR kdk_edid_get_visible_area (),
.BR kdk_edid_get_manufacturer (),
.BR kdk_edid_get_week (),
.BR kdk_edid_get_primary (),
.BR kdk_edid_get_resolution (),
.BR kdk_edid_get_ratio (),
.BR kdk_edid_get_character ()
and
.BR kdk_edid_freeall ().
.SH "SEE ALSO"
.BR kdk_edid_get_interface (3),
.BR kdk_edid_get_gamma (3),
.BR kdk_edid_get_size (3),
.BR kdk_edid_get_max_resolution (3),
.BR kdk_edid_get_model (3),
.BR kdk_edid_get_visible_area (3),
.BR kdk_edid_get_manufacturer (3),
.BR kdk_edid_get_week (3),
.BR kdk_edid_get_primary (3),
.BR kdk_edid_get_resolution (3),
.BR kdk_edid_get_ratio (3),
.BR kdk_edid_get_character (3)
and
.BR kdk_edid_freeall (3).

View File

@ -0,0 +1,43 @@
.TH "KDK_FAN_FREEALL" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_fan_freeall - 用于回收字符串列表
.SH SYNOPSIS
.nf
.B #include <libkyfan.h>
.sp
.BI "extern inline void kdk_fan_freeall(char **"ptr ");"
.sp
Link with \fI\-lkyfan\fP.
.SH "Detailed Description"
The main function of the interface is to recycle a list of strings of type char **.
.PP
The argument
.I ptr
is a list of strings of type char **.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "libkyfan.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **fan = kdk_fan_get_information();
int index = 0;
while (fan[index])
{
printf("%s\n", fan[index]);
index++;
}
kdk_fan_freeall(fan);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_fan_get_information ().
.SH "SEE ALSO"
.BR kdk_fan_get_information (3).

View File

@ -0,0 +1,47 @@
.TH "KDK_FAN_GET_INFORMATION" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_fan_get_information - 获取风扇的信息
.SH SYNOPSIS
.nf
.B #include <libkyfan.h>
.sp
.BI "extern char** kdk_fan_get_information();"
.sp
Link with \fI\-lkyfan\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the fan information.
.SH "RETURN VALUE"
On success, returns a list of fan information of type char*, including name and speed, ending with a
.BR NULL
string; Generated by
.I alloc
and needs to be recycled by
.BR kdk_fan_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyfan.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **fan = kdk_fan_get_information();
int index = 0;
while (fan[index])
{
printf("%s\n", fan[index]);
index++;
}
kdk_fan_freeall(fan);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_fan_freeall ().
.SH "SEE ALSO"
.BR kdk_fan_freeall (3).

View File

@ -0,0 +1,141 @@
.TH "KDK_HW_FREE_HW" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_hw_free_hw - 释放kdk_hw_get_hwinfo返回的硬件信息结构体
.SH SYNOPSIS
.nf
.B #include <libkyhw.h>
.sp
.BI "extern void kdk_hw_free_hw(struct HWInfo *"list ");"
.sp
Link with \fI\-lkyhwinfo\fP.
.SH "Detailed Description"
The main function of the interface is to release the hardware information structure returned by the
.I kdk_hw_get_hwinfo.
.PP
The argument
.I list
is the return value of the
.I kdk_hw_get_hwinfo.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "libkyhw.h"
#include <stdio.h>
#include <string.h>
static _print_hw(struct HWInfo *hw)
{
struct HWInfo *tmp = hw;
while (tmp)
{
printf("\tmodel : %s\n", tmp->model);
printf("\t\tvendor : %s\n", tmp->vendor);
printf("\t\tdevice : %s\n", tmp->device);
printf("\t\tdriver : %s\n", tmp->driver);
printf("\t\trevision : %s\n", tmp->revision);
printf("\t\tdevicenum : %s\n", tmp->devicenum);
printf("\t\tclock : %s\n", tmp->clock);
printf("\t\twidth : %s\n", tmp->width);
tmp = tmp->next;
}
}
static void Traverse_hardware()
{
struct HWInfo *keyboard = kdk_hw_get_hwinfo(3);
printf("KeyBoard Info:\n");
_print_hw(keyboard);
kdk_hw_free_hw(keyboard);
struct HWInfo *mouse = kdk_hw_get_hwinfo(5);
printf("Mouse Info:\n");
_print_hw(mouse);
kdk_hw_free_hw(mouse);
struct HWInfo *bound = kdk_hw_get_hwinfo(15);
printf("Bound Info:\n");
_print_hw(bound);
kdk_hw_free_hw(bound);
struct HWInfo *cdrom = kdk_hw_get_hwinfo(23);
printf("CDRom Info:\n");
_print_hw(cdrom);
kdk_hw_free_hw(cdrom);
struct HWInfo *camera = kdk_hw_get_hwinfo(27);
printf("Camera Info:\n");
_print_hw(camera);
kdk_hw_free_hw(camera);
}
static void Traverse_power()
{
struct Power * power = kdk_hw_get_powerinfo();
printf("on_battery : %s\n", power->on_battery ? "true" : "false");
printf("lid_is_closed : %s\n", power->lid_is_closed ? "true" : "false");
printf("lid_is_present : %s\n", power->lid_is_present ? "true" : "false");
printf("daemon version : %s\n", power->daemon_version);
printf("critical action : %s\n", power->critical_action);
struct power_device *tmp = power->devices;
while (tmp)
{
printf("name : %s\n", tmp->name);
printf("\tnative path : %s\n", tmp->native_path);
printf("\tpower supply : %s\n", tmp->power_supply ? "true" : "false");
printf("\tupdated : %s\n", tmp->updated);
printf("\thas history : %s\n", tmp->has_history ? "true" : "false");
printf("\thas statistics : %s\n", tmp->has_statistics ? "true" : "false");
printf("\tis persent: %s\n", tmp->is_persent ? "true" : "false");
printf("\tis rechargeable : %s\n", tmp->is_rechargeable ? "true" : "false");
printf("\tstate : %s\n", tmp->state);
printf("\twaring level : %s\n", tmp->warning_level);
printf("\tenergy : %0.2f\n", tmp->energy);
printf("\tenergy empty : %0.2f\n", tmp->energy_empty);
printf("\tenergy full: %0.2f\n", tmp->energy_full);
printf("\tenergy full design : %0.2f\n", tmp->energy_full_design);
printf("\tenergy rate : %0.2f\n", tmp->energy_rate);
printf("\tvoltage : %0.2f\n", tmp->voltage);
printf("\ttime to empty : %ld\n", tmp->time_to_empty);
printf("\ttime to full : %ld\n", tmp->time_to_full);
printf("\tpercentage : %0.2f\n", tmp->percentage);
printf("\ttemperature : %0.2f\n", tmp->temperature);
printf("\tcapacity : %0.2f\n", tmp->capacity);
printf("\ttechnology : %s\n", tmp->technology);
printf("\tonline : %s\n", tmp->online ? "true" : "false");
printf("\ticon name : %s\n", tmp->icon_name);
tmp = tmp->next;
}
kdk_hw_free_power_info(power);
}
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("please use like >> kyhwinfo-test --[target]\n");
printf("hardware");
printf("\tpower");
printf("\n");
return 0;
}
if (0 == strcmp(argv[1], "--hardware"))
Traverse_hardware();
if (0 == strcmp(argv[1], "--power"))
Traverse_power();
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_hw_get_hwinfo (),
.BR kdk_hw_get_powerinfo ()
and
.BR kdk_hw_free_power_info ().
.SH "SEE ALSO"
.BR kdk_hw_get_hwinfo (3),
.BR kdk_hw_get_powerinfo (3)
and
.BR kdk_hw_free_power_info (3).

View File

@ -0,0 +1,141 @@
.TH "KDK_HW_FREE_POWER_INFO" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_hw_free_power_info - 释放kdk_hw_get_hwinfo返回的硬件信息结构体
.SH SYNOPSIS
.nf
.B #include <libkyhw.h>
.sp
.BI "extern void kdk_hw_free_power_info(struct Power *"info ");"
.sp
Link with \fI\-lkyhwinfo\fP.
.SH "Detailed Description"
The main function of the interface is to release the power supply information structure returned by the
.I kdk_hw_get_powerinfo.
.PP
The argument
.I info
is the return value of the
.I kdk_hw_get_powerinfo.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "libkyhw.h"
#include <stdio.h>
#include <string.h>
static _print_hw(struct HWInfo *hw)
{
struct HWInfo *tmp = hw;
while (tmp)
{
printf("\tmodel : %s\n", tmp->model);
printf("\t\tvendor : %s\n", tmp->vendor);
printf("\t\tdevice : %s\n", tmp->device);
printf("\t\tdriver : %s\n", tmp->driver);
printf("\t\trevision : %s\n", tmp->revision);
printf("\t\tdevicenum : %s\n", tmp->devicenum);
printf("\t\tclock : %s\n", tmp->clock);
printf("\t\twidth : %s\n", tmp->width);
tmp = tmp->next;
}
}
static void Traverse_hardware()
{
struct HWInfo *keyboard = kdk_hw_get_hwinfo(3);
printf("KeyBoard Info:\n");
_print_hw(keyboard);
kdk_hw_free_hw(keyboard);
struct HWInfo *mouse = kdk_hw_get_hwinfo(5);
printf("Mouse Info:\n");
_print_hw(mouse);
kdk_hw_free_hw(mouse);
struct HWInfo *bound = kdk_hw_get_hwinfo(15);
printf("Bound Info:\n");
_print_hw(bound);
kdk_hw_free_hw(bound);
struct HWInfo *cdrom = kdk_hw_get_hwinfo(23);
printf("CDRom Info:\n");
_print_hw(cdrom);
kdk_hw_free_hw(cdrom);
struct HWInfo *camera = kdk_hw_get_hwinfo(27);
printf("Camera Info:\n");
_print_hw(camera);
kdk_hw_free_hw(camera);
}
static void Traverse_power()
{
struct Power * power = kdk_hw_get_powerinfo();
printf("on_battery : %s\n", power->on_battery ? "true" : "false");
printf("lid_is_closed : %s\n", power->lid_is_closed ? "true" : "false");
printf("lid_is_present : %s\n", power->lid_is_present ? "true" : "false");
printf("daemon version : %s\n", power->daemon_version);
printf("critical action : %s\n", power->critical_action);
struct power_device *tmp = power->devices;
while (tmp)
{
printf("name : %s\n", tmp->name);
printf("\tnative path : %s\n", tmp->native_path);
printf("\tpower supply : %s\n", tmp->power_supply ? "true" : "false");
printf("\tupdated : %s\n", tmp->updated);
printf("\thas history : %s\n", tmp->has_history ? "true" : "false");
printf("\thas statistics : %s\n", tmp->has_statistics ? "true" : "false");
printf("\tis persent: %s\n", tmp->is_persent ? "true" : "false");
printf("\tis rechargeable : %s\n", tmp->is_rechargeable ? "true" : "false");
printf("\tstate : %s\n", tmp->state);
printf("\twaring level : %s\n", tmp->warning_level);
printf("\tenergy : %0.2f\n", tmp->energy);
printf("\tenergy empty : %0.2f\n", tmp->energy_empty);
printf("\tenergy full: %0.2f\n", tmp->energy_full);
printf("\tenergy full design : %0.2f\n", tmp->energy_full_design);
printf("\tenergy rate : %0.2f\n", tmp->energy_rate);
printf("\tvoltage : %0.2f\n", tmp->voltage);
printf("\ttime to empty : %ld\n", tmp->time_to_empty);
printf("\ttime to full : %ld\n", tmp->time_to_full);
printf("\tpercentage : %0.2f\n", tmp->percentage);
printf("\ttemperature : %0.2f\n", tmp->temperature);
printf("\tcapacity : %0.2f\n", tmp->capacity);
printf("\ttechnology : %s\n", tmp->technology);
printf("\tonline : %s\n", tmp->online ? "true" : "false");
printf("\ticon name : %s\n", tmp->icon_name);
tmp = tmp->next;
}
kdk_hw_free_power_info(power);
}
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("please use like >> kyhwinfo-test --[target]\n");
printf("hardware");
printf("\tpower");
printf("\n");
return 0;
}
if (0 == strcmp(argv[1], "--hardware"))
Traverse_hardware();
if (0 == strcmp(argv[1], "--power"))
Traverse_power();
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_hw_get_hwinfo (),
.BR kdk_hw_get_powerinfo ()
and
.BR kdk_hw_free_hw ().
.SH "SEE ALSO"
.BR kdk_hw_get_hwinfo (3),
.BR kdk_hw_get_powerinfo (3)
and
.BR kdk_hw_free_hw (3).

View File

@ -0,0 +1,164 @@
.TH "KDK_HW_GET_HWINFO" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_hw_get_hwinfo - 获取键盘鼠标声卡光驱usb硬件信息
.SH SYNOPSIS
.nf
.B #include <libkyhw.h>
.sp
.BI "extern struct HWInfo *kdk_hw_get_hwinfo(int type);"
.sp
Link with \fI\-lkyhwinfo\fP.
.SH "Detailed Description"
The main function of the interface is to obtain keyboard, mouse, sound card, optical drive, USB hardware information.
.PP
The argument
.I type
is the hardware type; 3 stands for keyboard, 5 stands for mouse, 15 stands for sound, 23 stands for cdrom, 27 stands for usb.
.SH "RETURN VALUE"
On success, returns a pointer to a
.I HWInfo
structure containing keyboard, mouse, sound card, optical drive, USB hardware information.
.PP
The
.I HWInfo
structure is defined in
.I <libkyhw.h>
as follows:
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;
};
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyhw.h"
#include <stdio.h>
#include <string.h>
static _print_hw(struct HWInfo *hw)
{
struct HWInfo *tmp = hw;
while (tmp)
{
printf("\tmodel : %s\n", tmp->model);
printf("\t\tvendor : %s\n", tmp->vendor);
printf("\t\tdevice : %s\n", tmp->device);
printf("\t\tdriver : %s\n", tmp->driver);
printf("\t\trevision : %s\n", tmp->revision);
printf("\t\tdevicenum : %s\n", tmp->devicenum);
printf("\t\tclock : %s\n", tmp->clock);
printf("\t\twidth : %s\n", tmp->width);
tmp = tmp->next;
}
}
static void Traverse_hardware()
{
struct HWInfo *keyboard = kdk_hw_get_hwinfo(3);
printf("KeyBoard Info:\n");
_print_hw(keyboard);
kdk_hw_free_hw(keyboard);
struct HWInfo *mouse = kdk_hw_get_hwinfo(5);
printf("Mouse Info:\n");
_print_hw(mouse);
kdk_hw_free_hw(mouse);
struct HWInfo *bound = kdk_hw_get_hwinfo(15);
printf("Bound Info:\n");
_print_hw(bound);
kdk_hw_free_hw(bound);
struct HWInfo *cdrom = kdk_hw_get_hwinfo(23);
printf("CDRom Info:\n");
_print_hw(cdrom);
kdk_hw_free_hw(cdrom);
struct HWInfo *camera = kdk_hw_get_hwinfo(27);
printf("Camera Info:\n");
_print_hw(camera);
kdk_hw_free_hw(camera);
}
static void Traverse_power()
{
struct Power * power = kdk_hw_get_powerinfo();
printf("on_battery : %s\n", power->on_battery ? "true" : "false");
printf("lid_is_closed : %s\n", power->lid_is_closed ? "true" : "false");
printf("lid_is_present : %s\n", power->lid_is_present ? "true" : "false");
printf("daemon version : %s\n", power->daemon_version);
printf("critical action : %s\n", power->critical_action);
struct power_device *tmp = power->devices;
while (tmp)
{
printf("name : %s\n", tmp->name);
printf("\tnative path : %s\n", tmp->native_path);
printf("\tpower supply : %s\n", tmp->power_supply ? "true" : "false");
printf("\tupdated : %s\n", tmp->updated);
printf("\thas history : %s\n", tmp->has_history ? "true" : "false");
printf("\thas statistics : %s\n", tmp->has_statistics ? "true" : "false");
printf("\tis persent: %s\n", tmp->is_persent ? "true" : "false");
printf("\tis rechargeable : %s\n", tmp->is_rechargeable ? "true" : "false");
printf("\tstate : %s\n", tmp->state);
printf("\twaring level : %s\n", tmp->warning_level);
printf("\tenergy : %0.2f\n", tmp->energy);
printf("\tenergy empty : %0.2f\n", tmp->energy_empty);
printf("\tenergy full: %0.2f\n", tmp->energy_full);
printf("\tenergy full design : %0.2f\n", tmp->energy_full_design);
printf("\tenergy rate : %0.2f\n", tmp->energy_rate);
printf("\tvoltage : %0.2f\n", tmp->voltage);
printf("\ttime to empty : %ld\n", tmp->time_to_empty);
printf("\ttime to full : %ld\n", tmp->time_to_full);
printf("\tpercentage : %0.2f\n", tmp->percentage);
printf("\ttemperature : %0.2f\n", tmp->temperature);
printf("\tcapacity : %0.2f\n", tmp->capacity);
printf("\ttechnology : %s\n", tmp->technology);
printf("\tonline : %s\n", tmp->online ? "true" : "false");
printf("\ticon name : %s\n", tmp->icon_name);
tmp = tmp->next;
}
kdk_hw_free_power_info(power);
}
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("please use like >> kyhwinfo-test --[target]\n");
printf("hardware");
printf("\tpower");
printf("\n");
return 0;
}
if (0 == strcmp(argv[1], "--hardware"))
Traverse_hardware();
if (0 == strcmp(argv[1], "--power"))
Traverse_power();
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_hw_free_hw (),
.BR kdk_hw_get_powerinfo ()
and
.BR kdk_hw_free_power_info ().
.SH "SEE ALSO"
.BR kdk_hw_free_hw (3),
.BR kdk_hw_get_powerinfo (3)
and
.BR kdk_hw_free_power_info (3).

View File

@ -0,0 +1,185 @@
.TH "KDK_HW_GET_POWERINFO" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_hw_get_powerinfo - 获取电源信息
.SH SYNOPSIS
.nf
.B #include <libkyhw.h>
.sp
.BI "extern struct Power *kdk_hw_get_powerinfo();"
.sp
Link with \fI\-lkyhwinfo\fP.
.SH "Detailed Description"
The main function of the interface is to obtain power supply information.
.SH "RETURN VALUE"
On success, returns a pointer to a
.I Power
structure containing power supply information.
.PP
The
.I Power
structure is defined in
.I <libkyhw.h>
as follows:
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;
};
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;
};
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyhw.h"
#include <stdio.h>
#include <string.h>
static _print_hw(struct HWInfo *hw)
{
struct HWInfo *tmp = hw;
while (tmp)
{
printf("\tmodel : %s\n", tmp->model);
printf("\t\tvendor : %s\n", tmp->vendor);
printf("\t\tdevice : %s\n", tmp->device);
printf("\t\tdriver : %s\n", tmp->driver);
printf("\t\trevision : %s\n", tmp->revision);
printf("\t\tdevicenum : %s\n", tmp->devicenum);
printf("\t\tclock : %s\n", tmp->clock);
printf("\t\twidth : %s\n", tmp->width);
tmp = tmp->next;
}
}
static void Traverse_hardware()
{
struct HWInfo *keyboard = kdk_hw_get_hwinfo(3);
printf("KeyBoard Info:\n");
_print_hw(keyboard);
kdk_hw_free_hw(keyboard);
struct HWInfo *mouse = kdk_hw_get_hwinfo(5);
printf("Mouse Info:\n");
_print_hw(mouse);
kdk_hw_free_hw(mouse);
struct HWInfo *bound = kdk_hw_get_hwinfo(15);
printf("Bound Info:\n");
_print_hw(bound);
kdk_hw_free_hw(bound);
struct HWInfo *cdrom = kdk_hw_get_hwinfo(23);
printf("CDRom Info:\n");
_print_hw(cdrom);
kdk_hw_free_hw(cdrom);
struct HWInfo *camera = kdk_hw_get_hwinfo(27);
printf("Camera Info:\n");
_print_hw(camera);
kdk_hw_free_hw(camera);
}
static void Traverse_power()
{
struct Power * power = kdk_hw_get_powerinfo();
printf("on_battery : %s\n", power->on_battery ? "true" : "false");
printf("lid_is_closed : %s\n", power->lid_is_closed ? "true" : "false");
printf("lid_is_present : %s\n", power->lid_is_present ? "true" : "false");
printf("daemon version : %s\n", power->daemon_version);
printf("critical action : %s\n", power->critical_action);
struct power_device *tmp = power->devices;
while (tmp)
{
printf("name : %s\n", tmp->name);
printf("\tnative path : %s\n", tmp->native_path);
printf("\tpower supply : %s\n", tmp->power_supply ? "true" : "false");
printf("\tupdated : %s\n", tmp->updated);
printf("\thas history : %s\n", tmp->has_history ? "true" : "false");
printf("\thas statistics : %s\n", tmp->has_statistics ? "true" : "false");
printf("\tis persent: %s\n", tmp->is_persent ? "true" : "false");
printf("\tis rechargeable : %s\n", tmp->is_rechargeable ? "true" : "false");
printf("\tstate : %s\n", tmp->state);
printf("\twaring level : %s\n", tmp->warning_level);
printf("\tenergy : %0.2f\n", tmp->energy);
printf("\tenergy empty : %0.2f\n", tmp->energy_empty);
printf("\tenergy full: %0.2f\n", tmp->energy_full);
printf("\tenergy full design : %0.2f\n", tmp->energy_full_design);
printf("\tenergy rate : %0.2f\n", tmp->energy_rate);
printf("\tvoltage : %0.2f\n", tmp->voltage);
printf("\ttime to empty : %ld\n", tmp->time_to_empty);
printf("\ttime to full : %ld\n", tmp->time_to_full);
printf("\tpercentage : %0.2f\n", tmp->percentage);
printf("\ttemperature : %0.2f\n", tmp->temperature);
printf("\tcapacity : %0.2f\n", tmp->capacity);
printf("\ttechnology : %s\n", tmp->technology);
printf("\tonline : %s\n", tmp->online ? "true" : "false");
printf("\ticon name : %s\n", tmp->icon_name);
tmp = tmp->next;
}
kdk_hw_free_power_info(power);
}
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("please use like >> kyhwinfo-test --[target]\n");
printf("hardware");
printf("\tpower");
printf("\n");
return 0;
}
if (0 == strcmp(argv[1], "--hardware"))
Traverse_hardware();
if (0 == strcmp(argv[1], "--power"))
Traverse_power();
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_hw_free_hw (),
.BR kdk_hw_get_hwinfo ()
and
.BR kdk_hw_free_power_info ().
.SH "SEE ALSO"
.BR kdk_hw_free_hw (3),
.BR kdk_hw_get_hwinfo (3)
and
.BR kdk_hw_free_power_info (3).

View File

@ -0,0 +1,107 @@
.TH "KDK_NC_FREEALL" 3 "Tue Sep 05 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_freeall - 用于回收字符串列表
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern inline void kdk_nc_freeall(char **"ptr ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to recycle a list of strings of type char **.
.PP
The argument
.I ptr
is a list of strings of type char **.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_phymac (),
and
.BR kdk_nc_get_driver ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_phymac (3),
and
.BR kdk_nc_get_driver (3).

View File

@ -0,0 +1,111 @@
.TH "KDK_NC_GET_CARDLIST" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_cardlist - 获取系统中所有的网卡
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char** kdk_nc_get_cardlist();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain all NICs in the system
.SH "RETURN VALUE"
On success, returns a list of NIC names, ending with a
.BR NULL
string; Generated by
.I alloc
and needs to be recycled by
.BR kdk_nc_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,113 @@
.TH "KDK_NC_GET_DRIVER" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_driver - 获取指定网卡的驱动
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char *kdk_nc_get_driver(const char *"nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the driver for the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, returns the NIC driver of type char*; The returned string needs to be released by
.I free
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_private_ipv4 (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_private_ipv4 (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,116 @@
.TH "KDK_NC_GET_IPV4" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_ipv4 - 获取指定网卡的所有IPv4地址
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char** kdk_nc_get_ipv4(const char* "nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain all IPv4 addresses of the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, returns a list of IPv4 addresses, ending with
.BR
NULL
, generated by alloc and required to be recycled by
.BR kdk_nc_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,116 @@
.TH "KDK_NC_GET_IPV6" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_ipv6 - 获取指定网卡的所有IPv6地址
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char** kdk_nc_get_ipv6(const char* "nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain all IPv6 addresses of the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, returns a list of IPv6 addresses, ending with
.BR
NULL
, generated by alloc and required to be recycled by
.BR kdk_nc_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,118 @@
.TH "KDK_NC_GET_PHYMAC" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_phymac - 获取指定网卡的物理MAC地址
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char* kdk_nc_get_phymac(const char *"nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the physical MAC address of the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, returns a physical MAC address of type char*, generated by
.I alloc
, which should be
.I free
; If the specified NIC does not exist,
.BR NULL
is returned.
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,114 @@
.TH "KDK_NC_GET_PRIVATE_IPV4" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_private_ipv4 - 获取指定网卡的第一个IPv4地址
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char* kdk_nc_get_private_ipv4(const char *"nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the first IPv4 address of the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, returns an IPv4 address of type char*, and returns
.BR NULL
without IP.
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,114 @@
.TH "KDK_NC_GET_PRIVATE_IPV6" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_private_ipv6 - 获取指定网卡的第一个IPv6地址
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char* kdk_nc_get_private_ipv6(const char *"nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the first IPv6 address of the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, returns an IPv6 address of type char*, and returns
.BR NULL
without IP.
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,111 @@
.TH "KDK_NC_GET_UPCARDS" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_upcards - 获取系统中当前处于 link up 状态的网卡列表
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern char** kdk_nc_get_upcards();"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain a list of NICs that are currently in the "link up" state on the system.
.SH "RETURN VALUE"
On success, returns a list of NIC names, ending with a
.BR NULL
string; Generated by
.I alloc
and needs to be recycled by
.BR kdk_nc_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,121 @@
.TH "KDK_NC_GET_VENDOR_AND_PRODUCT" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_get_vendor_and_product - 获取指定网卡的厂商名称和设备型号
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern int kdk_nc_get_vendor_and_product(const char *"nc ", char *" vendor ", char *" product ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the manufacturer name and device model of the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1";
.PP
The argument
.I vendor
is the manufacturer of the NIC, and it is necessary to allocate enough space in advance;
.PP
The argument
.I porduct
is a NIC name that stands for output parameters and needs to be allocated enough space in advance.
.SH "RETURN VALUE"
On success, returns
.BR 0.
.PP
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_is_up (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

115
man/hardware/kdk_nc_is_up.3 Normal file
View File

@ -0,0 +1,115 @@
.TH "KDK_NC_IS_UP" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_is_up - 检测指定网卡是否处于UP状态
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern int kdk_nc_is_up(const char *"nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to detect whether the specified NIC
.I nc
is in the UP state.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, the Up status returns
.BR 1
and the Down status returns
.BR 0.
.PP
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_wireless (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_wireless (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,115 @@
.TH "KDK_NC_IS_WIRELESS" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_nc_is_wireless - 获取指定网卡的有线/无线类型
.SH SYNOPSIS
.nf
.B #include <libkync.h>
.sp
.BI "extern int kdk_nc_is_wireless(const char *"nc ");"
.sp
Link with \fI\-lkyhw\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the wired/wireless type of the specified NIC
.I nc
.
.PP
The argument
.I nc
is the name of the NIC, such as "eno1".
.SH "RETURN VALUE"
On success, the wireless returns
.BR 1
and the wired returns
.BR 0.
.PP
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkync.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
char **cards = kdk_nc_get_cardlist();
size_t index = 0;
printf("所有网卡:\en");
while (cards[index])
{
char *mac = kdk_nc_get_phymac(cards[index]);
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
char *driver = kdk_nc_get_driver(cards[index]);
char vendor[256] = "\0", product[256] = "\0";
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\t driver: %s\en",
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
mac, ipv4, ipv6, vendor, product,
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet", driver);
char **list4 = kdk_nc_get_ipv4(cards[index]);
int i = 0;
printf("AllIpV4: ");
while (list4 && list4[i])
{
printf("%s\t", list4[i++]);
}
printf("\en");
char **list6 = kdk_nc_get_ipv6(cards[index]);
printf("AllIpV6: ");
i = 0;
while (list6 && list6[i])
{
printf("%s\t", list6[i++]);
}
printf("\en");
free(mac);
free(ipv4);
free(ipv6);
free(list4);
free(list6);
free(driver);
index++;
}
kdk_nc_freeall(cards);
char **upcards = kdk_nc_get_upcards();
index = 0;
printf("工作网卡:\en");
while (upcards[index])
{
printf("Card %zd: %s\en", index + 1, upcards[index]);
index++;
}
kdk_nc_freeall(upcards);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_nc_get_cardlist (),
.BR kdk_nc_get_upcards (),
.BR kdk_nc_get_phymac (),
.BR kdk_nc_get_private_ipv4 (),
.BR kdk_nc_get_ipv4 (),
.BR kdk_nc_get_private_ipv6 (),
.BR kdk_nc_get_ipv6 (),
.BR kdk_nc_is_up (),
.BR kdk_nc_get_vendor_and_product (),
.BR kdk_nc_get_driver (),
and
.BR kdk_nc_freeall ().
.SH "SEE ALSO"
.BR kdk_nc_get_cardlist (3),
.BR kdk_nc_get_upcards (3),
.BR kdk_nc_get_phymac (3),
.BR kdk_nc_get_private_ipv4 (3),
.BR kdk_nc_get_ipv4 (3),
.BR kdk_nc_get_private_ipv6 (3),
.BR kdk_nc_get_ipv6 (3),
.BR kdk_nc_is_up (3),
.BR kdk_nc_get_vendor_and_product (3),
.BR kdk_nc_get_driver (3),
and
.BR kdk_nc_freeall (3).

View File

@ -0,0 +1,100 @@
.TH "KDK_PRINTER_CANCEL_ALL_JOBS" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_cancel_all_jobs - 清除某个打印机的所有打印队列
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern int kdk_printer_cancel_all_jobs(const char *"printername ");"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to clears all print queues for a printer.
.PP
The argument
.I printername
is printer name,
.I kdk_printer_get_list
returned value.
.SH "RETURN VALUE"
On success, return
.BR 0.
.PP
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取打印机列表
char **printers = kdk_printer_get_available_list();
while (printers[index])
{
printf("%zd: %s\n", index + 1, printers[index]);
//取消当前打印机所有打印任务
kdk_printer_cancel_all_jobs(printers[index]);
//获取url对应的文件名
char *url = "http://www.cztouch.com/upfiles/soft/testpdf.pdf";
int res = -1;
char *filename = kdk_printer_get_filename(url); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
printf("filename = %s\n", filename);
//设置打印参数
kdk_printer_set_options(2, "A4", "lrtb", "two-sided-long-edge");
//下载
res = kdk_printer_print_download_remote_file(url, filename);
printf("[%s] res = %d\n", __FUNCTION__, res);
printf("[%s] filepath = %s\n", __FUNCTION__, filename);
//打印
int job_id = kdk_printer_print_local_file(printers[index], filename);
if (job_id == 0)
{
//打印失败
printf("[%s] create print job fail\n", __FUNCTION__);
}
else
{
//打印成功,等待一会获取任务状态
sleep(10);
int status = kdk_printer_get_job_status(printers[index], job_id);
}
index++;
free(filename);
}
kdk_printer_freeall(printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_list (),
.BR kdk_printer_get_available_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_download_remote_file (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_get_status (),
.BR kdk_printer_get_job_status (),
.BR kdk_printer_get_filename ()
and
.BR kdk_printer_freeall ().
.SH "SEE ALSO"
.BR kdk_printer_get_list (3),
.BR kdk_printer_get_available_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_download_remote_file (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_get_status (3),
.BR kdk_printer_get_job_status (3),
.BR kdk_printer_get_filename (3)
and
.BR kdk_printer_freeall (3).

View File

@ -0,0 +1,94 @@
.TH "KDK_PRINTER_FREEALL" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_freeall - 获取当前打印任务状态(发送打印任务之后下需要等待一会再获取状态,状态不是实时更新)
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern inline void kdk_printer_freeall(char **"ptr ");"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to recycle a list of strings of type char **.
.PP
The argument
.I ptr
is a list of strings of type char **.
.SH "RETURN VALUE"
No return value
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取打印机列表
char **printers = kdk_printer_get_available_list();
while (printers[index])
{
printf("%zd: %s\n", index + 1, printers[index]);
//取消当前打印机所有打印任务
kdk_printer_cancel_all_jobs(printers[index]);
//获取url对应的文件名
char *url = "http://www.cztouch.com/upfiles/soft/testpdf.pdf";
int res = -1;
char *filename = kdk_printer_get_filename(url); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
printf("filename = %s\n", filename);
//设置打印参数
kdk_printer_set_options(2, "A4", "lrtb", "two-sided-long-edge");
//下载
res = kdk_printer_print_download_remote_file(url, filename);
printf("[%s] res = %d\n", __FUNCTION__, res);
printf("[%s] filepath = %s\n", __FUNCTION__, filename);
//打印
int job_id = kdk_printer_print_local_file(printers[index], filename);
if (job_id == 0)
{
//打印失败
printf("[%s] create print job fail\n", __FUNCTION__);
}
else
{
//打印成功,等待一会获取任务状态
sleep(10);
int status = kdk_printer_get_job_status(printers[index], job_id);
}
index++;
free(filename);
}
kdk_printer_freeall(printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_list (),
.BR kdk_printer_get_available_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_download_remote_file (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_cancel_all_jobs (),
.BR kdk_printer_get_status (),
.BR kdk_printer_get_job_status ()
and
.BR kdk_printer_get_filename ().
.SH "SEE ALSO"
.BR kdk_printer_get_list (3),
.BR kdk_printer_get_available_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_download_remote_file (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_cancel_all_jobs (3),
.BR kdk_printer_get_status (3),
.BR kdk_printer_get_job_status (3)
and
.BR kdk_printer_get_filename (3).

View File

@ -0,0 +1,77 @@
.TH "KDK_PRINTER_GET_AVAILABLE_LIST" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_get_available_list - 获取本地的所有可用打印机(打印机处于idle状态)
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern char** kdk_printer_get_available_list();"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to obtain all available printers locally (printers in idle state).
.SH "RETURN VALUE"
On success, returns a list of printer names of type char**, ending with a
.BR NULL
string; Generated by
.I alloc
and needs to be recycled by
.BR kdk_printer_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取全部打印机列表
char **printers = kdk_printer_get_list();
while (printers[index])
{
int status = kdk_printer_get_status(printers[index]);
printf("%zd: %s , %d\n", index + 1, printers[index], status);
index++;
}
kdk_printer_freeall(printers);
//获取可用打印机列表
index = 0;
char **available_printers = kdk_printer_get_available_list();
while (available_printers[index])
{
int status = kdk_printer_get_status(available_printers[index]);
printf("%zd: %s , %d\n", index + 1, available_printers[index], status);
index++;
}
kdk_printer_freeall(available_printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_download_remote_file (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_cancel_all_jobs (),
.BR kdk_printer_get_status (),
.BR kdk_printer_get_job_status (),
.BR kdk_printer_get_filename ()
and
.BR kdk_printer_freeall ().
.SH "SEE ALSO"
.BR kdk_printer_get_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_download_remote_file (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_cancel_all_jobs (3),
.BR kdk_printer_get_status (3),
.BR kdk_printer_get_job_status (3),
.BR kdk_printer_get_filename (3)
and
.BR kdk_printer_freeall (3).

View File

@ -0,0 +1,98 @@
.TH "KDK_PRINTER_GET_FILENAME" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_get_filename - 获取当前打印任务状态(发送打印任务之后下需要等待一会再获取状态,状态不是实时更新)
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern char* kdk_printer_get_filename(const char *"url ");"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the file name inside the url.
.PP
The argument
.I url
is printer name,
.I url.
.SH "RETURN VALUE"
On success, returns the parsed file name of type char*.
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取打印机列表
char **printers = kdk_printer_get_available_list();
while (printers[index])
{
printf("%zd: %s\n", index + 1, printers[index]);
//取消当前打印机所有打印任务
kdk_printer_cancel_all_jobs(printers[index]);
//获取url对应的文件名
char *url = "http://www.cztouch.com/upfiles/soft/testpdf.pdf";
int res = -1;
char *filename = kdk_printer_get_filename(url); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
printf("filename = %s\n", filename);
//设置打印参数
kdk_printer_set_options(2, "A4", "lrtb", "two-sided-long-edge");
//下载
res = kdk_printer_print_download_remote_file(url, filename);
printf("[%s] res = %d\n", __FUNCTION__, res);
printf("[%s] filepath = %s\n", __FUNCTION__, filename);
//打印
int job_id = kdk_printer_print_local_file(printers[index], filename);
if (job_id == 0)
{
//打印失败
printf("[%s] create print job fail\n", __FUNCTION__);
}
else
{
//打印成功,等待一会获取任务状态
sleep(10);
int status = kdk_printer_get_job_status(printers[index], job_id);
}
index++;
free(filename);
}
kdk_printer_freeall(printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_list (),
.BR kdk_printer_get_available_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_download_remote_file (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_cancel_all_jobs (),
.BR kdk_printer_get_status (),
.BR kdk_printer_get_job_status ()
and
.BR kdk_printer_freeall ().
.SH "SEE ALSO"
.BR kdk_printer_get_list (3),
.BR kdk_printer_get_available_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_download_remote_file (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_cancel_all_jobs (3),
.BR kdk_printer_get_status (3),
.BR kdk_printer_get_job_status (3)
and
.BR kdk_printer_freeall (3).

View File

@ -0,0 +1,103 @@
.TH "KDK_PRINTER_GET_JOB_STATUS" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_get_job_status - 获取当前打印任务状态(发送打印任务之后下需要等待一会再获取状态,状态不是实时更新)
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern int kdk_printer_get_job_status(const char *"printername ", int "jobid ");"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the current print task status (after sending the print task,
you need to wait for a while to get the status, the status is not updated in real time).
.PP
The argument
.I printername
is printer name,
.I kdk_printer_get_list
returned value.
The argument
.I jobid
is the id of the print job.
.SH "RETURN VALUE"
On success, returns status code of type int.
.PP
On error, return
.BR 0.
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取打印机列表
char **printers = kdk_printer_get_available_list();
while (printers[index])
{
printf("%zd: %s\n", index + 1, printers[index]);
//取消当前打印机所有打印任务
kdk_printer_cancel_all_jobs(printers[index]);
//获取url对应的文件名
char *url = "http://www.cztouch.com/upfiles/soft/testpdf.pdf";
int res = -1;
char *filename = kdk_printer_get_filename(url); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
printf("filename = %s\n", filename);
//设置打印参数
kdk_printer_set_options(2, "A4", "lrtb", "two-sided-long-edge");
//下载
res = kdk_printer_print_download_remote_file(url, filename);
printf("[%s] res = %d\n", __FUNCTION__, res);
printf("[%s] filepath = %s\n", __FUNCTION__, filename);
//打印
int job_id = kdk_printer_print_local_file(printers[index], filename);
if (job_id == 0)
{
//打印失败
printf("[%s] create print job fail\n", __FUNCTION__);
}
else
{
//打印成功,等待一会获取任务状态
sleep(10);
int status = kdk_printer_get_job_status(printers[index], job_id);
}
index++;
free(filename);
}
kdk_printer_freeall(printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_list (),
.BR kdk_printer_get_available_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_download_remote_file (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_cancel_all_jobs (),
.BR kdk_printer_get_status (),
.BR kdk_printer_get_filename ()
and
.BR kdk_printer_freeall ().
.SH "SEE ALSO"
.BR kdk_printer_get_list (3),
.BR kdk_printer_get_available_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_download_remote_file (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_cancel_all_jobs (3),
.BR kdk_printer_get_status (3),
.BR kdk_printer_get_filename (3)
and
.BR kdk_printer_freeall (3).

View File

@ -0,0 +1,77 @@
.TH "KDK_PRINTER_GET_LIST" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_get_list - 获取本地的所有打印机(包含可用打印机和不可用打印机)
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern char** kdk_printer_get_list();"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to obtain all printers locally (both available and unavailable).
.SH "RETURN VALUE"
On success, returns a list of printer names of type char**, ending with a
.BR NULL
string; Generated by
.I alloc
and needs to be recycled by
.BR kdk_printer_freeall
.PP
On error, return
.BR NULL.
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取全部打印机列表
char **printers = kdk_printer_get_list();
while (printers[index])
{
int status = kdk_printer_get_status(printers[index]);
printf("%zd: %s , %d\n", index + 1, printers[index], status);
index++;
}
kdk_printer_freeall(printers);
//获取可用打印机列表
index = 0;
char **available_printers = kdk_printer_get_available_list();
while (available_printers[index])
{
int status = kdk_printer_get_status(available_printers[index]);
printf("%zd: %s , %d\n", index + 1, available_printers[index], status);
index++;
}
kdk_printer_freeall(available_printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_available_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_download_remote_file (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_cancel_all_jobs (),
.BR kdk_printer_get_status (),
.BR kdk_printer_get_job_status (),
.BR kdk_printer_get_filename ()
and
.BR kdk_printer_freeall ().
.SH "SEE ALSO"
.BR kdk_printer_get_available_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_download_remote_file (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_cancel_all_jobs (3),
.BR kdk_printer_get_status (3),
.BR kdk_printer_get_job_status (3),
.BR kdk_printer_get_filename (3)
and
.BR kdk_printer_freeall (3).

View File

@ -0,0 +1,99 @@
.TH "KDK_PRINTER_GET_STATUS" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_get_status - 获取当前打印机状态(状态不是实时更新)
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern int kdk_printer_get_status(const char *"printername ");"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to obtain the current printer status (status is not updated in real time).
.PP
The argument
.I printername
is printer name,
.I kdk_printer_get_list
returned value.
.SH "RETURN VALUE"
On success, returns status code of type int.
.PP
On error, return
.BR -2.
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取打印机列表
char **printers = kdk_printer_get_available_list();
while (printers[index])
{
printf("%zd: %s\n", index + 1, printers[index]);
//取消当前打印机所有打印任务
kdk_printer_cancel_all_jobs(printers[index]);
//获取url对应的文件名
char *url = "http://www.cztouch.com/upfiles/soft/testpdf.pdf";
int res = -1;
char *filename = kdk_printer_get_filename(url); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
printf("filename = %s\n", filename);
//设置打印参数
kdk_printer_set_options(2, "A4", "lrtb", "two-sided-long-edge");
//下载
res = kdk_printer_print_download_remote_file(url, filename);
printf("[%s] res = %d\n", __FUNCTION__, res);
printf("[%s] filepath = %s\n", __FUNCTION__, filename);
//打印
int job_id = kdk_printer_print_local_file(printers[index], filename);
if (job_id == 0)
{
//打印失败
printf("[%s] create print job fail\n", __FUNCTION__);
}
else
{
//打印成功,等待一会获取任务状态
sleep(10);
int status = kdk_printer_get_job_status(printers[index], job_id);
}
index++;
free(filename);
}
kdk_printer_freeall(printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_list (),
.BR kdk_printer_get_available_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_download_remote_file (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_cancel_all_jobs (),
.BR kdk_printer_get_job_status (),
.BR kdk_printer_get_filename ()
and
.BR kdk_printer_freeall ().
.SH "SEE ALSO"
.BR kdk_printer_get_list (3),
.BR kdk_printer_get_available_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_download_remote_file (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_cancel_all_jobs (3),
.BR kdk_printer_get_job_status (3),
.BR kdk_printer_get_filename (3)
and
.BR kdk_printer_freeall (3).

View File

@ -0,0 +1,101 @@
.TH "KDK_PRINTER_PRINT_DOWNLOAD_REMOTE_FILE" 3 "Fri Aug 25 2023" "Linux Programmer's Manual" \"
.SH NAME
kdk_printer_print_download_remote_file - 下载网络文件
.SH SYNOPSIS
.nf
.B #include <libkyprinter.h>
.sp
.BI "extern int kdk_printer_print_download_remote_file(const char *"url ", const char *"filepath ");"
.sp
Link with \fI\-lkyprinter\fP.
.SH "Detailed Description"
The main function of the interface is to download the network file.
.PP
The argument
.I url
is the url to print.
.PP
The argument
.I filepath
is the path to the saved file.
.SH "RETURN VALUE"
On success, returns the id of the print job of type int.
.PP
On error, return
.BR -1.
.SH EXAMPLES
.EX
#include "libkyprinter.h"
#include <stdio.h>
int main()
{
int index = 0;
//获取打印机列表
char **printers = kdk_printer_get_available_list();
while (printers[index])
{
printf("%zd: %s\n", index + 1, printers[index]);
//取消当前打印机所有打印任务
kdk_printer_cancel_all_jobs(printers[index]);
//获取url对应的文件名
char *url = "http://www.cztouch.com/upfiles/soft/testpdf.pdf";
int res = -1;
char *filename = kdk_printer_get_filename(url); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
printf("filename = %s\n", filename);
//设置打印参数
kdk_printer_set_options(2, "A4", "lrtb", "two-sided-long-edge");
//下载
res = kdk_printer_print_download_remote_file(url, filename);
printf("[%s] res = %d\n", __FUNCTION__, res);
printf("[%s] filepath = %s\n", __FUNCTION__, filename);
//打印
int job_id = kdk_printer_print_local_file(printers[index], filename);
if (job_id == 0)
{
//打印失败
printf("[%s] create print job fail\n", __FUNCTION__);
}
else
{
//打印成功,等待一会获取任务状态
sleep(10);
int status = kdk_printer_get_job_status(printers[index], job_id);
}
index++;
free(filename);
}
kdk_printer_freeall(printers);
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_printer_get_list (),
.BR kdk_printer_get_available_list (),
.BR kdk_printer_set_options (),
.BR kdk_printer_print_local_file (),
.BR kdk_printer_cancel_all_jobs (),
.BR kdk_printer_get_status (),
.BR kdk_printer_get_job_status (),
.BR kdk_printer_get_filename ()
and
.BR kdk_printer_freeall ().
.SH "SEE ALSO"
.BR kdk_printer_get_list (3),
.BR kdk_printer_get_available_list (3),
.BR kdk_printer_set_options (3),
.BR kdk_printer_print_local_file (3),
.BR kdk_printer_cancel_all_jobs (3),
.BR kdk_printer_get_status (3),
.BR kdk_printer_get_job_status (3),
.BR kdk_printer_get_filename (3)
and
.BR kdk_printer_freeall (3).

Some files were not shown because too many files have changed in this diff Show More