添加加密EFUSE的mac并发送到APP

This commit is contained in:
OPTOC
2025-10-23 18:39:07 +08:00
parent 793817d00e
commit 21b4e242a0
4 changed files with 144 additions and 3 deletions

View File

@@ -34,6 +34,11 @@ void sertrf_init(void)
//获取飞控代码地址
sertrf.fc_address = parse_hex_or_dec(FC_ADDRESS);
//获取加密后的efuse MAC 地址
if(!esp_efuse_mac_get_default_id(sertrf.efuse_mac))
{
sertrf_aes_ctr_encrypt(sertrf.efuse_mac, 6, sertrf.efuse_mac_encrypt);
}
//初始化环形buff
rb_init(&sertrf.data_handle_buffer, DATA_HANDLE_BUFFER_SIZE, sizeof(uint8_t));
@@ -146,7 +151,7 @@ void app_thread(void* arg)
strcpy(sertrf_stauct.wifi_ap_password, g_cfg_app->app_config_wifi_para.wifi_ap_password);
strcpy(sertrf_stauct.wifi_sta_ssid, g_cfg_app->app_config_wifi_para.wifi_sta_ssid);
strcpy(sertrf_stauct.wifi_sta_password, g_cfg_app->app_config_wifi_para.wifi_sta_password);
memcpy(sertrf_stauct.efuse_mac_encrypt, sertrf.efuse_mac_encrypt, 6);
resend_send_data(&sertrf.resend_device, RESEND_CMD_GET_PARAM, &sertrf_stauct, sizeof(sertrf_stauct_t), 1000);
sertrf.resend_device.handle_flag = 0;//标志位清零