Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG when transmition big data from host to esp32 var L2CAP layer (IDFGH-12886) #13847

Closed
3 tasks done
jankens opened this issue May 24, 2024 · 1 comment
Closed
3 tasks done
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@jankens
Copy link

jankens commented May 24, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

esp32 v5.1.3

Espressif SoC revision.

ESP32-pico

Operating System used.

Windows

How did you build your project?

Command line with Make

If you are using Windows, please specify command line type.

CMD

Development Kit.

ESP32-pico-mini-02

Power Supply used.

USB

What is the expected behavior?

I found a bug when using l2cap to communication for big data transimit.
here is the diff result:
void btc_l2cap_cb_handler(btc_msg_t *msg)
{
esp_bt_l2cap_cb_param_t param;
@@ -922,6 +923,7 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
}
}
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);

  •    post_bt_cradle_data_in();
       break;
    
    case BTA_JV_L2CAP_CONG_EVT:
    osi_mutex_lock(&l2cap_local_param.l2cap_slot_mutex, OSI_MUTEX_MAX_TIMEOUT);
    @@ -957,7 +959,7 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
    break; // to do disconnect
    }
    memset(p_data_buf, 0, count + sizeof(BT_HDR));
  •        p_data_buf->len = BTA_JvL2capRead(p_data->data_ind.handle, slot->id, p_data_buf->data, count);
    
  •        p_data_buf->len = BTA_JvL2capRead(p_data->l2c_read.handle, slot->id, p_data_buf->data, count);
           if (p_data_buf->len > 0) {
               fixed_queue_enqueue(slot->rx.queue, p_data_buf, FIXED_QUEUE_MAX_TIMEOUT);
           } else {
    

@@ -966,6 +968,7 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
}
}
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);

  •    post_bt_cradle_data_in();
       break;
    
    case BTA_JV_L2CAP_WRITE_EVT:
    osi_mutex_lock(&l2cap_local_param.l2cap_slot_mutex, OSI_MUTEX_MAX_TIMEOUT);

I think it should use p_data->l2c_read.handle instead of p_data->data_ind.handle for the BTA_JV_L2CAP_READ_EVT event
please confirm!!.
thanks

What is the actual behavior?

when transition big data from host to esp32. p_data_buf->len is negative number and data is wrong.

Steps to reproduce.

  1. Step
  2. Step
  3. Step
    ...

Debug Logs.

No response

More Information.

No response

@jankens jankens added the Type: Bug bugs in IDF label May 24, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label May 24, 2024
@github-actions github-actions bot changed the title BUG when transmition big data from host to esp32 var L2CAP layer BUG when transmition big data from host to esp32 var L2CAP layer (IDFGH-12886) May 24, 2024
@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels May 27, 2024
@xiongweichao
Copy link
Collaborator

Hi @jankens , Thank you for reporting the issue. You are right, we will fix this issue as soon as possible.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: In Progress Work is in progress labels May 31, 2024
espressif-bot pushed a commit that referenced this issue Jun 26, 2024
- Fixed the issue of using the wrong handle to handle the BTA_JV_L2CAP_READ_EVT event.
- Closes #13847
espressif-bot pushed a commit that referenced this issue Jun 26, 2024
- Fixed the issue of using the wrong handle to handle the BTA_JV_L2CAP_READ_EVT event.
- Closes #13847
espressif-bot pushed a commit that referenced this issue Jun 27, 2024
- Fixed the issue of using the wrong handle to handle the BTA_JV_L2CAP_READ_EVT event.
- Closes #13847
espressif-bot pushed a commit that referenced this issue Jul 31, 2024
- Fixed the issue of using the wrong handle to handle the BTA_JV_L2CAP_READ_EVT event.
- Closes #13847
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants