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

AP_HAL_ESP32: use correct unformatted system ID length #27540

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions libraries/AP_HAL_ESP32/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,13 @@ bool Util::get_system_id(char buf[50])

bool Util::get_system_id_unformatted(uint8_t buf[], uint8_t &len)
{
len = MIN(12, len);


uint8_t base_mac_addr[6] = {0};
esp_err_t ret = esp_efuse_mac_get_custom(base_mac_addr);
if (ret != ESP_OK) {
ret = esp_efuse_mac_get_default(base_mac_addr);
}

len = MIN(len, ARRAY_SIZE(base_mac_addr));
memcpy(buf, (const void *)base_mac_addr, len);

return true;
Expand Down
Loading