esp_gatt_srvc_id_t srvc_id;
esp_gatt_id_t char_id;
esp_gatt_id_t descr_id;
- uint8_t value[ESP_GATT_MAX_ATTR_LEN];
+ uint8_t *value;
uint16_t value_type;
uint16_t value_len;
} read; /* ESP_GATTC_READ_CHAR_EVT */
esp_gatt_id_t char_id;
esp_gatt_id_t descr_id;
uint16_t value_len;
- UINT8 value[ESP_GATT_MAX_ATTR_LEN];
+ uint8_t *value;
bool is_notify;
} notify;
p_dest->read.value_len = p_src->p_value->unformat.len;
if ( p_src->p_value->unformat.len > 0 && p_src->p_value->unformat.p_value != NULL )
{
- memcpy(p_dest->read.value, p_src->p_value->unformat.p_value,
- p_src->p_value->unformat.len);
+ p_dest->read.value = p_src->p_value->unformat.p_value;
}
len += p_src->p_value->unformat.len;
}
param.notify.is_notify = (notify->is_notify == TRUE) ? true : false;
param.notify.value_len = (notify->len > ESP_GATT_MAX_ATTR_LEN) ? \
ESP_GATT_MAX_ATTR_LEN : notify->len;
- memcpy(¶m.notify.value, notify->value, param.notify.value_len);
- BTC_GATTC_CB_TO_APP(ESP_GATTC_NOTIFY_EVT, ¶m);
+ param.notify.value = notify->value;
if (notify->is_notify == FALSE) {
BTA_GATTC_SendIndConfirm(notify->conn_id, ¬ify->char_id);
}
+
+ BTC_GATTC_CB_TO_APP(ESP_GATTC_NOTIFY_EVT, ¶m);
break;
}
case BTA_GATTC_OPEN_EVT: {