espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.34k stars 1.57k forks source link

Smartconfig does not provide a method to get airkiss random. (GIT8266O-260) #695

Open zebin-wu opened 5 years ago

zebin-wu commented 5 years ago

Environment

Problem Description

Because the project needs to get airkiss random to compose the broadcast package, but smartconfig does not provide a method to get airkiss random.

ESP32 esp-idf allows us to get random in the event, like this:

} else if (event_base == SC_EVENT && event_id == SC_EVENT_GOT_SSID_PSWD) {
        aks_log(LOG_INFO, "Got SSID and password");

        smartconfig_event_got_ssid_pswd_t *evt = (smartconfig_event_got_ssid_pswd_t *)event_data;
    struct al_aks_data *data = al_os_mem_calloc(sizeof(struct al_aks_data));
    if (!data) {
        aks_log(LOG_ERR, "alloc data error.");
        return;
    }
        memcpy(data->ssid.id, evt->ssid, sizeof(evt->ssid));
        memcpy(data->password, evt->password, sizeof(evt->password));
    data->ssid.len = strlen((char *)evt->ssid);
extern u8 aks_random;
    aks_random = evt->token;

I would be grateful if esp8266 could provide an interface to get random as soon as possible.

xuhongv commented 5 years ago
zebin-wu commented 5 years ago

@xuhongv 我知道可以调用airkiss 的库,我之后的做法也是直接调用,只是说esp8266 中的smartconfig缺失这个有点遗憾

niurenyige commented 4 years ago

这个有更新吗?

zebin-wu commented 4 years ago

这个有更新吗?

不清楚,你可以找找airkiss的开源库