Commit fcfd5f77 authored by Andrey's avatar Andrey

Default port is 9100

parent 8679f592
import 'package:esc_pos_printer/esc_pos_printer.dart';
main() {
Printer.connect('192.168.0.123', 9100).then((printer) {
Printer.connect('192.168.0.123').then((printer) {
printer.println('hello world :)');
printer.cut();
......
......@@ -26,8 +26,8 @@ class Printer {
///
/// The argument [timeout] is used to specify the maximum allowed time to wait
/// for a connection to be established.
static Future<Printer> connect(host, int port,
{sourceAddress, Duration timeout}) {
static Future<Printer> connect(host,
{int port = 9100, sourceAddress, Duration timeout}) {
return Socket.connect(host, port,
sourceAddress: sourceAddress, timeout: timeout)
.then((socket) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment