【发布时间】:2016-10-17 10:44:52
【问题描述】:
我有一个应用程序,它使用Rongta RRP-200 移动打印机打印一些文本,通过蓝牙与我的手机连接。
为此,我正在使用这个插件:https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer
我可以将我的设备连接到打印机,甚至可以从我的应用程序中运行打印功能,这会返回一条消息,通知我数据已发送。然而,打印机什么也不做(除了它的灯亮着)。
这是尝试打印我的文本的函数(来自插件):
boolean printText(CallbackContext callbackContext, String msg) throws IOException {
try {
mmOutputStream.write(msg.getBytes());
// tell the user data were sent
//Log.d(LOG_TAG, "Data Sent");
callbackContext.success("Data Sent");
return true;
} catch (Exception e) {
String errMsg = e.getMessage();
Log.e(LOG_TAG, errMsg);
e.printStackTrace();
callbackContext.error(errMsg);
}
return false;
}
这里可能出了什么问题?
【问题讨论】:
标签: android cordova mobile printing bluetooth