LinkOS with Xamarin and VS2015

C Chris Dafnis 3 years 6 months ago
3 2 0

Hi,
 
I'm writing a C# app to connect to a bluetooth printer and print labels off.
As part of this, I want to save the connected printer to an XML file, so that we can connect to it on subsequent runs without having to rediscover.
 
I've happily extracted the IDiscoveredPrinter details and saved them, and can read them back out again, but I am having problems recreating the printer.
I can create a DiscoveredPrinter, or DiscoveredPrinterBluetooth, but I cannot create or cast the relevant instances.
 
Any help please.
 
Thanks, Chris

Please Register or Login to post a reply

2 Replies

t tok yanru

first time posting.
can i check if there are any solution for this problem?
im trying to save instance IDiscoveredPrinter into database so that user do not have to Scan,Select, Print each time the user wants to print.
private async void SelectPrinterView_OnPrinterSelected(IDiscoveredPrinter printer){}

E Efkan YILMAZ

Hi Chris,
Using the SDK, I would recommend saving the IDiscoveredPrinter.Address to your file.  Then you can use:
IConnection connection = ConnectionBuilder.Current.Build("BT:" + address);
To create a new Bluetooth connection.
Robin

CONTACT
Can’t find what you’re looking for?