Hi,
We are building a Xamarin Android application using the Zebra.Printer.SDK nuget package. And also following the Zebra XamarinDevDemo project on github.
When discovering a printer over Ethernet (NetworkDiscoverer.FindPrinters(discoveryHandler)), the DiscoveryDataMap property for the discovered printer (i.e. Zebra.Sdk.Printer.Discovery.DiscoveredPrinter) includes the following properties:
LABEL_LENGTH
LABEL_WIDTH
This is very useful since these properties can be used as default properties for the printable media size. They are accurate and always reflect the media in the printer.
However when discovering a printer over Bluetooth (i.e. Zebra.Sdk.Printer.Discovery.BluetoothDiscoverer.FindPrinters), the LABEL_LENGTH and LABEL_WIDTH properties are NOT returned in the DiscoveryDataMap property. Only MAC_ADDRESS and FRIENDLY_NAME are returned - nothing else.
Is this expected? Is there any way to read the LABEL_LENGTH and LABEL_WIDTH properties for a printer discovered over Bluetooth?
Thanks
2 Replies
When using the network discovery, the printer responds to the probe of the network discovery packet with a lot more printer settings, including the label length and width. Unlike the network discovery, the Bluetooth discovery is done by scanning the Bluetooth broadcast message from the printer, of which the message is limited to the Bluetooth's friendly name and MAC address, due to the specification limitation of the Bluetooth broadcast message.
Once the application has the Bluetooth friendly name or the MAC address, the application can open the Bluetooth connection to the printer. Then it can retrieve the printer settings or configurations through the SDG.GET() API. For example, to retrieve the settings of the label length and width, we can use the code below. With the SGD.GET() API, we can retrieve many other printer settings and configurations.
Thank you SSi1, your solution worked perfectly.