Skip to content

Commit

Permalink
Add joiner start to button handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ktaborowski committed Aug 20, 2020
1 parent 09873b3 commit da64c69
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/nrfconnect/nrfconnect-app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ chip_configure(ChipConfig
ARCH arm-none-eabi
CFLAGS ${CHIP_COMMON_FLAGS} --specs=nosys.specs
CXXFLAGS ${CHIP_COMMON_FLAGS}
PROJECT_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/main/include/CHIPProjectConfig.h
)

chip_build(ChipLib ChipConfig
Expand Down
4 changes: 4 additions & 0 deletions examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ void AppTask::JoinerHandler(AppEvent * aEvent)

CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED;

#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
error = ThreadStackMgr().JoinerStart();
#endif

LOG_INF("Thread joiner triggering result: %s", chip::ErrorStr(error));
}

Expand Down
35 changes: 35 additions & 0 deletions examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* Example project configuration file for CHIP.
*
* This is a place to put application or project-specific overrides
* to the default configuration values for general CHIP features.
*
*/

#ifndef CHIP_PROJECT_CONFIG_H
#define CHIP_PROJECT_CONFIG_H

// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 12345678
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00

#endif // CHIP_PROJECT_CONFIG_H
2 changes: 2 additions & 0 deletions examples/lock-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ CONFIG_OPENTHREAD_BORDER_AGENT=y
CONFIG_OPENTHREAD_BORDER_ROUTER=y
CONFIG_OPENTHREAD_UDP_FORWARD=y
CONFIG_OPENTHREAD_ENABLE_SERVICE=y
CONFIG_OPENTHREAD_JOINER=y
CONFIG_OPENTHREAD_MANUAL_START=y

# Enable OpenThread shell
CONFIG_OPENTHREAD_SHELL=y
Expand Down

0 comments on commit da64c69

Please sign in to comment.