Skip to content

Commit

Permalink
Place device in user-selected mode when attention button pressed.
Browse files Browse the repository at this point in the history
Updated openweave submodule to commit baf1a8c.
  • Loading branch information
Jay Logue committed May 15, 2019
1 parent 616b2a3 commit a85291e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion main/openweave-esp32-demo.cpp
Expand Up @@ -320,13 +320,20 @@ extern "C" void app_main()
statusLED.Animate();

// Poll the attention button. Whenever we detect a *release* of the button
// demand start the WiFi AP interface.
// demand start the WiFi AP interface and place the device in "user selected"
// mode.
//
// While the device is in user selected mode, it will respond to Device
// Identify Requests that have the UserSelectedMode flag set. This makes it
// easy for other mobile applications or devices to find it.
//
bool attentionButtonPressDetected = false;
(void)attentionButtonPressDetected;
if (attentionButton.Poll() && !attentionButton.IsPressed())
{
PlatformMgr().LockWeaveStack();
ConnectivityMgr().DemandStartWiFiAP();
ConnectivityMgr().SetUserSelectedMode(true);
PlatformMgr().UnlockWeaveStack();
attentionButtonPressDetected = true;
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/openweave
Submodule openweave updated 2623 files

0 comments on commit a85291e

Please sign in to comment.