SPS文件屏蔽一些数据后发送

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
Joffrey COFFINEAU
Offline
Last seen:2 years 11 months ago
加入:2017-06-30 09:08
SPS文件屏蔽一些数据后发送

Hi,

I add the SPS profile to BLE example ANCS to send data over TX attribute when button is pressed. I use the "sps_tx_data" function to send data.

The data is correctly receive on an android device connected to BLE. But after few transfers (not a fix number of send and not dependent of the number of byte sent) no more data are sent with the "sps_tx_data" function. The function "sps_tx_data" return before sending data because the function "get_tx_lenght" differ from 0.

The last sent before blocking, the tx done callback is called with 0 bytes sent. This is caused by an error in "handle_event_sent" function, the "get_tx_lenght" function return error because the function "generic_get_cmd" return BLE_ERROR_NOT_FOUND.

I found a temporary workaround : In function "sps_tx_data", i moved the call to function "set_tx_lenght" before the call of "send_tx_data".

This seems to be timing issue, do you have any clues of miss configurations that could lead to such error ?

Keywords:
Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
年代taff
加入:2015-06-08 11:34
Hi Joffrey COFFINEAU,

Hi Joffrey COFFINEAU,

I ve placed an internal ticket on that, the team is checking the issue.

Thanks MT_dialog

MT_dialog
Offline
Last seen:2 months 1 week ago
年代taff
加入:2015-06-08 11:34
Hi Joffrey COFFINEAU,

Hi Joffrey COFFINEAU,

The purpose of set_tx_length and get_tx_length is to store the length of last TX and to act as a flag indicating TX in progress. If you see get_tx_length always returns 0, it means that you are sending data much faster than the BLE speed. So try to lower your data rate or increase your BLE throughput, the issue should not happen.

You can adapt the position of these two API to send aggressively the TX data. Then the stack is at the risk of overloading.

Thanks MT_dialog