46 lines
1.2 KiB
Objective-C
46 lines
1.2 KiB
Objective-C
//
|
|
// MMPeripheralsProvider.h
|
|
// MacMonitor
|
|
//
|
|
// Telemetry provider enumerating connected USB, Thunderbolt, and PCI peripheral devices via IOKit.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import "MMTelemetryProvider.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
typedef NS_ENUM(NSInteger, MMPeripheralBusType) {
|
|
MMPeripheralBusTypeUSB,
|
|
MMPeripheralBusTypeThunderbolt,
|
|
MMPeripheralBusTypePCI
|
|
};
|
|
|
|
@interface MMPeripheralDevice : NSObject
|
|
|
|
@property (nonatomic, copy) NSString *name;
|
|
@property (nonatomic, assign) MMPeripheralBusType busType;
|
|
@property (nonatomic, copy) NSString *vendorName;
|
|
@property (nonatomic, assign) uint32_t vendorID;
|
|
@property (nonatomic, assign) uint32_t productID;
|
|
@property (nonatomic, copy, nullable) NSString *serialNumber;
|
|
@property (nonatomic, copy, nullable) NSString *deviceClass;
|
|
@property (nonatomic, assign) uint64_t locationID;
|
|
@property (nonatomic, assign) BOOL isBuiltIn;
|
|
|
|
- (NSDictionary<NSString *, id> *)toDictionary;
|
|
|
|
@end
|
|
|
|
@interface MMPeripheralsProvider : NSObject <MMTelemetryProvider>
|
|
|
|
- (instancetype)init;
|
|
|
|
+ (NSArray<MMPeripheralDevice *> *)sampleUSBDevices;
|
|
+ (NSArray<MMPeripheralDevice *> *)sampleThunderboltDevices;
|
|
+ (NSArray<MMPeripheralDevice *> *)samplePCIDevices;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|