tether: Fix connman_technology_get_wifi_tethering
PATCH 1/1 tether: Fix connman_technology_get_wifi_tethering
The function is called from tethering, so the tethering is not yet enabled. We need to workaround in order to get the right value
Signed-off-by Michael Trimarchi <[email protected]>
--- src/technology.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
src/technology.c +6 -2
@@ -367,19 +367,23 @@ bool connman_technology_get_wifi_tethering(const struct connman_technology *tech const char **ssid, const char **psk, int *freq) { + bool force = true; +if (!ssid || !psk)return false; *ssid = *psk =NULL ;/* Workaround for the neard plugin */ -if (!technology) +if (!technology) { technology =technology_find (CONNMAN_SERVICE_TYPE_WIFI ); + force = false; + }if (!technology)return false; -if (!technology->tethering) +if (!force && !technology->tethering)return false; *ssid = technology->tethering_ident;
Signature · 1 line
2.25.1
Hi
I keep the compatibility. Another option is to give back them all anyway
Michael
Quoted 43 lines · Michael Trimarchi
The function is called from tethering, so the tethering is not yet enabled. We need to workaround in order to get the right value
Signed-off-by Michael Trimarchi <[email protected]>--- src/technology.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)src/technology.c +6
-3@@ -367,19 +367,23 @@ bool connman_technology_get_wifi_tethering(const struct connman_technology *tech const char **ssid, const char **psk, int *freq) { + bool force = true; +if (!ssid || !psk)return false; *ssid = *psk =NULL ;/* Workaround for the neard plugin */ -if (!technology) +if (!technology) { technology =technology_find (CONNMAN_SERVICE_TYPE_WIFI ); + force = false; + }if (!technology)return false; -if (!technology->tethering) +if (!force && !technology->tethering)return false; *ssid = technology->tethering_ident; --2.25.1
Signature · 11 lines
Michael Nazzareno Trimarchi Co-Founder & Chief Executive Officer M. +39 347 913 2170 [email protected] __________________________________ Amarula Solutions BV Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172 [email protected] www.amarulasolutions.com
Daniel Wagner
AppliedQuoted 5 lines · Michael Trimarchi
The function is called from tethering, so the tethering is not yet enabled. We need to workaround in order to get the right value
Applied, thanks!
[1/1] tether: Fix connman_technology_get_wifi_tethering
commit: bc26ab84e4a77950104c6c60609b549b9ce2830f
Best regards,
Signature · 1 line
Daniel Wagner <[email protected]>