site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=FQ/HgsBN2VAeOkB1mQj+QDqFdowv+kK313L1Oni8TXA=; b=H4OZtKHv+OUXgHZQbhntsVQXQ70weEeI320PXKwPJbTSRLMGijmLW6fUIIE5a1WXjs 4lE6NLl/ohFQOScHvPOLJj6HgsjvQOkYYOy9wuh9s/dIHdBvSNP8wSLcWY2oSjcLUZzS HYInYj+eMaDiV/b5JuH4BA3kzwNrvTwZsU8xw= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=i42RqLjoBC3WiDOO7X88g4Vc1bmGU7mq1QXdom223Gg27iaefM9fWHrZpucR3ExYGD 6KJ3UvoawD30e7UUxCZL+4HnJl9qKGh7xd04G8VKKwlvnqzvrn5+gCLnaNlQO7qXxwYC lR4ZdVo4y9raDWDZO/cwav7w0LlWAIggqyF/Y= I'm trying to combine user-space USB code with GCD and I'm finding that my async notification callback is not being triggered. I don't have a CFRunLoop and I'm using this hack instead: extern "C" { // http://lists.apple.com/archives/darwin-dev/2010/Apr/msg00072.html void IONotificationPortSetDispatchQueue(IONotificationPortRef notify, dispatch_queue_t queue ); }; In absence of a run loop, I can't go the standard route of (*interface)->CreateInterfaceAsyncEventSource(interface, &runLoopSource); CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode); I'm trying to work around it like this IOUSBInterfaceInterface245 **intf_; mach_port_t async; IOReturn kr = (*intf_)->CreateInterfaceAsyncPort(intf_, &async); dispatch_queue_t que_ = dispatch_queue_create("com.agilent.82357b.usb", NULL); IONotificationPortRef notify = IONotificationPortCreate(async); IONotificationPortSetDispatchQueue(notify, que_); (*intf_)->ReadPipeAsync(intf_, pipe, buffer, size, AsyncInterruptCallback, &data); but AsyncInterruptCallback is never called. Does IONotificationPortCreate give me a whole new notification port compared to the one used by IOUSBInterfaceClass::CreateInterfaceAsyncPort internally and associated with the mach port that it's returning? Is there a workaround? Can I get the IONotificationPortRef associated with an existing mach port somehow? Thanks, Joel P.S. This is the relevant chunk of CreateInterfaceAsyncPort IOReturn IOUSBInterfaceClass::CreateInterfaceAsyncPort(mach_port_t *port) { IOReturn kr; mach_port_t masterPort; ATTACHEDCHECK(); // If we already have a port, don't create a new one. if (fAsyncPort) { if (port) *port = IONotificationPortGetMachPort(fAsyncPort); return kIOReturnSuccess; } // First create a master_port for my task kr = IOMasterPort(MACH_PORT_NULL, &masterPort); if (kr || !masterPort) return kIOReturnError; fAsyncPort = IONotificationPortCreate(masterPort); ... --- http://twitter.com/wagerlabs _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com