-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[WIP][linux] add ThreadStackManager for Linux Device layer #1147
Closed
+1,176
−10
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* Copyright (c) 2018 Nest Labs, Inc. | ||
* 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. | ||
*/ | ||
|
||
#ifndef DEVICE_NETWORK_INFO_H | ||
#define DEVICE_NETWORK_INFO_H | ||
|
||
#include <stdint.h> | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
namespace Internal { | ||
|
||
/** | ||
* Ids for well-known network provision types. | ||
*/ | ||
enum | ||
{ | ||
kThreadNetworkId = 1, | ||
kWiFiStationNetworkId = 2, | ||
kMaxThreadNetworkNameLength = 16, | ||
kThreadExtendedPANIdLength = 8, | ||
kThreadMeshPrefixLength = 8, | ||
kThreadNetworkKeyLength = 16, | ||
kThreadPSKcLength = 16, | ||
kThreadChannel_NotSpecified = UINT8_MAX, | ||
kThreadPANId_NotSpecified = UINT16_MAX, | ||
}; | ||
|
||
class DeviceNetworkInfo | ||
{ | ||
public: | ||
// ---- Thread-specific Fields ---- | ||
char ThreadNetworkName[kMaxThreadNetworkNameLength + 1]; | ||
/**< The Thread network name as a NULL-terminated string. */ | ||
uint8_t ThreadExtendedPANId[kThreadExtendedPANIdLength]; | ||
/**< The Thread extended PAN ID. */ | ||
uint8_t ThreadMeshPrefix[kThreadMeshPrefixLength]; | ||
/**< The Thread mesh prefix. */ | ||
uint8_t ThreadNetworkKey[kThreadNetworkKeyLength]; | ||
/**< The Thread master network key (NOT NULL-terminated). */ | ||
uint8_t ThreadPSKc[kThreadPSKcLength]; | ||
/**< The Thread pre-shared commissioner key (NOT NULL-terminated). */ | ||
uint16_t ThreadPANId; /**< The 16-bit Thread PAN ID, or kThreadPANId_NotSpecified */ | ||
uint8_t ThreadChannel; /**< The Thread channel (currently [11..26]), or kThreadChannel_NotSpecified */ | ||
|
||
struct | ||
{ | ||
bool ThreadExtendedPANId : 1; | ||
bool ThreadMeshPrefix : 1; | ||
bool ThreadPSKc : 1; | ||
} FieldPresent; | ||
}; | ||
|
||
} // namespace Internal | ||
} // namespace DeviceLayer | ||
} // namespace chip | ||
|
||
#endif // DEVICE_NETWORK_INFO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* | ||
* 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. | ||
*/ | ||
|
||
#ifndef CHIP_PLATFORM_LINUX_THREAD_STACK_MANAGER_IMPL_H | ||
#define CHIP_PLATFORM_LINUX_THREAD_STACK_MANAGER_IMPL_H | ||
|
||
#include <memory> | ||
|
||
#include "platform/internal/CHIPDeviceLayerInternal.h" | ||
|
||
#include "dbus/client/thread_api_dbus.hpp" | ||
#include "platform/internal/DeviceNetworkInfo.h" | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
|
||
class ThreadStackManagerImpl : public ThreadStackManager | ||
{ | ||
public: | ||
ThreadStackManagerImpl(); | ||
|
||
CHIP_ERROR _InitThreadStack(); | ||
CHIP_ERROR _ProcessThreadActivity(); | ||
|
||
CHIP_ERROR _StartThreadTask() { return CHIP_NO_ERROR; } // Intentionally left blank | ||
CHIP_ERROR _LockThreadStack() { return CHIP_NO_ERROR; } // Intentionally left blank | ||
CHIP_ERROR _TryLockThreadStack() { return CHIP_NO_ERROR; } // Intentionally left blank | ||
CHIP_ERROR _UnlockThreadStack() { return CHIP_NO_ERROR; } // Intentionally left blank | ||
|
||
bool _HaveRouteToAddress(const Inet::IPAddress & destAddr); | ||
|
||
void _OnPlatformEvent(const ChipDeviceEvent * event); | ||
|
||
CHIP_ERROR _GetThreadProvision(Internal::DeviceNetworkInfo & netInfo, bool includeCredentials); | ||
|
||
CHIP_ERROR _SetThreadProvision(const Internal::DeviceNetworkInfo & netInfo); | ||
|
||
void _ClearThreadProvision(); | ||
|
||
bool _IsThreadProvisioned(); | ||
|
||
bool _IsThreadEnabled(); | ||
|
||
bool _IsThreadAttached(); | ||
|
||
CHIP_ERROR _SetThreadEnabled(bool val); | ||
|
||
ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(); | ||
|
||
CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); | ||
|
||
void _GetThreadPollingConfig(ConnectivityManager::ThreadPollingConfig & pollingConfig); | ||
|
||
CHIP_ERROR _SetThreadPollingConfig(const ConnectivityManager::ThreadPollingConfig & pollingConfig); | ||
|
||
bool _HaveMeshConnectivity(); | ||
|
||
void _OnMessageLayerActivityChanged(bool messageLayerIsActive); | ||
|
||
void _OnCHIPoBLEAdvertisingStart(); | ||
|
||
void _OnCHIPoBLEAdvertisingStop(); | ||
|
||
CHIP_ERROR _GetAndLogThreadStatsCounters(); | ||
|
||
CHIP_ERROR _GetAndLogThreadTopologyMinimal(); | ||
|
||
CHIP_ERROR _GetAndLogThreadTopologyFull(); | ||
|
||
CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf); | ||
|
||
~ThreadStackManagerImpl() = default; | ||
|
||
private: | ||
void _ThreadDevcieRoleChangedHandler(otbr::DBus::DeviceRole role); | ||
|
||
std::unique_ptr<otbr::DBus::ThreadApiDBus> mThreadApi; | ||
DBusConnection * mConnection; | ||
Internal::DeviceNetworkInfo mNetworkInfo; | ||
bool mAttached; | ||
}; | ||
|
||
} // namespace DeviceLayer | ||
} // namespace chip | ||
|
||
#endif // CHIP_PLATFORM_LINUX_THREAD_STACK_MANAGER_IMPL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
int main() | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
/* | ||
* Copyright (c) 2020, 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 <assert.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include <memory> | ||
|
||
#include <dbus/dbus.h> | ||
|
||
#include "dbus/client/thread_api_dbus.hpp" | ||
#include "dbus/common/constants.hpp" | ||
|
||
using otbr::DBus::ActiveScanResult; | ||
using otbr::DBus::ClientError; | ||
using otbr::DBus::DeviceRole; | ||
using otbr::DBus::ExternalRoute; | ||
using otbr::DBus::Ip6Prefix; | ||
using otbr::DBus::LinkModeConfig; | ||
using otbr::DBus::OnMeshPrefix; | ||
using otbr::DBus::ThreadApiDBus; | ||
|
||
struct DBusConnectionDeleter | ||
{ | ||
void operator()(DBusConnection *aConnection) { dbus_connection_unref(aConnection); } | ||
}; | ||
|
||
using UniqueDBusConnection = std::unique_ptr<DBusConnection, DBusConnectionDeleter>; | ||
|
||
static bool operator==(const otbr::DBus::Ip6Prefix &aLhs, const otbr::DBus::Ip6Prefix &aRhs) | ||
{ | ||
bool prefixDataEquality = (aLhs.mPrefix.size() == aRhs.mPrefix.size()) && | ||
(memcmp(&aLhs.mPrefix[0], &aRhs.mPrefix[0], aLhs.mPrefix.size()) == 0); | ||
|
||
return prefixDataEquality && aLhs.mLength == aRhs.mLength; | ||
} | ||
|
||
static void CheckExternalRoute(ThreadApiDBus *aApi, const Ip6Prefix &aPrefix) | ||
{ | ||
ExternalRoute route; | ||
std::vector<ExternalRoute> externalRouteTable; | ||
|
||
route.mPrefix = aPrefix; | ||
route.mStable = true; | ||
route.mPreference = 0; | ||
|
||
assert(aApi->AddExternalRoute(route) == OTBR_ERROR_NONE); | ||
assert(aApi->GetExternalRoutes(externalRouteTable) == OTBR_ERROR_NONE); | ||
assert(externalRouteTable.size() == 1); | ||
assert(externalRouteTable[0].mPrefix == aPrefix); | ||
assert(externalRouteTable[0].mPreference == 0); | ||
assert(externalRouteTable[0].mStable); | ||
assert(externalRouteTable[0].mNextHopIsThisDevice); | ||
assert(aApi->RemoveExternalRoute(aPrefix) == OTBR_ERROR_NONE); | ||
} | ||
|
||
int main() | ||
{ | ||
DBusError error; | ||
UniqueDBusConnection connection; | ||
std::unique_ptr<ThreadApiDBus> api; | ||
uint64_t extpanid = 0xdead00beaf00cafe; | ||
|
||
dbus_error_init(&error); | ||
connection = UniqueDBusConnection(dbus_bus_get(DBUS_BUS_SYSTEM, &error)); | ||
|
||
VerifyOrExit(connection != nullptr); | ||
|
||
VerifyOrExit(dbus_bus_register(connection.get(), &error) == true); | ||
|
||
api = std::unique_ptr<ThreadApiDBus>(new ThreadApiDBus(connection.get())); | ||
|
||
api->AddDeviceRoleHandler( | ||
[](DeviceRole aRole) { printf("Device role changed to %d\n", static_cast<uint8_t>(aRole)); }); | ||
|
||
api->Scan([&api, extpanid](const std::vector<ActiveScanResult> &aResult) { | ||
LinkModeConfig cfg = {true, true, false, true}; | ||
|
||
for (auto &&result : aResult) | ||
{ | ||
printf("%s channel %d rssi %d\n", result.mNetworkName.c_str(), result.mChannel, result.mRssi); | ||
} | ||
|
||
api->SetLinkMode(cfg); | ||
api->GetLinkMode(cfg); | ||
printf("LinkMode %d %d %d %d\n", cfg.mRxOnWhenIdle, cfg.mSecureDataRequests, cfg.mDeviceType, cfg.mNetworkData); | ||
|
||
cfg.mDeviceType = true; | ||
api->SetLinkMode(cfg); | ||
|
||
api->Attach("Test", 0x3456, extpanid, {}, {}, UINT32_MAX, [&api, extpanid](ClientError aError) { | ||
printf("Attach result %d\n", static_cast<int>(aError)); | ||
uint64_t extpanidCheck; | ||
if (aError == OTBR_ERROR_NONE) | ||
{ | ||
std::string name; | ||
uint64_t extAddress = 0; | ||
uint16_t rloc16 = 0xffff; | ||
uint8_t routerId; | ||
std::vector<uint8_t> networkData; | ||
std::vector<uint8_t> stableNetworkData; | ||
otbr::DBus::LeaderData leaderData; | ||
uint8_t leaderWeight; | ||
int8_t rssi; | ||
int8_t txPower; | ||
std::vector<otbr::DBus::ChildInfo> childTable; | ||
std::vector<otbr::DBus::NeighborInfo> neighborTable; | ||
uint32_t partitionId; | ||
Ip6Prefix prefix; | ||
OnMeshPrefix onMeshPrefix = {}; | ||
|
||
prefix.mPrefix = {0xfd, 0xcd, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06}; | ||
prefix.mLength = 64; | ||
|
||
onMeshPrefix.mPrefix = prefix; | ||
onMeshPrefix.mPreference = 0; | ||
onMeshPrefix.mStable = true; | ||
|
||
assert(api->GetNetworkName(name) == OTBR_ERROR_NONE); | ||
assert(api->GetExtPanId(extpanidCheck) == OTBR_ERROR_NONE); | ||
assert(api->GetRloc16(rloc16) == OTBR_ERROR_NONE); | ||
assert(api->GetExtendedAddress(extAddress) == OTBR_ERROR_NONE); | ||
assert(api->GetRouterId(routerId) == OTBR_ERROR_NONE); | ||
assert(api->GetLeaderData(leaderData) == OTBR_ERROR_NONE); | ||
assert(api->GetNetworkData(networkData) == OTBR_ERROR_NONE); | ||
assert(api->GetStableNetworkData(stableNetworkData) == OTBR_ERROR_NONE); | ||
assert(api->GetLocalLeaderWeight(leaderWeight) == OTBR_ERROR_NONE); | ||
assert(api->GetChildTable(childTable) == OTBR_ERROR_NONE); | ||
assert(api->GetNeighborTable(neighborTable) == OTBR_ERROR_NONE); | ||
assert(api->GetPartitionId(partitionId) == OTBR_ERROR_NONE); | ||
assert(api->GetInstantRssi(rssi) == OTBR_ERROR_NONE); | ||
assert(api->GetRadioTxPower(txPower) == OTBR_ERROR_NONE); | ||
CheckExternalRoute(api.get(), prefix); | ||
assert(api->AddOnMeshPrefix(onMeshPrefix) == OTBR_ERROR_NONE); | ||
assert(api->RemoveOnMeshPrefix(onMeshPrefix.mPrefix) == OTBR_ERROR_NONE); | ||
api->FactoryReset(nullptr); | ||
assert(api->GetNetworkName(name) == OTBR_ERROR_NONE); | ||
assert(rloc16 != 0xffff); | ||
assert(extAddress != 0); | ||
assert(routerId == leaderData.mLeaderRouterId); | ||
assert(!networkData.empty()); | ||
assert(childTable.empty()); | ||
assert(neighborTable.empty()); | ||
} | ||
if (aError != OTBR_ERROR_NONE || extpanidCheck != extpanid) | ||
{ | ||
exit(-1); | ||
} | ||
api->Attach("Test", 0x3456, extpanid, {}, {}, UINT32_MAX, | ||
[](ClientError aErr) { exit(static_cast<uint8_t>(aErr)); }); | ||
}); | ||
}); | ||
|
||
while (true) | ||
{ | ||
dbus_connection_read_write_dispatch(connection.get(), 0); | ||
} | ||
|
||
exit: | ||
dbus_error_free(&error); | ||
return 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "platform/internal/CHIPDeviceLayerInternal.h" | ||
|
||
#include "platform/ThreadStackManager.h" | ||
#include "platform/PlatformManager.h" | ||
|
||
int TestThreadStackManager(void) | ||
{ | ||
chip::DeviceLayer::ThreadStackManagerImpl impl; | ||
chip::DeviceLayer::Internal::DeviceNetworkInfo info; | ||
uint16_t masterKey[16] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; | ||
|
||
strncpy(info.ThreadNetworkName, "CHIP-TEST", sizeof(info.ThreadNetworkName)); | ||
info.ThreadChannel = UINT8_MAX; | ||
info.ThreadPANId = 0x3455; | ||
info.FieldPresent.ThreadExtendedPANId = false; | ||
info.FieldPresent.ThreadMeshPrefix = false; | ||
info.FieldPresent.ThreadPSKc = false; | ||
memcpy(&info.ThreadNetworkKey, &masterKey, sizeof(masterKey)); | ||
|
||
chip::DeviceLayer::PlatformMgrImpl().InitChipStack(); | ||
|
||
impl.InitThreadStack(); | ||
impl.StartThreadTask(); | ||
impl._SetThreadProvision(info); | ||
impl._SetThreadEnabled(true); | ||
|
||
printf("Start Thread task done\n"); | ||
|
||
//chip::DeviceLayer::PlatformMgrImpl().RunEventLoop(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* | ||
* 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 | ||
* This file declares test entry point for CHIP Platform Manager code unit tests. | ||
* | ||
*/ | ||
|
||
#ifndef CHIP_TEST_THREAD_STACK_MGR_H | ||
#define CHIP_TEST_THREAD_STACK_MGR_H | ||
|
||
int TestThreadStackManager(void); | ||
|
||
#endif // CHIP_TEST_THREAD_STACK_MGR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "TestThreadStackMgr.h" | ||
|
||
int main() | ||
{ | ||
TestThreadStackManager(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# 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. | ||
|
||
|
||
# | ||
# Description: | ||
# This file is the GNU automake template for the CHIP in-package, | ||
# otbr clientlibrary. | ||
# | ||
# | ||
|
||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am | ||
|
||
if CHIP_WITH_OTBRCLIENT_INTERNAL | ||
|
||
lib_LIBRARIES = libotbrclient.a | ||
|
||
nodist_libotbrclient_a_SOURCES = \ | ||
repo/src/dbus/client/client_error.cpp \ | ||
repo/src/dbus/client/thread_api_dbus.cpp \ | ||
repo/src/dbus/common/error.cpp \ | ||
repo/src/dbus/common/dbus_message_helper.cpp \ | ||
repo/src/dbus/common/dbus_message_helper_openthread.cpp \ | ||
$(NULL) | ||
|
||
libotbrclient_a_CPPFLAGS = \ | ||
-I$(top_srcdir)/third_party/ot-br-posix/repo/include \ | ||
-I$(top_srcdir)/third_party/ot-br-posix/repo/src \ | ||
$(OTBRCLIENT_CPPFLAGS) \ | ||
$(DBUS_CFLAGS) \ | ||
$(NULL) | ||
|
||
endif # CHIP_WITH_OTBRCLIENT_INTERNAL | ||
|
||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove commented out code?
is there any way for this test to fail besides a SIGSEGV? I see it initializing a lot of things but never check any error codes. Can we make it a unit test instead or provide some instructions on how run the test?