Cognex Mobile Barcode SDK
SDK for supporting communication with Cognex Barcode Reader devices
CMBReaderDevice.h
Go to the documentation of this file.
1//
2// CMBReaderDevice.h
3// MX_SDK_FW
4//
5// Created by Gyula Hatalyak on 09/01/17.
6// Copyright © 2017 Gyula Hatalyak. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <UIKit/UIKit.h>
11#import <cmbSDK/CMBReadResults.h>
12#import <cmbSDK/CDMDataManSystem.h>
13#import <CoreBluetooth/CoreBluetooth.h>
14
18typedef enum : NSUInteger {
40
44typedef enum : NSUInteger {
49
50@class CMBReaderDevice;
51
55typedef enum : NSUInteger {
65
69typedef enum : NSUInteger {
80
84@protocol CMBReaderDeviceDelegate <NSObject>
85
86@optional
87
92- (void)availabilityDidChangeOfReader:(CMBReaderDevice *_Nonnull)reader;
97- (void)connectionStateDidChangeOfReader:(CMBReaderDevice *_Nonnull)reader;
98
104- (void)didReceiveReadResultFromReader:(CMBReaderDevice *_Nonnull)reader results:(CMBReadResults *_Nonnull)readResults;
105
106@end
107
112@interface CMBReaderDevice : NSObject
113
117@property (readonly) DataManDeviceClass deviceClass;
118
125
132
136@property (readwrite) BOOL imageResultEnabled;
137
141@property (readwrite) BOOL SVGResultEnabled;
142
147@property (readwrite) CMBResultParser parser;
148
154
159@property (weak) id<CMBReaderDeviceDelegate> _Nullable delegate;
160
165+ (instancetype _Nonnull) readerOfMXDevice;
166
173+ (instancetype _Nonnull) readerOfBluetoothPeripheralUUID:(NSUUID *_Nonnull)peripheralUUID psm:(CBL2CAPPSM)psm API_AVAILABLE(ios(11));
174
181+ (instancetype _Nonnull) readerOfDeviceCameraWithCameraMode:(CDMCameraMode)cameraMode
182 previewOptions:(CDMPreviewOption)previewOptions;
183
191+ (instancetype _Nonnull) readerOfDeviceCameraWithCameraMode:(CDMCameraMode)cameraMode
192 previewOptions:(CDMPreviewOption)previewOptions
193 previewView:(UIView*_Nullable)previewContainer;
194
203+ (instancetype _Nonnull) readerOfDeviceCameraWithCameraMode:(CDMCameraMode)cameraMode
204 previewOptions:(CDMPreviewOption)previewOptions
205 previewView:(UIView*_Nullable)previewContainer
206 registrationKey:(NSString*_Nullable)registrationKey;
207
217+ (instancetype _Nonnull ) readerOfDeviceCameraWithCameraMode:(CDMCameraMode)cameraMode
218 previewOptions:(CDMPreviewOption)previewOptions
219 previewView:(UIView*_Nullable)previewContainer
220 registrationKey:(NSString*_Nullable)registrationKey
221 customData:(NSString*_Nullable)customData;
228- (void)setCameraPreviewContainer:(UIView*_Nullable) previewContainer completion:(void (^_Nullable)(NSError *_Nullable error))completionBlock;
229
235- (void)getCameraExposureCompensationRangeWithCompletion:(void (^_Nonnull)(NSArray<NSNumber *>*_Nullable range, NSError *_Nullable error))completionBlock;
236
242- (void)setCameraExposureCompensation:(float)exposureCompensation completion:(void (^_Nullable)(NSError * _Nullable error))completionBlock;
243
249- (void)loadCameraConfig:(void (^_Nullable)(NSError * _Nullable error))completionBlock;
250
255- (void) connectWithCompletion:(void (^_Nullable)(NSError *_Nullable error))completionBlock;
256
260- (void) disconnect;
261
265- (void) startScanning;
266
270- (void) stopScanning;
271
276- (void) getDeviceBatteryLevelWithCompletion:(void (^_Nonnull)(int batteryLevel, NSError * _Nullable error))completionBlock;
277
284- (void) setSymbology:(CMBSymbology)symbology
285 enabled:(bool)enabled
286 completion:(void (^_Nullable)(NSError *_Nullable error))completionBlock;
287
293- (void) isSymbologyEnabled:(CMBSymbology)symbology
294 completion:(void (^_Nonnull)(BOOL enabled, NSError *_Nullable error))completionBlock;
295
301- (void) setLightsON:(bool)on completion:(void (^_Nonnull)(NSError *_Nullable error))completionBlock;
302
307- (void) getLightsStateWithCompletion:(void (^_Nonnull)(BOOL enabled, NSError *_Nullable error))completionBlock;
308
313- (void) resetConfigWithCompletion:(void (^_Nonnull)(NSError *_Nullable error))completionBlock;
314
318- (void) beep;
319
325
326@end
CDMCameraMode
Specifies the preview/illumination mode when using the Mobile device camera.
Definition: CDMDataManSystem.h:143
CDMPreviewOption
Controls the preview/scanning options when using the Mobile device camera.
Definition: CDMDataManSystem.h:164
DataManDeviceClass
Specifies the device types of a CDMDataManSystem instance.
Definition: CDMDataManSystem.h:132
CMBReadStringEncoding
Possible values of Read String encoding for CMBReaderDevice.
Definition: CMBReaderDevice.h:69
@ CMBReadStringEncodingUS_ASCII_SHOW_NON_PRINTABLE
Definition: CMBReaderDevice.h:78
@ CMBReadStringEncodingAuto
Definition: CMBReaderDevice.h:70
@ CMBReadStringEncodingShift_JIS
Definition: CMBReaderDevice.h:76
@ CMBReadStringEncodingUTF_8
Definition: CMBReaderDevice.h:71
@ CMBReadStringEncodingUTF_16
Definition: CMBReaderDevice.h:72
@ CMBReadStringEncodingUS_ASCII
Definition: CMBReaderDevice.h:77
@ CMBReadStringEncodingISO_8859_1
Definition: CMBReaderDevice.h:74
@ CMBReadStringEncodingUTF_32
Definition: CMBReaderDevice.h:73
@ CMBReadStringEncodingISO_8859_2
Definition: CMBReaderDevice.h:75
CMBReaderAvailibility
Enum values for CMBReaderDevice availability.
Definition: CMBReaderDevice.h:44
@ CMBReaderAvailibilityUnavailable
Definition: CMBReaderDevice.h:47
@ CMBReaderAvailibilityUnknown
Definition: CMBReaderDevice.h:45
@ CMBReaderAvailibilityAvailable
Definition: CMBReaderDevice.h:46
CMBResultParser
Enum values for CMBReaderDevice parser.
Definition: CMBReaderDevice.h:55
@ CMBResultParserAAMVA
Definition: CMBReaderDevice.h:58
@ CMBResultParserHIBC
Definition: CMBReaderDevice.h:60
@ CMBResultParserGS1
Definition: CMBReaderDevice.h:59
@ CMBResultParserAuto
Definition: CMBReaderDevice.h:57
@ CMBResultParserNone
Definition: CMBReaderDevice.h:56
@ CMBResultParserSCM
Definition: CMBReaderDevice.h:63
@ CMBResultParserIUID
Definition: CMBReaderDevice.h:62
@ CMBResultParserISBT128
Definition: CMBReaderDevice.h:61
CMBConnectionState
Indicates the connection state of a CDMDataManSystem object.
Definition: CMBReaderDevice.h:18
@ CMBConnectionStateUnavailable
The CDMDataManSystem object's connection state is unavailable.
Definition: CMBReaderDevice.h:38
@ CMBConnectionStateConnected
The CDMDataManSystem object is connected to a remote system.
Definition: CMBReaderDevice.h:30
@ CMBConnectionStateDisconnecting
The CDMDataManSystem object is in the process of disconnecting from a remote system.
Definition: CMBReaderDevice.h:34
@ CMBConnectionStateConnecting
The CDMDataManSystem object is in the process of establishing a connection to a remote system.
Definition: CMBReaderDevice.h:26
@ CMBConnectionStateDisconnected
The CDMDataManSystem object is not connected to any remote system.
Definition: CMBReaderDevice.h:22
CMBSymbology
Enum values for supported barcode symbologies.
Definition: CMBSymbology.h:15
Represents a remote DataMan system.
Definition: CDMDataManSystem.h:211
Represents a list of read results.
Definition: CMBReadResults.h:16
Represents a Phone Camera or MX barcode reader.
Definition: CMBReaderDevice.h:113
void beep()
Plays a beep on the reader.
BOOL SVGResultEnabled
Enable or disable SVG image graphics results from reader.
Definition: CMBReaderDevice.h:141
DataManDeviceClass deviceClass
Tells the connection type of the CMBReaderDevice object.
Definition: CMBReaderDevice.h:117
CMBResultParser parser
Optionally set a CMBResultParser to be applied to a successful read result that is parsable with the ...
Definition: CMBReaderDevice.h:147
id< CMBReaderDeviceDelegate > _Nullable delegate
Delegate object to receive events from the CMBReaderDevice object.
Definition: CMBReaderDevice.h:159
void disconnect()
Disconnects from a connected barcode reader.
void startScanning()
Starts triggering.
CMBReaderAvailibility availability
Returns the availability of the reader.
Definition: CMBReaderDevice.h:124
CMBReadStringEncoding readStringEncoding
Set the CMBReadStringEncoding that is used to decode Read String from base64 result.
Definition: CMBReaderDevice.h:153
instancetype _Nonnull readerOfMXDevice()
Creates a CMBReaderDevice object for a connected MX barcode reader.
BOOL imageResultEnabled
Enable or disable image results from reader.
Definition: CMBReaderDevice.h:136
CMBConnectionState connectionState
Returns the current connection state of the reader.
Definition: CMBReaderDevice.h:131
void stopScanning()
Stops triggering.
CDMDataManSystem *_Nonnull dataManSystem()
Returns the DataManSystem instance for this CMBReaderDevice.
Delagate protocol for receiving events from a CMBReaderDevice object.
Definition: CMBReaderDevice.h:84