Re: [PATCH v6 06/13] heartrate: Read Body Sensor Location characteristics

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

 



Hi Andrzej,

On Thu, Sep 20, 2012, Andrzej Kaczmarek wrote:
> +static void read_sensor_location_cb(guint8 status, const guint8 *pdu,
> +						guint16 len, gpointer user_data)
> +{
> +	struct heartrate *hr = user_data;
> +	uint8_t value;
> +	ssize_t vlen;
> +
> +	if (status != 0) {
> +		error("Body Sensor Location read failed: %s",
> +							att_ecode2str(status));
> +		return;
> +	}
> +
> +	vlen = dec_read_resp(pdu, len, &value, sizeof(value));
> +	if (vlen < 0) {
> +		error("Protocol error");
> +		return;
> +	}
> +
> +	if (vlen != 1) {
> +		error("Invalid length for Body Sensor Location");
> +		return;
> +	}

Minor nitpick: vlen != sizeof(value) would make it more clear exactly
what you want to compare with.

Johan
--
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