DeviceRemoved()
Called by the OS when a device disconnects. You should track this event in persistent state variables.
DeviceUpdated()
Can be called by the OS when a device connects, so as with DeviceAdded(), you should have state transition code in place
to catch this. When this event occurs, you should recreate the scanning stack as follows:
•
BarcodeScanner
bcs = BarcodeScanner.CreateById();
•
ClaimedBarcodeScanner
• cbcs.EnableScanner();
• cbcs.SetActiveSymbologiesAsync( List<uint>symsToEnable );
• cbcs.SetActiveProfileAsync( List<string>profilesToEnable );
DeviceEnumCompleted()
Optional to track, but callback must be provided.
DetectorStopped()
Optional to track, but callback must be provided.
To register these callbacks, chain your support code to the events in the DeviceWatcher object.
To restore scanning when resuming, call
•
BarcodeScanner
bcs = BarcodeScanner.CreateById();
•
ClaimedBarcodeScanner
• cbcs.EnableScanner();
• cbcs.SetActiveSymbologiesAsync( List<uint>symsToEnable );
• cbcs.SetActiveProfileAsync( List<string>profilesToEnable );
B - 2
cbcs = bcs.ClaimScannerAsync();
cbcs = bcs.ClaimScannerAsync();