I have a device that plugs into the iPhone.
I have written a plug-in with functions open and close to initializes and open the device and close it and clean up resources.
These work great and even the data being captured is working and I am seeing it with NSLog out puts.
I am having a problem getting this data back the java script.
I pass in a callback function in the open function in the success parameter and want to somehow save this so I can fire this callback anytime data is read from the device so the phone gap application can use that data.
I tried saving the callback to a global variable in the class, but always get a EXC_BAD_ACCESS error.
Anyway to save the callback so it can be called on anytime the device acquires data?
I have written a plug-in with functions open and close to initializes and open the device and close it and clean up resources.
These work great and even the data being captured is working and I am seeing it with NSLog out puts.
I am having a problem getting this data back the java script.
I pass in a callback function in the open function in the success parameter and want to somehow save this so I can fire this callback anytime data is read from the device so the phone gap application can use that data.
I tried saving the callback to a global variable in the class, but always get a EXC_BAD_ACCESS error.
Anyway to save the callback so it can be called on anytime the device acquires data?

