printPOSCommand
获取当前扫描到的所有外围设备信息
printPOSCommand({params}, callback(ret,err))
params
{ msg: "" //pos命令以及需要打印的内容连接的字符串 支持中文 }
callback(ret,err)
ret:
- 类型:JSON对象
- 内部字段:
{
status: true //成功
}
err:
- 类型:JSON对象
- 内部字段:
{
msg: //错误信息
}
示例代码
var BluetoothPrinter = api.require('djyPrinter');
BluetoothPrinter.printPOSCommand({
msg:
String.fromCharCode(29) + String.fromCharCode(33) + String.fromCharCode(17) + //字体放大
String.fromCharCode(27) + String.fromCharCode(97) + String.fromCharCode(1) + //居中
String.fromCharCode(10) +
String.fromCharCode(10) +
"零点美食城\n" +
String.fromCharCode(29) + String.fromCharCode(33) + String.fromCharCode(0) + //字体放大
String.fromCharCode(27) + String.fromCharCode(97) + String.fromCharCode(0) +
"西红柿鸡蛋面" + "12元" + "\n" +
String.fromCharCode(27) + String.fromCharCode(97) + String.fromCharCode(0) +
String.fromCharCode(10) +
"总计12元"
+ "\n"
// + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"
}, function (ret, err) {
});
可用性
Android系统
可提供的1.0.0及更高版本