LinePrinter.Open (string) Method
Opens a communications connection between the mobile computer and the printer. Use this method if the Port Type specified in the configuration file is COMx:, WPPORT, or SOCKET.
Syntax
[Visual Basic]
Public Function Open(portStr As string) As void
[C#]
public void Open(string portStr);
Parameters
portStr
If the Port Type specified in the configuration file is COMx: or WPPORT, this value is the new port that replaces the port specified in the configuration file.
If the Port Type specified in the configuration file is SOCKET, this value can be any of the following:
- "IRDA" - Use for IRDA connections to the first discovered IRDA device using default parameters.
- "IRDA:IRServiceName", where IRServiceName replaces the IRServiceName parameter in the configuration file. For most printers, use LSAP-SEL002 or IrDA:IrCOMM.
- An IP4 format, such as "192.68.1.100". Use this to connect to a Wi-Fi printer with the specified IP address. This value replaces ADDRESS in the configuration file if ADDRESS is specified.
- A Bluetooth address format, such as "00:02:5b:00:02:58". Use this to connect to a Bluetooth printer with the specified Bluetooth address. This value replaces ADDRESS in the configuration file if ADDRESS is specified.
Return Values
Void.
Remarks
Actions taken during Open include:
- Establish contact with printer.
- Send initialization sequence to printer.
- Reset font types to normal.
The portString parameter replaces the network address and port specified in the configuration file, allowing easier programmatic determination of the network printer target.
Exceptions
LinePrinterException
More Information
LinePrinter Class