You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now ble::l2cap::Channel is Clone and the rx, tx and try_tx methods take self as shared reference.
I think this should be changed to mutable references and removing Clone because it is not possible to use a channel in two different tasks without triggering a panic in the long run. Doing that results in "Multiple tasks waiting on same portal". I tried having one task read from the channel and the other write to it.
To support that use case maybe we should implement a split method to split the channel into a reading and a writing half.
In my case I worked around that issue by using two different channels, one for reading and one for writing, but this requires more resources for the softdevice.
The text was updated successfully, but these errors were encountered:
Turns out this doesn't help at all. Since the portal is associated with the connection instead of the channel the current API design does not allow using even multiple independent channels at the same time.
Right now only the following works: Waiting for data on only one channel at a time with rx and only using try_tx or ensuring that tx never overlaps with rx.
Right now
ble::l2cap::Channel
isClone
and therx
,tx
andtry_tx
methods takeself
as shared reference.I think this should be changed to mutable references and removing
Clone
because it is not possible to use a channel in two different tasks without triggering a panic in the long run. Doing that results in "Multiple tasks waiting on same portal". I tried having one task read from the channel and the other write to it.To support that use case maybe we should implement a
split
method to split the channel into a reading and a writing half.In my case I worked around that issue by using two different channels, one for reading and one for writing, but this requires more resources for the softdevice.
The text was updated successfully, but these errors were encountered: