How does wifi scan handle SSID with embedded NULL bytes?

hippo59
Posts: 3
Joined: Thu Dec 09, 2021 7:55 pm

How does wifi scan handle SSID with embedded NULL bytes?

Postby hippo59 » Sat Jul 02, 2022 4:47 pm

I believe this question was posted a while ago but I couldn't find any response ...

I'm using ESP-IDF version 4.4

IEEE 802.11 specifies that the WIFI SSID can be from 0-32 bytes with no restriction on the values. So, since it can contain zero valued bytes one cannot treat the SSID as a null terminated string. Rather, the SSID needs to be defined along the lines of

uint8_t ssid[32]
uint8_t ssid_length;

But the ESP32 wifi component stores the results of a scan in records of type wifi_ap_record_t where the SSID is simply defined as

uint8_t ssid[33]

and the wifi scan example code prints out the SSID assuming it's a string.

Are there any plans to fix this?

Thanks !!

Who is online

Users browsing this forum: No registered users and 28 guests