printPOSCommand

2022-06-22 09:55 更新

獲取當(dāng)前掃描到的所有外圍設(shè)備信息

printPOSCommand({params}, callback(ret,err))

params

{ msg: "" //pos命令以及需要打印的內(nèi)容連接的字符串 支持中文 }

callback(ret,err)

ret:

  • 類型:JSON對(duì)象
  • 內(nèi)部字段:

  1. {
  2. status: true //成功
  3. }

err:

  • 類型:JSON對(duì)象
  • 內(nèi)部字段:

  1. {
  2. msg: //錯(cuò)誤信息
  3. }

示例代碼

  1. var BluetoothPrinter = api.require('djyPrinter');
  2. BluetoothPrinter.printPOSCommand({
  3. msg:
  4. String.fromCharCode(29) + String.fromCharCode(33) + String.fromCharCode(17) + //字體放大
  5. String.fromCharCode(27) + String.fromCharCode(97) + String.fromCharCode(1) + //居中
  6. String.fromCharCode(10) +
  7. String.fromCharCode(10) +
  8. "零點(diǎn)美食城\n" +
  9. String.fromCharCode(29) + String.fromCharCode(33) + String.fromCharCode(0) + //字體放大
  10. String.fromCharCode(27) + String.fromCharCode(97) + String.fromCharCode(0) +
  11. "西紅柿雞蛋面" + "12元" + "\n" +
  12. String.fromCharCode(27) + String.fromCharCode(97) + String.fromCharCode(0) +
  13. String.fromCharCode(10) +
  14. "總計(jì)12元"
  15. + "\n"
  16. // + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"
  17. }, function (ret, err) {
  18. });

可用性

Android系統(tǒng)

可提供的1.0.0及更高版本

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)