File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -827,8 +827,10 @@ static wifi_config_t wifi_config_sta = {
827827 */
828828static wifi_config_t wifi_config_ap = {
829829 .ap = {
830+ #ifdef ESP_WIFI_SSID
830831 .ssid = ESP_WIFI_SSID ,
831832 .ssid_len = ARRAY_SIZE (ESP_WIFI_SSID ) - 1 ,
833+ #endif
832834#ifdef ESP_WIFI_PASS
833835 .password = ESP_WIFI_PASS ,
834836 .authmode = WIFI_AUTH_WPA2_PSK ,
@@ -914,6 +916,15 @@ void esp_wifi_setup (esp_wifi_netdev_t* dev)
914916 }
915917
916918#if defined(MCU_ESP8266 ) || defined(MODULE_ESP_WIFI_AP )
919+ #ifdef ESP_WIFI_AP_PREFIX
920+ uint8_t mac [ETHERNET_ADDR_LEN ];
921+ esp_wifi_get_mac (ESP_MAC_WIFI_SOFTAP , mac );
922+ sprintf ((char * )wifi_config_ap .ap .ssid , "%s%02x%02x%02x%02x%02x%02x" ,
923+ ESP_WIFI_AP_PREFIX ,
924+ mac [0 ], mac [1 ], mac [2 ],
925+ mac [3 ], mac [4 ], mac [5 ]);
926+ wifi_config_ap .ap .ssid_len = strlen ((char * )wifi_config_ap .ap .ssid );
927+ #endif /* ESP_WIFI_AP_PREFIX */
917928 /* set the SoftAP configuration */
918929 result = esp_wifi_set_config (ESP_IF_WIFI_AP , & wifi_config_ap );
919930 if (result != ESP_OK ) {
Original file line number Diff line number Diff line change 4444/**
4545 * @brief SSID of the AP to be used.
4646 */
47- #ifndef ESP_WIFI_SSID
47+ #if !defined( ESP_WIFI_SSID ) && !defined( ESP_WIFI_AP_PREFIX )
4848#define ESP_WIFI_SSID "RIOT_AP"
4949#endif
5050
51+ /**
52+ * @brief Prefix to be used as part of the SSID (e.g.: RIOT_AP_aabbccddeeff)
53+ */
54+ #if !defined(ESP_WIFI_SSID ) && !defined(ESP_WIFI_AP_PREFIX )
55+ #define ESP_WIFI_AP_PREFIX "RIOT_AP_"
56+ #endif
57+
5158/**
5259 * @brief Passphrase used for the AP as clear text (max. 64 chars).
5360 */
You can’t perform that action at this time.
0 commit comments