Represents a remote DataMan system.
More...
#import <CDMDataManSystem.h>
Represents a remote DataMan system.
◆ acceptIncomingConnection:
- (void) acceptIncomingConnection: |
|
(BOOL) |
accept |
|
Changes whether the DataMan system accepts incoming messages or not.
It does not effect an already connected device.
- Parameters
-
accept | Flag to signal whether the incoming connection is accepted or not |
◆ connect
Connects to a remote system without authentication.
@name Instance methods
◆ connectWithUsername:password:
- (BOOL) connectWithUsername: |
|
(NSString *_Nullable) |
username |
password: |
|
(NSString *_Nullable) |
password |
|
|
| |
Connects to a remote system, authenticating with the specified username and password.
If the password is specified but the username is not, the username will be "admin" by default.
- Parameters
-
username | the username for the authentication |
password | the password for the given user |
- Returns
- YES, if the system has successfully started the connection process. (it may return NO mostly with EA devices if the session can't be opened)
◆ dataManSystemOfExternalAccessoryWithDelegate:
Constructs a DataMan system with accessory connector.
To properly detect and connect to the device, be sure to declare UISupportedExternalAccessoryProtocols key with Cognex DMCC protocol (com.cognex.dmcc) item in Info.plist.
- Parameters
-
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system with external accessory connection configured or nil, if there is no supported accessory connected
- See also
- CDMDataManSystemDelegate
◆ dataManSystemWithAccessory:delegate:
Constructs a DataMan system with accessory connector.
To properly detect and connect to the device, be sure to declare UISupportedExternalAccessoryProtocols key with Cognex DMCC protocol (com.cognex.dmcc) item in Info.plist.
- Parameters
-
accessory | The EAAccessory object with information about the connected device |
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system with external accessory connection configured or nil, if the accessory is not a CDM device
- See also
- CDMDataManSystemDelegate
◆ datamanSystemWithBluetoothPeripheralUUID:psm:delegate:
+ (CDMDataManSystem *_Nonnull) datamanSystemWithBluetoothPeripheralUUID: |
|
(NSUUID *_Nonnull) |
peripheralUUID |
psm: |
|
(CBL2CAPPSM) |
psm |
delegate: |
|
(ios(11)) |
API_AVAILABLE |
|
|
| |
Constructs a DataMan system with a Bluetooth device.
You should first scan for a Bluetooth device or load its saved UUID to connect.
- Parameters
-
peripheralUUID | The UUID of the CBPeripheral object you want to connect to. |
psm | The default value is 192. |
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system using the Bluetooth device identified by peripheralUUID parameter
- See also
- CDMDataManSystemDelegate
◆ dataManSystemWithCameraMode:previewOptions:delegate:
Constructs a DataMan system with iOS camera.
To properly detect and connect to the device, be sure to declare NSCameraUsageDescription key with Cognex DMCC protocol (com.cognex.dmcc) item in Info.plist.
- Parameters
-
cameraMode | Check CDMCameraMode for possible values. |
previewOptions | Check CDMPreviewOption for possible values. |
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system using the devices built in camera
- See also
- CDMDataManSystemDelegate
◆ dataManSystemWithCameraMode:previewOptions:nullablePreviewView:delegate:
Constructs a DataMan system with iOS camera.
To properly detect and connect to the device, be sure to declare NSCameraUsageDescription key with Cognex DMCC protocol (com.cognex.dmcc) item in Info.plist.
- Parameters
-
cameraMode | Check CDMCameraMode for possible values. |
previewOptions | Check CDMPreviewOption for possible values. |
previewView | Camera preview will be attached on that view, can be null (in which case, camera preview will be in full screen). |
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system using the devices built in camera
- See also
- CDMDataManSystemDelegate
◆ dataManSystemWithCameraMode:previewOptions:nullablePreviewView:registrationKey:customData:delegate:
+ (CDMDataManSystem *_Nonnull) dataManSystemWithCameraMode: |
|
(CDMCameraMode) |
cameraMode |
previewOptions: |
|
(CDMPreviewOption) |
previewOptions |
nullablePreviewView: |
|
(UIView *_Nullable) |
previewView |
registrationKey: |
|
(NSString *_Nullable) |
registrationKey |
customData: |
|
(NSString *_Nullable) |
customData |
delegate: |
|
(id< CDMDataManSystemDelegate >_Nonnull) |
delegate |
|
|
| |
Constructs a DataMan system with iOS camera.
To properly detect and connect to the device, be sure to declare NSCameraUsageDescription key with Cognex DMCC protocol (com.cognex.dmcc) item in Info.plist.
- Parameters
-
cameraMode | Check CDMCameraMode for possible values. |
previewOptions | Check CDMPreviewOption for possible values. |
previewView | Camera preview will be attached on that view, can be null (in which case, camera preview will be in full screen). |
registrationKey | The license key for registering the camera scanner. |
customData | Custom string to be send to the licensing server for tracking purposes. |
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system using the devices built in camera
- See also
- CDMDataManSystemDelegate
◆ dataManSystemWithCameraMode:previewOptions:nullablePreviewView:registrationKey:delegate:
Constructs a DataMan system with iOS camera.
To properly detect and connect to the device, be sure to declare NSCameraUsageDescription key with Cognex DMCC protocol (com.cognex.dmcc) item in Info.plist.
- Parameters
-
cameraMode | Check CDMCameraMode for possible values. |
previewOptions | Check CDMPreviewOption for possible values. |
previewView | Camera preview will be attached on that view, can be null (in which case, camera preview will be in full screen). |
registrationKey | The license key for registering the camera scanner. |
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system using the devices built in camera
- See also
- CDMDataManSystemDelegate
◆ dataManSystemWithHostname:port:delegate:
Constructs a DataMan system with hostname and port.
This factory method constructs a new DataMan system with an ethernet connector configured inside.
- Parameters
-
hostname | The hostname of the remote system |
port | The port of the remote system |
delegate | The delegate where the messages will be sent to |
- Returns
- DataMan system with ethernet connection configured
- See also
- CDMDataManSystemDelegate
◆ enableHeartbeatWithInterval:
- (void) enableHeartbeatWithInterval: |
|
(NSTimeInterval) |
interval |
|
Enables heartbeat function and sets its interval.
- Parameters
-
interval | Specifies heartbeat interval in seconds |
◆ enableLiveImageWithFormat:imageSize:imageQuality:callback:
Begins getting the latest image from the connected remote system in live display mode.
- Parameters
-
imageFormat | Image format |
imageSize | Image size |
quality | Image quality |
callback | Callback block with image to be called when operation completes |
◆ getCameraExposureCompensationRangeWithCompletion:
- (void) getCameraExposureCompensationRangeWithCompletion: |
|
(void(^)(NSArray< NSNumber * > *_Nullable range, NSError *_Nullable error)) |
completionBlock |
|
Get camera exposure compensation range (0: lower value, 1: upper value, 2: step) in the completion block.
Camera must to be opened before
- Parameters
-
completionBlock | The block will contain an array with the minimum and maximum exposure values, or an error when used on connector other than the Phone Camera The camera needs to be started within cmbSDK at least once to get the camera exposure compensation range |
◆ getVersion
+ (NSString *_Nonnull) getVersion |
|
|
|
Returns the current version of the library.
- Returns
- current DataMan SDK version
◆ loadCameraConfig:
- (void) loadCameraConfig: |
|
(void(^)(NSError *_Nullable error)) |
completionBlock |
|
Load config from app data if exist Method is only supported for Phone Camera.
- Parameters
-
completionBlock | The block will contain an error when used on connector other than the Phone Camera |
◆ sendBatchCommands:completed:
- (BOOL) sendBatchCommands: |
|
(NSArray *_Nonnull) |
commands |
completed: |
|
(void(^)(void)) |
complete |
|
|
| |
Sends the specified commands array to the connected remote system.
- Parameters
-
commands | The array of commands to send to the remote system |
complete | A callback that will be called when all the commands are sent |
- Returns
- YES, if the system is connected and the command can be sent, NO otherwise
◆ sendCommand:
- (BOOL) sendCommand: |
|
(NSString *_Nonnull) |
command |
|
Sends the specified command to the connected remote system.
- Parameters
-
command | The command to send to the remote system |
- Returns
- YES, if the system is connected and the command can be sent, NO otherwise
◆ sendCommand:withCallback:
- (BOOL) sendCommand: |
|
(NSString *_Nonnull) |
command |
withCallback: |
|
(void(^)(CDMResponse *_Nonnull response)) |
callback |
|
|
| |
Sends the specified command to the connected remote system.
Code samples:
[
self.dataManSystem sendCommand:
@"TRIGGER ON" withCallback:^(
CDMResponse *response){
} else {
}
}];
#define DMCC_STATUS_NO_ERROR
Definition: CDMResponse.h:9
Represents a DMCC response sent by a remote system.
Definition: CDMResponse.h:37
[
self.dataManSystem sendCommand:
@"GET TRAINED-CODE.INFO" withCallback:^(
CDMResponse *response){
if ([response.payload isEqualToString:@"Untrained"]) {
} else {
}
}
}];
- Parameters
-
command | The command to send to the remote system |
callback | A callback that will be called when the command is completed |
- Returns
- YES, if the system is connected and the command can be sent, NO otherwise
◆ sendCommand:withData:timeout:expectBinaryResponse:callback:
- (BOOL) sendCommand: |
|
(NSString *_Nonnull) |
command |
withData: |
|
(NSData *_Nullable) |
data |
timeout: |
|
(NSTimeInterval) |
timeout |
expectBinaryResponse: |
|
(BOOL) |
expectBinaryResponse |
callback: |
|
(void(^)(CDMResponse *_Nonnull response)) |
callback |
|
|
| |
Sends the specified command to the connected remote system.
- Parameters
-
command | The command to send to the remote system |
data | Additional data to send to the remote system |
timeout | Timeout for the command |
expectBinaryResponse | Flag to signal if we expect binary response |
callback | A callback that will be called when the command is completed |
- Returns
- YES, if the system is connected and the command can be sent, NO otherwise
◆ setCameraExposureCompensation:completion:
- (void) setCameraExposureCompensation: |
|
(float) |
exposureCompensation |
completion: |
|
(void(^)(NSError *_Nullable error)) |
completionBlock |
|
|
| |
Sets the camera exposure compensation value.
- Parameters
-
exposureCompensation | Float value that will be set as exposure compensation |
completionBlock | The block will contain an error when used on connector other than the Phone Camera |
◆ setCameraPreviewContainer:completion:
- (void) setCameraPreviewContainer: |
|
(UIView *_Nullable) |
previewContainer |
completion: |
|
(void(^)(NSError *_Nullable error)) |
completionBlock |
|
|
| |
Sets the container where the camera preview will be placed.
- Parameters
-
previewContainer | The container where the camera preview will be placed. |
completionBlock | The block will contain an error when used on connector other than the Phone Camera Method is only supported for Phone Camera |
◆ defaultMDMAuthCredentials
- (MDMAuthCredentials* _Nullable) defaultMDMAuthCredentials |
|
readwritenonatomicassign |
Default credentials for MDM communication.
Credentials provided by managed app configuration will override this property per field basis.
◆ delegate
◆ MDMReportingEnabled
- (BOOL) MDMReportingEnabled |
|
readwritenonatomicassign |
Enables reporting properties of the connected MX device to an MDM system.
Default value is false.
The documentation for this class was generated from the following file: