mirror of
https://github.com/espressif/openthread.git
synced 2026-07-11 14:50:18 +00:00
Compare commits
291 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 677d49b42e | |||
| 8e7dba9e4a | |||
| 12fab0b98e | |||
| 7f6ecce258 | |||
| 9bf8d8169a | |||
| 3ef4641b36 | |||
| 3c88ba28fb | |||
| 4c470d7eea | |||
| 868934b114 | |||
| 98457ea65e | |||
| d64b889f52 | |||
| 22dd0e0f7d | |||
| a2865b57a2 | |||
| e6df05b7eb | |||
| 7c8a37263b | |||
| 2457aa1864 | |||
| 467ab24e9b | |||
| 739842d168 | |||
| 9ae76c1c67 | |||
| 8e35bf1db8 | |||
| db3aa113cb | |||
| c5d611a366 | |||
| e3a82139e3 | |||
| cddfda34cc | |||
| 12171a1270 | |||
| 2af44beb74 | |||
| 5db4b0e295 | |||
| 2dea42cea6 | |||
| 461b1aec64 | |||
| 6282fcdeb0 | |||
| a5dc13e3be | |||
| 92b9746787 | |||
| b213628fd6 | |||
| 2f01fcc8d2 | |||
| ad3ea71c59 | |||
| 67f3880165 | |||
| 3ac958441e | |||
| 94ac42eec9 | |||
| abe64591c7 | |||
| b8cfaa3afa | |||
| 0c72bc426c | |||
| d640d4a7f9 | |||
| 97aafadf2c | |||
| 1b200be545 | |||
| 9f55322d36 | |||
| a97b0c02af | |||
| 3b3cca230a | |||
| 1c9ddd8c15 | |||
| 1ba69deb30 | |||
| 696a9441a9 | |||
| 473c009879 | |||
| eb2737189a | |||
| 2314a5603e | |||
| 5a489836cd | |||
| 5e42a40911 | |||
| 00cac8002b | |||
| cc24aa8f76 | |||
| ea1b83a4e7 | |||
| be1641434b | |||
| 125991b566 | |||
| 2ce47a8e9c | |||
| 5fe9038e33 | |||
| 55bf9fc2fe | |||
| 06bff96310 | |||
| 41d8e4a73b | |||
| 90178d3027 | |||
| 75522066c1 | |||
| b43d83f43f | |||
| 8f03f2a714 | |||
| 7f13a960a2 | |||
| 5fb4423a6c | |||
| 0a86cc99ef | |||
| 704511c96e | |||
| 136a444565 | |||
| 7132effa91 | |||
| b9d1cb3b20 | |||
| f5c55c5e23 | |||
| a834a06dbd | |||
| ed794337e7 | |||
| a23f778e11 | |||
| 6618c5564d | |||
| 9c04586861 | |||
| 222acd1362 | |||
| 4ef65c1ccf | |||
| 39cd92c743 | |||
| 5c08fb8e3b | |||
| b510468c6e | |||
| 6fb1e9f05f | |||
| c4f44ae0ca | |||
| 8a093a3f83 | |||
| e53c8824ac | |||
| 952542ae35 | |||
| cd6b9e835c | |||
| 311b9283c2 | |||
| 8c5775cbfc | |||
| d9da4c2652 | |||
| 26fab7399d | |||
| 50d0de5792 | |||
| 1cbfc66edf | |||
| b7c0c8ed99 | |||
| 42e44e34f9 | |||
| afb4d2e72a | |||
| c573dafe8e | |||
| 0d0c04ece2 | |||
| 144a4e3e06 | |||
| abfb16eb7f | |||
| b795c729d3 | |||
| 045aa4f358 | |||
| 9a9da5124f | |||
| b83fa59914 | |||
| 5d993e9868 | |||
| accf58d965 | |||
| 4aefb910bc | |||
| 9119bd5e33 | |||
| d05542dbf5 | |||
| 7917c7b1cc | |||
| b45cc3cd63 | |||
| f227bbe7f2 | |||
| e34b0f3437 | |||
| bdffbe5671 | |||
| 2742886134 | |||
| 8c333e6e07 | |||
| 3174c590c3 | |||
| a638442df8 | |||
| 11014739f2 | |||
| 9f9d76b8bc | |||
| fdd770b8fc | |||
| 5016af4cde | |||
| cb63295975 | |||
| 4665732e81 | |||
| 1aa0a9b5d8 | |||
| b5ce567ffd | |||
| c2f32e3df8 | |||
| 2d0baf8fc5 | |||
| b133a194fb | |||
| 54bf9ef0e0 | |||
| 2e89aa0ad3 | |||
| d103797ba0 | |||
| bf3c081843 | |||
| 026badad96 | |||
| 2f605e9953 | |||
| 48cbbfd32a | |||
| 315b7e4f9f | |||
| d54abf8c63 | |||
| 693bf015f3 | |||
| 1b25bf1238 | |||
| 5b7e49f21d | |||
| dd3916c404 | |||
| 20ccd55c16 | |||
| eba708f018 | |||
| d1a0b80a53 | |||
| 36e238453f | |||
| 024cf82ab0 | |||
| abecb07ba1 | |||
| 6ab5c63435 | |||
| cae716acc3 | |||
| af2bfc1cc4 | |||
| e731babedb | |||
| f993ba5f89 | |||
| 0cea4bc738 | |||
| e7de6eafa3 | |||
| ef31de69c1 | |||
| 8d2184a4e7 | |||
| c116441212 | |||
| 37b5a9655c | |||
| 3ff432f152 | |||
| ce48bf1819 | |||
| 920197398b | |||
| ae5421ecbd | |||
| 0c07c53ce3 | |||
| d2e59fd645 | |||
| c8d06c402e | |||
| 101e243372 | |||
| 9d585edc46 | |||
| 90ee0a4d66 | |||
| e181f1f98e | |||
| 492f0c3b10 | |||
| 8efb3c50e5 | |||
| a9d32b7bef | |||
| f089fc8e25 | |||
| f0bb0982ee | |||
| 1ca81fbb16 | |||
| c551e30350 | |||
| 44e583a554 | |||
| d67c4e2f6b | |||
| 601b99b394 | |||
| ba4b238a00 | |||
| 412f9740b0 | |||
| bcfa7edff1 | |||
| 7be61df6ec | |||
| c097cd2d3b | |||
| a9932027fa | |||
| 2aa335144c | |||
| 3acd900bdf | |||
| 68535657df | |||
| 1c7f811b32 | |||
| ffff5f3f6f | |||
| d24b02ea79 | |||
| d3b5b8fa60 | |||
| b6c2a2b06e | |||
| f824343f8c | |||
| 7978810afe | |||
| 2b8e2362b7 | |||
| f5aa83cad7 | |||
| c7e62553e5 | |||
| bb064cd074 | |||
| 3796b33e6a | |||
| 14a1f49011 | |||
| f22cddb9ee | |||
| 9d7a9f1e21 | |||
| e220197b6b | |||
| dcc3eac579 | |||
| 6269da241b | |||
| ffc2b972ab | |||
| 8e28b626a9 | |||
| d50e3713c3 | |||
| 7586509525 | |||
| 3ee31ec562 | |||
| 1075e35327 | |||
| 9b211b76c6 | |||
| c863a35662 | |||
| 758e647d91 | |||
| 7ba8f348dc | |||
| 0645a3ae65 | |||
| 564d57ec07 | |||
| 3cd6fad5aa | |||
| f2268fadbc | |||
| d7f8a5b631 | |||
| d68ac05bae | |||
| ae58f6cc06 | |||
| ae4e5171ef | |||
| 51a1a5f12b | |||
| 0d0c4ceaea | |||
| eee83a0d38 | |||
| f065438111 | |||
| b5dd84222f | |||
| c0454408a8 | |||
| 36ea84e06b | |||
| 9cb7c4b634 | |||
| a05fcb6e1d | |||
| af0e3f19fa | |||
| 8c8a953d29 | |||
| b8181ce76d | |||
| 5fc1788d37 | |||
| 96a7e2d5a5 | |||
| 8555513247 | |||
| 93bb67024f | |||
| cdc772759e | |||
| 19c73f8b66 | |||
| d54076ea97 | |||
| 42e590a8fc | |||
| 52354e73c7 | |||
| 4e6e1bc568 | |||
| da9d0df373 | |||
| 751c92821a | |||
| 0c537d8c0e | |||
| 92282bffa7 | |||
| 4aee236c6b | |||
| d79bf6f268 | |||
| 6bd04ddcda | |||
| 10666f5c1e | |||
| 30222e8538 | |||
| 31698ecaf7 | |||
| fdb3d0ef58 | |||
| 38e7b30ef7 | |||
| 60fc0ac05f | |||
| c925b42941 | |||
| 8ccf1386de | |||
| e25570fb93 | |||
| f5d895c812 | |||
| c325ab8a39 | |||
| e69019f962 | |||
| 292349c4d3 | |||
| e22f391af2 | |||
| 6b80574d10 | |||
| 1b14a36a35 | |||
| 17eace65e2 | |||
| 2d973955a9 | |||
| d99a2cea8f | |||
| 8cc6848d67 | |||
| 8f15ef3fbb | |||
| 9ce38e0161 | |||
| d5797546e1 | |||
| aa48f4d7b7 | |||
| a7b3ac780a | |||
| 0616997957 | |||
| 4241b87800 | |||
| b8333732fa | |||
| 9e2d7181ae | |||
| 403723dc82 | |||
| b5f22dcb5d |
@@ -42,13 +42,13 @@ REM Copy the relavant include headers
|
|||||||
|
|
||||||
copy include\openthread\commissioner.h release\include\openthread
|
copy include\openthread\commissioner.h release\include\openthread
|
||||||
copy include\openthread\dataset.h release\include\openthread
|
copy include\openthread\dataset.h release\include\openthread
|
||||||
|
copy include\openthread\error.h release\include\openthread
|
||||||
copy include\openthread\instance.h release\include\openthread
|
copy include\openthread\instance.h release\include\openthread
|
||||||
copy include\openthread\ip6.h release\include\openthread
|
copy include\openthread\ip6.h release\include\openthread
|
||||||
copy include\openthread\joiner.h release\include\openthread
|
copy include\openthread\joiner.h release\include\openthread
|
||||||
copy include\openthread\link.h release\include\openthread
|
copy include\openthread\link.h release\include\openthread
|
||||||
copy include\openthread\message.h release\include\openthread
|
copy include\openthread\message.h release\include\openthread
|
||||||
copy include\openthread\netdata.h release\include\openthread
|
copy include\openthread\netdata.h release\include\openthread
|
||||||
copy include\openthread\openthread.h release\include\openthread
|
|
||||||
copy include\openthread\thread.h release\include\openthread
|
copy include\openthread\thread.h release\include\openthread
|
||||||
copy include\openthread\types.h release\include\openthread
|
copy include\openthread\types.h release\include\openthread
|
||||||
copy include\openthread\platform\toolchain.h release\include\openthread\platform
|
copy include\openthread\platform\toolchain.h release\include\openthread\platform
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
GitHub Issues are for bugs and feature requests. To make bugs and feature requests more easy to find and organize, we close issues that are deemed out of scope for GitHub Issues.
|
GitHub Issues are for bugs and feature requests. To make bugs and feature requests more easy to find and organize, we close issues that are deemed out of scope for GitHub Issues.
|
||||||
|
|
||||||
Usage questions? Post questions to [Stack Overflow](http://stackoverflow.com/) using the [[openthread] tag](http://stackoverflow.com/questions/tagged/openthread). We also use Google Groups for discussion and announcements:
|
The openthread-users Google Group is the recommended place for users to discuss OpenThread and interact directly with the OpenThread community. https://groups.google.com/forum/#!forum/openthread-users
|
||||||
|
|
||||||
* [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) - subscribe for release notes and new updates on OpenThread
|
|
||||||
* [openthread-users](https://groups.google.com/forum/#!forum/openthread-users) - the best place for users to discuss OpenThread and interact with the OpenThread team
|
|
||||||
* [openthread-devel](https://groups.google.com/forum/#!forum/openthread-devel) - team members discuss the on-going development of OpenThread
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Information to reproduce the behavior, including:
|
||||||
|
1. Git commit id
|
||||||
|
2. IEEE 802.15.4 hardware platform
|
||||||
|
3. Build steps
|
||||||
|
4. Network topology
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Console/log output**
|
||||||
|
If applicable, add console/log output to help explain your problem.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is.
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
+45
-14
@@ -26,7 +26,8 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
language: generic
|
language: python
|
||||||
|
python: "3.6"
|
||||||
|
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: trusty
|
||||||
@@ -47,17 +48,31 @@ after_success:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- env: BUILD_TARGET="posix-distcheck" CC=clang-5.0 CXX=clang++-5.0 VERBOSE=1 VIRTUAL_TIME=1
|
- env: BUILD_TARGET="posix-app-cli" VERBOSE=1 VIRTUAL_TIME=1
|
||||||
|
os: linux
|
||||||
|
compiler: gcc
|
||||||
|
- env: BUILD_TARGET="posix-app-ncp" VERBOSE=1 VIRTUAL_TIME=1
|
||||||
|
os: linux
|
||||||
|
compiler: gcc
|
||||||
|
- env: BUILD_TARGET="posix-app-pty" VERBOSE=1
|
||||||
|
os: linux
|
||||||
|
compiler: gcc
|
||||||
|
- env: BUILD_TARGET="android-build" VERBOSE=1
|
||||||
|
os: linux
|
||||||
|
python: "2.7"
|
||||||
|
- env: BUILD_TARGET="posix-distcheck" CC=clang-6.0 CXX=clang++-6.0 VERBOSE=1 VIRTUAL_TIME=1
|
||||||
os: linux
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- llvm-toolchain-trusty-5.0
|
- llvm-toolchain-trusty-6.0
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- clang-5.0
|
- clang-6.0
|
||||||
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1 VIRTUAL_TIME=1
|
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1 VIRTUAL_TIME=1
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
python: "2.7"
|
||||||
- env: BUILD_TARGET="posix-ncp" VERBOSE=1 VIRTUAL_TIME=1
|
- env: BUILD_TARGET="posix-ncp" VERBOSE=1 VIRTUAL_TIME=1
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
@@ -72,34 +87,36 @@ matrix:
|
|||||||
- llvm-toolchain-trusty-5.0
|
- llvm-toolchain-trusty-5.0
|
||||||
packages:
|
packages:
|
||||||
- clang-5.0
|
- clang-5.0
|
||||||
- env: BUILD_TARGET="scan-build" CC="clang" CXX="clang++"
|
- env: BUILD_TARGET="scan-build" CC="clang-6.0" CXX="clang++-6.0"
|
||||||
os: linux
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- llvm-toolchain-trusty-5.0
|
- llvm-toolchain-trusty-6.0
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- clang-5.0
|
- clang-6.0
|
||||||
- env: BUILD_TARGET="arm-gcc49"
|
- env: BUILD_TARGET="arm-gcc-4"
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
- env: BUILD_TARGET="arm-gcc54"
|
- env: BUILD_TARGET="arm-gcc-5"
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
- env: BUILD_TARGET="arm-gcc63"
|
- env: BUILD_TARGET="arm-gcc-6"
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
- env: BUILD_TARGET="arm-gcc7"
|
- env: BUILD_TARGET="arm-gcc-7"
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
- env: BUILD_TARGET="posix" CC=clang-5.0 CXX=clang++-5.0
|
- env: BUILD_TARGET="posix" CC=clang-6.0 CXX=clang++-6.0
|
||||||
os: linux
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- llvm-toolchain-trusty-5.0
|
- llvm-toolchain-trusty-6.0
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- clang-5.0
|
- clang-6.0
|
||||||
- env: BUILD_TARGET="posix" CC="gcc-5" CXX="g++-5"
|
- env: BUILD_TARGET="posix" CC="gcc-5" CXX="g++-5"
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
@@ -130,9 +147,23 @@ matrix:
|
|||||||
packages:
|
packages:
|
||||||
- gcc-7
|
- gcc-7
|
||||||
- g++-7
|
- g++-7
|
||||||
|
- env: BUILD_TARGET="posix" CC="gcc-8" CXX="g++-8"
|
||||||
|
os: linux
|
||||||
|
compiler: gcc
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- gcc-8
|
||||||
|
- g++-8
|
||||||
- env: BUILD_TARGET="posix-ncp-spi" VERBOSE=1
|
- env: BUILD_TARGET="posix-ncp-spi" VERBOSE=1
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1
|
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1 TORANJ_POSIX_APP_RCP_MODEL=1
|
||||||
|
os: linux
|
||||||
|
compiler: gcc
|
||||||
|
python: "2.7"
|
||||||
+50
-16
@@ -39,24 +39,60 @@ cd /tmp || die
|
|||||||
[ $TRAVIS_OS_NAME != linux ] || {
|
[ $TRAVIS_OS_NAME != linux ] || {
|
||||||
sudo apt-get update || die
|
sudo apt-get update || die
|
||||||
|
|
||||||
[ $BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-mtd -a $BUILD_TARGET != posix-ncp ] || {
|
[ $BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-app-cli -a $BUILD_TARGET != posix-mtd -a $BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ] || {
|
||||||
pip install --user --upgrade pip || die
|
pip install --upgrade pip || die
|
||||||
pip install --user -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
|
pip install -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
|
||||||
[ $BUILD_TARGET != posix-ncp ] || {
|
[ $BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ] || {
|
||||||
# Packages used by ncp tools.
|
# Packages used by ncp tools.
|
||||||
pip install --user git+https://github.com/openthread/pyspinel || die
|
pip install git+https://github.com/openthread/pyspinel || die
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ $BUILD_TARGET != android-build ] || {
|
||||||
|
sudo apt-get install -y bison gcc-multilib g++-multilib
|
||||||
|
(
|
||||||
|
cd $HOME
|
||||||
|
wget https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip
|
||||||
|
unzip android-ndk-r17c-linux-x86_64.zip > /dev/null
|
||||||
|
mv android-ndk-r17c ndk-bundle
|
||||||
|
) || die
|
||||||
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != pretty-check ] || {
|
[ $BUILD_TARGET != pretty-check ] || {
|
||||||
clang-format --version || die
|
clang-format --version || die
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ $BUILD_TARGET != posix-app-pty ] || {
|
||||||
|
sudo apt-get install socat expect libdbus-1-dev autoconf-archive || die
|
||||||
|
JOBS=$(getconf _NPROCESSORS_ONLN)
|
||||||
|
(
|
||||||
|
WPANTUND_TMPDIR=/tmp/wpantund
|
||||||
|
git clone --depth 1 https://github.com/openthread/wpantund.git $WPANTUND_TMPDIR
|
||||||
|
cd $WPANTUND_TMPDIR
|
||||||
|
./bootstrap.sh
|
||||||
|
./configure --prefix= --exec-prefix=/usr --disable-ncp-dummy --enable-static-link-ncp-plugin=spinel
|
||||||
|
make -j $JOBS
|
||||||
|
sudo make install
|
||||||
|
) || die
|
||||||
|
(
|
||||||
|
LIBCOAP_TMPDIR=/tmp/libcoap
|
||||||
|
mkdir $LIBCOAP_TMPDIR
|
||||||
|
cd $LIBCOAP_TMPDIR
|
||||||
|
wget https://github.com/obgm/libcoap/archive/bsd-licensed.tar.gz
|
||||||
|
tar xvf bsd-licensed.tar.gz
|
||||||
|
cd libcoap-bsd-licensed
|
||||||
|
./autogen.sh
|
||||||
|
./configure --prefix= --exec-prefix=/usr --with-boost=internal --disable-tests --disable-documentation
|
||||||
|
make -j $JOBS
|
||||||
|
sudo make install
|
||||||
|
) || die
|
||||||
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != scan-build ] || {
|
[ $BUILD_TARGET != scan-build ] || {
|
||||||
sudo apt-get install clang || die
|
sudo apt-get install clang || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc49 ] || {
|
[ $BUILD_TARGET != arm-gcc-4 ] || {
|
||||||
sudo apt-get install lib32z1 || die
|
sudo apt-get install lib32z1 || die
|
||||||
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
||||||
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
||||||
@@ -64,16 +100,15 @@ cd /tmp || die
|
|||||||
arm-none-eabi-gcc --version || die
|
arm-none-eabi-gcc --version || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc54 ] || {
|
[ $BUILD_TARGET != arm-gcc-5 ] || {
|
||||||
sudo apt-get install lib32z1 || die
|
sudo apt-get install lib32z1 || die
|
||||||
wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
||||||
tar xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
tar xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
||||||
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
||||||
arm-none-eabi-gcc --version || die
|
arm-none-eabi-gcc --version || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc63 ] || {
|
[ $BUILD_TARGET != arm-gcc-6 ] || {
|
||||||
sudo apt-get install lib32z1 || die
|
|
||||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
||||||
tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
||||||
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
||||||
@@ -85,11 +120,10 @@ cd /tmp || die
|
|||||||
arc-elf32-gcc --version || die
|
arc-elf32-gcc --version || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc7 ] || {
|
[ $BUILD_TARGET != arm-gcc-7 ] || {
|
||||||
sudo apt-get install lib32z1 || die
|
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
|
||||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 || die
|
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
|
||||||
tar xjf gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 || die
|
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
|
||||||
export PATH=/tmp/gcc-arm-none-eabi-7-2017-q4-major/bin:$PATH || die
|
|
||||||
arm-none-eabi-gcc --version || die
|
arm-none-eabi-gcc --version || die
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +136,7 @@ cd /tmp || die
|
|||||||
sudo apt-get install llvm-3.4-runtime || die
|
sudo apt-get install llvm-3.4-runtime || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != posix -o $CC != clang ] || {
|
[ $BUILD_TARGET != posix -o "$CC" != clang ] || {
|
||||||
sudo apt-get install clang || die
|
sudo apt-get install clang || die
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Executable
+107
@@ -0,0 +1,107 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Run this command on parent directory of openthread
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Prepare android build system
|
||||||
|
# Globals:
|
||||||
|
# None
|
||||||
|
# Arguments:
|
||||||
|
# None
|
||||||
|
# Returns:
|
||||||
|
# None
|
||||||
|
#######################################
|
||||||
|
android_prepare_build_system()
|
||||||
|
{
|
||||||
|
# Android build system
|
||||||
|
(mkdir build && cd build && git init && git pull --depth 1 https://android.googlesource.com/platform/build 2db32730e79cafcf13e1f898a7bee7f82b0449d6)
|
||||||
|
ln -s build/core/main.mk Makefile
|
||||||
|
|
||||||
|
# Workarounds for java checking
|
||||||
|
export ANDROID_JAVA_HOME=/usr/lib/jvm/java-8-oracle
|
||||||
|
mkdir bin
|
||||||
|
cat > bin/java <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
echo java version \"1.6\"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > bin/javac <<EOF
|
||||||
|
echo javac \"1.6\"
|
||||||
|
EOF
|
||||||
|
chmod a+x bin/java bin/javac
|
||||||
|
export PATH=$(pwd)/bin:$PATH
|
||||||
|
|
||||||
|
# Files for building ndk
|
||||||
|
mkdir -p system/core/include/arch/linux-arm
|
||||||
|
touch system/core/include/arch/linux-arm/AndroidConfig.h
|
||||||
|
|
||||||
|
mkdir -p system/core/include/arch/linux-x86
|
||||||
|
touch system/core/include/arch/linux-x86/AndroidConfig.h
|
||||||
|
|
||||||
|
ANDROID_NDK_PATH=$HOME/ndk-bundle
|
||||||
|
mkdir -p bionic/libc/
|
||||||
|
cp -r $ANDROID_NDK_PATH/sysroot/usr/include bionic/libc/include
|
||||||
|
mv bionic/libc/include/arm-linux-androideabi/asm bionic/libc/include/asm
|
||||||
|
|
||||||
|
mkdir -p out/target/product/generic/obj/
|
||||||
|
cp -r $ANDROID_NDK_PATH/platforms/android-27/arch-arm/usr/lib out/target/product/generic/obj/
|
||||||
|
|
||||||
|
mkdir -p bionic/libstdc++
|
||||||
|
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/include bionic/libstdc++
|
||||||
|
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include/* bionic/libstdc++/include
|
||||||
|
# The default libstdc++.so does not contain full stl implementation, see https://developer.android.com/ndk/guides/cpp-support
|
||||||
|
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so out/target/product/generic/obj/lib/libstdc++.so
|
||||||
|
|
||||||
|
# Build spec
|
||||||
|
cat > buildspec.mk <<EOF
|
||||||
|
TARGET_PRODUCT := generic
|
||||||
|
TARGET_BUILD_VARIANT := eng
|
||||||
|
TARGET_BUILD_TYPE := release
|
||||||
|
TARGET_TOOLS_PREFIX := $ANDROID_NDK_PATH/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
android_prepare_build_system
|
||||||
|
|
||||||
|
make showcommands ot-core
|
||||||
|
make showcommands ot-cli
|
||||||
|
make showcommands ot-ncp
|
||||||
|
|
||||||
|
test -x out/target/product/generic/system/bin/ot-cli
|
||||||
|
test -x out/target/product/generic/system/bin/ot-ncp
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
Executable
+115
@@ -0,0 +1,115 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo " *** ERROR: " $*
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
at_exit() {
|
||||||
|
EXIT_CODE=$?
|
||||||
|
sudo killall wpantund || true
|
||||||
|
killall socat || true
|
||||||
|
exit $EXIT_CODE
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
./bootstrap
|
||||||
|
COVERAGE=1 make -f examples/Makefile-posix
|
||||||
|
COVERAGE=1 make -f src/posix/Makefile-posix PLATFORM_UDP=1
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
trap at_exit INT TERM EXIT
|
||||||
|
|
||||||
|
SOCAT_OUTPUT=/tmp/ot-socat
|
||||||
|
socat -d -d pty,raw,b115200,echo=0 pty,raw,b115200,echo=0 > /dev/null 2> $SOCAT_OUTPUT &
|
||||||
|
while true; do
|
||||||
|
if test $(head -n2 $SOCAT_OUTPUT | wc -l) = 2; then
|
||||||
|
RADIO_PTY=$(head -n1 $SOCAT_OUTPUT | grep -o '/dev/.\+')
|
||||||
|
CORE_PTY=$(head -n2 $SOCAT_OUTPUT | tail -n1 | grep -o '/dev/.\+')
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo 'Waiting for socat ready...'
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo 'RADIO_PTY' $DEVICE_PTY
|
||||||
|
echo 'CORE_PTY' $CORE_PTY
|
||||||
|
|
||||||
|
RADIO_NCP_PATH="$(pwd)/$(ls output/*linux*/bin/ot-ncp-radio)"
|
||||||
|
$RADIO_NCP_PATH 1 > $RADIO_PTY < $RADIO_PTY &
|
||||||
|
OT_NCP_PATH="$(pwd)/$(ls output/posix/*linux*/bin/ot-ncp)"
|
||||||
|
PLATFORM_NETIF=wpan0 sudo -E wpantund -I wpan0 -o Thread:Config:FilterRLOCAddresses 0 -s "system:${OT_NCP_PATH} ${CORE_PTY}" &
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
sleep 5
|
||||||
|
if sudo wpanctl status; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo 'Still waiting for wpantund'
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
sudo wpanctl leave || true
|
||||||
|
sudo wpanctl form -c 18 OpenThreadTest
|
||||||
|
|
||||||
|
mleid=$(sudo wpanctl status | grep MeshLocalAddress | cut -d'"' -f4)
|
||||||
|
echo "ML-EID is: ${mleid}"
|
||||||
|
|
||||||
|
netstat -an | grep -q 61631 || die 'TMF port is not available!'
|
||||||
|
xaddress=$(sudo wpanctl get 'NCP:ExtendedAddress' | cut -d= -f2 | tr -d ' []')
|
||||||
|
echo "Extended address is: ${xaddress}"
|
||||||
|
|
||||||
|
# Retrievie extended address through network diagnostic get
|
||||||
|
coap_response=$(echo -n '120100' | xxd -r -p | coap-client -m POST coap://[${mleid}]:61631/d/dg -f- | xxd -p -u | grep 0008)
|
||||||
|
echo "CoAP response is: ${coap_response}"
|
||||||
|
|
||||||
|
# Verify CoAP response contains the extended address
|
||||||
|
[[ "${coap_response}" = *${xaddress}* ]] || die 'failed to get extended address'
|
||||||
|
|
||||||
|
# Leave so that code coverage will be flushed
|
||||||
|
sudo wpanctl leave || true
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
case $1 in
|
||||||
|
check)
|
||||||
|
check
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
build
|
||||||
|
check
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
+113
-44
@@ -34,6 +34,8 @@ die() {
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
python --version || die
|
||||||
|
|
||||||
[ $BUILD_TARGET != pretty-check ] || {
|
[ $BUILD_TARGET != pretty-check ] || {
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
./configure || die
|
./configure || die
|
||||||
@@ -52,6 +54,7 @@ set -x
|
|||||||
--with-ncp-bus=uart \
|
--with-ncp-bus=uart \
|
||||||
--with-examples=posix \
|
--with-examples=posix \
|
||||||
--enable-application-coap \
|
--enable-application-coap \
|
||||||
|
--enable-application-coap-secure \
|
||||||
--enable-border-router \
|
--enable-border-router \
|
||||||
--enable-cert-log \
|
--enable-cert-log \
|
||||||
--enable-child-supervision \
|
--enable-child-supervision \
|
||||||
@@ -71,7 +74,11 @@ set -x
|
|||||||
scan-build --status-bugs -analyze-headers -v make || die
|
scan-build --status-bugs -analyze-headers -v make || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc49 ] || {
|
[ $BUILD_TARGET != android-build ] || {
|
||||||
|
(cd .. && ${TRAVIS_BUILD_DIR}/.travis/check-android-build) || die
|
||||||
|
}
|
||||||
|
|
||||||
|
[ $BUILD_TARGET != arm-gcc-4 ] || {
|
||||||
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH || die
|
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
@@ -104,13 +111,22 @@ set -x
|
|||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 TMF_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
||||||
|
|
||||||
|
git checkout -- . || die
|
||||||
|
git clean -xfd || die
|
||||||
|
./bootstrap || die
|
||||||
|
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
@@ -140,7 +156,7 @@ set -x
|
|||||||
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc54 ] || {
|
[ $BUILD_TARGET != arm-gcc-5 ] || {
|
||||||
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
@@ -173,13 +189,22 @@ set -x
|
|||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 TMF_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
||||||
|
|
||||||
|
git checkout -- . || die
|
||||||
|
git clean -xfd || die
|
||||||
|
./bootstrap || die
|
||||||
|
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
@@ -209,7 +234,7 @@ set -x
|
|||||||
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc63 ] || {
|
[ $BUILD_TARGET != arm-gcc-6 ] || {
|
||||||
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
@@ -221,14 +246,14 @@ set -x
|
|||||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
# git checkout -- . || die
|
git checkout -- . || die
|
||||||
# git clean -xfd || die
|
git clean -xfd || die
|
||||||
# ./bootstrap || die
|
./bootstrap || die
|
||||||
# COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
|
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
|
arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
|
arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
@@ -242,13 +267,22 @@ set -x
|
|||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 TMF_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
||||||
|
|
||||||
|
git checkout -- . || die
|
||||||
|
git clean -xfd || die
|
||||||
|
./bootstrap || die
|
||||||
|
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
@@ -289,8 +323,8 @@ set -x
|
|||||||
arc-elf32-size output/emsk/bin/ot-ncp-mtd || die
|
arc-elf32-size output/emsk/bin/ot-ncp-mtd || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != arm-gcc7 ] || {
|
[ $BUILD_TARGET != arm-gcc-7 ] || {
|
||||||
export PATH=/tmp/gcc-arm-none-eabi-7-2017-q4-major/bin:$PATH || die
|
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
@@ -301,14 +335,14 @@ set -x
|
|||||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
# git checkout -- . || die
|
git checkout -- . || die
|
||||||
# git clean -xfd || die
|
git clean -xfd || die
|
||||||
# ./bootstrap || die
|
./bootstrap || die
|
||||||
# COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
|
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
|
arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
|
arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
|
||||||
# arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
@@ -322,13 +356,22 @@ set -x
|
|||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 TMF_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 FULL_LOGS=1 JOINER=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
|
||||||
|
|
||||||
|
git checkout -- . || die
|
||||||
|
git clean -xfd || die
|
||||||
|
./bootstrap || die
|
||||||
|
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
|
||||||
|
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
@@ -345,17 +388,17 @@ set -x
|
|||||||
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
|
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
|
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
|
||||||
|
|
||||||
git checkout -- . || die
|
# git checkout -- . || die
|
||||||
git clean -xfd || die
|
# git clean -xfd || die
|
||||||
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
|
# wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
|
||||||
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
|
# unzip -qq asf-standalone-archive-3.36.0.58.zip || die
|
||||||
mv xdk-asf-3.36.0 third_party/microchip/asf || die
|
# mv xdk-asf-3.36.0 third_party/microchip/asf || die
|
||||||
./bootstrap || die
|
# ./bootstrap || die
|
||||||
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
|
# COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
|
||||||
arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
|
# arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
|
||||||
arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
|
# arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
|
||||||
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
|
# arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
|
||||||
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
# arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != posix ] || {
|
[ $BUILD_TARGET != posix ] || {
|
||||||
@@ -376,7 +419,9 @@ set -x
|
|||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
./configure \
|
./configure \
|
||||||
--enable-ncp-app=all \
|
--enable-ncp \
|
||||||
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
--with-ncp-bus=spi \
|
--with-ncp-bus=spi \
|
||||||
--with-examples=posix \
|
--with-examples=posix \
|
||||||
--enable-border-router \
|
--enable-border-router \
|
||||||
@@ -389,14 +434,15 @@ set -x
|
|||||||
--enable-channel-manager \
|
--enable-channel-manager \
|
||||||
--enable-channel-monitor \
|
--enable-channel-monitor \
|
||||||
--disable-docs \
|
--disable-docs \
|
||||||
--disable-test || die
|
--disable-tests || die
|
||||||
make -j 8 || die
|
make -j 8 || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
./configure \
|
./configure \
|
||||||
--enable-cli-app=mtd \
|
--enable-cli \
|
||||||
|
--enable-mtd \
|
||||||
--with-ncp-bus=spi \
|
--with-ncp-bus=spi \
|
||||||
--with-examples=posix \
|
--with-examples=posix \
|
||||||
--enable-border-router \
|
--enable-border-router \
|
||||||
@@ -405,15 +451,18 @@ set -x
|
|||||||
--enable-mac-filter \
|
--enable-mac-filter \
|
||||||
--enable-service \
|
--enable-service \
|
||||||
--disable-docs \
|
--disable-docs \
|
||||||
--disable-test || die
|
--disable-tests || die
|
||||||
make -j 8 || die
|
make -j 8 || die
|
||||||
|
|
||||||
git checkout -- . || die
|
git checkout -- . || die
|
||||||
git clean -xfd || die
|
git clean -xfd || die
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
./configure \
|
./configure \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
--enable-ncp \
|
||||||
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-radio-only \
|
||||||
--with-ncp-bus=uart \
|
--with-ncp-bus=uart \
|
||||||
--with-examples=posix || die
|
--with-examples=posix || die
|
||||||
make -j 8 || die
|
make -j 8 || die
|
||||||
@@ -432,6 +481,18 @@ set -x
|
|||||||
COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
|
COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ $BUILD_TARGET != posix-app-cli ] || {
|
||||||
|
./bootstrap || die
|
||||||
|
# enable code coverage for OpenThread transceiver only
|
||||||
|
COVERAGE=1 VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
|
||||||
|
COVERAGE=1 make -f src/posix/Makefile-posix || die
|
||||||
|
COVERAGE=1 PYTHONUNBUFFERED=1 OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli)" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-ncp-radio)" make -f src/posix/Makefile-posix check || die
|
||||||
|
}
|
||||||
|
|
||||||
|
[ $BUILD_TARGET != posix-app-pty ] || {
|
||||||
|
.travis/check-posix-app-pty || die
|
||||||
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != posix-mtd ] || {
|
[ $BUILD_TARGET != posix-mtd ] || {
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
|
COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
|
||||||
@@ -439,12 +500,20 @@ set -x
|
|||||||
|
|
||||||
[ $BUILD_TARGET != posix-ncp-spi ] || {
|
[ $BUILD_TARGET != posix-ncp-spi ] || {
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp-app=ftd --with-ncp-bus=spi --with-examples=posix" || die
|
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp --enable-ftd --with-ncp-bus=spi --with-examples=posix" || die
|
||||||
|
}
|
||||||
|
|
||||||
|
[ $BUILD_TARGET != posix-app-ncp ] || {
|
||||||
|
./bootstrap || die
|
||||||
|
COVERAGE=1 VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
|
||||||
|
# enable code coverage for OpenThread posix radio
|
||||||
|
COVERAGE=1 make -f src/posix/Makefile-posix || die
|
||||||
|
COVERAGE=1 PYTHONUNBUFFERED=1 OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-ncp-radio)" NODE_TYPE=ncp-sim make -f src/posix/Makefile-posix check || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != posix-ncp ] || {
|
[ $BUILD_TARGET != posix-ncp ] || {
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
|
COVERAGE=1 PYTHONUNBUFFERED=1 NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != toranj-test-framework ] || {
|
[ $BUILD_TARGET != toranj-test-framework ] || {
|
||||||
|
|||||||
+301
@@ -0,0 +1,301 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_MODULE := ot-core
|
||||||
|
LOCAL_MODULE_TAGS := eng
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := \
|
||||||
|
$(LOCAL_PATH)/include \
|
||||||
|
$(LOCAL_PATH)/src \
|
||||||
|
$(LOCAL_PATH)/src/cli \
|
||||||
|
$(LOCAL_PATH)/src/core \
|
||||||
|
$(LOCAL_PATH)/src/ncp \
|
||||||
|
$(LOCAL_PATH)/src/posix/platform \
|
||||||
|
$(LOCAL_PATH)/third_party \
|
||||||
|
$(LOCAL_PATH)/third_party/mbedtls \
|
||||||
|
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_CFLAGS := \
|
||||||
|
-D_GNU_SOURCE \
|
||||||
|
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
|
||||||
|
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||||
|
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
|
||||||
|
-DOPENTHREAD_FTD=1 \
|
||||||
|
-DOPENTHREAD_POSIX=1 \
|
||||||
|
-DOPENTHREAD_POSIX_APP=1 \
|
||||||
|
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
|
||||||
|
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
|
||||||
|
-Wno-error=non-virtual-dtor \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
src/core/api/border_router_api.cpp \
|
||||||
|
src/core/api/channel_manager_api.cpp \
|
||||||
|
src/core/api/channel_monitor_api.cpp \
|
||||||
|
src/core/api/child_supervision_api.cpp \
|
||||||
|
src/core/api/coap_api.cpp \
|
||||||
|
src/core/api/commissioner_api.cpp \
|
||||||
|
src/core/api/crypto_api.cpp \
|
||||||
|
src/core/api/dataset_api.cpp \
|
||||||
|
src/core/api/dataset_ftd_api.cpp \
|
||||||
|
src/core/api/dhcp6_api.cpp \
|
||||||
|
src/core/api/dns_api.cpp \
|
||||||
|
src/core/api/icmp6_api.cpp \
|
||||||
|
src/core/api/instance_api.cpp \
|
||||||
|
src/core/api/ip6_api.cpp \
|
||||||
|
src/core/api/jam_detection_api.cpp \
|
||||||
|
src/core/api/joiner_api.cpp \
|
||||||
|
src/core/api/link_api.cpp \
|
||||||
|
src/core/api/link_raw_api.cpp \
|
||||||
|
src/core/api/message_api.cpp \
|
||||||
|
src/core/api/netdata_api.cpp \
|
||||||
|
src/core/api/server_api.cpp \
|
||||||
|
src/core/api/tasklet_api.cpp \
|
||||||
|
src/core/api/thread_api.cpp \
|
||||||
|
src/core/api/thread_ftd_api.cpp \
|
||||||
|
src/core/api/udp_api.cpp \
|
||||||
|
src/core/coap/coap.cpp \
|
||||||
|
src/core/coap/coap_header.cpp \
|
||||||
|
src/core/coap/coap_secure.cpp \
|
||||||
|
src/core/common/crc16.cpp \
|
||||||
|
src/core/common/instance.cpp \
|
||||||
|
src/core/common/logging.cpp \
|
||||||
|
src/core/common/locator.cpp \
|
||||||
|
src/core/common/message.cpp \
|
||||||
|
src/core/common/notifier.cpp \
|
||||||
|
src/core/common/settings.cpp \
|
||||||
|
src/core/common/string.cpp \
|
||||||
|
src/core/common/tasklet.cpp \
|
||||||
|
src/core/common/timer.cpp \
|
||||||
|
src/core/common/tlvs.cpp \
|
||||||
|
src/core/common/trickle_timer.cpp \
|
||||||
|
src/core/crypto/aes_ccm.cpp \
|
||||||
|
src/core/crypto/aes_ecb.cpp \
|
||||||
|
src/core/crypto/hmac_sha256.cpp \
|
||||||
|
src/core/crypto/mbedtls.cpp \
|
||||||
|
src/core/crypto/pbkdf2_cmac.cpp \
|
||||||
|
src/core/crypto/sha256.cpp \
|
||||||
|
src/core/mac/mac.cpp \
|
||||||
|
src/core/mac/mac_filter.cpp \
|
||||||
|
src/core/mac/mac_frame.cpp \
|
||||||
|
src/core/meshcop/announce_begin_client.cpp \
|
||||||
|
src/core/meshcop/border_agent.cpp \
|
||||||
|
src/core/meshcop/commissioner.cpp \
|
||||||
|
src/core/meshcop/dataset.cpp \
|
||||||
|
src/core/meshcop/dataset_local.cpp \
|
||||||
|
src/core/meshcop/dataset_manager.cpp \
|
||||||
|
src/core/meshcop/dataset_manager_ftd.cpp \
|
||||||
|
src/core/meshcop/dtls.cpp \
|
||||||
|
src/core/meshcop/energy_scan_client.cpp \
|
||||||
|
src/core/meshcop/joiner.cpp \
|
||||||
|
src/core/meshcop/joiner_router.cpp \
|
||||||
|
src/core/meshcop/leader.cpp \
|
||||||
|
src/core/meshcop/meshcop.cpp \
|
||||||
|
src/core/meshcop/meshcop_tlvs.cpp \
|
||||||
|
src/core/meshcop/panid_query_client.cpp \
|
||||||
|
src/core/meshcop/timestamp.cpp \
|
||||||
|
src/core/net/dhcp6_client.cpp \
|
||||||
|
src/core/net/dhcp6_server.cpp \
|
||||||
|
src/core/net/dns_client.cpp \
|
||||||
|
src/core/net/icmp6.cpp \
|
||||||
|
src/core/net/ip6.cpp \
|
||||||
|
src/core/net/ip6_address.cpp \
|
||||||
|
src/core/net/ip6_filter.cpp \
|
||||||
|
src/core/net/ip6_headers.cpp \
|
||||||
|
src/core/net/ip6_mpl.cpp \
|
||||||
|
src/core/net/ip6_routes.cpp \
|
||||||
|
src/core/net/netif.cpp \
|
||||||
|
src/core/net/udp6.cpp \
|
||||||
|
src/core/thread/address_resolver.cpp \
|
||||||
|
src/core/thread/announce_begin_server.cpp \
|
||||||
|
src/core/thread/announce_sender.cpp \
|
||||||
|
src/core/thread/child_table.cpp \
|
||||||
|
src/core/thread/data_poll_manager.cpp \
|
||||||
|
src/core/thread/energy_scan_server.cpp \
|
||||||
|
src/core/thread/key_manager.cpp \
|
||||||
|
src/core/thread/link_quality.cpp \
|
||||||
|
src/core/thread/lowpan.cpp \
|
||||||
|
src/core/thread/mesh_forwarder.cpp \
|
||||||
|
src/core/thread/mesh_forwarder_ftd.cpp \
|
||||||
|
src/core/thread/mesh_forwarder_mtd.cpp \
|
||||||
|
src/core/thread/mle.cpp \
|
||||||
|
src/core/thread/mle_router.cpp \
|
||||||
|
src/core/thread/network_data.cpp \
|
||||||
|
src/core/thread/network_data_leader.cpp \
|
||||||
|
src/core/thread/network_data_leader_ftd.cpp \
|
||||||
|
src/core/thread/network_data_local.cpp \
|
||||||
|
src/core/thread/network_diagnostic.cpp \
|
||||||
|
src/core/thread/panid_query_server.cpp \
|
||||||
|
src/core/thread/router_table.cpp \
|
||||||
|
src/core/thread/src_match_controller.cpp \
|
||||||
|
src/core/thread/thread_netif.cpp \
|
||||||
|
src/core/thread/topology.cpp \
|
||||||
|
src/core/utils/channel_manager.cpp \
|
||||||
|
src/core/utils/channel_monitor.cpp \
|
||||||
|
src/core/utils/child_supervision.cpp \
|
||||||
|
src/core/utils/heap.cpp \
|
||||||
|
src/core/utils/jam_detector.cpp \
|
||||||
|
src/core/utils/missing_strlcpy.c \
|
||||||
|
src/core/utils/missing_strlcat.c \
|
||||||
|
src/core/utils/missing_strnlen.c \
|
||||||
|
src/core/utils/parse_cmdline.cpp \
|
||||||
|
src/core/utils/slaac_address.cpp \
|
||||||
|
src/diag/diag_process.cpp \
|
||||||
|
src/diag/openthread-diag.cpp \
|
||||||
|
src/ncp/hdlc.cpp \
|
||||||
|
src/ncp/ncp_spi.cpp \
|
||||||
|
src/ncp/spinel.c \
|
||||||
|
src/ncp/spinel_decoder.cpp \
|
||||||
|
src/ncp/spinel_encoder.cpp \
|
||||||
|
src/posix/platform/alarm.c \
|
||||||
|
src/posix/platform/misc.c \
|
||||||
|
src/posix/platform/logging.c \
|
||||||
|
src/posix/platform/random.c \
|
||||||
|
src/posix/platform/system.c \
|
||||||
|
src/posix/platform/uart.c \
|
||||||
|
src/posix/platform/spi-stubs.c \
|
||||||
|
src/posix/platform/frame_queue.cpp \
|
||||||
|
src/posix/platform/radio_spinel.cpp \
|
||||||
|
src/posix/platform/settings.cpp \
|
||||||
|
third_party/mbedtls/repo/library/md.c \
|
||||||
|
third_party/mbedtls/repo/library/md_wrap.c \
|
||||||
|
third_party/mbedtls/repo/library/memory_buffer_alloc.c \
|
||||||
|
third_party/mbedtls/repo/library/platform.c \
|
||||||
|
third_party/mbedtls/repo/library/sha256.c \
|
||||||
|
third_party/mbedtls/repo/library/bignum.c \
|
||||||
|
third_party/mbedtls/repo/library/ccm.c \
|
||||||
|
third_party/mbedtls/repo/library/cipher.c \
|
||||||
|
third_party/mbedtls/repo/library/cipher_wrap.c \
|
||||||
|
third_party/mbedtls/repo/library/cmac.c \
|
||||||
|
third_party/mbedtls/repo/library/ctr_drbg.c \
|
||||||
|
third_party/mbedtls/repo/library/debug.c \
|
||||||
|
third_party/mbedtls/repo/library/ecjpake.c \
|
||||||
|
third_party/mbedtls/repo/library/ecp_curves.c \
|
||||||
|
third_party/mbedtls/repo/library/entropy.c \
|
||||||
|
third_party/mbedtls/repo/library/entropy_poll.c \
|
||||||
|
third_party/mbedtls/repo/library/ssl_cookie.c \
|
||||||
|
third_party/mbedtls/repo/library/ssl_ciphersuites.c \
|
||||||
|
third_party/mbedtls/repo/library/ssl_cli.c \
|
||||||
|
third_party/mbedtls/repo/library/ssl_srv.c \
|
||||||
|
third_party/mbedtls/repo/library/ssl_ticket.c \
|
||||||
|
third_party/mbedtls/repo/library/ssl_tls.c \
|
||||||
|
third_party/mbedtls/repo/library/aes.c \
|
||||||
|
third_party/mbedtls/repo/library/ecp.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_MODULE := ot-cli
|
||||||
|
LOCAL_MODULE_TAGS := eng
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := \
|
||||||
|
$(LOCAL_PATH)/include \
|
||||||
|
$(LOCAL_PATH)/src \
|
||||||
|
$(LOCAL_PATH)/src/cli \
|
||||||
|
$(LOCAL_PATH)/src/core \
|
||||||
|
$(LOCAL_PATH)/src/posix/platform \
|
||||||
|
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_CFLAGS := \
|
||||||
|
-D_GNU_SOURCE \
|
||||||
|
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||||
|
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
|
||||||
|
-DOPENTHREAD_FTD=1 \
|
||||||
|
-DOPENTHREAD_POSIX=1 \
|
||||||
|
-DOPENTHREAD_POSIX_APP=2 \
|
||||||
|
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
|
||||||
|
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
|
||||||
|
-Wno-error=non-virtual-dtor \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_LDLIBS := \
|
||||||
|
-lutil
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
src/cli/cli.cpp \
|
||||||
|
src/cli/cli_coap.cpp \
|
||||||
|
src/cli/cli_console.cpp \
|
||||||
|
src/cli/cli_dataset.cpp \
|
||||||
|
src/cli/cli_uart.cpp \
|
||||||
|
src/cli/cli_udp_example.cpp \
|
||||||
|
src/posix/main.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_STATIC_LIBRARIES = ot-core
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_MODULE := ot-ncp
|
||||||
|
LOCAL_MODULE_TAGS := eng
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := \
|
||||||
|
$(LOCAL_PATH)/include \
|
||||||
|
$(LOCAL_PATH)/src \
|
||||||
|
$(LOCAL_PATH)/src/core \
|
||||||
|
$(LOCAL_PATH)/src/ncp \
|
||||||
|
$(LOCAL_PATH)/src/posix/platform \
|
||||||
|
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_CFLAGS := \
|
||||||
|
-D_GNU_SOURCE \
|
||||||
|
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||||
|
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
|
||||||
|
-DOPENTHREAD_FTD=1 \
|
||||||
|
-DOPENTHREAD_POSIX=1 \
|
||||||
|
-DOPENTHREAD_POSIX_APP=1 \
|
||||||
|
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
|
||||||
|
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
|
||||||
|
-Wno-error=non-virtual-dtor \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_LDLIBS := \
|
||||||
|
-lutil
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
src/ncp/changed_props_set.cpp \
|
||||||
|
src/ncp/ncp_base.cpp \
|
||||||
|
src/ncp/ncp_base_mtd.cpp \
|
||||||
|
src/ncp/ncp_base_ftd.cpp \
|
||||||
|
src/ncp/ncp_base_dispatcher.cpp \
|
||||||
|
src/ncp/ncp_buffer.cpp \
|
||||||
|
src/ncp/ncp_uart.cpp \
|
||||||
|
src/posix/main.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_STATIC_LIBRARIES = ot-core
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
+8
-4
@@ -33,25 +33,29 @@ AM_MAKEFLAGS = --no-print-directory
|
|||||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||||
--enable-address-sanitizer \
|
--enable-address-sanitizer \
|
||||||
--enable-application-coap \
|
--enable-application-coap \
|
||||||
|
--enable-application-coap-secure \
|
||||||
--enable-border-router \
|
--enable-border-router \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-commissioner \
|
--enable-commissioner \
|
||||||
--enable-dhcp6-client \
|
--enable-dhcp6-client \
|
||||||
--enable-dhcp6-server \
|
--enable-dhcp6-server \
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
--enable-dns-client \
|
--enable-dns-client \
|
||||||
|
--enable-ftd \
|
||||||
--enable-joiner \
|
--enable-joiner \
|
||||||
--enable-mac-filter \
|
--enable-mac-filter \
|
||||||
--enable-ncp-app=all \
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
--enable-service \
|
--enable-service \
|
||||||
--with-examples=posix \
|
--with-examples=posix \
|
||||||
--with-ncp-bus=uart \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
include \
|
include \
|
||||||
src \
|
|
||||||
third_party \
|
third_party \
|
||||||
|
src \
|
||||||
examples \
|
examples \
|
||||||
tests \
|
tests \
|
||||||
tools \
|
tools \
|
||||||
|
|||||||
+407
-215
@@ -68,7 +68,7 @@ AC_SUBST(LIBOPENTHREAD_VERSION_INFO, [${LIBOPENTHREAD_VERSION_CURRENT}:${LIB
|
|||||||
# Check the sanity of the source directory by checking for the
|
# Check the sanity of the source directory by checking for the
|
||||||
# presence of a key watch file
|
# presence of a key watch file
|
||||||
#
|
#
|
||||||
AC_CONFIG_SRCDIR([include/openthread/openthread.h])
|
AC_CONFIG_SRCDIR([include/openthread/error.h])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tell autoconf where to find auxilliary build tools (e.g. config.guess,
|
# Tell autoconf where to find auxilliary build tools (e.g. config.guess,
|
||||||
@@ -233,7 +233,7 @@ AC_PATH_PROG(CMP, cmp)
|
|||||||
#
|
#
|
||||||
|
|
||||||
PROSPECTIVE_CFLAGS="-Wall -Wextra -Wshadow -Werror -std=c99 -pedantic-errors"
|
PROSPECTIVE_CFLAGS="-Wall -Wextra -Wshadow -Werror -std=c99 -pedantic-errors"
|
||||||
PROSPECTIVE_CXXFLAGS="-Wall -Wextra -Wshadow -Werror -std=gnu++98 -Wno-c++14-compat"
|
PROSPECTIVE_CXXFLAGS="-Wall -Wextra -Wshadow -Werror -std=gnu++98 -Wno-c++14-compat -fno-exceptions -fno-rtti"
|
||||||
|
|
||||||
AC_CACHE_CHECK([whether $CC is Clang],
|
AC_CACHE_CHECK([whether $CC is Clang],
|
||||||
[nl_cv_clang],
|
[nl_cv_clang],
|
||||||
@@ -373,177 +373,6 @@ NL_ENABLE_TESTS([yes])
|
|||||||
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"])
|
AM_CONDITIONAL([OPENTHREAD_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"])
|
||||||
|
|
||||||
#
|
|
||||||
# CLI Library
|
|
||||||
#
|
|
||||||
AC_ARG_ENABLE(cli-app,
|
|
||||||
[AS_HELP_STRING([--enable-cli-app],[Enable CLI support (no|mtd|ftd|all) @<:@default=no@:>@.])],
|
|
||||||
[
|
|
||||||
case "${enableval}" in
|
|
||||||
all|both)
|
|
||||||
enable_cli_app=yes
|
|
||||||
enable_cli_app_mtd=yes
|
|
||||||
enable_cli_app_ftd=yes
|
|
||||||
;;
|
|
||||||
no|yes)
|
|
||||||
enable_cli_app=${enableval}
|
|
||||||
enable_cli_app_mtd=${enableval}
|
|
||||||
enable_cli_app_ftd=${enableval}
|
|
||||||
;;
|
|
||||||
mtd)
|
|
||||||
enable_cli_app=yes
|
|
||||||
enable_cli_app_mtd=yes
|
|
||||||
enable_cli_app_ftd=no
|
|
||||||
;;
|
|
||||||
ftd)
|
|
||||||
enable_cli_app=yes
|
|
||||||
enable_cli_app_mtd=no
|
|
||||||
enable_cli_app_ftd=yes
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([Invalid value ${enableval} for --enable-cli-app])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
],
|
|
||||||
[
|
|
||||||
enable_cli_app=no
|
|
||||||
enable_cli_app_mtd=no
|
|
||||||
enable_cli_app_ftd=no])
|
|
||||||
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([cli-app modes])
|
|
||||||
AC_MSG_RESULT(${enable_cli_app})
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_CLI], [test "${enable_cli_app}" == "yes"])
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_CLI_MTD], [test "${enable_cli_app_mtd}" == "yes"])
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_CLI_FTD], [test "${enable_cli_app_ftd}" == "yes"])
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_CLI)
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_CLI_FTD)
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_CLI_MTD)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# NCP app
|
|
||||||
#
|
|
||||||
AC_ARG_ENABLE(ncp-app,
|
|
||||||
[AS_HELP_STRING([--enable-ncp-app],[Enable NCP support (no|mtd|ftd|radio|all) @<:@default=no@:>@.])],
|
|
||||||
[
|
|
||||||
# Map all & both to yes
|
|
||||||
case "${enableval}" in
|
|
||||||
all)
|
|
||||||
enableval=yes
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "${enableval}" in
|
|
||||||
|
|
||||||
no|yes)
|
|
||||||
enable_ncp_app=${enableval}
|
|
||||||
enable_ncp_app_mtd=${enableval}
|
|
||||||
enable_ncp_app_ftd=${enableval}
|
|
||||||
enable_ncp_app_radio=${enableval}
|
|
||||||
;;
|
|
||||||
|
|
||||||
mtd)
|
|
||||||
enable_ncp_app=yes
|
|
||||||
enable_ncp_app_mtd=yes
|
|
||||||
enable_ncp_app_ftd=no
|
|
||||||
enable_ncp_app_radio=no
|
|
||||||
;;
|
|
||||||
|
|
||||||
ftd)
|
|
||||||
enable_ncp_app=yes
|
|
||||||
enable_ncp_app_mtd=no
|
|
||||||
enable_ncp_app_ftd=yes
|
|
||||||
enable_ncp_app_radio=no
|
|
||||||
;;
|
|
||||||
|
|
||||||
radio)
|
|
||||||
enable_ncp_app=yes
|
|
||||||
enable_ncp_app_mtd=no
|
|
||||||
enable_ncp_app_ftd=no
|
|
||||||
enable_ncp_app_radio=yes
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([Invalid value ${enableval} for --enable-ncp-app])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
],
|
|
||||||
[
|
|
||||||
enable_ncp_app=no
|
|
||||||
enable_ncp_app_ftd=no
|
|
||||||
enable_ncp_app_mtd=no
|
|
||||||
enable_ncp_app_radio=no
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([ncp-app modes])
|
|
||||||
AC_MSG_RESULT(${enable_ncp_app})
|
|
||||||
AC_MSG_CHECKING([should NCP support ftd])
|
|
||||||
AC_MSG_RESULT(${enable_ncp_app_ftd})
|
|
||||||
AC_MSG_CHECKING([should NCP support mtd])
|
|
||||||
AC_MSG_RESULT(${enable_ncp_app_mtd})
|
|
||||||
AC_MSG_CHECKING([should NCP support radio-only])
|
|
||||||
AC_MSG_RESULT(${enable_ncp_app_radio})
|
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_NCP)
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_NCP_MTD)
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_NCP_FTD)
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_NCP_RADIO)
|
|
||||||
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP], [test "${enable_ncp_app}" == "yes"])
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_MTD], [test "${enable_ncp_app_mtd}" == "yes"])
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_FTD], [test "${enable_ncp_app_ftd}" == "yes"])
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_RADIO], [test "${enable_ncp_app_radio}" == "yes"])
|
|
||||||
|
|
||||||
#
|
|
||||||
# NCP BUS - how does the NCP talk to the host?
|
|
||||||
#
|
|
||||||
|
|
||||||
AC_ARG_WITH(
|
|
||||||
[ncp-bus],
|
|
||||||
[AS_HELP_STRING([--with-ncp-bus],[Specify the NCP bus (none|spi|uart) @<:@default=none@:>@.])],
|
|
||||||
[
|
|
||||||
case "${with_ncp_bus}" in
|
|
||||||
"none")
|
|
||||||
OPENTHREAD_ENABLE_NCP_SPI=0
|
|
||||||
OPENTHREAD_ENABLE_NCP_UART=0
|
|
||||||
;;
|
|
||||||
"spi")
|
|
||||||
OPENTHREAD_ENABLE_NCP_SPI=1
|
|
||||||
OPENTHREAD_ENABLE_NCP_UART=0
|
|
||||||
;;
|
|
||||||
"uart")
|
|
||||||
OPENTHREAD_ENABLE_NCP_SPI=0
|
|
||||||
OPENTHREAD_ENABLE_NCP_UART=1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([unexpected --with-ncp-bus=${with_ncp_bus}])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
],
|
|
||||||
[
|
|
||||||
OPENTHREAD_ENABLE_NCP_SPI=0
|
|
||||||
OPENTHREAD_ENABLE_NCP_UART=0
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_NCP_SPI)
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_SPI], [test "${with_ncp_bus}" = "spi"])
|
|
||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_SPI],[${OPENTHREAD_ENABLE_NCP_SPI}],[Define to 1 to enable the NCP SPI interface.])
|
|
||||||
AC_MSG_CHECKING([should NCP support SPI])
|
|
||||||
AC_MSG_RESULT([${OPENTHREAD_ENABLE_SPI}])
|
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_NCP_UART)
|
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_UART], [test "${with_ncp_bus}" = "uart"])
|
|
||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_UART],[${OPENTHREAD_ENABLE_NCP_UART}],[Define to 1 to enable the NCP UART interface.])
|
|
||||||
AC_MSG_CHECKING([should NCP support UART])
|
|
||||||
AC_MSG_RESULT([${OPENTHREAD_ENABLE_UART}])
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Multiple OpenThread Instances
|
# Multiple OpenThread Instances
|
||||||
#
|
#
|
||||||
@@ -598,7 +427,6 @@ AC_ARG_ENABLE(builtin-mbedtls,
|
|||||||
if test "$enable_builtin_mbedtls" = "yes" -a ! "${MBEDTLS_CPPFLAGS}"; then
|
if test "$enable_builtin_mbedtls" = "yes" -a ! "${MBEDTLS_CPPFLAGS}"; then
|
||||||
MBEDTLS_CPPFLAGS="-I\${abs_top_srcdir}/third_party/mbedtls"
|
MBEDTLS_CPPFLAGS="-I\${abs_top_srcdir}/third_party/mbedtls"
|
||||||
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -I\${abs_top_srcdir}/third_party/mbedtls/repo/include"
|
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -I\${abs_top_srcdir}/third_party/mbedtls/repo/include"
|
||||||
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -I\${abs_top_srcdir}/third_party/mbedtls/repo/include/mbedtls"
|
|
||||||
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
|
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
|
||||||
fi
|
fi
|
||||||
AC_MSG_CHECKING([whether mbed TLS should be enabled])
|
AC_MSG_CHECKING([whether mbed TLS should be enabled])
|
||||||
@@ -606,36 +434,303 @@ AC_MSG_RESULT(${enable_builtin_mbedtls})
|
|||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_BUILTIN_MBEDTLS], [test "${enable_builtin_mbedtls}" = "yes"])
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_BUILTIN_MBEDTLS], [test "${enable_builtin_mbedtls}" = "yes"])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Thread TMF Proxy
|
# POSIX Application
|
||||||
#
|
#
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to enable TMF proxy])
|
AC_MSG_CHECKING([whether to build POSIX applicaton])
|
||||||
AC_ARG_ENABLE(tmf_proxy,
|
AC_ARG_ENABLE(posix-app,
|
||||||
[AS_HELP_STRING([--enable-tmf-proxy],[Enable TMF proxy support @<:@default=no@:>@.])],
|
[AS_HELP_STRING([--enable-posix-app], [Build POSIX application @<:@default=no@:>@.])],
|
||||||
[
|
[
|
||||||
case "${enableval}" in
|
case "${enableval}" in
|
||||||
|
|
||||||
no|yes)
|
no|yes)
|
||||||
enable_tmf_proxy=${enableval}
|
enable_posix_app=${enableval}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
AC_MSG_ERROR([Invalid value ${enable_tmf_proxy} for --enable-tmf-proxy])
|
AC_MSG_ERROR([Invalid value ${enable_posix_app} for --enable-posix-app])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
],
|
],
|
||||||
[enable_tmf_proxy=no])
|
[enable_posix_app=no])
|
||||||
|
|
||||||
if test "$enable_tmf_proxy" = "yes"; then
|
if test "$enable_posix_app" = "yes"; then
|
||||||
OPENTHREAD_ENABLE_TMF_PROXY=1
|
OPENTHREAD_ENABLE_POSIX_APP=1
|
||||||
else
|
else
|
||||||
OPENTHREAD_ENABLE_TMF_PROXY=0
|
OPENTHREAD_ENABLE_POSIX_APP=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_RESULT(${enable_tmf_proxy})
|
AC_MSG_RESULT(${enable_posix_app})
|
||||||
AC_SUBST(OPENTHREAD_ENABLE_TMF_PROXY)
|
AC_SUBST(OPENTHREAD_ENABLE_POSIX_APP)
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_TMF_PROXY], [test "${enable_tmf_proxy}" = "yes"])
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_POSIX_APP], [test "${enable_posix_app}" = "yes"])
|
||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_TMF_PROXY],[${OPENTHREAD_ENABLE_TMF_PROXY}],[Define to 1 to enable the TMF proxy feature.])
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_POSIX_APP], [${OPENTHREAD_ENABLE_POSIX_APP}], [Define to 1 to build posix application.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# FTD Library
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to build FTD library])
|
||||||
|
AC_ARG_ENABLE(ftd,
|
||||||
|
[AS_HELP_STRING([--enable-ftd], [Build FTD library @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_ftd=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_ftd} for --enable-ftd])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_ftd=no])
|
||||||
|
|
||||||
|
if test "$enable_ftd" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_FTD=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_FTD=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_ftd})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_FTD)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_FTD], [test "${enable_ftd}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_FTD], [${OPENTHREAD_ENABLE_FTD}], [Define to 1 to build FTD library.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# MTD Library
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to build MTD library])
|
||||||
|
AC_ARG_ENABLE(mtd,
|
||||||
|
[AS_HELP_STRING([--enable-mtd], [Build MTD library @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_mtd=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_mtd} for --enable-mtd])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_mtd=no])
|
||||||
|
|
||||||
|
if test "$enable_mtd" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_MTD=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_MTD=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_mtd})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_MTD)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_MTD], [test "${enable_mtd}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MTD], [${OPENTHREAD_ENABLE_MTD}], [Define to 1 to build MTD library.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Radio Library
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to build radio-only library])
|
||||||
|
AC_ARG_ENABLE(radio-only,
|
||||||
|
[AS_HELP_STRING([--enable-radio-only], [Build radio-only library @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_radio_only=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_radio_only} for --enable-radio-only])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_radio_only=no])
|
||||||
|
|
||||||
|
if test "$enable_radio_only" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_RADIO_ONLY=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_RADIO_ONLY=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_radio_only})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_RADIO_ONLY)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_RADIO_ONLY], [test "${enable_radio_only}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_RADIO_ONLY], [${OPENTHREAD_ENABLE_RADIO_ONLY}], [Define to 1 to build radio-only library.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# CLI Library
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to build CLI library])
|
||||||
|
AC_ARG_ENABLE(cli,
|
||||||
|
[AS_HELP_STRING([--enable-cli], [Build CLI library @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_cli=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_cli} for --enable-cli])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_cli=no])
|
||||||
|
|
||||||
|
if test "$enable_cli" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_CLI=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_CLI=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_cli})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_CLI)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_CLI], [test "${enable_cli}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_CLI], [${OPENTHREAD_ENABLE_CLI}], [Define to 1 to build CLI library.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# NCP Library
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to build NCP library])
|
||||||
|
AC_ARG_ENABLE(ncp,
|
||||||
|
[AS_HELP_STRING([--enable-ncp], [Build NCP library @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_ncp=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_ncp} for --enable-ncp])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_ncp=no])
|
||||||
|
|
||||||
|
if test "$enable_ncp" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_NCP=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_NCP=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_ncp})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_NCP)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP], [test "${enable_ncp}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP], [${OPENTHREAD_ENABLE_NCP}], [Define to 1 to build NCP library.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# NCP BUS - how does the NCP talk to the host?
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH(
|
||||||
|
[ncp-bus],
|
||||||
|
[AS_HELP_STRING([--with-ncp-bus],[Specify the NCP bus (none|spi|uart) @<:@default=none@:>@.])],
|
||||||
|
[
|
||||||
|
case "${with_ncp_bus}" in
|
||||||
|
"none")
|
||||||
|
OPENTHREAD_ENABLE_NCP_SPI=0
|
||||||
|
OPENTHREAD_ENABLE_NCP_UART=0
|
||||||
|
;;
|
||||||
|
"spi")
|
||||||
|
OPENTHREAD_ENABLE_NCP_SPI=1
|
||||||
|
OPENTHREAD_ENABLE_NCP_UART=0
|
||||||
|
;;
|
||||||
|
"uart")
|
||||||
|
OPENTHREAD_ENABLE_NCP_SPI=0
|
||||||
|
OPENTHREAD_ENABLE_NCP_UART=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([unexpected --with-ncp-bus=${with_ncp_bus}])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[
|
||||||
|
OPENTHREAD_ENABLE_NCP_SPI=0
|
||||||
|
OPENTHREAD_ENABLE_NCP_UART=0
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_NCP_SPI)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_SPI], [test "${with_ncp_bus}" = "spi"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_SPI],[${OPENTHREAD_ENABLE_NCP_SPI}],[Define to 1 to enable the NCP SPI interface.])
|
||||||
|
AC_MSG_CHECKING([should NCP support SPI])
|
||||||
|
AC_MSG_RESULT([${OPENTHREAD_ENABLE_SPI}])
|
||||||
|
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_NCP_UART)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_UART], [test "${with_ncp_bus}" = "uart"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_UART],[${OPENTHREAD_ENABLE_NCP_UART}],[Define to 1 to enable the NCP UART interface.])
|
||||||
|
AC_MSG_CHECKING([should NCP support UART])
|
||||||
|
AC_MSG_RESULT([${OPENTHREAD_ENABLE_UART}])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Thread UDP Proxy
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to enable UDP proxy])
|
||||||
|
AC_ARG_ENABLE(udp_proxy,
|
||||||
|
[AS_HELP_STRING([--enable-udp-proxy], [Enable UDP proxy support @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_udp_proxy=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_udp_proxy} for --enable-udp-proxy])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_udp_proxy=no])
|
||||||
|
|
||||||
|
if test "$enable_udp_proxy" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_UDP_PROXY=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_UDP_PROXY=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_udp_proxy})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_UDP_PROXY)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_UDP_PROXY], [test "${enable_udp_proxy}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_UDP_PROXY], [${OPENTHREAD_ENABLE_UDP_PROXY}], [Define to 1 to enable the UDP proxy feature.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Thread Border Agent
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to enable border agent])
|
||||||
|
AC_ARG_ENABLE(border_agent,
|
||||||
|
[AS_HELP_STRING([--enable-border-agent], [Enable border agent support @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_border_agent=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_border_agent} for --enable-border-agent])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_border_agent=no])
|
||||||
|
|
||||||
|
if test "${enable_border_agent}" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_BORDER_AGENT=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_BORDER_AGENT=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_border_agent})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_BORDER_AGENT)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_BORDER_AGENT], [test "${enable_border_agent}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_BORDER_AGENT], [${OPENTHREAD_ENABLE_BORDER_AGENT}], [Define to 1 to enable the border agent feature.])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Thread Network Diagnostic for MTD
|
# Thread Network Diagnostic for MTD
|
||||||
@@ -669,6 +764,66 @@ AC_SUBST(OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC)
|
|||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC], [test "${enable_mtd_network_diagnostic}" = "yes"])
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC], [test "${enable_mtd_network_diagnostic}" = "yes"])
|
||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC],[${OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC}],[Define to 1 to enable network diagnostic for MTD.])
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC],[${OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC}],[Define to 1 to enable network diagnostic for MTD.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Application CoAP Secure
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(application_coap_secure,
|
||||||
|
[AS_HELP_STRING([--enable-application-coap-secure],[Enable CoAP Secure to an application.@<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
|
||||||
|
no|yes)
|
||||||
|
enable_application_coap_secure=${enableval}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_application_coap_secure} for --enable-application-coap_secure])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_application_coap_secure=no])
|
||||||
|
|
||||||
|
if test "$enable_application_coap_secure" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE=1
|
||||||
|
enable_application_coap="yes"
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE], [test "${enable_application_coap_secure}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE],[${OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE}],[Define to 1 if you want to enable CoAP Secure to an application.])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Platform UDP
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(platform_udp,
|
||||||
|
[AS_HELP_STRING([--enable-platform-udp],[Enable platform UDP support @<:@default=no@:>@.])],
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
no|yes)
|
||||||
|
enable_platform_udp=${enableval}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value ${enable_platform_udp} for --enable-platform-udp])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[enable_platform_udp=no])
|
||||||
|
|
||||||
|
if test "$enable_platform_udp" = "yes"; then
|
||||||
|
OPENTHREAD_ENABLE_PLATFORM_UDP=1
|
||||||
|
else
|
||||||
|
OPENTHREAD_ENABLE_PLATFORM_UDP=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${enable_platform_udp})
|
||||||
|
AC_SUBST(OPENTHREAD_ENABLE_PLATFORM_UDP)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_PLATFORM_UDP], [test "${enable_platform_udp}" = "yes"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_PLATFORM_UDP], [${OPENTHREAD_ENABLE_PLATFORM_UDP}], [Define to 1 to enable platform UDP.])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Thread Commissioner
|
# Thread Commissioner
|
||||||
#
|
#
|
||||||
@@ -733,7 +888,7 @@ AC_SUBST(OPENTHREAD_ENABLE_JOINER)
|
|||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_JOINER], [test "${enable_joiner}" = "yes"])
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_JOINER], [test "${enable_joiner}" = "yes"])
|
||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_JOINER],[${OPENTHREAD_ENABLE_JOINER}],[Define to 1 to enable the joiner role.])
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_JOINER],[${OPENTHREAD_ENABLE_JOINER}],[Define to 1 to enable the joiner role.])
|
||||||
|
|
||||||
if test "${enable_commissioner}" = "yes" -o "${enable_joiner}" = "yes"; then
|
if test "${enable_commissioner}" = "yes" -o "${enable_joiner}" = "yes" -o "${enable_border_agent}" = "yes" -o "${enable_application_coap_secure}" = "yes"; then
|
||||||
enable_dtls="yes"
|
enable_dtls="yes"
|
||||||
OPENTHREAD_ENABLE_DTLS=1
|
OPENTHREAD_ENABLE_DTLS=1
|
||||||
else
|
else
|
||||||
@@ -1290,17 +1445,39 @@ AC_MSG_CHECKING([whether to enable linker map output])
|
|||||||
AC_MSG_RESULT(${enable_linker_map})
|
AC_MSG_RESULT(${enable_linker_map})
|
||||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_LINKER_MAP], [test "${enable_linker_map}" = "yes"])
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_LINKER_MAP], [test "${enable_linker_map}" = "yes"])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Custom linker file
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH(
|
||||||
|
[custom-linker-file],
|
||||||
|
[AS_HELP_STRING([--with-custom-linker-file=<linkerfile.ld>],[Specify custom linker file (absolute path). @<:@default=none@:>@.])],
|
||||||
|
[
|
||||||
|
with_custom_linker_file=yes
|
||||||
|
OPENTHREAD_CUSTOM_LINKER_FILE=${withval}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
with_custom_linker_file=no
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_SUBST(OPENTHREAD_CUSTOM_LINKER_FILE)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_CUSTOM_LINKER_FILE], [test "${with_custom_linker_file}" = "yes"])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Examples
|
# Examples
|
||||||
#
|
#
|
||||||
|
|
||||||
AC_ARG_WITH(examples,
|
AC_ARG_WITH(examples,
|
||||||
[AS_HELP_STRING([--with-examples=TARGET],
|
[AS_HELP_STRING([--with-examples=TARGET],
|
||||||
[Specify the examples from one of: none, posix, cc2538, cc2650, cc2652, da15000, efr32, emsk, gp712, kw41z, nrf52840, samr21 @<:@default=none@:>@.])],
|
[Specify the examples from one of: none, posix, cc1352, cc2538, cc2650, cc2652, da15000, efr32, emsk, gp712, kw41z, nrf52840, samr21 @<:@default=none@:>@.])],
|
||||||
[
|
[
|
||||||
case "${with_examples}" in
|
case "${with_examples}" in
|
||||||
|
none)
|
||||||
none|posix|cc2538|cc2650|cc2652|da15000|efr32|emsk|gp712|kw41z|nrf52840|samr21)
|
;;
|
||||||
|
posix|cc1352|cc2538|cc2650|cc2652|da15000|efr32|emsk|gp712|kw41z|nrf52840|samr21)
|
||||||
|
if test ${enable_posix_app} = "yes"; then
|
||||||
|
AC_MSG_ERROR([--with-examples must be none when POSIX apps are enabled by --enable-posix-app])
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_ERROR([Invalid value ${with_examples} for --with-examples])
|
AC_MSG_ERROR([Invalid value ${with_examples} for --with-examples])
|
||||||
@@ -1309,7 +1486,7 @@ AC_ARG_WITH(examples,
|
|||||||
],
|
],
|
||||||
[with_examples=none])
|
[with_examples=none])
|
||||||
|
|
||||||
OPENTHREAD_EXAMPLES=${with_examples}
|
OPENTHREAD_ENABLE_EXAMPLES=${with_examples}
|
||||||
|
|
||||||
case ${with_examples} in
|
case ${with_examples} in
|
||||||
|
|
||||||
@@ -1318,6 +1495,11 @@ case ${with_examples} in
|
|||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_EXAMPLES_POSIX],[${OPENTHREAD_EXAMPLES_POSIX}],[Define to 1 if you want to use posix examples])
|
AC_DEFINE_UNQUOTED([OPENTHREAD_EXAMPLES_POSIX],[${OPENTHREAD_EXAMPLES_POSIX}],[Define to 1 if you want to use posix examples])
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
cc1352)
|
||||||
|
OPENTHREAD_EXAMPLES_CC1352=1
|
||||||
|
AC_DEFINE_UNQUOTED([OPENTHREAD_EXAMPLES_CC1352],[${OPENTHREAD_EXAMPLES_CC1352}],[Define to 1 if you want to use cc1352 examples])
|
||||||
|
;;
|
||||||
|
|
||||||
cc2538)
|
cc2538)
|
||||||
OPENTHREAD_EXAMPLES_CC2538=1
|
OPENTHREAD_EXAMPLES_CC2538=1
|
||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_EXAMPLES_CC2538],[${OPENTHREAD_EXAMPLES_CC2538}],[Define to 1 if you want to use cc2538 examples])
|
AC_DEFINE_UNQUOTED([OPENTHREAD_EXAMPLES_CC2538],[${OPENTHREAD_EXAMPLES_CC2538}],[Define to 1 if you want to use cc2538 examples])
|
||||||
@@ -1373,42 +1555,45 @@ esac
|
|||||||
AC_MSG_CHECKING([whether to enable examples])
|
AC_MSG_CHECKING([whether to enable examples])
|
||||||
AC_MSG_RESULT(${OPENTHREAD_EXAMPLES})
|
AC_MSG_RESULT(${OPENTHREAD_EXAMPLES})
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES)
|
AC_SUBST(OPENTHREAD_ENABLE_EXAMPLES)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES], [test ${with_examples} != "none"])
|
AM_CONDITIONAL([OPENTHREAD_ENABLE_EXAMPLES], [test ${with_examples} != "none"])
|
||||||
AC_DEFINE_UNQUOTED([OPENTHREAD_EXAMPLES],[${OPENTHREAD_EXAMPLES}],[OpenThread examples])
|
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_EXAMPLES],[${OPENTHREAD_ENABLE_EXAMPLES}],[OpenThread examples])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_POSIX)
|
AC_SUBST(OPENTHREAD_EXAMPLES_POSIX)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_POSIX], [test "${OPENTHREAD_EXAMPLES}" = "posix"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_POSIX], [test "${with_examples}" = "posix"])
|
||||||
|
|
||||||
|
AC_SUBST(OPENTHREAD_EXAMPLES_CC1352)
|
||||||
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC1352], [test "${with_examples}" = "cc1352"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_CC2538)
|
AC_SUBST(OPENTHREAD_EXAMPLES_CC2538)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2538], [test "${OPENTHREAD_EXAMPLES}" = "cc2538"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2538], [test "${with_examples}" = "cc2538"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_CC2650)
|
AC_SUBST(OPENTHREAD_EXAMPLES_CC2650)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2650], [test "${OPENTHREAD_EXAMPLES}" = "cc2650"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2650], [test "${with_examples}" = "cc2650"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_CC2652)
|
AC_SUBST(OPENTHREAD_EXAMPLES_CC2652)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2652], [test "${OPENTHREAD_EXAMPLES}" = "cc2652"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2652], [test "${with_examples}" = "cc2652"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_DA15000)
|
AC_SUBST(OPENTHREAD_EXAMPLES_DA15000)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_DA15000], [test "${OPENTHREAD_EXAMPLES}" = "da15000"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_DA15000], [test "${with_examples}" = "da15000"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_EFR32)
|
AC_SUBST(OPENTHREAD_EXAMPLES_EFR32)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32], [test "${OPENTHREAD_EXAMPLES}" = "efr32"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32], [test "${with_examples}" = "efr32"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_EMSK)
|
AC_SUBST(OPENTHREAD_EXAMPLES_EMSK)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EMSK], [test "${OPENTHREAD_EXAMPLES}" = "emsk"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EMSK], [test "${with_examples}" = "emsk"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_GP712)
|
AC_SUBST(OPENTHREAD_EXAMPLES_GP712)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_GP712], [test "${OPENTHREAD_EXAMPLES}" = "gp712"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_GP712], [test "${with_examples}" = "gp712"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_KW41Z)
|
AC_SUBST(OPENTHREAD_EXAMPLES_KW41Z)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_KW41Z], [test "${OPENTHREAD_EXAMPLES}" = "kw41z"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_KW41Z], [test "${with_examples}" = "kw41z"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_NRF52840)
|
AC_SUBST(OPENTHREAD_EXAMPLES_NRF52840)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${OPENTHREAD_EXAMPLES}" = "nrf52840"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${with_examples}" = "nrf52840"])
|
||||||
|
|
||||||
AC_SUBST(OPENTHREAD_EXAMPLES_SAMR21)
|
AC_SUBST(OPENTHREAD_EXAMPLES_SAMR21)
|
||||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_SAMR21], [test "${OPENTHREAD_EXAMPLES}" = "samr21"])
|
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_SAMR21], [test "${with_examples}" = "samr21"])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tools
|
# Tools
|
||||||
@@ -1446,6 +1631,8 @@ NL_ENABLE_DOCS([auto],[NO])
|
|||||||
|
|
||||||
AM_CONDITIONAL(OPENTHREAD_BUILD_DOCS, [test "${nl_cv_build_docs}" = "yes"])
|
AM_CONDITIONAL(OPENTHREAD_BUILD_DOCS, [test "${nl_cv_build_docs}" = "yes"])
|
||||||
|
|
||||||
|
AM_CONDITIONAL(OPENTHREAD_POSIX, [test "${OPENTHREAD_ENABLE_POSIX_APP}" = "1" -o "${OPENTHREAD_EXAMPLES_POSIX}" = "1"])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Checks for libraries and packages.
|
# Checks for libraries and packages.
|
||||||
#
|
#
|
||||||
@@ -1541,6 +1728,8 @@ src/cli/Makefile
|
|||||||
src/ncp/Makefile
|
src/ncp/Makefile
|
||||||
src/core/Makefile
|
src/core/Makefile
|
||||||
src/diag/Makefile
|
src/diag/Makefile
|
||||||
|
src/posix/Makefile
|
||||||
|
src/posix/platform/Makefile
|
||||||
third_party/Makefile
|
third_party/Makefile
|
||||||
third_party/mbedtls/Makefile
|
third_party/mbedtls/Makefile
|
||||||
examples/Makefile
|
examples/Makefile
|
||||||
@@ -1548,6 +1737,7 @@ examples/apps/Makefile
|
|||||||
examples/apps/cli/Makefile
|
examples/apps/cli/Makefile
|
||||||
examples/apps/ncp/Makefile
|
examples/apps/ncp/Makefile
|
||||||
examples/platforms/Makefile
|
examples/platforms/Makefile
|
||||||
|
examples/platforms/cc1352/Makefile
|
||||||
examples/platforms/cc2538/Makefile
|
examples/platforms/cc2538/Makefile
|
||||||
examples/platforms/cc2650/Makefile
|
examples/platforms/cc2650/Makefile
|
||||||
examples/platforms/cc2652/Makefile
|
examples/platforms/cc2652/Makefile
|
||||||
@@ -1630,19 +1820,18 @@ AC_MSG_NOTICE([
|
|||||||
Pretty args : ${PRETTY_ARGS:--}
|
Pretty args : ${PRETTY_ARGS:--}
|
||||||
Pretty check : ${PRETTY_CHECK:--}
|
Pretty check : ${PRETTY_CHECK:--}
|
||||||
Pretty check args : ${PRETTY_CHECK_ARGS:--}
|
Pretty check args : ${PRETTY_CHECK_ARGS:--}
|
||||||
OpenThread CLI support : ${enable_cli_app}
|
OpenThread FTD support : ${enable_ftd}
|
||||||
OpenThread CLI-MTD support : ${enable_cli_app_mtd}
|
OpenThread MTD support : ${enable_mtd}
|
||||||
OpenThread CLI-FTD support : ${enable_cli_app_ftd}
|
OpenThread Radio Only support : ${enable_radio_only}
|
||||||
OpenThread NCP support : ${enable_ncp_app}
|
OpenThread CLI support : ${enable_cli}
|
||||||
OpenThread NCP-MTD support : ${enable_ncp_app_mtd}
|
OpenThread NCP support : ${enable_ncp}
|
||||||
OpenThread NCP-FTD support : ${enable_ncp_app_ftd}
|
|
||||||
OpenThread NCP-BUS Configuration : ${with_ncp_bus}
|
OpenThread NCP-BUS Configuration : ${with_ncp_bus}
|
||||||
OpenThread NCP Vendor Hook Source : ${with_ncp_vendor_hook_source}
|
OpenThread NCP Vendor Hook Source : ${with_ncp_vendor_hook_source}
|
||||||
OpenThread NCP Spinel Encrypter : ${with_ncp_spinel_encrypter_libs}
|
OpenThread NCP Spinel Encrypter : ${with_ncp_spinel_encrypter_libs}
|
||||||
OpenThread Multiple Instances support : ${enable_multiple_instances}
|
OpenThread Multiple Instances support : ${enable_multiple_instances}
|
||||||
OpenThread MTD Network Diagnostic support : ${enable_mtd_network_diagnostic}
|
OpenThread MTD Network Diagnostic support : ${enable_mtd_network_diagnostic}
|
||||||
OpenThread builtin mbedtls support : ${enable_builtin_mbedtls}
|
OpenThread builtin mbedtls support : ${enable_builtin_mbedtls}
|
||||||
OpenThread TMF Proxy support : ${enable_tmf_proxy}
|
OpenThread UDP Proxy support : ${enable_udp_proxy}
|
||||||
OpenThread Commissioner support : ${enable_commissioner}
|
OpenThread Commissioner support : ${enable_commissioner}
|
||||||
OpenThread Joiner support : ${enable_joiner}
|
OpenThread Joiner support : ${enable_joiner}
|
||||||
OpenThread DTLS support : ${enable_dtls}
|
OpenThread DTLS support : ${enable_dtls}
|
||||||
@@ -1658,9 +1847,12 @@ AC_MSG_NOTICE([
|
|||||||
OpenThread DHCPv6 Client support : ${enable_dhcp6_client}
|
OpenThread DHCPv6 Client support : ${enable_dhcp6_client}
|
||||||
OpenThread DNS Client support : ${enable_dns_client}
|
OpenThread DNS Client support : ${enable_dns_client}
|
||||||
OpenThread Application CoAP support : ${enable_application_coap}
|
OpenThread Application CoAP support : ${enable_application_coap}
|
||||||
|
OpenThread Application CoAP Secure support: ${enable_application_coap_secure}
|
||||||
OpenThread Raw Link-Layer support : ${enable_raw_link_api}
|
OpenThread Raw Link-Layer support : ${enable_raw_link_api}
|
||||||
|
OpenThread Border Agent support : ${enable_border_agent}
|
||||||
OpenThread Border Router support : ${enable_border_router}
|
OpenThread Border Router support : ${enable_border_router}
|
||||||
OpenThread Service support : ${enable_service}
|
OpenThread Service support : ${enable_service}
|
||||||
OpenThread examples : ${OPENTHREAD_EXAMPLES}
|
OpenThread Examples : ${with_examples}
|
||||||
|
OpenThread POSIX Application : ${enable_posix_app}
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ following allocation plan:
|
|||||||
Property ID Range | Description
|
Property ID Range | Description
|
||||||
:---------------------|:-----------------
|
:---------------------|:-----------------
|
||||||
0 - 127 | Reserved for frequently-used properties
|
0 - 127 | Reserved for frequently-used properties
|
||||||
128 - 15,359 | Unallocated
|
128 - 15,359 | Technology-specific
|
||||||
15,360 - 16,383 | Vendor-specific
|
15,360 - 16,383 | Vendor-specific
|
||||||
16,384 - 1,999,999 | Unallocated
|
16,384 - 1,999,999 | Technology-specific
|
||||||
2,000,000 - 2,097,151 | Experimental use only
|
2,000,000 - 2,097,151 | Experimental use only
|
||||||
|
|
||||||
For an explanation of the data format encoding shorthand used
|
For an explanation of the data format encoding shorthand used
|
||||||
@@ -28,16 +28,24 @@ The currently assigned properties are broken up into several
|
|||||||
sections, each with reserved ranges of property identifiers.
|
sections, each with reserved ranges of property identifiers.
|
||||||
These ranges are:
|
These ranges are:
|
||||||
|
|
||||||
Name | Range (Inclusive) | Documentation
|
Name | Range (Inclusive) | Description
|
||||||
-------|------------------------------|--------------
|
-------------|--------------------------------|------------------------
|
||||||
Core | 0x00 - 0x1F, 0x1000 - 0x11FF | (#prop-core)
|
Core | 0x000 - 0x01F, 0x1000 - 0x11FF | Spinel core
|
||||||
PHY | 0x20 - 0x2F, 0x1200 - 0x12FF | (#prop-phy)
|
PHY | 0x020 - 0x02F, 0x1200 - 0x12FF | Radio PHY layer
|
||||||
MAC | 0x30 - 0x3F, 0x1300 - 0x13FF | (#prop-mac)
|
MAC | 0x030 - 0x03F, 0x1300 - 0x13FF | MAC layer
|
||||||
NET | 0x40 - 0x4F, 0x1400 - 0x14FF | (#prop-net)
|
NET | 0x040 - 0x04F, 0x1400 - 0x14FF | Network
|
||||||
Tech | 0x50 - 0x5F, 0x1500 - 0x15FF | Technology-specific
|
Thread | 0x050 - 0x05F, 0x1500 - 0x15FF | Thread
|
||||||
IPv6 | 0x60 - 0x6F, 0x1600 - 0x16FF | (#prop-ipv6)
|
IPv6 | 0x060 - 0x06F, 0x1600 - 0x16FF | IPv6
|
||||||
Stream | 0x70 - 0x7F, 0x1700 - 0x17FF | (#prop-core)
|
Stream | 0x070 - 0x07F, 0x1700 - 0x17FF | Stream
|
||||||
Debug | 0x4000 - 0x4400 | (#prop-debug)
|
MeshCop | 0x080 - 0x08F, 0x1800 - 0x18FF | Thread Mesh Commissioning
|
||||||
|
OpenThread | 0x1900 - 0x19FF | OpenThread specific
|
||||||
|
Interface | 0x100 - 0x1FF | Interface (e.g., UART)
|
||||||
|
PIB | 0x400 - 0x4FF | 802.15.4 PIB
|
||||||
|
Counter | 0x500 - 0x7FF | Counters (MAC, IP, etc).
|
||||||
|
Nest | 0x3BC0 - 0x3BFF | Nest (legacy)
|
||||||
|
Vendor | 0x3C00 - 0x3FFF | Vendor specific
|
||||||
|
Debug | 0x4000 - 0x43FF | Debug related
|
||||||
|
Experimental | 2,000,000 - 2,097,151 | Experimental use only
|
||||||
|
|
||||||
Note that some of the property sections have two reserved
|
Note that some of the property sections have two reserved
|
||||||
ranges: a primary range (which is encoded as a single byte)
|
ranges: a primary range (which is encoded as a single byte)
|
||||||
|
|||||||
@@ -32,10 +32,17 @@ The IPv6 address of the leader. (Note: May change to long and short address of l
|
|||||||
|
|
||||||
### PROP 81: PROP_THREAD_PARENT
|
### PROP 81: PROP_THREAD_PARENT
|
||||||
* Type: Read-Only
|
* Type: Read-Only
|
||||||
* Packed-Encoding: `ES`
|
* Packed-Encoding: `ESLccCC`
|
||||||
* LADDR, SADDR
|
|
||||||
|
|
||||||
The long address and short address of the parent of this node.
|
Information about parent of this node.
|
||||||
|
|
||||||
|
* `E`: Extended address
|
||||||
|
* `S`: RLOC16
|
||||||
|
* `L`: Age (seconds since last heard from)
|
||||||
|
* `c`: Average RSS (in dBm)
|
||||||
|
* `c`: Last RSSI (in dBm)
|
||||||
|
* `C`: Link Quality In
|
||||||
|
* `C`: Link Quality Out
|
||||||
|
|
||||||
### PROP 82: PROP_THREAD_CHILD_TABLE
|
### PROP 82: PROP_THREAD_CHILD_TABLE
|
||||||
* Type: Read-Only
|
* Type: Read-Only
|
||||||
@@ -288,7 +295,7 @@ Set to true to enable the native commissioner. It is mandatory before adding the
|
|||||||
* Packed-Encoding: `b`
|
* Packed-Encoding: `b`
|
||||||
* Required capability: `CAP_THREAD_TMF_PROXY`
|
* Required capability: `CAP_THREAD_TMF_PROXY`
|
||||||
|
|
||||||
Set to true to enable the TMF proxy.
|
Set to true to enable the TMF proxy. This property is deprecated.
|
||||||
|
|
||||||
### PROP 5394: PROP_THREAD_TMF_PROXY_STREAM {#prop-thread-tmf-proxy-stream}
|
### PROP 5394: PROP_THREAD_TMF_PROXY_STREAM {#prop-thread-tmf-proxy-stream}
|
||||||
|
|
||||||
@@ -296,6 +303,8 @@ Set to true to enable the TMF proxy.
|
|||||||
* Packed-Encoding: `dSS`
|
* Packed-Encoding: `dSS`
|
||||||
* Required capability: `CAP_THREAD_TMF_PROXY`
|
* Required capability: `CAP_THREAD_TMF_PROXY`
|
||||||
|
|
||||||
|
This property is deprecated. Please see `SPINEL_PROP_THREAD_UDP_PROXY_STREAM`.
|
||||||
|
|
||||||
Data per item is:
|
Data per item is:
|
||||||
|
|
||||||
* `d`: CoAP frame
|
* `d`: CoAP frame
|
||||||
@@ -309,7 +318,6 @@ Fields: | Length | CoAP | locator | port
|
|||||||
This property allows the host to send and receive TMF messages from
|
This property allows the host to send and receive TMF messages from
|
||||||
the NCP's RLOC address and support Thread-specific border router functions.
|
the NCP's RLOC address and support Thread-specific border router functions.
|
||||||
|
|
||||||
|
|
||||||
### PROP 5395: PROP_THREAD_DISOVERY_SCAN_JOINER_FLAG {#prop-thread-discovery-scan-joiner-flag}
|
### PROP 5395: PROP_THREAD_DISOVERY_SCAN_JOINER_FLAG {#prop-thread-discovery-scan-joiner-flag}
|
||||||
|
|
||||||
* Type: Read-Write
|
* Type: Read-Write
|
||||||
@@ -416,7 +424,7 @@ following properties can also be included in the Pending Dataset:
|
|||||||
* SPINEL_PROP_DATASET_PENDING_TIMESTAMP
|
* SPINEL_PROP_DATASET_PENDING_TIMESTAMP
|
||||||
* SPINEL_PROP_DATASET_DELAY_TIMER
|
* SPINEL_PROP_DATASET_DELAY_TIMER
|
||||||
|
|
||||||
### PROP 5402: SPINEL_PROP_THREAD_MGMT_ACTIVE_DATASET (#prop-thread-mgmt-active-dataset)
|
### PROP 5402: SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET (#prop-thread-mgmt-set-active-dataset)
|
||||||
|
|
||||||
* Type: Write only
|
* Type: Write only
|
||||||
* Packing-Encoding: `A(t(iD))`
|
* Packing-Encoding: `A(t(iD))`
|
||||||
@@ -435,7 +443,7 @@ TLVs):
|
|||||||
|
|
||||||
* SPINEL_PROP_DATASET_RAW_TLVS
|
* SPINEL_PROP_DATASET_RAW_TLVS
|
||||||
|
|
||||||
### PROP 5403: SPINEL_PROP_THREAD_MGMT_PENDING_DATASET (#prop-thread-mgmt-pending-dataset)
|
### PROP 5403: SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET (#prop-thread-mgmt-set-pending-dataset)
|
||||||
|
|
||||||
* Type: Write only
|
* Type: Write only
|
||||||
* Packing-Encoding: `A(t(iD))`
|
* Packing-Encoding: `A(t(iD))`
|
||||||
@@ -461,8 +469,10 @@ This can only be included in one of the Dataset related properties below:
|
|||||||
|
|
||||||
* SPINEL_PROP_THREAD_ACTIVE_DATASET
|
* SPINEL_PROP_THREAD_ACTIVE_DATASET
|
||||||
* SPINEL_PROP_THREAD_PENDING_DATASET
|
* SPINEL_PROP_THREAD_PENDING_DATASET
|
||||||
* SPINEL_PROP_THREAD_MGMT_ACTIVE_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET
|
||||||
* SPINEL_PROP_THREAD_MGMT_PENDING_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
|
||||||
|
|
||||||
### PROP 5405: SPINEL_PROP_DATASET_PENDING_TIMESTAMP (#prop-dataset-pending-timestamps)
|
### PROP 5405: SPINEL_PROP_DATASET_PENDING_TIMESTAMP (#prop-dataset-pending-timestamps)
|
||||||
|
|
||||||
@@ -475,8 +485,8 @@ Dataset.
|
|||||||
It can only be included in one of the Pending Dataset properties:
|
It can only be included in one of the Pending Dataset properties:
|
||||||
|
|
||||||
* SPINEL_PROP_THREAD_PENDING_DATASET
|
* SPINEL_PROP_THREAD_PENDING_DATASET
|
||||||
* SPINEL_PROP_THREAD_MGMT_PENDING_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
|
||||||
|
|
||||||
### PROP 5406: SPINEL_PROP_DATASET_DELAY_TIMER (#prop-dataset-delay-timer)
|
### PROP 5406: SPINEL_PROP_DATASET_DELAY_TIMER (#prop-dataset-delay-timer)
|
||||||
|
|
||||||
@@ -491,7 +501,8 @@ Pending Operational Dataset.
|
|||||||
It can only be included in one of the Pending Dataset properties:
|
It can only be included in one of the Pending Dataset properties:
|
||||||
|
|
||||||
* SPINEL_PROP_THREAD_PENDING_DATASET
|
* SPINEL_PROP_THREAD_PENDING_DATASET
|
||||||
* SPINEL_PROP_THREAD_MGMT_PENDING_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
|
||||||
|
|
||||||
### PROP 5407: SPINEL_PROP_DATASET_SECURITY_POLICY (#prop-dataset-security-policy)
|
### PROP 5407: SPINEL_PROP_DATASET_SECURITY_POLICY (#prop-dataset-security-policy)
|
||||||
|
|
||||||
@@ -510,8 +521,10 @@ It can only be included in one of the Dataset related properties below:
|
|||||||
|
|
||||||
* SPINEL_PROP_THREAD_ACTIVE_DATASET
|
* SPINEL_PROP_THREAD_ACTIVE_DATASET
|
||||||
* SPINEL_PROP_THREAD_PENDING_DATASET
|
* SPINEL_PROP_THREAD_PENDING_DATASET
|
||||||
* SPINEL_PROP_THREAD_MGMT_ACTIVE_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET
|
||||||
* SPINEL_PROP_THREAD_MGMT_PENDING_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
|
||||||
|
|
||||||
### PROP 5408: SPINEL_PROP_DATASET_RAW_TLVS (#prop-dataset-raw-tlvs)
|
### PROP 5408: SPINEL_PROP_DATASET_RAW_TLVS (#prop-dataset-raw-tlvs)
|
||||||
|
|
||||||
@@ -523,8 +536,8 @@ DataSet.
|
|||||||
|
|
||||||
It can only be included in one of the following Dataset properties:
|
It can only be included in one of the following Dataset properties:
|
||||||
|
|
||||||
* SPINEL_PROP_THREAD_MGMT_ACTIVE_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET
|
||||||
* SPINEL_PROP_THREAD_MGMT_PENDING_DATASET
|
* SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
|
||||||
|
|
||||||
### PROP 5409: SPINEL_PROP_THREAD_CHILD_TABLE_ADDRESSES (#prop-thread-child-table-addresses)
|
### PROP 5409: SPINEL_PROP_THREAD_CHILD_TABLE_ADDRESSES (#prop-thread-child-table-addresses)
|
||||||
|
|
||||||
@@ -563,7 +576,6 @@ Data per item is:
|
|||||||
* `c`: Average RSSI (in dBm)
|
* `c`: Average RSSI (in dBm)
|
||||||
* `c`: Last RSSI (in dBm)
|
* `c`: Last RSSI (in dBm)
|
||||||
|
|
||||||
|
|
||||||
### PROP 5411: SPINEL_PROP_THREAD_ADDRESS_CACHE_TABLE (#prop-thread-address-cache-table)
|
### PROP 5411: SPINEL_PROP_THREAD_ADDRESS_CACHE_TABLE (#prop-thread-address-cache-table)
|
||||||
|
|
||||||
* Type: Read-Only
|
* Type: Read-Only
|
||||||
@@ -576,3 +588,74 @@ Data per item is:
|
|||||||
* `6` : Target IPv6 address
|
* `6` : Target IPv6 address
|
||||||
* `S` : RLOC16 of target
|
* `S` : RLOC16 of target
|
||||||
* `C` : Age (order of use, 0 indicates most recently used entry)
|
* `C` : Age (order of use, 0 indicates most recently used entry)
|
||||||
|
|
||||||
|
### PROP 5412: SPINEL_PROP_THREAD_UDP_PROXY_STREAM (#prop-thread-udp-proxy-stream)
|
||||||
|
|
||||||
|
* Type: Write-Stream
|
||||||
|
* Packed-Encoding: `dS6S`
|
||||||
|
* Required capability: `CAP_THREAD_UDP_PROXY`
|
||||||
|
|
||||||
|
This property helps exchange UDP packets with host.
|
||||||
|
|
||||||
|
`d`: UDP payload
|
||||||
|
`S`: Remote UDP port
|
||||||
|
`6`: Remote IPv6 address
|
||||||
|
`S`: Local UDP port
|
||||||
|
|
||||||
|
### PROP 5413: SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET (#prop-thread-mgmt-get-active-dataset)
|
||||||
|
|
||||||
|
* Type: Write-Only
|
||||||
|
* Packing-format: `A(t(iD))`
|
||||||
|
|
||||||
|
The formatting of this property follows the same rules as in
|
||||||
|
SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET. This property
|
||||||
|
allows the sender to not include a value associated with
|
||||||
|
properties in formating of `t(iD)`, i.e., it should accept
|
||||||
|
either a `t(iD)` or a `t(i)` encoding which in both cases
|
||||||
|
indicate the associated Dataset property should be requested
|
||||||
|
as part of MGMT_GET command.
|
||||||
|
|
||||||
|
When written, it triggers a MGMT_ACTIVE_GET meshcop command to be
|
||||||
|
sent to leader with the given Dataset. The spinel frame response
|
||||||
|
should be a `LAST_STATUS` with the status of the transmission
|
||||||
|
of MGMT_ACTIVE_GET command.
|
||||||
|
|
||||||
|
In addition to supported properties in
|
||||||
|
SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET, the following property
|
||||||
|
can be optionally included in the Dataset:
|
||||||
|
|
||||||
|
* SPINEL_PROP_DATASET_DEST_ADDRESS
|
||||||
|
|
||||||
|
### PROP 5414: SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET (#prop-thread-mgmt-get-pending-dataset)
|
||||||
|
|
||||||
|
* Type: Write-Only
|
||||||
|
* Packing-format: `A(t(iD))`
|
||||||
|
|
||||||
|
The formatting of this property follows the same rules as in
|
||||||
|
SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET.
|
||||||
|
|
||||||
|
This is write-only property. When written, it triggers a
|
||||||
|
MGMT_PENDING_GET meshcop command to be sent to leader with the
|
||||||
|
given Dataset. The spinel frame response should be a
|
||||||
|
`LAST_STATUS` with the status of the transmission of
|
||||||
|
MGMT_PENDING_GET command.
|
||||||
|
|
||||||
|
In addition to supported properties in
|
||||||
|
SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET, the following property
|
||||||
|
can be optionally included the Dataset:
|
||||||
|
|
||||||
|
* SPINEL_PROP_DATASET_DEST_ADDRESS
|
||||||
|
|
||||||
|
### PROP 5415: SPINEL_PROP_DATASET_DEST_ADDRESS (#prop-dataset-dest-address)
|
||||||
|
|
||||||
|
* Type: No direct read or write
|
||||||
|
* Packing-Encoding: `6`
|
||||||
|
|
||||||
|
This property specifies the IPv6 destination when sending
|
||||||
|
MGMT_GET command for either Active or Pending Dataset if not
|
||||||
|
provided, Leader ALOC address is used as default.
|
||||||
|
|
||||||
|
This can only be included in one of the Dataset related properties below:
|
||||||
|
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET
|
||||||
|
* SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
<ClCompile Include="..\..\src\cli\cli_dataset.cpp" />
|
<ClCompile Include="..\..\src\cli\cli_dataset.cpp" />
|
||||||
<ClCompile Include="..\..\src\cli\cli_instance.cpp" />
|
<ClCompile Include="..\..\src\cli\cli_instance.cpp" />
|
||||||
<ClCompile Include="..\..\src\cli\cli_uart.cpp" />
|
<ClCompile Include="..\..\src\cli\cli_uart.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\core\utils\missing_strnlen.c" />
|
||||||
|
<ClCompile Include="..\..\src\core\utils\parse_cmdline.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\ncp\ncp_base_dispatcher.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_spi.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_spi.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\spinel.c" />
|
<ClCompile Include="..\..\src\ncp\spinel.c" />
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp">
|
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\ncp\ncp_base_dispatcher.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp">
|
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\ncp\ncp_base_dispatcher.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_uart.cpp" />
|
<ClCompile Include="..\..\src\ncp\ncp_uart.cpp" />
|
||||||
<ClCompile Include="..\..\src\ncp\spinel.c" />
|
<ClCompile Include="..\..\src\ncp\spinel.c" />
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp">
|
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\ncp\ncp_base_dispatcher.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp">
|
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|||||||
@@ -59,12 +59,12 @@
|
|||||||
<ClCompile Include="..\..\examples\platforms\posix\flash-windows-stubs.c" />
|
<ClCompile Include="..\..\examples\platforms\posix\flash-windows-stubs.c" />
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\logging.c" />
|
<ClCompile Include="..\..\examples\platforms\posix\logging.c" />
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\misc.c" />
|
<ClCompile Include="..\..\examples\platforms\posix\misc.c" />
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\platform.c" />
|
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\radio.c" />
|
<ClCompile Include="..\..\examples\platforms\posix\radio.c" />
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\random.c" />
|
<ClCompile Include="..\..\examples\platforms\posix\random.c" />
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\spi-stubs.c" />
|
<ClCompile Include="..\..\examples\platforms\posix\spi-stubs.c" />
|
||||||
|
<ClCompile Include="..\..\examples\platforms\posix\system.c" />
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\uart-windows.c" />
|
<ClCompile Include="..\..\examples\platforms\posix\uart-windows.c" />
|
||||||
<ClCompile Include="..\..\examples\platforms\utils\settings.cpp" />
|
<ClCompile Include="..\..\examples\platforms\utils\settings_flash.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\examples\platforms\posix\platform-posix.h" />
|
<ClInclude Include="..\..\examples\platforms\posix\platform-posix.h" />
|
||||||
|
|||||||
@@ -22,9 +22,6 @@
|
|||||||
<ClCompile Include="..\..\examples\platforms\posix\misc.c">
|
<ClCompile Include="..\..\examples\platforms\posix\misc.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\platform.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\random.c">
|
<ClCompile Include="..\..\examples\platforms\posix\random.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -34,10 +31,13 @@
|
|||||||
<ClCompile Include="..\..\examples\platforms\posix\spi-stubs.c">
|
<ClCompile Include="..\..\examples\platforms\posix\spi-stubs.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\examples\platforms\posix\system.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\examples\platforms\posix\uart-windows.c">
|
<ClCompile Include="..\..\examples\platforms\posix\uart-windows.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\examples\platforms\utils\settings.cpp">
|
<ClCompile Include="..\..\examples\platforms\utils\settings_flash.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
<ClCompile Include="..\..\src\core\crypto\mbedtls.cpp" />
|
<ClCompile Include="..\..\src\core\crypto\mbedtls.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\crypto\pbkdf2_cmac.cpp" />
|
<ClCompile Include="..\..\src\core\crypto\pbkdf2_cmac.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\crypto\sha256.cpp" />
|
<ClCompile Include="..\..\src\core\crypto\sha256.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\core\mac\link_raw.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\mac\mac.cpp" />
|
<ClCompile Include="..\..\src\core\mac\mac.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\mac\mac_filter.cpp" />
|
<ClCompile Include="..\..\src\core\mac\mac_filter.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\mac\mac_frame.cpp" />
|
<ClCompile Include="..\..\src\core\mac\mac_frame.cpp" />
|
||||||
@@ -148,6 +149,7 @@
|
|||||||
<ClCompile Include="..\..\src\core\thread\thread_netif.cpp" />
|
<ClCompile Include="..\..\src\core\thread\thread_netif.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\thread\topology.cpp" />
|
<ClCompile Include="..\..\src\core\thread\topology.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp" />
|
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\core\utils\parse_cmdline.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp" />
|
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\jam_detector.cpp" />
|
<ClCompile Include="..\..\src\core\utils\jam_detector.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\missing_strnlen.c" />
|
<ClCompile Include="..\..\src\core\utils\missing_strnlen.c" />
|
||||||
@@ -238,6 +240,7 @@
|
|||||||
<ClInclude Include="..\..\src\core\thread\thread_uri_paths.hpp" />
|
<ClInclude Include="..\..\src\core\thread\thread_uri_paths.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\thread\topology.hpp" />
|
<ClInclude Include="..\..\src\core\thread\topology.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp" />
|
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp" />
|
||||||
|
<ClInclude Include="..\..\src\core\utils\parse_cmdline.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp" />
|
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\jam_detector.hpp" />
|
<ClInclude Include="..\..\src\core\utils\jam_detector.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\wrap_string.h" />
|
<ClInclude Include="..\..\src\core\utils\wrap_string.h" />
|
||||||
|
|||||||
@@ -165,6 +165,9 @@
|
|||||||
<ClCompile Include="..\..\src\core\crypto\aes_ccm.cpp">
|
<ClCompile Include="..\..\src\core\crypto\aes_ccm.cpp">
|
||||||
<Filter>Source Files\crypto</Filter>
|
<Filter>Source Files\crypto</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\core\mac\link_raw.cpp">
|
||||||
|
<Filter>Source Files\api</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\core\mac\mac.cpp">
|
<ClCompile Include="..\..\src\core\mac\mac.cpp">
|
||||||
<Filter>Source Files\mac</Filter>
|
<Filter>Source Files\mac</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -327,6 +330,9 @@
|
|||||||
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp">
|
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp">
|
||||||
<Filter>Source Files\utils</Filter>
|
<Filter>Source Files\utils</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\core\utils\parse_cmdline.cpp">
|
||||||
|
<Filter>Source Files\utils</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp">
|
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp">
|
||||||
<Filter>Source Files\utils</Filter>
|
<Filter>Source Files\utils</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -593,6 +599,9 @@
|
|||||||
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp">
|
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp">
|
||||||
<Filter>Header Files\utils</Filter>
|
<Filter>Header Files\utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\core\utils\parse_cmdline.hpp">
|
||||||
|
<Filter>Header Files\utils</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp">
|
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp">
|
||||||
<Filter>Header Files\utils</Filter>
|
<Filter>Header Files\utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|||||||
@@ -157,6 +157,7 @@
|
|||||||
<ClCompile Include="..\..\src\core\thread\thread_netif.cpp" />
|
<ClCompile Include="..\..\src\core\thread\thread_netif.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\thread\topology.cpp" />
|
<ClCompile Include="..\..\src\core\thread\topology.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp" />
|
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\core\utils\parse_cmdline.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp" />
|
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\jam_detector.cpp" />
|
<ClCompile Include="..\..\src\core\utils\jam_detector.cpp" />
|
||||||
<ClCompile Include="..\..\src\core\utils\missing_strlcat.c" />
|
<ClCompile Include="..\..\src\core\utils\missing_strlcat.c" />
|
||||||
@@ -173,6 +174,7 @@
|
|||||||
<ClInclude Include="..\..\include\openthread\dataset_ftd.h" />
|
<ClInclude Include="..\..\include\openthread\dataset_ftd.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\dhcp6_client.h" />
|
<ClInclude Include="..\..\include\openthread\dhcp6_client.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\dhcp6_server.h" />
|
<ClInclude Include="..\..\include\openthread\dhcp6_server.h" />
|
||||||
|
<ClInclude Include="..\..\include\openthread\error.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\icmp6.h" />
|
<ClInclude Include="..\..\include\openthread\icmp6.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\instance.h" />
|
<ClInclude Include="..\..\include\openthread\instance.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\ip6.h" />
|
<ClInclude Include="..\..\include\openthread\ip6.h" />
|
||||||
@@ -181,14 +183,11 @@
|
|||||||
<ClInclude Include="..\..\include\openthread\link.h" />
|
<ClInclude Include="..\..\include\openthread\link.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\message.h" />
|
<ClInclude Include="..\..\include\openthread\message.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\netdata.h" />
|
<ClInclude Include="..\..\include\openthread\netdata.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\openthread.h" />
|
|
||||||
<ClInclude Include="..\..\include\openthread\tasklet.h" />
|
<ClInclude Include="..\..\include\openthread\tasklet.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\thread.h" />
|
<ClInclude Include="..\..\include\openthread\thread.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\thread_ftd.h" />
|
<ClInclude Include="..\..\include\openthread\thread_ftd.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\types.h" />
|
|
||||||
<ClInclude Include="..\..\include\openthread-windows-config.h" />
|
<ClInclude Include="..\..\include\openthread-windows-config.h" />
|
||||||
<ClInclude Include="..\..\include\openthread\udp.h" />
|
<ClInclude Include="..\..\include\openthread\udp.h" />
|
||||||
<ClInclude Include="..\..\src\core\api\link_raw.hpp" />
|
|
||||||
<ClInclude Include="..\..\src\core\coap\coap.hpp" />
|
<ClInclude Include="..\..\src\core\coap\coap.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\coap\coap_header.hpp" />
|
<ClInclude Include="..\..\src\core\coap\coap_header.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\coap\coap_secure.hpp" />
|
<ClInclude Include="..\..\src\core\coap\coap_secure.hpp" />
|
||||||
@@ -214,6 +213,7 @@
|
|||||||
<ClInclude Include="..\..\src\core\crypto\mbedtls.hpp" />
|
<ClInclude Include="..\..\src\core\crypto\mbedtls.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\crypto\pbkdf2_cmac.h" />
|
<ClInclude Include="..\..\src\core\crypto\pbkdf2_cmac.h" />
|
||||||
<ClInclude Include="..\..\src\core\crypto\sha256.hpp" />
|
<ClInclude Include="..\..\src\core\crypto\sha256.hpp" />
|
||||||
|
<ClInclude Include="..\..\src\core\mac\link_raw.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\mac\mac.hpp" />
|
<ClInclude Include="..\..\src\core\mac\mac.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\mac\mac_filter.hpp" />
|
<ClInclude Include="..\..\src\core\mac\mac_filter.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\mac\mac_frame.hpp" />
|
<ClInclude Include="..\..\src\core\mac\mac_frame.hpp" />
|
||||||
@@ -273,6 +273,7 @@
|
|||||||
<ClInclude Include="..\..\src\core\thread\thread_uri_paths.hpp" />
|
<ClInclude Include="..\..\src\core\thread\thread_uri_paths.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\thread\topology.hpp" />
|
<ClInclude Include="..\..\src\core\thread\topology.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp" />
|
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp" />
|
||||||
|
<ClInclude Include="..\..\src\core\utils\parse_cmdline.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp" />
|
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\jam_detector.hpp" />
|
<ClInclude Include="..\..\src\core\utils\jam_detector.hpp" />
|
||||||
<ClInclude Include="..\..\src\core\utils\wrap_string.h" />
|
<ClInclude Include="..\..\src\core\utils\wrap_string.h" />
|
||||||
|
|||||||
@@ -327,6 +327,9 @@
|
|||||||
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp">
|
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp">
|
||||||
<Filter>Source Files\utils</Filter>
|
<Filter>Source Files\utils</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\core\utils\parse_cmdline.cpp">
|
||||||
|
<Filter>Source Files\utils</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp">
|
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp">
|
||||||
<Filter>Source Files\utils</Filter>
|
<Filter>Source Files\utils</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -590,6 +593,9 @@
|
|||||||
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp">
|
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp">
|
||||||
<Filter>Header Files\utils</Filter>
|
<Filter>Header Files\utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\core\utils\parse_cmdline.hpp">
|
||||||
|
<Filter>Header Files\utils</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp">
|
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp">
|
||||||
<Filter>Header Files\utils</Filter>
|
<Filter>Header Files\utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -614,9 +620,6 @@
|
|||||||
<ClInclude Include="..\..\src\core\openthread-core-default-config.h">
|
<ClInclude Include="..\..\src\core\openthread-core-default-config.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\include\openthread\types.h">
|
|
||||||
<Filter>Header Files\openthread</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\examples\drivers\windows\include\openthread-core-windows-config.h">
|
<ClInclude Include="..\..\examples\drivers\windows\include\openthread-core-windows-config.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -644,6 +647,9 @@
|
|||||||
<ClInclude Include="..\..\include\openthread\dhcp6_server.h">
|
<ClInclude Include="..\..\include\openthread\dhcp6_server.h">
|
||||||
<Filter>Header Files\openthread</Filter>
|
<Filter>Header Files\openthread</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\include\openthread\error.h">
|
||||||
|
<Filter>Header Files\openthread</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\include\openthread\icmp6.h">
|
<ClInclude Include="..\..\include\openthread\icmp6.h">
|
||||||
<Filter>Header Files\openthread</Filter>
|
<Filter>Header Files\openthread</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -668,9 +674,6 @@
|
|||||||
<ClInclude Include="..\..\include\openthread\netdata.h">
|
<ClInclude Include="..\..\include\openthread\netdata.h">
|
||||||
<Filter>Header Files\openthread</Filter>
|
<Filter>Header Files\openthread</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\include\openthread\openthread.h">
|
|
||||||
<Filter>Header Files\openthread</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\include\openthread\tasklet.h">
|
<ClInclude Include="..\..\include\openthread\tasklet.h">
|
||||||
<Filter>Header Files\openthread</Filter>
|
<Filter>Header Files\openthread</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -683,7 +686,7 @@
|
|||||||
<ClInclude Include="..\..\include\openthread\udp.h">
|
<ClInclude Include="..\..\include\openthread\udp.h">
|
||||||
<Filter>Header Files\openthread</Filter>
|
<Filter>Header Files\openthread</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\core\api\link_raw.hpp">
|
<ClInclude Include="..\..\src\core\mac\link_raw.hpp">
|
||||||
<Filter>Header Files\api</Filter>
|
<Filter>Header Files\api</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\core\utils\wrapper_string.h">
|
<ClInclude Include="..\..\src\core\utils\wrapper_string.h">
|
||||||
|
|||||||
@@ -0,0 +1,297 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
.NOTPARALLEL:
|
||||||
|
|
||||||
|
AR = arm-none-eabi-ar
|
||||||
|
CCAS = arm-none-eabi-as
|
||||||
|
CPP = arm-none-eabi-cpp
|
||||||
|
CC = arm-none-eabi-gcc
|
||||||
|
CXX = arm-none-eabi-g++
|
||||||
|
LD = arm-none-eabi-ld
|
||||||
|
STRIP = arm-none-eabi-strip
|
||||||
|
NM = arm-none-eabi-nm
|
||||||
|
RANLIB = arm-none-eabi-ranlib
|
||||||
|
OBJCOPY = arm-none-eabi-objcopy
|
||||||
|
|
||||||
|
BuildJobs ?= 10
|
||||||
|
|
||||||
|
configure_OPTIONS = \
|
||||||
|
--enable-cli \
|
||||||
|
--enable-diag \
|
||||||
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
|
--with-examples=cc1352 \
|
||||||
|
MBEDTLS_CPPFLAGS="$(CC1352_MBEDTLS_CPPFLAGS)" \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
DEFAULT_LOGGING ?= 1
|
||||||
|
|
||||||
|
CC1352_MBEDTLS_CPPFLAGS = \
|
||||||
|
-DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"' \
|
||||||
|
-DMBEDTLS_USER_CONFIG_FILE='\"cc1352-mbedtls-config.h\"' \
|
||||||
|
-I$(PWD)/examples/platforms/cc1352/crypto \
|
||||||
|
-I$(PWD)/third_party/ti/devices/cc13x2_cc26x2 \
|
||||||
|
-I$(PWD)/third_party/mbedtls \
|
||||||
|
-I$(PWD)/third_party/mbedtls/repo/include \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
CC1352_CONFIG_FILE_CPPFLAGS = \
|
||||||
|
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-cc1352-config.h\"' \
|
||||||
|
-I$(PWD)/examples/platforms/cc1352/ \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
COMMONCFLAGS := \
|
||||||
|
-fdata-sections \
|
||||||
|
-ffunction-sections \
|
||||||
|
-Os \
|
||||||
|
-g \
|
||||||
|
$(CC1352_CONFIG_FILE_CPPFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||||
|
|
||||||
|
CPPFLAGS += \
|
||||||
|
$(COMMONCFLAGS) \
|
||||||
|
$(target_CPPFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
CFLAGS += \
|
||||||
|
$(COMMONCFLAGS) \
|
||||||
|
$(target_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
CXXFLAGS += \
|
||||||
|
$(COMMONCFLAGS) \
|
||||||
|
$(target_CXXFLAGS) \
|
||||||
|
-fno-exceptions \
|
||||||
|
-fno-rtti \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LDFLAGS += \
|
||||||
|
$(COMMONCFLAGS) \
|
||||||
|
$(target_LDFLAGS) \
|
||||||
|
-nostartfiles \
|
||||||
|
-specs=nano.specs \
|
||||||
|
-specs=nosys.specs \
|
||||||
|
-Wl,--gc-sections \
|
||||||
|
-Wl,-Map=map.map \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
ECHO := @echo
|
||||||
|
MAKE := make
|
||||||
|
MKDIR_P := mkdir -p
|
||||||
|
LN_S := ln -s
|
||||||
|
RM_F := rm -f
|
||||||
|
|
||||||
|
INSTALL := /usr/bin/install
|
||||||
|
INSTALLFLAGS := -p
|
||||||
|
|
||||||
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
|
||||||
|
BuildPath = build
|
||||||
|
TopBuildDir = $(BuildPath)
|
||||||
|
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||||
|
|
||||||
|
ResultPath = output
|
||||||
|
TopResultDir = $(ResultPath)
|
||||||
|
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||||
|
|
||||||
|
TargetTuple = cc1352
|
||||||
|
|
||||||
|
ARCHS = cortex-m4f
|
||||||
|
|
||||||
|
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||||
|
|
||||||
|
ifndef BuildJobs
|
||||||
|
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||||
|
endif
|
||||||
|
JOBSFLAG := -j$(BuildJobs)
|
||||||
|
|
||||||
|
#
|
||||||
|
# configure-arch <arch>
|
||||||
|
#
|
||||||
|
# Configure OpenThread for the specified architecture.
|
||||||
|
#
|
||||||
|
# arch - The architecture to configure.
|
||||||
|
#
|
||||||
|
define configure-arch
|
||||||
|
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||||
|
(cd $(BuildPath)/$(TargetTuple) \
|
||||||
|
&& $(AbsTopSourceDir)/configure \
|
||||||
|
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||||
|
CPP="$(CPP)" \
|
||||||
|
CC="$(CC)" \
|
||||||
|
CXX="$(CXX)" \
|
||||||
|
OBJC="$(OBJC)" \
|
||||||
|
OBJCXX="$(OBJCXX)" \
|
||||||
|
AR="$(AR)" \
|
||||||
|
RANLIB="$(RANLIB)" \
|
||||||
|
NM="$(NM)" \
|
||||||
|
STRIP="$(STRIP)" \
|
||||||
|
CPPFLAGS="$(CPPFLAGS)" \
|
||||||
|
CFLAGS="$(CFLAGS)" \
|
||||||
|
CXXFLAGS="$(CXXFLAGS)" \
|
||||||
|
LDFLAGS="$(LDFLAGS)" \
|
||||||
|
--host=arm-none-eabi \
|
||||||
|
--prefix=/ \
|
||||||
|
--exec-prefix=/$(TargetTuple) \
|
||||||
|
$(configure_OPTIONS))
|
||||||
|
endef # configure-arch
|
||||||
|
|
||||||
|
#
|
||||||
|
# build-arch <arch>
|
||||||
|
#
|
||||||
|
# Build the OpenThread intermediate build products for the specified
|
||||||
|
# architecture.
|
||||||
|
#
|
||||||
|
# arch - The architecture to build.
|
||||||
|
#
|
||||||
|
define build-arch
|
||||||
|
$(ECHO) " BUILD $(TargetTuple)"
|
||||||
|
$(MAKE) \
|
||||||
|
$(JOBSFLAG) \
|
||||||
|
-C $(BuildPath)/$(TargetTuple) \
|
||||||
|
--no-print-directory \
|
||||||
|
all
|
||||||
|
endef # build-arch
|
||||||
|
|
||||||
|
#
|
||||||
|
# stage-arch <arch>
|
||||||
|
#
|
||||||
|
# Stage (install) the OpenThread final build products for the specified
|
||||||
|
# architecture.
|
||||||
|
#
|
||||||
|
# arch - The architecture to stage.
|
||||||
|
#
|
||||||
|
define stage-arch
|
||||||
|
$(ECHO) " STAGE $(TargetTuple)"
|
||||||
|
$(MAKE) \
|
||||||
|
$(JOBSFLAG) \
|
||||||
|
-C $(BuildPath)/$(TargetTuple) \
|
||||||
|
--no-print-directory \
|
||||||
|
DESTDIR=$(AbsTopResultDir) \
|
||||||
|
install
|
||||||
|
endef # stage-arch
|
||||||
|
|
||||||
|
#
|
||||||
|
# ARCH_template <arch>
|
||||||
|
#
|
||||||
|
# Define macros, targets and rules to configure, build, and stage the
|
||||||
|
# OpenThread for a single architecture.
|
||||||
|
#
|
||||||
|
# arch - The architecture to instantiate the template for.
|
||||||
|
#
|
||||||
|
define ARCH_template
|
||||||
|
CONFIGURE_TARGETS += configure-$(1)
|
||||||
|
BUILD_TARGETS += do-build-$(1)
|
||||||
|
STAGE_TARGETS += stage-$(1)
|
||||||
|
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||||
|
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||||
|
|
||||||
|
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||||
|
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||||
|
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||||
|
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||||
|
|
||||||
|
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||||
|
|
||||||
|
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||||
|
$$(call configure-arch,$(1))
|
||||||
|
|
||||||
|
do-build-$(1): configure-$(1)
|
||||||
|
|
||||||
|
do-build-$(1):
|
||||||
|
+$$(call build-arch,$(1))
|
||||||
|
|
||||||
|
stage-$(1): do-build-$(1)
|
||||||
|
|
||||||
|
stage-$(1): | $(TopResultDir)
|
||||||
|
$$(call stage-arch,$(1))
|
||||||
|
|
||||||
|
$(1): stage-$(1)
|
||||||
|
endef # ARCH_template
|
||||||
|
|
||||||
|
.DEFAULT_GOAL := all
|
||||||
|
|
||||||
|
all: stage
|
||||||
|
|
||||||
|
#
|
||||||
|
# cortex-m4f
|
||||||
|
#
|
||||||
|
|
||||||
|
cortex-m4f_target_ABI = cortex-m4f
|
||||||
|
cortex-m4f_target_CPPFLAGS = -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb
|
||||||
|
cortex-m4f_target_CFLAGS = -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb
|
||||||
|
cortex-m4f_target_CXXFLAGS = -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb
|
||||||
|
cortex-m4f_target_LDFLAGS = -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb
|
||||||
|
|
||||||
|
# Instantiate an architecture-specific build template for each target
|
||||||
|
# architecture.
|
||||||
|
|
||||||
|
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||||
|
|
||||||
|
#
|
||||||
|
# Common / Finalization
|
||||||
|
#
|
||||||
|
|
||||||
|
configure: $(CONFIGURE_TARGETS)
|
||||||
|
|
||||||
|
build: $(BUILD_TARGETS)
|
||||||
|
|
||||||
|
stage: $(STAGE_TARGETS)
|
||||||
|
|
||||||
|
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||||
|
|
||||||
|
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||||
|
|
||||||
|
all: stage
|
||||||
|
|
||||||
|
$(DIRECTORIES):
|
||||||
|
$(ECHO) " MKDIR $@"
|
||||||
|
@$(MKDIR_P) "$@"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(ECHO) " CLEAN"
|
||||||
|
@$(RM_F) -r $(CLEAN_DIRS)
|
||||||
|
|
||||||
|
help:
|
||||||
|
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||||
|
$(ECHO) "architectures: "
|
||||||
|
$(ECHO) ""
|
||||||
|
$(ECHO) " $(ARCHS)"
|
||||||
|
$(ECHO) ""
|
||||||
|
$(ECHO) "To build only a particular architecture, specify: "
|
||||||
|
$(ECHO) ""
|
||||||
|
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||||
|
$(ECHO) ""
|
||||||
|
|
||||||
@@ -42,12 +42,15 @@ OBJCOPY = arm-none-eabi-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
|
||||||
--with-ncp-bus=uart \
|
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
--with-examples=cc2538 \
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=cc2538 \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
|||||||
@@ -42,15 +42,18 @@ OBJCOPY = arm-none-eabi-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=mtd \
|
--enable-cli \
|
||||||
--enable-ncp-app=mtd \
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
--with-ncp-bus=uart \
|
--with-ncp-bus=uart \
|
||||||
--with-examples=cc2650 \
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=cc2650 \
|
||||||
MBEDTLS_CPPFLAGS="$(CC2650_MBEDTLS_CPPFLAGS)" \
|
MBEDTLS_CPPFLAGS="$(CC2650_MBEDTLS_CPPFLAGS)" \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
CC2650_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"cc2650-mbedtls-config.h\"'
|
CC2650_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||||
|
CC2650_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"cc2650-mbedtls-config.h\"'
|
||||||
CC2650_MBEDTLS_CPPFLAGS += -I$(PWD)/examples/platforms/cc2650/crypto
|
CC2650_MBEDTLS_CPPFLAGS += -I$(PWD)/examples/platforms/cc2650/crypto
|
||||||
CC2650_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/ti/devices/cc26x0
|
CC2650_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/ti/devices/cc26x0
|
||||||
CC2650_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/mbedtls
|
CC2650_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/mbedtls
|
||||||
|
|||||||
@@ -42,10 +42,13 @@ OBJCOPY = arm-none-eabi-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
|
||||||
--with-ncp-bus=uart \
|
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
--with-examples=cc2652 \
|
--with-examples=cc2652 \
|
||||||
MBEDTLS_CPPFLAGS="$(CC2652_MBEDTLS_CPPFLAGS)" \
|
MBEDTLS_CPPFLAGS="$(CC2652_MBEDTLS_CPPFLAGS)" \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@@ -53,9 +56,10 @@ configure_OPTIONS = \
|
|||||||
DEFAULT_LOGGING ?= 1
|
DEFAULT_LOGGING ?= 1
|
||||||
|
|
||||||
CC2652_MBEDTLS_CPPFLAGS = \
|
CC2652_MBEDTLS_CPPFLAGS = \
|
||||||
-DMBEDTLS_CONFIG_FILE='\"cc2652-mbedtls-config.h\"' \
|
-DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"' \
|
||||||
|
-DMBEDTLS_USER_CONFIG_FILE='\"cc2652-mbedtls-config.h\"' \
|
||||||
-I$(PWD)/examples/platforms/cc2652/crypto \
|
-I$(PWD)/examples/platforms/cc2652/crypto \
|
||||||
-I$(PWD)/third_party/ti/devices/cc26x2 \
|
-I$(PWD)/third_party/ti/devices/cc13x2_cc26x2 \
|
||||||
-I$(PWD)/third_party/mbedtls \
|
-I$(PWD)/third_party/mbedtls \
|
||||||
-I$(PWD)/third_party/mbedtls/repo/include \
|
-I$(PWD)/third_party/mbedtls/repo/include \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|||||||
@@ -42,18 +42,22 @@ OBJCOPY = arm-none-eabi-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
--with-ncp-bus=uart \
|
--with-ncp-bus=uart \
|
||||||
--with-examples=da15000 \
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=da15000 \
|
||||||
MBEDTLS_CPPFLAGS="$(DA15000_MBEDTLS_CPPFLAGS)" \
|
MBEDTLS_CPPFLAGS="$(DA15000_MBEDTLS_CPPFLAGS)" \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
|
||||||
DA15000_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"da15000-mbedtls-config.h\"'
|
DA15000_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||||
|
DA15000_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"da15000-mbedtls-config.h\"'
|
||||||
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/examples/platforms/da15000/crypto
|
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/examples/platforms/da15000/crypto
|
||||||
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/bsp/include
|
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/bsp/include
|
||||||
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/bsp/peripherals/include
|
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/bsp/peripherals/include
|
||||||
|
|||||||
+12
-9
@@ -42,12 +42,15 @@ OBJCOPY = arm-none-eabi-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
|
||||||
--with-ncp-bus=uart \
|
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
--with-examples=efr32 \
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=efr32 \
|
||||||
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
@@ -79,11 +82,11 @@ EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
|||||||
EFR32_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"efr32-mbedtls-config.h\"'
|
EFR32_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"efr32-mbedtls-config.h\"'
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/crypto
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/crypto
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.2/util/third_party/mbedtls/configs
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.3/util/third_party/mbedtls/configs
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.2/platform/CMSIS/Include
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.3/platform/CMSIS/Include
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.2/util/third_party/mbedtls/sl_crypto/include
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.3/util/third_party/mbedtls/sl_crypto/include
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.2/platform/Device/SiliconLabs/EFR32MG12P/Include
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.3/platform/Device/SiliconLabs/EFR32MG12P/Include
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.2/platform/emlib/inc
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.3/platform/emlib/inc
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
||||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
||||||
|
|||||||
@@ -42,11 +42,14 @@ OBJCOPY = arc-elf32-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
--with-ncp-bus=uart \
|
--with-ncp-bus=uart \
|
||||||
--with-examples=emsk \
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=emsk \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
|||||||
@@ -46,8 +46,10 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
|
|||||||
BuildJobs ?= 9
|
BuildJobs ?= 9
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=ftd \
|
--enable-cli \
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
--with-examples=$(PPREFIX) \
|
--with-examples=$(PPREFIX) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|||||||
@@ -42,12 +42,15 @@ OBJCOPY = arm-none-eabi-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
|
||||||
--with-ncp-bus=uart \
|
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
--with-examples=kw41z \
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=kw41z \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
|||||||
@@ -43,11 +43,14 @@ BuildJobs ?= 10
|
|||||||
GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.`)
|
GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.`)
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
--with-examples=nrf52840 \
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=nrf52840 \
|
||||||
MBEDTLS_CPPFLAGS="$(NRF52840_MBEDTLS_CPPFLAGS)" \
|
MBEDTLS_CPPFLAGS="$(NRF52840_MBEDTLS_CPPFLAGS)" \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
@@ -61,6 +64,10 @@ else
|
|||||||
configure_OPTIONS += --with-ncp-bus=uart
|
configure_OPTIONS += --with-ncp-bus=uart
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BOOTLOADER),1)
|
||||||
|
configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf52840/nrf52840_bootloader.ld
|
||||||
|
endif
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
|
||||||
|
|||||||
+13
-7
@@ -46,26 +46,31 @@ BuildJobs ?= 10
|
|||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-application-coap \
|
--enable-application-coap \
|
||||||
|
--enable-application-coap-secure \
|
||||||
|
--enable-border-agent \
|
||||||
--enable-border-router \
|
--enable-border-router \
|
||||||
--enable-cert-log \
|
--enable-cert-log \
|
||||||
--enable-child-supervision \
|
--enable-child-supervision \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-commissioner \
|
--enable-commissioner \
|
||||||
--enable-dhcp6-client \
|
--enable-dhcp6-client \
|
||||||
--enable-dhcp6-server \
|
--enable-dhcp6-server \
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
--enable-dns-client \
|
--enable-dns-client \
|
||||||
|
--enable-ftd \
|
||||||
--enable-jam-detection \
|
--enable-jam-detection \
|
||||||
--enable-joiner \
|
--enable-joiner \
|
||||||
--enable-legacy \
|
--enable-legacy \
|
||||||
--enable-mac-filter \
|
--enable-mac-filter \
|
||||||
|
--enable-mtd \
|
||||||
--enable-mtd-network-diagnostic \
|
--enable-mtd-network-diagnostic \
|
||||||
--enable-ncp-app=all \
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
--enable-raw-link-api \
|
--enable-raw-link-api \
|
||||||
--enable-service \
|
--enable-service \
|
||||||
--enable-tmf-proxy \
|
--enable-udp-proxy \
|
||||||
--with-examples=posix \
|
--with-examples=posix \
|
||||||
--with-ncp-bus=uart \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
@@ -87,6 +92,10 @@ ifeq ($(VIRTUAL_TIME),1)
|
|||||||
COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME=1
|
COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(VIRTUAL_TIME_UART),1)
|
||||||
|
COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME_UART=1
|
||||||
|
endif
|
||||||
|
|
||||||
CPPFLAGS += \
|
CPPFLAGS += \
|
||||||
$(COMMONCFLAGS) \
|
$(COMMONCFLAGS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@@ -106,9 +115,6 @@ LDFLAGS += \
|
|||||||
INSTALL := /usr/bin/install
|
INSTALL := /usr/bin/install
|
||||||
INSTALLFLAGS := -p
|
INSTALLFLAGS := -p
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
|
||||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
|
||||||
|
|
||||||
BuildPath = build
|
BuildPath = build
|
||||||
TopBuildDir = $(BuildPath)
|
TopBuildDir = $(BuildPath)
|
||||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||||
|
|||||||
@@ -42,12 +42,15 @@ OBJCOPY = arm-none-eabi-objcopy
|
|||||||
BuildJobs ?= 10
|
BuildJobs ?= 10
|
||||||
|
|
||||||
configure_OPTIONS = \
|
configure_OPTIONS = \
|
||||||
--enable-cli-app=all \
|
--enable-cli \
|
||||||
--enable-ncp-app=all \
|
|
||||||
--with-ncp-bus=uart \
|
|
||||||
--enable-diag \
|
--enable-diag \
|
||||||
--with-examples=samr21 \
|
--enable-ftd \
|
||||||
|
--enable-mtd \
|
||||||
|
--enable-ncp \
|
||||||
|
--with-ncp-bus=uart \
|
||||||
|
--enable-radio-only \
|
||||||
--enable-linker-map \
|
--enable-linker-map \
|
||||||
|
--with-examples=samr21 \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ EXTRA_DIST = \
|
|||||||
|
|
||||||
# Always build (e.g. for 'make all') these subdirectories.
|
# Always build (e.g. for 'make all') these subdirectories.
|
||||||
|
|
||||||
|
if OPENTHREAD_ENABLE_EXAMPLES
|
||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
platforms \
|
platforms \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
if OPENTHREAD_EXAMPLES
|
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
apps \
|
apps \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ LDADD_COMMON += \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
endif # OPENTHREAD_ENABLE_DIAG
|
endif # OPENTHREAD_ENABLE_DIAG
|
||||||
|
|
||||||
if OPENTHREAD_ENABLE_CLI_FTD
|
if OPENTHREAD_ENABLE_FTD
|
||||||
bin_PROGRAMS += \
|
bin_PROGRAMS += \
|
||||||
ot-cli-ftd \
|
ot-cli-ftd \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@@ -93,7 +93,7 @@ ot_cli_ftd_SOURCES = \
|
|||||||
$(SOURCES_COMMON) \
|
$(SOURCES_COMMON) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
if OPENTHREAD_ENABLE_CLI_MTD
|
if OPENTHREAD_ENABLE_MTD
|
||||||
bin_PROGRAMS += \
|
bin_PROGRAMS += \
|
||||||
ot-cli-mtd \
|
ot-cli-mtd \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@@ -129,6 +129,10 @@ ot_cli_mtd_LDFLAGS += -Wl,-Ma
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if OPENTHREAD_BUILD_COVERAGE
|
if OPENTHREAD_BUILD_COVERAGE
|
||||||
|
CPPFLAGS_COMMON += \
|
||||||
|
-DOPENTHREAD_ENABLE_COVERAGE \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
CLEANFILES = $(wildcard *.gcda *.gcno)
|
CLEANFILES = $(wildcard *.gcda *.gcno)
|
||||||
endif # OPENTHREAD_BUILD_COVERAGE
|
endif # OPENTHREAD_BUILD_COVERAGE
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,19 @@
|
|||||||
|
|
||||||
#include <openthread/cli.h>
|
#include <openthread/cli.h>
|
||||||
#include <openthread/diag.h>
|
#include <openthread/diag.h>
|
||||||
#include <openthread/openthread.h>
|
#include <openthread/tasklet.h>
|
||||||
#include <openthread/platform/logging.h>
|
#include <openthread/platform/logging.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "openthread-system.h"
|
||||||
|
|
||||||
|
#if OPENTHREAD_EXAMPLES_POSIX
|
||||||
|
#include <setjmp.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
jmp_buf gResetJump;
|
||||||
|
|
||||||
|
void __gcov_flush();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||||
@@ -58,6 +67,17 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
otInstance *sInstance;
|
otInstance *sInstance;
|
||||||
|
|
||||||
|
#if OPENTHREAD_EXAMPLES_POSIX
|
||||||
|
if (setjmp(gResetJump))
|
||||||
|
{
|
||||||
|
alarm(0);
|
||||||
|
#if OPENTHREAD_ENABLE_COVERAGE
|
||||||
|
__gcov_flush();
|
||||||
|
#endif
|
||||||
|
execvp(argv[0], argv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||||
size_t otInstanceBufferLength = 0;
|
size_t otInstanceBufferLength = 0;
|
||||||
uint8_t *otInstanceBuffer = NULL;
|
uint8_t *otInstanceBuffer = NULL;
|
||||||
@@ -65,7 +85,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
pseudo_reset:
|
pseudo_reset:
|
||||||
|
|
||||||
PlatformInit(argc, argv);
|
otSysInit(argc, argv);
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||||
// Call to query the buffer size
|
// Call to query the buffer size
|
||||||
@@ -88,10 +108,10 @@ pseudo_reset:
|
|||||||
otDiagInit(sInstance);
|
otDiagInit(sInstance);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (!PlatformPseudoResetWasRequested())
|
while (!otSysPseudoResetWasRequested())
|
||||||
{
|
{
|
||||||
otTaskletsProcess(sInstance);
|
otTaskletsProcess(sInstance);
|
||||||
PlatformProcessDrivers(sInstance);
|
otSysProcessDrivers(sInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
otInstanceFinalize(sInstance);
|
otInstanceFinalize(sInstance);
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ SOURCES_COMMON += \
|
|||||||
LDADD_MBEDTLS = \
|
LDADD_MBEDTLS = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
LDADD_DIAG = \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||||
LDADD_MBEDTLS += \
|
LDADD_MBEDTLS += \
|
||||||
$(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
|
$(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
|
||||||
@@ -61,7 +64,7 @@ LDADD_MBEDTLS += \
|
|||||||
endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||||
|
|
||||||
if OPENTHREAD_ENABLE_DIAG
|
if OPENTHREAD_ENABLE_DIAG
|
||||||
LDADD_COMMON += \
|
LDADD_DIAG += \
|
||||||
$(top_builddir)/src/diag/libopenthread-diag.a \
|
$(top_builddir)/src/diag/libopenthread-diag.a \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
@@ -72,7 +75,7 @@ LDADD_COMMON += \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
endif # OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
|
endif # OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
|
||||||
|
|
||||||
if OPENTHREAD_ENABLE_NCP_FTD
|
if OPENTHREAD_ENABLE_FTD
|
||||||
bin_PROGRAMS += \
|
bin_PROGRAMS += \
|
||||||
ot-ncp-ftd \
|
ot-ncp-ftd \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@@ -87,9 +90,11 @@ ot_ncp_ftd_LDADD = \
|
|||||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||||
$(LDADD_COMMON) \
|
$(LDADD_COMMON) \
|
||||||
$(LDADD_MBEDTLS) \
|
$(LDADD_MBEDTLS) \
|
||||||
|
$(LDADD_DIAG) \
|
||||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||||
$(LDADD_COMMON) \
|
$(LDADD_COMMON) \
|
||||||
$(LDADD_MBEDTLS) \
|
$(LDADD_MBEDTLS) \
|
||||||
|
$(LDADD_DIAG) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ot_ncp_ftd_LDFLAGS = \
|
ot_ncp_ftd_LDFLAGS = \
|
||||||
@@ -104,7 +109,7 @@ ot_ncp_ftd_SOURCES = \
|
|||||||
$(SOURCES_COMMON) \
|
$(SOURCES_COMMON) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
if OPENTHREAD_ENABLE_NCP_MTD
|
if OPENTHREAD_ENABLE_MTD
|
||||||
bin_PROGRAMS += \
|
bin_PROGRAMS += \
|
||||||
ot-ncp-mtd \
|
ot-ncp-mtd \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@@ -119,9 +124,11 @@ ot_ncp_mtd_LDADD = \
|
|||||||
$(top_builddir)/src/core/libopenthread-mtd.a \
|
$(top_builddir)/src/core/libopenthread-mtd.a \
|
||||||
$(LDADD_COMMON) \
|
$(LDADD_COMMON) \
|
||||||
$(LDADD_MBEDTLS) \
|
$(LDADD_MBEDTLS) \
|
||||||
|
$(LDADD_DIAG) \
|
||||||
$(top_builddir)/src/core/libopenthread-mtd.a \
|
$(top_builddir)/src/core/libopenthread-mtd.a \
|
||||||
$(LDADD_COMMON) \
|
$(LDADD_COMMON) \
|
||||||
$(LDADD_MBEDTLS) \
|
$(LDADD_MBEDTLS) \
|
||||||
|
$(LDADD_DIAG) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ot_ncp_mtd_LDFLAGS = \
|
ot_ncp_mtd_LDFLAGS = \
|
||||||
@@ -136,7 +143,7 @@ ot_ncp_mtd_SOURCES = \
|
|||||||
$(SOURCES_COMMON) \
|
$(SOURCES_COMMON) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
if OPENTHREAD_ENABLE_NCP_RADIO
|
if OPENTHREAD_ENABLE_RADIO_ONLY
|
||||||
bin_PROGRAMS += \
|
bin_PROGRAMS += \
|
||||||
ot-ncp-radio \
|
ot-ncp-radio \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@@ -173,6 +180,10 @@ ot_ncp_radio_LDFLAGS += -Wl,-Ma
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if OPENTHREAD_BUILD_COVERAGE
|
if OPENTHREAD_BUILD_COVERAGE
|
||||||
|
CPPFLAGS_COMMON += \
|
||||||
|
-DOPENTHREAD_ENABLE_COVERAGE \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
CLEANFILES = $(wildcard *.gcda *.gcno)
|
CLEANFILES = $(wildcard *.gcda *.gcno)
|
||||||
endif # OPENTHREAD_BUILD_COVERAGE
|
endif # OPENTHREAD_BUILD_COVERAGE
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,18 @@
|
|||||||
|
|
||||||
#include <openthread/diag.h>
|
#include <openthread/diag.h>
|
||||||
#include <openthread/ncp.h>
|
#include <openthread/ncp.h>
|
||||||
#include <openthread/openthread.h>
|
#include <openthread/tasklet.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "openthread-system.h"
|
||||||
|
|
||||||
|
#if OPENTHREAD_EXAMPLES_POSIX
|
||||||
|
#include <setjmp.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
jmp_buf gResetJump;
|
||||||
|
|
||||||
|
void __gcov_flush();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||||
@@ -57,6 +66,17 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
otInstance *sInstance;
|
otInstance *sInstance;
|
||||||
|
|
||||||
|
#if OPENTHREAD_EXAMPLES_POSIX
|
||||||
|
if (setjmp(gResetJump))
|
||||||
|
{
|
||||||
|
alarm(0);
|
||||||
|
#if OPENTHREAD_ENABLE_COVERAGE
|
||||||
|
__gcov_flush();
|
||||||
|
#endif
|
||||||
|
execvp(argv[0], argv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||||
size_t otInstanceBufferLength = 0;
|
size_t otInstanceBufferLength = 0;
|
||||||
uint8_t *otInstanceBuffer = NULL;
|
uint8_t *otInstanceBuffer = NULL;
|
||||||
@@ -64,7 +84,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
pseudo_reset:
|
pseudo_reset:
|
||||||
|
|
||||||
PlatformInit(argc, argv);
|
otSysInit(argc, argv);
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||||
// Call to query the buffer size
|
// Call to query the buffer size
|
||||||
@@ -87,10 +107,10 @@ pseudo_reset:
|
|||||||
otDiagInit(sInstance);
|
otDiagInit(sInstance);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (!PlatformPseudoResetWasRequested())
|
while (!otSysPseudoResetWasRequested())
|
||||||
{
|
{
|
||||||
otTaskletsProcess(sInstance);
|
otTaskletsProcess(sInstance);
|
||||||
PlatformProcessDrivers(sInstance);
|
otSysProcessDrivers(sInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
otInstanceFinalize(sInstance);
|
otInstanceFinalize(sInstance);
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define OTDLL 1
|
#define OTDLL 1
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/border_router.h>
|
#include <openthread/border_router.h>
|
||||||
#include <openthread/thread_ftd.h>
|
#include <openthread/thread_ftd.h>
|
||||||
#include <openthread/commissioner.h>
|
#include <openthread/commissioner.h>
|
||||||
@@ -72,7 +71,7 @@ public enum class otLinkModeFlags : unsigned int
|
|||||||
None = 0,
|
None = 0,
|
||||||
RxOnWhenIdle = 0x1, /* 1, if the sender has its receiver on when not transmitting. 0, otherwise. */
|
RxOnWhenIdle = 0x1, /* 1, if the sender has its receiver on when not transmitting. 0, otherwise. */
|
||||||
SecureDataRequests = 0x2, /* 1, if the sender will use IEEE 802.15.4 to secure all data requests. 0, otherwise. */
|
SecureDataRequests = 0x2, /* 1, if the sender will use IEEE 802.15.4 to secure all data requests. 0, otherwise. */
|
||||||
DeviceType = 0x4, /* 1, if the sender is an FFD. 0, otherwise. */
|
DeviceType = 0x4, /* 1, if the sender is an FTD. 0, otherwise. */
|
||||||
NetworkData = 0x8 /* 1, if the sender requires the full Network Data. 0, otherwise. */
|
NetworkData = 0x8 /* 1, if the sender requires the full Network Data. 0, otherwise. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ifeq ($(BORDER_AGENT),1)
|
||||||
|
configure_OPTIONS += --enable-border-agent
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(BORDER_ROUTER),1)
|
ifeq ($(BORDER_ROUTER),1)
|
||||||
configure_OPTIONS += --enable-border-router
|
configure_OPTIONS += --enable-border-router
|
||||||
endif
|
endif
|
||||||
@@ -39,6 +43,10 @@ ifeq ($(COAP),1)
|
|||||||
configure_OPTIONS += --enable-application-coap
|
configure_OPTIONS += --enable-application-coap
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(COAPS),1)
|
||||||
|
configure_OPTIONS += --enable-application-coap-secure
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(COMMISSIONER),1)
|
ifeq ($(COMMISSIONER),1)
|
||||||
configure_OPTIONS += --enable-commissioner
|
configure_OPTIONS += --enable-commissioner
|
||||||
endif
|
endif
|
||||||
@@ -95,8 +103,8 @@ ifeq ($(SERVICE),1)
|
|||||||
configure_OPTIONS += --enable-service
|
configure_OPTIONS += --enable-service
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TMF_PROXY),1)
|
ifeq ($(UDP_PROXY),1)
|
||||||
configure_OPTIONS += --enable-tmf-proxy
|
configure_OPTIONS += --enable-udp-proxy
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(DEBUG_UART),1)
|
ifeq ($(DEBUG_UART),1)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
OpenThread includes Windows 10 drivers necessary for interfacing with UART NCP devices. The design allows for support of both simple radio devices and devices running the complete OpenThread stack.
|
OpenThread includes Windows 10 drivers necessary for interfacing with UART NCP devices. The design allows for support of both simple radio devices and devices running the complete OpenThread stack.
|
||||||
|
|
||||||
|
> **NOTE:** OpenThread's Windows integration has not been actively maintained for some time. While Windows builds are still a part of OpenThread's continuous integration (CI), the Windows CI only tests basic compilation.
|
||||||
|
|
||||||
## Architecture ##
|
## Architecture ##
|
||||||
|
|
||||||
Details on the architecture can be found [here](https://openthread.io/platforms/windows10).
|
Details on the architecture can be found [here](https://openthread.io/platforms/windows10).
|
||||||
@@ -99,7 +101,11 @@ Since most of these drivers are still under development, it is recommended to al
|
|||||||
|
|
||||||
The filter driver `otlwf.sys` exposes the IOCTL interface that `otapi.dll` uses and houses the bulk of the actual Thread logic. `otapi.dll` exposes the C interface for user mode applications to use to control the Thread interfaces.
|
The filter driver `otlwf.sys` exposes the IOCTL interface that `otapi.dll` uses and houses the bulk of the actual Thread logic. `otapi.dll` exposes the C interface for user mode applications to use to control the Thread interfaces.
|
||||||
|
|
||||||
1. Download the latest binaries ([x86](https://ci.appveyor.com/api/projects/jwhui/openthread/artifacts/release.zip?job=Platform%3A+x86), [x64](https://ci.appveyor.com/api/projects/jwhui/openthread/artifacts/release.zip?job=Platform%3A+x64), [arm](https://ci.appveyor.com/api/projects/jwhui/openthread/artifacts/release.zip?job=Platform%3A+arm))
|
1. Download the latest platform binary on AppVeyor:
|
||||||
|
1. Go to the [latest build](https://ci.appveyor.com/project/jwhui/openthread) page
|
||||||
|
1. Select the desired platform (x64, x86, arm)
|
||||||
|
1. On the platform page, select **ARTIFACTS**
|
||||||
|
1. Download the release.zip file for that platform
|
||||||
1. Extract the files to a temporary location
|
1. Extract the files to a temporary location
|
||||||
1. Open an admin command prompt in the temporary location
|
1. Open an admin command prompt in the temporary location
|
||||||
1. Run the `install_otlwf.cmd` file
|
1. Run the `install_otlwf.cmd` file
|
||||||
@@ -146,7 +152,7 @@ The `instancelist` command queries for all available instances/interfaces on the
|
|||||||
|
|
||||||
### Sample Universal App
|
### Sample Universal App
|
||||||
|
|
||||||
The latest build of the sample universal app can be downloaded from ([x86](https://ci.appveyor.com/api/projects/jwhui/openthread/artifacts/build/bin/app.zip?job=Platform%3A+x86), [x64](https://ci.appveyor.com/api/projects/jwhui/openthread/artifacts/build/bin/app.zip?job=Platform%3A+x64), [arm](https://ci.appveyor.com/api/projects/jwhui/openthread/artifacts/build/bin/app.zip?job=Platform%3A+arm)).
|
The latest builds of the sample universal app can be downloaded from the [latest AppVeyor build](https://ci.appveyor.com/project/jwhui/openthread).
|
||||||
|
|
||||||
### Running Python Certification Tests
|
### Running Python Certification Tests
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
#ifndef __OTLWFIOCTL_H__
|
#ifndef __OTLWFIOCTL_H__
|
||||||
#define __OTLWFIOCTL_H__
|
#define __OTLWFIOCTL_H__
|
||||||
|
|
||||||
#include <openthread/types.h>
|
|
||||||
|
|
||||||
__inline LONG ThreadErrorToNtstatus(otError error) { return (LONG)-((int)error); }
|
__inline LONG ThreadErrorToNtstatus(otError error) { return (LONG)-((int)error); }
|
||||||
|
|
||||||
// User-mode IOCTL path for CreateFile
|
// User-mode IOCTL path for CreateFile
|
||||||
|
|||||||
@@ -29,14 +29,12 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* @brief
|
* @brief
|
||||||
* This file defines a node interface for openthread.h to be used for certification tests
|
* This file defines a node interface for openthread to be used for certification tests
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OTNODE_H_
|
#ifndef OTNODE_H_
|
||||||
#define OTNODE_H_
|
#define OTNODE_H_
|
||||||
|
|
||||||
#include <openthread/openthread.h>
|
|
||||||
|
|
||||||
#ifndef OTNODEAPI
|
#ifndef OTNODEAPI
|
||||||
#define OTNODEAPI __declspec(dllimport)
|
#define OTNODEAPI __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1506,7 +1506,7 @@ otLinkSetExtendedAddress(
|
|||||||
}
|
}
|
||||||
|
|
||||||
OTAPI
|
OTAPI
|
||||||
const uint8_t *
|
const otExtendedPanId *
|
||||||
OTCALL
|
OTCALL
|
||||||
otThreadGetExtendedPanId(
|
otThreadGetExtendedPanId(
|
||||||
_In_ otInstance *aInstance
|
_In_ otInstance *aInstance
|
||||||
@@ -1515,12 +1515,13 @@ otThreadGetExtendedPanId(
|
|||||||
if (aInstance == nullptr) return nullptr;
|
if (aInstance == nullptr) return nullptr;
|
||||||
|
|
||||||
otExtendedPanId *Result = (otExtendedPanId*)malloc(sizeof(otExtendedPanId));
|
otExtendedPanId *Result = (otExtendedPanId*)malloc(sizeof(otExtendedPanId));
|
||||||
if (Result && QueryIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, Result) != ERROR_SUCCESS)
|
if (Result == nullptr) return nullptr;
|
||||||
|
if (QueryIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, Result) != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
free(Result);
|
free(Result);
|
||||||
Result = nullptr;
|
Result = nullptr;
|
||||||
}
|
}
|
||||||
return (uint8_t*)Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
OTAPI
|
OTAPI
|
||||||
@@ -1528,11 +1529,11 @@ otError
|
|||||||
OTCALL
|
OTCALL
|
||||||
otThreadSetExtendedPanId(
|
otThreadSetExtendedPanId(
|
||||||
_In_ otInstance *aInstance,
|
_In_ otInstance *aInstance,
|
||||||
const uint8_t *aExtendedPanId
|
const otExtendedPanId *aExtendedPanId
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
||||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, (const otExtendedPanId*)aExtendedPanId));
|
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, aExtendedPanId));
|
||||||
}
|
}
|
||||||
|
|
||||||
OTAPI
|
OTAPI
|
||||||
@@ -1670,7 +1671,7 @@ otThreadGetMeshLocalEid(
|
|||||||
}
|
}
|
||||||
|
|
||||||
OTAPI
|
OTAPI
|
||||||
const uint8_t *
|
const otMeshLocalPrefix *
|
||||||
OTCALL
|
OTCALL
|
||||||
otThreadGetMeshLocalPrefix(
|
otThreadGetMeshLocalPrefix(
|
||||||
_In_ otInstance *aInstance
|
_In_ otInstance *aInstance
|
||||||
@@ -1684,7 +1685,7 @@ otThreadGetMeshLocalPrefix(
|
|||||||
free(Result);
|
free(Result);
|
||||||
Result = nullptr;
|
Result = nullptr;
|
||||||
}
|
}
|
||||||
return (uint8_t*)Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
OTAPI
|
OTAPI
|
||||||
@@ -1692,11 +1693,11 @@ otError
|
|||||||
OTCALL
|
OTCALL
|
||||||
otThreadSetMeshLocalPrefix(
|
otThreadSetMeshLocalPrefix(
|
||||||
_In_ otInstance *aInstance,
|
_In_ otInstance *aInstance,
|
||||||
const uint8_t *aMeshLocalPrefix
|
const otMeshLocalPrefix *aMeshLocalPrefix
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
||||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_MESH_LOCAL_PREFIX, (const otMeshLocalPrefix*)aMeshLocalPrefix));
|
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_MESH_LOCAL_PREFIX, aMeshLocalPrefix));
|
||||||
}
|
}
|
||||||
|
|
||||||
OTAPI
|
OTAPI
|
||||||
@@ -2287,13 +2288,14 @@ OTAPI
|
|||||||
otError
|
otError
|
||||||
OTCALL
|
OTCALL
|
||||||
otDatasetSendMgmtActiveGet(
|
otDatasetSendMgmtActiveGet(
|
||||||
_In_ otInstance *aInstance,
|
_In_ otInstance *aInstance,
|
||||||
|
const otOperationalDatasetComponents *aDatasetComponents,
|
||||||
const uint8_t *aTlvTypes,
|
const uint8_t *aTlvTypes,
|
||||||
uint8_t aLength,
|
uint8_t aLength,
|
||||||
_In_opt_ const otIp6Address *aAddress
|
_In_opt_ const otIp6Address *aAddress
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
if (aInstance == nullptr || aDatasetComponents == nullptr) return OT_ERROR_INVALID_ARGS;
|
||||||
if (aTlvTypes == nullptr && aLength != 0) return OT_ERROR_INVALID_ARGS;
|
if (aTlvTypes == nullptr && aLength != 0) return OT_ERROR_INVALID_ARGS;
|
||||||
|
|
||||||
DWORD BufferSize = sizeof(GUID) + sizeof(uint8_t) + aLength;
|
DWORD BufferSize = sizeof(GUID) + sizeof(uint8_t) + aLength;
|
||||||
@@ -2302,6 +2304,7 @@ otDatasetSendMgmtActiveGet(
|
|||||||
if (Buffer == nullptr) return OT_ERROR_NO_BUFS;
|
if (Buffer == nullptr) return OT_ERROR_NO_BUFS;
|
||||||
|
|
||||||
memcpy_s(Buffer, BufferSize, &aInstance->InterfaceGuid, sizeof(GUID));
|
memcpy_s(Buffer, BufferSize, &aInstance->InterfaceGuid, sizeof(GUID));
|
||||||
|
memcpy_s(Buffer + sizeof(GUID), BufferSize - sizeof(GUID), aDatasetComponents, sizeof(otOperationalDatasetComponents));
|
||||||
memcpy_s(Buffer + sizeof(GUID), BufferSize - sizeof(GUID), &aLength, sizeof(aLength));
|
memcpy_s(Buffer + sizeof(GUID), BufferSize - sizeof(GUID), &aLength, sizeof(aLength));
|
||||||
if (aLength > 0)
|
if (aLength > 0)
|
||||||
memcpy_s(Buffer + sizeof(GUID) + sizeof(uint8_t), BufferSize - sizeof(GUID) - sizeof(uint8_t), aTlvTypes, aLength);
|
memcpy_s(Buffer + sizeof(GUID) + sizeof(uint8_t), BufferSize - sizeof(GUID) - sizeof(uint8_t), aTlvTypes, aLength);
|
||||||
@@ -2320,7 +2323,7 @@ otError
|
|||||||
OTCALL
|
OTCALL
|
||||||
otDatasetSendMgmtActiveSet(
|
otDatasetSendMgmtActiveSet(
|
||||||
_In_ otInstance *aInstance,
|
_In_ otInstance *aInstance,
|
||||||
const otOperationalDataset *aDataset,
|
const otOperationalDataset *aDataset,
|
||||||
const uint8_t *aTlvs,
|
const uint8_t *aTlvs,
|
||||||
uint8_t aLength
|
uint8_t aLength
|
||||||
)
|
)
|
||||||
@@ -2349,13 +2352,14 @@ OTAPI
|
|||||||
otError
|
otError
|
||||||
OTCALL
|
OTCALL
|
||||||
otDatasetSendMgmtPendingGet(
|
otDatasetSendMgmtPendingGet(
|
||||||
_In_ otInstance *aInstance,
|
_In_ otInstance *aInstance,
|
||||||
|
const otOperationalDatasetComponents *aDatasetComponents,
|
||||||
const uint8_t *aTlvTypes,
|
const uint8_t *aTlvTypes,
|
||||||
uint8_t aLength,
|
uint8_t aLength,
|
||||||
_In_opt_ const otIp6Address *aAddress
|
_In_opt_ const otIp6Address *aAddress
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
if (aInstance == nullptr || aDatasetComponents == nullptr) return OT_ERROR_INVALID_ARGS;
|
||||||
if (aTlvTypes == nullptr && aLength != 0) return OT_ERROR_INVALID_ARGS;
|
if (aTlvTypes == nullptr && aLength != 0) return OT_ERROR_INVALID_ARGS;
|
||||||
|
|
||||||
DWORD BufferSize = sizeof(GUID) + sizeof(uint8_t) + aLength;
|
DWORD BufferSize = sizeof(GUID) + sizeof(uint8_t) + aLength;
|
||||||
@@ -2364,6 +2368,7 @@ otDatasetSendMgmtPendingGet(
|
|||||||
if (Buffer == nullptr) return OT_ERROR_NO_BUFS;
|
if (Buffer == nullptr) return OT_ERROR_NO_BUFS;
|
||||||
|
|
||||||
memcpy_s(Buffer, BufferSize, &aInstance->InterfaceGuid, sizeof(GUID));
|
memcpy_s(Buffer, BufferSize, &aInstance->InterfaceGuid, sizeof(GUID));
|
||||||
|
memcpy_s(Buffer + sizeof(GUID), BufferSize - sizeof(GUID), aDatasetComponents, sizeof(otOperationalDatasetComponents));
|
||||||
memcpy_s(Buffer + sizeof(GUID), BufferSize - sizeof(GUID), &aLength, sizeof(aLength));
|
memcpy_s(Buffer + sizeof(GUID), BufferSize - sizeof(GUID), &aLength, sizeof(aLength));
|
||||||
if (aLength > 0)
|
if (aLength > 0)
|
||||||
memcpy_s(Buffer + sizeof(GUID) + sizeof(uint8_t), BufferSize - sizeof(GUID) - sizeof(uint8_t), aTlvTypes, aLength);
|
memcpy_s(Buffer + sizeof(GUID) + sizeof(uint8_t), BufferSize - sizeof(GUID) - sizeof(uint8_t), aTlvTypes, aLength);
|
||||||
@@ -3440,7 +3445,7 @@ otThreadErrorToString(
|
|||||||
switch (aError)
|
switch (aError)
|
||||||
{
|
{
|
||||||
case OT_ERROR_NONE:
|
case OT_ERROR_NONE:
|
||||||
retval = "None";
|
retval = "OK";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OT_ERROR_FAILED:
|
case OT_ERROR_FAILED:
|
||||||
@@ -3941,6 +3946,7 @@ otJoinerGetId(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
||||||
|
ZeroMemory(aJoinerId, sizeof(otExtAddress));
|
||||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_JOINER_ID, aJoinerId));
|
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_JOINER_ID, aJoinerId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
#define OTDLL
|
#define OTDLL
|
||||||
#define OTAPI EXTERN_C __declspec(dllexport)
|
#define OTAPI EXTERN_C __declspec(dllexport)
|
||||||
|
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/border_router.h>
|
#include <openthread/border_router.h>
|
||||||
#include <openthread/dataset_ftd.h>
|
#include <openthread/dataset_ftd.h>
|
||||||
|
#include <openthread/error.h>
|
||||||
#include <openthread/thread_ftd.h>
|
#include <openthread/thread_ftd.h>
|
||||||
#include <openthread/commissioner.h>
|
#include <openthread/commissioner.h>
|
||||||
#include <openthread/joiner.h>
|
#include <openthread/joiner.h>
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/cli.h>
|
#include <openthread/cli.h>
|
||||||
#include <openthread/platform/uart.h>
|
#include <openthread/platform/uart.h>
|
||||||
#include <openthread/platform/misc.h>
|
#include <openthread/platform/misc.h>
|
||||||
|
|||||||
@@ -1256,12 +1256,13 @@ otLwfIoCtl_otExtendedPanId(
|
|||||||
|
|
||||||
if (InBufferLength >= sizeof(otExtendedPanId))
|
if (InBufferLength >= sizeof(otExtendedPanId))
|
||||||
{
|
{
|
||||||
status = ThreadErrorToNtstatus(otThreadSetExtendedPanId(pFilter->otCtx, (uint8_t*)InBuffer));
|
status = ThreadErrorToNtstatus(otThreadSetExtendedPanId(pFilter->otCtx, (otExtendedPanId*)InBuffer));
|
||||||
*OutBufferLength = 0;
|
*OutBufferLength = 0;
|
||||||
}
|
}
|
||||||
else if (*OutBufferLength >= sizeof(otExtendedPanId))
|
else if (*OutBufferLength >= sizeof(otExtendedPanId))
|
||||||
{
|
{
|
||||||
memcpy(OutBuffer, otThreadGetExtendedPanId(pFilter->otCtx), sizeof(otExtendedPanId));
|
const otExtendedPanId* aExtendedPanId = otThreadGetExtendedPanId(pFilter->otCtx);
|
||||||
|
memcpy(OutBuffer, aExtendedPanId, sizeof(otExtendedPanId));
|
||||||
*OutBufferLength = sizeof(otExtendedPanId);
|
*OutBufferLength = sizeof(otExtendedPanId);
|
||||||
status = STATUS_SUCCESS;
|
status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1539,7 +1540,7 @@ enum
|
|||||||
{
|
{
|
||||||
kThreadMode_RxOnWhenIdle = (1 << 3),
|
kThreadMode_RxOnWhenIdle = (1 << 3),
|
||||||
kThreadMode_SecureDataRequest = (1 << 2),
|
kThreadMode_SecureDataRequest = (1 << 2),
|
||||||
kThreadMode_FullFunctionDevice = (1 << 1),
|
kThreadMode_FullThreadDevice = (1 << 1),
|
||||||
kThreadMode_FullNetworkData = (1 << 0),
|
kThreadMode_FullNetworkData = (1 << 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1563,7 +1564,7 @@ otLwfTunIoCtl_otLinkMode(
|
|||||||
|
|
||||||
if (aLinkMode->mRxOnWhenIdle) numeric_mode |= kThreadMode_RxOnWhenIdle;
|
if (aLinkMode->mRxOnWhenIdle) numeric_mode |= kThreadMode_RxOnWhenIdle;
|
||||||
if (aLinkMode->mSecureDataRequests) numeric_mode |= kThreadMode_SecureDataRequest;
|
if (aLinkMode->mSecureDataRequests) numeric_mode |= kThreadMode_SecureDataRequest;
|
||||||
if (aLinkMode->mDeviceType) numeric_mode |= kThreadMode_FullFunctionDevice;
|
if (aLinkMode->mDeviceType) numeric_mode |= kThreadMode_FullThreadDevice;
|
||||||
if (aLinkMode->mNetworkData) numeric_mode |= kThreadMode_FullNetworkData;
|
if (aLinkMode->mNetworkData) numeric_mode |= kThreadMode_FullNetworkData;
|
||||||
|
|
||||||
status =
|
status =
|
||||||
@@ -1614,7 +1615,7 @@ otLwfTunIoCtl_otLinkMode_Handler(
|
|||||||
|
|
||||||
aLinkMode->mRxOnWhenIdle = ((numeric_mode & kThreadMode_RxOnWhenIdle) == kThreadMode_RxOnWhenIdle);
|
aLinkMode->mRxOnWhenIdle = ((numeric_mode & kThreadMode_RxOnWhenIdle) == kThreadMode_RxOnWhenIdle);
|
||||||
aLinkMode->mSecureDataRequests = ((numeric_mode & kThreadMode_SecureDataRequest) == kThreadMode_SecureDataRequest);
|
aLinkMode->mSecureDataRequests = ((numeric_mode & kThreadMode_SecureDataRequest) == kThreadMode_SecureDataRequest);
|
||||||
aLinkMode->mDeviceType = ((numeric_mode & kThreadMode_FullFunctionDevice) == kThreadMode_FullFunctionDevice);
|
aLinkMode->mDeviceType = ((numeric_mode & kThreadMode_FullThreadDevice) == kThreadMode_FullThreadDevice);
|
||||||
aLinkMode->mNetworkData = ((numeric_mode & kThreadMode_FullNetworkData) == kThreadMode_FullNetworkData);
|
aLinkMode->mNetworkData = ((numeric_mode & kThreadMode_FullNetworkData) == kThreadMode_FullNetworkData);
|
||||||
|
|
||||||
*OutBufferLength = sizeof(otLinkModeConfig);
|
*OutBufferLength = sizeof(otLinkModeConfig);
|
||||||
@@ -1935,12 +1936,13 @@ otLwfIoCtl_otMeshLocalPrefix(
|
|||||||
|
|
||||||
if (InBufferLength >= sizeof(otMeshLocalPrefix))
|
if (InBufferLength >= sizeof(otMeshLocalPrefix))
|
||||||
{
|
{
|
||||||
status = ThreadErrorToNtstatus(otThreadSetMeshLocalPrefix(pFilter->otCtx, InBuffer));
|
status = ThreadErrorToNtstatus(otThreadSetMeshLocalPrefix(pFilter->otCtx, (otMeshLocalPrefix*)InBuffer));
|
||||||
*OutBufferLength = 0;
|
*OutBufferLength = 0;
|
||||||
}
|
}
|
||||||
else if (*OutBufferLength >= sizeof(otMeshLocalPrefix))
|
else if (*OutBufferLength >= sizeof(otMeshLocalPrefix))
|
||||||
{
|
{
|
||||||
memcpy(OutBuffer, otThreadGetMeshLocalPrefix(pFilter->otCtx), sizeof(otMeshLocalPrefix));
|
const otMeshLocalPrefix* aMeshLocalPrefix = otThreadGetMeshLocalPrefix(pFilter->otCtx);
|
||||||
|
memcpy(OutBuffer, aMeshLocalPrefix, sizeof(otMeshLocalPrefix));
|
||||||
*OutBufferLength = sizeof(otMeshLocalPrefix);
|
*OutBufferLength = sizeof(otMeshLocalPrefix);
|
||||||
status = STATUS_SUCCESS;
|
status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -5918,20 +5920,22 @@ otLwfIoCtl_otSendActiveGet(
|
|||||||
*OutBufferLength = 0;
|
*OutBufferLength = 0;
|
||||||
UNREFERENCED_PARAMETER(OutBuffer);
|
UNREFERENCED_PARAMETER(OutBuffer);
|
||||||
|
|
||||||
if (InBufferLength >= sizeof(uint8_t))
|
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t))
|
||||||
{
|
{
|
||||||
uint8_t aLength = *(uint8_t*)InBuffer;
|
const otOperationalDatasetComponents *aDatasetComp = (otOperationalDatasetComponents*)InBuffer;
|
||||||
PUCHAR aTlvTypes = aLength == 0 ? NULL : InBuffer + sizeof(uint8_t);
|
uint8_t aLength = *(uint8_t*)(InBuffer + sizeof(otOperationalDatasetComponents));
|
||||||
|
PUCHAR aTlvTypes = aLength == 0 ? NULL : InBuffer + sizeof(otOperationalDatasetComponents) + sizeof(uint8_t);
|
||||||
|
|
||||||
if (InBufferLength >= sizeof(uint8_t) + aLength)
|
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength)
|
||||||
{
|
{
|
||||||
otIp6Address *aAddress = NULL;
|
otIp6Address *aAddress = NULL;
|
||||||
if (InBufferLength >= sizeof(uint8_t) + aLength + sizeof(otIp6Address))
|
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength + sizeof(otIp6Address))
|
||||||
aAddress = (otIp6Address*)(InBuffer + sizeof(uint8_t) + aLength);
|
aAddress = (otIp6Address*)(InBuffer + sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength);
|
||||||
|
|
||||||
status = ThreadErrorToNtstatus(
|
status = ThreadErrorToNtstatus(
|
||||||
otDatasetSendMgmtActiveGet(
|
otDatasetSendMgmtActiveGet(
|
||||||
pFilter->otCtx,
|
pFilter->otCtx,
|
||||||
|
aDatasetComp,
|
||||||
aTlvTypes,
|
aTlvTypes,
|
||||||
aLength,
|
aLength,
|
||||||
aAddress)
|
aAddress)
|
||||||
@@ -5997,20 +6001,22 @@ otLwfIoCtl_otSendPendingGet(
|
|||||||
*OutBufferLength = 0;
|
*OutBufferLength = 0;
|
||||||
UNREFERENCED_PARAMETER(OutBuffer);
|
UNREFERENCED_PARAMETER(OutBuffer);
|
||||||
|
|
||||||
if (InBufferLength >= sizeof(uint8_t))
|
if (InBufferLength >= sizeof(otOperationalDataset) + sizeof(uint8_t))
|
||||||
{
|
{
|
||||||
uint8_t aLength = *(uint8_t*)InBuffer;
|
const otOperationalDatasetComponents *aDatasetComp = (otOperationalDatasetComponents*)InBuffer;
|
||||||
PUCHAR aTlvTypes = aLength == 0 ? NULL : InBuffer + sizeof(uint8_t);
|
uint8_t aLength = *(uint8_t*)(InBuffer + sizeof(otOperationalDataset));
|
||||||
|
PUCHAR aTlvTypes = aLength == 0 ? NULL : InBuffer + sizeof(otOperationalDataset) + sizeof(uint8_t);
|
||||||
|
|
||||||
if (InBufferLength >= sizeof(uint8_t) + aLength)
|
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength)
|
||||||
{
|
{
|
||||||
otIp6Address *aAddress = NULL;
|
otIp6Address *aAddress = NULL;
|
||||||
if (InBufferLength >= sizeof(uint8_t) + aLength + sizeof(otIp6Address))
|
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength + sizeof(otIp6Address))
|
||||||
aAddress = (otIp6Address*)(InBuffer + sizeof(uint8_t) + aLength);
|
aAddress = (otIp6Address*)(InBuffer + sizeof(otOperationalDataset) + sizeof(uint8_t) + aLength);
|
||||||
|
|
||||||
status = ThreadErrorToNtstatus(
|
status = ThreadErrorToNtstatus(
|
||||||
otDatasetSendMgmtPendingGet(
|
otDatasetSendMgmtPendingGet(
|
||||||
pFilter->otCtx,
|
pFilter->otCtx,
|
||||||
|
aDatasetComp,
|
||||||
aTlvTypes,
|
aTlvTypes,
|
||||||
aLength,
|
aLength,
|
||||||
aAddress)
|
aAddress)
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ RtlCopyBufferToMdl(
|
|||||||
|
|
||||||
#include <openthread-windows-config.h>
|
#include <openthread-windows-config.h>
|
||||||
#include <openthread-core-config.h>
|
#include <openthread-core-config.h>
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/border_router.h>
|
#include <openthread/border_router.h>
|
||||||
#include <openthread/dataset_ftd.h>
|
#include <openthread/dataset_ftd.h>
|
||||||
#include <openthread/thread_ftd.h>
|
#include <openthread/thread_ftd.h>
|
||||||
|
|||||||
@@ -1976,24 +1976,24 @@ OTNODEAPI int32_t OTCALL otNodeSetActiveDataset(otNode* aNode, uint64_t aTimesta
|
|||||||
otOperationalDataset aDataset = {};
|
otOperationalDataset aDataset = {};
|
||||||
|
|
||||||
aDataset.mActiveTimestamp = aTimestamp;
|
aDataset.mActiveTimestamp = aTimestamp;
|
||||||
aDataset.mIsActiveTimestampSet = true;
|
aDataset.mComponents.mIsActiveTimestampPresent = true;
|
||||||
|
|
||||||
if (aPanId != 0)
|
if (aPanId != 0)
|
||||||
{
|
{
|
||||||
aDataset.mPanId = aPanId;
|
aDataset.mPanId = aPanId;
|
||||||
aDataset.mIsPanIdSet = true;
|
aDataset.mComponents.mIsPanIdPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aChannel != 0)
|
if (aChannel != 0)
|
||||||
{
|
{
|
||||||
aDataset.mChannel = aChannel;
|
aDataset.mChannel = aChannel;
|
||||||
aDataset.mIsChannelSet = true;
|
aDataset.mComponents.mIsChannelPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aChannelMask != 0)
|
if (aChannelMask != 0)
|
||||||
{
|
{
|
||||||
aDataset.mChannelMaskPage0 = aChannelMask;
|
aDataset.mChannelMaskPage0 = aChannelMask;
|
||||||
aDataset.mIsChannelMaskPage0Set = true;
|
aDataset.mComponents.mIsChannelMaskPage0Present = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMasterKey != NULL && strlen(aMasterKey) != 0)
|
if (aMasterKey != NULL && strlen(aMasterKey) != 0)
|
||||||
@@ -2004,7 +2004,7 @@ OTNODEAPI int32_t OTCALL otNodeSetActiveDataset(otNode* aNode, uint64_t aTimesta
|
|||||||
printf("invalid length key %d\r\n", keyLength);
|
printf("invalid length key %d\r\n", keyLength);
|
||||||
return OT_ERROR_PARSE;
|
return OT_ERROR_PARSE;
|
||||||
}
|
}
|
||||||
aDataset.mIsMasterKeySet = true;
|
aDataset.mComponents.mIsMasterKeyPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = otDatasetSetActive(aNode->mInstance, &aDataset);
|
auto result = otDatasetSetActive(aNode->mInstance, &aDataset);
|
||||||
@@ -2022,25 +2022,25 @@ OTNODEAPI int32_t OTCALL otNodeSetPendingDataset(otNode* aNode, uint64_t aActive
|
|||||||
if (aActiveTimestamp != 0)
|
if (aActiveTimestamp != 0)
|
||||||
{
|
{
|
||||||
aDataset.mActiveTimestamp = aActiveTimestamp;
|
aDataset.mActiveTimestamp = aActiveTimestamp;
|
||||||
aDataset.mIsActiveTimestampSet = true;
|
aDataset.mComponents.mIsActiveTimestampPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aPendingTimestamp != 0)
|
if (aPendingTimestamp != 0)
|
||||||
{
|
{
|
||||||
aDataset.mPendingTimestamp = aPendingTimestamp;
|
aDataset.mPendingTimestamp = aPendingTimestamp;
|
||||||
aDataset.mIsPendingTimestampSet = true;
|
aDataset.mComponents.mIsPendingTimestampPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aPanId != 0)
|
if (aPanId != 0)
|
||||||
{
|
{
|
||||||
aDataset.mPanId = aPanId;
|
aDataset.mPanId = aPanId;
|
||||||
aDataset.mIsPanIdSet = true;
|
aDataset.mComponents.mIsPanIdPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aChannel != 0)
|
if (aChannel != 0)
|
||||||
{
|
{
|
||||||
aDataset.mChannel = aChannel;
|
aDataset.mChannel = aChannel;
|
||||||
aDataset.mIsChannelSet = true;
|
aDataset.mComponents.mIsChannelPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = otDatasetSetPending(aNode->mInstance, &aDataset);
|
auto result = otDatasetSetPending(aNode->mInstance, &aDataset);
|
||||||
@@ -2058,31 +2058,31 @@ OTNODEAPI int32_t OTCALL otNodeSendPendingSet(otNode* aNode, uint64_t aActiveTim
|
|||||||
if (aActiveTimestamp != 0)
|
if (aActiveTimestamp != 0)
|
||||||
{
|
{
|
||||||
aDataset.mActiveTimestamp = aActiveTimestamp;
|
aDataset.mActiveTimestamp = aActiveTimestamp;
|
||||||
aDataset.mIsActiveTimestampSet = true;
|
aDataset.mComponents.mIsActiveTimestampPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aPendingTimestamp != 0)
|
if (aPendingTimestamp != 0)
|
||||||
{
|
{
|
||||||
aDataset.mPendingTimestamp = aPendingTimestamp;
|
aDataset.mPendingTimestamp = aPendingTimestamp;
|
||||||
aDataset.mIsPendingTimestampSet = true;
|
aDataset.mComponents.mIsPendingTimestampPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aDelayTimer != 0)
|
if (aDelayTimer != 0)
|
||||||
{
|
{
|
||||||
aDataset.mDelay = aDelayTimer;
|
aDataset.mDelay = aDelayTimer;
|
||||||
aDataset.mIsDelaySet = true;
|
aDataset.mComponents.mIsDelayPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aPanId != 0)
|
if (aPanId != 0)
|
||||||
{
|
{
|
||||||
aDataset.mPanId = aPanId;
|
aDataset.mPanId = aPanId;
|
||||||
aDataset.mIsPanIdSet = true;
|
aDataset.mComponents.mIsPanIdPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aChannel != 0)
|
if (aChannel != 0)
|
||||||
{
|
{
|
||||||
aDataset.mChannel = aChannel;
|
aDataset.mChannel = aChannel;
|
||||||
aDataset.mIsChannelSet = true;
|
aDataset.mComponents.mIsChannelPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMasterKey != NULL && strlen(aMasterKey) != 0)
|
if (aMasterKey != NULL && strlen(aMasterKey) != 0)
|
||||||
@@ -2093,7 +2093,7 @@ OTNODEAPI int32_t OTCALL otNodeSendPendingSet(otNode* aNode, uint64_t aActiveTim
|
|||||||
printf("invalid length key %d\r\n", keyLength);
|
printf("invalid length key %d\r\n", keyLength);
|
||||||
return OT_ERROR_PARSE;
|
return OT_ERROR_PARSE;
|
||||||
}
|
}
|
||||||
aDataset.mIsMasterKeySet = true;
|
aDataset.mComponents.mIsMasterKeyPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMeshLocal != NULL && strlen(aMeshLocal) != 0)
|
if (aMeshLocal != NULL && strlen(aMeshLocal) != 0)
|
||||||
@@ -2102,13 +2102,13 @@ OTNODEAPI int32_t OTCALL otNodeSendPendingSet(otNode* aNode, uint64_t aActiveTim
|
|||||||
auto error = otIp6AddressFromString(aMeshLocal, &prefix);
|
auto error = otIp6AddressFromString(aMeshLocal, &prefix);
|
||||||
if (error != OT_ERROR_NONE) return error;
|
if (error != OT_ERROR_NONE) return error;
|
||||||
memcpy(aDataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(aDataset.mMeshLocalPrefix.m8));
|
memcpy(aDataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(aDataset.mMeshLocalPrefix.m8));
|
||||||
aDataset.mIsMeshLocalPrefixSet = true;
|
aDataset.mComponents.mIsMeshLocalPrefixPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aNetworkName != NULL && strlen(aNetworkName) != 0)
|
if (aNetworkName != NULL && strlen(aNetworkName) != 0)
|
||||||
{
|
{
|
||||||
strcpy_s(aDataset.mNetworkName.m8, sizeof(aDataset.mNetworkName.m8), aNetworkName);
|
strcpy_s(aDataset.mNetworkName.m8, sizeof(aDataset.mNetworkName.m8), aNetworkName);
|
||||||
aDataset.mIsNetworkNameSet = true;
|
aDataset.mComponents.mIsNetworkNamePresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = otDatasetSendMgmtPendingSet(aNode->mInstance, &aDataset, nullptr, 0);
|
auto result = otDatasetSendMgmtPendingSet(aNode->mInstance, &aDataset, nullptr, 0);
|
||||||
@@ -2128,24 +2128,24 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
|||||||
if (aActiveTimestamp != 0)
|
if (aActiveTimestamp != 0)
|
||||||
{
|
{
|
||||||
aDataset.mActiveTimestamp = aActiveTimestamp;
|
aDataset.mActiveTimestamp = aActiveTimestamp;
|
||||||
aDataset.mIsActiveTimestampSet = true;
|
aDataset.mComponents.mIsActiveTimestampPresent = true;
|
||||||
}
|
}
|
||||||
if (aPanId != 0)
|
if (aPanId != 0)
|
||||||
{
|
{
|
||||||
aDataset.mPanId = aPanId;
|
aDataset.mPanId = aPanId;
|
||||||
aDataset.mIsPanIdSet = true;
|
aDataset.mComponents.mIsPanIdPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aChannel != 0)
|
if (aChannel != 0)
|
||||||
{
|
{
|
||||||
aDataset.mChannel = aChannel;
|
aDataset.mChannel = aChannel;
|
||||||
aDataset.mIsChannelSet = true;
|
aDataset.mComponents.mIsChannelPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aChannelMask != 0)
|
if (aChannelMask != 0)
|
||||||
{
|
{
|
||||||
aDataset.mChannelMaskPage0 = aChannelMask;
|
aDataset.mChannelMaskPage0 = aChannelMask;
|
||||||
aDataset.mIsChannelMaskPage0Set = true;
|
aDataset.mComponents.mIsChannelMaskPage0Present = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aExtPanId != NULL && strlen(aExtPanId) != 0)
|
if (aExtPanId != NULL && strlen(aExtPanId) != 0)
|
||||||
@@ -2156,7 +2156,7 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
|||||||
printf("invalid length ext pan id %d\r\n", keyLength);
|
printf("invalid length ext pan id %d\r\n", keyLength);
|
||||||
return OT_ERROR_PARSE;
|
return OT_ERROR_PARSE;
|
||||||
}
|
}
|
||||||
aDataset.mIsExtendedPanIdSet = true;
|
aDataset.mComponents.mIsExtendedPanIdPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMasterKey != NULL && strlen(aMasterKey) != 0)
|
if (aMasterKey != NULL && strlen(aMasterKey) != 0)
|
||||||
@@ -2167,7 +2167,7 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
|||||||
printf("invalid length key %d\r\n", keyLength);
|
printf("invalid length key %d\r\n", keyLength);
|
||||||
return OT_ERROR_PARSE;
|
return OT_ERROR_PARSE;
|
||||||
}
|
}
|
||||||
aDataset.mIsMasterKeySet = true;
|
aDataset.mComponents.mIsMasterKeyPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMeshLocal != NULL && strlen(aMeshLocal) != 0)
|
if (aMeshLocal != NULL && strlen(aMeshLocal) != 0)
|
||||||
@@ -2176,13 +2176,13 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
|||||||
auto error = otIp6AddressFromString(aMeshLocal, &prefix);
|
auto error = otIp6AddressFromString(aMeshLocal, &prefix);
|
||||||
if (error != OT_ERROR_NONE) return error;
|
if (error != OT_ERROR_NONE) return error;
|
||||||
memcpy(aDataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(aDataset.mMeshLocalPrefix.m8));
|
memcpy(aDataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(aDataset.mMeshLocalPrefix.m8));
|
||||||
aDataset.mIsMeshLocalPrefixSet = true;
|
aDataset.mComponents.mIsMeshLocalPrefixPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aNetworkName != NULL && strlen(aNetworkName) != 0)
|
if (aNetworkName != NULL && strlen(aNetworkName) != 0)
|
||||||
{
|
{
|
||||||
strcpy_s(aDataset.mNetworkName.m8, sizeof(aDataset.mNetworkName.m8), aNetworkName);
|
strcpy_s(aDataset.mNetworkName.m8, sizeof(aDataset.mNetworkName.m8), aNetworkName);
|
||||||
aDataset.mIsNetworkNameSet = true;
|
aDataset.mComponents.mIsNetworkNamePresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aBinary != NULL && strlen(aBinary) != 0)
|
if (aBinary != NULL && strlen(aBinary) != 0)
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ using namespace std;
|
|||||||
#define OTDLL
|
#define OTDLL
|
||||||
#define OTNODEAPI EXTERN_C __declspec(dllexport)
|
#define OTNODEAPI EXTERN_C __declspec(dllexport)
|
||||||
|
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/border_router.h>
|
#include <openthread/border_router.h>
|
||||||
#include <openthread/dataset_ftd.h>
|
#include <openthread/dataset_ftd.h>
|
||||||
#include <openthread/thread_ftd.h>
|
#include <openthread/thread_ftd.h>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
|||||||
# Always package (e.g. for 'make dist') these subdirectories.
|
# Always package (e.g. for 'make dist') these subdirectories.
|
||||||
|
|
||||||
DIST_SUBDIRS = \
|
DIST_SUBDIRS = \
|
||||||
|
cc1352 \
|
||||||
cc2538 \
|
cc2538 \
|
||||||
cc2650 \
|
cc2650 \
|
||||||
cc2652 \
|
cc2652 \
|
||||||
@@ -51,6 +52,10 @@ SUBDIRS = \
|
|||||||
utils \
|
utils \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
if OPENTHREAD_EXAMPLES_CC1352
|
||||||
|
SUBDIRS += cc1352
|
||||||
|
endif
|
||||||
|
|
||||||
if OPENTHREAD_EXAMPLES_CC2538
|
if OPENTHREAD_EXAMPLES_CC2538
|
||||||
SUBDIRS += cc2538
|
SUBDIRS += cc2538
|
||||||
endif
|
endif
|
||||||
@@ -96,12 +101,13 @@ SUBDIRS += samr21
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
platform.h \
|
openthread-system.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
# Always pretty (e.g. for 'make pretty') these subdirectories.
|
# Always pretty (e.g. for 'make pretty') these subdirectories.
|
||||||
|
|
||||||
PRETTY_SUBDIRS = \
|
PRETTY_SUBDIRS = \
|
||||||
|
cc1352 \
|
||||||
cc2538 \
|
cc2538 \
|
||||||
cc2650 \
|
cc2650 \
|
||||||
cc2652 \
|
cc2652 \
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ LDFLAGS_COMMON = $(NULL)
|
|||||||
SOURCES_COMMON = $(NULL)
|
SOURCES_COMMON = $(NULL)
|
||||||
LIBTOOLFLAGS_COMMON = --preserve-dup-deps
|
LIBTOOLFLAGS_COMMON = --preserve-dup-deps
|
||||||
|
|
||||||
|
if OPENTHREAD_EXAMPLES_CC1352
|
||||||
|
include $(top_srcdir)/examples/platforms/cc1352/Makefile.platform.am
|
||||||
|
endif
|
||||||
|
|
||||||
if OPENTHREAD_EXAMPLES_CC2538
|
if OPENTHREAD_EXAMPLES_CC2538
|
||||||
include $(top_srcdir)/examples/platforms/cc2538/Makefile.platform.am
|
include $(top_srcdir)/examples/platforms/cc2538/Makefile.platform.am
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
#
|
||||||
|
# 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
|
||||||
|
|
||||||
|
lib_LIBRARIES = libopenthread-cc1352.a
|
||||||
|
|
||||||
|
# Do not enable -pedantic-errors for cc13xx driverlib
|
||||||
|
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
|
||||||
|
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
|
||||||
|
|
||||||
|
libopenthread_cc1352_a_CPPFLAGS = \
|
||||||
|
-I$(top_srcdir)/include \
|
||||||
|
-I$(top_srcdir)/src \
|
||||||
|
-I$(top_srcdir)/src/core \
|
||||||
|
-I$(top_srcdir)/examples/platforms \
|
||||||
|
-I$(top_srcdir)/examples/platforms/cc1352 \
|
||||||
|
-I$(top_srcdir)/third_party/ti/devices/cc13x2_cc26x2 \
|
||||||
|
-I$(top_srcdir)/third_party/mbedtls/repo/include \
|
||||||
|
$(MBEDTLS_CPPFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
PLATFORM_SOURCES = \
|
||||||
|
alarm.c \
|
||||||
|
diag.c \
|
||||||
|
flash.c \
|
||||||
|
logging.c \
|
||||||
|
misc.c \
|
||||||
|
radio.c \
|
||||||
|
random.c \
|
||||||
|
system.c \
|
||||||
|
uart.c \
|
||||||
|
crypto/aes_alt.c \
|
||||||
|
cc1352_ccfg.c \
|
||||||
|
cc1352_startup.c \
|
||||||
|
cxx_helpers.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
libopenthread_cc1352_a_SOURCES = \
|
||||||
|
$(PLATFORM_SOURCES) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
libopenthread_cc1352_a_DEPENDENCIES = \
|
||||||
|
$(top_srcdir)/third_party/ti/devices/cc13x2_cc26x2/driverlib/bin/gcc/driverlib.a \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
noinst_HEADERS = \
|
||||||
|
platform-cc1352.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
PRETTY_FILES = \
|
||||||
|
$(PLATFORM_SOURCES) \
|
||||||
|
$(noinst_HEADERS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
Dash = -
|
||||||
|
libopenthread_cc1352_a_LIBADD = \
|
||||||
|
$(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o")
|
||||||
|
|
||||||
|
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||||
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# cc1352 platform-specific Makefile
|
||||||
|
#
|
||||||
|
|
||||||
|
CPPFLAGS_COMMON += \
|
||||||
|
-I$(top_srcdir)/third_party/ti/devices/cc13x2_cc26x2 \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LDADD_COMMON += \
|
||||||
|
$(top_builddir)/examples/platforms/cc1352/libopenthread-cc1352.a \
|
||||||
|
$(top_srcdir)/third_party/ti/devices/cc13x2_cc26x2/driverlib/bin/gcc/driverlib.a \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LDFLAGS_COMMON += \
|
||||||
|
-T $(top_srcdir)/third_party/ti/devices/cc13x2_cc26x2/linker_files/cc26x2r1f.lds \
|
||||||
|
$(NULL)
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
# OpenThread on CC1352 Example
|
||||||
|
|
||||||
|
This directory contains example platform drivers for the [Texas Instruments
|
||||||
|
CC1352R1][cc1352r1].
|
||||||
|
|
||||||
|
The example platform drivers are intended to present the minimal code necessary
|
||||||
|
to support OpenThread. As a result, the example platform drivers do not
|
||||||
|
necessarily highlight the platform's full capabilities. Consult the [SimpleLink
|
||||||
|
CC26X2R1 SDK][cc26x2r1-sdk] for more development option. The platform drivers
|
||||||
|
were built for the [CC1352R1 LAUNCHXL][cc1352r1-launchxl], usage on other
|
||||||
|
boards with a cc1352r1 may require changes to the peripheral drivers.
|
||||||
|
|
||||||
|
[cc1352r1-launchxl]: http://www.ti.com/tool/launchxl-cc26x2r1
|
||||||
|
[cc26x2r1-sdk]: http://www.ti.com/tool/simplelink-cc26x2-sdk
|
||||||
|
<!---
|
||||||
|
TODO: Update link when cc1352 product page is live
|
||||||
|
[cc1352r1]: http://www.ti.com/product/cc1352r1
|
||||||
|
-->
|
||||||
|
[cc1352r1]: http://www.ti.com/tool/launchxl-cc26x2r1
|
||||||
|
|
||||||
|
## Toolchain
|
||||||
|
|
||||||
|
Building the examples for the cc1352 requires [GNU AutoConf][gnu-autoconf],
|
||||||
|
[GNU AutoMake][gnu-automake], [Python][python], and the [ARM gcc
|
||||||
|
toolchain][arm-toolchain].
|
||||||
|
|
||||||
|
With the exception of the arm toolchain, most of these tools are installed by
|
||||||
|
default on modern Posix systems. It is recommended to setup a Linux virtual
|
||||||
|
machine for building on a Windows host system. For help setting up VirtualBox
|
||||||
|
with Ubuntu, consult this [community help wiki
|
||||||
|
article][ubuntu-wiki-virtualbox].
|
||||||
|
|
||||||
|
[gnu-autoconf]: https://www.gnu.org/software/autoconf
|
||||||
|
[gnu-automake]: https://www.gnu.org/software/automake
|
||||||
|
[python]: https://www.python.org
|
||||||
|
[arm-toolchain]: https://launchpad.net/gcc-arm-embedded
|
||||||
|
[cygwin]: https://www.cygwin.com
|
||||||
|
[mingw]: http://www.mingw.org
|
||||||
|
[ubuntu-wiki-virtualbox]: https://help.ubuntu.com/community/VirtualBox
|
||||||
|
|
||||||
|
In a Bash terminal, follow these instructions to install the GNU toolchain and
|
||||||
|
other dependencies.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd <path-to-openthread>
|
||||||
|
$ ./script/bootstrap
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
In a Bash terminal, follow these instructions to build the cc1352 examples.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd <path-to-openthread>
|
||||||
|
$ ./bootstrap
|
||||||
|
$ make -f examples/Makefile-cc1352
|
||||||
|
```
|
||||||
|
|
||||||
|
## Flash Binaries
|
||||||
|
|
||||||
|
If the build completed successfully, the `elf` files may be found in
|
||||||
|
`<path-to-openthread>/output/cc1352/bin`.
|
||||||
|
|
||||||
|
Flash the images with [Uniflash][uniflash]. Make sure to deselect the binary
|
||||||
|
check-box, Uniflash assumes a file without an extension is a binary file.
|
||||||
|
|
||||||
|
[uniflash]: http://www.ti.com/tool/uniflash
|
||||||
|
|
||||||
|
## Interact
|
||||||
|
|
||||||
|
### CLI example
|
||||||
|
|
||||||
|
1. With a terminal client (PuTTY, minicom, etc.) open the com port associated
|
||||||
|
with the cc1352 UART. The serial port settings are:
|
||||||
|
* 115200 baud
|
||||||
|
* 8 data bits
|
||||||
|
* no parity bit
|
||||||
|
* 1 stop bit
|
||||||
|
2. Type `help` for a list of commands.
|
||||||
|
3. Follow the instructions in the [CLI README][cli-readme] for instructions on
|
||||||
|
setting up a network.
|
||||||
|
|
||||||
|
[cli-readme]: ../../../src/cli/README.md
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> help
|
||||||
|
help
|
||||||
|
channel
|
||||||
|
childtimeout
|
||||||
|
contextreusedelay
|
||||||
|
extaddr
|
||||||
|
extpanid
|
||||||
|
ipaddr
|
||||||
|
keysequence
|
||||||
|
leaderweight
|
||||||
|
masterkey
|
||||||
|
mode
|
||||||
|
netdataregister
|
||||||
|
networkidtimeout
|
||||||
|
networkname
|
||||||
|
panid
|
||||||
|
ping
|
||||||
|
prefix
|
||||||
|
releaserouterid
|
||||||
|
rloc16
|
||||||
|
route
|
||||||
|
routerupgradethreshold
|
||||||
|
scan
|
||||||
|
start
|
||||||
|
state
|
||||||
|
stop
|
||||||
|
whitelist
|
||||||
|
```
|
||||||
|
|
||||||
|
### NCP example
|
||||||
|
|
||||||
|
Refer to the documentation in the [wpantund][wpantund] project for build
|
||||||
|
instructions and usage information.
|
||||||
|
|
||||||
|
[wpantund]: https://github.com/openthread/wpantund
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* This file implements the OpenThread platform abstraction for the alarm.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <openthread/config.h>
|
||||||
|
|
||||||
|
#include <driverlib/aon_rtc.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <openthread/platform/alarm-milli.h>
|
||||||
|
#include <openthread/platform/diag.h>
|
||||||
|
|
||||||
|
#include "platform-cc1352.h"
|
||||||
|
|
||||||
|
/* NOTE: we could use systick, but that would sacrifice atleast a few ops
|
||||||
|
* every ms, and not run when the processor is sleeping.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static uint32_t sTime0 = 0;
|
||||||
|
static uint32_t sAlarmTime = 0;
|
||||||
|
static bool sIsRunning = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform-cc1352.h
|
||||||
|
*/
|
||||||
|
void cc1352AlarmInit(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* NOTE: this will not enable the individual rtc alarm channels
|
||||||
|
*/
|
||||||
|
AONRTCEnable();
|
||||||
|
sIsRunning = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/alarm-milli.h
|
||||||
|
*/
|
||||||
|
uint32_t otPlatAlarmMilliGetNow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This is current value of RTC as it appears in the register.
|
||||||
|
* With seconds as the upper 32 bits and fractions of a second as the
|
||||||
|
* lower 32 bits <32.32>.
|
||||||
|
*/
|
||||||
|
uint64_t rtcVal = AONRTCCurrent64BitValueGet();
|
||||||
|
return ((rtcVal * 1000) >> 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/alarm-milli.h
|
||||||
|
*/
|
||||||
|
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||||
|
{
|
||||||
|
(void)aInstance;
|
||||||
|
sTime0 = aT0;
|
||||||
|
sAlarmTime = aDt;
|
||||||
|
sIsRunning = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/alarm-milli.h
|
||||||
|
*/
|
||||||
|
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
(void)aInstance;
|
||||||
|
sIsRunning = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform-cc1352.h
|
||||||
|
*/
|
||||||
|
void cc1352AlarmProcess(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
uint32_t offsetTime;
|
||||||
|
|
||||||
|
if (sIsRunning)
|
||||||
|
{
|
||||||
|
/* unsinged subtraction will result in the absolute offset */
|
||||||
|
offsetTime = otPlatAlarmMilliGetNow() - sTime0;
|
||||||
|
|
||||||
|
if (sAlarmTime <= offsetTime)
|
||||||
|
{
|
||||||
|
sIsRunning = false;
|
||||||
|
#if OPENTHREAD_ENABLE_DIAG
|
||||||
|
|
||||||
|
if (otPlatDiagModeGet())
|
||||||
|
{
|
||||||
|
otPlatDiagAlarmFired(aInstance);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||||
|
{
|
||||||
|
otPlatAlarmMilliFired(aInstance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure the Customer Configuration Area.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
// enable bootloader backdoor
|
||||||
|
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 // Enable ROM boot loader
|
||||||
|
|
||||||
|
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x0 // Active low to open boot loader backdoor
|
||||||
|
|
||||||
|
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0x0F // DIO15 (BTN-1 button) on CC1352 LaunchPad Board for boot loader backdoor
|
||||||
|
|
||||||
|
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5 // Enabled boot loader backdoor
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Include the default ccfg struct and configuration code.
|
||||||
|
*/
|
||||||
|
#include <startup_files/ccfg.c>
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
@@ -0,0 +1,201 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CC1352_RADIO_H_
|
||||||
|
#define CC1352_RADIO_H_
|
||||||
|
|
||||||
|
#include <driverlib/rf_ieee_cmd.h>
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
IEEE802154_FRAME_TYPE_MASK = 0x7, ///< (IEEE 802.15.4-2006) PSDU.FCF.frameType
|
||||||
|
IEEE802154_FRAME_TYPE_ACK = 0x2, ///< (IEEE 802.15.4-2006) frame type: ACK
|
||||||
|
IEEE802154_ACK_REQUEST = (1<<5), ///< (IEEE 802.15.4-2006) PSDU.FCF.bAR
|
||||||
|
IEEE802154_DSN_OFFSET = 2, ///< (IEEE 802.15.4-2006) PSDU.sequenceNumber
|
||||||
|
IEEE802154_MAC_MIN_BE = 1, ///< (IEEE 802.15.4-2006) macMinBE
|
||||||
|
IEEE802154_MAC_MAX_BE = 5, ///< (IEEE 802.15.4-2006) macMaxBE
|
||||||
|
IEEE802154_MAC_MAX_CSMA_BACKOFFS = 4, ///< (IEEE 802.15.4-2006) macMaxCSMABackoffs
|
||||||
|
IEEE802154_MAC_MAX_FRAMES_RETRIES = 3, ///< (IEEE 802.15.4-2006) macMaxFrameRetries
|
||||||
|
IEEE802154_A_UINT_BACKOFF_PERIOD = 20, ///< (IEEE 802.15.4-2006 7.4.1) MAC constants
|
||||||
|
IEEE802154_A_TURNAROUND_TIME = 12, ///< (IEEE 802.15.4-2006 6.4.1) PHY constants
|
||||||
|
IEEE802154_PHY_SHR_DURATION = 10,
|
||||||
|
///< (IEEE 802.15.4-2006 6.4.2) PHY PIB attribute, specifically the O-QPSK PHY
|
||||||
|
IEEE802154_PHY_SYMBOLS_PER_OCTET = 2,
|
||||||
|
///< (IEEE 802.15.4-2006 6.4.2) PHY PIB attribute, specifically the O-QPSK PHY
|
||||||
|
IEEE802154_MAC_ACK_WAIT_DURATION = (IEEE802154_A_UINT_BACKOFF_PERIOD +
|
||||||
|
IEEE802154_A_TURNAROUND_TIME +
|
||||||
|
IEEE802154_PHY_SHR_DURATION +
|
||||||
|
( 6 * IEEE802154_PHY_SYMBOLS_PER_OCTET)),
|
||||||
|
///< (IEEE 802.15.4-2006 7.4.2) macAckWaitDuration PIB attribute
|
||||||
|
IEEE802154_SYMBOLS_PER_SEC = 62500 ///< (IEEE 802.15.4-2006 6.5.3.2) O-QPSK symbol rate
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CC1352_RAT_TICKS_PER_SEC = 4000000, ///< 4MHz clock
|
||||||
|
CC1352_INVALID_RSSI = 127,
|
||||||
|
CC1352_UNKNOWN_EUI64 = 0xFF,
|
||||||
|
///< If the EUI64 read from the ccfg is all ones then the customer did not set the address
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TX Power dBm lookup table - values from SmartRF Studio
|
||||||
|
*/
|
||||||
|
typedef struct output_config
|
||||||
|
{
|
||||||
|
int dbm;
|
||||||
|
uint16_t value;
|
||||||
|
} output_config_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * TX Power dBm lookup table from SmartRF Studio 7 2.10.0#94
|
||||||
|
*/
|
||||||
|
static const output_config_t rgOutputPower[] =
|
||||||
|
{
|
||||||
|
{ 5, 0x941E},
|
||||||
|
{ 4, 0x6c16},
|
||||||
|
{ 3, 0x5411},
|
||||||
|
{ 2, 0x440d},
|
||||||
|
{ 1, 0x385c},
|
||||||
|
{ 0, 0x3459},
|
||||||
|
{ -3, 0x2851},
|
||||||
|
{ -5, 0x224e},
|
||||||
|
{ -6, 0x204d},
|
||||||
|
{ -9, 0x0a8d},
|
||||||
|
{ -10, 0x168c},
|
||||||
|
{ -12, 0x108a},
|
||||||
|
{ -15, 0xc88c},
|
||||||
|
{ -18, 0x06c9},
|
||||||
|
{ -21, 0x06c7},
|
||||||
|
};
|
||||||
|
|
||||||
|
#define OUTPUT_CONFIG_COUNT (sizeof(rgOutputPower) / sizeof(rgOutputPower[0]))
|
||||||
|
|
||||||
|
/* Max and Min Output Power in dBm */
|
||||||
|
#define OUTPUT_POWER_MIN (rgOutputPower[OUTPUT_CONFIG_COUNT - 1].dbm)
|
||||||
|
#define OUTPUT_POWER_MAX (rgOutputPower[0].dbm)
|
||||||
|
#define OUTPUT_POWER_UNKNOWN 0xFFFF
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return value used when searching the source match array
|
||||||
|
*/
|
||||||
|
#define CC1352_SRC_MATCH_NONE 0xFF
|
||||||
|
|
||||||
|
/**
|
||||||
|
* number of extended addresses used for source matching
|
||||||
|
*/
|
||||||
|
#define CC1352_EXTADD_SRC_MATCH_NUM 10
|
||||||
|
|
||||||
|
/**
|
||||||
|
* structure for source matching extended addresses
|
||||||
|
*/
|
||||||
|
typedef struct __attribute__((aligned(4))) ext_src_match_data
|
||||||
|
{
|
||||||
|
uint32_t srcMatchEn[((CC1352_EXTADD_SRC_MATCH_NUM + 31) / 32)];
|
||||||
|
uint32_t srcPendEn[((CC1352_EXTADD_SRC_MATCH_NUM + 31) / 32)];
|
||||||
|
uint64_t extAddrEnt[CC1352_EXTADD_SRC_MATCH_NUM];
|
||||||
|
} ext_src_match_data_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* number of short addresses used for source matching
|
||||||
|
*/
|
||||||
|
#define CC1352_SHORTADD_SRC_MATCH_NUM 10
|
||||||
|
|
||||||
|
/**
|
||||||
|
* structure for source matching short addresses
|
||||||
|
*/
|
||||||
|
typedef struct __attribute__((aligned(4))) short_src_match_data
|
||||||
|
{
|
||||||
|
uint32_t srcMatchEn[((CC1352_SHORTADD_SRC_MATCH_NUM + 31) / 32)];
|
||||||
|
uint32_t srcPendEn[((CC1352_SHORTADD_SRC_MATCH_NUM + 31) / 32)];
|
||||||
|
rfc_shortAddrEntry_t extAddrEnt[CC1352_SHORTADD_SRC_MATCH_NUM];
|
||||||
|
} short_src_match_data_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* size of length field in receive struct
|
||||||
|
*
|
||||||
|
* defined in Table 23-10 of the cc26xx TRM
|
||||||
|
*/
|
||||||
|
#define DATA_ENTRY_LENSZ_BYTE 1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* address type for @ref rfCoreModifySourceMatchEntry()
|
||||||
|
*/
|
||||||
|
typedef enum cc1352_address
|
||||||
|
{
|
||||||
|
SHORT_ADDRESS = 1,
|
||||||
|
EXT_ADDRESS = 0,
|
||||||
|
} cc1352_address_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This enum represents the state of a radio.
|
||||||
|
* Initially, a radio is in the Disabled state.
|
||||||
|
*
|
||||||
|
* The following are valid radio state transitions for the cc1352:
|
||||||
|
*
|
||||||
|
* (Radio ON)
|
||||||
|
* +----------+ Enable() +-------+ Receive() +---------+ Transmit() +----------+
|
||||||
|
* | |----------->| |------------->| |--------------->| |
|
||||||
|
* | Disabled | | Sleep | | Receive | | Transmit |
|
||||||
|
* | |<-----------| |<-------------| |<---------------| |
|
||||||
|
* +----------+ Disable() | | Sleep() | | AckFrame RX or +----------+
|
||||||
|
* | | (Radio OFF) +---------+ sTxCmdChainDone == true
|
||||||
|
* | |
|
||||||
|
* | | EnergyScan() +--------+
|
||||||
|
* | |------------->| |
|
||||||
|
* | | | EdScan |
|
||||||
|
* | |<-------------| |
|
||||||
|
* | | signal ED | |
|
||||||
|
* +-------+ scan done +--------+
|
||||||
|
*
|
||||||
|
* These states slightly differ from the states in \ref include/platform/radio.h.
|
||||||
|
* The additional states the phy can be in are due to the asynchronous nature
|
||||||
|
* of the CM0 radio core.
|
||||||
|
*
|
||||||
|
* | state | description |
|
||||||
|
* |------------------|----------------------------------------------------|
|
||||||
|
* | Disabled | The rfcore powerdomain is off and the RFCPE is off |
|
||||||
|
* | Sleep | The RFCORE PD is on, and the RFCPE is in IEEE mode |
|
||||||
|
* | Receive | The RFCPE is running a CMD_IEEE_RX |
|
||||||
|
* | Transmit | The RFCPE is running a transmit command string |
|
||||||
|
* | TransmitComplete | The transmit command string has completed |
|
||||||
|
* | EdScan | The RFCPE is running a CMD_IEEE_ED_SCAN |
|
||||||
|
*
|
||||||
|
* \note The RAT start and Radio Setup commands may be moved to the Receive()
|
||||||
|
* and EnergyScan() transitions in the future.
|
||||||
|
*/
|
||||||
|
typedef enum cc1352_PhyState
|
||||||
|
{
|
||||||
|
cc1352_stateDisabled = 0,
|
||||||
|
cc1352_stateSleep,
|
||||||
|
cc1352_stateReceive,
|
||||||
|
cc1352_stateEdScan,
|
||||||
|
cc1352_stateTransmit,
|
||||||
|
} cc1352_PhyState_t;
|
||||||
|
|
||||||
|
#endif /* CC1352_RADIO_H_ */
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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 the standard startup files for the specified toolchain
|
||||||
|
* startup code is in 'third_party/ti'
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#include <startup_files/startup_gcc.c>
|
||||||
|
#elif defined(__TI_ARM__)
|
||||||
|
#include <startup_files/startup_ccs.c>
|
||||||
|
#else
|
||||||
|
#error "Unknown compiler"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
/*
|
||||||
|
* 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 "aes_alt.h"
|
||||||
|
#include "mbedtls/aes.h"
|
||||||
|
|
||||||
|
#ifdef MBEDTLS_AES_ALT
|
||||||
|
|
||||||
|
#include <driverlib/crypto.h>
|
||||||
|
#include <driverlib/prcm.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <utils/code_utils.h>
|
||||||
|
|
||||||
|
#define CC1352_AES_KEY_UNUSED (-1)
|
||||||
|
#define CC1352_AES_CTX_MAGIC (0x7E)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* bitmap of which key stores are currently used
|
||||||
|
*/
|
||||||
|
static uint8_t sUsedKeys = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* number of active contexts, used for power on/off of the crypto core
|
||||||
|
*/
|
||||||
|
static unsigned int sRefNum = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in aes_alt.h
|
||||||
|
*/
|
||||||
|
void mbedtls_aes_init(mbedtls_aes_context *ctx)
|
||||||
|
{
|
||||||
|
if (sRefNum++ == 0)
|
||||||
|
{
|
||||||
|
/* enable the crypto core */
|
||||||
|
/* The TRNG should already be running before we ever ask the AES core
|
||||||
|
* to do anything, if there is any scenario that the TRNG powers off
|
||||||
|
* the peripheral power domain use this code to repower it
|
||||||
|
|
||||||
|
PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
|
||||||
|
while (PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH) != PRCM_DOMAIN_POWER_ON);
|
||||||
|
*/
|
||||||
|
PRCMPeripheralRunEnable(PRCM_PERIPH_CRYPTO);
|
||||||
|
PRCMPeripheralSleepEnable(PRCM_PERIPH_CRYPTO);
|
||||||
|
PRCMPeripheralDeepSleepEnable(PRCM_PERIPH_CRYPTO);
|
||||||
|
PRCMLoadSet();
|
||||||
|
|
||||||
|
while (!PRCMLoadGet())
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx->magic = CC1352_AES_CTX_MAGIC;
|
||||||
|
ctx->key_idx = CC1352_AES_KEY_UNUSED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in aes_alt.h
|
||||||
|
*/
|
||||||
|
void mbedtls_aes_free(mbedtls_aes_context *ctx)
|
||||||
|
{
|
||||||
|
otEXPECT(ctx->magic == CC1352_AES_CTX_MAGIC);
|
||||||
|
|
||||||
|
if (ctx->key_idx != CC1352_AES_KEY_UNUSED)
|
||||||
|
{
|
||||||
|
sUsedKeys &= ~(1 << ctx->key_idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (--sRefNum == 0)
|
||||||
|
{
|
||||||
|
/* disable the crypto core */
|
||||||
|
/* The TRNG core needs the peripheral power domain powered on to
|
||||||
|
* function. if there is a situation where the power domain must be
|
||||||
|
* powered off, use this code to do so.
|
||||||
|
|
||||||
|
PRCMPowerDomainOff(PRCM_DOMAIN_PERIPH);
|
||||||
|
while (PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH) != PRCM_DOMAIN_POWER_OFF);
|
||||||
|
*/
|
||||||
|
PRCMPeripheralRunDisable(PRCM_PERIPH_CRYPTO);
|
||||||
|
PRCMPeripheralSleepDisable(PRCM_PERIPH_CRYPTO);
|
||||||
|
PRCMPeripheralDeepSleepDisable(PRCM_PERIPH_CRYPTO);
|
||||||
|
PRCMLoadSet();
|
||||||
|
|
||||||
|
while (!PRCMLoadGet())
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset((void *)ctx, 0x00, sizeof(ctx));
|
||||||
|
|
||||||
|
exit:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in aes_alt.h
|
||||||
|
*/
|
||||||
|
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
|
||||||
|
{
|
||||||
|
unsigned char key_idx;
|
||||||
|
int retval = 0;
|
||||||
|
|
||||||
|
otEXPECT_ACTION(ctx->magic == CC1352_AES_CTX_MAGIC, retval = -1);
|
||||||
|
|
||||||
|
if (ctx->key_idx != CC1352_AES_KEY_UNUSED)
|
||||||
|
{
|
||||||
|
sUsedKeys &= ~(1 << ctx->key_idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* our hardware only supports 128 bit keys */
|
||||||
|
otEXPECT_ACTION(keybits == 128u, retval = MBEDTLS_ERR_AES_INVALID_KEY_LENGTH);
|
||||||
|
|
||||||
|
for (key_idx = 0; ((sUsedKeys >> key_idx) & 0x01) != 0 && key_idx < 8; key_idx++)
|
||||||
|
;
|
||||||
|
|
||||||
|
/* we have no more room for this key */
|
||||||
|
otEXPECT_ACTION(key_idx < 8, retval = -2);
|
||||||
|
|
||||||
|
otEXPECT_ACTION(CRYPTOAesLoadKey((uint32_t *)key, key_idx) == AES_SUCCESS,
|
||||||
|
retval = MBEDTLS_ERR_AES_INVALID_KEY_LENGTH);
|
||||||
|
|
||||||
|
sUsedKeys |= (1 << key_idx);
|
||||||
|
ctx->key_idx = key_idx;
|
||||||
|
exit:
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in aes_alt.h
|
||||||
|
*/
|
||||||
|
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
|
||||||
|
{
|
||||||
|
unsigned char key_idx;
|
||||||
|
int retval = 0;
|
||||||
|
|
||||||
|
otEXPECT_ACTION(ctx->magic == CC1352_AES_CTX_MAGIC, retval = -1);
|
||||||
|
|
||||||
|
if (ctx->key_idx != CC1352_AES_KEY_UNUSED)
|
||||||
|
{
|
||||||
|
sUsedKeys &= ~(1 << ctx->key_idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* our hardware only supports 128 bit keys */
|
||||||
|
otEXPECT_ACTION(keybits == 128u, retval = MBEDTLS_ERR_AES_INVALID_KEY_LENGTH);
|
||||||
|
|
||||||
|
for (key_idx = 0; ((sUsedKeys >> key_idx) & 0x01) != 0 && key_idx < 8; key_idx++)
|
||||||
|
;
|
||||||
|
|
||||||
|
/* we have no more room for this key */
|
||||||
|
otEXPECT_ACTION(key_idx < 8, retval = -2);
|
||||||
|
|
||||||
|
otEXPECT_ACTION(CRYPTOAesLoadKey((uint32_t *)key, key_idx) == AES_SUCCESS,
|
||||||
|
retval = MBEDTLS_ERR_AES_INVALID_KEY_LENGTH);
|
||||||
|
|
||||||
|
sUsedKeys |= (1 << key_idx);
|
||||||
|
ctx->key_idx = key_idx;
|
||||||
|
exit:
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in aes_alt.h
|
||||||
|
*/
|
||||||
|
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
|
||||||
|
{
|
||||||
|
int retval = -1;
|
||||||
|
|
||||||
|
retval = CRYPTOAesEcb((uint32_t *)input, (uint32_t *)output, ctx->key_idx, mode == MBEDTLS_AES_ENCRYPT, false);
|
||||||
|
otEXPECT(retval == AES_SUCCESS);
|
||||||
|
|
||||||
|
while ((retval = CRYPTOAesEcbStatus()) == AES_DMA_BSY)
|
||||||
|
;
|
||||||
|
|
||||||
|
CRYPTOAesEcbFinish();
|
||||||
|
|
||||||
|
exit:
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* MBEDTLS_AES_ALT */
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MBEDTLS_AES_ALT_H
|
||||||
|
#define MBEDTLS_AES_ALT_H
|
||||||
|
|
||||||
|
#ifndef MBEDTLS_CONFIG_FILE
|
||||||
|
#include "cc1352-mbedtls-config.h"
|
||||||
|
#else
|
||||||
|
#include MBEDTLS_CONFIG_FILE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MBEDTLS_AES_ALT
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t magic;
|
||||||
|
signed char key_idx;
|
||||||
|
} mbedtls_aes_context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize AES context
|
||||||
|
*
|
||||||
|
* @param [in,out] ctx AES context to be initialized
|
||||||
|
*/
|
||||||
|
void mbedtls_aes_init(mbedtls_aes_context *ctx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear AES context
|
||||||
|
*
|
||||||
|
* @param [in,out] ctx AES context to be cleared
|
||||||
|
*/
|
||||||
|
void mbedtls_aes_free(mbedtls_aes_context *ctx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AES key schedule (encryption)
|
||||||
|
*
|
||||||
|
* @param [in,out] ctx AES context to be used
|
||||||
|
* @param [in] key Encryption key
|
||||||
|
* @param [in] keybits Must be 128
|
||||||
|
*
|
||||||
|
* @retval 0 If successful
|
||||||
|
* @retval MBEDTLS_ERR_AES_INVALID_KEY_LENGTH If keybits was not 128
|
||||||
|
*/
|
||||||
|
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||||
|
unsigned int keybits);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AES key schedule (decryption)
|
||||||
|
*
|
||||||
|
* @param [in,out] ctx AES context to be used
|
||||||
|
* @param [in] key Decryption key
|
||||||
|
* @param [in] keybits Must be 128
|
||||||
|
*
|
||||||
|
* @retval 0 If successful
|
||||||
|
* @retval MBEDTLS_ERR_AES_INVALID_KEY_LENGTH If keybits was not 128
|
||||||
|
*/
|
||||||
|
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||||
|
unsigned int keybits);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief AES-ECB block encryption/decryption
|
||||||
|
*
|
||||||
|
* \param ctx AES context
|
||||||
|
* \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
|
||||||
|
* \param input 16-byte input block
|
||||||
|
* \param output 16-byte output block
|
||||||
|
*
|
||||||
|
* @return The return value of @ref CRYPTOAesEcb.
|
||||||
|
* @retval 0 If successful
|
||||||
|
* @retval AES_KEYSTORE_READ_ERROR If the indicated keystore ram could not be read
|
||||||
|
*/
|
||||||
|
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned char input[16],
|
||||||
|
unsigned char output[16]);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MBEDTLS_AES_ALT */
|
||||||
|
|
||||||
|
#endif /* MBEDTLS_AES_ALT_H */
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CC1352_MBEDTLS_CONFIG_H
|
||||||
|
#define CC1352_MBEDTLS_CONFIG_H
|
||||||
|
|
||||||
|
#define MBEDTLS_AES_ALT
|
||||||
|
|
||||||
|
#endif // CC1352_MBEDTLS_CONFIG_H
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Helper functions for running c++ without the standard library
|
||||||
|
*/
|
||||||
|
|
||||||
|
__extension__ typedef int __guard __attribute__((mode(__DI__)));
|
||||||
|
|
||||||
|
int __cxa_guard_acquire(__guard *g)
|
||||||
|
{
|
||||||
|
return !*(char *)(g);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __cxa_guard_release(__guard *g)
|
||||||
|
{
|
||||||
|
*(char *)g = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __cxa_guard_abort(__guard *g)
|
||||||
|
{
|
||||||
|
(void)g;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __cxa_pure_virtual(void)
|
||||||
|
{
|
||||||
|
while (1)
|
||||||
|
;
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* 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 <openthread/config.h>
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <openthread/config.h>
|
||||||
|
#include <openthread/platform/alarm-milli.h>
|
||||||
|
#include <openthread/platform/radio.h>
|
||||||
|
|
||||||
|
#include "platform-cc1352.h"
|
||||||
|
|
||||||
|
#if OPENTHREAD_ENABLE_DIAG
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Diagnostics mode variables.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static bool sDiagMode = false;
|
||||||
|
|
||||||
|
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||||
|
{
|
||||||
|
(void)aInstance;
|
||||||
|
|
||||||
|
// Add more platform specific diagnostics features here.
|
||||||
|
if (argc > 1)
|
||||||
|
{
|
||||||
|
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void otPlatDiagModeSet(bool aMode)
|
||||||
|
{
|
||||||
|
sDiagMode = aMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool otPlatDiagModeGet()
|
||||||
|
{
|
||||||
|
return sDiagMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||||
|
{
|
||||||
|
(void)aChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||||
|
{
|
||||||
|
(void)aTxPower;
|
||||||
|
}
|
||||||
|
|
||||||
|
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||||
|
{
|
||||||
|
(void)aInstance;
|
||||||
|
(void)aFrame;
|
||||||
|
(void)aError;
|
||||||
|
}
|
||||||
|
|
||||||
|
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
(void)aInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // OPENTHREAD_ENABLE_DIAG
|
||||||
@@ -0,0 +1,313 @@
|
|||||||
|
/*
|
||||||
|
* 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 <string.h>
|
||||||
|
|
||||||
|
#include <driverlib/aon_batmon.h>
|
||||||
|
#include <driverlib/flash.h>
|
||||||
|
#include <driverlib/interrupt.h>
|
||||||
|
#include <driverlib/vims.h>
|
||||||
|
|
||||||
|
#include <openthread-core-config.h>
|
||||||
|
#include <openthread/config.h>
|
||||||
|
#include <openthread/platform/alarm-milli.h>
|
||||||
|
|
||||||
|
#include <utils/code_utils.h>
|
||||||
|
|
||||||
|
#include "platform-cc1352.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The settings configuration base address *MUST* be defined in the core config
|
||||||
|
* file. The base address *MUST* be aligned on an 8K page boundary or the flash
|
||||||
|
* program calls will fail.
|
||||||
|
*/
|
||||||
|
#ifndef SETTINGS_CONFIG_BASE_ADDRESS
|
||||||
|
#error "SETTINGS_CONFIG_BASE_ADDRESS not defined in the OpenThread Core Config"
|
||||||
|
#endif /* SETTINGS_CONFIG_BASE_ADDRESS */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The settings configuration page size *MUST* be defined in the core config
|
||||||
|
* file. The page size *MUST* be 8K or the flash program calls will fail.
|
||||||
|
*/
|
||||||
|
#if (SETTINGS_CONFIG_PAGE_SIZE != 0x2000)
|
||||||
|
#error "SETTINGS_CONFIG_PAGE_SIZE must be defined in OpenThread Core Config"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The settings configuration page number _SHOULD_ be defined in the core
|
||||||
|
* config file.
|
||||||
|
*/
|
||||||
|
#ifndef SETTINGS_CONFIG_PAGE_NUM
|
||||||
|
#warn "SETTINGS_CONFIG_PAGE_NUM not defined in the OpenThread Core Config"
|
||||||
|
#endif /* SETTINGS_CONFIG_PAGE_NUM */
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MIN_VDD_FLASH = 0x18, /* 1.50 volts (0.50=128/256 -> 128=0x80) */
|
||||||
|
MAX_WRITE_INCREMENT = 8, /* maximum number of bytes to write at a time to
|
||||||
|
* avoid interrupt latency while in ROM
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the Battery Monitor measurements and calculations are enabled.
|
||||||
|
*
|
||||||
|
* @return If the Battery Monitor is enabled.
|
||||||
|
* @retval true The Battery Monitor is on.
|
||||||
|
* @retval false The Battery Monitor is off.
|
||||||
|
*/
|
||||||
|
static bool isBatMonOn(void)
|
||||||
|
{
|
||||||
|
uint32_t batMonCtl = HWREG(AON_BATMON_BASE + AON_BATMON_O_CTL);
|
||||||
|
return ((batMonCtl & AON_BATMON_CTL_CALC_EN_M) == AON_BATMON_CTL_CALC_EN &&
|
||||||
|
(batMonCtl & AON_BATMON_CTL_MEAS_EN_M) == AON_BATMON_CTL_MEAS_EN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the supply voltage is high enough to support flash programming.
|
||||||
|
*
|
||||||
|
* @return If the Voltage is too low to support flash programming.
|
||||||
|
* @retval false The supply voltage is too low.
|
||||||
|
* @retval true The supply voltage is sufficient.
|
||||||
|
*/
|
||||||
|
static bool checkVoltage(void)
|
||||||
|
{
|
||||||
|
bool batMonWasOff = !isBatMonOn();
|
||||||
|
bool ret = false;
|
||||||
|
|
||||||
|
if (batMonWasOff)
|
||||||
|
{
|
||||||
|
AONBatMonEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AONBatMonBatteryVoltageGet() >= MIN_VDD_FLASH)
|
||||||
|
{
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (batMonWasOff)
|
||||||
|
{
|
||||||
|
AONBatMonDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable Flash data caching and instruction pre-fetching.
|
||||||
|
*
|
||||||
|
* It is necessary to disable the caching and VIMS to ensure the cache has
|
||||||
|
* valid data while the program is executing.
|
||||||
|
*
|
||||||
|
* @return The VIMS state before being disabled.
|
||||||
|
*/
|
||||||
|
static uint32_t disableFlashCache(void)
|
||||||
|
{
|
||||||
|
uint32_t mode = VIMSModeGet(VIMS_BASE);
|
||||||
|
|
||||||
|
VIMSLineBufDisable(VIMS_BASE);
|
||||||
|
|
||||||
|
if (mode != VIMS_MODE_DISABLED)
|
||||||
|
{
|
||||||
|
VIMSModeSet(VIMS_BASE, VIMS_MODE_DISABLED);
|
||||||
|
|
||||||
|
while (VIMSModeGet(VIMS_BASE) != VIMS_MODE_DISABLED)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore the Flash data caching and instruction pre-fetching.
|
||||||
|
*
|
||||||
|
* @param [in] mode The VIMS mode returned by @ref disableFlashCache.
|
||||||
|
*/
|
||||||
|
static void restoreFlashCache(uint32_t mode)
|
||||||
|
{
|
||||||
|
if (mode != VIMS_MODE_DISABLED)
|
||||||
|
{
|
||||||
|
VIMSModeSet(VIMS_BASE, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
VIMSLineBufEnable(VIMS_BASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translate the errors from the Flash programming FSM to OpenThread error
|
||||||
|
* codes.
|
||||||
|
*
|
||||||
|
* @param [in] error Return from the Flash programming function.
|
||||||
|
*
|
||||||
|
* @return The corresponding OpenThread @ref otError value.
|
||||||
|
*/
|
||||||
|
static otError fsmErrorToOtError(uint32_t error)
|
||||||
|
{
|
||||||
|
otError ret = OT_ERROR_GENERIC;
|
||||||
|
|
||||||
|
switch (error)
|
||||||
|
{
|
||||||
|
case FAPI_STATUS_SUCCESS:
|
||||||
|
ret = OT_ERROR_NONE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH:
|
||||||
|
ret = OT_ERROR_INVALID_ARGS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FAPI_STATUS_FSM_ERROR:
|
||||||
|
ret = OT_ERROR_FAILED;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platforms/utils/flash.h
|
||||||
|
*/
|
||||||
|
otError utilsFlashInit(void)
|
||||||
|
{
|
||||||
|
return OT_ERROR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platforms/utils/flash.h
|
||||||
|
*/
|
||||||
|
uint32_t utilsFlashGetSize(void)
|
||||||
|
{
|
||||||
|
return FlashSizeGet();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platforms/utils/flash.h
|
||||||
|
*/
|
||||||
|
otError utilsFlashErasePage(uint32_t aAddress)
|
||||||
|
{
|
||||||
|
uint32_t mode;
|
||||||
|
uint32_t fsmRet;
|
||||||
|
otError ret;
|
||||||
|
|
||||||
|
otEXPECT_ACTION(checkVoltage(), ret = OT_ERROR_FAILED);
|
||||||
|
|
||||||
|
mode = disableFlashCache();
|
||||||
|
|
||||||
|
fsmRet = FlashSectorErase(aAddress);
|
||||||
|
|
||||||
|
restoreFlashCache(mode);
|
||||||
|
|
||||||
|
ret = fsmErrorToOtError(fsmRet);
|
||||||
|
|
||||||
|
exit:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platforms/utils/flash.h
|
||||||
|
*/
|
||||||
|
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||||
|
{
|
||||||
|
uint32_t start = otPlatAlarmMilliGetNow();
|
||||||
|
otError ret = OT_ERROR_BUSY;
|
||||||
|
|
||||||
|
while ((otPlatAlarmMilliGetNow() - start) < aTimeout)
|
||||||
|
{
|
||||||
|
if (FlashCheckFsmForReady() == FAPI_STATUS_FSM_READY)
|
||||||
|
{
|
||||||
|
ret = OT_ERROR_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platforms/utils/flash.h
|
||||||
|
*/
|
||||||
|
uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||||
|
{
|
||||||
|
uint32_t mode;
|
||||||
|
uint32_t written = 0;
|
||||||
|
|
||||||
|
otEXPECT(checkVoltage());
|
||||||
|
|
||||||
|
mode = disableFlashCache();
|
||||||
|
|
||||||
|
while (written < aSize)
|
||||||
|
{
|
||||||
|
uint32_t toWrite = aSize - written;
|
||||||
|
uint8_t *data = aData + written;
|
||||||
|
uint32_t address = aAddress + written;
|
||||||
|
uint32_t fsmRet;
|
||||||
|
bool interruptsWereDisabled;
|
||||||
|
|
||||||
|
if (toWrite > MAX_WRITE_INCREMENT)
|
||||||
|
{
|
||||||
|
toWrite = MAX_WRITE_INCREMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The CPU may not execute code from flash while a program is
|
||||||
|
* happening. We disable interrupts to ensure one does not preempt the
|
||||||
|
* ROM fsm.
|
||||||
|
*/
|
||||||
|
interruptsWereDisabled = IntMasterDisable();
|
||||||
|
|
||||||
|
fsmRet = FlashProgram(data, address, toWrite);
|
||||||
|
|
||||||
|
if (!interruptsWereDisabled)
|
||||||
|
{
|
||||||
|
IntMasterEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fsmRet != FAPI_STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
written += toWrite;
|
||||||
|
}
|
||||||
|
|
||||||
|
restoreFlashCache(mode);
|
||||||
|
|
||||||
|
exit:
|
||||||
|
return written;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platforms/utils/flash.h
|
||||||
|
*/
|
||||||
|
uint32_t utilsFlashRead(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||||
|
{
|
||||||
|
memcpy(aData, (void *)aAddress, (size_t)aSize);
|
||||||
|
|
||||||
|
return aSize;
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* 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 logging.c
|
||||||
|
* Platform abstraction for the logging
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include <openthread-core-config.h>
|
||||||
|
#include <openthread/config.h>
|
||||||
|
#include <openthread/platform/logging.h>
|
||||||
|
#include <openthread/platform/toolchain.h>
|
||||||
|
|
||||||
|
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) || \
|
||||||
|
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||||
|
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||||
|
{
|
||||||
|
(void)aLogLevel;
|
||||||
|
(void)aLogRegion;
|
||||||
|
(void)aFormat;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* 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 <openthread/config.h>
|
||||||
|
|
||||||
|
#include <driverlib/sys_ctrl.h>
|
||||||
|
#include <openthread/platform/misc.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: if the system is flashed with Flash Programmer 2 or Uniflash, this
|
||||||
|
* reset will not work the first time. Both programs use the cJTAG module,
|
||||||
|
* which sets the halt in boot flag. The device must be manually reset the
|
||||||
|
* first time after being programmed through the JTAG interface.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/misc.h
|
||||||
|
*/
|
||||||
|
void otPlatReset(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
(void)aInstance;
|
||||||
|
SysCtrlSystemReset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/misc.h
|
||||||
|
*/
|
||||||
|
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
(void)aInstance;
|
||||||
|
otPlatResetReason ret;
|
||||||
|
|
||||||
|
switch (SysCtrlResetSourceGet())
|
||||||
|
{
|
||||||
|
case RSTSRC_PWR_ON:
|
||||||
|
ret = OT_PLAT_RESET_REASON_POWER_ON;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSTSRC_PIN_RESET:
|
||||||
|
ret = OT_PLAT_RESET_REASON_EXTERNAL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSTSRC_VDDS_LOSS:
|
||||||
|
case RSTSRC_VDDR_LOSS:
|
||||||
|
case RSTSRC_CLK_LOSS:
|
||||||
|
ret = OT_PLAT_RESET_REASON_CRASH;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSTSRC_WARMRESET:
|
||||||
|
case RSTSRC_SYSRESET:
|
||||||
|
case RSTSRC_WAKEUP_FROM_SHUTDOWN:
|
||||||
|
ret = OT_PLAT_RESET_REASON_SOFTWARE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ret = OT_PLAT_RESET_REASON_UNKNOWN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void otPlatWakeHost(void)
|
||||||
|
{
|
||||||
|
// TODO: implement an operation to wake the host from sleep state.
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OPENTHREAD_CORE_CC1352_CONFIG_H_
|
||||||
|
#define OPENTHREAD_CORE_CC1352_CONFIG_H_
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def OPENTHREAD_CONFIG_PLATFORM_INFO
|
||||||
|
*
|
||||||
|
* The platform-specific string to insert into the OpenThread version string.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define OPENTHREAD_CONFIG_PLATFORM_INFO "CC1352"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def SETTINGS_CONFIG_BASE_ADDRESS
|
||||||
|
*
|
||||||
|
* The base address of the pages to be used for non-volatile-settings storage.
|
||||||
|
*/
|
||||||
|
#define SETTINGS_CONFIG_BASE_ADDRESS (0x52000)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def SETTINGS_CONFIG_PAGE_SIZE
|
||||||
|
*
|
||||||
|
* The size in bytes of a page for the cc26x2 platform.
|
||||||
|
*
|
||||||
|
* @note *MUST BE* 8K.
|
||||||
|
*/
|
||||||
|
#define SETTINGS_CONFIG_PAGE_SIZE (0x2000)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def SETTINGS_CONFIG_PAGE_NUM
|
||||||
|
*
|
||||||
|
* The number of flash pages to use for non-volatile settings storage.
|
||||||
|
*/
|
||||||
|
#define SETTINGS_CONFIG_PAGE_NUM (2)
|
||||||
|
|
||||||
|
#endif /* OPENTHREAD_CORE_CC1352_CONFIG_H_ */
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, The OpenThread Authors.
|
* Copyright (c) 2018, The OpenThread Authors.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -26,57 +26,64 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @file
|
|
||||||
* @brief
|
|
||||||
* This file defines the platform-specific initializers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PLATFORM_H_
|
#ifndef PLATFORM_H_
|
||||||
#define PLATFORM_H_
|
#define PLATFORM_H_
|
||||||
|
|
||||||
#include <openthread/types.h>
|
#include <openthread-core-config.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <openthread/config.h>
|
||||||
|
#include <openthread/instance.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
// Global OpenThread instance structure
|
||||||
* This function performs all platform-specific initialization.
|
extern otInstance *sInstance;
|
||||||
*
|
|
||||||
*/
|
|
||||||
void PlatformInit(int argc, char *argv[]);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function performs all platform-specific deinitialization.
|
* Initialize the debug uart
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
void PlatformDeinit(void);
|
void cc1352DebugUartInit(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns true is a pseudo-reset was requested.
|
* This method initializes the alarm service used by OpenThread.
|
||||||
* In such a case, the main loop should shut down and re-initialize
|
|
||||||
* the OpenThread instance.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool PlatformPseudoResetWasRequested(void);
|
void cc1352AlarmInit(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function performs all platform-specific processing.
|
* This method performs alarm driver processing.
|
||||||
*
|
|
||||||
* @param[in] aInstance The OpenThread instance structure.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void PlatformProcessDrivers(otInstance *aInstance);
|
void cc1352AlarmProcess(otInstance *aInstance);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is called whenever platform drivers needs processing.
|
* This method initializes the radio service used by OpenThread.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
extern void PlatformEventSignalPending(void);
|
void cc1352RadioInit(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method performs radio driver processing.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void cc1352RadioProcess(otInstance *aInstance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method initializes the random number service used by OpenThread.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void cc1352RandomInit(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method performs radio driver processing.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void cc1352UartProcess(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // end of extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // PLATFORM_H_
|
#endif // PLATFORM_H_
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* 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 <openthread/config.h>
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include <utils/code_utils.h>
|
||||||
|
#include <openthread/platform/random.h>
|
||||||
|
|
||||||
|
#include <driverlib/prcm.h>
|
||||||
|
#include <driverlib/trng.h>
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CC1352_TRNG_MIN_SAMPLES_PER_CYCLE = (1 << 6),
|
||||||
|
CC1352_TRNG_MAX_SAMPLES_PER_CYCLE = (1 << 24),
|
||||||
|
CC1352_TRNG_CLOCKS_PER_SAMPLE = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \note if more than 32 bits of entropy are needed, the TRNG core produces
|
||||||
|
* 64 bits of random data, we just ignore the upper 32 bytes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform-cc1352.h
|
||||||
|
*/
|
||||||
|
void cc1352RandomInit(void)
|
||||||
|
{
|
||||||
|
PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
|
||||||
|
|
||||||
|
while (PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH) != PRCM_DOMAIN_POWER_ON)
|
||||||
|
;
|
||||||
|
|
||||||
|
PRCMPeripheralRunEnable(PRCM_PERIPH_TRNG);
|
||||||
|
PRCMPeripheralSleepEnable(PRCM_DOMAIN_PERIPH);
|
||||||
|
PRCMPeripheralDeepSleepEnable(PRCM_DOMAIN_PERIPH);
|
||||||
|
PRCMLoadSet();
|
||||||
|
TRNGConfigure(CC1352_TRNG_MIN_SAMPLES_PER_CYCLE, CC1352_TRNG_MAX_SAMPLES_PER_CYCLE, CC1352_TRNG_CLOCKS_PER_SAMPLE);
|
||||||
|
TRNGEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/random.h
|
||||||
|
*/
|
||||||
|
uint32_t otPlatRandomGet(void)
|
||||||
|
{
|
||||||
|
while (!(TRNGStatusGet() & TRNG_NUMBER_READY))
|
||||||
|
;
|
||||||
|
|
||||||
|
return TRNGNumberGet(TRNG_LOW_WORD);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fill an arbitrary area with random data.
|
||||||
|
*
|
||||||
|
* @param [out] aOutput Area to place the random data.
|
||||||
|
* @param [in] aLen Size of the area to place random data.
|
||||||
|
* @param [out] oLen How much of the output was written to.
|
||||||
|
*
|
||||||
|
* @return Indication of error.
|
||||||
|
* @retval 0 No error occurred.
|
||||||
|
*/
|
||||||
|
static int TRNGPoll(unsigned char *aOutput, size_t aLen)
|
||||||
|
{
|
||||||
|
size_t length = 0;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
uint32_t u32[2];
|
||||||
|
uint8_t u8[8];
|
||||||
|
} buffer;
|
||||||
|
|
||||||
|
while (length < aLen)
|
||||||
|
{
|
||||||
|
if (length % 8 == 0)
|
||||||
|
{
|
||||||
|
/* we've run to the end of the buffer */
|
||||||
|
while (!(TRNGStatusGet() & TRNG_NUMBER_READY))
|
||||||
|
;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* don't use TRNGNumberGet here because it will tell the TRNG to
|
||||||
|
* refill the entropy pool, instead we do it ourself.
|
||||||
|
*/
|
||||||
|
buffer.u32[0] = HWREG(TRNG_BASE + TRNG_O_OUT0);
|
||||||
|
buffer.u32[1] = HWREG(TRNG_BASE + TRNG_O_OUT1);
|
||||||
|
HWREG(TRNG_BASE + TRNG_O_IRQFLAGCLR) = 0x1;
|
||||||
|
}
|
||||||
|
|
||||||
|
aOutput[length] = buffer.u8[length % 8];
|
||||||
|
|
||||||
|
length++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/random.h
|
||||||
|
*/
|
||||||
|
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||||
|
{
|
||||||
|
otError error = OT_ERROR_NONE;
|
||||||
|
size_t length = aOutputLength;
|
||||||
|
|
||||||
|
otEXPECT_ACTION(aOutput, error = OT_ERROR_INVALID_ARGS);
|
||||||
|
|
||||||
|
otEXPECT_ACTION(TRNGPoll((unsigned char *)aOutput, length) == 0, error = OT_ERROR_FAILED);
|
||||||
|
|
||||||
|
exit:
|
||||||
|
return error;
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @brief
|
||||||
|
* This file includes the platform-specific initializers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <openthread/config.h>
|
||||||
|
|
||||||
|
#include "platform-cc1352.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "inc/hw_ccfg.h"
|
||||||
|
#include "inc/hw_ccfg_simple_struct.h"
|
||||||
|
#include "inc/hw_types.h"
|
||||||
|
|
||||||
|
extern const ccfg_t __ccfg;
|
||||||
|
|
||||||
|
const char *dummy_ccfg_ref = ((const char *)(&(__ccfg)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform-cc1352.h
|
||||||
|
*/
|
||||||
|
void otSysInit(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
|
while (dummy_ccfg_ref == NULL)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This provides a code reference to the customer configuration area of
|
||||||
|
* the flash, otherwise the data is skipped by the linker and not put
|
||||||
|
* into the final flash image.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
#if OPENTHREAD_CONFIG_ENABLE_DEBUG_UART
|
||||||
|
cc1352DebugUartInit();
|
||||||
|
#endif
|
||||||
|
cc1352AlarmInit();
|
||||||
|
cc1352RandomInit();
|
||||||
|
cc1352RadioInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool otSysPseudoResetWasRequested(void)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform-cc1352.h
|
||||||
|
*/
|
||||||
|
void otSysProcessDrivers(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
// should sleep and wait for interrupts here
|
||||||
|
|
||||||
|
cc1352UartProcess();
|
||||||
|
cc1352RadioProcess(aInstance);
|
||||||
|
cc1352AlarmProcess(aInstance);
|
||||||
|
}
|
||||||
@@ -0,0 +1,333 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* This file implements the OpenThread platform abstraction for UART communication.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <openthread-core-config.h>
|
||||||
|
#include <openthread/config.h>
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <openthread/platform/debug_uart.h>
|
||||||
|
#include <openthread/platform/logging.h>
|
||||||
|
#include <openthread/platform/uart.h>
|
||||||
|
|
||||||
|
#include "utils/code_utils.h"
|
||||||
|
|
||||||
|
#include <utils/code_utils.h>
|
||||||
|
|
||||||
|
#include <driverlib/ioc.h>
|
||||||
|
#include <driverlib/prcm.h>
|
||||||
|
#include <driverlib/sys_ctrl.h>
|
||||||
|
#include <driverlib/uart.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @note This will configure the uart for 115200 baud 8-N-1, no HW flow control
|
||||||
|
* RX pin IOID_2 TX pin IOID_3.
|
||||||
|
*
|
||||||
|
* If the DEBUG UART is enabled, IOID_0 = debug tx, IOID_1 = debug rx
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CC1352_RECV_CIRC_BUFF_SIZE = 256,
|
||||||
|
};
|
||||||
|
|
||||||
|
static uint8_t const *sSendBuffer = NULL;
|
||||||
|
static uint16_t sSendLen = 0;
|
||||||
|
|
||||||
|
static uint8_t sReceiveBuffer[CC1352_RECV_CIRC_BUFF_SIZE];
|
||||||
|
static uint16_t sReceiveHeadIdx = 0;
|
||||||
|
static uint16_t sReceiveTailIdx = 0;
|
||||||
|
|
||||||
|
void UART0_intHandler(void);
|
||||||
|
|
||||||
|
static void uart_power_control(uint32_t who_base, int turnon)
|
||||||
|
{
|
||||||
|
uint32_t value;
|
||||||
|
|
||||||
|
if (turnon)
|
||||||
|
{
|
||||||
|
/* UART0 is in the SERIAL domain
|
||||||
|
* UART1 is in the PERIPH domain.
|
||||||
|
* See: ti/devices/cc13x2_cc26x2/driverlib/pcrm.h, line: 658
|
||||||
|
*/
|
||||||
|
value = (who_base == UART0_BASE) ? PRCM_DOMAIN_SERIAL : PRCM_DOMAIN_PERIPH;
|
||||||
|
PRCMPowerDomainOn(value);
|
||||||
|
|
||||||
|
while (PRCMPowerDomainStatus(value) != PRCM_DOMAIN_POWER_ON)
|
||||||
|
;
|
||||||
|
|
||||||
|
value = (who_base == UART0_BASE) ? PRCM_PERIPH_UART0 : PRCM_PERIPH_UART1;
|
||||||
|
PRCMPeripheralRunEnable(value);
|
||||||
|
PRCMPeripheralSleepEnable(value);
|
||||||
|
PRCMPeripheralDeepSleepEnable(value);
|
||||||
|
PRCMLoadSet();
|
||||||
|
|
||||||
|
while (!PRCMLoadGet())
|
||||||
|
;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (who_base == UART0_BASE)
|
||||||
|
{
|
||||||
|
PRCMPeripheralRunDisable(PRCM_PERIPH_UART0);
|
||||||
|
PRCMPeripheralSleepDisable(PRCM_PERIPH_UART0);
|
||||||
|
PRCMPeripheralDeepSleepDisable(PRCM_PERIPH_UART0);
|
||||||
|
PRCMLoadSet();
|
||||||
|
PRCMPowerDomainOff(PRCM_DOMAIN_SERIAL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* we never turn the debug uart off */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/uart.h
|
||||||
|
*/
|
||||||
|
otError otPlatUartEnable(void)
|
||||||
|
{
|
||||||
|
uart_power_control(UART0_BASE, true);
|
||||||
|
|
||||||
|
IOCPinTypeUart(UART0_BASE, IOID_12, IOID_13, IOID_UNUSED, IOID_UNUSED);
|
||||||
|
UARTConfigSetExpClk(UART0_BASE, SysCtrlClockGet(), 115200,
|
||||||
|
UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);
|
||||||
|
|
||||||
|
/* Note: UART1 could use IRQs
|
||||||
|
* However, for reasons of debug simplicity
|
||||||
|
* we do not use IRQs for the debug uart
|
||||||
|
*/
|
||||||
|
UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
|
||||||
|
UARTIntRegister(UART0_BASE, UART0_intHandler);
|
||||||
|
UARTEnable(UART0_BASE);
|
||||||
|
|
||||||
|
return OT_ERROR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/uart.h
|
||||||
|
*/
|
||||||
|
otError otPlatUartDisable(void)
|
||||||
|
{
|
||||||
|
UARTDisable(UART0_BASE);
|
||||||
|
UARTIntUnregister(UART0_BASE);
|
||||||
|
UARTIntDisable(UART0_BASE, UART_INT_RX | UART_INT_RT);
|
||||||
|
IOCPortConfigureSet(IOID_2, IOC_PORT_GPIO, IOC_STD_INPUT);
|
||||||
|
IOCPortConfigureSet(IOID_3, IOC_PORT_GPIO, IOC_STD_INPUT);
|
||||||
|
|
||||||
|
uart_power_control(UART0_BASE, false);
|
||||||
|
|
||||||
|
return OT_ERROR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform/uart.h
|
||||||
|
*/
|
||||||
|
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||||
|
{
|
||||||
|
otError error = OT_ERROR_NONE;
|
||||||
|
otEXPECT_ACTION(sSendBuffer == NULL, error = OT_ERROR_BUSY);
|
||||||
|
|
||||||
|
sSendBuffer = aBuf;
|
||||||
|
sSendLen = aBufLength;
|
||||||
|
|
||||||
|
exit:
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief process the receive side of the buffers
|
||||||
|
*/
|
||||||
|
static void processReceive(void)
|
||||||
|
{
|
||||||
|
while (sReceiveHeadIdx != sReceiveTailIdx)
|
||||||
|
{
|
||||||
|
uint16_t tailIdx;
|
||||||
|
|
||||||
|
if (sReceiveHeadIdx < sReceiveTailIdx)
|
||||||
|
{
|
||||||
|
tailIdx = sReceiveTailIdx;
|
||||||
|
otPlatUartReceived(&(sReceiveBuffer[sReceiveHeadIdx]), tailIdx - sReceiveHeadIdx);
|
||||||
|
sReceiveHeadIdx = tailIdx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tailIdx = CC1352_RECV_CIRC_BUFF_SIZE;
|
||||||
|
otPlatUartReceived(&(sReceiveBuffer[sReceiveHeadIdx]), tailIdx - sReceiveHeadIdx);
|
||||||
|
sReceiveHeadIdx = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief process the transmit side of the buffers
|
||||||
|
*/
|
||||||
|
static void processTransmit(void)
|
||||||
|
{
|
||||||
|
otEXPECT(sSendBuffer != NULL);
|
||||||
|
|
||||||
|
for (; sSendLen > 0; sSendLen--)
|
||||||
|
{
|
||||||
|
UARTCharPut(UART0_BASE, *sSendBuffer);
|
||||||
|
sSendBuffer++;
|
||||||
|
}
|
||||||
|
|
||||||
|
sSendBuffer = NULL;
|
||||||
|
sSendLen = 0;
|
||||||
|
otPlatUartSendDone();
|
||||||
|
|
||||||
|
exit:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function documented in platform-cc1352.h
|
||||||
|
*/
|
||||||
|
void cc1352UartProcess(void)
|
||||||
|
{
|
||||||
|
processReceive();
|
||||||
|
processTransmit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief the interrupt handler for the uart interrupt vector
|
||||||
|
*/
|
||||||
|
void UART0_intHandler(void)
|
||||||
|
{
|
||||||
|
while (UARTCharsAvail(UART0_BASE))
|
||||||
|
{
|
||||||
|
uint32_t c = UARTCharGet(UART0_BASE);
|
||||||
|
/* XXX process error flags for this character ?? */
|
||||||
|
sReceiveBuffer[sReceiveTailIdx] = (uint8_t)c;
|
||||||
|
sReceiveTailIdx++;
|
||||||
|
|
||||||
|
if (sReceiveTailIdx >= CC1352_RECV_CIRC_BUFF_SIZE)
|
||||||
|
{
|
||||||
|
sReceiveTailIdx = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if OPENTHREAD_CONFIG_ENABLE_DEBUG_UART
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in platform-cc1352.h
|
||||||
|
*/
|
||||||
|
void cc1352DebugUartInit(void)
|
||||||
|
{
|
||||||
|
uart_power_control(UART1_BASE, true);
|
||||||
|
/*
|
||||||
|
* LaunchPad Pin29 = tx, Pin 30 = rxd
|
||||||
|
*
|
||||||
|
* The function IOCPinTypeUart() is hard coded to
|
||||||
|
* only support UART0 - and does not support UART1.
|
||||||
|
*
|
||||||
|
* Thus, these pins are configured using a different way.
|
||||||
|
*/
|
||||||
|
IOCPortConfigureSet(IOID_0, IOC_PORT_MCU_UART1_TX, IOC_STD_INPUT);
|
||||||
|
IOCPortConfigureSet(IOID_1, IOC_PORT_MCU_UART1_RX, IOC_STD_INPUT);
|
||||||
|
|
||||||
|
UARTConfigSetExpClk(UART1_BASE, SysCtrlClockGet(), 115200,
|
||||||
|
UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);
|
||||||
|
UARTEnable(UART1_BASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This holds the last key pressed */
|
||||||
|
static int debug_uart_ungetbuf;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in "src/core/common/debug_uart.h"
|
||||||
|
*/
|
||||||
|
int otPlatDebugUart_getc(void)
|
||||||
|
{
|
||||||
|
int ch = -1;
|
||||||
|
|
||||||
|
if (otPlatDebugUart_kbhit())
|
||||||
|
{
|
||||||
|
/* get & clear 0x100 bit used below as flag */
|
||||||
|
ch = debug_uart_ungetbuf & 0x0ff;
|
||||||
|
debug_uart_ungetbuf = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in "src/core/common/debug_uart.h"
|
||||||
|
*/
|
||||||
|
int otPlatDebugUart_kbhit(void)
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
|
||||||
|
/* if something is in the unget buf... */
|
||||||
|
r = !!debug_uart_ungetbuf;
|
||||||
|
|
||||||
|
if (!r)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Driverlib code returns "-1", or "char" on something
|
||||||
|
* but it comes with flags in upper bits
|
||||||
|
*/
|
||||||
|
r = (int)UARTCharGetNonBlocking(UART1_BASE);
|
||||||
|
|
||||||
|
if (r < 0)
|
||||||
|
{
|
||||||
|
r = 0; /* no key pressed */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* key was pressed, mask flags
|
||||||
|
* and set 0x100 bit, to distinguish
|
||||||
|
* the value "0x00" from "no-key-pressed"
|
||||||
|
*/
|
||||||
|
debug_uart_ungetbuf = ((r & 0x0ff) | 0x0100);
|
||||||
|
|
||||||
|
r = 1; /* key pressed */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documented in "src/core/common/debug_uart.h"
|
||||||
|
*/
|
||||||
|
void otPlatDebugUart_putchar_raw(int b)
|
||||||
|
{
|
||||||
|
UARTCharPut(UART1_BASE, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* OPENTHREAD_CONFIG_ENABLE_DEBUG_UART */
|
||||||
@@ -41,10 +41,10 @@ PLATFORM_SOURCES = \
|
|||||||
diag.c \
|
diag.c \
|
||||||
flash.c \
|
flash.c \
|
||||||
misc.c \
|
misc.c \
|
||||||
platform.c \
|
|
||||||
radio.c \
|
radio.c \
|
||||||
random.c \
|
random.c \
|
||||||
startup-gcc.c \
|
startup-gcc.c \
|
||||||
|
system.c \
|
||||||
logging.c \
|
logging.c \
|
||||||
uart.c \
|
uart.c \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/platform/alarm-milli.h>
|
#include <openthread/platform/alarm-milli.h>
|
||||||
#include <openthread/platform/diag.h>
|
#include <openthread/platform/diag.h>
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
#define RFCORE_XREG_RXENABLE 0x4008862C // RX enabling
|
#define RFCORE_XREG_RXENABLE 0x4008862C // RX enabling
|
||||||
#define RFCORE_XREG_FREQCTRL 0x4008863C // Controls the RF frequency
|
#define RFCORE_XREG_FREQCTRL 0x4008863C // Controls the RF frequency
|
||||||
#define RFCORE_XREG_TXPOWER 0x40088640 // Controls the output power
|
#define RFCORE_XREG_TXPOWER 0x40088640 // Controls the output power
|
||||||
|
#define RFCORE_XREG_FSMSTAT0 0x40088648 // Radio finite state machine status
|
||||||
#define RFCORE_XREG_FSMSTAT1 0x4008864C // Radio status register
|
#define RFCORE_XREG_FSMSTAT1 0x4008864C // Radio status register
|
||||||
#define RFCORE_XREG_FIFOPCTRL 0x40088650 // FIFOP threshold
|
#define RFCORE_XREG_FIFOPCTRL 0x40088650 // FIFOP threshold
|
||||||
#define RFCORE_XREG_CCACTRL0 0x40088658 // CCA threshold
|
#define RFCORE_XREG_CCACTRL0 0x40088658 // CCA threshold
|
||||||
@@ -105,7 +106,50 @@
|
|||||||
|
|
||||||
#define RFCORE_XREG_RFRND_IRND 0x00000001
|
#define RFCORE_XREG_RFRND_IRND 0x00000001
|
||||||
|
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_MASK 0x0000003F
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_CAL_DONE 0x00000080
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_CAL_RUN 0x00000040
|
||||||
|
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_IDLE 0x00000000
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX_CAL 0x00000002
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_SFD_WAIT0 0x00000003
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_SFD_WAIT1 0x00000004
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_SFD_WAIT2 0x00000005
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_SFD_WAIT3 0x00000006
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX0 0x00000007
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX1 0x00000008
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX2 0x00000009
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX3 0x0000000A
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX4 0x0000000B
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX5 0x0000000C
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX6 0x0000000D
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX_WAIT 0x0000000E
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX_FRST 0x00000010
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RX_OVER 0x00000011
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX_CAL 0x00000020
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX0 0x00000022
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX1 0x00000023
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX2 0x00000024
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX3 0x00000025
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX4 0x00000026
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX_FINAL 0x00000027
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_RXTX_TRANS 0x00000028
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK_CAL 0x00000030
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK0 0x00000031
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK1 0x00000032
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK2 0x00000033
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK3 0x00000034
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK4 0x00000035
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK5 0x00000036
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_ACK_DELAY 0x00000037
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX_UNDER 0x00000038
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX_DOWN0 0x0000001A
|
||||||
|
#define RFCORE_XREG_FSMSTAT0_STATE_TX_DOWN1 0x0000003A
|
||||||
|
|
||||||
|
#define RFCORE_XREG_FSMSTAT1_RX_ACTIVE 0x00000001
|
||||||
#define RFCORE_XREG_FSMSTAT1_TX_ACTIVE 0x00000002
|
#define RFCORE_XREG_FSMSTAT1_TX_ACTIVE 0x00000002
|
||||||
|
#define RFCORE_XREG_FSMSTAT1_LOCK_STATUS 0x00000004
|
||||||
|
#define RFCORE_XREG_FSMSTAT1_SAMPLED_CCA 0x00000008
|
||||||
#define RFCORE_XREG_FSMSTAT1_CCA 0x00000010 // Clear channel assessment
|
#define RFCORE_XREG_FSMSTAT1_CCA 0x00000010 // Clear channel assessment
|
||||||
#define RFCORE_XREG_FSMSTAT1_SFD 0x00000020
|
#define RFCORE_XREG_FSMSTAT1_SFD 0x00000020
|
||||||
#define RFCORE_XREG_FSMSTAT1_FIFOP 0x00000040
|
#define RFCORE_XREG_FSMSTAT1_FIFOP 0x00000040
|
||||||
@@ -113,7 +157,13 @@
|
|||||||
|
|
||||||
#define RFCORE_XREG_RSSISTAT_RSSI_VALID 0x00000001 // RSSI value is valid.
|
#define RFCORE_XREG_RSSISTAT_RSSI_VALID 0x00000001 // RSSI value is valid.
|
||||||
|
|
||||||
|
#define RFCORE_SFR_RFERRF_NLOCK 0x00000001 // Failed to achieve PLL lock.
|
||||||
|
#define RFCORE_SFR_RFERRF_RXABO 0x00000002 // RX Aborted.
|
||||||
#define RFCORE_SFR_RFERRF_RXOVERF 0x00000004 // RX FIFO overflowed.
|
#define RFCORE_SFR_RFERRF_RXOVERF 0x00000004 // RX FIFO overflowed.
|
||||||
|
#define RFCORE_SFR_RFERRF_RXUNDERF 0x00000008 // RX FIFO underflowed.
|
||||||
|
#define RFCORE_SFR_RFERRF_TXOVERF 0x00000010 // TX FIFO overflowed.
|
||||||
|
#define RFCORE_SFR_RFERRF_TXUNDERF 0x00000020 // TX FIFO underflowed.
|
||||||
|
#define RFCORE_SFR_RFERRF_STROBEERR 0x00000040 // Command Strobe Error.
|
||||||
|
|
||||||
#define RFCORE_SFR_RFST_INSTR_RXON 0xE3 // Instruction set RX on
|
#define RFCORE_SFR_RFST_INSTR_RXON 0xE3 // Instruction set RX on
|
||||||
#define RFCORE_SFR_RFST_INSTR_TXON 0xE9 // Instruction set TX on
|
#define RFCORE_SFR_RFST_INSTR_TXON 0xE9 // Instruction set TX on
|
||||||
@@ -172,6 +222,11 @@
|
|||||||
#define IOC_OVERRIDE_OE 0x00000008 // PAD Config Override Output Enable
|
#define IOC_OVERRIDE_OE 0x00000008 // PAD Config Override Output Enable
|
||||||
#define IOC_OVERRIDE_DIS 0x00000000 // PAD Config Override Disabled
|
#define IOC_OVERRIDE_DIS 0x00000000 // PAD Config Override Disabled
|
||||||
|
|
||||||
|
#define IOC_PAD_IN_SEL_PA0 0x00000000 // PA0
|
||||||
|
#define IOC_PAD_IN_SEL_PA1 0x00000001 // PA1
|
||||||
|
#define IOC_PAD_IN_SEL_PA2 0x00000002 // PA2
|
||||||
|
#define IOC_PAD_IN_SEL_PA3 0x00000003 // PA3
|
||||||
|
|
||||||
#define UART0_BASE 0x4000C000
|
#define UART0_BASE 0x4000C000
|
||||||
#define UART1_BASE 0x4000D000
|
#define UART1_BASE 0x4000D000
|
||||||
#define GPIO_A_BASE 0x400D9000 // GPIO
|
#define GPIO_A_BASE 0x400D9000 // GPIO
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/platform/alarm-milli.h>
|
#include <openthread/platform/alarm-milli.h>
|
||||||
#include <openthread/platform/radio.h>
|
#include <openthread/platform/radio.h>
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <openthread-core-config.h>
|
#include <openthread-core-config.h>
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
#include <openthread/platform/logging.h>
|
#include <openthread/platform/logging.h>
|
||||||
|
#include <openthread/platform/toolchain.h>
|
||||||
|
|
||||||
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) || \
|
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) || \
|
||||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openthread/types.h>
|
|
||||||
#include <openthread/platform/misc.h>
|
#include <openthread/platform/misc.h>
|
||||||
|
|
||||||
#include "platform-cc2538.h"
|
#include "platform-cc2538.h"
|
||||||
|
|||||||
@@ -58,6 +58,14 @@
|
|||||||
*/
|
*/
|
||||||
#define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT 1
|
#define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT 1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_CSMA_BACKOFF
|
||||||
|
*
|
||||||
|
* Define to 1 if you want to enable software CSMA-CA backoff logic.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_CSMA_BACKOFF 1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN
|
* @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -38,8 +38,7 @@
|
|||||||
#include <openthread-core-config.h>
|
#include <openthread-core-config.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
|
#include <openthread/instance.h>
|
||||||
#include <openthread/types.h>
|
|
||||||
|
|
||||||
#include "cc2538-reg.h"
|
#include "cc2538-reg.h"
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
#include <openthread/openthread.h>
|
|
||||||
#include <openthread/platform/alarm-milli.h>
|
#include <openthread/platform/alarm-milli.h>
|
||||||
#include <openthread/platform/diag.h>
|
#include <openthread/platform/diag.h>
|
||||||
#include <openthread/platform/radio.h>
|
#include <openthread/platform/radio.h>
|
||||||
@@ -343,6 +342,30 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setupTransmit(otRadioFrame *aFrame)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// wait for current TX operation to complete, if any.
|
||||||
|
while (HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE)
|
||||||
|
;
|
||||||
|
|
||||||
|
// flush txfifo
|
||||||
|
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHTX;
|
||||||
|
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHTX;
|
||||||
|
|
||||||
|
// frame length
|
||||||
|
HWREG(RFCORE_SFR_RFDATA) = aFrame->mLength;
|
||||||
|
|
||||||
|
// frame data
|
||||||
|
for (i = 0; i < aFrame->mLength; i++)
|
||||||
|
{
|
||||||
|
HWREG(RFCORE_SFR_RFDATA) = aFrame->mPsdu[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
setChannel(aFrame->mChannel);
|
||||||
|
}
|
||||||
|
|
||||||
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||||
{
|
{
|
||||||
otError error = OT_ERROR_INVALID_STATE;
|
otError error = OT_ERROR_INVALID_STATE;
|
||||||
@@ -356,27 +379,61 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
|||||||
sState = OT_RADIO_STATE_TRANSMIT;
|
sState = OT_RADIO_STATE_TRANSMIT;
|
||||||
sTransmitError = OT_ERROR_NONE;
|
sTransmitError = OT_ERROR_NONE;
|
||||||
|
|
||||||
while (HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE)
|
setupTransmit(aFrame);
|
||||||
;
|
|
||||||
|
|
||||||
// flush txfifo
|
// Set up a counter to inform us if we get stuck.
|
||||||
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHTX;
|
i = 1000000;
|
||||||
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHTX;
|
|
||||||
|
|
||||||
// frame length
|
// Wait for radio to enter receive state.
|
||||||
HWREG(RFCORE_SFR_RFDATA) = aFrame->mLength;
|
while ((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_RX_ACTIVE) == 0)
|
||||||
|
|
||||||
// frame data
|
|
||||||
for (i = 0; i < aFrame->mLength; i++)
|
|
||||||
{
|
{
|
||||||
HWREG(RFCORE_SFR_RFDATA) = aFrame->mPsdu[i];
|
// Count down the cycles, and emit a message if we get to zero.
|
||||||
|
// Ideally, we should never get there!
|
||||||
|
if (i)
|
||||||
|
{
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
otLogCritPlat(sInstance, "Radio is stuck!!! FSMSTAT0=0x%08x FSMSTAT1=0x%08x RFERRF=0x%08x",
|
||||||
|
HWREG(RFCORE_XREG_FSMSTAT0), HWREG(RFCORE_XREG_FSMSTAT1), HWREG(RFCORE_SFR_RFERRF));
|
||||||
|
i = 1000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure we haven't overflowed the RX buffer in the mean time, as this
|
||||||
|
// will cause a deadlock here otherwise. Similarly, if we see an aborted
|
||||||
|
// RX, handle that here too to prevent deadlock.
|
||||||
|
if (HWREG(RFCORE_SFR_RFERRF) & (RFCORE_SFR_RFERRF_RXOVERF | RFCORE_SFR_RFERRF_RXABO))
|
||||||
|
{
|
||||||
|
if (HWREG(RFCORE_SFR_RFERRF) & RFCORE_SFR_RFERRF_RXOVERF)
|
||||||
|
{
|
||||||
|
otLogCritPlat(sInstance, "RX Buffer Overflow detected", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HWREG(RFCORE_SFR_RFERRF) & RFCORE_SFR_RFERRF_RXABO)
|
||||||
|
{
|
||||||
|
otLogCritPlat(sInstance, "Aborted RX detected", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flush the RX buffer
|
||||||
|
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHRX;
|
||||||
|
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHRX;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for idle state. After flushing the RX buffer, we may wind up here.
|
||||||
|
if (!(HWREG(RFCORE_XREG_FSMSTAT1) & (RFCORE_XREG_FSMSTAT1_TX_ACTIVE | RFCORE_XREG_FSMSTAT1_RX_ACTIVE)))
|
||||||
|
{
|
||||||
|
otLogCritPlat(sInstance, "Idle state detected", NULL);
|
||||||
|
|
||||||
|
// In this case, the state of our driver mis-matches our state. So force
|
||||||
|
// matters by clearing our channel variable and calling setChannel. This
|
||||||
|
// should bring our radio into the RX state, which should allow us to go
|
||||||
|
// into TX.
|
||||||
|
sChannel = 0;
|
||||||
|
setupTransmit(aFrame);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setChannel(aFrame->mChannel);
|
|
||||||
|
|
||||||
while ((HWREG(RFCORE_XREG_FSMSTAT1) & 1) == 0)
|
|
||||||
;
|
|
||||||
|
|
||||||
// wait for valid rssi
|
// wait for valid rssi
|
||||||
while ((HWREG(RFCORE_XREG_RSSISTAT) & RFCORE_XREG_RSSISTAT_RSSI_VALID) == 0)
|
while ((HWREG(RFCORE_XREG_RSSISTAT) & RFCORE_XREG_RSSISTAT_RSSI_VALID) == 0)
|
||||||
;
|
;
|
||||||
@@ -440,7 +497,7 @@ void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void readFrame(void)
|
void readFrame(otInstance *aInstance)
|
||||||
{
|
{
|
||||||
uint8_t length;
|
uint8_t length;
|
||||||
uint8_t crcCorr;
|
uint8_t crcCorr;
|
||||||
@@ -453,11 +510,12 @@ void readFrame(void)
|
|||||||
length = HWREG(RFCORE_SFR_RFDATA);
|
length = HWREG(RFCORE_SFR_RFDATA);
|
||||||
otEXPECT(IEEE802154_MIN_LENGTH <= length && length <= IEEE802154_MAX_LENGTH);
|
otEXPECT(IEEE802154_MIN_LENGTH <= length && length <= IEEE802154_MAX_LENGTH);
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_RAW_LINK_API
|
if (otPlatRadioGetPromiscuous(aInstance))
|
||||||
// Timestamp
|
{
|
||||||
sReceiveFrame.mInfo.mRxInfo.mMsec = otPlatAlarmMilliGetNow();
|
// Timestamp
|
||||||
sReceiveFrame.mInfo.mRxInfo.mUsec = 0; // Don't support microsecond timer for now.
|
sReceiveFrame.mInfo.mRxInfo.mMsec = otPlatAlarmMilliGetNow();
|
||||||
#endif
|
sReceiveFrame.mInfo.mRxInfo.mUsec = 0; // Don't support microsecond timer for now.
|
||||||
|
}
|
||||||
|
|
||||||
// read psdu
|
// read psdu
|
||||||
for (i = 0; i < length - 2; i++)
|
for (i = 0; i < length - 2; i++)
|
||||||
@@ -496,7 +554,7 @@ exit:
|
|||||||
|
|
||||||
void cc2538RadioProcess(otInstance *aInstance)
|
void cc2538RadioProcess(otInstance *aInstance)
|
||||||
{
|
{
|
||||||
readFrame();
|
readFrame(aInstance);
|
||||||
|
|
||||||
if ((sState == OT_RADIO_STATE_RECEIVE && sReceiveFrame.mLength > 0) ||
|
if ((sState == OT_RADIO_STATE_RECEIVE && sReceiveFrame.mLength > 0) ||
|
||||||
(sState == OT_RADIO_STATE_TRANSMIT && sReceiveFrame.mLength > IEEE802154_ACK_LENGTH))
|
(sState == OT_RADIO_STATE_TRANSMIT && sReceiveFrame.mLength > IEEE802154_ACK_LENGTH))
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openthread/types.h>
|
|
||||||
#include <openthread/platform/radio.h>
|
#include <openthread/platform/radio.h>
|
||||||
#include <openthread/platform/random.h>
|
#include <openthread/platform/random.h>
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
otInstance *sInstance;
|
otInstance *sInstance;
|
||||||
|
|
||||||
void PlatformInit(int argc, char *argv[])
|
void otSysInit(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if OPENTHREAD_CONFIG_ENABLE_DEBUG_UART
|
#if OPENTHREAD_CONFIG_ENABLE_DEBUG_UART
|
||||||
cc2538DebugUartInit();
|
cc2538DebugUartInit();
|
||||||
@@ -49,12 +49,12 @@ void PlatformInit(int argc, char *argv[])
|
|||||||
(void)argv;
|
(void)argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlatformPseudoResetWasRequested(void)
|
bool otSysPseudoResetWasRequested(void)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformProcessDrivers(otInstance *aInstance)
|
void otSysProcessDrivers(otInstance *aInstance)
|
||||||
{
|
{
|
||||||
sInstance = aInstance;
|
sInstance = aInstance;
|
||||||
|
|
||||||
@@ -39,7 +39,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <openthread/types.h>
|
|
||||||
#include <openthread/platform/debug_uart.h>
|
#include <openthread/platform/debug_uart.h>
|
||||||
#include <openthread/platform/logging.h>
|
#include <openthread/platform/logging.h>
|
||||||
#include <openthread/platform/uart.h>
|
#include <openthread/platform/uart.h>
|
||||||
@@ -114,8 +113,8 @@ otError otPlatUartEnable(void)
|
|||||||
HWREG(GPIO_A_BASE + GPIO_O_AFSEL) |= GPIO_PIN_1;
|
HWREG(GPIO_A_BASE + GPIO_O_AFSEL) |= GPIO_PIN_1;
|
||||||
|
|
||||||
// rx pin
|
// rx pin
|
||||||
HWREG(IOC_PA0_SEL) = IOC_UARTRXD_UART0;
|
HWREG(IOC_UARTRXD_UART0) = IOC_PAD_IN_SEL_PA0;
|
||||||
HWREG(IOC_PA0_OVER) = IOC_OVERRIDE_DIS;
|
HWREG(IOC_PA0_OVER) = IOC_OVERRIDE_DIS;
|
||||||
HWREG(GPIO_A_BASE + GPIO_O_AFSEL) |= GPIO_PIN_0;
|
HWREG(GPIO_A_BASE + GPIO_O_AFSEL) |= GPIO_PIN_0;
|
||||||
|
|
||||||
HWREG(UART0_BASE + UART_O_CTL) = 0;
|
HWREG(UART0_BASE + UART_O_CTL) = 0;
|
||||||
@@ -288,8 +287,8 @@ void cc2538DebugUartInit(void)
|
|||||||
|
|
||||||
// UART1 - rx pin we don't really use but we setup anyway
|
// UART1 - rx pin we don't really use but we setup anyway
|
||||||
// PA2 => is jumper position RF1.16
|
// PA2 => is jumper position RF1.16
|
||||||
HWREG(IOC_PA2_SEL) = IOC_UARTRXD_UART1;
|
HWREG(IOC_UARTRXD_UART1) = IOC_PAD_IN_SEL_PA2;
|
||||||
HWREG(IOC_PA2_OVER) = IOC_OVERRIDE_DIS;
|
HWREG(IOC_PA2_OVER) = IOC_OVERRIDE_DIS;
|
||||||
HWREG(GPIO_A_BASE + GPIO_O_AFSEL) |= GPIO_PIN_2;
|
HWREG(GPIO_A_BASE + GPIO_O_AFSEL) |= GPIO_PIN_2;
|
||||||
|
|
||||||
HWREG(UART1_BASE + UART_O_CC) = 0;
|
HWREG(UART1_BASE + UART_O_CC) = 0;
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ PLATFORM_SOURCES = \
|
|||||||
flash.c \
|
flash.c \
|
||||||
misc.c \
|
misc.c \
|
||||||
logging.c \
|
logging.c \
|
||||||
platform.c \
|
|
||||||
radio.c \
|
radio.c \
|
||||||
random.c \
|
random.c \
|
||||||
|
system.c \
|
||||||
uart.c \
|
uart.c \
|
||||||
crypto/sha256_alt.c \
|
crypto/sha256_alt.c \
|
||||||
crypto/aes_alt.c \
|
crypto/aes_alt.c \
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#include <driverlib/aon_rtc.h>
|
#include <driverlib/aon_rtc.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <openthread/types.h>
|
|
||||||
|
|
||||||
#include <openthread/platform/alarm-milli.h>
|
#include <openthread/platform/alarm-milli.h>
|
||||||
#include <openthread/platform/diag.h>
|
#include <openthread/platform/diag.h>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -26,14 +26,17 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <openthread/platform/diag.h>
|
#include <openthread/platform/diag.h>
|
||||||
|
|
||||||
#if OPENTHREAD_ENABLE_DIAG
|
#if OPENTHREAD_ENABLE_DIAG
|
||||||
|
|
||||||
|
#include "platform-cc2650.h"
|
||||||
/**
|
/**
|
||||||
* Diagnostics mode variables.
|
* Diagnostics mode variables.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#include "platform-cc2650.h"
|
#include "platform-cc2650.h"
|
||||||
|
|
||||||
|
#include <openthread/error.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @warning this file only implements stubs for the function calls. There is
|
* @warning this file only implements stubs for the function calls. There is
|
||||||
* not enough space on the cc2650 to support NV as an SoC.
|
* not enough space on the cc2650 to support NV as an SoC.
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <openthread-core-config.h>
|
#include <openthread-core-config.h>
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
#include <openthread/platform/logging.h>
|
#include <openthread/platform/logging.h>
|
||||||
|
#include <openthread/platform/toolchain.h>
|
||||||
|
|
||||||
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) || \
|
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) || \
|
||||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <driverlib/sys_ctrl.h>
|
#include <driverlib/sys_ctrl.h>
|
||||||
#include <openthread/types.h>
|
|
||||||
#include <openthread/platform/misc.h>
|
#include <openthread/platform/misc.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,7 +54,6 @@ otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
|||||||
return OT_PLAT_RESET_REASON_EXTERNAL;
|
return OT_PLAT_RESET_REASON_EXTERNAL;
|
||||||
|
|
||||||
case RSTSRC_VDDS_LOSS:
|
case RSTSRC_VDDS_LOSS:
|
||||||
case RSTSRC_VDD_LOSS:
|
|
||||||
case RSTSRC_VDDR_LOSS:
|
case RSTSRC_VDDR_LOSS:
|
||||||
case RSTSRC_CLK_LOSS:
|
case RSTSRC_CLK_LOSS:
|
||||||
return OT_PLAT_RESET_REASON_CRASH;
|
return OT_PLAT_RESET_REASON_CRASH;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include <openthread-core-config.h>
|
#include <openthread-core-config.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <openthread/config.h>
|
#include <openthread/config.h>
|
||||||
#include "openthread/types.h"
|
#include <openthread/instance.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -26,12 +26,13 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openthread/types.h>
|
#include <openthread/config.h>
|
||||||
|
|
||||||
#include "cc2650_radio.h"
|
#include "cc2650_radio.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <utils/code_utils.h>
|
#include <utils/code_utils.h>
|
||||||
#include <openthread/platform/alarm-milli.h>
|
#include <openthread/platform/alarm-milli.h>
|
||||||
|
#include <openthread/platform/diag.h>
|
||||||
#include <openthread/platform/radio.h>
|
#include <openthread/platform/radio.h>
|
||||||
#include <openthread/platform/random.h> /* to seed the CSMA-CA funciton */
|
#include <openthread/platform/random.h> /* to seed the CSMA-CA funciton */
|
||||||
|
|
||||||
@@ -1823,11 +1824,12 @@ static void cc2650RadioProcessReceiveQueue(otInstance *aInstance)
|
|||||||
|
|
||||||
if (crcCorr->status.bCrcErr == 0 && (len - 2) < OT_RADIO_FRAME_MAX_SIZE)
|
if (crcCorr->status.bCrcErr == 0 && (len - 2) < OT_RADIO_FRAME_MAX_SIZE)
|
||||||
{
|
{
|
||||||
#if OPENTHREAD_ENABLE_RAW_LINK_API
|
if (otPlatRadioGetPromiscuous(aInstance))
|
||||||
// TODO: Propagate CM0 timestamp
|
{
|
||||||
receiveFrame.mInfo.mRxInfo.mMsec = otPlatAlarmMilliGetNow();
|
// TODO: Propagate CM0 timestamp
|
||||||
receiveFrame.mInfo.mRxInfo.mUsec = 0; // Don't support microsecond timer for now.
|
receiveFrame.mInfo.mRxInfo.mMsec = otPlatAlarmMilliGetNow();
|
||||||
#endif
|
receiveFrame.mInfo.mRxInfo.mUsec = 0; // Don't support microsecond timer for now.
|
||||||
|
}
|
||||||
|
|
||||||
receiveFrame.mLength = len;
|
receiveFrame.mLength = len;
|
||||||
receiveFrame.mPsdu = &(payload[1]);
|
receiveFrame.mPsdu = &(payload[1]);
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <utils/code_utils.h>
|
#include <utils/code_utils.h>
|
||||||
#include <openthread/types.h>
|
|
||||||
|
|
||||||
#include <driverlib/prcm.h>
|
#include <driverlib/prcm.h>
|
||||||
#include <driverlib/trng.h>
|
#include <driverlib/trng.h>
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#include "platform-cc2650.h"
|
#include "platform-cc2650.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <openthread/types.h>
|
|
||||||
#include "inc/hw_ccfg_simple_struct.h"
|
#include "inc/hw_ccfg_simple_struct.h"
|
||||||
|
|
||||||
extern const ccfg_t __ccfg;
|
extern const ccfg_t __ccfg;
|
||||||
@@ -38,7 +37,7 @@ void *dummy_ccfg_ref = ((void *)(&(__ccfg)));
|
|||||||
/**
|
/**
|
||||||
* Function documented in platform-cc2650.h
|
* Function documented in platform-cc2650.h
|
||||||
*/
|
*/
|
||||||
void PlatformInit(int argc, char *argv[])
|
void otSysInit(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
(void)argc;
|
(void)argc;
|
||||||
(void)argv;
|
(void)argv;
|
||||||
@@ -57,7 +56,7 @@ void PlatformInit(int argc, char *argv[])
|
|||||||
cc2650RadioInit();
|
cc2650RadioInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlatformPseudoResetWasRequested(void)
|
bool otSysPseudoResetWasRequested(void)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -65,7 +64,7 @@ bool PlatformPseudoResetWasRequested(void)
|
|||||||
/**
|
/**
|
||||||
* Function documented in platform-cc2650.h
|
* Function documented in platform-cc2650.h
|
||||||
*/
|
*/
|
||||||
void PlatformProcessDrivers(otInstance *aInstance)
|
void otSysProcessDrivers(otInstance *aInstance)
|
||||||
{
|
{
|
||||||
// should sleep and wait for interrupts here
|
// should sleep and wait for interrupts here
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user