天嵌二次封装库使用手册  V1.0
tq_disk.h 文件参考
#include <stdio.h>
#include <mntent.h>
#include <errno.h>
#include <string.h>
#include <sys/statfs.h>
#include <ctype.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <getopt.h>
#include <asm/types.h>
#include <mtd/mtd-abi.h>
#include <dirent.h>
#include "tq_common.h"
tq_disk.h 的引用(Include)关系图:

浏览源代码.

结构体

struct  tagDevParam_T
 外部设备的子结构 更多...
 
struct  tagDevinfo_T
 设备消息标志 更多...
 

宏定义

#define DEVTYPE_DISK   2
 硬盘
 
#define DEVTYPE_U   3
 U盘
 

类型定义

typedef struct tagDevParam_T tagDevParam_t
 外部设备的子结构
 
typedef struct tagDevParam_TptagDevParam_t
 
typedef struct tagDevinfo_T tagDevinfo_t
 设备消息标志
 
typedef struct tagDevinfo_TptagDevinfo_t
 

函数

int get_udisk_count (void)
 获取u盘个数 更多...
 
int get_udisk_path (int index, int part, char *buff, int size)
 获取u盘挂载路径 更多...
 
int get_sdisk_path (int part, char *buff, int size)
 获取sd卡挂载路径 更多...
 
int CheckIsDiskOrUsbDisk (char *devname)
 判读是u盘还是sata硬盘 更多...
 
int get_udisk_devname (int index, char *buff, int length)
 获取U盘设备节点 更多...
 
int get_flash_dev (char *ndev)
 获取闪存对象 更多...
 

详细描述

作者
zhengchuangyong (zheng.nosp@m.chua.nosp@m.ngyon.nosp@m.g@em.nosp@m.bedsk.nosp@m.y.ne.nosp@m.t)
版本
1.0
日期
2021-09-07
修改日志:
Date Version Author Description
2021-09-07 1.0 zhengchuangyong 第一次发布,对磁盘一些基本操作的封装,如获取磁盘信息个数等.

函数说明

int CheckIsDiskOrUsbDisk ( char *  devname)

判读是u盘还是sata硬盘

参数
devnamedevname 为设备节点
返回
int 成功返回设备类型(2:硬盘,3:U盘),失败返回-1
int get_flash_dev ( char *  ndev)

获取闪存对象

参数
ndev设备节点名
返回
int 成功返回设备号(>0),失败返回-1
int get_sdisk_path ( int  part,
char *  buff,
int  size 
)

获取sd卡挂载路径

参数
part为分区号
buff存放获取后挂载路径
sizebuff的空间大小
返回
int 成功返回填充buff的长度,无挂载返回0,失败返回-1
int get_udisk_count ( void  )

获取u盘个数

返回
int 成功返回u盘个数,失败返回-1
int get_udisk_devname ( int  index,
char *  buff,
int  length 
)

获取U盘设备节点

参数
indexu盘号
buff获取后挂载路径
lengthbuff的空间大小
返回
int 成功返回填充buff的长度,无挂载返回0,失败返回-1
int get_udisk_path ( int  index,
int  part,
char *  buff,
int  size 
)

获取u盘挂载路径

参数
indexu盘号
part为分区号
buff存放获取后挂载路径
sizebuff的空间大小
返回
int 成功返回填充buff的长度,无挂载返回0,失败返回-1