Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @ogabrielinacio,
In one of my projects I need to check the BSSID of the WiFi networks of the scan results. I research the ESP32 firmware I am using and it seems ESP32 manage the BSSID internally in case it is required and ESP32 also seems to return the BSSID in the scan results.
Then I research a bit more and it seems the default behavior, so the ESP32 apparently always send the BSSID of each scanned network.
In the code of this package, it seems easy to implement the BSSID, because it is already available in the proto code and it seems correctly generated by you (take a quick lookup to the search results of "bssid".
Tasks
Get the
BSSID
in the scan resultsI think the first step must be to get the BSSID of a network in the scan results:
esp_provisioning_ble/lib/src/protos/wifi_scan.proto
Lines 31 to 37 in 58a268f
So it seems as easy as to add the
bssid
parameter in theWifiAP
mode and then decodeentry.bssid
in thescanResultResponse
method, where a network is added to the scan results.I already did this in the commit 1ad70dc of this PR.
Malformed UTF8
However, it seems the obtained
bssid
can't be decoded because of aFormatException
. For example, in one of my networks I am getting this[80, 145, 227, 205, 77, 243]
for theentry.bssid
and, when trying to decode it:What I think it is that I must be misunderstanding something, but I think you know better the internals of this package and how works the ESP32 provisioning, and maybe you see it and catch it!
Both,
ssid
andbssid
, seems to be the same type, a list of bytes that must be decoded according to the proto and according to the generateds files.I also check if it happens with one network, what could indicates a bad configuration of a specific network, or if it happens with any network. And it happens with any network.
Update:
I think I have made some progress!
utf8.decode
may not work because a BSSID is represented as a MAC, the bytes are representing a hexadecimal composition, as Wikipedia's article for MAC address describes:I decode manually one
bssid
I get from the log using:As it was just a test, I am going to develop a little decode function for this case and check how to implement the rest of the stuff in the package.
Update:
Issue solved, check the comment #15 (comment) and the commit 73af8bd.