Cognex Mobile Barcode SDK
SDK for supporting communication with Cognex Barcode Reader devices
CDMDataManSystem.h
Go to the documentation of this file.
1 //
2 // CDMDataManSystem.h
3 //
4 // Copyright (c) 2014 Cognex Corporation. All rights reserved.
5 //
6 
144 #import <Foundation/Foundation.h>
145 #import <ExternalAccessory/ExternalAccessory.h>
147 
148 
152 typedef NS_ENUM(NSInteger, CDMImageSize)
153 {
170 };
171 
175 typedef NS_ENUM(NSInteger, CDMImageQuality)
176 {
189 };
190 
194 typedef NS_ENUM(NSInteger, CDMImageFormat)
195 {
204 };
205 
209 typedef NS_OPTIONS(NSInteger, CDMResultTypes)
210 {
243 };
244 
248 typedef NS_ENUM(NSInteger, CDMConnectionState) {
253 };
254 
258 typedef enum : NSUInteger {
263 
267 typedef NS_ENUM(NSInteger, CDMCameraMode)
268 {
285 };
286 
292 typedef NS_OPTIONS(NSInteger, CDMPreviewOption)
293 {
330 };
331 
335 @interface CDMDataManSystem : NSObject
336 
340 @property (readonly) DataManDeviceClass deviceClass;
341 
345 @property (readonly) CDMConnectionState connectionState;
346 
351 @property (weak) id<CDMDataManSystemDelegate> delegate;
352 
356 @property (nonatomic) CDMResultTypes resultTypes;
357 
361 @property (readonly, getter = isHeartbeatEnabled) BOOL heartbeatEnabled;
362 
366 @property (readonly, getter = isLiveImageEnabled) BOOL liveImageEnabled;
367 
371 @property (nonatomic) NSTimeInterval timeout;
372 
376 @property (readonly, getter = isConnected) BOOL connected;
377 
382 + (NSString *)getVersion;
383 
396 + (CDMDataManSystem *)dataManSystemWithHostname:(NSString *)hostname port:(int)port delegate:(id<CDMDataManSystemDelegate>)delegate;
397 
406 + (CDMDataManSystem *)dataManSystemWithAccessory:(EAAccessory*)accessory delegate:(id<CDMDataManSystemDelegate>)delegate;
407 
415 + (CDMDataManSystem *)dataManSystemOfExternalAccessoryWithDelegate:(id<CDMDataManSystemDelegate>)delegate;
416 
427 + (CDMDataManSystem *)dataManSystemWithCameraMode:(CDMCameraMode)cameraMode
428  previewOptions:(CDMPreviewOption)previewOptions
429  nullablePreviewView:(UIView*)previewView
430  delegate:(id<CDMDataManSystemDelegate>)delegate;
431 
441 + (CDMDataManSystem *)dataManSystemWithCameraMode:(CDMCameraMode)cameraMode
442  previewOptions:(CDMPreviewOption)previewOptions
443  delegate:(id<CDMDataManSystemDelegate>)delegate;
444 
456 + (CDMDataManSystem *)dataManSystemWithCameraMode:(CDMCameraMode)cameraMode
457  previewOptions:(CDMPreviewOption)previewOptions
458  nullablePreviewView:(UIView*)previewView
459  registrationKey:(NSString*)registrationKey
460  delegate:(id<CDMDataManSystemDelegate>)delegate;
461 
474 + (CDMDataManSystem *)dataManSystemWithCameraMode:(CDMCameraMode)cameraMode
475  previewOptions:(CDMPreviewOption)previewOptions
476  nullablePreviewView:(UIView*)previewView
477  registrationKey:(NSString*)registrationKey
478  customData:(NSString*)customData
479  delegate:(id<CDMDataManSystemDelegate>)delegate;
480 
487 - (void)setCameraPreviewContainer:(UIView*) previewContainer completion:(void (^)(NSError *error))completionBlock;
488 
492 
496 - (BOOL)connect;
497 
505 - (BOOL)connectWithUsername:(NSString*)username password:(NSString*)password;
506 
510 - (void)disconnect;
511 
517 - (BOOL)sendCommand:(NSString *)command;
518 
547 - (BOOL)sendCommand:(NSString *)command withCallback:(void(^)(CDMResponse *response))callback;
548 
558 - (BOOL)sendCommand:(NSString *)command withData:(NSData *)data timeout:(NSTimeInterval)timeout expectBinaryResponse:(BOOL)expectBinaryResponse callback:(void(^)(CDMResponse *response))callback;
559 
566 - (BOOL)sendBatchCommands:(NSArray *)commands completed:(void(^)(void))complete;
567 
572 - (void)acceptIncomingConnection:(BOOL)accept;
573 
578 - (void)enableHeartbeatWithInterval:(NSTimeInterval)interval;
579 
583 - (void)disableHeartbeat;
584 
593 - (void)enableLiveImageWithFormat:(CDMImageFormat)imageFormat imageSize:(CDMImageSize)imageSize imageQuality:(CDMImageQuality)quality callback:(void(^)(UIImage* image, CDMResponse* response))callback;
594 
598 - (void)disableLiveImage;
599 
600 @end
CDMConnectionState
Specifies the connection states, that the DataManSystem can have.
Definition: CDMDataManSystem.h:248
Use defaults (no overrides).
Definition: CDMDataManSystem.h:297
BOOL connect()
Connects to a remote system without authentication.
Definition: CDMDataManSystem.m:269
Definition: CDMDataManSystem.h:250
Represents a read image.
Definition: CDMDataManSystem.h:230
Represents a remote DataMan system.
Definition: CDMDataManSystem.h:335
When scanning starts, the preview is displayed but decoding is paused until a trigger (either the on ...
Definition: CDMDataManSystem.h:313
Represents a DMCC response sent by a remote system.
Definition: CDMResponse.h:35
Enables the simulated hardware trigger (the volume down button).
Definition: CDMDataManSystem.h:309
BOOL heartbeatEnabled
Read-only state of the heartbeat function.
Definition: CDMDataManSystem.h:361
id< CDMDataManSystemDelegate > delegate
Sets or gets the delegate where the messages will be sent to.
Definition: CDMDataManSystem.h:351
Represents code quality information in xml format.
Definition: CDMDataManSystem.h:242
CDMResultTypes resultTypes
Sets which result types the application wants to receive.
Definition: CDMDataManSystem.h:356
Low image quality for jpeg format.
Definition: CDMDataManSystem.h:180
Represent an image graphics xml.
Definition: CDMDataManSystem.h:234
BOOL connected
Read-only connection state of the system.
Definition: CDMDataManSystem.h:376
Image scaled down by 1/4.
Definition: CDMDataManSystem.h:161
CDMImageQuality
Image quality used when getting live image or process monitor images.
Definition: CDMDataManSystem.h:175
void disconnect()
Disconnects from the remote system.
Definition: CDMDataManSystem.m:316
Use mobile device front camera.
Definition: CDMDataManSystem.h:284
Definition: CDMDataManSystem.h:261
CDMPreviewOption
Controls the preview/scanning options when using the Mobile device camera.
Definition: CDMDataManSystem.h:292
Bitmap format.
Definition: CDMDataManSystem.h:199
Jpeg format.
Definition: CDMDataManSystem.h:203
CDMResultTypes
Specifies the result types, that the application can receive.
Definition: CDMDataManSystem.h:209
Represents training results in xml format.
Definition: CDMDataManSystem.h:238
High image quality for jpeg format.
Definition: CDMDataManSystem.h:188
Definition: CDMDataManSystem.h:252
Definition: CDMDataManSystem.h:251
Image scaled down by 1/16.
Definition: CDMDataManSystem.h:165
void disableHeartbeat()
Disables the heartbeat when enabled.
Definition: CDMDataManSystem.m:405
Definition: CDMDataManSystem.h:260
Use camera with a basic aimer (e.g., StingRay).
Definition: CDMDataManSystem.h:276
No results of any kind are requested from the reader.
Definition: CDMDataManSystem.h:214
Full sized image.
Definition: CDMDataManSystem.h:157
Definition: CDMDataManSystem.h:259
CDMImageSize
Image size.
Definition: CDMDataManSystem.h:152
Represents read statistics in xml format.
Definition: CDMDataManSystem.h:226
Use higher framerate if the device supports it.
Definition: CDMDataManSystem.h:329
Use camera with no aimer.
Definition: CDMDataManSystem.h:272
Image scaled down by 1/64.
Definition: CDMDataManSystem.h:169
Affects only kCDMCameraModeActiveAimer, reads the settings from the ActiveAimer after the app has bee...
Definition: CDMDataManSystem.h:321
Definition: CDMDataManSystem.h:249
CDMImageFormat
Indicates the image format type for live displays or process monitor images.
Definition: CDMDataManSystem.h:194
Represents a read result in xml format.
Definition: CDMDataManSystem.h:222
BOOL liveImageEnabled
Read-only state of live image mode.
Definition: CDMDataManSystem.h:366
Represents a simple read result string.
Definition: CDMDataManSystem.h:218
CDMConnectionState connectionState
Gets the current connection state of the CDMDataManSystem instance.
Definition: CDMDataManSystem.h:345
NSTimeInterval timeout
Timeout for commands and connection, default value is 5 sec.
Definition: CDMDataManSystem.h:371
Use higher resolution if the device supports it.
Definition: CDMDataManSystem.h:325
Medium image quality for jpeg format.
Definition: CDMDataManSystem.h:184
Disable illumination (removes illumination button from preview).
Definition: CDMDataManSystem.h:305
void disableLiveImage()
Stops a pending live image retrieval operation.
Definition: CDMDataManSystem.m:434
DataManDeviceClass deviceClass
Gets the device type of the CDMDataManSystem instance.
Definition: CDMDataManSystem.h:340
DataManDeviceClass
Specifies the device types of a CDMDataManSystem instance.
Definition: CDMDataManSystem.h:258
CDMCameraMode
Specifies the preview/illumination mode when using the Mobile device camera.
Definition: CDMDataManSystem.h:267
NSString * getVersion()
Returns the current version of the library.
Definition: CDMDataManSystem.m:66
Use camera with an active aimer (e.g., MX-100).
Definition: CDMDataManSystem.h:280
Disable zoom feature (removes zoom button from preview).
Definition: CDMDataManSystem.h:301
Force the preview to be displayed, even if off by default (e.g., when using kCDMCameraModePassiveAime...
Definition: CDMDataManSystem.h:317