File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
ports/espressif/common-hal/wifi Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 16
16
#include "py/gc.h"
17
17
#include "py/mpstate.h"
18
18
#include "py/runtime.h"
19
- #include "py/objstr.h"
20
- #include "py/objint.h"
21
19
22
20
#include "components/esp_wifi/include/esp_wifi.h"
23
21
@@ -42,6 +40,8 @@ wifi_radio_obj_t common_hal_wifi_radio_obj;
42
40
#include "nvs_flash.h"
43
41
#endif
44
42
43
+ #define MAC_ADDRESS_LENGTH 6
44
+
45
45
static const char * TAG = "CP wifi" ;
46
46
47
47
static void schedule_background_on_cp_core (void * arg ) {
@@ -200,8 +200,8 @@ void common_hal_wifi_init(bool user_initiated) {
200
200
return ;
201
201
}
202
202
// set the default lwip_local_hostname
203
- char cpy_default_hostname [80 ];
204
- uint8_t mac [6 ];
203
+ char cpy_default_hostname [strlen ( CIRCUITPY_BOARD_ID ) + ( MAC_ADDRESS_LENGTH * 2 ) + 6 ];
204
+ uint8_t mac [MAC_ADDRESS_LENGTH ];
205
205
esp_wifi_get_mac (ESP_IF_WIFI_STA , mac );
206
206
sprintf (cpy_default_hostname , "cpy_%s_%x" , CIRCUITPY_BOARD_ID , (unsigned int )mac );
207
207
const char * default_lwip_local_hostname = cpy_default_hostname ;
You can’t perform that action at this time.
0 commit comments