代码拉取完成,页面将自动刷新
同步操作将从 山野羡民/BTPrinter 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
显示消息短提示:
Bluetooth.showToast('提示语');
显示消息对话框:
Bluetooth.showAlert('提示语');
显示/关闭等待对话框:
Bluetooth.showProgress('提示语');
Bluetooth.closeProgress();
检查蓝牙是否开启:
if (Bluetooth.isBluetoothEnabled()) {
Bluetooth.showToast('蓝牙已打开');
} else {
Bluetooth.showToast('蓝牙未打开');
}
开启蓝牙:
Bluetooth.enableBluetooth();
关闭蓝牙:
Bluetooth.disableBluetooth();
打开蓝牙设置(配对):
Bluetooth.openBluetoothSettings();
获取已配对蓝牙设备:
var json = Bluetooth.getPairedDevice();
Bluetooth.showAlert(json);
[{"address":"DC:0D:30:60:A1:F3","name":"Printer001"},{"address":"54:DC:1D:57:7D:57","name":"cool1 dual"},{"address":"E4:F8:9C:66:5A:B6","name":"LIYUJIANG"}]
连接蓝牙打印机:
Bluetooth.connectPrinter('DC:0D:30:60:A1:F3');
打印测试:
var json = '{}';
Bluetooth.printPaper(json);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。