The function(esp_ble_gatts_set_attr_value) can not change attr_value.It returns OK,but when i use " esp_ble_gatts_get_attr_value",i found that the value has no change.And i have set "ESP_GATT_RSP_BY_APP".
My code:
Code: Select all
case ESP_GATTS_WRITE_EVT: {
ESP_LOGI(UPDATE_GATTS_TAG, "GATT_WRITE_EVT, conn_id %d, trans_id %d, handle %d\n", param->write.conn_id, param->write.trans_id, param->write.handle);
ESP_LOGI(UPDATE_GATTS_TAG, "GATT_WRITE_EVT, value len %d, value %08x\n", param->write.len, *(uint32_t *)param->write.value);
LOG_ERROR("write value = %d\n",param->write.value[0]);
esp_ble_gatts_set_attr_value(param->write.handle,param->write.len,param->write.value);
esp_ble_gatts_send_response(gatts_if, param->write.conn_id, param->write.trans_id, ESP_GATT_OK, NULL);
break;
}