天嵌二次封装库使用手册  V2.1.2
lib_disk.h
浏览该文件的文档.
1 
7 #ifndef LINUX_LIBV2_SOURCE_DISK_LIB_DISK_H_
8 #define LINUX_LIBV2_SOURCE_DISK_LIB_DISK_H_
9 
10 #define DEVTYPE_DISK 2
11 #define DEVTYPE_U 3
12 #ifdef __cplusplus
13 #define DISK_API extern "C"
14 #else
15 #define DISK_API
16 #endif
17 
21  typedef struct tagDevParam_T
22  {
23  unsigned char devname[12];
24  unsigned char devtype;
25  unsigned char partition_count;
26  unsigned int dev_totalspace;
27  unsigned int partition_size[12];
29 
33  typedef struct tagDevinfo_T
34  {
35  tagDevParam_t dev[8];
36  int devcount;
37  int disk_num;
38 
40 
45  DISK_API int get_udisk_count(void);
53  DISK_API int get_udisk_devname(int index, char *buff, int length);
59  DISK_API int get_flash_dev(char *ndev);
66  DISK_API int get_disk_path(const char* node, char *buff, int size);
72  DISK_API int get_sdisk_dev(char *ndev);
78  DISK_API int get_nvme_dev(char *ndev);
85 
86 #endif
DISK_API int CheckIsDiskOrUsbDisk(char *devname)
判读是u盘还是sata硬盘
struct tagDevinfo_T * ptagDevinfo_t
unsigned char devtype
设备类型,2:硬盘,3:U盘
Definition: lib_disk.h:24
DISK_API int get_sdisk_dev(char *ndev)
Get the sdisk dev object.
unsigned char devname[12]
设备名
Definition: lib_disk.h:23
#define DISK_API
Definition: lib_disk.h:15
DISK_API int get_udisk_count(void)
获取u盘个数
设备消息标志
Definition: lib_disk.h:33
DISK_API int get_flash_dev(char *ndev)
获取闪存对象
unsigned int dev_totalspace
总空间 KB
Definition: lib_disk.h:26
DISK_API int get_disk_path(const char *node, char *buff, int size)
Get the disk path object.
int devcount
总共的设备数量
Definition: lib_disk.h:36
DISK_API int get_nvme_dev(char *ndev)
Get the nvme dev object.
struct tagDevParam_T tagDevParam_t
外部设备的子结构
unsigned char partition_count
分区个数
Definition: lib_disk.h:25
unsigned int partition_size[12]
分区大小,单位KB
Definition: lib_disk.h:27
DISK_API int get_udisk_devname(int index, char *buff, int length)
获取U盘设备节点
struct tagDevinfo_T tagDevinfo_t
设备消息标志
外部设备的子结构
Definition: lib_disk.h:21
struct tagDevParam_T * ptagDevParam_t
int disk_num
设备编号
Definition: lib_disk.h:37