Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Add function to LinkLayer for entering standby #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daboross
Copy link
Contributor

@daboross daboross commented Aug 5, 2020

I'm mainly wanting to arbitrarily stop advertising - I'm not at all sure how much this makes sense in practice, but it seems like a useful control to have for completeness? It's a single function LinkLayer::enter_standby which returns a Cmd and does as the name suggests.

This doesn't gracefully end connections - it's doing the same thing as starting advertising when one has an existing connection, but just not advertising instead.

I mainly want this functionality to stop advertising, and for
completeness. We can start, but not stop, and that seems like it could
be fixed.

Signed-off-by: David Ross <[email protected]>
@jonas-schievink
Copy link
Owner

Hmm, yeah, we want something like this eventually, but getting it correct is a bit more involved. For example, the low-priority part of the stack needs to know that the connection is being teared down to drain the packet queue before the operation can complete (otherwise establishing a new connection will start processing and transmitting packets from the old connection, which is pretty bad).

That said, going from "advertising" to "not advertising" should be trivial. Maybe we should have a stop_advertising function instead that will panic when a connection is established, if that helps with your use case?

@daboross
Copy link
Contributor Author

That makes a lot of sense! I assumed some teardown would be needed, but didn't realize that this could even result in sending packets to the wrong connection.

I think a stop_advertising function could be useful, though it would allow accessing the same kind of bad situation if one calls start_advertising immediately followed by stop_advertising. I don't have a super compelling use case for this in any case, it would just be adding a feature so that it could be exposed to tock apps.

I think we definitely want some kind of connection termination at some point, though. Would it be alright if I opened up a new issue just to track that?

@jonas-schievink
Copy link
Owner

Sure!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants