Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // When the app goes into the background the DidEnterBackground() function is called and it looks like this:
- public override void WillEnterForeground(UIKit.UIApplication application)
- {
- SAMISMPManager.SharedManager.BarcodeReader.PowerOn();
- SAMISMPManager.SharedManager.BarcodeReader.EnableTrigger(true);
- SAMISMPManager.SharedManager.BarcodeReader.EnableSymbology(eICBarCodeSymbologies.ICBarCode_QRCode, true);
- IBarcodeScanner.BarcodeScanned -= IBarcodeScanner_BarcodeScanned;
- // When the app goes into the foreground the WillEnterForeground() function is called and it looks like this:
- public override void DidEnterBackground(UIApplication application)
- {
- ExternalAccessoryManagement.sharedManager = SAMISMPManager.SharedManager;
- ExternalAccessoryManagement.sharedManager.Delegate = new MySamIsmpDelegate(this.ConnectionStatusChange);
- ExternalAccessoryManagement.sharedChannel = ICAdministration.SharedChannel as ICAdministration;
- ExternalAccessoryManagement.sharedChannel.Open();
- EFT.sharedChannel = ICAdministration.SharedChannel as ICAdministration;
- EFT.sharedChannel.Delegate = new MyICAdministrationStandAloneDelegate();
- NSMutableData transaction = new NSMutableData();
- var header = new byte[]{
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- };
- transaction.AppendBytes(header);
- var getLastTransactionCommand = BitConverter.GetBytes(2060);
- if (BitConverter.IsLittleEndian)
- Array.Reverse(getLastTransactionCommand); //reverse it so we get big endian.
- transaction.AppendBytes(getLastTransactionCommand);
- var dataLength = new byte[]{
- 0x00, 0x00, 0x00, 0x00,
- };
- transaction.AppendBytes(dataLength);
- bool result = sharedChannel.SendMessage(transaction);
- this.IEFT.OpenConnection();
- this.IBarcodeScanner = new BarcodeScanner(this.IEAManagement);
- this.IBarcodeScanner.OpenScannerConnection();
- IBarcodeScanner.BarcodeScanned += IBarcodeScanner_BarcodeScanned;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement