資源簡介
在linux嵌入式下用C語言編寫的系統自動識別USB接口的插拔的程序
代碼片段和文件信息
#include?
#include
#include
int?main?()
{
? FILE?*fp;
int?resultsys;
char?ch1=‘&‘ch2=‘&‘;
while(1)
{
sys=system(“dmesg?|?grep?USB?>?usb_info“);
if(sys!=0)
{
printf(“commond?is?not?found“);
break;
}
else
{
if(?(fp=?fopen(?“usb_info“?“r“?))?==?NULL?)
????? {
?????? //printf(?“The?file?‘usb_info‘?was?not?opened\n“?);
??????
continue;
????? }
else
?????? {
?????? if(?re
- 上一篇:水流界面追蹤VOF模型的CPP源碼
- 下一篇:http上傳C++代碼實現
評論
共有 條評論