in FBDeviceControl/Management/FBAMDeviceManager.m [88:114]
static void FB_AMDeviceListenerCallback(AMDeviceNotification *notification, FBAMDeviceManager *manager)
{
AMDeviceNotificationType notificationType = notification->status;
AMDeviceRef device = notification->amDevice;
id<FBControlCoreLogger> logger = manager.logger;
switch (notificationType) {
case AMDeviceNotificationTypeConnected:
case AMDeviceNotificationTypePaired:
FB_AMDeviceConnected(device, manager);
return;
case AMDeviceNotificationTypeDisconnected: {
NSString *identifier = [manager identifierForDevice:device];
if (!identifier) {
[logger logFormat:@"Cannot obtain identifier for device %@", device];
return;
}
[manager deviceDisconnected:device identifier:[manager identifierForDevice:device]];
return;
}
case AMDeviceNotificationTypeUnsubscribed:
[logger logFormat:@"Unsubscribed from AMDeviceNotificationSubscribe"];
return;
default:
[manager.logger logFormat:@"Got Unknown status %d from AMDeviceNotificationSubscribe", notificationType];
return;
}
}