In swift based application, I have to implement barcode scanning using device camera as well as using Linea Pro 5 (LP5) external barcode scanner. In the application have to to check the iPhone connection state with Linea Pro 5 (LP5) device and if iPhone is not connected with LP5 then it must open iPhone camera otherwise it will scan using LP5. The scanning I have to do with any UIButton reside on the application screen.
My problem is that when I call connect() method the "func connectionState(state: Int32)" method call and iPhone connection state with LP5 change from Connecting to Connected then after I am able to scan using LP5 but when I perform scan another barcode the LP5 is not scanning and camera get open. Also when I scan wring barcode which is not expect then after rescan the device camera opens. It means connection state changed somehow. but each time "func connectionState(state: Int32)” not call.
Can anybody tell me how to check connection state of the LP5 device before each scan operation. Or tell me proper solution of the above problem.