蓝牙发送经常处于GATTC_SERVER_BUSY状态是怎么回事?

6 posts / 0 new
Last post
魏文彬
Offline
Last seen: 1 year 2 weeks ago
Joined: 2019-04-10 03:51
蓝牙发送经常处于GATTC_SERVER_BUSY状态是怎么回事?

你好,请问下我在用DA14682蓝牙大量数据长时间持续发送数据的时候。前面20分钟正常。20分钟后遇到函数返回的BLE_ERROR_BUSY状态,且每次发送数据都会遇到。请问这是怎么回事?

我用的demo是ble_sps_peripheral

问题出现在函数:ble_gatts_send_event里的ble_mgr_gatts_send_event_cmd_handler里的BLE_ERROR_BUSY

        /* Check if GATT controller is busy */
        if ( ke_state_get(KE_BUILD_ID(TASK_GATTC, cmd->conn_idx)) & GATTC_SERVER_BUSY ) {
                ret = BLE_ERROR_BUSY;
                goto done;
        }

我每次蓝牙发送数据前会检查上一次蓝牙发送数据时候完成。若上一次蓝牙发送完成这次发送才能开始。

 

 

Device: 
PM_Dialog
Offline
Last seen: 7 months 1 week ago
Staff
Joined: 2018-02-08 11:03
Hi There,

Hi There,

This is our English forum and customers posts their question in English. So, please try to translate your question in English. Otherwise, I would suggest you to post your question in our Chinese forums.

Thanks, PM_Dialog

魏文彬
Offline
Last seen: 1 year 2 weeks ago
Joined: 2019-04-10 03:51
OK

OK

Hello, may I ask when I use the DA14682 Bluetooth large amount of data to continuously send data for a long time. The first 20 minutes are normal. After 20 minutes, the BLE_ERROR_BUSY state returned by the function is encountered. May I ask how is This going?

The demo I use is ble_sps_peripheral

The problem occurs in the function ble_gatts_send_event ble_mgr_gatts_send_event_cmd_handler BLE_ERROR_BUSY

        /* Check if GATT controller is busy */
        if ( ke_state_get(KE_BUILD_ID(TASK_GATTC, cmd->conn_idx)) & GATTC_SERVER_BUSY ) {
                ret = BLE_ERROR_BUSY;
                goto done;
        }

 

Every time I send data to Bluetooth, I will check when the last Bluetooth data is sent. This can only be started if the last Bluetooth transmission was completed.

PM_Dialog
Offline
Last seen: 7 months 1 week ago
Staff
Joined: 2018-02-08 11:03
Hi There,

Hi There,

Thanks for translating your question into English. As you correctly mentioned, the BLE_ERROR_BUSY one of the possible errors that are returned by the ble_gatts_send_event(). The BLE_ERROR_BUSY indicates that the GATT controller is busy because it's handling other commands. If indications are sent one after the another in quick succession this is likely to happen. In that case, commands are put in a queue and are handled at a later time by the BLE manger. BLE manager has it's own queue for that purpose. You can check the flow for handling notification commands/events in ble_mgr_gatts.c source file.

Thanks, PM_Dialog

song
Offline
Last seen: 11 months 1 day ago
Joined: 2016-04-14 09:49
I had the same problem with

I had the same problem with the SDK upgrade to 1.0.14.1081, while version 1.0.8.1050 is normal.

PM_Dialog
Offline
Last seen: 7 months 1 week ago
Staff
Joined: 2018-02-08 11:03
Hi Song,

Hi Song,

Did you use any of our SDK examples and you had this issue with the latest SDK?

Thanks, PM_Dialog