2

I am using Linea Pro 5 with iPod Touch 5. I develop iOS App under Xamarin in C#, under VS 2012.

My case is like this: I have screen A and screen B in my iOS App. In screen A, I want to allow the user to scan barcodes, but when he moves to screen B, I want to disable the scanner. Meaning, I want the option to scan only in one screen (screen A).

Here is what I did: My Linea device is declared as variable 'lineaDevice' of class type "Linea". I tried doing in screen A (when the screen is loading): lineaDevice.Connect(); and in screen B (when the screen is loading): lineaDevice.Disconnect();

It is work, the scanner is not function in screen B (the red light is even doesn't turned ON), but, the problem with this approach is that each time after calling to lineaDevice.Connect();, only the second click on the physical button of the Linea device, will actually turn ON the device (and its Red light) for scanning. Meaning, when the user moves back to screen A, he has to click 2 times on the physical button in order to start scanning.

I want it to be always "smooth" scan, on the first time.

Please let me know any ideas to "disable" the Linea in other screens. Meaning, nothing will happen in other screens when clicking on the physical Linea button, but it will be still connected for the moment the user will be back to screen A (where the Linea has to be connected).

Thanks in advance!

hmofaz
  • 21
  • 3

1 Answers1

3

setScanButtonMode

Sets Linea's scan button mode. This setting is not persistent and is best to configure it upon connect.

Syntax
-(void)setScanButtonMode:(int)mode;

Parameters mode,

BUTTON_DISABLED - Linea's button will become inactive
BUTTON_ENABLED - Linea's button will triger barcode scan when pressed

Return value

NSPortTimeoutException - if there is no connection to Linea
NSInvalidArgumentException if some of the input parameters are wrong

Hope, this will help you.

Muthu
  • 770
  • 5
  • 13