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 1616#include "py/gc.h"
1717#include "py/mpstate.h"
1818#include "py/runtime.h"
19- #include "py/objstr.h"
20- #include "py/objint.h"
2119
2220#include "components/esp_wifi/include/esp_wifi.h"
2321
@@ -42,6 +40,8 @@ wifi_radio_obj_t common_hal_wifi_radio_obj;
4240#include "nvs_flash.h"
4341#endif
4442
43+ #define MAC_ADDRESS_LENGTH 6
44+
4545static const char * TAG = "CP wifi" ;
4646
4747static void schedule_background_on_cp_core (void * arg ) {
@@ -200,8 +200,8 @@ void common_hal_wifi_init(bool user_initiated) {
200200 return ;
201201 }
202202 // 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 ];
205205 esp_wifi_get_mac (ESP_IF_WIFI_STA , mac );
206206 sprintf (cpy_default_hostname , "cpy_%s_%x" , CIRCUITPY_BOARD_ID , (unsigned int )mac );
207207 const char * default_lwip_local_hostname = cpy_default_hostname ;
You can’t perform that action at this time.
0 commit comments