Re: [PATCH BlueZ v3 5/5] mesh: Add "node is busy" check for Leave() & Attach()

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

 



Hi Inga,

On 06/10, Inga Stotland wrote:
> Attach() method:
> If Attach method is called for a node that is being processed as a result
> of a Create, Import or Join method calls in progress, node attachment
> is not allowed and org.bluez.mesh.Error.Busy error is returned.

I don't think I understand how this is supposed to be used by the
application.

So far, we've implemented the API by calling Import() and then, as soon as
JoinComplete() call arrives, calling Attach().

> @@ -1654,6 +1665,12 @@ void node_attach(const char *app_root, const char *sender, uint64_t token,
>  		return;
>  	}
>  
> +	/* Check if there is a pending request associated with this node */
> +	if (node->busy) {
> +		cb(user_data, MESH_ERROR_BUSY, NULL);
> +		return;
> +	}
> +
>  	/* Check if the node is already in use */
>  	if (node->owner) {
>  		l_warn("The node is already in use");

With this patch, this call sequence fails, because now we're supposed to
send a *reply* to JoinComplete first, and only then call Attach()?

I'm using a high-level API for D-Bus, so I don't really control when the
reply is sent, so at the moment the only way to implement this would be
by delaying Attach() by a fixed timeout - and I'm not comfortable with
that.

regards
-- 
Michał Lowas-Rzechonek <michal.lowas-rzechonek@xxxxxxxxxxx>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND



[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