bugfix and additional functionality for Wifi.cpp #114
Conversation
squonk11
commented
Nov 5, 2019
- bugfix for Wifi::get_mac_address() which now returns the right mac address of the used interface
- added Wifi:: get_local_mac_address(uint8_t m[6]) for getting the binary representation of the mac address
- added Wifi::get_local_ip() for getting the IP address of the ESP32
…address of the used interface - added Wifi:: get_local_mac_address(uint8_t m[6]) for getting the binary representation of the mac address - added Wifi::get_local_ip() for getting the IP address of the ESP32
|
I created the PR with my modifications. Unfortunately I see that the two checks failed:
Do you have an idea what I have to modify? |
PerMalmberg
left a comment
There was a problem hiding this comment.
The format check fails because the code doesn't follow the formatting rules set in the uncrustify config. If you run it on the files in question you'll see it will reformat your code, hence the file-size change.
The reason for the other failure is that esp_wifi_get_mode isn't defined in mock-idf used when compiling Smooth for Linux/macOS:
- https://github.com/PerMalmberg/Smooth/blob/master/mock-idf/components/esp_wifi/include/esp_wifi.h#L22
- https://github.com/PerMalmberg/Smooth/blob/master/mock-idf/components/esp_wifi/esp_wifi.cpp#L33
I've not had any code that has needed it yet. If you add stubs with the correct signature for esp_wifi_get_mode it should compile.
|
Also, please update the contributors.md file to list this PR 👍 |
|
thank you for reviewing the code. I will take care about your suggestions tomorrow. |
- bugfix for Wifi::get_mac_address() which now returns the right mac address of the used interface - added Wifi:: get_local_mac_address(std::array<uint8_t, 6>& m>) for getting the binary representation of the mac address - added Wifi::get_local_ip() for getting the IP address of the ESP32
|
Now I saw that your last comments were in parallel with my last commit. Maybe you can check the actual status and give additional comments on that? |
- added comment to "static ip4_addr_t get_local_ip()" as a warning concerning threading issue - made "std::string get_mac_address()"static also
removing unnecessary initialization of ip
|
Are you planning to update a test project to use this new functionality? |
|
Yes, I could modify the AP test.
Am 7. November 2019 20:33:55 MEZ schrieb Per Malmberg <notifications@github.com>:
…Are you planning to update a test project to use this new
functionality?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#114 (comment)
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
|
Cool, lets finish with that before merging. |
|
I try to do it this evening. |
- added test for Wifi::get_local_ip() - added test for Wifi::get_local_mac_address(std::array<uint8_t, 6> mac)
|
I'm going to accept this as-is now, but will make a few modifications afterwards as I can't push to the master branch of your repository. |