首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从TM-P60II打印时,Epson ePos sdk错误

从TM-P60II打印时,Epson ePos sdk错误
EN

Stack Overflow用户
提问于 2014-04-01 02:57:32
回答 1查看 1.7K关注 0票数 5

我正在使用爱普生ePOS软件开发工具包从iOS打印到TM-P60II。我可以连接和打印,但只有一两次。在尝试了一两次之后,我得到了一个超时错误,然后必须重新启动应用程序才能再次打印。我已经在sdk中的示例中复制了错误,并在手册中的p37示例中复制了错误。关闭/释放打印机时看起来像是某种错误。我曾向他们的技术支持寻求帮助,但一个月后,我收到了4封电子邮件,但没有回复。(实际上,第一线的支持是好的。第二层是问题所在。)

我的问题是,有没有人经历过这种情况并开发了一种变通方法?我正在考虑尝试一下斑马iMZ220 (欢迎评论),但我已经走了90%的路了,我不想从头开始。

谢谢!

下面是p37示例的外观:

更新:与爱普生联系,发现这是一个已知的iOS 7.1错误。目前还没有确切的消息。

UPDATE2:新的sdk发布...还是不管用。但是,如果您在单独的队列中启动它,这似乎可以解决问题。当队列自动释放时,未释放的打印机项目将随其一起释放。更好的做法是,如果我没有造成内存泄漏的话。

UPDATE3:代码见下文。是的没有打磨。请注意,PrinterUtils只是我的epson打印函数的包装器。欢迎任何评论和HTH。

代码语言:javascript
复制
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];
    }
}

//-解决方法

代码语言:javascript
复制
// 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];
    });
});
EN

回答 1

Stack Overflow用户

发布于 2014-07-22 01:08:33

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22769907

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档