【问题标题】:Epson ePos sdk error when printing from TM-P60II从 TM-P60II 打印时出现 Epson ePos sdk 错误
【发布时间】:2014-05-11 06:48:54
【问题描述】:

我正在使用 epson ePOS sdk 从 iOS 打印到 TM-P60II。我可以连接和打印,但只有一两次。一两次尝试后出现超时错误,然后必须重新启动应用程序才能再次打印。我已经用他们在 sdk 中的示例以及他们手册中 p37 的示例中复制了错误。关闭/释放打印机时看起来像某种错误。我已经向他们的技术支持寻求帮助,但 1 个月和 4 封电子邮件后没有回复。 (其实前线支持也不错,2级才是问题。)

我的问题是,有没有人经历过这种情况并开发了解决方法?我正在考虑改用 Zebra iMZ220(对此表示赞赏),但我已经完成了 90% 的工作,我不想从头开始。

谢谢!

p37 示例如下所示:

更新:已与 Epson 联系,结果发现这是 iOS 7.1 的一个已知错误。目前还没有关于修复的消息。

UPDATE2:新的 sdk 出...仍然无法正常工作。但是,如果您在似乎可以解决问题的单独队列中启动它。当队列自动释放时,未释放的打印机项目随之而来。无论如何,如果我不只是造成内存泄漏,那就更好的做法。

UPDATE3:代码见下文。是的,它没有抛光。请注意,PrinterUtils 只是我对 epson 打印功能的包装。欢迎任何 cmets 和 HTH。

id builder2 = [[EposBuilder alloc] initWithPrinterModel: @"TM-P60II" Lang: EPOS_OC_MODEL_ANK];
if (builder2 != nil) {
    errorStatus = EPOS_OC_SUCCESS;

    //Create a print document
    errorStatus = [builder2 addText: @"Hello,\t"];
    errorStatus = [builder2 addText: @"World!\n"];
    errorStatus = [builder2 addCut: EPOS_OC_CUT_FEED];

    //Initialize an EposBuilder class instance for confirmation
    id conBuilder2 = [[EposBuilder alloc] initWithPrinterModel: @"TM-P60II" Lang: EPOS_OC_MODEL_ANK];

    //Initialize an EposPrint class instance
    id printer2 = [[EposPrint alloc] init];
    unsigned long status;
    int connectionType = EPOS_OC_DEVTYPE_BLUETOOTH;
    if (printer2 != nil) {
        //<Start communication with the printer>
        errorStatus = [printer2 openPrinter:connectionType DeviceName:macAddress Enabled:EPOS_OC_FALSE Interval:EPOS_OC_PARAM_DEFAULT];

        //Send Data for confirmation
        errorStatus = [printer2 sendData:conBuilder2 Timeout:10000 Status:&status];

        if ((errorStatus = EPOS_OC_SUCCESS && (status & EPOS_OC_ST_OFF_LINE ) != EPOS_OC_ST_OFF_LINE) ) {
            //<Send print data>
            errorStatus = [printer2 sendData:builder2 Timeout:10000 Status:&status]; }

        //<End communication with the printer>
        errorStatus = [printer2 closePrinter];
    }
}

//------- 解决方法--------

// Busy Spinner
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
spinner.center = CGPointMake (self.view.bounds.size.width * 0.5F, self.view.bounds.size.height * 0.5F);
spinner.hidesWhenStopped = YES;
[self.view addSubview:spinner];
[spinner startAnimating];
spinner.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);

// Launch new queue
dispatch_queue_t myQueue = dispatch_queue_create("My Sync Queue",NULL);
dispatch_async(myQueue, ^{
    PrinterUtils *pu = [[PrinterUtils alloc] init];
    EposBuilder *builder = [pu getNewEposBuilder];
    EposPrint *printer = [pu getNewEposPrinter];
    [pu setPrintStyle:PRINTSTYLE_BODY2 eposBuilder:builder];
    [pu loadTextLine:@"bm print to tm-p60II" eposBuilder:builder];
    [pu print:builder eposPrint:printer ];
    [pu closePrinterConnection];

    dispatch_async(dispatch_get_main_queue(), ^{

        // Update the UI
        [spinner stopAnimating];
    });
});

【问题讨论】:

  • 天哪,我整天都在用头撞墙。感谢发帖!
  • 有人提出解决方案了吗?我们正在与爱普生合作解决此问题,但尚未收到他们的回复。
  • 好的,看到发送更新了。我会试试你的建议。

标签: ios printing bluetooth epson


【解决方案1】:

我的 P60II 也遇到了这个问题,最终打电话给爱普生。第一级支持将我送到第二级,他们说他们有固件更新。我通过并填写了他们通过电子邮件发送给我的表格,并在大约 30 分钟内获得了固件。更新似乎已经纠正了这个问题。我拨打的号码是 (562) 276-1314,我选择了开发人员支持。

【讨论】:

  • 这个问题已经有一个可行的解决方案,如果你有类似的问题,你不应该发布轶事。请阅读 SO 的帮助页面,了解如何提问。 :-)
  • @JoJoe 发布固件更新解决了问题并不是“轶事”。这是其他人可能会从中受益的有用信息,保罗甚至不厌其烦地附上了电话号码。恕我直言,是像你这样的人毁了我们其他人的 Stack Overflow。
猜你喜欢
  • 2015-08-09
  • 2014-01-19
  • 2018-11-18
  • 2020-11-15
  • 1970-01-01
  • 2018-04-23
  • 2020-06-04
  • 2016-01-13
  • 1970-01-01
相关资源
最近更新 更多