Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everybody,

I am currently writing an application for Panasonic's TOUGHPAD FZ-E1 and I have problems software triggering the barcode scanner. I know this is possible because the demo app that came with it does that.
My code is written in C# according to the Microsoft documentation provided here
https://msdn.microsoft.com/en-us/library/dn792056(v=winembedded.81).aspx[^]

The app crashes when I call this method:
private async void SoftwareTrigger_Click(object sender, RoutedEventArgs e)
{
    if (scanner.Capabilities.IsSoftwareTriggerSupported)
    {
        await claimedScanner.StartSoftwareTriggerAsync();
    }
}

The code compiles, but when I test it on device the app crashes saying that IsSoftwareTriggerSupported and StartSoftwareTriggerAsync() are not found.
I carefully followed all the steps in the documentation and I don't think I missed something.

If someone has any idea how to achieve my goal please let me know.

Thank you,
Raul
Posted
Comments
BillWoodruff 8-Feb-15 4:26am    
You need to confirm that this device supports those commands, or conforms to a standard where those commands are guaranteed to be supported. For that, you will need to consult the manufacturer's documentation and/or technical support.

Or, you might get lucky and find someone else on the web who has a fix for this.
[no name] 9-Feb-15 1:27am    
This is how you check if the software trigger is supported on the device
scanner.Capabilities.IsSoftwareTriggerSupported
The problem is that this crashes too and it shouldn't. It acts like the deploy operation does not copy the right assembly because at runtime the property does not exist.
Sinisa Hajnal 9-Feb-15 2:17am    
It acts as if your scanner variable is of the object type that does NOT have those methods and properties. Put a breakpoint and see runtime type - maybe you just have to cast generic IReader object to particular type.

Check the demo code if available and re-check the documentation.
[no name] 9-Feb-15 2:48am    
This happens before reading from the scanner.
The BarcodeScanner objects are the same (compile time and runtime). The BarcodeScannerCapabilities are different.

If I go to definition I see these properties

public sealed class BarcodeScannerCapabilities
{
public bool IsImagePreviewSupported { get; }
public bool IsSoftwareTriggerSupported { get; }
public bool IsStatisticsReportingSupported { get; }
public bool IsStatisticsUpdatingSupported { get; }
public UnifiedPosPowerReportingType PowerReportingType { get; }
}

At runtime IsSoftwareTriggerSupported is missing from my object. The capabilities object has only the other 4 properties

scanner = await BarcodeScanner.GetDefaultAsync();
BarcodeScannerCapabilities capabilities = (BarcodeScannerCapabilities)scanner.Capabilities;
Sinisa Hajnal 9-Feb-15 3:41am    
And what is runtime type of capabilities object? Does that differ? Also, ensure that you have latest libraries referenced in your References...it sometimes happens that you take one older library that doesn't support things that came later (obviously) - so check DLL versions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900