Hi Daniel,

+++ b/gsupplicant/gsupplicant.h
@@ -78,6 +78,8 @@ extern "C" {
  #define G_SUPPLICANT_WPS_PIN            (1 << 2)
  #define G_SUPPLICANT_WPS_REGISTRAR      (1 << 3)
+#define G_SUPPLICANT_WPS_CONFIG_PBC 0x0080
+
Is there a special reason it is not like the defines above (1 << x)?

This value is the one given by wpa_supplicant into wps_capabilities (yes, internal values exposed...).
So, it's use to parse wps_capabilities.

+bool g_supplicant_peer_is_wps_pin(GSupplicantPeer *peer)
+{
+       if (!peer)
+               return false;
+
+       return ((peer->wps_capabilities & G_SUPPLICANT_WPS_PIN) ==
+                                                       G_SUPPLICANT_WPS_PIN);
+}
In the linse above this change the pattern used is:

dbus_bool_t g_supplicant_network_is_wps_advertizing(GSupplicantNetwork
*network)
{
         if (!network)
                 return FALSE;

         if (network->wps_capabilities & G_SUPPLICANT_WPS_REGISTRAR)
                 return TRUE;

         return FALSE;
}

I would suggest to stick to the pattern. That  brings the next question
if the return type 'bool' should not be dbus_bool_t to be consistent.

Actually, I would rather change this g_supplicant_network_is_wps_advertizing()
returning a bool rather than a dbus_bool_t.

Tomasz
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to