BusProberSharedFunctions.h [plain text]
#import <Foundation/Foundation.h>
#import <IOKit/usb/IOUSBLib.h>
#import <IOKit/usb/USB.h>
#import <IOKit/usb/USBSpec.h>
#import <IOKit/IOCFPlugIn.h>
#import "BusProbeClass.h"
typedef struct IOUSBDeviceStruct197** IOUSBDeviceRef ;
typedef struct IOUSBInterfaceStruct220** IOUSBInterfaceRef ;
#define ROOT_LEVEL 0
#define DEVICE_DESCRIPTOR_LEVEL ROOT_LEVEL + 1
#define CONFIGURATION_DESCRIPTOR_LEVEL ROOT_LEVEL + 1
#define INTERFACE_LEVEL CONFIGURATION_DESCRIPTOR_LEVEL + 1
#define ENDPOINT_LEVEL INTERFACE_LEVEL + 1
#define HID_DESCRIPTOR_LEVEL INTERFACE_LEVEL + 1
#define DFU_DESCRIPTOR_LEVEL INTERFACE_LEVEL + 1
#define HUB_DESCRIPTOR_LEVEL ROOT_LEVEL + 1
#define DEVICE_QUAL_DESCRIPTOR_LEVEL ROOT_LEVEL + 1
enum {
kIntegerOutputStyle = 0,
kHexOutputStyle = 1
};
int GetDeviceLocationID( IOUSBDeviceRef deviceIntf, UInt32 * locationID );
int GetDeviceSpeed( IOUSBDeviceRef deviceIntf, UInt8 * speed );
int GetDeviceAddress( IOUSBDeviceRef deviceIntf, USBDeviceAddress * address );
int SuspendDevice( IOUSBDeviceRef deviceIntf, BOOL suspend );
IOReturn GetDescriptor(IOUSBDeviceRef deviceIntf, UInt8 descType, UInt8 descIndex, void *buf, UInt16 len);
int GetStringDescriptor(IOUSBDeviceRef deviceIntf, UInt8 descIndex, void *buf, UInt16 len, UInt16 lang);
int GetClassDescriptor(IOUSBDeviceRef deviceIntf, UInt8 descType, UInt8 descIndex, void *buf, UInt16 len);
int GetDescriptorFromInterface(IOUSBDeviceRef deviceIntf, UInt8 descType, UInt8 descIndex, UInt16 wIndex, void *buf, UInt16 len);
BusProbeClass * GetDeviceClassAndSubClass(UInt8 * pcls);
BusProbeClass * GetInterfaceClassAndSubClass(UInt8 * pcls);
char * GetStringFromNumber(UInt32 value, int sizeInBytes, int style);
char * GetStringFromIndex(UInt8 strIndex, IOUSBDeviceRef deviceIntf);
NSString * VendorNameFromVendorID(NSString * intValueAsString);
NSString * GetUSBProductNameFromRegistry(io_registry_entry_t entry);
void FreeString(char * cstr);
UInt16 Swap16(void *p);
UInt32 Swap32(void *p);
UInt64 Swap64(void *p);
UInt32 Swap24(void *p);