Code no longer works using Xamarin LinkOS to print to ZQ510 via Bluetooth on iPad

Hello,

 

We have a body of code that is running in the following environment:

 

  • C# / Xamarin / LinkOS_Xaramin_SDK version 1.1.75
  • Xcode 9.2
  • iPad running iOS 11.2.1
  • Printing via bluetooth to ZEBRA ZQ510

 

The method below deployed to a half-dozen developer iPads and was working from all of them up until a couple of weeks ago.  In the code below we try to access "printer.CurrentStatus" we are now getting the error "Error getting status: Malformed status response - unable to determine printer status"

 

That line previously worked but if we skip over that section and just go to connection.Write the code executes with-out error but it never prints (it used to print)

 

       // Before call this method we use DiscoveryHandlerFactory to discover a printer and use the following method to print to the connection. 

      // The attached screen shots show the connection object when we get to this method

        public void SendPrintCommandToBluetoothPrinterIfConnectedAndReadyToPrint(IConnection connection, string zplCommand)

        {

            try

            {

                if (!connection.IsConnected)

                    connection.Open();

 

                var printer = LinkOS.Plugin.ZebraPrinterFactory.Current.GetInstance(LinkOS.Plugin.Abstractions.PrinterLanguage.ZPL, connection);

 

                 // The line below now yields the error "Error getting status: Malformed status response - unable to determine printer status"

                if (!printer.CurrentStatus.IsReadyToPrint)

                {

                    var message = $"Printer is not ready for print.  Printer status is currently set to: {printer.CurrentStatus.Status}";

                    _logger.Warn(message);

                }

                else

                {

                     // Bluetooth communications must be handled on a separate thread and it's

                     // best practice to handle network coms on it as well

                     // If I skip the line that reads "printer.CurrentStatus.IsReadyToPrint" then I get to the line below and it executes with-out error but the printer does not print

                    // (I have tried with and with-out Task.Factory)

                     Task.Factory.StartNew(() => connection.Write(Encoding.ASCII.GetBytes(zplCommand)));

 

                     connection.Close();

                }

            }

            catch (Exception e)

            {

                _logger.Error($"An error occurred while trying to send the following command to the printer: {zplCommand}", e);

            }

            finally

            {

                connection?.Close();

            }

        }

 

I attached screen shots showing the connection object and also the exception itself.

 

Also on the iPad I downloaded Zebra Utilities app and was able to connect to and print to the printer so I believe the printer is working.

 

I also tried resetting the settings and re-configuring bluetooth with the following commands (which I can send via usb on pc)

! U1 do "device.restore_defaults" "bluetooth"

! U1 do "device.restore_defaults" "ip"

! U1 do "device.restore_defaults" "wlan"

! U1 do "device.restore_defaults" "power"

! U1 do "device.restore_defaults" "display"

 

! U1 setvar "bluetooth.enable" "on"

! U1 setvar "bluetooth.friendly_name" "BluePrinter"

! U1 setvar "bluetooth.discoverable" "on"

! U1 setvar "bluetooth.minimum_security_mode" "1"

! U1 setvar "bluetooth.bonding" "on"

! U1 setvar "bluetooth.enable_reconnect" "iOS_only"

! U1 setvar "bluetooth.le.controller_mode" "both"

! U1 setvar "bluetooth.le.minimum_security" "none"

! U1 do "device.reset" ""

 

 

I wanted to see if anyone knew of any recents changes that would have broken things or if I'm printing incorrectly and this shouldn't have worked to begin with?

 

Thanks in advance for any and all help you can give.