Re: [PATCH BlueZ] mesh: Make meshctl use bt_shell helpers

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

 



Hi Luiz,

On Tue, Dec 05, 2017, Luiz Augusto von Dentz wrote:
> -static void cmd_connect(const char *arg)
> +static void cmd_connect(int argc, char *argv[])
>  {
> +	char *filters[] = { MESH_PROXY_SVC_UUID };
> +
>  	if (check_default_ctrl() == FALSE)
>  		return;
>  
>  	memset(&connection, 0, sizeof(connection));
>  
> -	if (!arg || !strlen(arg)) {
> +	if (!argc || !strlen(argv[0])) {
>  		connection.net_idx = NET_IDX_PRIMARY;
>  	} else {
>  		char *end;
> -		connection.net_idx = strtol(arg, &end, 16);
> -		if (end == arg) {
> +		connection.net_idx = strtol(argv[0], &end, 16);
> +		if (end == argv[0]) {
>  			connection.net_idx = NET_IDX_INVALID;
> -			rl_printf("Invalid network index %s\n", arg);
> +			bt_shell_printf("Invalid network index %s\n", argv[0]);
>  			return;
>  		}

This looks like it's breaking the Node ID connecting that was just
added. That code from Steve was taking advantage of the "end" pointer to
get the next parameter, however now that you get the full parsed argv
the connection.unicast should be set based on argv[1].

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