I am looking for help in integrating Captuvo SL22 SDK within appcelerator. The Captuvo SDK comes with the Captuvo scanner/msr for ipod. I am trying to use Captuvo SDK in a custom module and call it in the main app. I am able to establish a connection with the Captuvo Device by using the following code in the custom module startup method:
-(void) startup{
self.captuvo = [Captuvo sharedCaptuvoDevice];
[self.captuvo addCaptuvoDelegate:self];
[self.captuvo startDecoderHardware];
}
-(void) DecoderReady{
//Fire Event successfully to Titanium App
}
After the startup I try to turn the scanner on by hitting a button in the app, this is my code:
-(void) turnScannerOn{
if([self.captuvo isDecoderRunning]){
//Fire event successfully to Titanium App
[self.captuvo startDecoderScanning];
}
}
However, no matter what I try I cannot get the scanner to turn on for the life of me. I am using Titanium 3.1.1 for an iPod touch running iOS 6.1. Any help would be much appreciated! If I figure it out I will be sure to let others know!
Update: So an update on this is that I was able to get the this to kind of work. This to the tiapp.xml to scan:
<ios>
<plist>
<dict>
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.honeywell.scansled.protocol.decoder</string>
<string>com.honeywell.scansled.protocol.msr</string>
<string>com.honeywell.scansled.protocol.pm</string>
</array>
</dict>
</plist>
</ios>
However, when you first startup the app, I am unable to turn on the scanner using a button, but the triggers on the side work, but no data is returned. Honeywell provided some sample code and I noticed that this code added to a native app makes the scanner work on the initial start up so I was wondering if there is a way to replicate this objective C code inside of titanium:
- (void)viewWillAppear:(BOOL)animated
{
[[Captuvo sharedCaptuvoDevice] removeCaptuvoDelegate:self] ;
[[Captuvo sharedCaptuvoDevice] addCaptuvoDelegate:self];
[[Captuvo sharedCaptuvoDevice] startPMHardware];
[[Captuvo sharedCaptuvoDevice] startDecoderHardware];
}
- (void)viewDidDisappear:(BOOL)animated
{
[[Captuvo sharedCaptuvoDevice] stopDecoderHardware];
[[Captuvo sharedCaptuvoDevice] stopPMHardware];
[[Captuvo sharedCaptuvoDevice] removeCaptuvoDelegate:self];
}