Commit 0cb0a2d1 authored by Alex Moore's avatar Alex Moore

Anthony: finally got scanner working. Was missing three lines in Build Info. ...

Anthony: finally got scanner working.  Was missing three lines in Build Info.  Hopefully won't have to play this game again moving forward.
parent 5e513f5c
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
D9CA443E1A8988EF002039E1 /* CaptuvoSDKDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D9CA443D1A8988EF002039E1 /* CaptuvoSDKDemoTests.m */; }; D9CA443E1A8988EF002039E1 /* CaptuvoSDKDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D9CA443D1A8988EF002039E1 /* CaptuvoSDKDemoTests.m */; };
D9CA444A1A898952002039E1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9CA44491A898952002039E1 /* ViewController.m */; }; D9CA444A1A898952002039E1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9CA44491A898952002039E1 /* ViewController.m */; };
D9CA444D1A89898D002039E1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9CA444C1A89898D002039E1 /* Main.storyboard */; }; D9CA444D1A89898D002039E1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9CA444C1A89898D002039E1 /* Main.storyboard */; };
D9CA44511A8989D3002039E1 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9CA444E1A8989AF002039E1 /* ExternalAccessory.framework */; };
D9CA44531A898A9C002039E1 /* libCaptuvoSDK_Emulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D9CA44521A898A9C002039E1 /* libCaptuvoSDK_Emulator.a */; };
D9CA44551A898ABF002039E1 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D9CA44301A8988EF002039E1 /* LaunchScreen.xib */; }; D9CA44551A898ABF002039E1 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D9CA44301A8988EF002039E1 /* LaunchScreen.xib */; };
D9D2F5A91A8B1A2100CED28A /* libCaptuvoSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D9D2F5A81A8B1A2100CED28A /* libCaptuvoSDK.a */; }; D9D2F5A91A8B1A2100CED28A /* libCaptuvoSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D9D2F5A81A8B1A2100CED28A /* libCaptuvoSDK.a */; };
EF3A94521A91565B00884373 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF3A94511A91565B00884373 /* ExternalAccessory.framework */; };
EF3A94541A91566D00884373 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF3A94531A91566D00884373 /* UIKit.framework */; };
EF3A94561A91567B00884373 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF3A94551A91567B00884373 /* Foundation.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -42,11 +43,13 @@ ...@@ -42,11 +43,13 @@
D9CA443D1A8988EF002039E1 /* CaptuvoSDKDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CaptuvoSDKDemoTests.m; sourceTree = "<group>"; }; D9CA443D1A8988EF002039E1 /* CaptuvoSDKDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CaptuvoSDKDemoTests.m; sourceTree = "<group>"; };
D9CA44471A898952002039E1 /* Captuvo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Captuvo.h; sourceTree = "<group>"; }; D9CA44471A898952002039E1 /* Captuvo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Captuvo.h; sourceTree = "<group>"; };
D9CA44481A898952002039E1 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; }; D9CA44481A898952002039E1 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
D9CA44491A898952002039E1 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ViewController.m; path = ../ViewController.m; sourceTree = "<group>"; }; D9CA44491A898952002039E1 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ViewController.m; path = ../ViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
D9CA444C1A89898D002039E1 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = ../Main.storyboard; sourceTree = "<group>"; }; D9CA444C1A89898D002039E1 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = ../Main.storyboard; sourceTree = "<group>"; };
D9CA444E1A8989AF002039E1 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
D9CA44521A898A9C002039E1 /* libCaptuvoSDK_Emulator.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCaptuvoSDK_Emulator.a; path = ../libCaptuvoSDK_Emulator.a; sourceTree = "<group>"; }; D9CA44521A898A9C002039E1 /* libCaptuvoSDK_Emulator.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCaptuvoSDK_Emulator.a; path = ../libCaptuvoSDK_Emulator.a; sourceTree = "<group>"; };
D9D2F5A81A8B1A2100CED28A /* libCaptuvoSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCaptuvoSDK.a; sourceTree = "<group>"; }; D9D2F5A81A8B1A2100CED28A /* libCaptuvoSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCaptuvoSDK.a; sourceTree = "<group>"; };
EF3A94511A91565B00884373 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
EF3A94531A91566D00884373 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
EF3A94551A91567B00884373 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -54,9 +57,10 @@ ...@@ -54,9 +57,10 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
EF3A94561A91567B00884373 /* Foundation.framework in Frameworks */,
EF3A94541A91566D00884373 /* UIKit.framework in Frameworks */,
EF3A94521A91565B00884373 /* ExternalAccessory.framework in Frameworks */,
D9D2F5A91A8B1A2100CED28A /* libCaptuvoSDK.a in Frameworks */, D9D2F5A91A8B1A2100CED28A /* libCaptuvoSDK.a in Frameworks */,
D9CA44531A898A9C002039E1 /* libCaptuvoSDK_Emulator.a in Frameworks */,
D9CA44511A8989D3002039E1 /* ExternalAccessory.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -73,6 +77,9 @@ ...@@ -73,6 +77,9 @@
D9CA44151A8988EF002039E1 = { D9CA44151A8988EF002039E1 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
EF3A94551A91567B00884373 /* Foundation.framework */,
EF3A94531A91566D00884373 /* UIKit.framework */,
EF3A94511A91565B00884373 /* ExternalAccessory.framework */,
D9CA44201A8988EF002039E1 /* CaptuvoSDKDemo */, D9CA44201A8988EF002039E1 /* CaptuvoSDKDemo */,
D9CA443A1A8988EF002039E1 /* CaptuvoSDKDemoTests */, D9CA443A1A8988EF002039E1 /* CaptuvoSDKDemoTests */,
D9CA441F1A8988EF002039E1 /* Products */, D9CA441F1A8988EF002039E1 /* Products */,
...@@ -145,7 +152,6 @@ ...@@ -145,7 +152,6 @@
children = ( children = (
D9D2F5A81A8B1A2100CED28A /* libCaptuvoSDK.a */, D9D2F5A81A8B1A2100CED28A /* libCaptuvoSDK.a */,
D9CA44521A898A9C002039E1 /* libCaptuvoSDK_Emulator.a */, D9CA44521A898A9C002039E1 /* libCaptuvoSDK_Emulator.a */,
D9CA444E1A8989AF002039E1 /* ExternalAccessory.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -199,6 +205,11 @@ ...@@ -199,6 +205,11 @@
TargetAttributes = { TargetAttributes = {
D9CA441D1A8988EF002039E1 = { D9CA441D1A8988EF002039E1 = {
CreatedOnToolsVersion = 6.1.1; CreatedOnToolsVersion = 6.1.1;
SystemCapabilities = {
com.apple.WAC = {
enabled = 0;
};
};
}; };
D9CA44361A8988EF002039E1 = { D9CA44361A8988EF002039E1 = {
CreatedOnToolsVersion = 6.1.1; CreatedOnToolsVersion = 6.1.1;
...@@ -368,6 +379,8 @@ ...@@ -368,6 +379,8 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = CaptuvoSDKDemo/Info.plist; INFOPLIST_FILE = CaptuvoSDKDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
...@@ -376,6 +389,8 @@ ...@@ -376,6 +389,8 @@
"$(PROJECT_DIR)/CaptuvoSDKDemo", "$(PROJECT_DIR)/CaptuvoSDKDemo",
); );
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
}; };
...@@ -383,6 +398,8 @@ ...@@ -383,6 +398,8 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = CaptuvoSDKDemo/Info.plist; INFOPLIST_FILE = CaptuvoSDKDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
...@@ -391,6 +408,8 @@ ...@@ -391,6 +408,8 @@
"$(PROJECT_DIR)/CaptuvoSDKDemo", "$(PROJECT_DIR)/CaptuvoSDKDemo",
); );
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Release; name = Release;
}; };
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "Captuvo.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate> @interface AppDelegate : UIResponder <UIApplicationDelegate, CaptuvoEventsProtocol>
@property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UIWindow *window;
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "ViewController.h"
@interface AppDelegate () @interface AppDelegate ()
@end @end
...@@ -20,26 +22,89 @@ ...@@ -20,26 +22,89 @@
return YES; return YES;
} }
- (void)applicationWillResignActive:(UIApplication *)application { - (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
// [[Captuvo sharedCaptuvoDevice] stopDecoderHardware];
// [[Captuvo sharedCaptuvoDevice] stopMSRHardware];
// [[Captuvo sharedCaptuvoDevice] stopPMHardware] ;
} }
- (void)applicationDidEnterBackground:(UIApplication *)application { - (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
[[Captuvo sharedCaptuvoDevice] stopDecoderHardware] ;
// [[Captuvo sharedCaptuvoDevice] stopMSRHardware] ;
[[Captuvo sharedCaptuvoDevice] stopPMHardware] ;
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
// NSInteger index = [self.tabBarController selectedIndex] ;
[[Captuvo sharedCaptuvoDevice] startDecoderHardware] ;
// UIAlertView *testAlert = [[UIAlertView alloc] initWithTitle:@"Test resume" message:[NSString stringWithFormat:@"index=%d",index] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil] ;
// [testAlert show] ;
// switch (index) {
// case 0:
// [((UIViewController*)[self.tabBarController.viewControllers objectAtIndex:0]).navigationController popToRootViewControllerAnimated:YES] ;
//
// break;
// case 1:
// [((UIViewController*)[self.tabBarController.viewControllers objectAtIndex:1]).navigationController popToRootViewControllerAnimated:YES] ;
//
// [[Captuvo sharedCaptuvoDevice] startMSRHardware] ;
// break ;
// case 2:
[[Captuvo sharedCaptuvoDevice] startPMHardware] ;
// break ;
// default:
// break;
// }
} }
- (void)applicationDidBecomeActive:(UIApplication *)application { - (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
// NSInteger index = [self.tabBarController selectedIndex] ;
// [[Captuvo sharedCaptuvoDevice] startDecoderHardware] ;
//// UIAlertView *testAlert = [[UIAlertView alloc] initWithTitle:@"Test resume" message:[NSString stringWithFormat:@"index=%d",index] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil] ;
//// [testAlert show] ;
// switch (index) {
// case 0:
// [((UIViewController*)[self.tabBarController.viewControllers objectAtIndex:0]).navigationController popToRootViewControllerAnimated:YES] ;
//
// break;
// case 1:
// [((UIViewController*)[self.tabBarController.viewControllers objectAtIndex:1]).navigationController popToRootViewControllerAnimated:YES] ;
//
// [[Captuvo sharedCaptuvoDevice] startMSRHardware] ;
// break ;
// case 2:
// [[Captuvo sharedCaptuvoDevice] startPMHardware] ;
// break ;
// default:
// break;
// }
//
} }
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
[[Captuvo sharedCaptuvoDevice] stopDecoderHardware] ;
// [[Captuvo sharedCaptuvoDevice] stopMSRHardware] ;
[[Captuvo sharedCaptuvoDevice] stopPMHardware] ;
} }
@end @end
...@@ -30,11 +30,15 @@ ...@@ -30,11 +30,15 @@
<array> <array>
<string>armv7</string> <string>armv7</string>
</array> </array>
<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>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state> </state>
<connections> <connections>
<action selector="handleButtonClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="v2y-Lg-ggf"/> <action selector="scanStartAction:" destination="BYZ-38-t0r" eventType="touchDown" id="RK6-oG-PGk"/>
<action selector="scanStopAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="1y3-cn-gNJ"/>
</connections> </connections>
</button> </button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Barcode" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tm2-Im-Urw"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Barcode" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tm2-Im-Urw">
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
@implementation ViewController @implementation ViewController
- (void) prepareForScanning { - (void) prepareForScanning {
ProtocolConnectionStatus status = [self.sharedCaptuvoDevice startDecoderHardware]; ProtocolConnectionStatus status = [[Captuvo sharedCaptuvoDevice] startDecoderHardware];
if (status == ProtocolConnectionStatusConnected) { if (status == ProtocolConnectionStatusConnected) {
printf("ProtocolConnectionStatus - Decoder Hardware Started\n"); printf("ProtocolConnectionStatus - Decoder Hardware Started\n");
} }
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
printf("ERROR DETECTED: ProtocolConnectionStatus - Decoder Hardware Not Started\n"); printf("ERROR DETECTED: ProtocolConnectionStatus - Decoder Hardware Not Started\n");
} }
else { else {
[self.sharedCaptuvoDevice enableDecoderScanning]; [[Captuvo sharedCaptuvoDevice] enableDecoderScanning];
//[self.sharedCaptuvoDevice startDecoderScanning]; //[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
} }
//status = [self.sharedCaptuvoDevice startPMHardware]; //status = [[Captuvo sharedCaptuvoDevice] startPMHardware];
//if (status == ProtocolConnectionStatusConnected) { //if (status == ProtocolConnectionStatusConnected) {
// printf("ProtocolConnectionStatus - PM Hardware Started\n"); // printf("ProtocolConnectionStatus - PM Hardware Started\n");
//} //}
...@@ -46,74 +46,106 @@ ...@@ -46,74 +46,106 @@
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib. // Do any additional setup after loading the view, typically from a nib.
//[[Captuvo sharedCaptuvoDevice] getCaptuvoSerialNumber]; //[[Captuvo sharedCaptuvoDevice] getCaptuvoSerialNumber];
self.sharedCaptuvoDevice = [Captuvo sharedCaptuvoDevice]; //[Captuvo sharedCaptuvoDevice] = [Captuvo sharedCaptuvoDevice];
self.nameLabel.text = [self.sharedCaptuvoDevice getCaptuvoName]; self.nameLabel.text = [[Captuvo sharedCaptuvoDevice] getCaptuvoName];
self.manufacturerLabel.text = [self.sharedCaptuvoDevice getCaptuvoManufacturer]; self.manufacturerLabel.text = [[Captuvo sharedCaptuvoDevice] getCaptuvoManufacturer];
self.modelNumberLabel.text = [self.sharedCaptuvoDevice getCaptuvoModelNumber]; self.modelNumberLabel.text = [[Captuvo sharedCaptuvoDevice] getCaptuvoModelNumber];
self.serialNumberLabel.text = [self.sharedCaptuvoDevice getCaptuvoSerialNumber]; self.serialNumberLabel.text = [[Captuvo sharedCaptuvoDevice] getCaptuvoSerialNumber];
self.firmwareRevLabel.text = [self.sharedCaptuvoDevice getCaptuvoFirmwareRevision]; self.firmwareRevLabel.text = [[Captuvo sharedCaptuvoDevice] getCaptuvoFirmwareRevision];
[self.sharedCaptuvoDevice addCaptuvoDelegate:self]; //[[Captuvo sharedCaptuvoDevice] addCaptuvoDelegate:self];
//[self prepareForScanning]; //[self prepareForScanning];
[self.sharedCaptuvoDevice startDecoderHardware]; //[[Captuvo sharedCaptuvoDevice] startDecoderHardware];
[self initCaptuvoSDK];
[self.scanButton addTarget:self action:@selector(scanStartAction:) forControlEvents:UIControlEventTouchDown];
[self.scanButton addTarget:self action:@selector(scanStopAction:) forControlEvents:UIControlEventTouchUpInside];
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
//[self.sharedCaptuvoDevice removeCaptuvoDelegate:self]; //[[Captuvo sharedCaptuvoDevice] removeCaptuvoDelegate:self];
} }
- (void)initCaptuvoSDK
- (IBAction)handleButtonClick:(id)sender { {
self.barcodeLabel.text = @"Joke's on you - trick button :P";
[[Captuvo sharedCaptuvoDevice] addCaptuvoDelegate:self] ;
[[Captuvo sharedCaptuvoDevice] startDecoderHardware];
[[Captuvo sharedCaptuvoDevice] requestBatteryVoltage] ;
[[Captuvo sharedCaptuvoDevice] requestChargeStatus] ;
} }
- (void) captuvoConnected {
UIAlertView *connectedAlert = [[UIAlertView alloc] initWithTitle:@"Sled Connection Status" message:@"Captuvo Sled connected!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[connectedAlert show];
}
- (void) captuvoDisconnected { - (IBAction)scanStartAction:(id)sender {
UIAlertView *disconnectedAlert = [[UIAlertView alloc] initWithTitle:@"Sled Connection Status" message:@"Captuvo Sled disconnected!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; //self.barcodeLabel.text = @"Joke's on you - trick button :P";
[disconnectedAlert show]; printf("scan Started\n");
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
} }
- (void) decoderReady { - (IBAction)scanStopAction:(id)sender {
[self.sharedCaptuvoDevice enableDecoderBeeperForGoodRead:YES persistSetting:NO]; //self.barcodeLabel.text = @"Joke's on you - trick button :P";
//[self.sharedCaptuvoDevice setDecoderSerialTriggerTimeoutInMilliSeconds:5000 persistSetting:NO]; printf("scan Stopped\n");
[[Captuvo sharedCaptuvoDevice] stopDecoderScanning];
UIAlertView *decoderReady = [[UIAlertView alloc] initWithTitle:@"Decoder Status" message:@"Decoder ready!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[decoderReady show];
} }
- (void)scanKeyAction:(ScanKeyStatus)status { //- (void) captuvoConnected {
if (status == ScanKeyPressing) { // UIAlertView *connectedAlert = [[UIAlertView alloc] initWithTitle:@"Sled Connection Status" message:@"Captuvo Sled connected!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[self.sharedCaptuvoDevice enableDecoderIllumination:TRUE]; // [connectedAlert show];
[self.sharedCaptuvoDevice enableDecoderAimer:TRUE]; //}
[self.sharedCaptuvoDevice startDecoderScanning]; //
} //- (void) captuvoDisconnected {
else if (status == ScanKeyReleased) { // UIAlertView *disconnectedAlert = [[UIAlertView alloc] initWithTitle:@"Sled Connection Status" message:@"Captuvo Sled disconnected!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[self.sharedCaptuvoDevice stopDecoderScanning]; // [disconnectedAlert show];
[self.sharedCaptuvoDevice disableDecoderIllumination:TRUE]; //}
[self.sharedCaptuvoDevice disableDecoderAimer:TRUE];
} - (void)decoderReady
{
double delayInSeconds = 1.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[[Captuvo sharedCaptuvoDevice] enableDecoderBeeperForGoodRead:YES persistSetting:NO] ;
//setting decoder trigger click status.
// [[Captuvo sharedCaptuvoDevice]requestDecoderTriggerClickStatus];
//setting 5 seconds after will auto stop the aimer light.
[[Captuvo sharedCaptuvoDevice] setDecoderSerialTriggerTimeoutInMilliSeconds:5000 persistSetting:NO];
});
} }
- (void) pmReady { //- (void)scanKeyAction:(ScanKeyStatus)status {
UIAlertView *pmReady = [[UIAlertView alloc] initWithTitle:@"PM Status" message:@"PM ready!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; // if (status == ScanKeyPressing) {
[pmReady show]; // [[Captuvo sharedCaptuvoDevice] enableDecoderIllumination:TRUE];
} // [[Captuvo sharedCaptuvoDevice] enableDecoderAimer:TRUE];
// [[Captuvo sharedCaptuvoDevice] startDecoderScanning];
// }
// else if (status == ScanKeyReleased) {
// [[Captuvo sharedCaptuvoDevice] stopDecoderScanning];
// [[Captuvo sharedCaptuvoDevice] disableDecoderIllumination:TRUE];
// [[Captuvo sharedCaptuvoDevice] disableDecoderAimer:TRUE];
// }
//}
//
//- (void) pmReady {
// UIAlertView *pmReady = [[UIAlertView alloc] initWithTitle:@"PM Status" message:@"PM ready!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
// [pmReady show];
//}
- (void) decoderDataReceived:(NSString *)data { - (void) decoderDataReceived:(NSString *)data {
//printf("Decoder data received: %s", [data cStringUsingEncoding:NSASCIIStringEncoding]); //printf("Decoder data received: %s", [data cStringUsingEncoding:NSASCIIStringEncoding]);
self.barcodeLabel.text = data; self.barcodeLabel.text = data;
//[self.sharedCaptuvoDevice stopDecoderHardware]; //[[Captuvo sharedCaptuvoDevice] stopDecoderHardware];
} }
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment