Zebra LinkOS Multiplatform SDK for Xamarin  1.1
Link-OS Portable Class Library Plugin for Xamarin
LinkOS.Plugin.Abstractions.IFileUtil Interface Reference

This is an utility class for performing file operations on a device More...

Inheritance diagram for LinkOS.Plugin.Abstractions.IFileUtil:
LinkOS.Plugin.Abstractions.IZebraPrinter LinkOS.Plugin.ZebraPrinterImplementation

Public Member Functions

string [] RetrieveFileNames ()
 Retrieves the names of the files which are stored on the device. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use: More...
 
string [] RetrieveFileNames (string[] extensions)
 Retrieves the names of the files which are stored on the device. This method only returns files which have one of the extensions in extensions. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use: More...
 
void SendFileContents (string filePath)
 Sends the contents of a file to the device. More...
 

Detailed Description

This is an utility class for performing file operations on a device

See IPrinterStatus for PreCheckPrinterStatus() and PostPrintCheckStatus() code.
See IConnection for CheckPrinterLanguage() code.

using LinkOS.Plugin;
public void SendFile()
{
IConnection connection = ConnectionBuilder.Current.Build("TCP:192.168.1.100:9100");
try
{
connection.Open();
if (!CheckPrinterLanguage(connection))
return;
if (!PreCheckPrinterStatus(connection))
return;
IZebraPrinter printer = ZebraPrinterFactory.Current.GetInstance(connection);
printer.SendFileContents(@"/Documents/SAMPLE.FMT");
PostPrintCheckStatus(connection);
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("Exception:" + e.Message);
}
finally
{
if (connection.IsConnected)
connection.Close();
}
}

Member Function Documentation

◆ RetrieveFileNames() [1/2]

string [] LinkOS.Plugin.Abstractions.IFileUtil.RetrieveFileNames ( )

Retrieves the names of the files which are stored on the device. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use:

IConnection.SendAndWaitForResponse("! U1 getvar \"file.dir\"\r\n", 3000, 1000); or IConnection.SendAndWaitForResponse("^XA^HWE:*.*^XZ", 3000, 1000);

Returns
list of file names

Implemented in LinkOS.Plugin.ZebraPrinterImplementation.

◆ RetrieveFileNames() [2/2]

string [] LinkOS.Plugin.Abstractions.IFileUtil.RetrieveFileNames ( string []  extensions)

Retrieves the names of the files which are stored on the device. This method only returns files which have one of the extensions in extensions. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use:

IConnection.SendAndWaitForResponse("! U1 getvar \"file.dir\"\r\n", 3000, 1000); or IConnection.SendAndWaitForResponse("^XA^HWE:*." + extension + "^XZ", 3000, 1000);

Parameters
extensionsthe extensions to filter on
Returns
list of file names.

Implemented in LinkOS.Plugin.ZebraPrinterImplementation.

◆ SendFileContents()

void LinkOS.Plugin.Abstractions.IFileUtil.SendFileContents ( string  filePath)

Sends the contents of a file to the device.

Parameters
filePaththe full file path (e.g. "/storage/sdcard1/Download/sample.lbl").

Implemented in LinkOS.Plugin.ZebraPrinterImplementation.


The documentation for this interface was generated from the following file: