Skip to content

Commit

Permalink
[commissioner] move commissioner to src (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
bukepo authored and jwhui committed Sep 18, 2018
1 parent da2f254 commit 1c39f91
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 45 deletions.
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,10 @@ third_party/angular-material/Makefile
include/Makefile
src/Makefile
src/agent/Makefile
src/web/Makefile
src/commissioner/Makefile
src/common/Makefile
src/utils/Makefile
src/web/Makefile
tests/Makefile
tests/mdns/Makefile
tests/meshcop/Makefile
Expand Down
7 changes: 5 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am

DIST_SUBDIRS = \
agent \
web \
commissioner \
common \
utils \
web \
$(NULL)

# Always build (e.g. for 'make all') these subdirectories.
Expand All @@ -44,16 +45,18 @@ SUBDIRS = \
utils \
agent \
web \
commissioner \
$(NULL)


# Always pretty (e.g. for 'make pretty') these subdirectories.

PRETTY_SUBDIRS = \
agent \
web \
commissioner \
common \
utils \
web \
$(NULL)

include $(abs_top_nlbuild_autotools_dir)/automake/post.am
72 changes: 72 additions & 0 deletions src/commissioner/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

include $(abs_top_nlbuild_autotools_dir)/automake/pre.am

bin_PROGRAMS = otbr-commissioner

noinst_HEADERS = \
addr_utils.hpp \
commissioner.hpp \
commissioner_argcargv.hpp \
commissioner_constants.hpp \
commissioner_utils.hpp \
device_hash.hpp \
joiner_session.hpp \
$(NULL)

otbr_commissioner_SOURCES = \
addr_utils.cpp \
commissioner.cpp \
commissioner_argcargv.cpp \
device_hash.cpp \
joiner_session.cpp \
main.cpp \
$(NULL)

otbr_commissioner_CPPFLAGS = \
-DMBEDTLS_CONFIG_FILE='<config-thread.h>' \
-I$(top_srcdir)/third_party/mbedtls/repo/configs \
-I$(top_srcdir)/third_party/mbedtls/repo/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/agent \
-I$(top_srcdir)/src/web \
$(NULL)

otbr_commissioner_LDADD = \
$(top_builddir)/src/agent/libotbr-agent.la \
$(top_builddir)/src/utils/libutils.la \
$(top_builddir)/src/web/libotbr-web.la \
$(top_builddir)/src/common/libotbr-logging.la \
$(NULL)

otbr_commissioner_LDFLAGS = \
-static \
$(NULL)

include $(abs_top_nlbuild_autotools_dir)/automake/post.am
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include <vector>

#include <assert.h>
#include <stdlib.h>
#include <string.h>

Expand Down Expand Up @@ -613,6 +614,8 @@ int Commissioner::SendRelayTransmit(uint8_t *aBuf, size_t aLength)
responseTlv->SetValue(mJoinerRouterLocator);
responseTlv = responseTlv->GetNext();

assert(mJoinerSession != NULL);

if (mJoinerSession->NeedAppendKek())
{
uint8_t kek[kKEKSize];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 0 additions & 41 deletions tests/meshcop/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,6 @@

include $(abs_top_nlbuild_autotools_dir)/automake/pre.am

check_PROGRAMS = otbr-commissioner

noinst_HEADERS = \
addr_utils.hpp \
commissioner.hpp \
commissioner_argcargv.hpp \
commissioner_constants.hpp \
commissioner_utils.hpp \
device_hash.hpp \
joiner_session.hpp \
$(NULL)

otbr_commissioner_SOURCES = \
addr_utils.cpp \
commissioner.cpp \
commissioner_argcargv.cpp \
device_hash.cpp \
joiner_session.cpp \
main.cpp \
$(NULL)

otbr_commissioner_CPPFLAGS = \
-DMBEDTLS_CONFIG_FILE='<config-thread.h>' \
-I$(top_srcdir)/third_party/mbedtls/repo/configs \
-I$(top_srcdir)/third_party/mbedtls/repo/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/agent \
-I$(top_srcdir)/src/web \
$(NULL)

otbr_commissioner_LDADD = \
$(top_builddir)/src/agent/libotbr-agent.la \
$(top_builddir)/src/utils/libutils.la \
$(top_builddir)/src/web/libotbr-web.la \
$(top_builddir)/src/common/libotbr-logging.la \
$(NULL)

otbr_commissioner_LDFLAGS = \
-static \
$(NULL)

dist_check_SCRIPTS = \
meshcop \
meshcop_ftd \
Expand Down
2 changes: 1 addition & 1 deletion tests/meshcop/meshcop
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ readonly WPANCTL_PATH="${STAGE_DIR}/usr/bin/${WPANCTL}"
readonly WPANTUND_PATH="${STAGE_DIR}/usr/sbin/${WPANTUND}"
readonly OT_NCP_PATH="${STAGE_DIR}/usr/bin/${OT_NCP}"
readonly OT_CLI_PATH="${STAGE_DIR}/usr/bin/${OT_CLI}"
readonly OTBR_COMMISSIONER_PATH="${ABS_TOP_BUILDDIR}/tests/meshcop/${OTBR_COMMISSIONER}"
readonly OTBR_COMMISSIONER_PATH="${ABS_TOP_BUILDDIR}/src/commissioner/${OTBR_COMMISSIONER}"
readonly OTBR_AGENT_PATH="${ABS_TOP_BUILDDIR}/src/agent/${OTBR_AGENT}"
readonly OTBR_DBUS_CONF="${ABS_TOP_SRCDIR}/src/agent/otbr-agent.conf"

Expand Down

0 comments on commit 1c39f91

Please sign in to comment.