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

Particle.connect() should be blocking in SEMI_AUTOMATIC mode #1145

Merged
merged 5 commits into from Nov 28, 2016

Conversation

@avtolstoy
Copy link
Member

commented Oct 22, 2016

Closes #973

Makes Particle.connect() blocking in SEMI_AUTOMATIC mode (when threading is disabled).

Relevant tests:

  • CLOUD_01_Particle_Connect_Blocks_In_SemiAutomatic_Mode_With_Threading_Disabled
  • CLOUD_02_Particle_Connect_Does_Not_Block_In_SemiAutomatic_Mode_With_Threading_Enabled
  • CLOUD_03_Restore_System_Mode

This PR also enables wiring/no_fixture to be compiled with threading enabled.


Doneness:

  • Contributor has signed CLA
  • Problem and Solution clearly stated
  • Code peer reviewed
  • API tests compiled
  • Run unit/integration/application tests on device
  • Add documentation
  • Add to CHANGELOG.md after merging (add links to docs and issues)

Bugfixes

  • Particle.connect() now blocks loop() from running until Particle.connected() is true in single threaded SEMI_AUTOMATIC mode. [Fixes #973]

@avtolstoy avtolstoy added this to the 0.7.x milestone Oct 22, 2016

@@ -2,10 +2,16 @@
#include "unit-test/unit-test.h"

// make clean all TEST=wiring/no_fixture PLATFORM=electron -s COMPILE_LTO=n program-dfu DEBUG_BUILD=y
// make clean all TEST=wiring/no_fixture PLATFORM=electron -s COMPILE_LTO=n program-dfu DEBUG_BUILD=y USE_THREADING=y

This comment has been minimized.

Copy link
@technobly

technobly Nov 28, 2016

Member

Nice addition here with USE_THREADING=y, this is something added to release process just now. Some of the tests already have threading turned on by default i.e., wiring/threading but this is something we'd like to start regularly testing with all existing tests originally written with a single thread in mind.

SystemClass::mode() == SEMI_AUTOMATIC)
{
// Particle.connect() should be blocking in SEMI_AUTOMATIC mode when threading is disabled
waitUntil(connected);

This comment has been minimized.

Copy link
@technobly

technobly Nov 28, 2016

Member

I wonder if we should give this a timeout value of something like 60 seconds for Wi-Fi devices and 300 seconds for Cellular devices? Otherwise bad credentials or network issue may block user code in single threaded mode indefinitely, which no chance of user code intervention.

@technobly technobly merged commit 456eeef into develop Nov 28, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@technobly technobly deleted the feature/connect-block-in-semi-automatic branch Nov 28, 2016

@technobly technobly modified the milestones: 0.7.x, 0.6.1 Nov 29, 2016

@avtolstoy avtolstoy referenced this pull request Oct 6, 2017
4 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.