收藏
回答

向低功耗设备写入数据,蓝牙打印机未打印返回写入成功 纯血鸿蒙?ios与安卓没有问题

// 写入蓝牙打印机

function writeBLECharacteristicValue(buffer) {

  return new Promise((resolvereject=> {

    const deviceId = printer.deviceId;

    serviceId = serviceId;

    const characteristicId = findList[0].uuid;

    uni.writeBLECharacteristicValue({

      deviceId,

      serviceId,

      characteristicId,

      value: buffer,

      success: (res=> {

        console.log("写入成功"JSON.stringify(res));

        resolve(res);

      },

      fail: (e=> {

        console.log("写入失败"JSON.stringify(e));

        reject(e);

      },

    });

  });

}

链接成功写入成功,但是蓝牙打印机没有打印,点击蓝牙打印测试,安卓和ios没有问题,仅存在于鸿蒙

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    2025-11-21
    有用
登录 后发表内容