esp8266: Update for changes to mp_obj_str_get_data.
This commit is contained in:
parent
a9c8db07bd
commit
1145dd35f2
|
@ -97,7 +97,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp_active_obj, 1, 2, esp_active);
|
||||||
STATIC mp_obj_t esp_connect(mp_uint_t n_args, const mp_obj_t *args) {
|
STATIC mp_obj_t esp_connect(mp_uint_t n_args, const mp_obj_t *args) {
|
||||||
require_if(args[0], STATION_IF);
|
require_if(args[0], STATION_IF);
|
||||||
struct station_config config = {{0}};
|
struct station_config config = {{0}};
|
||||||
mp_uint_t len;
|
size_t len;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
|
||||||
if (n_args > 1) {
|
if (n_args > 1) {
|
||||||
|
@ -311,7 +311,7 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
|
||||||
}
|
}
|
||||||
case QS(MP_QSTR_essid): {
|
case QS(MP_QSTR_essid): {
|
||||||
req_if = SOFTAP_IF;
|
req_if = SOFTAP_IF;
|
||||||
mp_uint_t len;
|
size_t len;
|
||||||
const char *s = mp_obj_str_get_data(kwargs->table[i].value, &len);
|
const char *s = mp_obj_str_get_data(kwargs->table[i].value, &len);
|
||||||
len = MIN(len, sizeof(cfg.ap.ssid));
|
len = MIN(len, sizeof(cfg.ap.ssid));
|
||||||
memcpy(cfg.ap.ssid, s, len);
|
memcpy(cfg.ap.ssid, s, len);
|
||||||
|
@ -330,7 +330,7 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
|
||||||
}
|
}
|
||||||
case QS(MP_QSTR_password): {
|
case QS(MP_QSTR_password): {
|
||||||
req_if = SOFTAP_IF;
|
req_if = SOFTAP_IF;
|
||||||
mp_uint_t len;
|
size_t len;
|
||||||
const char *s = mp_obj_str_get_data(kwargs->table[i].value, &len);
|
const char *s = mp_obj_str_get_data(kwargs->table[i].value, &len);
|
||||||
len = MIN(len, sizeof(cfg.ap.password) - 1);
|
len = MIN(len, sizeof(cfg.ap.password) - 1);
|
||||||
memcpy(cfg.ap.password, s, len);
|
memcpy(cfg.ap.password, s, len);
|
||||||
|
|
Loading…
Reference in New Issue