USB

作者: 冰J冰 | 来源:发表于2017-06-09 08:59 被阅读31次

``

ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*'``

```

```

ioreg -p IOUSB -w0 -l

```

```

ioreg -p IOUSB

```

```

//

//main.m

//USBDDD

//

//Created by dengbb on 14/06/2017.

//Copyright © 2017 mohekeji. All rights reserved.

//

#import

#include

#include

#include

#include

#import

intmain(intargc,constchar* argv[]) {

returnNSApplicationMain(argc, argv);

}

voidlistProperties(io_service_tService){

CFMutableDictionaryRefpropertiesDict;

kern_return_tkr =IORegistryEntryCreateCFProperties(Service, &propertiesDict,kCFAllocatorDefault,kNilOptions);

if(!kr){

fprintf(stderr,"Error geting propertiex..\n");

return;

}

CFDataRefxml =CFPropertyListCreateXMLData(kCFAllocatorDefault, (CFPropertyListRef)propertiesDict);

if(xml) {

write(1,CFDataGetBytePtr(xml),CFDataGetLength(xml));

CFRelease(xml);

}

}

```

相关文章

网友评论

      本文标题:USB

      本文链接:https://www.haomeiwen.com/subject/vvyxqxtx.html