Skip to content

Commit

Permalink
device message type made enum
Browse files Browse the repository at this point in the history
  • Loading branch information
DanilKorotenko committed Jul 9, 2024
1 parent 4919ddf commit ea5d65c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion usbmuxUtils/UsbMuxDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, UsbMuxDeviceMessageType)
{
UsbMuxDeviceMessageTypeAttached = 0,
};

@interface UsbMuxDevice : NSObject

- (instancetype)initWithDeviceInfoDictionary:(NSDictionary *)aDeviceInfoDictionary;

@property (readonly) NSInteger deviceID;
@property (readonly) NSString *messageType;
@property (readonly) UsbMuxDeviceProperties *properties;

@property (readonly) UsbMuxDeviceMessageType messageType;

@end

NS_ASSUME_NONNULL_END
8 changes: 6 additions & 2 deletions usbmuxUtils/UsbMuxDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ - (NSInteger)deviceID
return [(NSNumber *)self.deviceInfoDictionary[@"DeviceID"] integerValue];
}

- (NSString *)messageType
- (UsbMuxDeviceMessageType)messageType
{
return self.deviceInfoDictionary[@"MessageType"];
// NSString *messageTypeString = self.deviceInfoDictionary[@"MessageType"];
// if ([messageTypeString isEqualToString:@"Attached"])
// {
return UsbMuxDeviceMessageTypeAttached;
// }
}

- (UsbMuxDeviceProperties *)properties
Expand Down

0 comments on commit ea5d65c

Please sign in to comment.