Without looking at the exact API's you are using, it should be
something like this...
//You have a cocoa method that is calling a USB manager routine that
takes a C function pointer and a user value.
- (void)myCocoaMethod
{
SomeUSBFunctionWithACallback(myCallback, self);
}
// Your C callback looks like this. It casts the user value back into
an object pointer and dispatches appropriately
void myCallBack(void *refcon)
{
MyCocoaObject *object = (MyCocoaObject*)refcon;
[object someMethod];
}
Dave
On May 10, 2005, at 3:02 PM, Juan Pablo Pertierra wrote:
Hello,
I am calling a separate thread in my Cocoa app to do reading from
the USB port. My problem is that the callback functions are not
part of My Controller class, and i'd like the callback to trigger a
function within my controller. Basically i want the callback to
the my controller that there is new data just received from the USB
port to display.
Can/should i make the callbacks part of my controller class
somehow? What should I do/use in this case?
Thanks,
Juan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden
This email sent to email@hidden
---
It's not denial. I'm just very particular about the reality I choose
to accept. -Calvin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden