Commit fcfd5f77 authored by Andrey's avatar Andrey

Default port is 9100

parent 8679f592
import 'package:esc_pos_printer/esc_pos_printer.dart'; import 'package:esc_pos_printer/esc_pos_printer.dart';
main() { main() {
Printer.connect('192.168.0.123', 9100).then((printer) { Printer.connect('192.168.0.123').then((printer) {
printer.println('hello world :)'); printer.println('hello world :)');
printer.cut(); printer.cut();
......
...@@ -26,8 +26,8 @@ class Printer { ...@@ -26,8 +26,8 @@ class Printer {
/// ///
/// The argument [timeout] is used to specify the maximum allowed time to wait /// The argument [timeout] is used to specify the maximum allowed time to wait
/// for a connection to be established. /// for a connection to be established.
static Future<Printer> connect(host, int port, static Future<Printer> connect(host,
{sourceAddress, Duration timeout}) { {int port = 9100, sourceAddress, Duration timeout}) {
return Socket.connect(host, port, return Socket.connect(host, port,
sourceAddress: sourceAddress, timeout: timeout) sourceAddress: sourceAddress, timeout: timeout)
.then((socket) { .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