Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should wait_for_lte fail on not finding an available network? #24

Open
huntc opened this issue Jun 2, 2021 · 3 comments
Open

Should wait_for_lte fail on not finding an available network? #24

huntc opened this issue Jun 2, 2021 · 3 comments

Comments

@huntc
Copy link

huntc commented Jun 2, 2021

I wonder if the wait_for_lte function should check on receiving a status of +CEREG: 4 and fail. I think +CEREG: 4 indicates that there's no available network i.e. "Unknown (for example, out of Evolved Terrestrial Radio Access Network (E-UTRAN) coverage)". Or is the idea to continuously try until it can get one?

@jonathanpallant
Copy link
Member

I was working with the use case that you might boot the unit outside of a coverage area and then later move into a coverage area.

In general, that function is only really for the simplest of example applications as you almost always have something else useful to be doing whilst you wait for signal (like updating the UI).

@huntc
Copy link
Author

huntc commented Jun 2, 2021

What do you think of having a function that performs the CEREG and another to perform and process the recv? This function could then compose them while supporting more complex use-cases. Thoughts?

@jonathanpallant
Copy link
Member

In general, when working with telecom systems, I would have a callback which takes any asynchronous event, and a command queue which submits commands one at a time.

Calling a poll(|async_ind| handle_indication(async_ind)) function periodically seems to make sense. And maybe a poll_until(|async_ind| handle_indication_and_return_true_if_were_done(async_ind), Duration::new_us(1000)) or something.

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

No branches or pull requests

2 participants