Hi Tomasz,

On 07/10/2014 10:33 AM, Tomasz Bursztyka wrote:
>>> +++ 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.

It stands out, that is way I am asking. The rest of the defines use the
(1 << x) version.

>>> +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.

Yes, that is also good idea. I don't mind just be be careful where the
allee uses the type for D-Bus messages (1 byte vs 4 byte issue). :D

cheers,
daniel

> 
> Tomasz

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

Reply via email to