Re: [PATCH v4 1/4] android: Update bond state on incoming bonding

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

 



Hi Lukasz,

On Thu, Nov 14, 2013, Lukasz Rymanowski wrote:
> +static void send_remote_device_name_prop(const bdaddr_t *bdaddr, char *name)
> +{
> +	struct hal_ev_remote_device_props *ev;
> +	uint8_t buf[BASELEN_REMOTE_DEV_PROP + strlen(name)];
> +
> +	ev =  (void *) buf;

Minor white space issue here (two spaces instead of one after =.

> @@ -1865,12 +1933,18 @@ static bool cancel_bond(void *buf, uint16_t len)
>  {
>  	struct hal_cmd_cancel_bond *cmd = buf;
>  	struct mgmt_addr_info cp;
> +	bool result;
>  
>  	cp.type = BDADDR_BREDR;
>  	android2bdaddr(cmd->bdaddr, &cp.bdaddr);
>  
> -	return mgmt_reply(mgmt_if, MGMT_OP_CANCEL_PAIR_DEVICE, adapter.index,
> +	result = mgmt_reply(mgmt_if, MGMT_OP_CANCEL_PAIR_DEVICE, adapter.index,
>  					sizeof(cp), &cp, NULL, NULL, NULL) > 0;
> +	if (result)
> +		set_device_bond_state(&cp.bdaddr, HAL_STATUS_SUCCESS,
> +							HAL_BOND_STATE_NONE);

Would it not make sense to use the mgmt command complete callback for
sending HAL_BOND_STATE_NONE? (right now you're just passing NULL for
it). Actually, sending this command will generate a command complete to
our pair_device command with a "canceled" status. So aren't we sending
redundant HAL_BOND_STATE_NONE here?

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