-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Silabs] [EFR32] Adds translation between spec WiFi Security Types #25458
[Silabs] [EFR32] Adds translation between spec WiFi Security Types #25458
Conversation
5860517
to
8f8544d
Compare
PR #25458: Size comparison from af3fdc5 to 8f8544d Full report (1 build for cc32xx)
|
PR #25458: Size comparison from af3fdc5 to f507bca Full report (1 build for cc32xx)
|
PR #25458: Size comparison from af3fdc5 to 060b49e Decreases (1 build for cc32xx)
Full report (4 builds for cc32xx, mbed, qpg)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be simpler to just do the conversion in a single location, in the WiFi Diagnostic function
DiagnosticDataProviderImpl::GetWiFiSecurityType ?
Converting your WFX or RSI security enums to the Matter WiFiNetworkDiagnostics::SecurityTypeEnum ?
Yes agreed, but that is something I want to pick up without blocking the spec. We have a task to clean up the code here, including the global variables and functions. Including and not limiting only this, it also includes a proper structure to save AP details which seems to be different for WF200 and RS9116, we can remove quite a few duplicate codes with a clean-up. I will also introduce guard style if statement instead of if-else littered everywhere. |
ok, I'll approve then so you can continue your clean up |
PR #25458: Size comparison from af3fdc5 to 9091af6 Full report (1 build for cc32xx)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sound like a bit of factorization improvement is needed
unless you wish to copy/paste everything again when SiWx918 then SiWx920 comes up....
Yes, agreed that we are replicating code for now, and a refactor effort is required. This was done to meet the spec requirement without changing the logic much, the refactor effort will be done in a phased manner since it requires quite a good amount of testing. |
Co-authored-by: Jonathan Mégevand <77852424+jmeg-sfy@users.noreply.github.com>
9b0455d
to
edecd39
Compare
PR #25458: Size comparison from 32fb896 to edecd39 Increases (1 build for cc32xx)
Full report (2 builds for cc32xx, mbed)
|
@@ -149,28 +148,19 @@ typedef enum | |||
/* Note that these are same as RSI_security */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these in fact still the same as RSI_security?
But also, is there a reason this is not just using the spec-defined enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now, they are not same as rsi_security
, it was a comment which I plan to clean up during the cleanup activity.
@@ -274,7 +264,7 @@ typedef enum | |||
typedef struct wfx_wifi_scan_result | |||
{ | |||
char ssid[32 + 1]; | |||
uint8_t security; | |||
wfx_sec_t security; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look right. For a scan result, the security type is a bitmap, not an enum, in the spec. See "11.8.5.1. WiFiSecurityBitmap", which is not the same thing as the "11.14.5.1. SecurityTypeEnum" used by network diagnostics. It looks to me like the enums above match the latter, but not the scan result bitmap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation for this is here src/platform/silabs/NetworkCommissioningWiFiDriver.cpp#L197
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how that can work. That ConvertSecuritytype
function expects a bitmap as input (not the bit test it's doing) and converts to a different bitmap. But wfx_sec_t
is not a bitmap....
…roject-chip#25458) * Adds fix for project-chip#25118 * Adds fix for unused-variable-warning * Adds fix for rsi_wlan_connect_async invoke * Adding break statements for default case. * Update examples/platform/silabs/efr32/rs911x/rsi_if.c Co-authored-by: Jonathan Mégevand <77852424+jmeg-sfy@users.noreply.github.com> --------- Co-authored-by: Jonathan Mégevand <77852424+jmeg-sfy@users.noreply.github.com>
Fixes #25118
Encoding the enum provided by driver in scan result callback to CHIP spec based enum, decoding them back to driver based enum on the connect API.