Re: [RFC 14/16] android: Handle mgmt changed events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrei,

On Fri, Sep 27, 2013 at 10:12 AM, Andrei Emeltchenko
<Andrei.Emeltchenko.news@xxxxxxxxx> wrote:
> +static void mgmt_dev_class_changed_event(uint16_t index, uint16_t length,
> +                                       const void *param, void *user_data)
> +{
> +       struct bt_adapter *adapter = user_data;
> +       const struct mgmt_cod *rp = param;
> +       uint8_t appearance[3];
> +       uint32_t dev_class;
> +
> +       if (length < sizeof(*rp)) {
> +               error("Wrong size of class of device changed parameters");
> +               return;
> +       }
> +
> +       dev_class = rp->val[0] | (rp->val[1] << 8) | (rp->val[2] << 16);
> +
> +       if (dev_class == adapter->dev_class)
> +               return;
> +
> +       DBG("Class: 0x%06x", dev_class);
> +
> +       adapter->dev_class = dev_class;
> +
> +       /* TODO: Inform prop change: Class */
> +
> +       appearance[0] = rp->val[0];
> +       appearance[1] = rp->val[1] & 0x1f;  /* removes service class */
> +       appearance[2] = rp->val[2];
> +
> +       /* TODO: Gatt attrib set*/
> +       (void)appearance;

While it is clear this is incomplete code, doing things like above
just to silence the compiler looks bad. better simply remove the
"appearance" variable (adding it later when you implement GAP
Appearance) and replace it with a TODO or print the value with a
DBG().

Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux