mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 14:47:46 +00:00
Commissioner and Joiner API cleanup.
This commit is contained in:
@@ -1080,7 +1080,6 @@ AC_CONFIG_FILES([
|
||||
Makefile
|
||||
include/Makefile
|
||||
include/cli/Makefile
|
||||
include/commissioning/Makefile
|
||||
include/dhcp6/Makefile
|
||||
include/ncp/Makefile
|
||||
include/openthread/Makefile
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\core\api\commissioner_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\joiner_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\link_raw_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\message_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\tasklet_api.cpp" />
|
||||
|
||||
@@ -60,6 +60,12 @@
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\core\api\commissioner_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\api\joiner_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\api\link_raw_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\core\api\commissioner_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\joiner_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\message_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\tasklet_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\coap\coap_base.cpp" />
|
||||
|
||||
@@ -60,6 +60,12 @@
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\core\api\commissioner_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\api\joiner_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\api\link_raw_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <mstcpip.h>
|
||||
#define OTDLL 1
|
||||
#include <openthread.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include <commissioning/joiner.h>
|
||||
#include <openthread/commissioner.h>
|
||||
#include <openthread/joiner.h>
|
||||
|
||||
#include "App.xaml.h"
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#define OTAPI EXTERN_C __declspec(dllexport)
|
||||
|
||||
#include <openthread.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include <commissioning/joiner.h>
|
||||
#include <openthread/commissioner.h>
|
||||
#include <openthread/joiner.h>
|
||||
#include <platform/logging-windows.h>
|
||||
|
||||
#include <winioctl.h>
|
||||
|
||||
@@ -65,8 +65,8 @@ RtlCopyBufferToMdl(
|
||||
#include <openthread-icmp6.h>
|
||||
#include <openthread-ip6.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include <commissioning/joiner.h>
|
||||
#include <openthread/commissioner.h>
|
||||
#include <openthread/joiner.h>
|
||||
#include <dhcp6/dhcp6_server.h>
|
||||
#include <dhcp6/dhcp6_client.h>
|
||||
#include <common/code_utils.hpp>
|
||||
|
||||
@@ -50,8 +50,8 @@ using namespace std;
|
||||
#define OTNODEAPI EXTERN_C __declspec(dllexport)
|
||||
|
||||
#include <openthread.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include <commissioning/joiner.h>
|
||||
#include <openthread/commissioner.h>
|
||||
#include <openthread/joiner.h>
|
||||
#include <platform/logging-windows.h>
|
||||
#include <otNode.h>
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
|
||||
DIST_SUBDIRS = \
|
||||
cli \
|
||||
commissioning \
|
||||
dhcp6 \
|
||||
ncp \
|
||||
openthread \
|
||||
@@ -43,7 +42,6 @@ DIST_SUBDIRS = \
|
||||
|
||||
SUBDIRS = \
|
||||
cli \
|
||||
commissioning \
|
||||
dhcp6 \
|
||||
ncp \
|
||||
openthread \
|
||||
@@ -54,7 +52,6 @@ SUBDIRS = \
|
||||
|
||||
PRETTY_SUBDIRS = \
|
||||
cli \
|
||||
commissioning \
|
||||
dhcp6 \
|
||||
ncp \
|
||||
openthread \
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 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
|
||||
|
||||
ot_commissioning_headers = \
|
||||
commissioner.h \
|
||||
joiner.h \
|
||||
$(NULL)
|
||||
|
||||
ot_commissioningdir = $(includedir)/commissioning
|
||||
dist_ot_commissioning_HEADERS = $(ot_commissioning_headers)
|
||||
|
||||
install-headers: install-includeHEADERS
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -30,8 +30,10 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
|
||||
openthread_headers = \
|
||||
coap.h \
|
||||
commissioner.h \
|
||||
crypto.h \
|
||||
jam_detection.h \
|
||||
joiner.h \
|
||||
message.h \
|
||||
tasklet.h \
|
||||
udp.h \
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#ifndef OPENTHREAD_COMMISSIONER_H_
|
||||
#define OPENTHREAD_COMMISSIONER_H_
|
||||
|
||||
#include "openthread-types.h"
|
||||
#include <platform/toolchain.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -195,7 +196,7 @@ OTAPI ThreadError OTCALL otCommissionerPanIdQuery(otInstance *aInstance, uint16_
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otSendMgmtCommissionerGet(otInstance *, const uint8_t *aTlvs, uint8_t aLength);
|
||||
OTAPI ThreadError OTCALL otCommissionerSendMgmtGet(otInstance *, const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_COMMISSIONER_SET.
|
||||
@@ -209,7 +210,7 @@ OTAPI ThreadError OTCALL otSendMgmtCommissionerGet(otInstance *, const uint8_t *
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otSendMgmtCommissionerSet(otInstance *, const otCommissioningDataset *aDataset,
|
||||
OTAPI ThreadError OTCALL otCommissionerSendMgmtSet(otInstance *, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,7 @@
|
||||
#ifndef OPENTHREAD_JOINER_H_
|
||||
#define OPENTHREAD_JOINER_H_
|
||||
|
||||
#include "openthread-types.h"
|
||||
#include <platform/toolchain.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
+4
-4
@@ -46,8 +46,8 @@
|
||||
#endif
|
||||
|
||||
#include <openthread.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include <commissioning/joiner.h>
|
||||
#include "openthread/commissioner.h"
|
||||
#include "openthread/joiner.h"
|
||||
|
||||
#ifndef OTDLL
|
||||
#include <openthread-instance.h>
|
||||
@@ -2464,7 +2464,7 @@ void Interpreter::ProcessCommissioner(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
SuccessOrExit(error = otSendMgmtCommissionerGet(mInstance, tlvs, static_cast<uint8_t>(length)));
|
||||
SuccessOrExit(error = otCommissionerSendMgmtGet(mInstance, tlvs, static_cast<uint8_t>(length)));
|
||||
}
|
||||
else if (strcmp(argv[0], "mgmtset") == 0)
|
||||
{
|
||||
@@ -2527,7 +2527,7 @@ void Interpreter::ProcessCommissioner(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
SuccessOrExit(error = otSendMgmtCommissionerSet(mInstance, &dataset, tlvs, static_cast<uint8_t>(length)));
|
||||
SuccessOrExit(error = otCommissionerSendMgmtSet(mInstance, &dataset, tlvs, static_cast<uint8_t>(length)));
|
||||
}
|
||||
else if (strcmp(argv[0], "sessionid") == 0)
|
||||
{
|
||||
|
||||
@@ -103,6 +103,7 @@ endif # OPENTHREAD_ENABLE_MAC_WHITELIST
|
||||
|
||||
if OPENTHREAD_ENABLE_COMMISSIONER
|
||||
SOURCES_COMMON += \
|
||||
api/commissioner_api.cpp \
|
||||
coap/secure_coap_server.cpp \
|
||||
crypto/pbkdf2_cmac.cpp \
|
||||
meshcop/announce_begin_client.cpp \
|
||||
@@ -114,6 +115,7 @@ endif # OPENTHREAD_ENABLE_COMMISSIONER
|
||||
|
||||
if OPENTHREAD_ENABLE_JOINER
|
||||
SOURCES_COMMON += \
|
||||
api/joiner_api.cpp \
|
||||
coap/secure_coap_client.cpp \
|
||||
meshcop/joiner.cpp \
|
||||
$(NULL)
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread UDP API.
|
||||
*/
|
||||
|
||||
#include "openthread/commissioner.h"
|
||||
|
||||
#include "openthread-instance.h"
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_COMMISSIONER
|
||||
|
||||
ThreadError otCommissionerStart(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().Start();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerStop(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().Stop();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aExtAddress, const char *aPSKd)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().AddJoiner(static_cast<const Mac::ExtAddress *>(aExtAddress), aPSKd);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().RemoveJoiner(static_cast<const Mac::ExtAddress *>(aExtAddress));
|
||||
}
|
||||
|
||||
ThreadError otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SetProvisioningUrl(aProvisioningUrl);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerAnnounceBegin(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
const otIp6Address *aAddress)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mAnnounceBegin.SendRequest(aChannelMask, aCount, aPeriod,
|
||||
*static_cast<const Ip6::Address *>(aAddress));
|
||||
}
|
||||
|
||||
ThreadError otCommissionerEnergyScan(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
uint16_t aScanDuration, const otIp6Address *aAddress,
|
||||
otCommissionerEnergyReportCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mEnergyScan.SendQuery(aChannelMask, aCount, aPeriod, aScanDuration,
|
||||
*static_cast<const Ip6::Address *>(aAddress),
|
||||
aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask,
|
||||
const otIp6Address *aAddress,
|
||||
otCommissionerPanIdConflictCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mPanIdQuery.SendQuery(
|
||||
aPanId, aChannelMask, *static_cast<const Ip6::Address *>(aAddress), aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerSendMgmtGet(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SendMgmtCommissionerGetRequest(aTlvs, aLength);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerSendMgmtSet(otInstance *aInstance, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SendMgmtCommissionerSetRequest(*aDataset, aTlvs, aLength);
|
||||
}
|
||||
|
||||
uint16_t otCommissionerGetSessionId(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().GetSessionId();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName,
|
||||
const uint8_t *aExtPanId, uint8_t *aPSKc)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().GeneratePSKc(aPassPhrase, aNetworkName, aExtPanId, aPSKc);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_COMMISSIONER
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread UDP API.
|
||||
*/
|
||||
|
||||
#include "openthread/joiner.h"
|
||||
|
||||
#include "openthread-instance.h"
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_JOINER
|
||||
|
||||
ThreadError otJoinerStart(otInstance *aInstance, const char *aPSKd, const char *aProvisioningUrl,
|
||||
const char *aVendorName, const char *aVendorModel,
|
||||
const char *aVendorSwVersion, const char *aVendorData,
|
||||
otJoinerCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetJoiner().Start(aPSKd, aProvisioningUrl,
|
||||
aVendorName, aVendorModel, aVendorSwVersion, aVendorData,
|
||||
aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otJoinerStop(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetJoiner().Stop();
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_JOINER
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread-types.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include "openthread/commissioner.h"
|
||||
|
||||
#include <coap/coap_client.hpp>
|
||||
#include <net/ip6_address.hpp>
|
||||
#include <net/udp6.hpp>
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#define COMMISSIONER_HPP_
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include "openthread/commissioner.h"
|
||||
|
||||
#include <coap/coap_client.hpp>
|
||||
#include <coap/coap_server.hpp>
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread-types.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include "openthread/commissioner.h"
|
||||
|
||||
#include <coap/coap_client.hpp>
|
||||
#include <coap/coap_server.hpp>
|
||||
#include <net/ip6_address.hpp>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#define JOINER_HPP_
|
||||
|
||||
#include <openthread-types.h>
|
||||
#include <commissioning/joiner.h>
|
||||
#include "openthread/joiner.h"
|
||||
|
||||
#include <coap/coap_header.hpp>
|
||||
#include <coap/coap_server.hpp>
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread-types.h>
|
||||
#include <commissioning/commissioner.h>
|
||||
#include "openthread/commissioner.h"
|
||||
|
||||
#include <coap/coap_client.hpp>
|
||||
#include <coap/coap_server.hpp>
|
||||
#include <net/ip6_address.hpp>
|
||||
|
||||
@@ -1607,97 +1607,6 @@ ThreadError otSendPendingSet(otInstance *aInstance, const otOperationalDataset *
|
||||
return aInstance->mThreadNetif.GetPendingDataset().SendSetRequest(*aDataset, aTlvs, aLength);
|
||||
}
|
||||
|
||||
#if OPENTHREAD_ENABLE_COMMISSIONER
|
||||
#include <commissioning/commissioner.h>
|
||||
ThreadError otCommissionerStart(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().Start();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerStop(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().Stop();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aExtAddress, const char *aPSKd)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().AddJoiner(static_cast<const Mac::ExtAddress *>(aExtAddress), aPSKd);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().RemoveJoiner(static_cast<const Mac::ExtAddress *>(aExtAddress));
|
||||
}
|
||||
|
||||
ThreadError otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SetProvisioningUrl(aProvisioningUrl);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerAnnounceBegin(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
const otIp6Address *aAddress)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mAnnounceBegin.SendRequest(aChannelMask, aCount, aPeriod,
|
||||
*static_cast<const Ip6::Address *>(aAddress));
|
||||
}
|
||||
|
||||
ThreadError otCommissionerEnergyScan(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
uint16_t aScanDuration, const otIp6Address *aAddress,
|
||||
otCommissionerEnergyReportCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mEnergyScan.SendQuery(aChannelMask, aCount, aPeriod, aScanDuration,
|
||||
*static_cast<const Ip6::Address *>(aAddress),
|
||||
aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask,
|
||||
const otIp6Address *aAddress,
|
||||
otCommissionerPanIdConflictCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mPanIdQuery.SendQuery(
|
||||
aPanId, aChannelMask, *static_cast<const Ip6::Address *>(aAddress), aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otSendMgmtCommissionerGet(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SendMgmtCommissionerGetRequest(aTlvs, aLength);
|
||||
}
|
||||
|
||||
ThreadError otSendMgmtCommissionerSet(otInstance *aInstance, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SendMgmtCommissionerSetRequest(*aDataset, aTlvs, aLength);
|
||||
}
|
||||
|
||||
uint16_t otCommissionerGetSessionId(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().GetSessionId();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName,
|
||||
const uint8_t *aExtPanId, uint8_t *aPSKc)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().GeneratePSKc(aPassPhrase, aNetworkName, aExtPanId, aPSKc);
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_COMMISSIONER
|
||||
|
||||
#if OPENTHREAD_ENABLE_JOINER
|
||||
ThreadError otJoinerStart(otInstance *aInstance, const char *aPSKd, const char *aProvisioningUrl,
|
||||
const char *aVendorName, const char *aVendorModel,
|
||||
const char *aVendorSwVersion, const char *aVendorData,
|
||||
otJoinerCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetJoiner().Start(aPSKd, aProvisioningUrl,
|
||||
aVendorName, aVendorModel, aVendorSwVersion, aVendorData,
|
||||
aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otJoinerStop(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetJoiner().Stop();
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_JOINER
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user