General information
The MobileCapture class is the starting point for signoMobileCapture API. This class is responsible for Bonjour communication and provides suitable instances of the MobileDevice class for the mobile devices found.
MobileCapture %MOBILECAPTURE_NAME% = new MobileCapture();
SetLicenseKey method
This method is used to set the hardware-independent company licence key (if applicable). This unlocks various functions and removes the demo stamp.
If you have any questions regarding the acquisition of a licence key, please speak to your signotec contact.
static void SetLicenseKey(string licenseKey)
|
Parameter |
Description |
|---|---|
|
licenceKey |
A valid licence key for “signoAPI". |
Dispose method
In cases where the MobileCapture class is not instantiated via a “using” block, the Dispose method must be called as soon as the instance is no longer required.
As a result, the Bonjour service is stopped (if it has been running) and other cleanup operations are performed.
void Dispose()
StartService method
This method launches the Bonjour service. Once this has taken place, the respective events will be triggered for all located mobile devices and for any errors that may occur.
It is highly recommended that appropriate handlers are registered for all events in this class before running the service!
void StartService()
MobileDeviceFound event
This event is called whenever the current service locates a mobile device.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.MobileDeviceFound += new MobileDeviceFoundHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(Object sender, MobileDeviceEventArgs e);
The MobileDeviceEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
Device |
Found mobile device |
MobileDeviceLost event
This event is called whenever the current service can no longer contact a mobile device that it had previously located.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.MobileDeviceLost += new MobileDeviceFoundHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(Object sender, MobileDeviceEventArgs e);
The MobileDeviceEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
Device |
Mobile device no longer accessible |
BonjourError event
This event is called whenever one of the asynchronous Bonjour methods reports a specific error.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.BonjourError += new BonjourErrorHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, BonjourErrorEventArgs e);
The BonjourErrorEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
ErrorCode |
The error code reported by Bonjour |
MobileCaptureError event
This event is called whenever one of the current service’s asynchronous internal methods throws an exception.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.MobileCaptureError += new MobileCaptureErrorHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, MobileCaptureErrorEventArgs e);
The MobileCaptureErrorEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
Exception |
Exception |
The exception thrown by the internal method |