-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Resolution: DoneIssue is done internallyIssue is done internallyResolution: NAIssue resolution is unavailableIssue resolution is unavailableStatus: DoneIssue is done internallyIssue is done internally
Description
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.
General issue report
esp_gatt_value_t has a ESP_GATT_MAX_ATTR_LEN sized array to hold any potential response values.
esp-idf/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h
Lines 374 to 380 in 4f900ed
| typedef struct { | |
| uint8_t value[ESP_GATT_MAX_ATTR_LEN]; /*!< Gatt attribute value */ | |
| uint16_t handle; /*!< Gatt attribute handle */ | |
| uint16_t offset; /*!< Gatt attribute value offset */ | |
| uint16_t len; /*!< Gatt attribute value length */ | |
| uint8_t auth_req; /*!< Gatt authentication request */ | |
| } esp_gatt_value_t; |
This is unnecessary as in btc_gatts_arg_deep_copy this value gets deep copied anyway:
esp-idf/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gatts.c
Lines 85 to 94 in 4f900ed
| case BTC_GATTS_ACT_SEND_RESPONSE: { | |
| if (src->send_rsp.rsp) { | |
| dst->send_rsp.rsp = (esp_gatt_rsp_t *) osi_malloc(sizeof(esp_gatt_rsp_t)); | |
| if (dst->send_rsp.rsp) { | |
| memcpy(dst->send_rsp.rsp, src->send_rsp.rsp, sizeof(esp_gatt_rsp_t)); | |
| } else { | |
| BTC_TRACE_ERROR("%s %d no mem\n", __func__, msg->act); | |
| } | |
| } | |
| break; |
For esp_ble_gatts_send_response a pointer + length should be accepted rather than making a second copy.
Metadata
Metadata
Assignees
Labels
Resolution: DoneIssue is done internallyIssue is done internallyResolution: NAIssue resolution is unavailableIssue resolution is unavailableStatus: DoneIssue is done internallyIssue is done internally