[UWP]蓝牙LE - 特征WriteWithoutResponse - 如何检查传输何时完成? [英] [UWP] Bluetooth LE - Characteristic WriteWithoutResponse - how to check when transfer is finished?

查看:1007
本文介绍了[UWP]蓝牙LE - 特征WriteWithoutResponse - 如何检查传输何时完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

为了在BLE上获得更多吞吐量,我想使用"WriteWithoutResponse"并发送以特征写入块分割的更大数据包。但如果我这样写:

To get more throughput on BLE I want to use a "WriteWithoutResponse" and send bigger data packets splitted up in chunks of characteristic writes. But if I make a write like this:

await Characteristics.Characteristic.WriteValueAsync(writeBuffer,GattWriteOption.WriteWithoutResponse);

await Characteristic.Characteristic.WriteValueAsync(writeBuffer, GattWriteOption.WriteWithoutResponse);

该方法立即返回并且做一些"魔术"在引擎盖下缓冲。我的api电话立即完成,但无线电转接仍在继续。


如果我执行"WriteWithResponse"只有在传输数据包并且传回响应时,该方法才会返回。但是使用"WriteWithoutResponse"我无法控制我的数据吞吐量。


等待任务完成似乎不是解决方案。

the method immediately returns and does some "magic" buffering under the hood. My api calls are finished immediately but the transfer over the air is still going on.
If I do a "WriteWithResponse" the method returns only when the packet is transfered and the response is transfered back. But with a "WriteWithoutResponse" I can not control my data throughput.
Waiting for the task to finish seems not to be a solution for this.

有没有人在这里有什么想法和如何ckeck转移是通过空气完成的吗?

这是一个错误还是这个?

Has anybody any Ideas whats going on here and how to ckeck when the transfer is finished over the air??
Is this a bug or is this wanted?

谢谢提前,

Joachim




推荐答案


嗨Joachim


这是例外行为。您可以参考

document
。作为其名称,WriteWithoutResponse是一种使用write而没有响应过程的写操作。所以你不知道这个过程什么时候结束。

This is excepted behavior. You could refer the document. As its name, WriteWithoutResponse is a kind of write operation that used write without response procedure. So you will not know when the process is finished.


< span style ="font-size:10.5pt; font-family:'Segoe UI',sans-serif;颜色:#454545; background:white">如果需要检查传输是否已完成,则可能需要使用WriteWithResponse 。


最好的问候,


Roy


这篇关于[UWP]蓝牙LE - 特征WriteWithoutResponse - 如何检查传输何时完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆