We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use ESP-IDF, its version is ESP-IDF v5.0-dev-2332-ge498209ed2-dirty I try to assign a value to "peer->priv" in the following way
esp_now_peer_info_t *peer = malloc(sizeof(esp_now_peer_info_t)); if (peer == NULL) { ESP_LOGE(TAG, "Malloc peer information fail"); esp_restart(); } memset(peer, 0, sizeof(esp_now_peer_info_t)); peer->channel = CONFIG_ESPNOW_CHANNEL; peer->ifidx = ESPNOW_WIFI_IF; peer->encrypt = true; peer_data.heartbeat=111; peer_data.identity = 4; peer->priv=malloc(sizeof(espnow_peer_data_t)); memcpy(peer->priv,&peer_data,sizeof(espnow_peer_data_t)); memcpy(peer->lmk, CONFIG_ESPNOW_LMK, ESP_NOW_KEY_LEN); memcpy(peer->peer_addr, recv_cb.mac_addr, ESP_NOW_ETH_ALEN); ESP_ERROR_CHECK(esp_now_add_peer(peer));
the “espnow_peer_data_t” is my custom structure
typedef struct { uint8_t identity; uint32_t heartbeat; }espnow_peer_data_t;
I read the variables in the following way
esp_now_peer_info_t *peer_info; espnow_peer_data_t *peer_data_point; peer_info = malloc(sizeof(esp_now_peer_info_t)); esp_now_fetch_peer(true,peer_info); peer_data_point = (espnow_peer_data_t *)peer_info->priv; free(peer_info->priv);
The read value is incorrect and caused a restart due to the release of an incorrect memory
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use ESP-IDF, its version is ESP-IDF v5.0-dev-2332-ge498209ed2-dirty
I try to assign a value to "peer->priv" in the following way
the “espnow_peer_data_t” is my custom structure
I read the variables in the following way
The read value is incorrect and caused a restart due to the release of an incorrect memory
The text was updated successfully, but these errors were encountered: