Ok...so this seems like it should be a super simple - I need to disable a symbol barcode scanner, do some work and then re-enable the scanner.
I have a scanner class which works fine so I tried the below code in my item look-up class
private Symbol.Barcode.Reader MyReader = Scanner.GetMyReader;//gets the reader
.....
......
private method()
{
MyReader.Actions.Disable();
...do some work here
MyReader.Actions.Enable()
}
The problem with the above code is the reader never seems to re-enable, esp. the laser light never comes back on and the read notify event never fires again.
I also tried MyReader.ReadNotify -= MyReader_ReadNotify; and then adding it back but this doesn't work either as the scanner still builds scan events when the scan button is hit.
I did try MyReader.Actions.Read(MyReaderData), this fired the read event again and still did not enable the scanner.
Is there something I need to add after MyReader.Actions.Enable() ?
I have searched for hours with no luck on this problem.
Thanks
According to the Motorola EMDK guide you just need three methods and the event handlers in place:
QUOTE
Enable the reader
Enables the scanner hardware. This method does not make the scanner scan or turn on the laser.
Submit a read request
Starts a pending read. The method will not turn on the laser. It will, however, put the scanner in a state in which the laser can be turned on either by pressing a hardware trigger or by performing assoftware trigger.
Even though a read request is submit and a successful read is complete, obtaining data needs an event handler. Please refer Registering to to scanner notifications sections for creating event handlers.
Disable the reader
Disables the scanner hardware. Reverses the Enable process. The scanner must be re-enabled before its use if it has been disabled.
NOTE: When disabling the reader, the following must be considered regarding notification handlers. For information on notifications, refer to the section "Registering to scanner notifications".
/QUOTE
That means you have to use:
and
and re-attach notification handlers. The scanner will then lit when you issue
Possibly you have to press the scan button to trigger the scanner to light up.