Hello,
I am trying to implement a streaming application using a DA14681 as the source and a DA14580 as the sink. The DA14681 is in Central role and the DA14580 is in Peripheral role. Sleep is disabled at both ends.
最终目标是将数据以约35kbps的数据速率传输到两个外围设备。我们已经在核心角色中成功完成了DA14580。由于各种原因,我们想在其位置使用DA14681。
The structure is essentially that of the Serial Port Service although the MTU and characteristic length has been increased to 325 and the flow control is currently unused. The connection interval is 40 ms and the slave latency is set to 0. Thus at each connection event, we need to transmit 177 bytes on average which includes a 2-byte header.
On the DA14681, I have enabled the notification for the BLE_EVENTEND via ble_event_notif_enable_end_event(). At each call, data is added to a ring-buffer - provided it was emptied previously. In the 'main' loop of the task a transmit routine is called which checks for data and successful completion of the previous write and then executes a ble_gattc_write_no_resp() and sets a tx_busy flag. The tx_busy flag is cleared when the BLE_EVT_GATTC_WRITE_COMPLETED event is caught thus allowing the next write to take place.
The problem I am seeing is that no more than about 73 bytes of data are transferred per connection interval. At higher payload sizes, it takes several Connection Events before the data is actually transferred. At the desired size of 177 bytes, it takes more than 4 CIs to transmit one packet.
It's not clear what I'm missing. Any help would be appreciated. Again, we have this working with a DA14580 at both ends so it does not appear to be a problem at the peripheral end.
作为次要问题,是否可以在DA14580上实现L2CAP COC?如果是这样,是否有任何代码?
谢谢,
Sandeep
------------
Hi Sandeep Sira,
Since the 580 doens't support the packet length extention or the CoCs, i assume that you application is using only the MTU exchange scheme in order to exchange data.
设备在连接间隔期间发送的数据量取决于中央允许外围设备发送的数据包,因此检查数据事务时是否交换了多少个数据包?(两端都发生在每个连接间隔中的73个字节的量,我假设由于您正在谈论通知,因此在外围设备发送数据时发生这种情况。事实上,在每个连接间隔中只看到73个字节的事实似乎有点奇怪,因为如果有MTU Exchange,则允许说3包然后应该转移的字节量应该是:每个通知包都适合27字节,第一个数据包将包括特定特性的ATT标题,并且L2CAP头和其余20个字节是有效载荷所以在3个数据包中,清洁有效载荷的量为20 + 27 + 27 = 74字节(其余分组具有27个有效载荷由于使用MTU Exchange,您可以保存数据包中的ATT和L2CAP头信息)。因此,即使堆栈不允许超过3个数据包信息的数量也应该是大约74个字节而不是73.现在,将发送多少个数据包,其一个中央的问题(这不是由SW控制的但是从堆栈)通常,连接间隔期间的数据包数量超过3,我认为在中央有一个配置指示中央的配置将保持每个事件连接它具有CE_MIN和CE_MAX,因此可能使用这些值强制您的中心限制在连接间隔期间可以接收的数据包量。
谢谢mt_dialog.
MT_Dialog,
Thank you for your detailed answer. The ce_min is set by default to 0 in ble_config.h. Changing it to 20 (12.5 ms), which is the default in the DA14580, solved the problem.
当然,提出了另一个问题。为什么CE_MIN的改变相关?似乎CE_MAX是控制参数。
Sandeep
-------------
Hi Sandeep Sira,
Both of the values ce_min and ce_max are relevant, based on those values the central decides the actual time that the central will keep a connection event alive, although the values are informative they provide the expected minimum and maximum length of the connection event. So i suppose that both of the values should be declared in order for the central to be aware how to allocate the time when more than one connection should be maintained and in order to save power. The fact that you ve changed the minimum value to a specific default forced the central to stay awake longer in order to listen to the peripheral for additional data.
谢谢mt_dialog.
Hello, Dialog experts.
I need to know if it possible to use DA14681 as central device and gather advertisement data?
一段时间后,使用USB CDC发送该数据。USB CDC我已经检查过,它正在工作。
How about gathering advertisement data?
Hi Sparta,
Could you please clarify your question in order to understand which your requirement is? As I am able to understand correctly from what you mentioned, you would like to have a central DA14681 connected with a DA14681 peripheral, so the peripheral will be sending data to the central, is that correct? This is possible and we have a reference design for this scope, named DSPS. Please check the link below:
//www.wsdof.com/products/dialog-serial-port-service-dsps
if you mean something else, please clarify your question/ I would kindly suggest you to create a new forum thread for your question. If you don’t know the procedure for creating a new forum thread, please let me know and I will provide you the appropriate guidelines.
谢谢,PM_DIALOG.