Compare commits

..

967 Commits

Author SHA1 Message Date
Yakun Xu 677d49b42e [posix-app] platform UDP (#3070)
This commit defines a set of platform APIs to integrate UDP layer of
OpenThread with that of the platform.

With this commit, services and applications developed upon OpenThread can
also be accessed through platform's own network interface, e.g. socket() on
POSIX.
2018-10-14 11:08:35 -07:00
Yakun Xu 8e7dba9e4a [posix-app] fix set radio spinel speed (#3157) 2018-10-14 10:59:23 -07:00
Abtin Keshavarzian 12fab0b98e [posix-app] exit on untimely RCP crash/reset (#3154) 2018-10-14 06:38:21 -07:00
Stuart Longland 7f6ecce258 [spinel] do not use glibc-internal header sys/cdefs.h (#3153)
The `sys/cdefs.h` is an internal header of `glibc` and is not meant to
be used by user code.  The macros needed from it can be trivially
implemented where required, relying on this header being present
excludes OpenThread from being used on systems where `glibc` is not the
used C library (e.g. OpenWRT, where `uclibc` or `musl` is standard).

https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E
2018-10-14 06:36:26 -07:00
Abtin Keshavarzian 9bf8d8169a [mesh-forwarder] add log for retry attempts of indirect tx to sleepy nodes (#3151) 2018-10-12 22:19:06 -07:00
Yakun Xu 3ef4641b36 [posix-app] verify radio capabilities (#3148) 2018-10-12 22:18:20 -07:00
Abtin Keshavarzian 3c88ba28fb [docs] specify seconds as the unit for child timeout value (#3145) 2018-10-12 22:16:36 -07:00
rongli 4c470d7eea [doc] add note for 'parent' command (#3142) 2018-10-12 22:16:16 -07:00
Jonathan Hui 868934b114 [dtls] include server only with commissioner or coaps (#3139) 2018-10-12 22:13:08 -07:00
Yakun Xu 98457ea65e [posix-app] always reset radio when init (#3149) 2018-10-12 13:19:08 -07:00
Jonathan Hui d64b889f52 [travis] add python3 to continuous integration (#3146) 2018-10-12 11:10:18 -07:00
Jonathan Hui 22dd0e0f7d [tests] add python3 support (#3146) 2018-10-12 11:10:18 -07:00
Jing a2865b57a2 [thci] fix channel mask format issue in wpanctl commissioner command (#3150) 2018-10-12 10:53:21 -07:00
Abtin Keshavarzian e6df05b7eb [posix-app] check spinel version of RCP from RaioSpinel::Init() (#3141) 2018-10-12 10:41:17 -07:00
Abtin Keshavarzian 7c8a37263b [posix-app] get RCP (NCP in radio mode) version (#3140)
This commit contains the following changes:

- It adds `otPlatRadioGetVersionString()` as an optional radio
  platform API. If the radio platform does not implement this
  function, OpenThread core provides a default weak implementation
  of this function which return the OpenThread version.

- A public OpenThread API `otGetRadioVersionString()` is added which
  provides the radio version string.

- POSIX App is updated to get the version from its RCP and provide
  `otPlatRadioGetVersionString()`

- A new spinel capability `SPINEL_CAP_POSIX_APP` is added which
  corresponds to `ENABLE_POSIX_APP` configuration.

- A new spinel property `SPINEL_PROP_RCP_VERSION` (only available
  in POSIX_APP) is added which gets the RCP version.
2018-10-12 10:40:57 -07:00
Yakun Xu 2457aa1864 [posix-app] remove dependency on stty (#3138) 2018-10-12 10:39:14 -07:00
Abtin Keshavarzian 467ab24e9b [mesh-forwarder] update indirect message logs (#3135)
This commit makes the following changes in `MeshForwarder`:

- It separates the logging of sent direct and indirect messages,
  ensuring that for indirect messages the status (success/failure)
  is logged after all retry attempts.

- It updates the log message (status of transmission) for a larger
  message requiring fragmentation and multiple frame transmissions
  when `CONFIG_DROP_MESSAGE_ON_FRAGMENT_TX_FAILURE` is not enabled.

- It fixes managing of `IpCounters` to only account for messages
  with type `kTypeIp6`.
2018-10-11 10:07:11 -07:00
Jonathan Hui 739842d168 [travis] update to gcc-arm-none-eabi-7-2018-q2-update (#3134) 2018-10-11 10:06:11 -07:00
Yakun Xu 9ae76c1c67 [core] remove dependency on libstdc++ (#3130) 2018-10-11 10:05:51 -07:00
Zhanglong Xia 8e35bf1db8 [qos] reverse message priority level values (#3132) 2018-10-10 23:06:33 -07:00
Abtin Keshavarzian db3aa113cb [toranj] test-case to check child mode change and parent reset recovery (#3129) 2018-10-10 12:43:13 -07:00
Abtin Keshavarzian c5d611a366 [mle] save child info in settings on mode or timeout change (#3129)
This commit changes `MleRouter::HandleChildUpdateRequest()`:

- If the child entry is modified (i.e., timeout value or
  device mode changes) on an already attached child, the child
  info is updated and saved in the non-volatile settings.
  This ensures that after a parent reset the child can be
  recovered correctly.

- If the "Child Update Request" causes a mode change from rx-on
  to sleepy on a child in `kStateValid` (already attached), the
  source match controller is set to perform source address
  matching on the short address.

- This commit also adds a log to indicate mode change of a
  child.
2018-10-10 12:43:13 -07:00
Jeff Bumgardner e3a82139e3 [nrf52840] fix typo in log parameter (#3136) 2018-10-09 14:50:38 -07:00
Yakun Xu cddfda34cc [posix-app] map log level with syslog (#3133) 2018-10-09 11:15:00 -07:00
Yakun Xu 12171a1270 [meshcop] do not set joiner port in constructor (#3131) 2018-10-09 11:14:00 -07:00
Yakun Xu 2af44beb74 [posix-app] simplify saving settings (#3108) 2018-10-09 11:12:56 -07:00
rongli 5db4b0e295 [core] update first parent request with only R flag during downgrade (#3084)
This commit distinguishes the attach same process during downgrade from
the one caused by losing connectivity as for the former downgrade
scenario, there must be enough active routers to provide connectivity,
and additional benefits is to avoid the impact of possible flooding parent
responses if there are lots of REEDs in large scale thread network.
2018-10-09 10:55:51 -07:00
Jonathan Hui 2dea42cea6 [dhcp6] add dhcp6 server support to NCP (#3128) 2018-10-08 15:42:11 -07:00
Abtin Keshavarzian 461b1aec64 [toranj] adding test-026 for addition/removal of SLAAC IPv6 address (#3111) 2018-10-08 15:41:46 -07:00
Jonathan Hui 6282fcdeb0 [dtls] remove unnecessary member variable mClient (#3127) 2018-10-08 11:04:49 -07:00
Jonathan Hui a5dc13e3be [mbedtls] simplify config file (#3126) 2018-10-08 09:24:43 -07:00
Yakun Xu 92b9746787 [cli] fix initializing coap secure response (#3125) 2018-10-08 09:24:11 -07:00
Jonathan Hui b213628fd6 [travis] update to clang-6.0 (#3122) 2018-10-08 09:23:47 -07:00
Jonathan Hui 2f01fcc8d2 [configure] fix typo (#3121) 2018-10-08 09:23:36 -07:00
Abtin Keshavarzian ad3ea71c59 [posix-app] rename global variable to gNodeId (#3118)
This commit renames `NODE_ID` to `gNodeId` in posix app and  posix
platform example code. It also ensures to use correct encoding (byte
order) to calculate the `gNodeId` (as `uint64_t`) in posix app.
2018-10-08 09:23:13 -07:00
Abtin Keshavarzian 67f3880165 [spinel] add and use new capability NET_THREAD_1_1 (#3124) 2018-10-05 00:59:16 -07:00
Yakun Xu 3ac958441e [meshcop] add commissioner aloc (#3123) 2018-10-05 00:58:19 -07:00
Abtin Keshavarzian 94ac42eec9 [docs] fixing typos in comments/docs (#3120) 2018-10-05 00:56:55 -07:00
Abtin Keshavarzian abe64591c7 [posix-app] update the logging implementation (#3119) 2018-10-05 00:56:26 -07:00
Abtin Keshavarzian b8cfaa3afa [posix-app] remove unused global variables in system.c (#3117) 2018-10-03 23:22:35 -07:00
Abtin Keshavarzian 0c72bc426c [posix-app] remove unused debug_uart source file (#3115) 2018-10-03 23:21:53 -07:00
Abtin Keshavarzian d640d4a7f9 [link-raw] move the LinkRaw implementation to core from api folder (#3114) 2018-10-03 23:21:12 -07:00
rongli 97aafadf2c [thci] fix warning when set downgrade threshold for ncp device (#3113) 2018-10-03 23:20:24 -07:00
Jonathan Hui 1b200be545 [thci] fix IPv6 prefix format (#3116) 2018-10-02 23:12:38 -07:00
rongli 9f55322d36 [thci] fix preferred flag when config border router (#3112) 2018-10-02 02:34:58 -07:00
Jing a97b0c02af [thci] wpanctl thci firmeware validation and modify getGUA according to GRL change (#3106) 2018-10-01 23:52:06 -07:00
Jeff Bumgardner 3b3cca230a [docs] minor Doxygen fixes (#3110) 2018-10-01 23:13:41 -07:00
Jeff Bumgardner 1c9ddd8c15 [docs] update Windows 10 README (#3107) 2018-09-28 13:51:49 -07:00
Jonathan Hui 1ba69deb30 [coaps] add functional tests for psk and x509 (#3096) 2018-09-27 15:15:08 -07:00
Jonathan Hui 696a9441a9 [coaps] include coaps in make dist (#3096) 2018-09-27 15:15:08 -07:00
Abtin Keshavarzian 473c009879 [toranj] relax wpan state transition checks in test-100-mcu-power-state (#3103) 2018-09-27 13:35:53 -07:00
Yakun Xu eb2737189a [posix] add baudrate configuration for POSIX simulation (#3105) 2018-09-27 09:34:18 -07:00
Yakun Xu 2314a5603e [travis] fix typo of disable tests (#3104) 2018-09-27 09:33:40 -07:00
Jonathan Hui 5a489836cd [naming] rename FFD to FTD (#3102) 2018-09-27 09:33:03 -07:00
Abtin Keshavarzian 5e42a40911 [network-data] add MatchMode enumeration for how RLOC16 are matched (#3098) 2018-09-27 09:16:02 -07:00
Abtin Keshavarzian 00cac8002b [spinel] add spinel_command_to_cstr() and update strings (#3097) 2018-09-27 08:45:17 -07:00
Zhanglong Xia cc24aa8f76 [message] create new messages with priority (#3015) 2018-09-26 20:07:51 -07:00
Jing ea1b83a4e7 [thci] add SSH support for OpenThread wpanctl THCI (#3086) 2018-09-26 19:59:18 -07:00
Christian Stauffer be1641434b [cli] fix NULL pointer udp example cli, when udp called without args (#3101) 2018-09-26 07:23:44 -10:00
Yakun Xu 125991b566 [meshcop] verify border agent address is rloc (#3100) 2018-09-26 07:23:12 -10:00
Christian Stauffer 2ce47a8e9c [coaps] CoAP Secure Client/Server accessible through OT API (#2716) 2018-09-24 11:22:08 -10:00
Abtin Keshavarzian 5fe9038e33 [toranj] enable new mode "posix app and RCP" (#3091)
This commit updates `toranj` framework to allow a different mode of
operation where tests are run using posix-app along with an RCP (NCP
in radio only mode) build. This commit also adds a new job for the
new model in travis CI build matrix.
2018-09-24 09:43:19 -10:00
rongli 55bf9fc2fe [core] remove children when attached after receiving MLE Announce Messages (#3093) 2018-09-24 06:57:31 -10:00
Biswajit 06bff96310 [mle] API to provide MLE Parent Response information (#3027) 2018-09-21 18:28:41 -10:00
Yakun Xu 41d8e4a73b [ip6] revert allowing sending packet with hop limit 0 (#3092) 2018-09-21 12:31:13 -07:00
Abtin Keshavarzian 90178d3027 [toranj] add new test NetworkData timeout and entry removal (#3082) 2018-09-19 11:31:11 -10:00
Abtin Keshavarzian 75522066c1 [network-data] remove all matching entries from RemoveRloc methods (#3082)
This commit makes changes to ensure the `Leader::RemoveRloc` methods
remove all matching entries from a `BorderRouterTlv` or `HasRouteTlv`
It adds new methods to `BorderRouterTlv` and `HasRouteTlv` to get the
first entry or last entry and allow an easier way to iterate over all
the entries.
This commit also adds a new helper method `RlocMatch()` to simplify
the comparison of RLOC16 values (exact match vs router id match).
2018-09-19 11:31:11 -10:00
Abtin Keshavarzian b43d83f43f [network-data] check and validate received network data before registering (#3078)
This commit adds check in `Leader::RegisterNetworkData()`to validate
the received network data and ensure it only contains entries matching
the RLOC16 of the device registering the network data. It updates
`RlocLookup()` method to add a new mode to allow or not allow any
entries that do not match the given RLOC16.
2018-09-19 07:55:21 -10:00
Yakun Xu 8f03f2a714 [travis] fix android check for ndk upgrade (#3090) 2018-09-19 05:55:08 -10:00
Jeff Bumgardner 7f13a960a2 [docs] update OT logos for Test Harness use (#3088) 2018-09-18 20:06:22 -10:00
Jonathan Hui 5fb4423a6c [license] update license headers (#3081) 2018-09-18 06:44:58 -10:00
Yakun Xu 0a86cc99ef [posix] flash file permission to 600 (#3085) 2018-09-18 06:31:40 -10:00
Łukasz Duda 704511c96e [icmp6] pass Echo Request messages to user-defined callback (#3083) 2018-09-18 06:30:56 -10:00
Yakun Xu 136a444565 [ip6] allow hop limit 0 (#3077) 2018-09-18 06:29:50 -10:00
Kamil Sroka 7132effa91 [nrf52840] enable ECDSA in mbed TLS (#3080) 2018-09-17 06:30:37 -10:00
Abtin Keshavarzian b9d1cb3b20 [ncp] add support for SPINEL_PROP_PHY_RSSI property in radio only mode (#3075) 2018-09-15 11:42:55 -10:00
Abtin Keshavarzian f5c55c5e23 [poisx-app] fix delayed TxDone callback (#3074) 2018-09-15 11:42:33 -10:00
Yakun Xu a834a06dbd [posix-app] remove link file from posix-app (#3072) 2018-09-15 11:40:47 -10:00
Yakun Xu ed794337e7 [posix] enhance reset implementation to support code coverage (#3071) 2018-09-14 10:59:07 -10:00
Jonathan Hui a23f778e11 [tests] support python3 (#3068) 2018-09-14 10:58:40 -10:00
Abtin Keshavarzian 6618c5564d [toranj] new test to check partition formation and merging (#3066) 2018-09-14 10:58:26 -10:00
Yakun Xu 9c04586861 [posix-app] check energy scan capability (#3047) 2018-09-14 10:56:58 -10:00
Jonathan Hui 222acd1362 [windows] resolve uninitialized memory warning (#3073) 2018-09-12 22:26:45 -10:00
Yakun Xu 4ef65c1ccf [posix-app] add README for posix-app (#3052) 2018-09-12 20:27:03 -10:00
Jonathan Hui 39cd92c743 [build] conditionally build cli and ncp FTD/MTD/radio libs (#3067) 2018-09-12 20:17:17 -10:00
Shu Chen 5c08fb8e3b [diags] support platform specific diags in radio-only ncp (#3024) 2018-09-12 05:42:19 -10:00
Abtin Keshavarzian b510468c6e [toranj] disable OT logs in test-023 and test-015 (#3065) 2018-09-11 23:27:33 -10:00
Abtin Keshavarzian 6fb1e9f05f [dataset] do not use Channel Mask TLV as MAC's supported channel mask (#3058)
This commit changes the code to treat Channel Mask TLV from
Operational Dataset and the MAC layer supported channel mask as
two different (unrelated) network parameters. In particular:
- With this commit, the Channel Mask TLV value is ignored when
  applying a Dataset from `Dataset:ApplyConfiguration()`.
- However, when we create an Active Operational Dataset as leader in
  `ActiveDataset::GenerateLocal()` method, the MAC layer's supported
  channel mask is still used for the Dataset Channel Mask TLV value.
- This commit also adds a check in `Mle::SendAnnounce()` to ensure
  that MLE Announcements are not sent on channels that are are not
  included in the MAC layer's supported channel mask.
2018-09-11 21:58:07 -10:00
Yakun Xu c4f44ae0ca [udp] remove transport pointer (#3064) 2018-09-11 14:56:59 -10:00
Yakun Xu 8a093a3f83 [meshcop] stop coaps before restart (#3063) 2018-09-11 14:53:16 -10:00
Jiacheng Guo e53c8824ac [cc2538] fix wrong uart rx ioc config (#3062) 2018-09-11 14:52:01 -10:00
rongli 952542ae35 [mle] fix connectivity parse if default sed capacity is not included (#3061) 2018-09-11 14:49:47 -10:00
Abtin Keshavarzian cd6b9e835c [posix-app] clear and free mTxRadioTid from Receive (#3046) 2018-09-11 14:47:07 -10:00
Yakun Xu 311b9283c2 [tests] move test_diag into tests/scripts/thread-cert (#3049) 2018-09-11 01:22:42 -10:00
Abtin Keshavarzian 8c5775cbfc [mle] log Thread Mode change (#3059)
This commit adds a log line (at log level `OT_LOG_LEVEL_NOTE`) to
indicate the mode change and the new mode value.
2018-09-10 19:36:36 -10:00
Yakun Xu d9da4c2652 [udp] verify destination before binding (#3055) 2018-09-10 18:11:06 -10:00
Yakun Xu 26fab7399d [posix-app] get real rssi from NCP (#3051) 2018-09-10 18:03:42 -10:00
Yakun Xu 50d0de5792 [toranj] fix typo of toranj tests (#3050) 2018-09-10 18:00:34 -10:00
Yakun Xu 1cbfc66edf [tests] enable self tests (#3048) 2018-09-10 14:46:05 -10:00
Abtin Keshavarzian b7c0c8ed99 [posix-app] update timer implementation to handle speedup (#3045) 2018-09-10 14:42:20 -10:00
Abtin Keshavarzian 42e44e34f9 [radio] update definition of otRadioCaps and the related constants. (#3044) 2018-09-10 14:41:03 -10:00
Yakun Xu afb4d2e72a [travis] add code coverage flag (#3037) 2018-09-10 14:40:23 -10:00
Zhanglong Xia c573dafe8e [ncp] fix clearing unsecure ports (#3022) 2018-09-10 14:39:06 -10:00
Abtin Keshavarzian 0d0c04ece2 [posix-app] add $(OPENTHREAD_TARGET_DEFINES) to CPPFLAGS_COMMON in Makefiles. (#3041) 2018-09-07 07:21:04 -10:00
Abtin Keshavarzian 144a4e3e06 [mle] add MLE counters (#2982)
This commit adds support for a set of MLE counters (e.g., counters to
track number of times device entered different roles, or counters
tracking number of attach attempts, partition ID or parent changes).
2018-09-06 21:01:31 -10:00
Yakun Xu abfb16eb7f [posix-app] tmf proxy to udp proxy (#3039) 2018-09-06 20:58:21 -10:00
Shu Chen b795c729d3 [posix-app] support platform energy scan in posix-app (#3038) 2018-09-06 20:57:38 -10:00
Abtin Keshavarzian 045aa4f358 [travis] update "posix" and "posix-ncp-spi" targets to use new configure options (#3031) 2018-09-06 20:55:47 -10:00
Shu Chen 9a9da5124f [cli] support energy scan command (#3036) 2018-09-06 07:30:55 -10:00
Zhanglong Xia b83fa59914 [mesh-forwarder] add function to decompress IPv6 Header (#3014) 2018-09-06 07:28:08 -10:00
Abtin Keshavarzian 5d993e9868 [configure] add OpenThread example to output of configure script (#3028) 2018-09-06 07:18:23 -10:00
Abtin Keshavarzian accf58d965 [posix-app] include <util.h> on darwin target for forkpty (#3030) 2018-09-06 07:15:38 -10:00
Abtin Keshavarzian 4aefb910bc [posix-app] include <sys/prctl.h> only on Linux target (#3029) 2018-09-06 07:15:22 -10:00
Łukasz Duda 9119bd5e33 [nrf52840] suppress IAR error inside mbedtls (#3026) 2018-09-05 23:18:14 -10:00
Hubert Miś d05542dbf5 [nrf52840] use otSys prefix in the SoftDevice platform API (#3025) 2018-09-05 23:17:54 -10:00
Kamil Sroka 7917c7b1cc [nrf52840] enable ECDH in mbed TLS (#3023) 2018-09-05 23:17:23 -10:00
Yakun Xu b45cc3cd63 [posix-app] get radio caps from NCP (#3021) 2018-09-05 23:17:00 -10:00
Yakun Xu f227bbe7f2 [posix-app] fix alarm issue (#3035) 2018-09-05 23:16:33 -10:00
Shu Chen e34b0f3437 [posix-app] fix bug in posix-app initialization with real hardware (#3034) 2018-09-05 20:04:00 -10:00
Yakun Xu bdffbe5671 [posix-app] enhance virtual time for posix app (#3016) 2018-09-05 18:08:36 -07:00
Abtin Keshavarzian 2742886134 [posix-app] address integer conversions (#3018) 2018-09-05 00:44:27 -07:00
Abtin Keshavarzian 8c333e6e07 [posix-app] change GetReceiveSensitivity() return value to int8_t (#3017) 2018-09-05 00:43:26 -07:00
Shu Chen 3174c590c3 [utils] implement a common method for command line parsing (#3001) 2018-09-05 00:40:02 -07:00
Jonathan Hui a638442df8 [configure] separate example apps and ftd/mtd/radio in build config (#3010) 2018-09-05 00:35:52 -07:00
Jing 11014739f2 [thci] OpenThread wpanctl THCI bug fix (#3012) 2018-08-31 17:56:33 -07:00
rongli 9f9d76b8bc [ncp] fix no reply issue for ping to RLOC/ALOC (#3011) 2018-08-31 17:55:32 -07:00
Abtin Keshavarzian fdd770b8fc [mle] inline simple getter methods (#3007) 2018-08-31 08:57:54 -07:00
Yakun Xu 5016af4cde [tests] increase child timeout (#3000)
* fix calculate default poll period

* add default child timeout in config.py

* define FAILED_CHILD_TRANSMISSIONS
2018-08-30 11:58:32 -07:00
hjian2017 cb63295975 [coap] improve readability (#3008) 2018-08-30 10:18:13 -07:00
Hubert Miś 4665732e81 [nrf52840] fix millisecond alarm trigger condition (#3009) 2018-08-30 10:17:29 -07:00
Jonathan Hui 1aa0a9b5d8 [diags] fix build error introduced in 2d0baf8 (#3006) 2018-08-29 13:10:15 -07:00
Giedrius b5ce567ffd [api] add return code to otCoapHeaderSetPayloadMarker (#3004) 2018-08-29 09:59:02 -07:00
Hubert Miś c2f32e3df8 [nrf52840] update drivers to SDK 15.1.0 (#3003) 2018-08-29 09:58:29 -07:00
Shu Chen 2d0baf8fc5 [ncp] remove diags module from radio only ncp (#3002)
The diags module runs on host side, radio only ncp will only act as
transceiver and support platform specific diags features.
2018-08-29 09:57:46 -07:00
Jeff Bumgardner b133a194fb [docs] revise THCI README (#3005) 2018-08-28 20:50:20 -07:00
rongli 54bf9ef0e0 [dataset] fix issue in applying pending dataset when delaytimer expires (#2988) 2018-08-28 11:52:02 -07:00
Yakun Xu 2e89aa0ad3 [tests] add missing simulator parameter (#2999) 2018-08-28 09:28:14 -07:00
rongli d103797ba0 [tests] fix unstable Cert_5_3_03 (#2998) 2018-08-28 09:26:45 -07:00
Jonathan Hui bf3c081843 [tests] update pycryptodome version to 3.6.6 (#2997) 2018-08-28 09:24:46 -07:00
Shu Chen 026badad96 [diags] use temporary buffer for diag output (#2992) 2018-08-28 09:24:23 -07:00
Abtin Keshavarzian 2f605e9953 [toranj] test covering multicast traffic over multi-hop (#2983)
This commit adds a test-case under `toranj` covering multicast
traffic exchange over a multi-hop network to the following multicast
IPv6 addresses: link-local/mesh-local all-nodes address, link-local
/mesh-local all-routers address, link-local/mesh-local all-thread-
nodes address, and user-specified multicast address.
2018-08-27 16:00:11 -07:00
Jing 48cbbfd32a [thci] add OpenThread Border Router support (#2947) 2018-08-27 10:51:03 -07:00
Shu Chen 315b7e4f9f [posix] make posix settings path configurable (#2993)
configure settings path on andriod to "/data/thread" as default, which will persist after reboot.
2018-08-27 10:44:30 -07:00
Jonathan Hui d54abf8c63 [travis] fix scan-build (#2990) 2018-08-27 09:41:32 -07:00
Kamil Sroka 693bf015f3 [nrf52840] add support for USB bootloader on PCA10059 (#2994) 2018-08-27 08:57:21 -07:00
Kamil Sroka 1b25bf1238 [nrf52840] add crypto to all platform lib variants (#2995) 2018-08-27 08:53:48 -07:00
rongli 5b7e49f21d [dataset] update active/pending dataset based on existing active dataset (#2991) 2018-08-24 19:14:06 -07:00
Hubert Miś dd3916c404 [nrf52840] fix TimeToTicks function in the alarm port (#2986) 2018-08-24 08:44:30 -07:00
Abtin Keshavarzian 20ccd55c16 [makefile] add missing files to libopenthread-radio source list (#2989) 2018-08-23 11:16:15 -07:00
Jonathan Hui eba708f018 [mbedtls] simplify source file listing in Makefile.am (#2984) 2018-08-23 10:34:10 -07:00
Abtin Keshavarzian d1a0b80a53 [toranj] multicast IPv6 addresses on routers/FED/SED (#2979)
The new test covers the following:
- Verify all nodes (routers/FED/SED) subscribe to:
   * Link-local all nodes, realm-local all nodes,
   * Link-local all Thread nodes, realm-local all Thread nodes,
   * All MPL forwarder realm-local.
- Verify routers also subscribe to:
   * Link-local all routers, realm-local all nodes.
- Verify adding/removing multicast addresses on all devices.
2018-08-23 10:27:51 -07:00
jciupis 36e238453f [nrf52840] add missing radio driver source file to appropriate Makefile (#2987) 2018-08-22 16:11:11 -07:00
Abtin Keshavarzian 024cf82ab0 [toranj] add test-case for address cache table (#2972)
This test verifies the behavior of `AddressResolver` module and
entries in address cache table. It also tests the behavior of nodes
when there are topology changes in the network (e.g., a child switches
parent). In particular, the test covers the address cache update
through snooping.
2018-08-22 13:30:54 -07:00
Abtin Keshavarzian abecb07ba1 [tools] add bash script git-squash-merge (#2962)
This commit adds a new script `git-squash-merg` which can help with
performing squash merge of a branch into another. The commit message
includes the list of squashed commits. This script is helpful for
synchronization of git repositories that work with gerrit.
2018-08-22 13:30:14 -07:00
Abtin Keshavarzian 6ab5c63435 [toranj] update form/join tests to cover new wpanctl capabilities (#2978)
This commit updates the `toranj` tests related to forming/joining
a network to cover newly added capabilities to wpanctl `form`/`join`
commands (allowing all parameters to be given as part of the
command itself).
2018-08-21 09:41:45 -07:00
Abtin Keshavarzian cae716acc3 [toranj] update test-001 to get and set more wpan properties (#2976) 2018-08-21 09:40:03 -07:00
Yakun Xu af2bfc1cc4 [test] save packets as pcap file in thread-cert tests (#2965) 2018-08-20 09:27:04 -07:00
Abtin Keshavarzian e731babedb [mle] simplify device role checks using IsAttached method (#2975) 2018-08-18 18:04:33 -07:00
Abtin Keshavarzian f993ba5f89 [toranj] add test-case for router table (#2970)
This commit adds a test-case under `toranj` to verify router table
entries on a network with 4 routers: {r1, r2, r3} forming a loop
with r4 connecting to r3.
2018-08-17 14:36:05 -07:00
Yakun Xu 0cea4bc738 [cli] return number of bytes in ping reply (#2973) 2018-08-17 11:53:54 -07:00
Yakun Xu e7de6eafa3 [test] enhance android build check (#2974) 2018-08-17 11:49:35 -07:00
Seth Rickard ef31de69c1 [cc13x2_cc26x2] fix runtime issue with RF patching (#2971) 2018-08-17 09:34:13 -07:00
Hubert Miś 8d2184a4e7 [nrf52840] update nRF52840 radio driver to version 1.2.0 (#2968) 2018-08-17 09:03:55 -07:00
Jonathan Hui c116441212 [api] change type from uint8_t * to otMeshLocalPrefix (#2966) 2018-08-17 08:59:37 -07:00
Abtin Keshavarzian 37b5a9655c [toranj] Child Supervision test (#2951)
This commit adds a new test-case under `toranj` for Child Supervision
feature.

This test uses MAC whitelisting to emulate the situation where a child
is removed from parent's child table while the child continues to stay
attached to the parent (since data polls from child are acked at radio
platform layer). Specifically the test verifies that once supervision
check is enabled on the child, the child detects that it is no longer
in the parent's table and tries to re-attach. The test verifies the
behavior of both the parent and the child when supervision is enabled.
It verifies that the parent is periodically sending supervision
messages to the child and that the child is monitoring the messages
from parent. This test also indirectly verify the child timeout
behavior on a parent.
2018-08-15 15:47:50 -07:00
Abtin Keshavarzian 3ff432f152 [spi-hdlc-adapter] update README.md (fix typos) (#2961) 2018-08-15 12:48:31 -07:00
Abtin Keshavarzian ce48bf1819 [toranj] test behavior of "inform previous parent" feature (#2964)
This commit adds a new test-case under `toranj` frame-work to verify
the behavior of devices under the "inform previous parent" feature.

With this feature enabled, when a child attaches to a new parent, it
will send an IP message (with empty payload) to its previous parent.
Upon receiving this message the previous parent would immediately
remove the child from its child table.

The test network topology consists of two routers/parents and a single
sleepy child. The child is first attached a parent and is then forced
to switch its parent. It's then verified that the child is removed
from first parent's child table.
2018-08-15 10:27:52 -07:00
Jonathan Hui 920197398b [api] change type from uint8_t* to otExtendedPanId (#2960) 2018-08-15 10:12:49 -07:00
Abtin Keshavarzian ae5421ecbd [toranj] reduce number of routers/children in test-016-neighbor-table (#2963) 2018-08-15 10:12:00 -07:00
Yakun Xu 0c07c53ce3 [platform] attach timestamp in promiscuous mode (#2954) 2018-08-10 09:26:11 -07:00
Yakun Xu d2e59fd645 [posix-app] fix getting tx power (#2957) 2018-08-10 01:16:00 -07:00
Jonathan Hui c8d06c402e [efr32] fix em_system.h include (#2956) 2018-08-09 18:31:34 -07:00
Yakun Xu 101e243372 [nrf52840] fix default parameters of FEM (#2945) 2018-08-08 18:30:30 -07:00
Jonathan Hui 9d585edc46 [types] move types into specific headers (#2946) 2018-08-08 11:19:41 -07:00
rongli 90ee0a4d66 [ncp] add joiner spinel support (#2877) 2018-08-08 11:18:53 -07:00
Yakun Xu e181f1f98e [posix-app] fix diag issues of radio only mode (#2948) 2018-08-07 19:15:14 -07:00
Jing 492f0c3b10 [harness-automation] update read method for TopologyConfig.txt format change (#2950) 2018-08-07 10:47:01 -05:00
Yakun Xu 8efb3c50e5 [meshcop] implement commissioning UDP proxy (#2926) 2018-08-06 14:50:41 -05:00
Abtin Keshavarzian a9d32b7bef [ncp] add support for Commissioner APIs in spinel and NCP (#2911)
This commit adds support for Commissioner related APIs in spinel and
NCP including starting/stopping Commissioner, setting Provisioning
URL, adding/removing Joiners, and sending Announce Begin, Energy Scan
Query, PAN ID Query, MGMT_GET/MGMT_SET messages.
2018-08-06 14:46:01 -05:00
Jonathan Hui f089fc8e25 [gcc8] resolve compiler errors (#2944)
This commit resolves compiler errors generated by gcc8.

This commit also adds gcc8 build checks to travis.
2018-08-03 14:14:41 -05:00
Jonathan Hui f0bb0982ee [examples] change example platform namespacing (#2927) 2018-08-03 14:13:47 -05:00
Abtin Keshavarzian 1ca81fbb16 [ncp] add support for child supervision in spinel/NcpBase (#2939) 2018-08-02 17:21:11 -05:00
Abtin Keshavarzian c551e30350 [posix] handle signals SIGHUP or SIGTERM and exit (#2930)
This commit adds signal handler in posix example platform for
signals SIGHUP and SIGTERM. Upon receiving either signal the
process is terminated using `exit(0)`.
2018-08-02 17:17:40 -05:00
Abtin Keshavarzian 44e583a554 [toranj] add new method to finalize all nodes at end of each test (#2930)
This commit adds a new method `finalize_all_node()` in `wpan.Node`
class to finalize all previously created instances of `wpan.Node`. It
terminates the associated `wpantund` process and wait.
2018-08-02 17:17:40 -05:00
Abtin Keshavarzian d67c4e2f6b [ncp] include prop set support for THREAD_CHILD_TIMEOUT in MTD build (#2943) 2018-08-02 00:55:35 -05:00
Yakun Xu 601b99b394 [android] use spi instead of uart (#2942) 2018-08-02 00:54:48 -05:00
Jonathan Hui ba4b238a00 [link-quality] explicitly clear link quality for new child/router (#2941)
The child/router entries are generally cleared using `memset()` to avoid
explicitly setting all fields to zero.  As a result, it is necessary to
explicitly clear the link quality state to properly initialize the last
RSSI reading.  The user-specific constructors are also removed.
2018-08-01 10:33:03 -05:00
Jonathan Hui 412f9740b0 [tlv] remove unnecessary user-specified constructor (#2940) 2018-08-01 10:32:46 -05:00
Jonathan Hui bcfa7edff1 [ip6] ensure slaac addresses are added back after reset (#2938)
This commit makes the following changes:

1. A child that is resynchronizing with its parent after reset always
   requests the network data to ensure that it has the latest version.

2. When autoconfiguring SLAAC addresses in response to a network data update
   always attempt to add the netif address buffer in case the netif
   structure was removed (e.g. due to reset).
2018-08-01 10:32:27 -05:00
Jonathan Hui 7be61df6ec [message-info] remove unnecessary memset initialization (#2937) 2018-07-31 14:10:02 -05:00
Jonathan Hui c097cd2d3b [mle] remove unused LeaderDataTlv from HandleChildUpdateRequest (#2936) 2018-07-31 14:09:48 -05:00
Abtin Keshavarzian a9932027fa [toranj] test case for adding IPv6 addresses with same prefix on multiple nodes (#2915)
This commit adds a new test script for `toranj` test frame-work
covering the situation when IPv6 addresses with same prefix are
added/removed on multiple nodes. The test verifies that the on-mesh
prefix list on all nodes stays consistent and updated as the addresses
are added/removed and nodes are reset.
2018-07-31 12:38:40 -05:00
Abtin Keshavarzian 2aa335144c [mle] fix logging at NOTE level (#2933)
This commit fixes the issue when building at `LOG_LEVEL_NOTE`
ensuring methods such as `AttachModeToString` are included.
2018-07-31 11:18:12 -05:00
Abtin Keshavarzian 3acd900bdf [message] update comment/documentation (#2903) 2018-07-31 10:41:26 -05:00
Abtin Keshavarzian 68535657df [toranj] test case to verify child restoration after parent reset (#2935)
This commit adds a new test-case under `toranj`. The test covers
the following situation:

- A single parent node with three sleepy and two rx-on children.
- Parent node is reset.
- It is verified that all children are recovered and are present
  in the parent's child table after reset.
- It is also verified that all children are restored on parent
  through "Child Update" exchange process and none of them get
  detached.
2018-07-30 16:04:58 -05:00
Abtin Keshavarzian 1c7f811b32 [mle] fix issue with saving child info to non-volatile (#2935)
This commit addresses an bug where the child info was not being
saved in non-volatile settings. It fixes the following cases in
the code where a child id was used to search for a child (using
`FindChild()`) instead of the RLOC16 address:

- `StoreChild()` is changed to accept a `const Child &` as input
  parameter avoiding the need to look up the child by ID or RLOC16.
- `SendChildIdResponse()` and `GetChildInfoById()` are updated to
  perform the search for a child using its RLOC16.
2018-07-30 16:04:58 -05:00
Jonathan Hui ffff5f3f6f [travis] remove lib32z1 from arm-gcc-6/7 build checks (#2928) 2018-07-30 10:46:28 -05:00
Jonathan Hui d24b02ea79 [github] update issue templates (#2920) 2018-07-30 10:46:10 -05:00
Jonathan Hui d3b5b8fa60 [flash] move example flash driver from c++ to c (#2919) 2018-07-30 10:45:50 -05:00
Jonathan Hui b6c2a2b06e [kw41z] load bytes into TX Packet Buffer in order (#2882)
The MKW41Z Reference Manual Section 44.6.2.7 states:
- "The 802.15.4 Link Layer software prepares data to be transmitted, by
  loading the octets, in order, into the Packet Buffer."

This commit maintains a separate buffer for building the transmit frame
then copies the buffer just before the transmit frame is submitted to the
radio.
2018-07-30 10:45:24 -05:00
Jonathan Hui f824343f8c [config] add check for OPENTHREAD_CONFIG_DISABLE_CCA_ON_LAST_ATTEMPT (#2925) 2018-07-26 02:17:29 -05:00
Abtin Keshavarzian 7978810afe [config] update comment/docs for MAX_TX_ATTEMPTS_INDIRECT_POLLS (#2924) 2018-07-26 02:17:16 -05:00
Tomas Cerskus 2b8e2362b7 [efr32] do not use CCA/CSMA when it is disabled (#2923) 2018-07-26 02:16:44 -05:00
Jonathan Hui f5aa83cad7 [mac] fix build failure with CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT (#2922) 2018-07-26 02:15:47 -05:00
Kamil Burzynski c7e62553e5 [mle] support for long routes (#2775)
This commit introduces changes necessary to support long routes (i.e. route
cost >= 16).

This is an experimental feature that requires changes to the route
information communicated in MLE messages.  As a result, it is not compatible
with the Thread 1.1 specification.

This feature is disabled by default.
2018-07-26 02:14:49 -05:00
Abtin Keshavarzian bb064cd074 [toranj] add test-case for "Thread:NeighborTable" (#2917) 2018-07-25 04:26:16 -05:00
Abtin Keshavarzian 3796b33e6a [commissioner] add new API to get Provisioning URL (#2884) 2018-07-25 04:20:41 -05:00
Jonathan Hui 14a1f49011 [efr32] update to Gecko SDK v2.3 (#2909) 2018-07-24 03:59:33 -05:00
Yakun Xu f22cddb9ee [core] move border agent into thread_netif (#2893) 2018-07-23 09:14:23 -05:00
Abtin Keshavarzian 9d7a9f1e21 [core-config-check] add CONFIG_MAX_TX_ATTEMPTS_DIRECT to list of replaced options (#2910) 2018-07-23 09:10:32 -05:00
Yakun Xu e220197b6b [meshcop] allow MBEDTLS_ERR_SSL_WANT_WRITE from mbedtls_ssl_write() (#2906)
* increase message buffers to pass meshcop check
2018-07-23 09:08:51 -05:00
rongli dcc3eac579 [network-data] clean stale child's server info when its parent is removed (#2905) 2018-07-23 09:06:38 -05:00
Abtin Keshavarzian 6269da241b [mle] fix retransmission of Data Request messages (#2895)
This commit renames the timer used for Child Update transmissions  to
`mMessageTransmissionTimer` and allow it to be used for retx of MLE
Data Request messages when there is no pending or active MLE Child
Update Request. It also adds logic to ensure that the device gets
detached after some number of MLE Data Request attempts with no
response.
2018-07-23 09:03:49 -05:00
Abtin Keshavarzian ffc2b972ab [toranj] perform a subprocess.poll() on wpantund instance during init of nodes (#2901)
This allows the underlying wpantund process associated with a `Node`
instance to be executed while we are waiting for it to be initialized.
It also protects against any unexpected termination of an instance.
This change would help with speed of initialization of all nodes
mainly when there are many instances running in parallel.
2018-07-20 14:41:24 -05:00
Abtin Keshavarzian 8e28b626a9 [spinel] add a section for MeshCop properties and update documentation (#2885)
This commit updates the documentation of spinel property sections
and also adds a new range 0x080 - 0x08F, 0x1800 - 0x18FF allocated
for MeshCop related properties.
2018-07-20 13:50:09 -05:00
Yakun Xu d50e3713c3 [meshcop] fix handling commissioner keep alive (#2907) 2018-07-20 10:47:35 -05:00
Jeff Bumgardner 7586509525 [docs] update API menu for new APIs (#2902) 2018-07-19 23:53:24 -05:00
Abtin Keshavarzian 3ee31ec562 [commissioner] update comments and method documentations (#2900) 2018-07-19 23:43:08 -05:00
Jonathan Hui 1075e35327 [code-style] remove multiple return statements per free function or method (#2891)
There should be one return statement per free function or method at the end
of the free function or method.
2018-07-19 20:09:07 -05:00
Robert Lubos 9b211b76c6 [nrf52840] prevent linker from dicarding strong nrf5CryptoInit implementation (#2899)
Linker will discard libmbedcrypto_a-cc310_mbedtls.o when searching
mbedTLS library, if it finds weak implementation of
nrf5CryptoInit/Deinit before strong ones. Adding additional
symbols to this file will prevent this behavior and make linker
to search libmbedcrypto_a-cc310_mbedtls.o even after weak
implementations are found.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-19 16:49:30 -05:00
Shu Chen c863a35662 [nrf52840] don't reinitialize cc310 during pseudo reset (#2897)
The device hangs when reinitialize cc310.
2018-07-19 16:47:50 -05:00
Abtin Keshavarzian 758e647d91 [dataset] update dataset SendMgmtGet APIs and add support in spinel/NCP (#2866)
This commit updates the APIs `otDatasetSendMgmtActiveGet` and
`otDatasetSendMgmtPendingGet` to be similar to MgmtSet APIs and use an
`otOperationalDatasetComponents` as input to specify the Dataset
components to be requested. The implementation of APIs in
`DatasetManager` and their use in in CLI is also updated.

It also defines new spinel properties `MGMT_GET_ACTIVE_DATASET` and
`THREAD_MGMT_GET_PENDING_DATASET` (with their set handlers) to add
support for sending `MGMT_GET` meshcop command for Active/Pending
Operational Dataset. It also renames the existing properties used for
sending `MGMT_SET` (include `MGMT_SET` in the property name).

It also adds a new property to allow an optional destination IPv6
address to be specified (for sending `MGMT_GET` command) as part of
spinel dictionary representation of Dataset instance.
2018-07-19 16:33:49 -05:00
Jonathan Hui 7ba8f348dc [mac] separate configs for macMaxCSMABackoffs and macMaxFrameRetries (#2881)
This commit aligns the MAC CSMA backoff and retransmit configuration more
closely with IEEE 802.15.4-2006.
2018-07-19 16:32:45 -05:00
Yakun Xu 0645a3ae65 [travis] fix cert 5-2-05 address query (#2894) 2018-07-16 11:28:21 -05:00
Yakun Xu 564d57ec07 [travis] fix Cert_6_3_02_NetworkDataUpdate of posix-ncp check (#2892) 2018-07-16 11:26:12 -05:00
Kamil Sroka 3cd6fad5aa [travis] update UDP_PROXY flag (#2890) 2018-07-13 14:10:12 -05:00
Yakun Xu f2268fadbc [core] inline instance getters (#2889) 2018-07-13 12:23:41 -05:00
Kamil Sroka d7f8a5b631 [ncp] remove unused variable from ncp_base_mtd.cpp (#2887) 2018-07-13 11:35:47 -05:00
Abtin Keshavarzian d68ac05bae [toranj] update wpan.init_all_nodes to allow wait time per node (#2886)
This commit also moves the disabling of the log within the `try`
region to ensure it is retried in case wpantund instance is not
yet ready.
2018-07-13 11:34:50 -05:00
Shu Chen ae58f6cc06 [build] separate Header IE feature from time sync code (#2876)
Add a configure option to enable/disable Header IE support: OPENTHREAD_CONFIG_HEADER_IE_SUPPORT

So then the Header IE generation and parsing feature could be enabled separately.
2018-07-13 11:33:22 -05:00
Yakun Xu ae4e5171ef [posix-app] fix bugs of posix apps (#2888)
1. avoid possibility of reentrant to Hdlc::Decode
2. do not send unwanted ACK to core stack
2018-07-13 10:50:14 -05:00
rongli 51a1a5f12b [core] update Child Update Request aggregation feature (#2874) 2018-07-12 23:51:00 -05:00
Abtin Keshavarzian 0d0c4ceaea [ncp] increase ChangedPropsSet max supported entries to 64 (#2883)
This commit increases the maximim number of entries that can be
supported by `Ncp::ChangePropsSet` to 64 by using `uint64_t` to
save the flags instead of `uint32_t`.
2018-07-12 21:49:00 -05:00
Abtin Keshavarzian eee83a0d38 [toranj] disable OT/NCP logs (by default) during initialization of nodes (#2880)
This commit changes `wpan.init_all_nodes()` to disable OT/logs on
all nodes as the default behavior.
2018-07-12 10:49:20 -05:00
Abtin Keshavarzian f065438111 [ncp] add UDP_PROXY_STREAM to dispatcher list and update documents (#2879) 2018-07-11 20:16:56 -05:00
Zhanglong Xia b5dd84222f [mac] enable broadcast message retransmission in MAC layer (#2815) 2018-07-11 16:03:19 -05:00
Shu Chen c0454408a8 [nrf52840] reinitialize all peripherals except uart for pseudo reset (#2878)
There are some problems if radio is not reinitialized during pseudo reset:
* It may trigger unexpected otPlatRadioTxDone(), and cause the device to hang;
* The uncleared radio timer queue is invalid, it may block the new added timer which has a larger targer time.

Note: The clock init/deinit is disabled during radio init/deinit.
2018-07-11 14:21:48 -05:00
Stuart Longland 36ea84e06b [cc2538] avoid possible deadlock in otPlatRadioTransmit (#2371)
* [cc2538] Add definitions for FSMSTAT0 and RFERRF bits.

This adds a register definition for `RFCORE_XREG_FSMSTAT0` and defines
the bits in `RFCORE_SFR_RFERRF`.

* [cc2538] Check for error conditions on transmit.

The transmit code first waits for an existing transmission to finish,
then sets things up for the next transmission and waits for the radio to
go into receive mode before proceeding.

If, the radio receive buffer overflows during this time, the radio will
enter a RX overflow state (state 0x11 in `FSMSTAT0`) and will block
there until the RX FIFO is flushed.

In such cases, the CC2538 hard-locks due to the while loop waiting for
the `RX_ACTIVE` bit to be set.  While waiting for `RX_ACTIVE`, we need
to check for these overflow conditions, handle them, then re-try our
transmitter set-up.

* [cc2538] Re-try transmit set-up on IDLE

If we enter the idle state, then rather than just setting the channel,
re-try our transmitter set-up since we should be in the correct state
to do this at this point.
2018-07-11 14:10:52 -05:00
Kamil Sroka 9cb7c4b634 [travis] add link raw to nrf52840 build checks (#2875) 2018-07-10 16:22:53 -05:00
Jonathan Hui a05fcb6e1d [travis] add cc1352 build checks (#2873) 2018-07-10 15:56:23 -05:00
Jonathan Hui af0e3f19fa [tlv] change GetSize() return type to uint16_t to avoid overflow (#2870)
Credit to OSS-Fuzz.
2018-07-10 14:13:16 -05:00
Abtin Keshavarzian 8c8a953d29 [toranj] adding verify_within and updating test-014-ip-address-add. (#2871)
This commit adds a new function `verify_within` in `toranj` wpan
library. This function verifies that certain conditions (given as
function handler) pass within a given wait time interval. The
`verify` function is also changed to raise an exception (instead
of immediate `exit(1)`).

The new function is then used in `test-014` to allow faster checks
after device reset while giving longer wait time for test to pass.
2018-07-10 12:13:11 -05:00
Jonathan Hui b8181ce76d [android] fix removal of tmf_proxy.cpp in Android.mk (#2872) 2018-07-09 22:15:19 -05:00
Seth Rickard 5fc1788d37 [cc1352] add support for Texas Instruments CC1352 (#2863) 2018-07-09 15:28:41 -05:00
Yakun Xu 96a7e2d5a5 [meshcop] move border agent into core (#2771)
This commit moves the border agent service into OpenThread core.

Border agent, commissioner, and joiner shares a single secure CoAP agent,
because they will not be active at the same time.

Other changes include:
- Replaced TMF proxy with UDP proxy, which is more generalized.
- Changed OT_ERROR_NONE string to "OK".
- Defined a special interface id -1 to differentiate packets received by
  host side.
2018-07-09 15:25:23 -05:00
Kamil Sroka 8555513247 [build] fix errors and warnings when building on IAR and Keil (#2868) 2018-07-09 11:17:46 -05:00
Yakun Xu 93bb67024f [posix-app] add Makefile for building with android build system (#2864) 2018-07-09 11:15:43 -05:00
Shu Chen cdc772759e [nrf52840] avoid unexpected transmit done callback after pseudo reset (#2862)
Introduce a nrf5RadioPseudoReset() method, it will put the radio to sleep mode,
and clear the pending events during pseudo reset. So to avoid unexpected transmit
done callback after pseudo reset, which may cause the device to hang.
2018-07-09 11:05:45 -05:00
rongli 19c73f8b66 [core] update tmf rules to allow link local multicast address as dest (#2865) 2018-07-06 23:43:32 -05:00
Yakun Xu d54076ea97 [api] fix reset for radio only mode (#2859) 2018-07-04 22:46:26 -05:00
Yakun Xu 42e590a8fc [posix-app] add missing check for spinel radio (#2855) 2018-07-04 22:45:53 -05:00
Abtin Keshavarzian 52354e73c7 [ncp] add new fields (age, rssi, etc) to PARENT spinel property (#2854)
This commit appends new fields to format of `PROP_THREAD_PARENT`
spinel property. The new fields provide age, avrerage RSSI and
last RSSI, etc. This commit also updates the spinel documentation.
2018-07-04 15:40:40 -05:00
Abtin Keshavarzian 4e6e1bc568 [toranj] test-case for adding IPv6 addresses (#2853)
This commit adds a `toranj` test for adding/removing IPv6 addresses
on routers, FEDs, and SEDs (on network interface).

The test then covers the following:
- Verify "IPv6:AllAddresses" wpantund property.
- Verify that prefixes are present in network data corresponding
  to added addresses (on all nodes).
- Verify that a SED does register the address with its parents
  ("Thread:ChildTable:Addresses" wpantund property).
- Verify that addresses/prefixes are retained by wpantund over
  NPC resets.
- Verify that when an address is removed on network interface
  its corresponding prefix is also removed (on all nodes).
2018-07-04 00:14:55 -05:00
Abtin Keshavarzian da9d0df373 [toranj] add support for add-prefix and remove-prefix (#2852)
This commit updates `wpan.py` module to include newly added wpanctl
commands `add-prefix` and `remove-prefix` and include new `stable`
parameter for `add-route`. It also updates `test-10` to test the
behavior of the new commands.
2018-07-04 00:11:30 -05:00
Abtin Keshavarzian 751c92821a [mle-router] update the route table log message (#2839)
This commit changes the code such that the logs are emitted only if
the route table is updated. It also changes the log format.
2018-07-04 00:10:21 -05:00
Shu Chen 0c537d8c0e [nrf52840] set initialized state to false in nrf_drv_clock_uninit() (#2850)
Fix an issue that application could not reinitialize the clock again after nrf_drv_clock_uninit().
2018-07-04 00:05:48 -05:00
Abtin Keshavarzian 92282bffa7 [ip6] fix forwarding of off-mesh traffic on FED (#2847)
This commit addresses an issue with forwarding of off-mesh traffic
on FED. It also adds a `toranj` test-case to test adding of off-mesh
routes (on routers and FEDs) and traffic flow to off-mesh addresses.
2018-07-02 20:53:54 -05:00
Shu Chen 4aee236c6b [nrf52840] avoid endless "otPlatUartSendDone" log when using usb-cdc (#2849) 2018-07-02 13:08:02 -05:00
Abtin Keshavarzian d79bf6f268 [toranj] limit the logs during init of all nodes (#2848) 2018-07-02 10:48:17 -05:00
Jonathan Hui 6bd04ddcda [mesh-forwarder] retransmit on CCA errors (#2846)
This commit changes the way the mesh forwarder layer handles transmit
attempt failures due to CCA failures.  Prior to this commit, the mesh
forwarder layer would simply drop the packet.  This commit keeps the
packet in the queue so that it can be retransmitted at a later time.  This
applies to both direct and indirect transmissions.
2018-07-02 10:44:50 -05:00
Jonathan Hui 10666f5c1e [mac] ensure frame validation checks occur before reading FCF (#2845)
Credit to OSS-Fuzz.
2018-07-02 10:44:28 -05:00
Jonathan Hui 30222e8538 [radio] rename CcaEnabled to CsmaCaEnabled (#2844) 2018-07-02 10:44:09 -05:00
Abtin Keshavarzian 31698ecaf7 [mac] tracking supported channel mask (#2838)
This commit contains the following changes:
- Adds new logic to `Mac` to track supported channel mask along
  get/set methods.
- Adds public OT APIs `otLinkGetSupportedChannelMask()` and
 `otLinkSetSupportedChannelMask()` to get/set the channel mask.
- Ensures supported channel mask from `Mac` is included in Dataset
  TLVs when a local Dataset is generated.
- Ensures the channel mask at `Mac` gets updated when a new Dataset
  configuration is applied.
- Adds `OT_CHANGED` notification for signaling channel mask changes.
- Updates `NcpBase` and `PHY_CHAN_SUPPORTED` spinel property get/set
  handlers to adopt the new public APIs.
- Updates `NcpBase` to emit async `PHY_CHAN_SUPPORTED` updated on
  OT_CHANGED channel mask notification.
2018-07-02 10:43:45 -05:00
Abtin Keshavarzian fdb3d0ef58 [mesh-forwarder] update LogMessage to use NOTE level for failure/error cases (#2836)
This commit also contains
- Adding `Instance::GetLogLevel()` to get current log level on
  device.
- Adding new `otLogMac()` macro to log at MAC region with a run-time
  given log level.
2018-06-29 13:00:53 -05:00
Abtin Keshavarzian 38e7b30ef7 [ncp] update/add comments and re-order handler lookup (#2841) 2018-06-29 12:34:04 -05:00
Abtin Keshavarzian 60fc0ac05f [logging] change some log messages from INFO level to NOTE level (#2835)
This commit changes some of the log messages in `mle`, `ip6`,
`address_resolver` and `router_table` from INFO level to NOTE level.

It also adds missing `otLogNote<>` implementation for windows.
2018-06-28 16:20:24 -05:00
Kamil Sroka c925b42941 [link-raw] split software retransmit to retransmit and backoff (#2840) 2018-06-28 09:56:28 -07:00
Yakun Xu 8ccf1386de [ncp] adjust defining NCP handlers (#2829) 2018-06-28 11:26:31 -05:00
Abtin Keshavarzian e25570fb93 [settings] do not log setting delete operation with NOT_FOUND error (#2834) 2018-06-28 11:26:08 -05:00
Shu Chen f5d895c812 [posix] fix a bug when updating time info for time synchronization (#2837) 2018-06-27 11:41:44 -05:00
Jonathan Hui c325ab8a39 [ncp] add dhcp6 client support (#2833) 2018-06-26 22:26:36 -05:00
Shu Chen e69019f962 [time-sync] network-wide time synchronization service (#2618)
OpenThread network-wide time synchronization service is an experimental feature, not part of the standard Thread protocol.

Feature Overview:
 * All the nodes in the same Thread partition sync to the same Thread network-wide time;
 * Microsecond level time synchronization precision;
 * Flexible time accuracy and time sync period configuration;
 * APIs for application layer use case, support both CLI and NCP version.

The feature is wrapped by OPENTHREAD_CONFIG_ENABLE_TIME_SYNC, there's no change to current Thread 1.1
implementation if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is not enabled.

If OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is enabled, the node could:
 * Attach to a time sync enabled network, otherwise
 * Attach to a standard Thread 1.1 network, otherwise
 * Form a new time sync enabled network

In addition, if OPENTHREAD_CONFIG_TIME_SYNC_REQUIRED is also enable, the node could only:
 * Attach to a time sync enabled network, otherwise
 * Form a new time sync enabled network

Note:
Currently, the feature is only supported on nRF52840 and posix platforms. And the network time
is only synced among Routers and REEDs, the SEDs will be supported later as an optional feature.
2018-06-26 13:46:32 -05:00
Jeff Bumgardner 292349c4d3 [docs] add missing Doxygen comments for radio (#2832) 2018-06-26 11:21:45 -05:00
Jonathan Hui e22f391af2 [da15000] resolve compiler warnings (#2831) 2018-06-26 11:20:10 -05:00
Tomas Cerskus 6b80574d10 [efr32] fix building errors on boards without FEM (#2830) 2018-06-26 11:19:04 -05:00
Yakun Xu 1b14a36a35 [posix] radio only host side driver (#2690) 2018-06-25 16:32:32 -07:00
Abtin Keshavarzian 17eace65e2 [child-table] fix typo in constant name (#2826) 2018-06-25 12:03:12 -07:00
Abtin Keshavarzian 2d973955a9 [child/router-table] overload ++ operator to advance iterators (#2828) 2018-06-25 07:04:55 -07:00
Abtin Keshavarzian d99a2cea8f [mesh-forwarder] limit mesh header message logging to FTD build (#2827)
This commit moves the methods related to logging mesh header
messages in `mesh_forwarder_ftd.cpp` and limit their scope to FTD
build. This helps reduce the code size of MTD build with logs
enabled.
2018-06-25 07:01:45 -07:00
Abtin Keshavarzian 8cc6848d67 [mac] simplify Mac::SetNetworkName(string) (#2825) 2018-06-25 06:44:04 -07:00
Abtin Keshavarzian 8f15ef3fbb [mle] reset the attach counter and restart backoff on "mode" change (#2824)
This changes addresses the situation where we have a single device
in network configured as sleepy end-device going through attach
backoff intervals and then user changes the device mode to be
non-sleepy and FTD. This change ensures that device become leader
quickly.
2018-06-25 06:43:36 -07:00
Abtin Keshavarzian 9ce38e0161 [notifier] always signal changed state/config for the first time (#2818)
This commit adds new logic in `Notifier` class (and how it is used) to
ensure when state/configuration is changed, each of the OT_CHANGED_*
events (e.g., channel, network name) is signaled for the first time
(even in case new set value is same as before).

This change addresses an issue where if user sets a parameter (using
OpenThread public APIs) before starting Thread operation the event
indicating the change would not be emitted.

This commit also defines `otChangedFlags` and `Notifier::Flags`
types, and updates the logging in `Notifier` to use `String` class.
2018-06-22 15:09:18 -07:00
Kamil Sroka d5797546e1 [link-raw] handle mIsCcaEnabled flag with software retransmit (#2821) 2018-06-22 09:23:50 -07:00
Kamil Sroka aa48f4d7b7 [nrf52840] fix building with link raw enabled (#2820) 2018-06-22 09:23:12 -07:00
Kamil Sroka a7b3ac780a [nrf52840] fix frames handling with disabled CCA (#2819) 2018-06-22 09:22:54 -07:00
Shu Chen 0616997957 [mac] separate aes ccm process from ProcessTransmitSecurity() method (#2810)
Create a new ProcessTransmitAesCcm() method, which is safe to be called in
interrupt context.
2018-06-21 08:45:19 -07:00
Jonathan Hui 4241b87800 [router-table] clear router table when changing partitions (#2809) 2018-06-21 08:44:09 -07:00
Yakun Xu b8333732fa [ncp] make NCP sources pretty (#2811) 2018-06-20 13:15:13 -07:00
Abtin Keshavarzian 9e2d7181ae [mesh-forwarder] add logs for forwarded MeshHeader messages (#2783)
This commit adds a new method `MeshForwarder::LogMeshMessage()` to log
info about messages with `MeshHeader` (messages that are forwarded by
device). The new logs indicate  when a message is received/sent or
possibly dropped. The immediate source and destination for the
received or sent frame is logged. The new logs include info from
`MeshHeader` such as mesh source, mesh destination, number of hops
left. If the message is fragmented, info from fragment header such as
datagram tag and offset is included in the logs. For a non-fragmented
or a  first fragment, `LogMeshMessage()` will also decompress the IPv6
and transport (UDP/TCP) headers and provide info from them such as
IPv6 source/destination addresses, UDP/TCP checksum, source/destination
port numbers.

In addition to the new logs, this commit add the following changes:
- Adds `\t` to log lines which are grouped (make it easier to read).
- Adds `const` qualifiers to some methods in `Lowpan::MeshHeader`.
- Adds new method in `FragmentHeader` to init it from a `Message`.
- Refactors/updates some methods in `Lowpan` class (e.g., adding new
  public method to decompress LOWPAN_NHC UDP header).
2018-06-19 12:22:29 -07:00
Kamil Burzynski 403723dc82 [mle] minor TLV and route table cleanup (#2807) 2018-06-19 09:59:13 -07:00
Yakun Xu b5f22dcb5d [posix] remove duplicated definition in Makefile-posix (#2808) 2018-06-19 08:41:14 -07:00
Łukasz Duda 7c7c179a38 [nrf52840] handle NRF_802154_RX_ERROR_ABORTED error (#2805) 2018-06-18 11:24:11 -07:00
rongli 3e0f0b25f4 [cert] THCI: enhance firmware validation (#2797) 2018-06-18 11:23:41 -07:00
Kamil Sroka eb4fcff15f [link-raw] add switch for link raw to common-switches.mk (#2800) 2018-06-18 11:11:51 -07:00
rongli 63257be510 [cert] THCI: apply GRL's update (#2796) 2018-06-15 10:35:40 -07:00
rongli 14d7a70a7a [commissioner-dataset] initialize mSessionId to a random value (#2793) 2018-06-15 10:34:55 -07:00
Shu Chen ed58a6775b [radio] union the transmit and receive information in radio frame (#2789)
The transmit and receive specific information will not be used at the same time,
so use union structure to save ram usage.
2018-06-15 10:26:37 -07:00
Abtin Keshavarzian 13a40c8bcf [ncp] adding new spinel property to get EID address cache table (#2788)
This commit adds a new spinel property `THREAD_ADDRESS_CACHE_TABLE`
to get the Thread EID IPv6 Address cache table.
2018-06-15 10:25:36 -07:00
Jonathan Hui 380cfb8ae0 [mesh-forwarder] fix bug when stopping discover request (#2795)
This commit fixes a bug when calling `MeshForwarder::Stop()` while the
discover operation is ongoing.  In particular, while the send queue is
flushed, `mDiscoverTimer` is not stopped, resulting in a NULL pointer
dereference in the timer handler.

This commit also moves common cleanup code for the discover operation into
a single method.
2018-06-15 09:32:01 -07:00
Jonathan Hui 496742762d [nlbuild-autotools] ignore autoconf files modified by bootstrap (#2794) 2018-06-15 09:31:42 -07:00
rongli d92b424bc9 [dataset] fix dataset update issues (#2791)
* pending dataset should not be restored from local when ClearNetwork

* update the condition for stop /c/as registration attempts during dataset transition
2018-06-14 09:01:34 -07:00
Yakun Xu a5e5eadfdf [cli] recover default behavior of ctrl-c (#2790) 2018-06-14 08:54:31 -07:00
Shu Chen c87a81d346 [mac-frame] unify mac frame access using Get()/Set() methods (#2787) 2018-06-13 14:34:43 -07:00
Shu Chen 41f1cc24f7 [radio] remove unused mSecurityValid from otRadioFrame structure (#2786) 2018-06-13 12:50:23 -07:00
Abtin Keshavarzian e523b6b424 [toranj] adding test-case for multi-hop traffic exchange (#2782)
This commit adds a new `toranj` test script to test IPv6 traffic
exchange over multiple hops in a network with chain topology:

       r1 ----- r2 ---- r3 ----- r4
       /\       |       |        /\
      /  \      |       |       /  \
    fed1 sed1  sed2    sed3   sed4 fed4

Traffic flow:
- From first router to last router
- From SED child of last router to SED child of first router
- From FED child of first router to FED child of last router

The test covers the following:
- Verifies Address Query process over multi-hop to routers and FEDs
- Verifies Mesh Header frame forwarding over multiple routers.
- Verifies forwarding of large IPv6 messages (1000 bytes) requiring
  lowpan fragmentation.
2018-06-13 12:22:08 -07:00
Abtin Keshavarzian a9bd1e2d35 [toranj] update README.md (alternate way to install wpantund) (#2784) 2018-06-12 23:15:03 -07:00
Tomas Cerskus ef940b0659 [efr32] add BRD4304A (MGM12P) support and board-specific hal-config.h (#2763)
* add BRD4304A (MGM12P Module) board support

* make hal-config.h board-specific

Copied existing hal-config.h for BRD4161A and BRD4166A. For BRD4304A
used hal-config from Silabs Thread 2.6.2.0 ncp-uart-hw project without
WDOG, VUART, VCOM, UARTNCP and BSP_SERIAL_APP_PORT settings.

* enable FEM for the platforms that require it
2018-06-12 11:41:40 -07:00
Abtin Keshavarzian 45125cacc5 [mle] enhance the route table log message (#2780) 2018-06-12 09:24:58 -07:00
Abtin Keshavarzian 674757aa44 [posix] skip calling RadioReceiveDone with OT_ERROR_ABORT (#2779)
This commit changes the posix platform radio implementation by not
invoking the `RadioReceiveDone` callback with error `OT_ERROR_ABORT`.
This is added to help remove extra logs when simulating OpenThread in
posix mode.
2018-06-12 09:23:03 -07:00
Marcin K Szczodrak 8d21f72cf0 [docker] dockerfiles for openthread sim and wpantund (#2760) 2018-06-12 09:18:39 -07:00
Abtin Keshavarzian b4c9f92821 [lowpan] use BigEndian::ReadUint16() (#2774) 2018-06-11 14:13:56 -07:00
Jeff Bumgardner 13667b0499 [docs] updating Doxygen tags for ble module (#2777) 2018-06-11 13:07:14 -07:00
Abtin Keshavarzian 139b2da408 [toranj] add test-case for child table and child recovery (#2776) 2018-06-11 09:19:50 -07:00
Abtin Keshavarzian 70154b1f4d [mesh-forwarder] do not log dropping of received beacon frames (#2773)
This change removes the log message indicating dropping of a
received beacon frame.
2018-06-11 09:12:23 -07:00
Abtin Keshavarzian 4b918f85f0 [string] adding ot::String<size> class (#2764)
This commit adds a new template class `ot::String<size>` which
implements a fixed-length character string. This class is then used as
return value of `ToString()` methods from different classes. This
simplifies the `ToString()` implementation and its use. This commit
also adds a unit test for `String`.
2018-06-11 09:10:52 -07:00
Abtin Keshavarzian 90b160ccfa [ncp-spi] improve callback implementation, change code style format (#2734)
This commit makes the following changes in `NcpSpi` class:

- It adds a new class `SpiFrame` which provides helper methods to
  parse and update the header fields in the header of an SPI  frame.
- It simplifies/enhances the `SpiTransactionComplete()` callback
  implementation by combining the parsing of input/output frame
  headers with the rx/tx frame processing.
- It adds a check for correct pattern bits in a received frame
  flag byte (frames with incorrect pattern bits are ignored).
- Code format is changed to follow the "pretty" style.
- Fixes a rare issue with a possible incorrect accept length on
  the first SPI transaction after NCP reset.
2018-06-11 08:59:25 -07:00
rongli 2f9bd174d0 [network-diagnostic] REED should omit ChildTable TLV request (#2772) 2018-06-11 08:56:22 -07:00
Jonathan Hui 631557e81f [data-poll] only allow data polling when rx-off-when-idle (#2770) 2018-06-08 10:13:52 -07:00
Jonathan Hui e1fa68f650 [mle] implement MLE Data Request retransmissions (#2766)
This commit adds MLE Data Request timeout and retransmissions for
rx-off-when-idle devices.  rx-on-when-idle devices do not require explicit
retransmissions because MLE Advertisements will trigger an rx-on-when-idle
device to send the MLE Data Request again.  However, if an rx-off-when-idle
device fails to receive an MLE Data Response, it will never attempt to
request again.
2018-06-08 10:13:36 -07:00
Jonathan Hui 30f20f3fbc [mesh-forwarder] do not treat CCA failures the same as no-ack (#2765)
Thread 1.1.1 Section 5.9.4 states: "Note that failures to transmit due to
failed clear channel assessments do not count as a failure to receive an
ACK."
2018-06-08 10:13:23 -07:00
Jonathan Hui feafdad1d1 [mbedtls] upgrade to 2.9.0 (#2756) 2018-06-08 09:00:04 -07:00
Hubert Miś 3b155ebe1a [nrf52840] fix cc310 with mbedtls 2.9.0 (#2756)
* Update ECP implementation using CC310

* Use software AES for AES-256 in nRF52840 platform
2018-06-07 11:08:38 -07:00
Jonathan Hui 78a98fa38f [mbedtls] do not treat visual studio build warnings as errors (#2756) 2018-06-07 11:08:37 -07:00
Jonathan Hui 0f26317d0e [mbedtls] remove v2.6.1 (#2756) 2018-06-07 11:08:37 -07:00
Jonathan Hui 9be25a87ed [scan-build] define KEY_EXCHANGE_ECDHE_ECDSA_ENABLED to avoid warnings (#2756) 2018-06-07 11:08:37 -07:00
Jonathan Hui 74642918ad [mbedtls] update cc2650 sha256_alt to new mbedtls API (#2756) 2018-06-07 11:08:37 -07:00
Jonathan Hui 35c2c9ec13 [mbedtls] update nrf52840 sha256_alt to new mbedtls APIs (#2756) 2018-06-07 11:08:37 -07:00
Jonathan Hui 951e305f31 [crypto] update SHA256 to new mbedtls APIs (#2756) 2018-06-07 11:08:37 -07:00
Jonathan Hui 5e94a2d485 [mbedtls] update path from 'repo.patched' to 'repo' (#2756) 2018-06-07 11:08:37 -07:00
Jonathan Hui 5309056689 [mbedtls] normalize visual studio files (#2756) 2018-06-07 11:08:25 -07:00
Jonathan Hui 2b05167668 Add subtree mirror of repository 'git@github.com:ARMmbed/mbedtls.git' tag 'mbedtls-2.9.0'. 2018-06-07 11:08:20 -07:00
Jonathan Hui 6d52ee056a Squashed 'third_party/mbedtls/repo/' content from commit 38b64b0
git-subtree-dir: third_party/mbedtls/repo
git-subtree-split: 38b64b09ecd722c94de0b6076c980e28c624273e
2018-06-07 11:08:20 -07:00
Abtin Keshavarzian 92a70fb0ad [logging] adding a new log level NOTE (#2735)
This commit adds a new log level `NOTE` between `INFO` and `WARN`. The
`INFO` level is intended for informational message about behavior of
the network (e.g., info about received/transmitted messages). `NOTE`
level is intended for normal but significant events that require
special handling (e.g., device getting detached) and are expected to
be less frequent that `INFO` level events and logs.
2018-06-07 11:06:56 -07:00
Kamil Sroka ddf177edf3 [nrf52840] handle mIsCcaEnabled flag (#2768) 2018-06-07 09:17:56 -07:00
rongli cbd0511775 [network-diagnostic] fix Connectivity and Route TLV type issue when get (#2769)
Type value of Connectivity and Route TLV are different under different namespaces.
2018-06-07 09:17:33 -07:00
Jonathan Hui 3eb552a9b7 [mle] properly handle cases where router table is not populated (#2759)
After attaching to a network, a device may need to wait until receiving the
next MLE Advertisement before populating the router table.

This commit makes the following changes:

- When receiving an MLE Advertisement, always process the Route TLV when the
  router table is not yet populated.

- Have RouterTable::GetLeaderAge() return max value when the router table
  is not yet populated.

- When generating a Connectivity TLV, populate the max routing cost when
  no leader information is available.
2018-06-04 15:40:54 -07:00
tfrazel 7ac94f674d [kw41z] radio driver fix to allow channel change (#2757)
The NXP KW41Z radio driver prohibited changing channels while in receive
mode; this prevented the leader properly responding to MLE Announces from
orphaned child devices.
2018-06-04 09:29:42 -07:00
Biswajit bdc73dc193 [diags] make diag output & cmd line buffer params configurable (#2728) 2018-06-04 09:28:13 -07:00
Shu Chen e7d782c421 [nrf52840] support aes usage in interrupt context (#2719)
Introduce a simple software AES under nRF52840 platform layer for
AES usage when hardware AES is not available.
2018-06-04 09:27:28 -07:00
Abtin Keshavarzian 6fbca6ab30 [docs] fix typos and update comment/doxygen style (#2741) 2018-05-31 12:35:11 -07:00
Abtin Keshavarzian 1e68d2bbe0 [mle] attach backoff feature (#2713)
This commit adds "attach backoff" feature in MLE. When enabled, an
exponentially increasing backoff wait time is added between attach
attempts. If device is sleepy, the radio will be put to sleep during
the wait time. This ensures that a battery-powered sleepy end-device
does not drain its battery by continuously searching for a parent to
attach to (when there is no router/parent for it to attach).

`OPENTHREAD_CONFIG_ENABLE_ATTACH_BACKOFF` configuration option can be
used to enable/disable this feature. It is enabled by default.
2018-05-31 12:30:59 -07:00
Abtin Keshavarzian 98ed5ea2ad [trickle-timer] improve/simplify the implementation (#2742)
This commit makes the following changes in `TrickleTimer` class:

- Member variable are renamed to follow the code style guideline.
- New methods added for handling of "end of interval" vs. "middle
  of interval" timer fired callbacks.
- The random range selections for mode `kModeNormal` are updated
  to follow RFC6206.
2018-05-30 09:15:31 -07:00
georgecpr a3d01cbca8 [kw41z] radio driver bug fixes (#2753)
* Replaced 'the the' string with 'the'

* Fix promiscuous mode filtering issue

* Stop ACK wait timer after the ACK was received

* Filter ACK frames durind RX sequence. Only TR sequence will allow ACK frames.
2018-05-30 09:05:06 -07:00
Łukasz Duda 90b66eb6de [cli] align autostart command (#2755) 2018-05-30 09:00:49 -07:00
Łukasz Duda b98c8b350a [mle] read Link Margin TLV from Link Accept in detached state (#2754) 2018-05-30 08:59:45 -07:00
Jonathan Hui 64fed1ed4d [cli] fix router table command (#2747) 2018-05-29 16:30:43 -07:00
Yakun Xu 45d360fcd3 [ncp] enable missing properties in radio only mode (#2751) 2018-05-29 15:56:42 -07:00
Abtin Keshavarzian 2abd7a2822 [code-utils] adding helper macro OT_ARRAY_LENGTH() (#2743)
This commit adds helper macro `OT_ARRAY_LENGTH()` to get the number
of elements in an array.
2018-05-29 15:53:53 -07:00
Abtin Keshavarzian ae7984d3a7 [logging] append log level and region prefix strings at compile-time (#2737)
This commit changes how the log level and region prefix strings are
appended to OpenThread's log strings. Instead of the prefix strings
being generated and added at run-time, with the change in this commit
they are appended as part of the format string of `otPlatLog()` during
compile-time.
2018-05-29 15:53:09 -07:00
Jonathan Hui aabd06ab51 [cli] fix child table command (#2749) 2018-05-29 10:01:16 -07:00
Jonathan Hui c1954838b6 [router-table] validate num routers when processing Route TLV (#2744)
Credit to OSS-Fuzz.
2018-05-29 09:45:44 -07:00
Yakun Xu 131ae9d731 [code-style] enhance clang-format.sh (#2750) 2018-05-28 21:20:30 -07:00
Abtin Keshavarzian 94bc7b14f3 [makefile] sort filename lists in alphabetical order (#2746) 2018-05-26 00:15:48 -07:00
Abtin Keshavarzian 1098110ed8 [address-resolver] include age field as part of otEidCacheEntry (#2745)
This commit adds `mAge` field as part of `otEidCacheEntry`. Also
updates comments and fixes minor typo/style issues.
2018-05-26 00:14:28 -07:00
Abtin Keshavarzian 26279a236e [mac] reset CCA success rate tracker on channel change (#2740)
This commit contains two changes:
- When PAN channel is changed, the CCA success rate tracker is reset
- CCA tracker is updated only for frame transmissions on PAN channel
2018-05-25 23:50:31 -07:00
Yuzhuo Yang 1a63f5dbe3 [mpl] update dynamic MPL interval according to new interface (#2739) 2018-05-25 13:47:08 -07:00
Abtin Keshavarzian 68d83fbfd9 [logging] fix logging in LinkRaw class (#2736) 2018-05-24 01:59:05 -07:00
Nathan Lutchansky cdc1dd5660 [logging] fix build with OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL=1 (#2727) 2018-05-24 01:56:55 -07:00
Abtin Keshavarzian 8f7dfead41 [ncp] add vendor hook for property get/set handlers for vendor properties (#2725) 2018-05-24 01:55:59 -07:00
Abtin Keshavarzian 67d68009b7 [toranj] adding test-case for adding on-mesh prefix (config-gateway) (#2721)
This commit adds a new `toranj` test script which covers the
following functionalities:

- Adding on-mesh prefixes using wpantund `config-gateway`
  command.
- Prefixes with different flags/priorities on routers/end-devices.
- `wpantund` behavior adding SLAAC based IPv6 address.
- `wpantund` retaining user-added prefixes and adding them back
  after an NCP reset.
2018-05-24 01:55:07 -07:00
Abtin Keshavarzian 38f206c670 [mle] update processing of received MLE Announce messages (#2707)
This commit changes how the received MLE Announce messages are
processed.

The new implementation adds a delay before taking action when it
receives an MLE Announce message that has a more recent Active
timestamp (compared to device's current Active Dataset timestamp).  A
timeout interval of `kAnnounceProcessTimeout` (250ms) is used before
the device switches to the new channel or pan-id from the received MLE
Announce message. During the timeout interval, device can receive and
parse other MLE Announce messages and it will ignore any with the same
timestamp.
2018-05-23 01:19:49 -07:00
Abtin Keshavarzian c276d0776c [mle] add helper methods to check device mode flags (#2718)
This commit adds helper methods in `Mle` class to check whether
different flags are set in device mode, such as `IsRxOnWhenIdle()`,
`IsFullThreadDevice()`.
2018-05-23 01:15:55 -07:00
Robrecht Dewaele ff04efc283 [configure.ac] fix typographical error (#2729) 2018-05-23 00:49:59 -07:00
Abtin Keshavarzian 420813e03d [ncp] adding new log output through NCP spinel property (#2722)
This commit adds a new log output model for NCP to use a newly added
spinel stream log property. `OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL`
can be used to be select the new log output model.

This commit defines a new spinel property `SPINEL_PROP_STREAM_LOG`
which provides streaming of formatted log string from NCP along with
an optional metadata structure. OpenThread log level and log region
are included as part of the metadata.

This commit also updates the `toranj` configuration header file to
use the new log output model.
2018-05-23 00:43:09 -07:00
Stuart Longland 70c3f11741 [CC2538]: Fix MAC address word ordering. (#2714)
It seems TI (for whatever reason) chose to use a rather unorthadox
mixed-endian representation for the MAC address in the CC2538, where the
most significant 4 octets are given first in little-endian order,
followed by the least significant 4 octets (again in little-endian).

The OpenThread code expects a big-endian representation of the MAC, so
we need to read in and byte-swap each half individually.
2018-05-23 00:32:34 -07:00
Jonathan Hui 52644515a6 [router-table] check num active routers before allocating (#2723)
Credit to OSS-Fuzz.
2018-05-17 20:05:58 -07:00
Piotr Szkotak 65d6c98037 [nrf52840] fix building with FULL_LOGS=1 and update .travis/script.sh (#2720)
Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2018-05-17 15:22:57 -07:00
Robrecht Dewaele da2af98e2e [spi-hdlc-adapter] fix compilation on Alpine Linux with musl libc (#2712)
Without linux/ioctl.h compilation fails on this platform,
because _IOC_SIZEBITS will not be defined.
2018-05-17 08:53:51 -07:00
Robrecht Dewaele b76f72e1ac [posix] fixed trivial typographical error (#2715) 2018-05-15 22:13:34 -07:00
Abtin Keshavarzian 243642272a [meshcop-tlvs] new methods for parsing Channel Mask Entry (#2705)
This commit adds new methods/classes related to parsing of Channel
Mask Entries in a Channel Mask TLV.

A new class `ChannelMask0Entry` is added for a Channel Mask Entry
with Channel Page 0.

`ChannelMaskTlv::GetFirstEntry()` and`ChannelMaskEntry:GetNext()`
methods are added and can be used to iterate through all the
entries in a Channel Mask TLV.

New method `ChannelMaskTlv::GetMask0Entry()` can be used to search
among all entries to find the one with Channel Page 0 (if one exist).
2018-05-15 19:35:14 -07:00
Abtin Keshavarzian 7f901cf9c7 [announce-sender] feature to enable periodic tx of MLE Announce (#2693)
This commit adds a new feature/class namely `AnnounceSender` which
enables periodic transmission of MLE Announce messages on all
channels. The feature can be enabled using the config option
`OPENTHREAD_CONFIG_ENABLE_ANNOUNCE_SENDER` (disabled by default).

This commit also adds some new helper methods in `Mac::ChannelMask`
to get number of channels in a given mask, and operator overloads
to compare two masks.
2018-05-15 19:32:01 -07:00
Martin Turon 38a48b2b09 [ble] initial platform API for BLE (#2658) 2018-05-15 19:25:09 -07:00
Jonathan Hui 727b8fa2fa [debug] allow build system to provide custom file name (#2706) 2018-05-15 15:45:13 -07:00
Jonathan Hui 5659668aca [router-table] validate router id before allocating router (#2710)
Credit to OSS-Fuzz.
2018-05-15 13:03:45 -07:00
Piotr Szkotak f854cce1fb [nrf52840] fix mbedtls define names in openthread-core-nrf52840-config.h (#2708)
Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2018-05-15 10:04:42 -07:00
Abtin Keshavarzian a4330998af [random] add helper function to add random jitter to a value (#2703) 2018-05-15 09:24:12 -07:00
Łukasz Duda 0824818646 [nrf52840] fix race condition when reporting channel busy event (#2700)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2018-05-15 08:42:42 -07:00
Kamil Sroka 733d461d25 [nrf52840] update platform README.md (#2702) 2018-05-15 08:41:55 -07:00
Jonathan Hui 9c59d032f3 [router-table] avoid out-of-bound access (#2704) 2018-05-14 16:30:56 -07:00
Abtin Keshavarzian 4d6f5a7c4f [mle] change the attach MLE Announcement transmissions (#2692)
This commit changes the attach state machine and how the MLE Announce
messages are sent as part of the attach process. A new attach state
`kAttachStateAnnounce` is added where the device sends MLE Announce on
all channels (in Active Dataset's channel mask).

This commit also adds a new `toranj` test-case which tests the
situation where a device misses a channel change and then reattaches
by sending MLE Announce messages.
2018-05-14 12:33:47 -07:00
Abtin Keshavarzian 7e2caa5f16 [toranj] enable code coverage mode on travis only (#2701) 2018-05-11 09:20:30 -07:00
pvanhorn 27fb81673c [mac] serialize access to the radio channel (#2694) 2018-05-11 08:36:01 -07:00
Jonathan Hui 585080e3a0 [router-table] reduce router allocation from 63 to 32 (#2678)
The existing router table allocated a router entry for every possible router
id value (63).  Beacuse Thread only allows at most 32 active routers in a
given network, allocating 63 router entries is wasteful.  This commit
allocates only 32 router entries and dynamically manages the pool of router
entries.
2018-05-10 15:47:36 -07:00
Jeff Bumgardner e4f5f240eb [docs] update OpenThread logos (#2699) 2018-05-07 20:47:19 -07:00
Abtin Keshavarzian 8889342cee [toranj] add new test script for insecure traffic exchange (during join) (#2696)
This commit adds a new test-script in `toranj` to test the insecure
traffic exchange (during partial join). The test covers the
following functionalities:

- Using specific insecure port through wpantund `permit-join`
- `wpantund` keeping track of insecure traffic flow (source
  address/port) and sending replies insecurely.
- `wpantund` switching to secure mode after receiving a secure
  message from a source.
2018-05-07 13:28:53 -07:00
Jonathan Hui 3af0bda8b7 [dataset] validate TLVs when applying configuration (#2680)
Credit to OSS-Fuzz.
2018-05-06 19:13:57 -07:00
Jonathan Hui 664d9832e5 [mle] move previous partition state into FTD code (#2697)
Previous partition state is only used by FTDs.
2018-05-06 15:22:06 -07:00
Martin Turon 3a6cdd635d [api] add OPENTHREAD prefix to public include guards (#2695) 2018-05-06 15:21:14 -07:00
pvanhorn e4f5aa89d0 [mac] add start/stop the MAC according to the state of the netif (#2688)
To ensure proper and expedient shutdown of Openthread when the Interface is brought down, this change provides a mechanism to gracefully stop the MAC layer operations. Scans are stopped by preventing any new channel change. New Transmissions are stopped. Existing transmissions are allowed to complete. Any pending operations are cleared.
2018-05-01 11:18:34 -07:00
Marco Studerus 273e6f9ba4 [nrf52840] check return value of vsnprintf in otPlatLog (#2691) 2018-04-30 13:47:01 -07:00
Grant Erickson 87a4e713d2 [build] Update to nlbuild-autotools 1.5.2 to Address git Compatibility Issues (#2689)
Update to reflect upstream repository 'https://github.com:nestlabs/nlbuild-autotools' at tag '1.5.2'.
2018-04-30 09:04:31 -07:00
Yakun Xu b69b5bdbd6 [posix] correct config.guess path (#2687) 2018-04-27 10:48:45 -07:00
Jonathan Hui 3813f9b7f0 [travis] add posix build check for gcc 7 (#2685) 2018-04-27 08:49:45 -07:00
Yakun Xu 231925190c [link-raw] fix a log error (#2684) 2018-04-26 08:46:36 -07:00
Yakun Xu 5e634f7c16 [posix] fix a warning on gcc7 (#2681) 2018-04-25 21:25:33 -07:00
Jonathan Hui 2c4b793283 [mle] attach process enhancements (#2675) 2018-04-24 13:22:23 -07:00
Abtin Keshavarzian a86d5ac8c9 [mle] update how timer is restarted in HandleAttachTimer
This commit updates `Mle::HandleAttachTimer()` so that the timer
`mAttachTimer` is restarted at the end of handling all state
transitions.
2018-04-24 10:40:00 -07:00
Abtin Keshavarzian 864f51c024 [mle] update SendParentRequest()
This commit updates `Mle::SendParentRequest()` method to accept
a type as input parameter indicating whether the "Parent Request"
is targeted for all routers or for all routers and REEDs.
2018-04-24 10:40:00 -07:00
Abtin Keshavarzian 3c9d4c8bb8 [mle] refactor the reattach logic into a method
This commit moves the logic related to reattach process (after a
timeout waiting for "Child ID Response") into a new method
`Mle::Reattach()`.
2018-04-24 10:40:00 -07:00
Abtin Keshavarzian c6b3c3c4b5 [mle] rename MLE attach enumeration and function
This commit renames some of enumeration constants, types, and variable
names in `Mle` related to attach process. In particular,

- `AttachState` enum & its constants (replacing `ParentRequestState`)
- `mAttachTimer` instead of `mParentRequestTimer

This code does not contain any logic change to the code.
2018-04-24 10:40:00 -07:00
Jonathan Hui ab1006e089 [efr32] update crypto to RAIL v2.2 (#2679) 2018-04-24 09:26:48 -07:00
Grant Erickson 982b1e6c8f [build] update nlbuild-autotools to 1.5.1 (#2677) 2018-04-24 09:26:07 -07:00
Jonathan Hui 4512fc82e8 [efr32] update to RAIL v2.2 (#2655) 2018-04-23 15:45:32 -07:00
Abtin Keshavarzian 82c3efc065 [toranj] add test for joining without key (#2676)
This commit updates the `test-003-join` test script to add a case
for joining without first setting network key and checking the
wpantund state "associating:credentials-needed".
2018-04-23 14:19:16 -07:00
Jonathan Hui 32cbb47d8f [travis] add build checks for gcc-arm 7 (#2673) 2018-04-23 09:14:52 -07:00
Jonathan Hui 1fff473335 [dataset] add message length checks when processing MGMT_SET.req (#2671)
Credit to OSS-Fuzz.
2018-04-23 09:14:22 -07:00
Jonathan Hui 59de9f34ad [posix] fix compile warning on darwin (#2674) 2018-04-20 09:22:38 -07:00
Abtin Keshavarzian e0ee632d00 [mle] adding SetRole() method to change device role (#2672)
This commit adds a new method `Mle::SetRole()` to update the device
role. This method is used in MLE class instead of direct assignment to
`mRole` variable. The `SetRole()` will ensure to set flag on
`Notifier` (when there is a role change) and also log the role change.
This change simplifies the code and addresses a (rare) issue where
notifier callback would not be invoked on transition from "detached"
to "disabled" role.
2018-04-19 10:02:25 -07:00
Abtin Keshavarzian dc16c5e694 [mle] send a unicast MLE Announce in response to a received Announce (#2669)
This commit changes how MLE Announce messages are sent in response to
a received MLE Announce. In addition to a multicast MLE Announce
message, a unicast MLE Announce is also sent. This behavior can be
controlled using `OPENTHREAD_CONFIG_SEND_UNICAST_ANNOUNCE_RESPONSE`
config option. By default this is enabled.

This commit also changes actions taken after receiving an MLE Announce
in `Mle::HandleAnnounce()` to handle the situation where a device may
receive multiple MLE Announce messages with same info. No action is
taken if the device is detached, and current channel and panid match
the values from the received MLE Announce message.
2018-04-19 09:29:18 -07:00
Abtin Keshavarzian 51d487ed57 [channel-manager] allow channel manager feature without channel-monitor (#2670)
This commit fixes an issue to allow "channel manager" feature to be
enabled without requiring the channel-monitor feature.
2018-04-18 14:06:18 -07:00
Yakun Xu 31e0fec12a [link] fix link raw caps calculation (#2668)
Allow software implementations of link layer features even when hardware
supports.
2018-04-18 10:54:13 -07:00
Yakun Xu 88b6822ac1 [utils] make heap for general use (#2667)
* move heap into utils namespace
* add api to get free space of heap
2018-04-18 09:48:13 -07:00
Abtin Keshavarzian f849ce37c6 [mac] on ack timeout switch the radio to receive mode (#2666)
This commit changes the `Mac` logic for handling ack timeout to put
the radio in receive mode before invoking the `HandleTransmitDone()`
callback with the `OT_ERROR_NO_ACK` status. This ensures that the
radio can be put to sleep after a no-ack error.
2018-04-18 09:00:10 -07:00
Jonathan Hui a370ef6ec3 [channel-manager] channel selection (#2634) 2018-04-17 15:45:05 -07:00
Abtin Keshavarzian b72f4a5d83 [toranj] add test case related to MCU power state control (#2659)
This commit adds a new test-case (under `toranj`) related to
controlling of NCP's MCU power state and iterations between
NCP and wpantund (related to MCU sleep).
2018-04-17 09:12:08 -07:00
Abtin Keshavarzian 1bb139121c [toranj] update verify() to print line-no and test-name (#2662) 2018-04-17 09:09:34 -07:00
Abtin Keshavarzian 00ec62e485 [tests] add new toranj test scripts for "ChannelManager" module
This commit adds new `toranj` test scripts to test newly added
functionality by `ChannelManager` including:

- Test to check new spinel/wpan properties,
- Test to check channel change request feature,
- Test to check channel selection feature.

This commit also updates the posix/radio `otPlatRadioGetRssi()` to
emulate a simple interference model where it would return either a
high or a low  RSSI value with a fixed probability per each channel.
This is used to verify the `ChannelMonitor` sampling logic and channel
selection functionality.
2018-04-16 18:45:17 -07:00
Abtin Keshavarzian 9fa066a592 [ncp] implement "Channel Manager" spinel properties
This commit adds new spinel properties along with their set/get
handlers for `ChannelManager` module.
2018-04-16 14:07:19 -07:00
Abtin Keshavarzian 51ca76c242 [channel-manager] add (auto) "channel selection" algorithm
This commit updates `ChannelManager` class to add support for "channel
selection" logic where the `ChannelManager` can select a channel (for
network to switch to) based on the collected channel/link quality data
(by `ChannelMonitor` module). This commit also adds support for auto-
channel-selection functionality where `ChannelManager` will periodically
check to see if network can/should switch to a better channel. This
commit also adds public OpenThread APIs for all newly added
functionalities.
2018-04-16 14:07:19 -07:00
Abtin Keshavarzian df45240665 [channel-monitor] use "channel occupancy" instead of "quality"
This commit changes the API names (and spinel properties and
documentation) related to "channel monitor" feature to use "channel
occupancy" instead of the term "channel quality" to represent the
rate/percentage of RSSI samples which are higher than a threshold.
2018-04-16 14:07:19 -07:00
Abtin Keshavarzian 7512e23b59 [posix] enable time speed up feature (#2624)
This commit adds a new feature under posix platform to emulate
time (platform Alarm APIs) with a given speed up factor (i.e., as
if time runs `x` times faster). The speed up factor can be given
when running the NCP app as an input argument (default is 1).
2018-04-16 13:17:00 -07:00
Abtin Keshavarzian 8e6be519da [child-table] introducing ChildTable class (#2642)
This commit introduces a new class `ChildTable` as part of OpenThread
core. This class provides methods for iterating through the child
table and searching for a specific child (based on short/extended
address and/or child state). This commit also adds a unit test for the
newly added `ChildTable class.
2018-04-16 10:18:59 -07:00
Yakun Xu 96ed7ccd24 [ncp] add radio only mode NCP app (#2085) 2018-04-16 09:28:00 -07:00
Yakun Xu 6578b2dcf3 [meshcop] fix dataset manager returning stack pointer (#2663) 2018-04-14 08:02:37 -07:00
Jonathan Hui 9ef9b67882 [coverage] enable coverage on toranj tests (#2654) 2018-04-11 10:11:31 -07:00
Jonathan Hui cc2cc68337 [build] sync with latest nlbuild-autotools repo (#2657) 2018-04-11 09:53:58 -07:00
Jonathan Hui df84947d3e [build] update configure.ac for coverage flags 2018-04-11 09:01:37 -07:00
Jonathan Hui b9d7cec1fc [build] add subtree mirror of repository 'git@github.com:nestlabs/nlbuild-autotools.git' branch 'master' at commit 'HEAD'. 2018-04-11 09:00:57 -07:00
Jonathan Hui 7006ce281c Squashed 'third_party/nlbuild-autotools/repo/' content from commit ac7284236
git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: ac7284236cc046c9127da56a86275441f8a42929
2018-04-11 09:00:57 -07:00
Jonathan Hui 05e8108c75 [build] removing nlbuild-autotools for subtree replacement 2018-04-11 08:59:23 -07:00
Jonathan Hui 13b0de60e5 [mac] process frame pending bit at the MAC layer (#2656)
This commit allows processing of the frame pending bit to occur even if the
received frame is a duplicate.
2018-04-11 08:53:32 -07:00
Abtin Keshavarzian 648e8b292a [spinel] add string conversion support for MCU_POWER_STATE definitions (#2653) 2018-04-10 13:10:26 -07:00
Abtin Keshavarzian 9690339837 [jam-detector] pause jam detection when thread is disabled (#2652)
Once jamming detection is enabled/started, `JamDetector`  will also
monitor the Thread device role. RSSI sampling is stopped if the device
role changes to `DISABLED` and is resumed if the role changes. This
commit also adds new logs to this class to indicate when jamming is
detected or cleared and/or when any of the parameters get changed.
2018-04-10 10:23:18 -07:00
Jonathan Hui 5fcb34c22f [logging] remove deprecated OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT (#2651) 2018-04-09 15:55:19 -07:00
Abtin Keshavarzian 6dcf5415a9 [toranj] add cleanup code after every test-case (#2650)
This commit adds `cleanup()` function in the `toranj` start script.
The cleanup code removes logs and any flash files, issues a `killall`
to remove any lingering `wpantund` instances (`wpantund` processes may
still be running from previous `wpan.Node` objects which are not yet
garbage collected by python). It also deletes any `wpan<num>` network
interfaces (this addresses the situation where even after `killall
wpantund` the network interface may stay active by kernel for some
short time, not allowing the next test-case to create network
interface with same name).
2018-04-09 09:37:24 -07:00
Piotr Szkotak ec59d7ef70 [nrf52840] improve timeslot_request in timeslot_request_prepare (#2649) 2018-04-06 14:53:49 -07:00
Hubert Miś d3b26a0558 [nrf52840] fix radio deinitialization (#2648) 2018-04-06 14:53:25 -07:00
Abtin Keshavarzian bd4cc2689b [spi-hdlc-adapter] enhance the retry logic when slave is busy (#2647)
This commit changes the `spi-hdlc-adapter` retry logic when the slave
is busy (it refuses a transmission). There are three levels, initially
the retries happen almost immediately, then up to certain number of
attempts at a fast rate and finally it drops to a slow rate.

This change helps with the average delay of spinel message exchange
between NCP and host (connected using an SPI interface).
2018-04-06 08:49:15 -07:00
Abtin Keshavarzian ecd28458ec [ncp] add support for controlling power state of NCP MCU (#2635)
This commit adds a configuration option to enable NCP power state
control `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL`.
When enabled, the platform is expected to provide two functions:
`otPlatSetMcuPowerState()` and `otPlatGetMcuPowerState()`. Host
can then control the power state using the newly added spinel
property `SPINEL_PROP_MCU_POWER_STATE`.
2018-04-05 10:20:47 -07:00
Yakun Xu ab55bece52 [code-style] require clang-format-5.0 (#2645) 2018-04-04 09:28:00 -07:00
Hubert Miś 8b66cb0fe8 [nrf52840] update radio driver to version 1.1.0 (#2646) 2018-04-04 09:26:07 -07:00
Robert Lubos 477fd5cebb [nrf52840] use single config for mbedtls build (#2643) 2018-03-29 08:52:14 -07:00
Jeff Bumgardner ef5d1afe2c [docs] add Project Zephyr logo to README (#2644) 2018-03-28 23:17:25 +01:00
jciupis 138aee3e50 [nrf52840] add SPI Slave support (#2632) 2018-03-28 16:46:11 +01:00
Robert Lubos 976f7a4078 [nrf52840] fix IAR warning in radio.c (#2641)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-03-27 17:33:04 +01:00
Łukasz Duda 0ccf6a2be2 [nrf52840] update nrfx to version 1.0.0 (#2639)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2018-03-27 17:32:38 +01:00
Hubert Miś 3c019a5d59 [nrf52840] update radio driver to f36aa41 and provide temperature (#2638) 2018-03-27 17:31:31 +01:00
Robert Lubos 5a2a808329 [nrf52840] remove startup delay after software reset in USB driver (#2637)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-03-27 17:30:08 +01:00
Abtin Keshavarzian cb2a7800d7 [key-manager] set default key from KeyManager (#2636)
This commit moves the setting/initialization of default key from
`ThreadNetif` to `KeyManager` class.
2018-03-23 22:12:15 +00:00
Jonathan Hui 4e92a73720 [efr32] pass up received ACK frame (#2617) 2018-03-21 16:09:54 +00:00
Krzysztof Bogucki 21b971c7e4 [nrf52840] custom EUI-64 get (#2631) 2018-03-21 16:09:06 +00:00
Kamil Sroka ef0940644d [nrf52840] use mac features introduced in new radio driver (#2629)
* Use ACK timeout feature introduced in new driver version

* Use CSMA-CA feature introduced in new driver version
2018-03-21 16:06:58 +00:00
Robert Lubos 996be6e147 [nrf52840] add cryptocell support (#2628)
* Add cc310 library and headers

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>

* Add support for CC310 accelerated mbedtls library

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-03-21 16:06:09 +00:00
Abtin Keshavarzian 302c999367 [child-supervision] change how child supervision gets started/stopped (#2627)
This commit removes the `Start()/Stop()` APIs from `ChildSupervisor`
class. Instead `ChildSupervisor` class itself would decide when to
start/stop. It registers a `Notifier` callback to be notified when the
Thread role changes and/or when a child is added or removed. If MLE
operation is enabled and there is at least one "valid" child in the
child table, child supervision starts, otherwise it is stopped.
2018-03-20 17:48:27 +00:00
rongli 11f326068c [ncp] decode PROP_IPV6_ML_PREFIX property as [6C] (#2625) 2018-03-20 15:55:41 +00:00
Shu Chen 449d3e7f11 [cli] return error if the command's argument is not supported (#2620) 2018-03-20 15:54:38 +00:00
Abtin Keshavarzian f27b64dc59 [channel-monitor] add public OT API to enable/disable channel monitoring (#2623) 2018-03-19 22:47:28 +00:00
Abtin Keshavarzian ad4b597262 [settings] adding Settings class (#2606) 2018-03-19 22:45:04 +00:00
Abtin Keshavarzian 130b88f71c [travis] fix pip install issue (#2626) 2018-03-19 17:47:23 +00:00
Shu Chen 59e9aab082 [cli] get external route list in the local Network Data (#2619) 2018-03-16 18:41:39 +00:00
Abtin Keshavarzian c80884bdac [tests] Update toranj test script to retry failed tests (#2615)
This commit updates the `start.sh` script under `toranj` test
framework so that failed tested are tried again up to 3 times.
It also modifies how wpantund project is built and installed
under `toranj`.
2018-03-16 18:39:28 +00:00
Robert Quattlebaum ccb354fb31 [examples] Introducing pseudo resets (#2621)
Pseudo resets allow for `otPlatReset()` to reset the OpenThread state
without resetting the chip. This is important if the SoC is presenting
itself as a USB device.

The build option `OPENTHREAD_PLATFORM_USE_PSEUDO_RESET` can be used to
force this feature to be enabled or disabled by setting it to `1` or
`0` accordingly. Otherwise it will be set to a platform-specified
default value.
2018-03-15 20:53:49 +00:00
Abtin Keshavarzian 1545b0d658 [mesh-forwarder] refactor logging code into method (#2614)
This commit helps reduce stack usage by refactoring logging related
code in `MeshForwarder` into separate methods.
2018-03-15 16:47:38 +00:00
Abtin Keshavarzian 9d661319b9 [mac] refactor frame rx/tx logging logic into methods (#2613)
This commit helps reduce stack usage by refactoring logging related
code for frame rx/tx failure and beacon rx/tx into separate methods.
2018-03-15 16:46:02 +00:00
Jonathan Hui f602dcd5e7 [icmp6] allow config of echo handling for unicast/multicast separately (#2609)
Previously, ICMPv6 Echo Request handling was either enabled or disabled.
This commit allows enabling/disabling the handler for ICMPv6 Echo Requests
sent to unicast and multicast destinations separately.

This commit also adds an associated spinel property and NCP implementation.
2018-03-13 18:10:28 +00:00
Jonathan Hui 0dd689752c [logging] remove deprecated use of OPENTHREAD_ENABLE_CLI_LOGGING (#2605) 2018-03-13 18:10:11 +00:00
Jonathan Hui 51c62a29d0 [network-data] optimize network data update via MLE (#2612)
This commit reduces stack usage when receiving/updating network data via MLE
by copying the network data directly out of the message and skipping the TLV
read.
2018-03-12 18:27:07 +00:00
Jonathan Hui 8ad0e8e0c9 [operational-dataset] optimize storing dataset to non-volatile (#2611)
This commit reduces stack usage when writing operational datasets to
non-volatile by writing out dataset as given and moving the cleanup of TLVs
when reading the dataset out of non-volatile.
2018-03-12 18:26:28 +00:00
Jonathan Hui ab0416c201 [meshcop] handle Keep Alive when no Commissioner is active (#2610)
Credit to OSS-Fuzz.
2018-03-12 18:25:28 +00:00
Robert Lubos 6d98377a1a [nrf52840] update platform drivers and libraries (#2608)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-03-12 18:24:12 +00:00
Kamil Sroka 2559e03b55 [nrf52840] Add timer API for new radio driver in alarm.c (#2607) 2018-03-12 18:23:02 +00:00
Abtin Keshavarzian ef17e914a9 [tests] adding toranj test framework (#2559)
This commit adds the base implementation of `toranj`, a test framework
for OpenThread and `wpantund`.

- It enables testing of combined behavior of OpenThread (in NCP mode),
  spinel interface, and `wpantund` driver on linux.
- It can be used to simulate multiple nodes forming complex network
  topologies, testing network interactions between many nodes
  (e.g., IPv6 traffic exchanges).

This commit also sets up the new test-cases to run as part of travis
pull request validation in OpenThread GitHub projects.
2018-03-07 22:41:01 +00:00
Jonathan Hui c98164f933 [mle] skip IPv6 address registration entries with no matching context (#2604) 2018-03-07 20:12:55 +00:00
Abtin Keshavarzian 157d74d3ef [ncp] config option for max log string size in otNcpPlatLogv() (#2603)
This commit adds `OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE` as
a config option to set the max log string size supported by NCP
`otNcpPlatLogv()`. This commit also increases the default to 150
characters.
2018-03-07 17:46:32 +00:00
Jonathan Hui 3e4ed6cc98 [meshcop] update Border Agent Locator TLV on keep alives (#2596) 2018-03-07 17:45:42 +00:00
Jing 63245f67f0 [harness-automation] support Test Harness V1.1 R1.2.1 and testbeds with mixed-type devices (#2586) 2018-03-07 17:35:38 +00:00
Kamil Sroka 8ebb31f520 [nrf52840] update alarm.c for nrf52840 platform (#2602) 2018-03-07 17:34:11 +00:00
Hubert Miś f758cc1cc9 [nrf52840] update radio driver to 178ecb3514e5f46282bf2108b56aecf5b8db6728 (#2601) 2018-03-07 17:32:25 +00:00
Jonathan Hui afa7f34b26 [dataset-local] cache Active/Pending Timestamp value (#2599)
This commit caches the Active/Pending Timestamp value in memory so that
subsequent calls to `DatasetLocal::Compare()` does not require reading
from non-volatile settings and allocating another dataset buffer on the
stack to do so.
2018-03-02 17:16:36 +00:00
Jonathan Hui 0e9c0cd6b7 [child-table] detect child move by inspecting messages (#2600) 2018-03-01 22:20:10 +00:00
Jonathan Hui 17db74dc8b [operational-dataset] remove redundant Get/Set methods. (#2593) 2018-03-01 22:19:55 +00:00
Jonathan Hui aabebb7c1e [operational-dataset] fix bug in getting the channel mask (#2591) 2018-03-01 20:50:59 +00:00
Jonathan Hui ca791f1ae8 [address-resolver] fix bug in updating address cache by snooping (#2598) 2018-03-01 18:41:32 +00:00
Jonathan Hui 15f4e0129e [meshcop] improve logging of adding/removing joiners (#2597)
This commit makes the following changes:
- Only print logs on success.
- Remove use of `HostSwap64()`, which can cause hard faults.
- Add `ExtAddress::ToString()` method.
2018-03-01 13:49:13 +00:00
Jonathan Hui 76c9d7f65f [tests] fix occasional failures in Cert_5_2_07_REEDSynchronization.py (#2588)
This commit adds delay to allow topology to form and allow the REED to
establish receive-only links.
2018-03-01 13:47:37 +00:00
Abtin Keshavarzian b9e9b6bd63 [mesh-forwarder] config option if to log src/dst IPv6 addresses (#2594)
This commit adds a new config option which determines if the source
and destination IPv6 addresses of received/sent messages are logged
from `MeshForwarder::LogIp6Message()`.
2018-02-28 19:50:07 +00:00
Abtin Keshavarzian 79c4830c3c [mle] do not clear network data on MLE stop (#2590)
This commit changes `Mle:Stop()` so that leader and local network data
are not cleared.
2018-02-27 14:16:21 +00:00
Jonathan Hui b6763163ab [netif] do not allow external link-local unicast addresses (#2579)
Thread does not support address resolution for link-local unicast addresses.
As a result, any link-local unicast address other than the one based on the
IEEE 802.15.4 Extended Address is not useful.
2018-02-27 02:53:52 +00:00
Abtin Keshavarzian 34b045c96b [core] remove unused forward class declarations in header files (#2587) 2018-02-26 21:56:23 +00:00
Abtin Keshavarzian f49158e166 [mle-router] simplify IsSleepyChildSubscribed() (#2584) 2018-02-26 21:55:34 +00:00
Jing 67d61e50a1 [harness-automation] adjust golden device numbers based on TestPlanV1.2.0 (#2583) 2018-02-26 21:55:10 +00:00
Abtin Keshavarzian 3ee92c974b [mac] add method ToString() to Mac::ChannelMask (#2578) 2018-02-26 21:54:13 +00:00
jobroe b87104a459 [efr32] configurable board (#2566)
* Use variables for MCU and board to allow configuration via makefile parameter.

* Add a switch in the efr32 Makefile to choose between supported boards.

* Update efr32 README according to the new possibility to choose between boards.
2018-02-26 21:51:31 +00:00
Jonathan Hui 1c6714712b [tests] fix occasional failures in Cert_6_1_03_RouterAttachConnectivity.py (#2580)
This commit adds necessary delay to allow the router topology to establish
links with neighboring routers.
2018-02-23 17:04:56 +00:00
Abtin Keshavarzian d6e6e0be2b [random] adding random utility functions (#2573)
This commit adds a new header file `common/random.hpp` which
provides functions related to generating random numbers including
a helper function `FillBuffer()` which fills a given buffer with
random bytes. The OpenThread core files are updated to use the
new helper functions.
2018-02-23 17:04:02 +00:00
Giuseppe Andreello f14cf1361e [code-style] make pretty-check output something better (#2576)
PRETTY   cli.cpp
+clang-format -style=file ./cli.cpp
+diff ./cli.cpp -
1006,1009c1006,1009
<     int id;
<     const char *mgrName = otFIGetManagerName();
<     const char *faultName = NULL;
<     uint32_t faultCounter = 0;
---
>     int         id;
>     const char *mgrName      = otFIGetManagerName();
>     const char *faultName    = NULL;
>     uint32_t    faultCounter = 0;
make[2]: *** [pretty-check] Error 1
make[1]: *** [pretty-check-recursive] Error 1
make: *** [pretty-check-recursive] Error 1
+die
+echo  *** ERROR:
2018-02-22 16:59:55 +00:00
Jonathan Hui 1a025f8c3e [tests] fix occasional failures in Cert_5_2_01_REEDAttach.py (#2577)
This commit adds delay to allow routes to form between REED1 and Leader.
2018-02-22 16:55:04 +00:00
Jonathan Hui 757f9163f7 [tests] fix occasional failures in Cert_5_1_09_REEDAttachConnectivity.py (#2575)
This commit adds necessary delay to allow the REEDs to establish links with
neighboring routers.
2018-02-22 16:54:25 +00:00
Jonathan Hui e69ed68223 [tests] fix occasional failures in Cert_5_1_08_RouterAttachConnectivity.py (#2574)
This commit adds necessary delay to allow the router topology to establish
links with neighboring routers.
2018-02-22 16:54:07 +00:00
Jonathan Hui 4a30a1cbb4 [docs] explicitly mention clang-format v5.0.1 requirement (#2572) 2018-02-21 16:47:54 +00:00
Jonathan Hui bf32700912 [mle] reset last heard time when sending Link Request (#2570) 2018-02-21 16:47:44 +00:00
Jonathan Hui 05ae48530c [efr32] fix compile error due to include ordering (#2569) 2018-02-21 16:47:17 +00:00
Jonathan Hui 6f5c939eeb [tests] fix occasional failures in Cert_5_3_05_RoutingLinkQuality.py (#2564)
Updating the bidirectional link quality requires a two-way exchange via MLE
Advertisements.  In the worst case, this can take 2.5x the worst-case MLE
Advertisement period.  This commit increases the delay after updating link
quality configurations.
2018-02-20 17:29:50 +00:00
Abtin Keshavarzian 00a3905fde [mac] avoid data poll timeout when a duplicate frame is received (#2563)
This commit changes how `Mac::HandleReceivedFrame()` handles duplicate
received frame when a sleepy device is waiting for data after a data
poll ack from parent indicating a pending frame. This change ensures
that the sleepy device can go to sleep faster and avoid a data poll
timeout.
2018-02-20 17:29:40 +00:00
Jonathan Hui a94f8fb229 [gp712] fix typo in Makefile.am (#2562) 2018-02-20 17:28:58 +00:00
Abtin Keshavarzian 4d339496e5 [mac] adding Mac::ChannelMask class (#2560)
This commit adds a `Mac::ChannelMask` class to define a channel (a
`uint32_t` bit-vector specifying a set of channels). The `ChannelMask`
class provides methods to add/remove channel to the mask, intersect
two masks, and iterate through the channels in the mask. A unit test
for the new class is also added.
2018-02-20 17:28:46 +00:00
Jonathan Hui db4759cc41 [mle] set rx-on-when-idle when stopping Thread (#2558) 2018-02-14 17:04:29 +00:00
Abtin Keshavarzian 4207f41f91 [makefile] update example platform makefiles
This commit makes the following changes to (platform) makefiles:

- Removes conditional source file inclusions in Makefiles and
  adopts the model where the source files themselves would add
  `#if` check for the config option (this is the model adopted
  in OpenThread core).
- Defines `PLATFORM_SOURCES` to include all the sources files
- Adds `PRETTY_FILES` to specify files for "make pretty-check"

This commit also adds `PRETTY_FILES` in unit test makefile.
2018-02-14 17:04:07 +00:00
Abtin Keshavarzian 00299f2e91 [code-style] make diag related file pretty 2018-02-14 17:04:07 +00:00
jbumgardner c369d729b4 Add channel manager to Doxygen TOC 2018-02-12 17:17:08 +00:00
Abtin Keshavarzian 610ee30669 [travis] enable "channel manager" feature in posix ftd (router) build 2018-02-12 17:16:47 +00:00
Jonathan Hui 12237d07dc [code-style] fix initializers in constructors 2018-02-09 21:43:42 +00:00
Jonathan Hui 69d98d4a53 [code-style] apply clang-format 2018-02-09 21:43:42 +00:00
Jonathan Hui f8e866c65c [code-style] disable formatting in code blocks 2018-02-09 21:43:42 +00:00
Jonathan Hui d3e9925b42 [code-style] change to clang-format 2018-02-09 21:43:42 +00:00
Abtin Keshavarzian 053557ca72 [ncp] add Channel Manager related properties (#2545)
This commit defines new spinel properties related to Channel
Manager feature and implements their get/set handler in `NcpBase`
2018-02-09 19:22:37 +00:00
Abtin Keshavarzian 9473c04b86 [channel-manager] handle simultaneous channel change requests (#2543)
This commit adds new logic in `ChannelManager` to help handle
situations where multiple devices within network request channel
change around the same time. This simplifies how the channel change
can be triggered by users allowing them to request a channel change on
all routers/devices simultaneously (this would help with cases where
the Thread network contains multiple partitions).

In particular, this commit adds a jitter delay to start processing of
a channel change request (random delay before a Pending Dataset is
prepared and sent to leader). Also this commit changes how the Pending
Dataset is prepared and sent. The code now checks if there is a valid
Pending Dataset and if it is changing the channel to same one as the
current channel change request, then it skips updating the Pending
Dataset.
2018-02-09 17:00:21 +00:00
Jonathan Hui 6159e3a646 [tests] remove test-fuzz - superceded by OSS-Fuzz (#2551) 2018-02-09 16:55:54 +00:00
Oleksandr Grytsov e7cbed07e0 [samr21] fix gcc 7 compilation issue and update README.md (#2552)
* [samr21] add conditional -Wno-expansion-to-defined for GCC7 (#2548)

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>

* [samr21] update README.md (#2548)

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2018-02-09 16:54:49 +00:00
Thomas 878950990a [gp712] add missing const to radio_qorvo.h (#2553) 2018-02-09 16:53:35 +00:00
Abtin Keshavarzian e347a7ddba [channel-manager] API to get the last requested channel (#2546)
This commits adds a new API to `ChannelManager` class (and a
a corresponding public OT API) to get the channel for the last
successfully requested channel change.
2018-02-08 18:47:23 +00:00
Tomas Cerskus 33a9b3e62b [efr32] fix otPlatRadioTxDone sometimes not being called (#2549)
Sometimes when transmission is started RAIL_EVENT_RX_OVERFLOW
happens and then otPlatRadioTxDone is never called.

This commit makes sure the RX FIFO is always drained, even when
transmitting so RAIL_EVENT_RX_OVERFLOW never happens.
2018-02-08 17:06:10 +00:00
Zhanglong Xia edc299a368 [tests] add traffic analysis for Cert_5_5_01 as TestPlan (#2540) 2018-02-08 17:04:04 +00:00
Tomas Cerskus 6805cfa81e [efr32] initialise timeReceived as required by Rail (#2550)
Worked fine without this but just to be safe.
2018-02-07 17:15:28 +00:00
rongli 7a82a1e1f2 [log] correct the log info in HandleLeaderKeepAliveResponse() (#2547) 2018-02-07 17:04:58 +00:00
Jonathan Hui e09b355575 [travis] upgrade to clang 5.0 (#2544) 2018-02-07 17:01:29 +00:00
Jonathan Hui 4453ef5276 [examples] move platform.h into examples (#2541)
The existing platform.h is really a part of the examples and not a part of
OpenThread core.  This commit moves the platform.h out of the public API
and into the examples directory.
2018-02-07 16:55:09 +00:00
Zhanglong Xia 459de968e9 [tests] add traffic analysis for Cert_5_3_11 as TestPlan (#2539) 2018-02-07 16:54:36 +00:00
Jonathan Hui 56bf6a79f7 [network-data] add length validation to Service TLV (#2542)
Credit to OSS-Fuzz.
2018-02-06 17:23:53 +00:00
Abtin Keshavarzian cc8579fb3f [channel-manager] adding Channel Manager module (#2535)
This commit adds a new module/class `ChannelManager` which provides a
mechanism to perform a network-wide channel change. It internally
uses Pending Operational Dataset updates to trigger the channel change
in the network. It also manages retries in case of errors/failures.

This commit also adds public OT APIs for user to request a channel
change and get/set different parameters related to operation of
Channel Manager (e.g., supported channels mask).

This feature can be enabled using `--enable-channel-manager` configure
option (by default it is disabled).
2018-02-06 17:23:10 +00:00
Matt Smith 2e08471706 [spi-hdlc-adapter] increase max spi-align-allowance from 6 to 16 (#2536)
* Increase max spi-align-allowance from 6 to 16

Testing has determined that some SPI slave interfaces sometimes emit
even more than 6 0xFF bytes before sending the first header byte. Upping
this value to 16 in order to provide some future proofing.

* Up version from 0.06 to 0.07
2018-02-05 21:23:24 +00:00
Jonathan Hui 9ec07205cc [network-data] add length validation to Server TLV (#2532)
Credit to OSS-Fuzz.
2018-02-05 17:06:36 +00:00
rongli d0c983f0a4 [mle] delay to send announce for FTD (#2521) 2018-02-03 06:54:57 +00:00
Abtin Keshavarzian 10f6c4f0cd [ncp] add support to get the frame/message error rate of neighbors (#2525)
This commit adds `SPINEL_PROP_THREAD_NEIGHBOR_TABLE_ERROR_RATES`
as a new spinel property to get the frame and message error rates
for all neighbors. This property requires the presence of a newly
added Spinel capability `CAP_ERROR_RATE_TRACKING` which indicates
if the error-tracking feature is enabled in OpenThread.
2018-02-02 18:29:52 +00:00
Łukasz Duda 49b4f84685 [mle] do not clear address query cache when switching to the router role (#2529) 2018-02-02 17:08:04 +00:00
Abtin Keshavarzian 2b7298bf9b [logging] use core log region for Notifier, and util for child supervision (#2528)
This commit also updated windows-logging to add new core and util
related logs.
2018-02-02 17:04:21 +00:00
Jonathan Hui 1318d7942e [network-data] add length validation to Service TLV (#2527)
Credit to OSS-Fuzz.
2018-02-02 17:03:36 +00:00
Thomas 639b58eae7 [commissioner] joiner timing out causes an assert in timer.cpp (#2526) 2018-02-02 17:03:22 +00:00
Jonathan Hui bf52ed706f [dataset] remove network dataset buffers (#2523)
This commit removes both the Active and Pending Operational Dataset buffers.
2018-02-01 19:11:16 +00:00
Abtin Keshavarzian 2d3dcece7b [logging] add two new regions for core and utility modules (#2524)
This commit adds `OT_LOG_REGION_CORE` and `OT_LOG_REGION_UTIL` as
two new log regions. The Core is intended for any core module that
does not fit any other category. The `UTIL` is intended for all
modules under `/core/util` folder.
2018-02-01 16:55:25 +00:00
Zhanglong Xia ed05498cdc [tests] add traffic analysis for Cert_5_3_09 as TestPlan (#2522) 2018-02-01 16:52:06 +00:00
Abtin Keshavarzian 68a605f22e [link-quality] track MAC frame and message error rates (#2520)
This commit implement a new feature to allow the tracking of tx error
rates at two layers:

- At PHY/MAC layer for MAC frame transmissions (frame tx error rate):
  Error rate is maintained per link/neighbor. A frame transmission
  attempt is considered failed if the frame is sent over the channel,
  but no acknowledgment frame is received from the neighbor.

- Above MAC layer for message transmissions (message error rate):
  A larger (IPv6) message may be fragmented and sent as multiple MAC
  frames. The message transmission is considered failed, if any of
  its fragments fail after all retry attempts.  Message error rate is
  maintained per link/neighbor and includes both direct and indirect
  message transmissions.

Configuration option `OPENTHREAD_CONFIG_ENABLE_TX_ERROR_RATE_TRACKING`
can be used to enable/disable this feature. By default it is enabled.

`otChildInfo` and `otNeighborInfo` structs are updated to provide the
error rates for a child or neighbor.
2018-01-31 20:40:23 +00:00
rongli 9190aa21c4 [mle] fix the issue when the number of registered addresses exceeds the parent's capacity (#2518) 2018-01-31 16:47:36 +00:00
Abtin Keshavarzian 050cf9074f [mac-frame] update Mac::Address to track its type (Short vs Extended) (#2517)
This commit updates the implementation of `Mac::Address` class
adding getter and setter and other helper methods. When the address
is updated using the setter methods (`SetShort()` or `SetExtended()`
the `Address` class itself will update its type (remembering whether
it is an IEEE 802.15.4 Short Address or an Extended Address). This
helps simplify how this class is used in other modules.
2018-01-30 01:25:47 +00:00
Jonathan Hui d426d7cfbd [posix] implement virtual time and update tests to utilize virtual time (#2508)
This commit adds the following features:

- Example posix drivers to support virtual time simulation, allowing tests
  to run faster than real time.

- A python-based simulation driver that coordinates the virtual time
  simulations.  Each alarm event and message transmission across all nodes
  are scheduled in a single discrete time event queue.  As a result, only
  a single node is making forward progress at a time.

- Updated tests to utilize new virtual-time simulator, allowing them to run
  faster than real time.

- To enable virtual time feature, define VIRTUAL_TIME=1 env var and set
  CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1.
2018-01-29 19:30:46 +00:00
Neal Jackson 0403a1baf5 [nrf52840] add conditional -Wno-expansion-to-defined for GCC7 (#2514) 2018-01-29 16:12:27 +00:00
rongli b12cb9e41f [netif] support multicast address subscription by SEDs (#2474)
Updates mainly include:
1) Remove explict registration APIs
2) Define a new constant to limit the maximum number of addresses to register
3) Fix duplicate delivery to SED for packet sent from the parent to the realm-local multicast address
   its sleepy children subscribe (due to not differentiate MPL retransmission)
4) Some other refinements and resolve conflicts when rebase
2018-01-29 16:11:25 +00:00
Abtin Keshavarzian 20fd57f6a4 [topology] reorder member variables in Neighbor class (#2512)
This commit makes removes the unused `mChannelLength` and moves the
`mRloc16` outside of `mValidPending` union.
2018-01-26 17:48:29 +00:00
Abtin Keshavarzian 98491461e3 [child] adding Child::GetMeshLocalIp6Address() (#2511)
This commit adds a new method `Child::GetMeshLocalIp6Address()`
to get the mesh-local IPv6 address registered by a child. The
unit test `test_child` is also updated to verify the new method.
2018-01-26 17:16:46 +00:00
Jeff Bumgardner d8605003e4 [docs] correcting Doxygen tags (#2510)
* [docs] correcting Doxygen tag

* [docs] fix misspelled Doxygen tag

* [docs] add Channel Monitoring to Doxygen hierarchy
2018-01-25 22:56:02 +00:00
Abtin Keshavarzian 130936579e [child] enhance how mesh-local IPv6 address is stored in a child entry (#2504)
This commit changes how a mesh-local IPv6 address is stored in
`Child` class. Instead of storing the entire IPv6 addresses (16
bytes), only the Interface Identifier (8 bytes) is saved.  The full
address is derived (when needed) using the mesh-local prefix from
`Mle`. This reduces the memory required for storing registered IPv6
addresses in the child table.

This commit also updates the unit test `test_child` to use mesh-local
IPv6 address as part of the test and verify the behavior of new
implementation.
2018-01-25 18:05:45 +00:00
Zhanglong Xia 9d4f367e6d [tests] add traffic analysis for Cert_5_3_10 as TestPlan (#2502) 2018-01-25 17:31:03 +00:00
rongli d7edaae158 [mle] MTD doesn't request Route64 TLV when attach (#2506) 2018-01-24 18:12:03 +00:00
Abtin Keshavarzian 60a1e69bd1 [mac] add delay between RSSI samples during Energy Scan (#2505) 2018-01-24 18:05:59 +00:00
Oleksandr Grytsov 39b6c4eea3 [efr32] Remove UART retargeting (#2499)
Remove redundant retargetserial.c as retargeting may
conflict with OT UART. Also retargeting doesn't work
without retargetio.c just consumes flash and RAM.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2018-01-24 16:47:42 +00:00
Abtin Keshavarzian 171c951eaf [ncp] add new spinel property SPINEL_PROP_MAC_CCA_FAILURE_RATE (#2500)
This commit adds new spinel property corresponding to the MAC CCA
failure rate, and its get handler in `NcpBase`.
2018-01-23 17:10:13 +00:00
Abtin Keshavarzian 39af476d70 [configrue] output "none" for NCP Vendor Hook or Spinel Encrypted when not specified (#2497) 2018-01-23 17:03:23 +00:00
Abtin Keshavarzian 23069bbeec [ncp] add a new spinel property to get all MAC counters (#2489) 2018-01-23 17:00:27 +00:00
Abtin Keshavarzian c2d22744c0 [link-quality] adding SuccessRateTracker and tracking CCA failure rate (#2493)
This commit adds a new class `SuccessRateTracker` which can be used to
tracker success/failure rate of an operation. It uses an exponentially
moving average IIR filter to maintain the rate using  a `uint16_t` as
its storage. Unit test `test_link_quality` is updated to include a new
test case ``ot::TestSuccessRateTracker()` verifying the behavior of
the new class.

This commit uses the new class to track the CCA failure rate (over all
frame transmissions) at MAC layer.
2018-01-22 16:56:18 +00:00
Abtin Keshavarzian 5e6e262dfb [child] update how IPv6 addresses of a child are managed (#2485)
This commit updates/enhances the `Child` class methods related to
managing of the list of IPv6 addresses associated with a child. The
new model provides APIs to add or remove an IPv6 address, check if the
list contains an address, and a method to iterate through all IPv6
addresses of a child. The `mle_router` and `address_resolver` and NCP
implementations are updated to use the new APIs.

This commit also adds a unit test `test_child` to verify  the newly
added methods.
2018-01-22 16:52:14 +00:00
Zhanglong Xia 2636df1952 [tests] add traffic analysis for Cert_5_3_08 as TestPlan (#2484)
This commit adds the method set_lowpan_context to set the lowpan context of sniffer.
2018-01-22 16:48:00 +00:00
Jonathan Hui 092021ad45 [docs] update version (#2496) 2018-01-19 22:06:40 +00:00
Abtin Keshavarzian 19b16b5bcf [dataset] remove unused method declaration in DatasetLocal (#2495) 2018-01-19 17:21:32 +00:00
Abtin Keshavarzian 6c8aef053f [mle] do not delete the ParentInfo settings (#2494) 2018-01-19 17:21:19 +00:00
Abtin Keshavarzian afcb345219 [mle] become detached if no valid parent when sending "Child Update Request" (#2492)
This commit changes the checks in `Mle::SendChildUpdateRequest()` so
that if there is no valid/restoring parent the device immediately
becomes detached and will go through full attach process.

This addresses an issue with an end-device failing to re-attach after
reset in case the device can restore its network info from
settings/flash but there is no parent info entry in the settings.
2018-01-19 17:04:35 +00:00
rongli bb9e6003f7 [mle] remove existing MLE Data Response in queues when there is newer Network Data (#2479)
This commit helps to reduce additional message exchanges when multiple network data updates
in short time.
2018-01-19 16:48:55 +00:00
pvanhorn 9339230acd [mac] add feature to transmit out of band 15.4 frames (#2488) 2018-01-18 22:48:30 +00:00
Abtin Keshavarzian 0acba9909c [logging] remove unnecessary errors when handling Discovery Request (#2490)
This commit removes the unused errors (such as when the device is not
joinable or PAN Id from message does not match the device's PAN Id) in
`MleRouter::HandleDiscoveryRequest()`. This suppresses the (inaccurate)
MLE warning log "Failed to process Discovery Request" for above
scenarios.
2018-01-18 19:43:47 +00:00
Jonathan Hui f19ee244e8 [efr32] fix crypto acceleration flags for RAIL 2.x (#2487) 2018-01-18 19:21:49 +00:00
Krzysztof Bogucki 6284d5cad6 [ncp] Transforming spinel frames between AP and NCP (#2402)
* [ncp] Transforming spinel frames between AP and NCP

NCP Spinel Transformer allows to transform spinel frames sent between
Application Processor (AP) and Network Co-Processor (NCP).

Spinel frames can be transformed by using transformer library
(or libraries) implementing spinel_transformer.hpp. Libraries
can be specified using option --with-ncp-spinel-transformer-libs.
Addidionaly, transformer's outbound buffer can be changed if needed,
using option --with-ncp-spinel-transformer-outbound-buffer-size.
2018-01-18 19:21:20 +00:00
Jonathan Hui c59da516ae [mle] revert request network data on child reattach after reboot (#2466) (#2486)
This reverts commit 87d8940abf.

Adding Network Data to the MLE Child Update Response message increases the
message size beyond what can fit in a single IEEE 802.15.4 frame.  The
Thread specification requires all fragmented MLE message to have MAC
security enabled.
2018-01-18 00:24:02 +00:00
Jonathan Hui 5028d2f71b [mesh-forwarder] MTD code size optimizations (#2469) 2018-01-17 20:18:09 +00:00
Jonathan Hui cc26bb7862 [mle] allow REED to attach to a better partition (#2483) 2018-01-17 16:46:24 +00:00
Abtin Keshavarzian a6a0f1c213 [diags] fix parsing command line and enhancements (#2480)
This commit contains fixes and enchantments for diagnostics module
in OpenThread. In particular, the following changes are made to the
implementation of `otDiagProcessCmdLine()`:

- Fixes an issue with the parsing of command line input (where if
  more than 8 arguments were given, it could cause an out-of bound
  array access and a possible NCP crash). The new code will check for
  this and outputs an error if too many arguments are provided.
- Parsing logic is simplified and now allows for extra spaces between
  arguments.
- A local buffer is used to store the arguments to avoid modifying
  the passed-in input string.

This commit also simplifies and does a code clean-up of `Diag`
class (variable name changes, removing extra method paramters, and
minor style changes).

The `test_diag` unit test implementation is also updated:

- It includes new test commands.
- The test prints/logs the issued input commands and their
  corresponding output (as human-readable printable strings).
2018-01-16 17:45:39 +00:00
Abtin Keshavarzian 1dc8938d67 [types] remove unused CONTAINING_RECORD macro (#2482) 2018-01-16 17:16:52 +00:00
rongli 7256270af0 [mle] remove queued outdated "Child Update Request" when there is newer network data to send (#2477) 2018-01-16 17:07:18 +00:00
Jonathan Hui 1f4b082f2b [mle] abort Address Solicit on partition change (#2481)
This commit aborts the Address Solicit transaction on a partition change.
Doing so avoids having Address Solicit messages being sent to the wrong
Leader address and delays caused by waiting for the previous Address Solicit
transaction to time out.
2018-01-16 17:00:02 +00:00
Jonathan Hui 011a2d14c9 [mle] updates to advertise timer management (#2478)
This commit fixes the following issues:

1. The advertise timer is no longer stopped when sending an Address Solicit
   message.  This ensures that a REED continues to send MLE Advertisements.

2. The advertise timer is always started after becoming a child, even when
   the router upgrade threshold is not yet met.  This ensures that a REED
   will start sending MLE Advertisements.
2018-01-16 02:29:36 +00:00
Jonathan Hui 0b59c2fcd0 [coap] have AbortTransaction() call the associated response handler (#2473)
Calling the associated response handler simplifies the client's handling of
CoAP transactions.

This commit also fixes a bug in aborting multiple pending transactions.
2018-01-15 19:37:03 +00:00
Zhanglong Xia 836377093e [tests] add traffic analysis for Cert_5_2_01 as TestPlan (#2463)
This commit modifies the method assertSentToNode to confirm if the destination Mac address of
the message is the node's Mac address. Add method check_parent_request, check_parent_response,
check_child_id_request and check_child_id_request to command.py.
2018-01-15 19:36:38 +00:00
Jonathan Hui 33065099e1 [mle] fix partition merging with REEDs (#2476)
REEDs periodically transmit MLE Advertisement messages to support merging
partitions.  However, REEDs do not include Route64 TLVs in their MLE
Advertisement messages.

This commit removes the strict requirement check when handling MLE
Advertisement messages, allowing such messages sent by REEDs to trigger
the partition merging process.
2018-01-15 05:36:28 +00:00
Jonathan Hui 15885dc2a2 [mle] do not clear router table state until role transitions to router (#2475)
Prior to this commit, a REED attempting to become a router clears its
routing table state when sending the Address Solicit message.  This causes
the REED to improperly think that it is a singleton when determining whether
or not to merge with another partition.

This commit only updates the routing table state when the REED actually
transitions to becoming a router.
2018-01-14 18:46:34 +00:00
Jonathan Hui 5df7c83fb3 [mle] fix bug in restarting router state update timer (#2472)
This commit moves restarting the state update timer to the top of
`MleRouter::HandleStateUpdateTimer()`.  This ensures that the timer
continues to fire periodically.  Prior to this change, the state update
timer is not properly restarted when `mRouterSelectionJitterTimeout`
expires.
2018-01-13 21:38:08 +00:00
Abtin Keshavarzian ba5317a957 [ncp] channel monitoring properties and public OT API (#2462)
This commits contains the following changes related to channel
monitoring feature:

- It adds OT public APIs for this feature.
- It defines new spinel properties (and their documentation).
- It implements `NcpBase` get handlers for the new properties.
2018-01-13 21:37:04 +00:00
Abtin Keshavarzian cfdab91f44 [ncp] add a vendor hook to notify when a frame is sent and removed (#2468) 2018-01-12 17:10:34 +00:00
Zhanglong Xia f9df5c2c09 [tests] delete deprecated test case cert_5_2_02 (#2465)
The test case cert_5_2_02 has been deprecated from the Certification Test Plan V1.1 R64
2018-01-12 17:09:38 +00:00
Jonathan Hui 87d8940abf [mle] request network data on child reattach after reboot (#2466)
This commit adds a Network Data TLV request to the MLE Child Update Request
message when trying to resynchronize with a parent after reset.  This
eliminates the need for an MLE Data Request/Response exchange following the
MLE Child Update Request/Response exchange.
2018-01-12 01:04:55 +00:00
Jeff Bumgardner 1b4c82c5c5 [docs] fix Doxygen tag (#2467) 2018-01-11 20:20:18 +00:00
Jonathan Hui 2c44b7f3f8 [mesh-forwarder] do not forward mesh headers to MTD (#2464) 2018-01-11 17:03:28 +00:00
rongli e25f97d0fb [mle] fix some corner cases when trying to attach to a better partition (#2461) 2018-01-11 17:01:58 +00:00
Jonathan Hui e668f0cc3e [efr32] update to RAIL 2.x (#2401)
This update also makes the following changes:
- Initialize chip using `halInitChipSpecific()` provided by RAIL HAL.
- Use `RAIL_HoldRxPacket()` to move rx processing out of interrupt context
- Eliminate critical sections from `otPlatRadio*` APIs.
- Use UART driver provided by Gecko SDK.
2018-01-09 17:47:01 +00:00
Abtin Keshavarzian e27cb115a5 [travis] enable "channel monitor" feature in posix ftd (router) build (#2460) 2018-01-09 05:54:30 +00:00
Łukasz Duda daad2be64c [ncp] do not check local network data lock when adding joiners (#2459)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2018-01-09 00:01:58 +00:00
pvanhorn 1bb458214c [ncp] fix some issues with the spinel vendor hook (#2458) 2018-01-08 21:23:37 +00:00
Jonathan Hui 09f8800b87 [cc2538] adjust receiver sensitivity (#2453)
CC2538 data sheet indicates -88 dBm across entire operating conditions.
2018-01-08 21:23:09 +00:00
Jonathan Hui 2f72c2fe16 [mesh-forwarder] always perform routing lookup (#2452) 2018-01-08 21:22:54 +00:00
Abtin Keshavarzian 3043674f4f [utils] implementing channel monitoring feature (#2451)
This commits introduces channel monitoring feature which monitors
signal level on all channels to help determine the cleaner channels
(channels with less interference).

When enabled and started, `ChannelMonitor` class will perform a
zero-duration Energy Scan collecting a single RSSI sample per channel,
every sample interval (which is a build-time configurable parameter).
The RSSI samples are then compared with a (build-time configurable) RSSI
threshold. As an indicator of channel quality, the `ChannelMonitor`
class maintains and provides the average rate/percentage of RSS
samples that are above the threshold within (approximately) a
specified sample window length.
2018-01-08 21:22:43 +00:00
Jonathan Hui 5841410c72 [appveyor] remove OpenThread project due to expired certificate (#2448)
Visual Studio does not like commented lines in sln files.  This PR simply
removes the commented lines.
2018-01-08 21:22:25 +00:00
Abtin Keshavarzian ca493393a4 [ncp] allow log/prints while an async property update is pending (#2454)
This commit changes the `StreamWrite` logic to allow logs/prints
when there is a pending async property update.
2018-01-08 19:09:16 +00:00
Zhanglong Xia 442289a104 [tests] fix the unstable test case Cert_5_5_08_SplitRoutersLostLeader (#2457)
The unstable failing lies in when Leader has lower partition id and switches to better partition
formed by original routers.  The default RouterSelectionJitter of Leader is 120s, however the
migration waiting time in script is 60s, thus there are chances that the ping happens when the
Leader just becomes router in the new partition but before link sychronization, causing the ping
packet dropped on ROUTER3.

Two options to resolve this: 1) increase the waiting time for migration to a value > 120s or
2) configure router selection jitter to a small value to relax the waiting time requirements.
2018-01-08 17:29:53 +00:00
Abtin Keshavarzian 7d193c422f [mesh-forwarder] Clear child's indirect message pointer when removing all its messages (#2456)
This commit changes the `ClearChildIndirectMessages(aChild)` method in
`MeshForwarder` to ensure that it also clears the indirect message
pointer on the child entry.

This addresses a subtle bug in the code in the following situation: If
we happen to receive a "Child Id Request" from an already valid child
for which we are in the middle of an indirect transmission, from
`MleRouter::HandleChildIdRequest()` all queued indirect messages for
the child  are removed (through `MleRouter::RemoveNeighbor()` call).
This would then free the indirect message while the child still kept a
pointer to the freed message.
2018-01-06 01:43:51 +00:00
Łukasz Duda e86e5ca7cf [nrf52840] update platfrom readme.md (#2455)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2018-01-05 17:17:24 +00:00
Duda, Lukasz 9c9fdf074b [mle] unify the way of child removing
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2018-01-05 17:16:07 +00:00
Duda, Lukasz 41e4b3202b [mle] invalidate EID-to-RLOC cache entries while removing a neighbor
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2018-01-05 17:16:07 +00:00
Abtin Keshavarzian c26f5e3bbe [child-supervision] relax the check for starting the supervision timeout timer (#2446)
This commit changes the `SupervisionListener` implementation by
relaxing the checks for when to start the supervision listener timeout
timer, in particular relaxing the check for role to be `ROLE_CHILD`.
This addresses an issue where timer may not start during (re-)attach
process after a "Child Id Request" transmission where the device
becomes sleepy but it's not yet fully attached as a child.
2018-01-04 17:38:37 +00:00
Abtin Keshavarzian eeb24229f0 [mesh-forwarder] use extended address for data poll during parent switch attempt (#2449)
This commit changes the logic for preparing a data poll (802.15.4 MAC
Data Request) frame and selecting short/extended address. It ensures
that during a parent switch attempt on a sleepy-end-device, the data
polls use the extended address as the source MAC address.
2018-01-04 17:07:16 +00:00
Jonathan Hui 9f49148e7e [mbedtls] configure max entropy sources to 1 to save RAM (#2441)
- Reduces the number of maximum entropy sources from 20 to 1 to save RAM.
- Explicitly add platform-specific entropy source.
2018-01-04 17:01:30 +00:00
Jeff Bumgardner 5ed108d9cf [docs] update Doxygen comments (#2450) 2018-01-03 22:43:58 +00:00
Abtin Keshavarzian 784eda5ee4 [mac] zero-duration energy scan from single tasklet (#2442)
This commit changes the implementation of zero-duration energy scan
operation so that all RSSI samples (for different channels) are taken
within the same tasklet. This ensures that the zero-duration energy
scan operation can be performed quickly and radio is switched to its
normal channel avoiding any delays caused by other tasklets and/or
platform operations.
2018-01-03 22:19:20 +00:00
JakubBrachTieto b7000f280b [da15000] fix for Dialog IDE (#2417)
Fix build error caused by lack of compilation flag
2018-01-02 18:30:23 +00:00
Abtin Keshavarzian 34310be5cd [logging] change log strings in LogIp6Message (#2440) 2018-01-02 18:29:37 +00:00
Abtin Keshavarzian 34d9b13c45 [ip6] remove the unused (#if 0) code segment (#2439) 2017-12-22 16:41:20 +00:00
Abtin Keshavarzian f366e4f987 [logging] remove otLogFunc<Entry/Exit> macros (#2438) 2017-12-22 16:41:05 +00:00
Abtin Keshavarzian 16f3213973 [style] use prefix a for function/method argument names (#2437) 2017-12-21 19:17:08 +00:00
Abtin Keshavarzian fb5faeb6f8 [ncp] adding CHILD_TABLE_ADDRESSES spinel property and its get handler (#2434)
This property provides the list of all addresses associated with
every child including any registered IPv6 addresses.
2017-12-21 18:31:29 +00:00
Robert Lubos effbb4de81 [build] fix IAR and Keil build warnings (#2436)
* Apply fixes for IAR

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>

* Apply fixes for Keil

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2017-12-21 16:38:13 +00:00
Hubert Miś 23d149844c [nrf52840] Update radio driver (#2435)
* Separate radio HAL from imported HAL files in nrf52840 platform.

* Update nRF52840 radio driver

* Update nRF52850 HAL files

* Update README.md files in third_party/NordicSemiconductor
2017-12-21 16:36:40 +00:00
Abtin Keshavarzian e45dfa5182 [spinel] change parsing of boolean (#2433)
This commit brings/syncs the change in `spinel.c` from wpantund.
This change was done as part of wpantund commit d77e7cbf23 which
addressed some of the fuzzer test issues.
2017-12-20 23:55:07 +00:00
Jonathan Hui 44a7ba393a [mle] increase Route TLV length to avoid buffer overflow (#2431)
Properly formed Route TLVs should never have more than 32 route entries.
This fix follows a "be liberal in what you accept" approach.

Credit to OSS-Fuzz.
2017-12-20 17:04:03 +00:00
Jonathan Hui ea75fe719f [mbedtls] upgrade to 2.6.1 (#2430) 2017-12-20 17:03:38 +00:00
Jonathan Hui 2e1bc424d4 [posix] print error and exit when node id is invalid (#2429) 2017-12-20 05:32:56 +00:00
Jonathan Hui 22dfb2dddc [instance] co-locate OT_CHANGED_* flags with otStateChangedCallback (#2428) 2017-12-20 05:32:38 +00:00
Abtin Keshavarzian 8ef2228ab2 [mac] ensure MAC operations get started from a tasklet (#2427)
This commit changes how MAC operations (frame tx, active/energy scan,
etc.) get started by adding a new tasklet `mOperationTask` which
is used to start/perform any pending operation. This ensures that
callbacks related to an operation are invoked after the method which
initiates the operation returns. For example, when a new `Mac::Sender`
is registered with a call to `Mac::SendFrameRequest()`, its callback
`FrameRequestHandler` would be invoked after the `SendFrameRequest()`
call itself returns.

The `mOperationTask` serves two purposes. It's mainly used for
starting a new operation. It is also used during Energy Scan to take
an RSSI sample.
2017-12-20 05:32:24 +00:00
Jonathan Hui debf68dd09 [meshcop] use joiner id when enabling discovery response filter (#2426) 2017-12-20 05:32:04 +00:00
Abtin Keshavarzian 38b7d9e652 [mac] simplify scan implementation (#2420)
This commit contains the following changes: It simplifies the MAC
scan implementation by adding common helper methods such as
`UpdateScanChannel()`. It also fixes an issue where invoking back-to-
back scan could cause the handler to be overwritten with NULL. It adds
support for special case of Energy Scan with zero scan duration to
collect a single RSSI sample per channel.
2017-12-16 00:34:57 +00:00
Abtin Keshavarzian 3a46740c24 [core] add explicit to one-argument constructors (#2422) 2017-12-16 00:21:49 +00:00
Jeff Bumgardner 6047a94dce [docs] add Android Things logo, remove old images (#2423) 2017-12-16 00:19:53 +00:00
Abtin Keshavarzian 7b706a9aa6 [mac] simplify the tx processing (#2411) 2017-12-14 05:51:29 +00:00
Abtin Keshavarzian 5b25a57db7 [notifier] Notifier class and new OT_CHANGED flags (#2403)
This commit contains the following changes: (a) It adds a new class
`Notifer` which can be used to register callbacks to be notified of
state or configuration changes within OpenThread. This is used both
internally (by other core OpenThread classes) or externally by
registering `otStateChangedCallback` handlers. (b) This commit also
adds a set of new `OT_CHANGED` flag definitions corresponding to
fields in the Thread Operational Dataset (e.g., the Thread network
channel changes map to `OT_CHANGED_THREAD_CHANNEL`). This ensures that
user is notified of changes to Active Operational Dataset. (c) Finally,
this commit adds support in `NcpBase` for the newly added `OT_CHANGED`
flags by emitting asynchronous spinel property updates corresponding
to the changed configuration properties.
2017-12-14 05:50:30 +00:00
rongli 78818c3f42 [cert] THCI: add diagnosticQuery() API (#2419) 2017-12-13 13:10:25 +00:00
Jonathan Hui 3021a067c5 [ip6] clean up ip6 address usage (#2415)
- Replace `memcmp` with `==` and `!=` operators.
- Change pointers to reference where applicable.
2017-12-13 13:09:34 +00:00
Jonathan Hui 0606b0aefa [mac] clean up extended address usage (#2413)
- Replace `memcmp` with `==` and `!=` operators.
- Replace `memcpy` with `=` assignment.
- Change pointers to reference where applicable.
2017-12-13 07:12:23 +00:00
Jonathan Hui 3364688218 [mle] implement hysteresis for establishing links and merging (#2409)
This commit applies a hysteresis to establishing new links or merging
partitions.  In particular, this commit introduces new minimum link
margin thresholds that must be met before attempting to establish a
new link or merging to a different partition.  Enforcing a mininmum
link margin threshold before establishing new links helps avoid links
that will quickly become invalid due to normal time-varying link
qualities.
2017-12-13 07:11:53 +00:00
pvanhorn c4d27e5642 [ncp] allow a vendor defined subclass of ncp_uart or ncp_spi to access ncp_base members (#2412) 2017-12-13 07:11:21 +00:00
Jonathan Hui d9b498079b [setup] add basic macos tools (#2332) 2017-12-13 05:48:51 +00:00
Thomas 5110704723 [network-data] changing kMaxServerDataSize and kMaxServiceDataSize to #defines (#2408)
The size of the server and service data is not really an enum.
Additionally the formatting of the enum was different from the other enums.
2017-12-08 16:58:32 +00:00
Robert Quattlebaum 9428a2fe26 [nrf52840] Improvements to USB-CDC-UART (#2406)
This change addresses some issues that was noticed while working to
bring up the OpenThread NCP on the nRF52840. The most important change
is the introduction of the macro `USB_HOST_UART_CONFIG_DELAY_MS`, which
will slightly delay the output of queued data once the fake UART is
opened. On some slow Linux systems, the USB-CDC-UART driver sends the
data so quickly after the port opens that the application hasn't had
time to get the TTY properly configured using tcsetattr(). While this is
technically a host-side problem, fixing this problem host-side is
architecturally infeasible in many cases. Ensuring the reliable delivery
of the first bytes of the HDLC stream from the NCP after a reset is
critical to the host driver being able to identify that a reset has
indeed occurred. Waiting a few milliseconds after the port is opened
allows the reset reason frame to be reliably transmitted.
2017-12-07 23:58:31 +00:00
Abtin Keshavarzian 07f4ae1ff3 [ncp] update JAM_DETECT_HISTORY_BITMAP to spinel uint64_t (#2404)
This commit changes the `JAM_DETECT_HISTORY_BITMAP` format to use
spinel primitive type of `uint64_t` instead of two `uint32_t`.
2017-12-07 18:22:24 +00:00
Abtin Keshavarzian a667c59af0 [mac] move tx related methods close to each other (#2407)
This commit moves `StartCsmaBakcoff()` and `SentFrame()` methods in
`Mac.cpp` so that all tx related methods are close to one another.
2017-12-07 18:20:54 +00:00
Abtin Keshavarzian c1cb99f14d [ncp] fix handling of (parse) error in UNSOL_UPDATE_FILTER set handler (#2397) 2017-12-07 18:20:09 +00:00
Abtin Keshavarzian 6f584b2b54 [ncp] remove unnecessary type casts (#2396) 2017-12-07 18:19:52 +00:00
Jonathan Hui a6dcb5fb8c [cli] add missing initializer in coap/udp examples (#2395) 2017-12-07 18:19:34 +00:00
Tomas Cerskus 3ddbb4213a [efr32] Allow calling otPlatAlarmMilliGetNow from an interrupt (#2398)
Before this commit if otPlatAlarmMilliGetNow were called from an interrupt
the timer state could be corrupted.
2017-12-07 17:32:41 +00:00
Robert Quattlebaum 56a12799b5 [ncp] Supress all output except PROP_LAST_STATUS at startup. (#2405)
When an OpenThread NCP starts up, the only thing it should emit is a `CMD_PROP_VALUE_IS` for `PROP_LAST_STATUS`, with a reset reason as the status code.

However, up until this point we have been also dumping out lots of other details which happen to be triggrered by OpenThread's start-up code. This is effectively noise, since a properly implemented host driver would be explicitly fetching the values of properties it needs to know at startup.

This change fixes this by supressing all property updates at startup except `PROP_LAST_STATUS`.
2017-12-07 03:18:58 +00:00
Tomas Cerskus c5b733eea9 [efr32] Fix incorrect transmit power setting (#2400)
OpenThread uses dBm to set power. RAIL_TxPowerSet expects dBm * 10.
2017-12-06 17:11:49 +00:00
Abtin Keshavarzian 9afb77668f [ncp] initialize SpinelEncoder property mSavedNumOpenStructs (#2394) 2017-12-06 16:50:12 +00:00
Jonathan Hui d704694816 [netif] initialize mIsUp (#2393) 2017-12-06 16:49:50 +00:00
Abtin Keshavarzian 831c7874f9 [ncp] send spinel LAST_STATUS error if getting PHY_TX_POWER fails with an error (#2392) 2017-12-06 16:49:32 +00:00
Jonathan Hui 58dd2af06f [spinel] move call to va_end to exit path (#2390) 2017-12-06 16:49:02 +00:00
Jonathan Hui e98bbcc4e6 [bootstrap] reduce dependencies to bare minimum needed for building (#2389) 2017-12-06 16:48:43 +00:00
Abtin Keshavarzian 9ce57b239e [ncp] enhance handling of outbound Spinel responses (to host) (#2302)
This commit adds a new feature in `NcpBase` to allow spinel responses
for property "get/set" commands to be saved/queued by NCP. This in turn
helps to ensure that the responses are never dropped/missed due to NCP
buffer space not being available at the time of processing of the command.
The responses are sent when NCP buffer space becomes available.
2017-12-06 02:33:53 +00:00
Abtin Keshavarzian fc170d85fd [mle] Periodic Parent Search feature (#2330)
This commit implements a "Periodic Parent Search" feature in MLE.
This feature is disabled by default and can be enabled through
`OPENTHREAD_CONFIG_ENABLE_PERIODIC_PARENT_SEARCH` configuration
option.

When enabled, an end-device/child (while staying attached) will
periodically search for a possible better parent and will switch
if it finds a better one.

The child will periodically check the average RSS value for the
current parent, and only if it is below a specific threshold, a
parent search is performed. Since the parent search process can be
power consuming (child needs to stays in RX mode to collect parent
response) and to limit its impact on battery-powered devices, after a
parent search is triggered, the child will not trigger another one
before a specified longer backoff interval. The check and backoff
intervals along with the RSS threshold used to trigger the parent
search can be set from a set of configuration options.
2017-12-05 17:17:02 +00:00
Jonathan Hui 0097c403bc [mle] support MLE attach without having to detach first (#2337)
This commit allows a device to execute the MLE attach protocol without first
having to detach from it's existing parent.  This change allows a device to
search for a better parent without disrupting existing connectivity.

This commit involves the following changes:

1. Support sending MLE Parent Request and receiving MLE Parent Response
   while attached.

2. If the set of MLE Parent Responses yields a better parent than the
   one the device is currently attached to, the device proceeds to complete
   the attach process with the better parent.
2017-12-05 17:16:11 +00:00
Abtin Keshavarzian da4ddd7bf0 [style] fix alignments (#2386) 2017-12-04 20:23:22 +00:00
Ciaran Woodward 4972d7c091 [mac] process security for neighbors on FFD Children (#2373) 2017-12-04 16:54:37 +00:00
Robert Lubos 17e91e611b [nrf52840] fix USB driver deinitialization (#2388) 2017-12-04 16:43:55 +00:00
Robert Quattlebaum bd05a73e38 [nrf52480] Don't call PlatformDeinit() before NVIC_SystemReset() (#2385)
Calling `PlatformDeinit()` before calling `NVIC_SystemReset()` reduces
the reliability of `otPlatReset()` to always work properly, and doing so
seems superfluous if you are just going to reset the chip anyway.

This fixes issue #2383.
2017-12-04 16:41:57 +00:00
rongli 9f9fed5d2d [build] let COMMONCFLAGS defined in common-switches.mk take effect (#2387) 2017-12-03 00:20:42 +00:00
Robert Quattlebaum 2723a136c9 [nrf52480] Fix for buffer overrun in otPlatLog (#2384)
This commit addresses a misunderstanding of what the return value of `vsnprintf()` means.

This fixes issue #2382.
2017-12-03 00:19:41 +00:00
Hubert Miś ebae34998f [nrf52840] Fix HF clock stop procedure in radio driver (#2381) 2017-12-03 00:19:05 +00:00
Shu Chen aa3d17fa5f [diag] remove diag sleep command (#2378)
So then platforms could define their own sleep behavior.
2017-12-02 02:00:10 +00:00
rongli 9270cb4377 [build] config LOG_OUTPUT_APP when CERT_LOG is enabled (#2315) 2017-12-02 01:59:26 +00:00
Abtin Keshavarzian 935d2d07c9 [mle] detect duplicate/invalid child info in non-volatile (#2376)
This commit changes the `MleRouter::RestoreChildren()` so that it
can detect invalid child info in non-volatile settings (e.g., if there
are more entries than max allowed/supported children, or if there are
duplicate entries with same ext address in the list). If any error is
detected the non-volatile child info is refreshed (erased and
re-written).
2017-11-30 05:29:13 +00:00
Abtin Keshavarzian a1d6ceef62 [ncp-buffer] limit number of segments in a frame (being read) (#2377)
This commit adds code in `NcpFrameBuffer` to check and limit the
number of segments in a frame (being read). This is to help detect
cases where the underlying buffer may get corrupted.
2017-11-29 23:39:26 +00:00
Jonathan Hui 7eea5e6d96 [mle] fixes to restoring children (#2375)
This commit makes the following fixes:
- Relax the length check in `RemoveStoredChild()`
- Remove children that do not match router ID
- Simplify restoring logic and remove `mIsRouterrestoringChildren` state var
2017-11-29 20:59:31 +00:00
Abtin Keshavarzian ed2112a19a [ncp] new spinel property to trigger/test watchdog (#2374) 2017-11-29 20:57:58 +00:00
Abtin Keshavarzian 5fc97364f3 [locator] adding OwnerLocator (#2346)
This commit adds a new class `OwnerLocator` which is used by the
callback providing types (like `Timer` or `Tasklet`) to remember the
owner of the object. This change help simplify the handling of
callbacks from such objects. The object itself can be used to get
to its owner using `GetOwner<Type>()` method.  If support for multiple
OpenThread instances is enabled, an `OwnerLocator`  object maintains a
pointer to the owner. But for the single OpenThread instance scenario,
the owner is derived from the single `ot::Instance` object.
2017-11-28 22:42:54 +00:00
Robin Vos 513903061a [coap] set the interfaceId on retransmission (#2370) 2017-11-28 17:35:24 +00:00
Jonathan Hui 741941e271 [radio] remove transmit power config from core (#2352)
Thread (and OpenThread) does not employ any form of transmit power control.
As a result, while OpenThread provides APIs to control transmit power, it
simply buffers and passes the transmit power value straight through to the
radio.

Currently, the transmit power APIs allow specifying an int8_t in units of
dBm.  This is overly constraining for platforms that have more advanced ways
of configuring the transmit power.

This commit removes the transmit power configuration from the core.  This
provides better flexibility in platform-specific ways to configure transmit
power.
2017-11-28 17:33:32 +00:00
Martin Turon 8bd588301e [build] simplfy platform-specific Makefile configuration (#2111)
Make libtool more tolerant of library link order and cyclical dependencies.
2017-11-28 16:45:46 +00:00
Kamil Burzynski c9c203bbed [network-data] added support for iterating over services from leader data (#2368) 2017-11-27 22:20:55 +00:00
Robert Quattlebaum 9b4a9aced4 [ncp] added support for external NCP vendor hook (#2347) 2017-11-27 18:54:48 +00:00
Tomas Cerskus 10a1db7dd9 [ncp] HandleEnergyScanResult should use SPINEL_PROP_MAC_ENERGY_SCAN_RESULT (#2367)
Without this energy scan would falsely return SPINEL_PROP_MAC_SCAN_BEACON.
2017-11-27 18:01:03 +00:00
JakubBrachTieto 448079d16b [da15000] update of Dialog SDK to 1_0_10 version (#2365)
- New cli_programmer tool
- Use RSSI calculation mechanism from SDK
- Change number of EID-to-RLOC cache entries to 20
- Remove unnecessary files
2017-11-22 23:30:43 +00:00
Hubert Miś e1ce2fb35d [nrf52840] update radio driver to 1fcfc44d566c02e555c866c907569b64959952a8 (#2363) 2017-11-22 23:28:30 +00:00
Jonathan Hui ced3294fa1 [cc26xx] remove -pedantic-errors from cc26xx driverlib build (#2366) 2017-11-22 21:37:30 +00:00
Jonathan Hui c7630e7cdd [instance] fix strict-aliasing warning for gcc6 (#2361) 2017-11-22 17:32:03 +00:00
Stuart Longland 1f6528e6c9 [cli] make CLI buffer sizes configurable (#2351)
* [core] Make CLI buffer sizes configurable.

At the moment, we allocate 512 bytes for a receive buffer and 1kB for
transmit, which while it doesn't seem a lot, is in fact a big commitment
for a CLI interface.  In cases where the platform does its own
buffering, this can be significantly reduced.

These add definitions that mirror the current settings so they may be
changed.

* [cli] Define UART buffers according to config.

Use the definitions produced in the previous commit to set the buffer
sizes.

* [core, cli] Rename OPENTHREAD_CONFIG_CLI_LINE_LENGTH

to `OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH` as per review in pull request 2351.
2017-11-21 00:31:47 +00:00
Piotr Szkotak 3acc159202 [instance] add empty line at the end of instance.cpp to fix the keil build (#2356) 2017-11-20 18:07:56 +00:00
Abtin Keshavarzian ab648c6c55 [child-info] add mIsStateRestoring to otChildInfo and filter restoring child in NcpBase (#2355)
This commit adds a new field `mIsStateRestoring` to `otChildInfo`
struct to inform the if the child is being restored. This field is
used in `NcpBase` to filter child entries in restoring state.
2017-11-18 14:26:36 +00:00
Łukasz Duda aa3a72796a [ncp] add missing break statement (#2354)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2017-11-17 21:47:28 +00:00
Łukasz Duda bae14a9ee9 [mle] allow to use GetChildInfo method on restored children (#2353) 2017-11-17 21:14:41 +00:00
Abtin Keshavarzian 134071d814 [spinel] update docs - property formats (#2349)
This commit updates the docs in spinel header file to provide
info about format (struct fields) of some properties.
2017-11-17 10:11:03 +00:00
Kamil Sroka a89eb88748 [nRF52840] add missing call to PlatformEventSignalPending in nRF52840 platform (#2348) 2017-11-16 16:04:23 +00:00
Abtin Keshavarzian 4e060e4dd3 [ncp] add Thread Dataset related spinel properties and their get/set handlers in NCP (#2327)
This commit adds new spinel properties related to Thread Operational
Dataset and implements the corresponding get/set handlers for the
new properties in `NcpBase`.
2017-11-16 13:43:13 +00:00
Jonathan Hui a68e0b3f9f [travis] add samr21 platform to build check (#2341) 2017-11-16 11:34:23 +00:00
Vaas Krishnamurthy b8049dfaab [radio] add field to radio packet enable/disable CCA (#2344)
Defining `OPENTHREAD_CONFIG_DISABLE_CCA_ON_LAST_ATTEMPT` to use this
feature.
2017-11-16 11:33:46 +00:00
Kamil Sroka e22cca3ffe [nRF52840] prevent nRF52840 platform from permanent sleeping (#2345) 2017-11-16 08:56:37 +00:00
Abtin Keshavarzian 02c876ef62 [instance] define ot::Instance class (#2307)
This commit makes the following changes: It defines the public
`otInstance` as an empty opaque structure which is used by all public
C OpenThread APIs. It defines a new class `ot::Instance` (inheriting
from `otInstance) which is then used in core source files. The
functionality related to the instance is also moved/added into the
newly added `Instance` class (as class/static or member methods).
2017-11-13 08:27:57 -08:00
Jonathan Hui a394155372 [docs] fix typo in RFC reference (#2342)
Default Router Preferences and More-Specific Routes is RFC 4191.
2017-11-13 04:06:51 -08:00
Jonathan Hui c9bca709e4 [cli] add OT_NETIF_INTERFACE_ID_THREAD to UDP example (#2338)
The interface identifier is necessary to support link-local and multicast
communication.
2017-11-13 04:06:41 -08:00
Jonathan Hui 992263043b [mle] add retransmissions to MLE Link Request on neighbor timeout (#2336) 2017-11-13 04:05:54 -08:00
Jonathan Hui 9b0e3b2fba [mle] suppress Data Response when trying to update network data (#2335)
There may be short windows where a device does not have the proper Thread
Network Data.  For example, when a device is coming out of reset and
resynchronizing with the rest of the network.

This commit suppresses MLE Data Response transmissions while the device is
trying to receive the latest Thread Network Data from a neighbor.  This
eliminates the possibility that the device may propagate inconsistent
Thread Network Data.

This commit fixes spurious failures in Cert_9_2_15_PendingPartition.py.
2017-11-13 04:04:31 -08:00
Abtin Keshavarzian 609e011dc5 [childinfo] include array of registered IPv6 addresses in otChildInfo (#2326)
This commit adds new fields in `otChildInfo` to include the array
of registered IPv6 addresses by the child.
2017-11-11 17:15:29 -08:00
rongli f7ae14ffd9 [dhcp] invert u/l bit of link-layer address when allocating dhcp address (#2340) 2017-11-11 16:37:45 -08:00
hjian2017 d1f577d068 [tests] add traffic analysis for Cert_5_3_07_DuplicateAddress.py (#2298) 2017-11-11 16:24:38 -08:00
Oleksandr Grytsov c4dc72cf2d [SAMR21] change stack allocation to use all free RAM (#2334)
Initially fixed size 8k was allocated for stack.
As result there was almost no free RAM. This
change creates stack on all free RAM.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2017-11-10 15:56:57 -08:00
Jeff Bumgardner 1667cc7558 [docs] adding missing parameter documentation (#2333) 2017-11-10 12:21:02 -08:00
hjian2017 4dc9f8edf0 [tests] add traffic for Cert_5_3_06_RouterIdMask.py (#2295) 2017-11-10 08:47:54 -08:00
Oleksandr Grytsov f0d3512317 [platforms] add support for Microchip SAMR21 (#2297)
* Add support for Microchip SAMR21

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2017-11-09 12:25:32 -08:00
Jonathan Hui c46b75d0cf [appveyor] remove OpenThread project due to expired certificate (#2329) 2017-11-09 12:17:11 -08:00
Kamil Burzynski e083fdfef4 [posix] clear pending alarms in posix platform which could persist execve call (#2323) 2017-11-07 09:51:09 -08:00
Łukasz Duda a5ede80a15 [nrf52840] move UART initialization from PlatformInit to otPlatUartEnable (#2322)
Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
2017-11-07 09:46:07 -08:00
Jonathan Hui 6f05957bdb [mle] separate attach and child update request timers (#2313) 2017-11-07 09:44:40 -08:00
Jonathan Hui 74b3160f9d [meshcop] use IEEE EUI-64 rather than Joiner ID on user input (#2311) 2017-11-07 09:41:46 -08:00
rongli 27a30c7209 [tests] fix the unstable Cert_5_3_03 (#2317) 2017-11-06 08:58:49 -08:00
Robert Lubos 4b02d8e2ee [nRF52840] remove __aeabi_assert definition from platform (#2321) 2017-11-06 08:58:20 -08:00
rongli 2dfd1eb2ae [cert] THCI: only record commissioning log during 'joining' status (#2314) 2017-11-06 08:57:39 -08:00
Jeff Bumgardner 6699574764 [docs] fix broken README link (#2318) 2017-11-06 08:56:52 -08:00
rongli 203dd58998 [mle] fix router id release issue introduced in #2217 (#2320) 2017-11-06 08:56:19 -08:00
rongli 04ed60be07 [tests] fix the unstable Cert_5_6_07 (#2316) 2017-11-03 08:49:25 -07:00
Shu Chen a911b299f0 [diag] remove unnecessary receive operation in DiagReceiveDone() (#2310)
The extra receive operation may abort the process of transmit.
2017-11-02 08:36:38 -07:00
Abtin Keshavarzian 1e6658b3ad [spinel] add support for 64-bit long signed/unsigned integer (#2309)
This commit adds support for encoding/decoding `uint64_t`/`int64_t`
to spinel as primitive types. `X` and `x` are used as format ASCII
character associated with `uint64_t` and `int64_t` respectively.
This commit also updates the `SpinelEncoder` and `SpinelDecoder`
to add methods related to 64-bit long integer. The related unit test
are also updated.
2017-11-01 21:46:09 -07:00
hjian2017 d8e2c2f73d [tests] add traffic analysis for Cert_5_3_05_RoutingLinkQuality.py (#2289) 2017-11-01 08:53:18 -07:00
Jeff Bumgardner 977cd004bf [docs] Doxygen fixes (#2308) 2017-10-31 22:37:22 -07:00
Abtin Keshavarzian 7392200e9e [child-table] emit child entry inserted/removed from NCP (#2280)
This commit adds new public OpenThread API to set a callback for user
to be notified when a child table entry is being added or removed. This
callback provides info about the child entry and is always invoked before
the `otStateChangedCallback`.

This commit also updates the `NcpBase` implementation to use the new
callback and emit a `VALUE_INSERTED` or `VALUE_REMOVED` async spinel
frame to host whenever child table gets updated. If the async spinel
frame can not be sent (running out of NCP buffer space), an async
`LAST_STATUS(NOMEM)` spinel frame is sent and the entire child table
is sent later (when buffer becomes available) as an async `VALUE_IS`
spinel message.
2017-10-31 14:15:04 -07:00
Jonathan Hui 50942427de [mle] fix bug in forming Child ID Response message (#2306)
This commit fixes an overflow issue when forming the Address Registration
TLV within an MLE Child ID Response message.  The overflow can cause the
resulting message to be malformed.
2017-10-31 13:47:36 -07:00
Abtin Keshavarzian 07647ababc [ncp] add support for new Spinel property THREAD_ROUTER_TABLE (#2303)
This commit adds a new property `SPINEL_PROP_THREAD_ROUTER_TABLE` and
its corresponding get handler to `NcpBase`. The spinel documentation
is also updated. Some of the documentations for the related APIs are
also updated.
2017-10-31 10:57:23 -07:00
Robert Lubos 4329c0d2c4 [nRF52840] minor platform refactoring (#2305)
* Remove unnecessary source files in nRF52840 SDK libraries.

* Rename OT flash data section in nRF52840.
2017-10-31 10:28:35 -07:00
Xiao Ma baadfdf31d [efr32] remove duplicated uart initialization (#2304) 2017-10-30 12:08:00 -07:00
hjian2017 58a89be622 [tests] add traffic analysis for Cert_5_3_04_AddressMapCache.py (#2290) 2017-10-30 09:34:53 -07:00
Jonathan Hui 3c6f7d811e [mle] move attach fail logic to include child id response (#2301)
The MLE attach logic would only execute if no MLE Parent Response messages
were received and assumed that a Child ID Request/Response exchange would
eventually succeed if an MLE Parent Response message was received.

This commit moves that logic to when an MLE Parent Response is received but
a Child ID Request/Response exchange fails.
2017-10-27 09:07:58 -07:00
Jonathan Hui f9cc6e0426 [travis] add gcc-arm-none-eabi-6-2017-q2-update to build check (#2300) 2017-10-27 09:07:43 -07:00
Kamil Burzynski 005781d066 [network-data] add Service/Server TLV support (#2256) 2017-10-26 12:27:19 -07:00
Abtin Keshavarzian 1436d9b067 [core] reorder member variable declarations
This commit changes the order of member variable declarations in
certain classes to group them by size/alignment requirement and
also to avoid having the first member variable of class to inherit
from `InstanceLocator` for a class which its itself a sub-class of
`InstanceLocator` (this is to avoid extra memory padding added for
empty base class).

This commit also re-defines some of the public member variables in
`Ip6` and `Commissioner` classes as a private and provides getter
methods to access them.
2017-10-25 09:00:14 -07:00
Abtin Keshavarzian 4cb17495b2 [core] pass/locate otInstance to all OpenThread classes
This commit changes the model for OpenThread classes so that all
classes track/locate their owning/parent `otInstance` object (i.e.,
the owning `otInstance` object reference is expected to be passed  as
an input argument in the object constructor). This replaces and
simplifies current model where some of classes track/locate the parent
`ThreadNetif`, `MeshForwarder`, or `Ip6` object references instead.
This helps harmonize the model across OpenThread source and also
simplify the `Locator` class implementation.
2017-10-25 09:00:14 -07:00
Łukasz Duda 7b084eca71 [toolchain] fix warnings/errors in Keil compiler (#2286) 2017-10-25 08:54:17 -07:00
rongli 28d08916a5 [cli] separate the result and child list in different lines for THCI (#2296) 2017-10-24 08:46:46 -07:00
Abtin Keshavarzian 01d44ebeed [ncp-base] fix the POKE command handler (#2294) 2017-10-23 22:33:42 -07:00
Maciej Nycz c1a72f84c9 [harness-automation] add option to add all devices to the test bed (#2293) 2017-10-23 22:31:23 -07:00
Maciej Nycz 6a09e466d5 [harness-automation] delete deprecated test cases (#2292) 2017-10-23 22:30:18 -07:00
hjian2017 a6865bae23 [travis] fix increasing failures on Cert_5_3_03_AddressQuery (#2291) 2017-10-23 22:29:42 -07:00
Hubert Miś 9c719f2627 [nRF52840] fix alarm problem on timer overflow (#2282)
Millisecond and microsecond timers used by OpenThread can overflow during
application run. This commit sets RTC Compare Channel to correct value
after overflow.
2017-10-23 22:28:37 -07:00
Abtin Keshavarzian 4f5fa83194 [docs] fix typos in the comments (#2278) 2017-10-19 12:52:47 -07:00
Abtin Keshavarzian f082221854 [ncp-base] remove unused member variable (#2277) 2017-10-19 12:32:23 -07:00
Abtin Keshavarzian e4d5cbf0c0 [coap] fix application coap retransmissions (#2264) 2017-10-18 22:30:26 -07:00
pkanek 5c32a2e44e [mac] set scan handler before calling Scan function (#2274) 2017-10-18 18:04:39 -07:00
Abtin Keshavarzian 6c79f6651f [mesh-forwarder] clear child's indirect message pointer when message is removed (#2269)
This commit changes/fixes the `MeshForwarder::RemoveMessages()` to
check if the message being removed is the current indirect message
stored in child entry and if so, we ensure to clear the pointer in the
entry. It also adds a new private method in `MeshForwarder` called
`RemoveMessageFromSleepyChild()` to refactor the common code used in
both `RemoveMessage()` and `RemoveMessages()`.
2017-10-18 13:30:24 -07:00
hjian2017 5bc2b8113b [tests] add traffic to 4 test cases: from Cert_5_2_07 to Cert_5_3_03 (#2214)
- Add a method in message.py to verify if receive a ICMPv6 message.
- Add two methods in command.py to verify link request and link accept.
2017-10-18 09:25:22 -07:00
Kamil Burzynski e2ca9caac3 [mle] remove AppendDiscovery declaration (#2273) 2017-10-18 09:23:54 -07:00
Jeff Bumgardner 41faaada13 [docs] Doxygen updates for openthread.io reference documentation (#2271) 2017-10-17 21:40:09 -07:00
Abtin Keshavarzian 43f76b85a5 [config] add "openthread-core-config.h" to wrapped stdint/stdbool/string header files (#2270) 2017-10-17 18:07:28 -07:00
Łukasz Duda db91ff13c5 [nrf52840] update nRF802154-radio-driver (#2268) 2017-10-17 09:55:31 -07:00
rongli 7950203691 [dhcp] correct ALOC range (#2267) 2017-10-17 09:54:57 -07:00
Robert Lubos 9f86c3326e [nrf52840] fix IAR warning in USB driver (#2262) 2017-10-17 09:47:13 -07:00
Abtin Keshavarzian 2ea56446a4 [config-header] simplify config header file includes (#2255)
This commit simplifies the config header files includes in
OpenThread core and non-public source files. With this change the
"openthread-core-config.h" becomes the main config header file. This
header file includes all other config ones:
1) The `configure` generated `<openthread/config.h>;
2) The project specific one by `OPENTHREAD_PROJECT_CORE_CONFIG_FILE`;
3) The "openthread-core-default-config.h" defining default settings.

With the change in this commit, all header files include "openthread-
core-config.h" as the first `#include`, and in `.cpp` files, the first
`#include` continues to be the unit's corresponding header file. The
new model ensures that the configuration settings are visible and
consistent in all the source files. This commit also updates the
style guide document accordingly.
2017-10-17 09:46:34 -07:00
Abtin Keshavarzian 23f465c681 [ncp] group spinel property handler declaration in NcpBaase.h (#2265) 2017-10-16 13:02:29 -07:00
rongli 11924b09ff [cli] networkdiagnostic: pass tlv types directly (#2261) 2017-10-16 07:52:56 -07:00
Maciej Nycz a39e1f59da [harness-automation] add IpPowerSocketPduController class (#2247) 2017-10-16 07:51:46 -07:00
rongli b1baa7da52 [mac] rename mRxWhitelistFiltered to mRxAddressFiltered (#2263) 2017-10-13 09:33:23 -07:00
Abtin Keshavarzian 54fa0f1836 [ncp] enhance handling of outbound IP message over spinel (to host) (#2259)
This commit changes how the outbound datagram IPv6 messages (going
from NCP to host over spinel) are handled. If NCP spinel buffer is
full, new outbound messages are saved in a message queue and are
transfered later (as soon as buffer space becomes available). This
ensures that outbound IPv6 messages are never dropped due to spinel
NCP buffer being full.

To realize this, the following changes are made in this commit: (a)
The behavior of methods `NcpFrameBuffer::InFrameFeedMessage()` and
`SpinelEncoder::WriteMessage()` is changed so that the passed-in
message ownership changes to NCP buffer ONLY when the entire spinel
frame is written and the frame is successfully ended/finished. If the
spinel frame gets discarded (e.g. no buffer space) the caller continues
to own the message instance and should either free or save it. (b)
The unit test `test_ncp_buffer` is changed to address and check for
this change. (c) The `NcpBase::HandleDatagramFromStack()` is modified
to implement/use a message queue to save outbound messages and try again
to send the queued messages from `HandleFrameRemovedFromNcpBuffer()`
callback (when spinel buffer becomes available).
2017-10-13 09:29:18 -07:00
Abtin Keshavarzian 92ba27a1fa [ncp] adding SpinelDecoder class and updating NCP implementation (#2258)
This commit adds a new class `SpinelDecoder` which provides a set of
methods/APIs to help in decoding/reading content using Spinel formating
(it is practically a C++ wrapper over Spinel C APIs). A unit test
`test_spinel_decoder` is also added in this commit.

This commit also updates the `NcpBase` implementation to adopt the new
`SpinelDecoder` class mainly in set, insert, and remove handlers
for different Spinel properties. The new class provides similar advantage
as `SpinelEncoder` by simplifying the handler implementations and adding
type-check safety when parsing/reading the spinel frame.
2017-10-13 09:18:37 -07:00
rongli c7b02326b5 [network-diagnostic] use default source selection (#2260) 2017-10-12 23:13:34 -07:00
Jonathan Hui b481971eed [buffer-info] output secure CoAP messages in otMessageGetBufferInfo() (#2227) 2017-10-12 11:14:41 -07:00
Abtin Keshavarzian 2578a7bf8c [message-queue] enable adding a message to head of queue (#2246)
This commit updates the `MessageQueue` implementation to allow
messages to be added to head/front of the queue. It adds new methods
to the `MessageQueue` class and a corresponding one in public
OpenThread APIs (`otMessageQueueEnqueueAtHead()`). This commit also
updates the `test_message_queue` unit test to add cases/scenarios for
testing the new methods and public APIs.
2017-10-11 15:15:53 -07:00
Jonathan Hui 95f744fbb4 [address-solicit] only allow one oustanding address solicit (#2229) 2017-10-10 08:43:18 -07:00
jciupis 41e498a71c [mle] add Status TLV check in Child Update Request and Response (#2243) 2017-10-10 08:42:45 -07:00
Jonathan Hui 3564bae6d2 [mle] only handle MLE attach messages when router role is enabled (#2252) 2017-10-10 08:40:07 -07:00
Giedrius e190edf8a0 [message] extend buffer info provided by otMessageGetBufferInfo() (#2249)
* Include application CoAP messages and buffers
* Include cached messages and buffers
* Set unused buffer info fields to zero
2017-10-09 23:53:03 -07:00
Jeff Bumgardner 9a0b838e5b [docs] fix Doxygen error (#2253) 2017-10-06 16:29:56 -07:00
Jonathan Hui 90d47c9bcd [mle] do not restore last partition id after boot (#2250)
While the previous partition ID is stored in non-volatile memory, the last
known router ID sequence for that previous partition is not.  As a result,
a node coming out of reset that initially fails to reattach to the previous
partition may not be able to reattach until the router ID sequence value
wraps.  This commit also limits the time window with which to avoid the
previous partition ID.
2017-10-06 11:41:36 -07:00
Hubert Miś f9435edfdb [nrf52840] add multiprotocol version of temperature driver (#2251) 2017-10-06 08:55:47 -07:00
Robert Lubos 4238dd97a5 [nRF52840] add receive error handler to radio driver (#2245) 2017-10-04 21:20:29 -07:00
Robert Lubos 1bfa370f1f [cli] add neighbor command (#2244) 2017-10-04 21:19:38 -07:00
Jonathan Hui 6dba17317c [network-data] fix pointless integer comparison warning (#2239) 2017-10-04 08:44:11 -07:00
Jonathan Hui 6dda5c8408 [mle] add link margin to parent selection criteria (#2242) 2017-10-04 08:43:20 -07:00
Robert Lubos 6933a1c680 [iar] warning fixes (#2241) 2017-10-03 09:18:26 -07:00
Adam Eliot 27081335f0 [link-quality] last RSSI ignore invalid RSSI (#2240)
* Add in filtering for invalid 127 RSSI in the last rssi field
2017-10-02 21:52:49 -07:00
Jonathan Hui b2e889b5d4 [operational-dataset] add length check when reading network name (#2226) 2017-10-02 21:51:39 -07:00
Robert Lubos 44cb528a7a [nRF52840] add USB CDC ACM support (#2215) 2017-10-02 10:14:33 -07:00
Abtin Keshavarzian b905fa590e [style] remove comments after #endif in core-default-config.h (#2238) 2017-09-30 08:45:23 -07:00
Jonathan Hui 312bcc541f [key-manager] fix bug that prevents local key rotation (#2235)
Before rotating the key sequence counter, there is a check against the key
rotating guard time.  The key switch guard time is intended to prevent
the key sequence counter from advancing too quickly.  However, the existing
implementation only allowed the key sequence counter to increment if the
key switch guard time had *not* expired.  Because the key rotation period
is larger than the key switch guard time, the key would never rotate.

This commit fixes the logic to check if the key switch guard time *has*
expired, when performing a key rotation.
2017-09-30 08:36:13 -07:00
Łukasz Duda 42caf024c8 [style] minor coding standard fixes (#2234) 2017-09-30 08:32:39 -07:00
Łukasz Duda fe1c162e42 [dtls] introduce default sub-type and ensure InterfaceId is correctly set (#2233) 2017-09-30 08:32:08 -07:00
Vaas Krishnamurthy a837af7f6a [meshcop] add length check to steering data before checking bloom filter (#2222)
We found cases where the device hits a fault when we process steering
data with length = 0. This check will prevent this from happening.
2017-09-29 00:41:36 -07:00
Abtin Keshavarzian 572fd2c9e2 [ncp-buffer] initialize mReadDirection member variable (#2232) 2017-09-27 23:07:58 -07:00
Abtin Keshavarzian 9e1ea1d9bc [ncp] remove unused variable (#2231) 2017-09-27 23:07:16 -07:00
Jonathan Hui d1d3f5d63a [cli] remove useless call (#2228) 2017-09-27 23:06:52 -07:00
Abtin Keshavarzian 192df6cf00 [ncp] adding SpinelEncoder class and updating NCP implementation (#2221)
This commit adds a new class `SpinelEncoder` which provides a set of
methods/APIs to help in encoding/writing content using Spinel formating
(it is practically a C++ wrapper over Spinel C APIs). A unit test
`test_spinel_encoder` is also added in this commit.

This commit also updates the `NcpBase` implementation to adopt the new
`SpinelEncoder` class mainly in implementation of get, insert, and
remove  handlers for different Spinel properties. The new class
provides the following advantages: (a) it simplifies the
implementation of handers, particularly get-handlers for properties
with a single type output; (b) it adds type-checking and type-safety
when frames are being created, e.g., if the Spinel format expects a
`SPINEL_DATATYPE_UINT8` but a `uint16_t` value is provided, the new
model will cause a compile-time error (few instances in code where the
types did not match are fixed in this commit).
2017-09-27 23:04:53 -07:00
Jonathan Hui 7dbc20d2dd [mle] fix MLE Link Accept timeout on resync after boot (#2230) 2017-09-27 12:18:41 -07:00
Jonathan Hui f533fa60ab [mle] improve log messages (#2219) 2017-09-27 11:37:23 -07:00
Wojciech Bober aa6e1a4c22 [cli] add support for extending CLI with user commands (#2223) 2017-09-27 06:12:35 -07:00
Abtin Keshavarzian 408f201c0f [mesh-forwarder] add RSS info to "Rx: data poll" log message (#2224) 2017-09-26 23:24:42 -07:00
Shu Chen f1789623a8 [mpl] support dynamic MPL interval according to the network scale (#2220) 2017-09-26 23:10:15 -07:00
Abtin Keshavarzian 831bd7cb07 [mesh-forwarder] include RSS info in a reassembly timeout message drop log message (#2218) 2017-09-25 23:51:16 -07:00
Jonathan Hui 2f7992db8b [mle] add option to send MLE Link Request on neighbor router timeout (#2217) 2017-09-25 23:50:15 -07:00
JakubBrachTieto 831fd9b173 [da15000] misc improvements for Dialog platform (#2216)
* New Platform Startup
        * Flash memory handling improved
        * Ramdom generator improved
        * Faster platform reboot
        * UART based on interrupts intruduced
        * ARM core and linker related files moved to "third_party" folder
        * Radio Sleep Fixed
        * TLS config fixed
        * Software FIFO for UART added
2017-09-25 23:10:05 -07:00
Abtin Keshavarzian 3db75ab31f [config] simplify the log output selection (#2206)
This commits simplifies the log output selection by having posix and
windows use the common `CONFIG_LOG_OUTPUT_PLATFORM_DEFINED`.
2017-09-21 08:47:37 -07:00
Shu Chen 63a0654eef [mle] fix max response Tlvs limitation issue in HandleChildUpdateRequest() (#2213) 2017-09-21 08:46:03 -07:00
Hubert Miś aa811d0aac [nRF52840] update radio driver (#2212) 2017-09-21 08:44:34 -07:00
Buke Po b9ac11e741 [address-resolver] verify query sent successfully (#2210) 2017-09-21 08:42:53 -07:00
JakubBrachTieto 2e7cc0a8c2 [cli] fix for Dialog IDE (#2205)
Minor changes to ease Open Thread handling in Dialog SDK.
2017-09-21 08:41:47 -07:00
hjian2017 4e3ef18737 [tests] dd traffic analysis for Cert_5_2_06_RouterDowngrade.py (#2192)
Also add a method in command.py to verify a properly formatted address release command message.
2017-09-21 08:40:51 -07:00
pvanhorn d893b8d851 [ncp] fix logic surrounding the call to otPlatWakeHost (#2208)
Due to the nature of how frames can be processed in ncp_uart.cpp, it is possible for a call to otPlatWakeHost to execute before the SPINEL_PROP_HOST_POWER_STATE response message has been sent to the host. This order is unexpected and not sufficient for proper operation. Instead the call to otPlatWakeHost should only occur after the SPINEL_PROP_HOST_POWER_STATE response message has been sent and only when a new subsequent message has been made ready for delivery over the UART.

To solve this, the change below detects when the SPINEL_PROP_HOST_POWER_STATE response message has been completely written to mUartBuffer and immediately calls otPlatUartSend() when this condition is met. With this change the expected order of operations can be maintained.
2017-09-20 21:52:34 -07:00
Abtin Keshavarzian 8a15e3bb2e [mesh-forwarder] fix issue with selecting tx attempts for direct message (#2211) 2017-09-20 16:33:58 -07:00
Jonathan Hui c643aab206 [network-data] add length checks to Prefix TLV parsing (#2207)
Credit to OSS-Fuzz.
2017-09-20 15:45:14 -07:00
Abtin Keshavarzian 4cc448014e [mesh-forwarder] fix logging of RSS value for received messages (#2209) 2017-09-19 22:32:30 -07:00
Jonathan Hui 9234a76ed5 [address-resolver] inspect forwarded frames to update address cache (#2199)
This commit adds logic to inspect forwarded frames and update the address
cache.  If an entry exists for the given IPv6 Source Address and the
RLOC16 source differs, the address cache entry is updated.
2017-09-19 22:30:38 -07:00
Abtin Keshavarzian 4323b6f221 [address-resolver] update/add logs in AddressResolver (#2196) 2017-09-19 13:00:50 -07:00
rongli 93f4fb3a29 [network-diagnostic] Full network data should be returned if requested (#2204) 2017-09-18 21:38:59 -07:00
Robert Quattlebaum b3c3b02f98 [spinel] Improve string field parse checks (#2200)
This change addresses an input validation error when parsing malformed
Spinel string fields. This change may have security implications.

This change also proactively adds an additional sanity check on the
size of the data buffers being passed to the pack/unpack functions,
limiting the maximum input size to 32767 bytes.

With the Spinel data packing format, fields with the type `U` are
zero-terminated strings. Failure to zero-terminate a string is a
syntax error that usually causes `spinel_datatype_vunpack_` to
explicitly fail. However, if there were no bytes left in the unparsed
data buffer when the parser gets to parsing a string field, then this
condition is triggered and undefined behavior results.

This bug could allow an attacker that is already in control of either
the NCP or the host to bypass the zero-termination check on a Spinel
string field, leading to undefined behavior on the other device and,
most likely, Denial Of Service. Note that if an attacker has already
compromised either the NCP or the host, the ability of the attacker to
deny service is a foregone conclusion.

This bug is not a buffer-overflow: this bug results in a garbage
string with no explicit zero termination being returned to the caller.
Such strings usually lead to crashes, not code execution. However, it
is not immediately clear that this bug couldn't be cleverly exploited
in such a way as to enable remote code execution. If such a method was
found this bug would be a vector for a compromised NCP to compromise
the host, and vise versa.
2017-09-18 13:46:11 -07:00
Jonathan Hui 4e5a7b9bc4 [mle] fix partition merging bug when determining singleton partitions (#2203)
The Thread 1.1.1 Specification currently defines a "singleton" as a Thread
network partition that consists of a single router that has no
router-eligible end device children.  At the same time, Thread 1.1.1 does
not provide a way for a router to decipher between a Full End Device (FED)
and a router-eligible end device (REED).  This ambiguity can cause two
partitions to avoid merging, since each partition may determine that they
are higher priority than the other.

This commit makes the change to counting only active routers, which
eliminates the ambiguity above.
2017-09-18 13:31:27 -07:00
Abtin Keshavarzian 6ca9ac74ef [config] move LOG_OUTPUT definition close to other log related options (#2202)
This commit re-arranges some of the OpenThread configuration
definitions in `openthread-core-default-config.h` such that all the
log related options are close to each other. It also moves the
verification of debug uart dependency into the `logging.cpp` file
2017-09-18 09:00:41 -07:00
Abtin Keshavarzian 525247fadb [address-resolver] add config options for address query timeout parameters (#2201) 2017-09-18 08:59:32 -07:00
Martin Turon 4ccc23a511 [nrf52840] add basic gpio diag commands (#2139) 2017-09-15 11:31:11 -07:00
Jonathan Hui 908d7dae83 [mesh-forwarder] add log to RemoveMessage() (#2198) 2017-09-15 10:46:00 -07:00
Abtin Keshavarzian 419dade175 [docs] fix typos in comments (#2197) 2017-09-15 10:43:56 -07:00
Jonathan Hui ba148cf5bf [commissioning-dataset] add TLV validation in HandleCommissioningSet (#2193)
This commit adds a validation check when reading the Commissioning
Session ID TLV in HandleCommissioningSet().

Credit to OSS-Fuzz.
2017-09-15 10:42:02 -07:00
Abtin Keshavarzian 0139cc4195 [mesh-forwarder] add logs to indicate when a direct outbound message gets dropped (#2195) 2017-09-14 18:42:24 -07:00
Ciaran Woodward db707fbf34 [log] Fix otLog*Cli using the CoAP log region (#2194) 2017-09-14 18:35:38 -07:00
Shu Chen 1c02bc79b7 [mle] don't send unnecessary MLE Link Request (#2190) 2017-09-14 18:34:37 -07:00
Jonathan Hui 643eed78bd [message-pool] evict indirect message buffers if no available buffers (#2188)
Message buffer allocation can fail if there are no available message
buffers.  Without a way to evict messages, critical messages (i.e. MLE
Advertisements) needed to maintain the Thread network cannot be generated.

This commit takes a first step towards evicting queued message buffers. In
particular, this commit evicts indirect messages from the head of queue
until there are enough available buffers.

Future commits will seek to implement fairness and priority mechanisms to
better select which messages are evicted from the send queue.
2017-09-14 18:33:24 -07:00
Jonathan Hui 782328a6c2 [mle] properly free message on error in InformPreviousParent() (#2187)
`InformPreviousParent()` uses `Ip6::SendDatagram()` to submit an IPv6
datagram with no next header.  However, if `Ip6::SendDatagram()` returns
an error, custody of the message buffer remains with the caller.  This
commit ensures the message buffer is properly freed in this case.
2017-09-13 14:08:09 -07:00
Abtin Keshavarzian 8cade88f29 [network-data] iterate over both stable and not-stable network data entries (#2183)
This commit updates the `otNetworkDataIterator` to also store the
sub-tlv offset (in addition to main prefix tlv offset and the entry
index). It also updates two methods `GetNextExternalRoute()` and
`GetNextOnMeshPrefix()`. This commit also adds network data unit
test module.
2017-09-13 14:07:50 -07:00
hjian2017 d6a3519036 [tests] add traffic analysis for Cert_5_2_05_AddressQuery.py (#2173)
Add a fuction in node.py node_cli.py to node's address.
Add a module command to verify commands.
Spinel-cli.py doesn't request address for dhcp prefix now, so put
Cert_5_2_05_AddressQuery.py in XFAIL on ncp.
2017-09-13 01:44:56 -07:00
Jeff Bumgardner 79f8a5a82b [docs] updated ARM logo, added Thread Group attribution (#2186) 2017-09-12 18:59:18 -07:00
Abtin Keshavarzian 73fb75cb5f [mle] inform previous parent on attach to a new parent (#2181)
This commit adds a new feature for a child to inform its previous
parent when it attaches to a new parent. OpenThread config option
`CONFIG_INFORM_PREVIOUS_PARENT_ON_REATTACH` controls the behavior of
this feature (default is disabled). If this feature is enabled, after
a device attaches to a new parent, it sends an IP message (with empty
payload) to its previous parent.
2017-09-12 13:15:01 -07:00
Abtin Keshavarzian 2f429f6d88 [net-data-leader] check stable sub-tlvs when comparing in IsStableUpdated() (#2184)
This commit changes `IsStableUpdated()` to ensure the stable
BorderRouter and/or HasRoute sub-tlvs are used when comparing
two network-data.
2017-09-12 09:20:34 -07:00
Kamil Sroka ce2bc59c87 [platform] add PlatformEventSignalPending to platform module (#2180) 2017-09-12 09:02:48 -07:00
Jonathan Hui 50485f894e [mesh-forwarder] inspect forwarded frames to determine if child moved (#2182)
This commit adds logic to inspect frames being forwarded to determine if
a child has moved to a different parent.  If the message was received from
a neighboring router and the IPv6 source address matches that of a child,
the child is assumed to have moved and invalidated.
2017-09-11 09:00:44 -07:00
Jonathan Hui 9f73f67950 [network-data] add length checks to HandleCommissioningSet() (#2177)
Credit to OSS-Fuzz.
2017-09-10 21:25:06 -07:00
Buke Po 6060448140 [tests] change to test mtd apps (#2140)
* [mle] fix mtd child not reattach after partition
2017-09-10 21:14:14 -07:00
Abtin Keshavarzian 632e6913c0 [api] do not include config.h in public api/platform header files (#2168) 2017-09-08 14:37:15 -07:00
erja-gp ab4073980f [build] removed duplicate from source file list (#2179) 2017-09-08 11:04:56 -07:00
rongli 3744c10eec [pending-dataset] MGMT_PENDING_GET.rsp must include Delay Timer TLV (#2166) 2017-09-07 08:41:21 -07:00
hjian2017 2903bfd963 [tests] add traffic analysis for Cert_5_2_04_REEDUpgrade.py (#2162) 2017-09-07 08:39:06 -07:00
Ciaran Woodward b3f60ff713 [meshcop] implement a prioritized queue for Joiner Routers (#2152) 2017-09-07 08:37:13 -07:00
Jonathan Hui cb03cd607a [network-data] add length checks when adding new newtork data (#2171)
Credit to OSS-Fuzz.
2017-09-06 13:19:06 -07:00
Jonathan Hui 768f6af148 [pending-dataset] fix handling of large Delay Timer values (#2158)
The Delay Timer value has a 32-bit range.  However, the current Timer
implementation does not support the full 32-bit range.

This commit fixes the handling of large Delay Timer values by splitting
the delay across multiple timer triggers.

Credit to OSS-Fuzz.
2017-09-06 12:04:59 -07:00
Jeff Bumgardner 39a492bb09 [docs] doc cleanup after openthread.io launch (#2153)
* Doc cleanup after openthread.io launch

* Removed PROTOCOL.md from Makefile
2017-09-06 10:10:35 -07:00
Hubert Miś 75c5fbd1c9 [nRF52840] front end module support (#2175) 2017-09-06 09:55:47 -07:00
georgecpr 5390449351 [kw41z] replaced 'the the' string with 'the' (#2174) 2017-09-06 09:53:19 -07:00
Maciej Nycz d5fcc825f5 [harness-automation] add rf shield device support (#2172) 2017-09-06 09:52:27 -07:00
Abtin Keshavarzian 0e0ea33ef6 [mle-router] check for repeating child entries when restoring children (#2170)
This commit adds additional check in `MleRouter::RestoreChildren()`
method for repeating/duplicate child entries (child entries with
same extended address) when restoring child table from non-volatile
memory. If there are more than one entry, the last one will be used.
2017-09-06 09:51:30 -07:00
Jonathan Hui cbc883b932 [network-data] fix pointer arithmetic on length checks (#2169) 2017-09-05 16:11:48 -07:00
rongli b4858aa851 [network-data] stable flag fix (#2165) 2017-09-05 15:42:13 -07:00
Buke Po ba7c2f657a [mle] verify hop limit is 255 (#2167) 2017-09-05 15:37:09 -07:00
Abtin Keshavarzian 2c8f50bb5b [ncp] reset iterator in get handler of OFF_MESH_ROUTES for local network data (#2161)
This commit also simplifies the implementation for `ON_MESH_NETS`
get handler.
2017-09-01 21:27:58 -07:00
Jonathan Hui b0cf1534bb [operational-dataset] add additional TLV checks (#2159)
Credit to OSS-Fuzz.
2017-09-01 21:26:50 -07:00
Jonathan Hui ba586b5c36 [mle] remove assert on link info ptr check in HandleUdpReceive() (#2157)
Credit to OSS-Fuzz.
2017-09-01 21:26:22 -07:00
JakubBrachTieto 0a82741e86 [commissioning] changing CPU clock for commissioning process (#2041) 2017-09-01 21:24:36 -07:00
Abtin Keshavarzian bf0e663ee5 [network-data] fix updating of iterator in GetNextExternalRoute() (#2160) 2017-09-01 21:22:18 -07:00
Maciej Nycz 9f2085d130 [harness-automation] add option to not restart explorer.exe at the end (#2155) 2017-09-01 12:39:44 -07:00
Abtin Keshavarzian 3d1f287ede [mac] update ENABLE_BEACON_RSP_WHEN_JOINABLE behavior (#2147)
This commit updates the behavior of `ENABLE_BEACON_RSP_WHEN_JOINABLE`
feature. When this feature is enabled, the device will transmit IEEE
802.15.4 Beacons in response to IEEE 802.15.4 Beacon Requests even
while the device is not router-capable and detached.
2017-09-01 12:39:16 -07:00
Jonathan Hui 7cc5ba1358 [network-data] add additional TLV length checks (#2154)
Credit to OSS-Fuzz.
2017-09-01 00:23:39 -07:00
Jonathan Hui 66a98482ed [fuzz] clean up state at the end of each iteration (#2151) 2017-08-30 22:01:16 -07:00
Abtin Keshavarzian a4c46be1b0 [travis] add new configurations to travis posix test builds (#2118)
This commit adds 3 new configurations to travis test build under the
BUILD_TARGET posix. The first two are representatives of common router
and SED devices. The last configuration disables all features.
2017-08-30 10:24:05 -07:00
hjian2017 ce061e2174 [test] add traffic analysis for Cert_5_2_3_LeaderReject2Hops (#2142)
Also add a method last_mle_message to find the newest mle; Add a method assertAssignedRouterQuantity to confirm if Leader contains the Route64 TLV with 32 assigned router IDs.
2017-08-30 08:41:31 -07:00
Ciaran Woodward c57908ce9e [meshcop] give priority to better matches during join, not channel (#2137)
Previous behaviour of the joiner would result in the joiner joining
the network with the highest channel number, rather than the most
suitable. This commit utilizes the priority specified in thread spec
1.1.1 section 8.4.4.1.2 to choose the most suited network for joining.
This removes the bug where it would be impossible to join the desired
network due to another network on a higher channel allowing all joiners
in the steering data.
2017-08-30 08:37:52 -07:00
Buke Po b47ab9ba48 [doc] update CONTRIBUTING.md (#2148) 2017-08-29 17:51:07 -07:00
Maciej Nycz 3f5e796422 [harness-automation] added option to rerun failed test cases (#2149) 2017-08-29 09:27:19 -07:00
Abtin Keshavarzian 36f4f43adc [ncp-uart] fix the bug in uart encoder (#2145)
This commit fixes an issue with the `NcpUart::EncodeAndSendToUart()`
code where the last message can be removed from `mTxFrameBuffer`
and if we ran out of buffer and cannot finalize the HDLC encoded
frame, the final bytes would not be sent until next message is
queued in `mTxBuffer`.
2017-08-28 21:16:38 -07:00
Abtin Keshavarzian 34753d02ea [configure] change --enable-raw-link-api option's default to no (#2144) 2017-08-28 21:15:27 -07:00
Xiao Ma dec1178b4d [efr32] fix build casting warnings on pointer type (#2143) 2017-08-28 21:14:37 -07:00
Robert Lubos 141ceb0446 [mac] fix tx counters (#2134) 2017-08-28 20:17:41 -07:00
Jonathan Hui 850713f09b [tests] increase timeout for MLE Child Update Request. (#2146)
This commit increases the time in waiting for a child to reattach.  This
reflects the recent change to add retransmissions to the MLE Child Update
Request message.
2017-08-28 20:16:52 -07:00
Jonathan Hui 4db72783c8 [mac-frame] read FCF after validating PSDU length (#2141) 2017-08-26 23:56:10 -07:00
Shu Chen 3d2bb0373e [mac_frame] simplify ValidatePsdu() function (#2133) 2017-08-26 14:10:39 -07:00
Jonathan Hui b182d8d046 [mle] fix bug in child link sync after reset (#2135)
This commit fixes a bug when a child coming out of reset attempts to
re-establish the link to its parent.  Upon coming out of reset, a child
will restore state from non-volatile memory, including its IEEE 802.15.4
Short Address.  If the child fails to receive an MLE Child Update Response,
it begins the normal MLE Attach process in search for a new parent.  However,
prior to this commit, the device would not reset its state back to the
detached state.  As a result, a child may be stuck sending IEEE 802.15.4
Data Request messages using its old (probably invalid) Short Address.

This commit also enables retransmission of MLE Child Update Request
messages immediately after a reset.  This increases the child's likelihood
of maintaining its existing parent, which is a desirable property in Thread.
2017-08-25 10:20:25 -07:00
Jonathan Hui f29de59077 [mle] process Active and Pending Timestamps in MLE Child Update Request (#2131)
This commit adds proper handling of Active and Pending Timestamp TLVs
that are included in parent-initiated MLE Child Update Requests.
2017-08-24 14:03:26 -07:00
Jonathan Hui 1e3f3d1830 [mle] avoid sending challenge when child is valid (#2129)
This commit optimizes the parent-initiated MLE Child Update Request when
the child is already valid by omitting the Challenge and TLV Request TLVs.
2017-08-24 14:03:03 -07:00
Abtin Keshavarzian d4e6b8302e [docs] fix typos in comments and variable name (#2132) 2017-08-24 11:27:05 -07:00
Robert Lubos 293d0d4c66 [coap] fix secure coap retransmission issue (#2128)
This commit fixes a bug in SecureCoap encountered when testing commissioning.

A little bit of background - after GetOwner method in CoAP was introduced, a problem with a static handler of mRetransmissionTimer showed up. In single instance mode, whenever retransmission timer striked, static GetOwner method from Coap class was called, regardless if the timer was a member of a Coap or SecureCoap class.

As there are separate instances for Coap and SecureCoap: mCoap and mCoapSecure, the former one was always returned. In result, there was no chance to handle messages queued for retransmission in an instance of SecureCoap. This resulted in commissionig failure in case a retransmission of JoinerFinalize message was needed.

The same pattern would apply for any class that uses inheritance and uses GetOwner in static handlers.

This fix extends the Coap constructor with an optional parameter -aRetransmissionHandler. This way, SecureCoap instances can register their own static timer handler and thereby use correct GetOwner funcion.
2017-08-24 11:26:36 -07:00
Kamil Burzynski d85bb5a2c1 [network-data] add protection against memcpy() memory overwrite (#2125) 2017-08-24 11:24:51 -07:00
Abtin Keshavarzian 8b2e226874 [netif] add linklocal/realmlocal allnodes/allrouters multicast addresses to list (#2121)
Certain multicast addresses like "ff02::01" (Link-Local All-Nodes)
are fixed and will not change. The commit defines them as constant
entries which are then appended into the `mMulticastAddresses`
linked-list.
2017-08-24 11:24:14 -07:00
DuaneEllis-TI e937542990 [debug] add debug uart (#2082) 2017-08-24 10:28:01 -07:00
Jonathan Hui 5c52373c99 [fuzz] reset state on each invocation (#2130) 2017-08-23 14:45:26 -07:00
Abtin Keshavarzian 7804396588 [nRF52840] update the makefile to include diag in pretty file (#2124)
This commit changes the makefile to add `diag.c` under `PRETTY_FILES`
and also changes the alignment/spacing in the `diag.c` file.
2017-08-23 08:44:12 -07:00
Abtin Keshavarzian 1b20bc130b [network-data] fix bug in external route lookup (#2127)
This commit changes the external route lookup logic to ensure that if
an external route prefix is registered by multiple routers (at same
priority level) within the thread network, during route/destination
lookup on a device which has registered this external route, the
router itself is selected/preferred over other routers. This addresses
an issue where a message destined for the external address can be
passed back and forth between routers.
2017-08-22 20:54:04 -07:00
Jonathan Hui df09fc84a4 [lowpan] fix uninitialized variable warnings (#2126) 2017-08-22 18:44:32 -07:00
Abtin Keshavarzian 3523796722 [mac] update the log message for otPlatRadioSleep() failure (#2123) 2017-08-22 18:41:22 -07:00
hjian2017 97a2fc4cc3 [test] Add traffic analysis for Cert_6_1_01_RouterAttach (#2119)
Also fix the method assertMleMessageContainsOptionalTlv() in message.py to
output appropriate log.
2017-08-22 18:35:10 -07:00
Abtin Keshavarzian cfb8766928 [data-poll-manager] do not sent data poll when there is no parent (e.g., when detached) (#2109) 2017-08-22 16:00:08 -07:00
Abtin Keshavarzian cf8a789e24 [mle-router] update #if for logging the router list to be conditional of log level (#2122) 2017-08-22 09:38:06 -07:00
pvanhorn 91d1055d5a [ncp] add support for Spinel vendor specific commands (#2117) 2017-08-21 21:31:04 -07:00
Robert Lubos 296f057d44 [nRF52840] implement additional diag commands in nRF52840 platform (#2112)
* Additional diag commands in nrf52840 platform.

* Add information temperature measurement unit.
2017-08-18 08:55:11 -07:00
Abtin Keshavarzian 9f68c6b7df [configure] remove "platform information" line from configure.ac script. (#2116) 2017-08-17 18:36:55 -07:00
Abtin Keshavarzian 8212c31ae1 [ncp] fix the PHY_ENABLED getter when RAW_LINK_API is disabled (#2115) 2017-08-17 14:40:48 -07:00
Jonathan Hui 4decdad93d [tlvs] fix overflow in TLV length calculation (#2108) 2017-08-17 14:26:21 -07:00
Abtin Keshavarzian bfbf79fed8 [ncp] move some properties under "raw-link-api" feature (#2114) 2017-08-17 12:03:12 -07:00
Hubert Miś cfc84c0277 [nRF52840] pass received frames to MAC layer regardless PHY or MAC state (#2113) 2017-08-17 11:33:45 -07:00
JakubBrachTieto 494a37d31b [da15000] Various improvemets for da15000 radio (#2100)
* Radio Recieve is based on interrupts
* Retransmit mechanism is corrected
2017-08-17 08:28:44 -07:00
Jonathan Hui 9d66542ed8 [mle] enable retransmission of network data to SEDs (#2107)
The Thread Specification requires the router to repeatedly transmit
new Thread Network Data to the SED until it receive an explicit
acknolwedgment from the SED.  Prior to this commit, when network data
changes, a router attempts to update the SED by sending a single MLE
Data Response message.  If the message is lost for any reason (e.g. no
available message buffers, link-layer delivery failure, etc.), the
router will not attempt to send the MLE Data Response again to update
the SED's network data.

This commit makes the following changes:

- The router communicates updated network data in an MLE Child Update
  Request message, requiring the SED to send an MLE Child Update
  Response message with the Leader Data TLV.

- The router repeatedly attempts to transmit new network data to the
  SED until it receives a Leader Data TLV with the updated version.
2017-08-16 09:59:58 -07:00
JakubBrachTieto ff270a1233 [da15000] AES Hardware support (#2091) 2017-08-16 09:57:39 -07:00
Neal Jackson a8105f7fcc [build] bootstrap libtool dependency documentation fix (#2044) 2017-08-16 09:56:51 -07:00
Jonathan Hui f2ddf8ce15 [mle] add length check for AES-CCM tag (#2106)
Credit to OSS-Fuzz.
2017-08-15 15:59:10 -07:00
Jonathan Hui e52d7733c6 [mle] maintain existing child id whenever possible (#2101)
Child IDs are assigned when receiving a Child ID Request.  Prior to this
commit, a new Child ID is assigned whenever the child state is not valid.
A router stores state about its attached children in non-volatile memory.
On a reboot, the router attempts to restore its child links.  As a result,
it is possible for the child to be assigned a new Child ID while it is
being restored.

With this commit, a router only assigns a new Child ID if there is no
existing Child ID state for the given child.
2017-08-15 14:37:06 -07:00
Jeff Bumgardner 9b515e67f7 [doxygen] grammar and tag fixes (#2105) 2017-08-15 13:53:25 -07:00
Buke Po 06247b2d84 [coap] fix handling message id 0 (#2104) 2017-08-15 09:12:23 -07:00
Abtin Keshavarzian 02bdc692a2 [ncp] handle NOT_FOUND and ALREADY errors during VALUE_INSERT/VALUE_REMOVE commands (#2103)
This commit changes the error type returned from `VALUE_IS` and
`VALUE_REMOVE` spinel commands.  If a `VALUE_REMOVE` is issued where the
item being removed is not in the list, instead of passing up `NOT_FOUND`
error, a `LAST_STATUS` with `STATUS_OK` is used. Similarly the behavior
is changed for the `VALUE_INSERT` operation and error status `ALREADY`.

This change helps ensure driver/user considers the operation as a
success while still being able to distinguish (if required) whether
the value was actually removed by checking if we get a `VALUE_REMOVED`
response versus `LAST_STATUS(OK)` response.
2017-08-15 09:11:19 -07:00
Jonathan Hui 49fb997e76 [fuzz] add initial seed corpora to radio-receive-done (#2102) 2017-08-14 13:27:34 -07:00
Hubert Miś 8649a040ce [nRF52840] allow direct transition from TX to SLEEP state (#2095)
Currently SEDs perform this transition on ACK timeout.
2017-08-14 09:17:42 -07:00
Jonathan Hui f1cd0ce491 [doxygen] add builddir to include path (#2098) 2017-08-14 08:37:34 -07:00
Shu Chen b0394afa93 [mesh_forwarder] stay committed to send scheduled Indirect Transmission (#2094) 2017-08-12 13:06:35 -07:00
Buke Po d6cc89685b [meshcop] fix network name overflow (#2096) 2017-08-11 15:50:09 -07:00
Abtin Keshavarzian 5c8a105f66 [ncp] fix issues when OPENTHREAD_ENABLE_RAW_LINK_API is disabled (#2093)
This commit ensues that some properties/methods which are defined
under "raw-link-api" feature only are also `#ifdef`ed in the
lookup entry table definitions.

Another change is related to `HandleRawFrame()` method which is
used/needed for packet capture independent of "raw-link-api"
feature.
2017-08-10 21:32:52 -07:00
Jonathan Hui 444d2e4c84 [mpl] handle length computation overflow when inserting MPL header (#2092)
Credit to OSS-Fuzz.
2017-08-10 21:32:31 -07:00
Maciej Nycz 78247c8de9 [harness-automation] fix for test cases with many devices (#2088) 2017-08-10 10:09:02 -07:00
Shu Chen 588613ba65 [posix] add microsecond timer support (#2086) 2017-08-10 10:08:17 -07:00
Hubert Miś 592fbb27b1 [build] fix GCC7 warnings (#2090) 2017-08-10 08:53:47 -07:00
Hubert Miś 96f82b3858 [nRF52840] update 802.15.4 driver (#2089) 2017-08-10 08:52:39 -07:00
Shu Chen 913892a800 [build] remove remaining with-platform-info option (#2087) 2017-08-09 23:06:09 -07:00
rongli b3dbf285ea [cli] fix udp example (#2084) 2017-08-09 22:22:33 -07:00
Abtin Keshavarzian 1e61811e70 [network-data] iterate over all external routes or on-mesh prefix entries (#2073)
The same external route or on-mesh prefix can be registered by
different devices with different flags (e.g., different preference
level). This info is stored in network data as part of the
BorderRouterEntry TLV. This commit changes the methods
`GetNextOnMeshPrefix()` and `GetNextExternalRoute()`  to ensure that
different entries corresponding to the same prefix are provided
separately when iterating over all entries (i.e., without giving
a specific RLOC16).

To implement this the `otNetworkDataIterator` is changed to track
both the index into the `mTlvs` buffer and the entry index.

This commit also appends an RLOC16 field to the struct packing
format of `SPINEL_PROP_THREAD_ON_MESH_NETS and `OFF_MESH_ROUTES`
spinel properties and updates the implementation and documentation
accordingly.
2017-08-09 21:48:57 -07:00
Seth Rickard 6e8aef9644 [cc2652] refactored polling loop and propagated ack frames (#2080)
Updated cc2650 and cc2652 platforms to place ieee ack frame types in the
RX queue and to propagate those frames to the higher level.

Initialize extra RX buffers.
2017-08-09 11:02:49 -07:00
Jonathan Hui e875f5e86f [mbedtls] apply patch to check-in source (#2074)
This commit applies the patch directly to checked-in source files rather
than at build time.  This commit helps to simplify the build process.

This commit also introduces a shell script that allows anyone to reproduce
the patched mbedtls source.
2017-08-09 11:01:09 -07:00
Abtin Keshavarzian 3ecfb45c80 [mac-frame] const-qualify the getter methods and other enhancements (#2062) 2017-08-09 10:53:37 -07:00
Jonathan Hui 5ecab16f86 [configure] replace --with-platform-info using project config (#2077) 2017-08-08 22:10:07 -07:00
Jonathan Hui 35848351b5 [travis] add build checks for OT_LOG_LEVEL_NONE and OT_LOG_LEVEL_DEBG (#2076) 2017-08-08 22:09:33 -07:00
Buke Po bfb790776a [posix] add src match (#2078) 2017-08-08 22:06:43 -07:00
Abtin Keshavarzian 1be11ba229 [ncp] add IPV6_MULTICAST_ADDRESS_TABLE to unsolicited update capable list (again) (#2079) 2017-08-08 14:59:42 -07:00
Jonathan Hui e2d027c8a5 [coap] add length validation to header parsing (#2065)
Credit to OSS-Fuzz.
2017-08-08 13:51:26 -07:00
DuaneEllis-TI 22ab6f26a6 [cc2538] fix FLASH settings location (#2070) 2017-08-08 13:44:38 -07:00
Łukasz Duda ebf3acaa8e [mesh-forwarder] fix link layer address selection algorithm (#2064) 2017-08-07 12:24:01 -07:00
Buke Po 886f30f3a9 [tests] fix typo in Cert_9_2_12_Announce.py (#2072) 2017-08-06 22:27:21 -07:00
Buke Po 34f9c9a919 [message] change Message::Free() to return void (#2071) 2017-08-06 22:26:37 -07:00
Jonathan Hui ea95d84aa1 [style-guide] note that openthread/config.h must appear first (#2066) 2017-08-04 23:41:16 -07:00
Jonathan Hui 71d40a5c83 [fuzz] enable Thread protocols and set state to Leader (#2067)
This commit:

- Enables Thread-related protocols and sets the device role state to Leader
  in fuzz tests.

- Bypasses AES-CCM decryption and authentication in fuzz tests.
2017-08-04 16:06:59 -07:00
Jonathan Hui 97e957b14a [coverage] enable codecov.io reporting (#2060) 2017-08-04 08:49:32 -07:00
Buke Po 86e1f2a4d4 [ip6] free message if error occurred in Ip6::SendRaw() (#2063) 2017-08-04 08:49:11 -07:00
Jonathan Hui e98ccb8986 [ip6] validate IPv6 headers received via otIp6Send() (#2059) 2017-08-03 22:43:43 -07:00
Jonathan Hui 59b94b4ca7 [mpl] validate HBH header length when inserting MPL Option (#2058)
Credit to OSS-Fuzz.
2017-08-03 22:43:30 -07:00
Jonathan Hui 2f3cfe1c4c [commissioning] improve handling of OT_ERROR_NO_BUFS (#2054)
This commit makes the following changes:

1. Check return value of SetLength() when forming a RLY_TX.ntf message.

2. When accepting data to transmit from mbedtls, only free the message
   buffer if the message buffer is empty.  Otherwise, attempt to transmit
   the message buffer that was already formed.

3. When freeing the transmit message buffer for mbedtls, set the transmit
   message buffer pointer to NULL.
2017-08-03 10:19:50 -07:00
Buke Po 818998e609 [ncp] split ncp_base and rearrange declarations (#2045)
* split handlers into general, mtd, ftd and radio-only.
* move ChangedPropsSet into separate file.
* add Ncp namespace.
2017-08-03 10:19:07 -07:00
Łukasz Duda 134e23695c [api] expose Thread-specific link information structure (#2052) 2017-08-03 08:42:50 -07:00
Buke Po d4944ff373 [tests] add missing message type (#2053) 2017-08-02 21:49:55 -07:00
Jonathan Hui 713c709e04 [fuzz] add fuzz target for otIp6Send() (#2056) 2017-08-02 12:29:59 -07:00
Jonathan Hui 49c80937be [fuzz] fix otPlatRadioSetExtendedAddress in mock platform (#2051) 2017-08-01 11:36:00 -07:00
Buke Po 515519f7b6 [mac] enable radio layer before setting parameters (#2048)
This commit adjusts the order for calling radio layer API to make sure otPlatRadioEnable() is the first called to radio layer. This mainly addresses the issue of otInstance which is not provided when initializing radio layer.
2017-08-01 09:50:52 -07:00
Ciaran Woodward 6c9bba5445 [mac] Print warnings on failure, not success (#2049)
In Mac::RadioReceive, Mac::RadioTransmit and Mac::RadioSleep, the
SuccessOrExit macro was being used in a way which skipped printing
an error message upon failure, and printed it for OT_ERROR_NONE.
2017-08-01 08:37:11 -07:00
Buke Po 31b89311ba [spinel] support in place unpack. (#2025) 2017-07-31 14:54:59 -07:00
rongli 96c35b3f90 [ncp] update pass through filter rules (#2036) 2017-07-30 21:04:09 -07:00
Buke Po d009e77cd3 [mac] decouple mac frame from ip6 address (#2039) 2017-07-28 18:40:00 -07:00
Jonathan Hui a61e98ea0f [fuzz] bypass UDP checksum verification in fuzz tests (#2043) 2017-07-28 15:45:10 -07:00
Jonathan Hui 5d7a03334f [radio] unify around otExtAddress type (#2029) 2017-07-28 08:05:06 -07:00
Buke Po f77321ac9c [ncp] append ACK frame in reply of sending raw (#2016) 2017-07-27 21:50:22 -07:00
Jonathan Hui 0d356d11bd [lowpan] validate received fragment headers (#2038)
Credit to OSS-Fuzz.
2017-07-27 21:43:36 -07:00
Jonathan Hui 7a37d079d5 [tlvs] add additional length validation when reading tlvs (#2035) 2017-07-27 21:43:13 -07:00
Jonathan Hui 25759d3596 [mesh-forwarder] validate received fragment fits within message buf (#2034) 2017-07-27 13:40:07 -07:00
Abtin Keshavarzian a304692566 [mac] track and ensure single operation running at a time (#2024)
This commit contains different changes and enhancement to MAC
layer implementation.

It changes how the MAC layer maintains its operations. It is ensured
that only a single operation is active at a time.

An operation can be:
- active or energy scan,
- beacon or data frame transmission,
- waiting for data (after data poll ack with frame pending), or,
- idle operation (where radio is put in either rx or sleep mode).

Method `StartOperation()` starts an operation and `FinishOperation()`
is used to indicate when is is done. If there is an ongoing operation,
a subsequent call to `StartOperation()` ensures that the next
operation is marked as pending and gets started after the current one
is finished.

This commit also changes the `StartCsmaBackoff()` implementation such
that the radio is put in either receive or sleep mode depending on the
state `mRxOnWhenIdle` before starting the backoff timer. This ensures
that on a sleepy device the radio is put to sleep while backing off for
all transmission attempts including any MAC retries.

Another change added in this commit is to allow a received data frame
to be processed during an ongoing active/energy scan only if the
current scan channel matches the receive channel.

This commit also update `Mac::Frame` class by adding a new helper
method `IsDataRequestCommand()` to indicate if the frame is a MAC Data
Request command (data poll).
2017-07-27 13:06:25 -07:00
Abtin Keshavarzian ecebcbe2a2 [ncp] add IPV6_MULTICAST_ADDRESS_TABLE to unsolicited update capable list (#2033) 2017-07-27 12:05:30 -07:00
Martin Turon 94436b6f5f [nit] fix namespace closure comment (#2032) 2017-07-26 15:58:30 -07:00
Jonathan Hui 4996248e5a [fuzz] bypass MAC AES-CCM decryption and authentication in fuzz tests (#2031) 2017-07-26 12:15:21 -07:00
Jonathan Hui 3e6dbe7cef [mac] validate channel in Mac::SetChannel() (#2030) 2017-07-26 12:15:01 -07:00
Jonathan Hui f88c537c6c [udp] add cli-based example for UDP APIs (#2027) 2017-07-26 12:14:44 -07:00
Buke Po 4dc80ee357 [radio] remove deprecated transmit done api (#2020)
This commit removes the deprecated API otPlatRadioTransmitDone() to prevent new platforms using this API.

Some platforms still uses the deprecated API. This commit generates ACK frame according to the Frame Pending flag and the sent frame.

This commit does not define an API for generating ACK frame because the frame should not be generated by sender. Platforms not passing the received ACK frame should remove the code generating ACK frame soon.

This commit also fixes the build failures on the gp712 platform.
2017-07-26 09:11:46 -07:00
Abtin Keshavarzian fc72e4e719 [instance-locator] use instance reference instead of pointer (#2007)
This commit changes the `InstanceLocator` class to keep track of a
reference to `otInstance` (instead of a pointer) to make it behave
similar to other `ObjectLocator` classes. The method `GetInstance()`
in all locator objects is updated to provide a reference (instead
of a pointer) to `otInstance`.

The logging macros are updated such that a reference to `otInstance`
is passed as the first argument (with the exception of
`otLog<Level>Plat()` macros which are used by platform code in C
domain). The documentation for log macros are also updated.
2017-07-25 15:06:14 -07:00
Abtin Keshavarzian ea73c92151 [mac] Ensure to clear mDelaySleep flag after delaying sleep (#2023)
This commit fixes an issue related to the OpenThread feature
`OPENTHREAD_CONFIG_STAY_AWAKE_BETWEEN_FRAGMENTS` to  ensure that
`mDelaySleep` flag is cleared after timer starts so that sleep is
delayed only once.
2017-07-25 13:12:25 -07:00
Seth Rickard 6a1851106a [platform] support for Texas Instruments cc2652 (#2011)
* Add support for cc2652

Updated CC26XXware to latest release.
Moved CC26XXware to match the SimpleLink cc26x2 SDK directory structure.
Added CC2652 Platform support
2017-07-25 10:04:42 -07:00
Buke Po 1ff8824d18 [message] decouple message and ip6 (#2028) 2017-07-25 08:46:53 -07:00
Jonathan Hui 7ef2bcac03 [mle] remove assert in MleRouter::ResolveRoutingLoops() (#2022) 2017-07-23 22:02:30 -07:00
Jonathan Hui d200df368c [mle] validate received message length is >= header length (#2021)
Credit to OSS-Fuzz.
2017-07-23 22:01:57 -07:00
Buke Po ffd28ebd4d [crypto] reduce memcpy() usage (#2018) 2017-07-20 22:15:44 -07:00
Buke Po 2aa9830a07 [cli][posix] allow Ctrl-D to exit (#2017) 2017-07-20 22:13:49 -07:00
Jonathan Hui 791dd24d07 [fuzz] add support to build fuzzing targets (#2014)
This enables adding OpenThread to OSS-Fuzz.
2017-07-20 10:38:29 -07:00
Łukasz Duda 3c981ea415 [nrf52840] update platform's README.md (#2013) 2017-07-19 22:13:53 -07:00
Abtin Keshavarzian f4eb4a660a [mle] remove and add the multicast addresses when mesh-local prefix changes (#2012)
This commit changes how the link-local and the realm-local all-thread
multicast addresses are maintained. A change in mesh-local prefix
triggers a re-calculation of multicast addresses. When such a change
happens the old addresses are first removed/unsubscribed from the
interface and then the new ones are subscribed to. This ensures that
`OT_CHANGED_IP6_MULTICAST_(UN)SUBSRCRIBED` flags are set properly and
host/user is informed of the change of the multicast addresses.
2017-07-19 22:13:07 -07:00
Abtin Keshavarzian 08367625e5 [instance] check the instance to be valid in platform callbacks (#2005)
This commit adds a new API `otInstanceIsInitialized()` to check if a
given instance is valid, i.e, it has been initialized and not
finalized. We then use this function to verify that passed-in instance
argument in platform callbacks is valid.
2017-07-19 22:12:24 -07:00
Shu Chen 3883017fd8 [sniffer] add timestamp information to each captured radio frame (#1971)
Then sniffer devices could provide precise timestamp for each frame.

* The timestamp information is included in the metadata's PHY-specific data field of PROP_STREAM_RAW;

* nRf52840 supports microsecond accuracy timestamp;

* The other platforms support millisecond accuracy timestamp since they don't support microsecond timer for now.
2017-07-19 22:11:46 -07:00
Jonathan Hui 0193d6ce2e [mac] check frame length before reading security header (#2015) 2017-07-19 18:56:02 -07:00
Abtin Keshavarzian fa1041f705 [ncp-buffer] support for saving write position and overwriting content (#2010)
This commit adds new `InFrame` related methods to `NcpFrameBuffer` to
allow user to get/save current write position in an input frame being
written to the buffer. The saved position can later be used to
overwrite the previously added content (using `InFrameOverwrite()`) or
discard a portion of written data and move the write pointer back to
the saved position (using `InFrameReset()`).

The unit test for NCP buffer is also updated to add new test-cases
specific for the newly added methods.
2017-07-19 09:06:14 -07:00
JakubBrachTieto 4603e9907f [da15000] further fixes for Dialog DA15000 radio (#1965)
* Further fixes for Dialog DA15000 radio.

 - ACK Frame Handling improved - race condition resolved
 - anti-collision mechanism enabled in HW (Fix for 5.8.4 cert. test)
 - filtering out broken frame.
 - Frame type detection improved
 -  Radio power cycling improved
 - "Alive" blink functionality added
2017-07-19 09:04:05 -07:00
Abtin Keshavarzian 9839e9702b [ncp] enhance unsolicited property/status updates (#1993)
This commit implements a new model for keeping track of unsolicited
property updates and how asynchronous `VALUE_IS` spinel frames are
emitted from NCP.  It also implements a mechanism for host to block
updates from certain filterable properties. The behavior can be
controlled through spinel properties `UNSOL_UPDATE_FILTER` and
`UNSOL_UPDATE_LIST` (tied to capability `CAP_UNSOL_UPDATE_FILTER`).

The new model is then used to track dropped IPv6 messages, end of
scan, change in jamming state, and a newly added STATUS_NOMEM report
in case of no NCP buffer space for log messages.
2017-07-18 14:13:56 -07:00
Buke Po cb463add61 [dns] remove functional code from assert() (#2009) 2017-07-18 09:03:36 -07:00
Jonathan Hui 702ec2551f [aes-ccm] add lower-bound check for tag length (#2008) 2017-07-18 08:32:36 -07:00
Abtin Keshavarzian 5ba896266c [ncp] Support for multicast address table (#2001)
This commit adds a new spinel property (along with its prop handlers)
`SPINEL_PROP_IPV6_MULTICAST_ADDRESS_TABLE` to provide the list of
multicast IPv6 addresses.

It also adds `OT_CHANGED_IP6_MULTICAST_SUBSRCRIBED` and
`OT_CHANGED_IP6_MULTICAST_UNSUBSRCRIBED` to flags used in
`NetifCallback` to indicate changes in multicast address list.
2017-07-17 20:58:56 -07:00
Abtin Keshavarzian fdc3ea2732 [test-link-quality] Add check for GetLastRss() in link quality unit test (#2006) 2017-07-17 20:49:44 -07:00
2583 changed files with 680383 additions and 135414 deletions
+1 -1
View File
@@ -42,13 +42,13 @@ REM Copy the relavant include headers
copy include\openthread\commissioner.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\ip6.h release\include\openthread
copy include\openthread\joiner.h release\include\openthread
copy include\openthread\link.h release\include\openthread
copy include\openthread\message.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\types.h release\include\openthread
copy include\openthread\platform\toolchain.h release\include\openthread\platform
-16
View File
@@ -1,16 +0,0 @@
--style=allman
--max-code-length=120
--max-instatement-indent=100
--attach-namespaces --attach-inlines
--attach-extern-c
--min-conditional-indent=0
--break-blocks
--pad-oper
--pad-header
--unpad-paren
--align-pointer=name
--add-brackets
--keep-one-line-blocks
--convert-tabs
--break-after-logical
--formatted
+112
View File
@@ -0,0 +1,112 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
BeforeCatch: false
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<openthread/.*/'
Priority: 4
- Regex: '^<openthread/'
Priority: 3
- Regex: '^<'
Priority: 2
- Regex: '^".*/'
Priority: 5
- Regex: '^"'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
...
+8 -6
View File
@@ -1,8 +1,10 @@
coverage:
ignore:
- "tests/*"
- "third_party/*"
status:
project: false
patch: false
project: off
patch: off
ignore:
- "tests/*"
- "third_party/*"
comment: off
+2 -6
View File
@@ -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:
* [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
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
+24
View File
@@ -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.
+17
View File
@@ -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.
+13
View File
@@ -1,4 +1,5 @@
*.a
*.bak
*.db
*.gcda
*.gcno
@@ -12,6 +13,7 @@
*.suo
*.trs
*.user
*.bak
*~
.deps
.dirstamp
@@ -31,9 +33,20 @@ etc/visual-studio/BundleArtifacts
etc/visual-studio/Generated Files
include/openthread-config.h
include/openthread-config.h.in
include/openthread-config-generic.h
include/openthread-config-generic.h.in
include/stamp-h1
ipch
libtool
Makefile
Makefile.in
output
third_party/nlbuild-autotools/repo/third_party/autoconf/compile
third_party/nlbuild-autotools/repo/third_party/autoconf/depcomp
third_party/nlbuild-autotools/repo/third_party/autoconf/ltmain.sh
third_party/nlbuild-autotools/repo/third_party/autoconf/m4/libtool.m4
third_party/nlbuild-autotools/repo/third_party/autoconf/m4/ltoptions.m4
third_party/nlbuild-autotools/repo/third_party/autoconf/m4/ltsugar.m4
third_party/nlbuild-autotools/repo/third_party/autoconf/m4/ltversion.m4
third_party/nlbuild-autotools/repo/third_party/autoconf/m4/lt~obsolete.m4
third_party/nlbuild-autotools/repo/third_party/autoconf/missing
+88 -15
View File
@@ -26,7 +26,8 @@
# POSSIBILITY OF SUCH DAMAGE.
#
language: generic
language: python
python: "3.6"
sudo: required
dist: trusty
@@ -34,6 +35,11 @@ dist: trusty
before_install:
- .travis/before_install.sh
before_script:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
fi
script:
- .travis/script.sh
@@ -42,35 +48,75 @@ after_success:
matrix:
include:
- env: BUILD_TARGET="posix-distcheck" VERBOSE=1
os: linux
compiler: clang
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1
- env: BUILD_TARGET="posix-app-cli" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
- env: BUILD_TARGET="posix-ncp" VERBOSE=1
- 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
addons:
apt:
sources:
- llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
python: "2.7"
- env: BUILD_TARGET="posix-ncp" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
- env: BUILD_TARGET="posix-mtd" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
- env: BUILD_TARGET="pretty-check"
os: linux
- env: BUILD_TARGET="scan-build" CC="clang" CXX="clang++"
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
- env: BUILD_TARGET="scan-build" CC="clang-6.0" CXX="clang++-6.0"
os: linux
compiler: clang
- env: BUILD_TARGET="arm-gcc49"
addons:
apt:
sources:
- llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0
- env: BUILD_TARGET="arm-gcc-4"
os: linux
compiler: gcc
- env: BUILD_TARGET="arm-gcc54"
- env: BUILD_TARGET="arm-gcc-5"
os: linux
compiler: gcc
- env: BUILD_TARGET="arm-gcc63"
- env: BUILD_TARGET="arm-gcc-6"
os: linux
compiler: gcc
- env: BUILD_TARGET="posix" CC="clang" CXX="clang++"
os: linux
compiler: clang
- env: BUILD_TARGET="posix" CC="gcc" CXX="g++"
- env: BUILD_TARGET="arm-gcc-7"
os: linux
compiler: gcc
- env: BUILD_TARGET="posix" CC=clang-6.0 CXX=clang++-6.0
os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0
- env: BUILD_TARGET="posix" CC="gcc-5" CXX="g++-5"
os: linux
compiler: gcc
@@ -91,6 +137,33 @@ matrix:
packages:
- gcc-6
- g++-6
- env: BUILD_TARGET="posix" CC="gcc-7" CXX="g++-7"
os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-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
os: linux
compiler: gcc
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1
os: linux
compiler: gcc
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1 TORANJ_POSIX_APP_RCP_MODEL=1
os: linux
compiler: gcc
python: "2.7"
+81 -17
View File
@@ -39,30 +39,60 @@ cd /tmp || die
[ $TRAVIS_OS_NAME != linux ] || {
sudo apt-get update || die
[ $BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -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 --upgrade pip || die
pip install --user -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
[ $BUILD_TARGET != posix-ncp ] || {
pip install -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
[ $BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ] || {
# 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 ] || {
wget http://jaist.dl.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz || die
tar xzvf astyle_2.05.1_linux.tar.gz || die
cd astyle/build/gcc || die
LDFLAGS=" " make || die
cd ../../..
export PATH=/tmp/astyle/build/gcc/bin:$PATH || die
astyle --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 ] || {
sudo apt-get install clang || die
}
[ $BUILD_TARGET != arm-gcc49 ] || {
[ $BUILD_TARGET != arm-gcc-4 ] || {
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
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
@@ -70,22 +100,34 @@ cd /tmp || die
arm-none-eabi-gcc --version || die
}
[ $BUILD_TARGET != arm-gcc54 ] || {
[ $BUILD_TARGET != arm-gcc-5 ] || {
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
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
arm-none-eabi-gcc --version || die
}
[ $BUILD_TARGET != arm-gcc63 ] || {
[ $BUILD_TARGET != arm-gcc-6 ] || {
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
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
arm-none-eabi-gcc --version || die
wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2017.03-rc2/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install.tar.gz || die
tar xzf arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install.tar.gz
export PATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/bin:$PATH || die
arc-elf32-gcc --version || die
}
[ $BUILD_TARGET != posix-32-bit ] || {
[ $BUILD_TARGET != arm-gcc-7 ] || {
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
arm-none-eabi-gcc --version || die
}
[ $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-mtd ] || {
sudo apt-get install g++-multilib || die
}
@@ -94,9 +136,31 @@ cd /tmp || 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
}
[ $BUILD_TARGET != toranj-test-framework ] || {
# packages for wpantund
sudo apt-get install dbus || die
sudo apt-get install gcc g++ libdbus-1-dev || die
sudo apt-get install autoconf-archive || die
sudo apt-get install bsdtar || die
sudo apt-get install libtool || die
sudo apt-get install libglib2.0-dev || die
sudo apt-get install libboost-dev || die
sudo apt-get install libboost-signals-dev || die
# clone and build wpantund
git clone --depth=1 --branch=master https://github.com/openthread/wpantund.git
cd wpantund || die
./bootstrap.sh || die
./configure || die
sudo make -j 8 || die
sudo make install || die
cd .. || die
}
}
[ $TRAVIS_OS_NAME != osx ] || {
+107
View File
@@ -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 "$@"
+115
View File
@@ -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 "$@"
+327 -11
View File
@@ -34,8 +34,9 @@ die() {
set -x
python --version || die
[ $BUILD_TARGET != pretty-check ] || {
export PATH=/tmp/astyle/build/gcc/bin:$PATH || die
./bootstrap || die
./configure || die
make pretty-check || die
@@ -43,13 +44,17 @@ set -x
[ $BUILD_TARGET != scan-build ] || {
./bootstrap || die
# avoids "third_party/mbedtls/repo/library/ssl_srv.c:2904:9: warning: Value stored to 'p' is never read"
export CPPFLAGS=-DMBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
scan-build ./configure \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--with-examples=posix \
--with-platform-info=POSIX \
--enable-application-coap \
--enable-application-coap-secure \
--enable-border-router \
--enable-cert-log \
--enable-child-supervision \
@@ -64,11 +69,16 @@ set -x
--enable-mac-filter \
--enable-mtd-network-diagnostic \
--enable-raw-link-api \
--enable-service \
--enable-tmf-proxy || 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
git checkout -- . || die
@@ -101,11 +111,21 @@ set -x
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-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-mtd || 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-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 clean -xfd || die
@@ -113,9 +133,30 @@ set -x
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || 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-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || 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
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || 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-mtd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || 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
git checkout -- . || die
@@ -148,11 +189,21 @@ set -x
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-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-mtd || 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-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 clean -xfd || die
@@ -160,9 +211,106 @@ set -x
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || 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-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || 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
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || 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-mtd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || 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
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-cc2538 || die
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || 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-da15000 || 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-ncp-ftd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || 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-kw41z || die
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || 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 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-mtd || 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-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 clean -xfd || die
./bootstrap || die
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || 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-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || 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
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || 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-mtd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
export PATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/bin:$PATH || die
git checkout -- . || die
@@ -175,16 +323,155 @@ set -x
arc-elf32-size output/emsk/bin/ot-ncp-mtd || die
}
[ $BUILD_TARGET != arm-gcc-7 ] || {
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || 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-cc2538 || die
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || 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-da15000 || 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-ncp-ftd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || 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-kw41z || die
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || 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 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-mtd || 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-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 clean -xfd || die
./bootstrap || die
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || 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-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
# git checkout -- . || die
# git clean -xfd || 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
# mv xdk-asf-3.36.0 third_party/microchip/asf || die
# ./bootstrap || 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-mtd || die
# arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
# arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
}
[ $BUILD_TARGET != posix ] || {
sh -c '$CC --version' || die
sh -c '$CXX --version' || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-posix || die
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_NONE make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--with-ncp-bus=spi \
--with-examples=posix \
--enable-border-router \
--enable-child-supervision \
--enable-diag \
--enable-jam-detection \
--enable-legacy \
--enable-mac-filter \
--enable-service \
--enable-channel-manager \
--enable-channel-monitor \
--disable-docs \
--disable-tests || die
make -j 8 || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-mtd \
--with-ncp-bus=spi \
--with-examples=posix \
--enable-border-router \
--enable-child-supervision \
--enable-legacy \
--enable-mac-filter \
--enable-service \
--disable-docs \
--disable-tests || die
make -j 8 || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--enable-radio-only \
--with-ncp-bus=uart \
--with-examples=posix || die
make -j 8 || die
}
[ $BUILD_TARGET != posix-distcheck ] || {
export ASAN_SYMBOLIZER_PATH=`which llvm-symbolizer-3.4` || die
export ASAN_SYMBOLIZER_PATH=`which llvm-symbolizer-5.0` || die
export ASAN_OPTIONS=symbolize=1 || die
export DISTCHECK_CONFIGURE_FLAGS= CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1 || die
./bootstrap || die
make -f examples/Makefile-posix distcheck || die
}
@@ -194,12 +481,41 @@ set -x
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 ] || {
./bootstrap || die
COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
}
[ $BUILD_TARGET != posix-ncp-spi ] || {
./bootstrap || die
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp-app=ftd --with-ncp-bus=spi --with-examples=posix --with-platform-info=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 ] || {
./bootstrap || die
COVERAGE=1 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 ] || {
./tests/toranj/start.sh
}
+301
View File
@@ -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)
+3 -4
View File
@@ -104,7 +104,7 @@ Now, it may be desirable to squash some of your smaller commits down into a smal
```bash
# Rebase all commits on your development branch
git checkout
git checkout
git rebase -i master
```
@@ -112,15 +112,14 @@ This will open up a text editor where you can specify which commits to squash.
#### Coding Conventions and Style
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party).
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party). Use the `make pretty` and `make pretty-check` targets to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1) for `make pretty` and `make pretty-check`.
As part of the cleanup process, you should also run `make pretty-check` to ensure that your code passes the baseline code style checks.
```bash
./bootstrap
./configure --enable-ftd --enable-cli --enable-diag --enable-dhcp6-client --enable-dhcp6-server --enable-commissioner --enable-joiner --with-examples=posix
./configure
make pretty-check
```
Make sure to include any code format changes in your commits.
+14 -11
View File
@@ -32,25 +32,30 @@ AM_MAKEFLAGS = --no-print-directory
AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-address-sanitizer \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--enable-diag \
--with-examples=posix \
--enable-application-coap \
--enable-application-coap-secure \
--enable-border-router \
--enable-cli \
--enable-commissioner \
--enable-joiner \
--enable-dhcp6-client \
--enable-dhcp6-server \
--enable-diag \
--enable-dns-client \
--enable-application-coap \
--enable-border-router \
--enable-ftd \
--enable-joiner \
--enable-mac-filter \
--enable-mtd \
--enable-ncp \
--with-ncp-bus=uart \
--enable-radio-only \
--enable-service \
--with-examples=posix \
$(NULL)
SUBDIRS = \
include \
src \
third_party \
src \
examples \
tests \
tools \
@@ -58,8 +63,6 @@ SUBDIRS = \
$(NULL)
EXTRA_DIST = \
.astyle/astyle-opts \
.astyle/astyle-wrap.sh \
.default-version \
bootstrap \
etc \
+4 -4
View File
@@ -1,5 +1,5 @@
OpenThread is an open source implementation of the Thread 1.0.1 Final Specification.
The Thread 1.0.1 Final Specification is promulgated by the Thread Group. The Thread
OpenThread is an open source implementation of the Thread 1.1.1 Final Specification.
The Thread 1.1.1 Final Specification is promulgated by the Thread Group. The Thread
Group is a non-profit organization formed for the purposes of defining one or
more specifications, best practices, reference architectures, implementation
guidelines and certification programs to promote the availability of compliant
@@ -7,10 +7,10 @@ implementations of the Thread protocol. Information on becoming a Member, includ
information about the benefits thereof, can be found at http://threadgroup.org.
OpenThread is not affiliated with or endorsed by the Thread Group. Implementation
of this OpenThread code does not assure compliance with the Thread 1.0.1 Final
of this OpenThread code does not assure compliance with the Thread 1.1.1 Final
Specification and does not convey the right to identify any final product as Thread
certified. Members of the Thread Group may hold patents and other intellectual
property rights relating to the Thread 1.0.1 Final Specification, ownership and
property rights relating to the Thread 1.1.1 Final Specification, ownership and
licenses of which are subject to the Thread Groups IP Policies, and not this license.
The included copyright to the OpenThread code is subject to the license in the
+31 -138
View File
@@ -1,11 +1,11 @@
[![OpenThread][ot-logo]][ot-repo]
[![OpenThread][ot-logo]][ot-repo]
[![Build Status][ot-travis-svg]][ot-travis]
[![Build Status][ot-appveyor-svg]][ot-appveyor]
[![Coverage Status][ot-codecov-svg]][ot-codecov]
---
# What is OpenThread?
# What is OpenThread?
OpenThread is...
<a href="http://threadgroup.org/technology/ourtechnology#certifiedproducts">
@@ -14,11 +14,11 @@ OpenThread is...
**...an open-source implementation of the [Thread](http://threadgroup.org/technology/ourtechnology) networking protocol.** Nest has released OpenThread to make the technology used in Nest products more broadly available to developers to accelerate the development of products for the connected home.
**...OS and platform agnostic**, with a narrow platform abstraction layer and a small memory footprint, making it highly portable.
**...OS and platform agnostic**, with a narrow platform abstraction layer and a small memory footprint, making it highly portable. It supports both system-on-chip (SoC) and network co-processor (NCP) designs.
**...a Thread Certified Component**, implementing all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications). This specification defines an IPv6-based reliable, secure and low-power wireless device-to-device communication protocol for home applications.
**...a Thread Certified Component**, implementing all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications), including all Thread networking layers (IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, Mesh Routing) and device roles, as well as [Border Router](https://github.com/openthread/borderrouter) support.
More information about Thread can be found on [threadgroup.org](http://threadgroup.org/).
More information about Thread can be found at [threadgroup.org](http://threadgroup.org/). Thread is a registered trademark of the Thread Group, Inc.
[thread]: http://threadgroup.org/technology/ourtechnology
[ot-repo]: https://github.com/openthread/openthread
@@ -30,149 +30,32 @@ More information about Thread can be found on [threadgroup.org](http://threadgro
[ot-codecov]: https://codecov.io/gh/openthread/openthread
[ot-codecov-svg]: https://codecov.io/gh/openthread/openthread/branch/master/graph/badge.svg
# Get started with OpenThread
<a href="https://codelabs.developers.google.com/codelabs/openthread-simulation/index.html">
<img src="doc/images/ot-codelab.png" alt="OpenThread Codelab" width="300px" align="right">
</a>
Want to try OpenThread? The quickest way to get started is to run through our [Simulation Codelab](https://codelabs.developers.google.com/codelabs/openthread-simulation/index.html), which covers all the basics, without the need for test hardware. Using VirtualBox and Vagrant on a Mac or Linux machine, you will learn:
* How to set up the OpenThread build toolchain
* How to simulate a Thread network
* How to authenticate Thread nodes with Commissioning
* How to use `wpantund` to manage a simulated Thread network featuring an NCP
### Next Steps
The Codelab shows you how easy it is use to OpenThread to simulate a Thread network. Once complete:
1. Learn more about the [OpenThread architecture and features](#openthread-features)
1. Get familiar with [platforms and devices that support OpenThread](#who-supports-openthread)
1. See what [testing tools](#what-tools-are-available-for-testing) are available
1. Learn [where to get help](#need-help) and [how to contribute](#want-to-contribute) to the ongoing development of OpenThread
# OpenThread Features
OpenThread implements all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications), including all Thread networking layers (IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, Mesh Routing) and device roles, as well as [Border Router](https://github.com/openthread/borderrouter) support.
OpenThread supports both system-on-chip (SoC) and network co-processor (NCP) designs. Other features and enhancements include:
* Application support and services
* IPv6 configuration and raw data interface
* UDP sockets
* CoAP client and server
* DHCPv6 client and server
* DNSv6 client
* Command Line Interface (CLI)
* NCP support
* Spinel - general purpose NCP protocol
* `wpantund` - user-space NCP network interface driver/daemon
* Sniffer support via NCP Spinel nodes
* Border Router
* Web UI for configuration and management
* Thread Border Agent to support an External Commissioner
* NAT64 for connecting to IPv4 networks
* Thread interface driver using `wpantund`
### What's coming?
The development of OpenThread is ongoing to provide additional features not available in the standard. Check back regularly for new updates, or visit the [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) Google Group.
# Who supports OpenThread?
Led by Nest, the following companies are contributing to the ongoing development of OpenThread:
<a href="https://www.arm.com/"><img src="doc/images/ot-contrib-arm.png" alt="ARM" width="200px"></a><a href="http://www.atmel.com/"><img src="doc/images/ot-contrib-atmel.png" alt="Atmel" width="200px"></a><a href="http://www.dialog-semiconductor.com/"><img src="doc/images/ot-contrib-dialog.png" alt="Dialog" width="200px"></a><a href="https://www.microsoft.com/en-us/"><img src="doc/images/ot-contrib-ms.png" alt="Microsoft" width="200px"></a><a href="https://nest.com/"><img src="doc/images/ot-contrib-nest.png" alt="Nest" width="200px"></a><a href="http://www.nordicsemi.com/"><img src="doc/images/ot-contrib-nordic.png" alt="Nordic" width="200px"></a><a href="http://www.nxp.com/"><img src="doc/images/ot-contrib-nxp.png" alt="NXP" width="200px"></a><a href="https://www.qorvo.com/"><img src="doc/images/ot-contrib-qorvo.png" alt="Qorvo" width="200px"></a><a href="https://www.qualcomm.com/"><img src="doc/images/ot-contrib-qc.png" alt="Qualcomm" width="200px"></a><a href="https://www.synopsys.com/"><img src="doc/images/ot-contrib-synopsys.png" alt="Synopsys" width="200px"></a><a href="https://www.ti.com/"><img src="doc/images/ot-contrib-ti.png" alt="Texas Instruments" width="200px"></a>
<a href="https://developer.android.com/things/index.html"><img src="doc/images/ot-contrib-at.png" alt="Android Things" width="200px"></a><a href="https://www.arm.com/"><img src="doc/images/ot-contrib-arm.png" alt="ARM" width="200px"></a><a href="http://www.dialog-semiconductor.com/"><img src="doc/images/ot-contrib-dialog.png" alt="Dialog" width="200px"></a><a href="https://www.microsoft.com/en-us/"><img src="doc/images/ot-contrib-ms.png" alt="Microsoft" width="200px"></a><br /><a href="https://nest.com/"><img src="doc/images/ot-contrib-nest.png" alt="Nest" width="200px"></a><a href="http://www.nordicsemi.com/"><img src="doc/images/ot-contrib-nordic.png" alt="Nordic" width="200px"></a><a href="http://www.nxp.com/"><img src="doc/images/ot-contrib-nxp.png" alt="NXP" width="200px"></a><a href="http://www.qorvo.com/"><img src="doc/images/ot-contrib-qorvo.png" alt="Qorvo" width="200px"></a><br /><a href="https://www.qualcomm.com/"><img src="doc/images/ot-contrib-qc.png" alt="Qualcomm" width="200px"></a><a href="https://www.synopsys.com/"><img src="doc/images/ot-contrib-synopsys.png" alt="Synopsys" width="200px"></a><a href="https://www.ti.com/"><img src="doc/images/ot-contrib-ti.png" alt="Texas Instruments" width="200px"></a><a href="https://www.zephyrproject.org/"><img src="doc/images/ot-contrib-zephyr.png" alt="Zephyr Project" width="200px"></a>
OpenThread has been ported to several devices and platforms by both the OpenThread team and the community. Build examples for all supported platforms are included in the OpenThread project.
# Getting started
### IEEE 802.15.4 Platform Support
All end-user documentation and guides are located at [openthread.io](https://openthread.io). If you're looking to do things like...
* [Dialog Semiconductor DA15000](https://github.com/openthread/openthread/wiki/Platforms#dialog-da15000)
* [Nordic Semiconductor nRF52840](https://github.com/openthread/openthread/wiki/Platforms#nordic-semiconductor-nrf52840)
* [NXP KW41Z](https://github.com/openthread/openthread/wiki/Platforms#nxp-kw41z)
* [Qorvo GP712](https://github.com/openthread/openthread/wiki/Platforms#qorvo-gp712)
* [Silicon Labs EFR32](https://github.com/openthread/openthread/wiki/Platforms#silicon-labs-efr32)
* [Synopsys ARC EMSK with Microchip MRF24J40](https://github.com/openthread/openthread/wiki/Platforms#synopsys-arc-em-with-microchip-mrf24j40)
* [Texas Instruments CC2538](https://github.com/openthread/openthread/wiki/Platforms#texas-instruments-cc2538)
* [Texas Instruments CC2650](https://github.com/openthread/openthread/wiki/Platforms#texas-instruments-cc2650)
* [POSIX Emulation](https://github.com/openthread/openthread/wiki/Platforms#posix-emulation)
* Learn more about OpenThread features and enhancements
* Use OpenThread in your products
* Learn how to build and configure a Thread network
* Port OpenThread to a new platform
* Build an application on top of OpenThread
* Certify a product using OpenThread
See the [Wiki Platform page](https://github.com/openthread/openthread/wiki/Platforms) for more detailed information on supported platforms.
...then [openthread.io](https://openthread.io) is the place for you.
### Desktop Support
If you're interested in contributing to OpenThread, read on.
Desktop platforms can also be used to control and interface with a Thread network using OpenThread:
# Contributing
* **Unix** — [`wpantund`](https://github.com/openthread/wpantund) provides an interface to an NCP
* **Windows 10** — [universal drivers](https://github.com/openthread/openthread/wiki/OpenThread-on%C2%A0Windows) to interface with devices running OpenThread
We would love for you to contribute to OpenThread and help make it even better than it is today! See our [Contributing Guidelines](https://github.com/openthread/openthread/blob/master/CONTRIBUTING.md) for more information.
### Porting
If you are interested in porting OpenThread to a new platform, see the [Porting Guide](https://github.com/openthread/openthread/wiki/Porting-Guide) for hardware requirements and detailed porting instructions.
### Border Router
A Border Router connects a Thread network to networks at different layers, such as WiFi or Ethernet. [OpenThread Border Router](https://github.com/openthread/borderrouter) provides end-to-end IP via routing between Thread devices and other external IP networks, as well as external Thread Commissioning.
# What tools are available for testing?
### Certification Testing
Certification testing is done with the [GRL Thread Test Harness software](http://graniteriverlabs.com/thread/), available for download to Thread member companies.
Additional tools that extend the Test Harness are included in the OpenThread project:
* [Thread Harness Automation](https://github.com/openthread/openthread/tree/master/tools/harness-automation) — automates the Thread Test Harness software
* [Thread Harness THCI for OpenThread](https://github.com/openthread/openthread/tree/master/tools/harness-thci) — allows the Thread Test Harness to control OpenThread-based reference devices directly
* CC2538 example included in the GRL Thread Test Hardness software
* Library version can be modified by developers for use on other platforms
### Sniffer
OpenThread also provides a [sniffer](https://github.com/openthread/openthread/blob/master/tools/spinel-cli/SNIFFER.md) on the NCP build. The sniffer is exposed by the Spinel protocol and features:
* Monitor mode — capture packets during operation
* Promiscuous mode — dedicated sniffer
* Host-side support — `wpantund`
* pcap stream output
# Need help?
### Wiki
Explore the [OpenThread Wiki](https://github.com/openthread/openthread/wiki) for more in-depth documentation on building, testing, automation and tools.
### Interact
There are numerous avenues for OpenThread support:
* Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
* Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
* Google Groups — discussion and announcements
* [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) — 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
### Directory Structure
The OpenThread repository is structured as follows:
Folder | Contents
--------------|----------------------------------------------------------------
`doc` | Spinel docs and Doxygen build file
`etc` | Configuration files for other build systems (e.g. Visual Studio)
`examples` | Sample applications and platforms demonstrating OpenThread
`include` | Public API header files
`src` | Core implementation of the Thread standard and related add-ons
`tests` | Unit and Thread conformance tests
`third_party` | Third-party code used by OpenThread
`tools` | Helpful utilities related to the OpenThread project
# Want to contribute?
We would love for you to contribute to OpenThread and help make it even better than it is today! See the [`CONTRIBUTING.md`](https://github.com/openthread/openthread/blob/master/CONTRIBUTING.md) file for more information.
Contributors are required to abide by our [Code of Conduct](https://github.com/openthread/openthread/blob/master/CODE_OF_CONDUCT.md) and [Coding Conventions and Style Guide](https://github.com/openthread/openthread/blob/master/STYLE_GUIDE.md).
# Versioning
@@ -180,6 +63,16 @@ OpenThread follows the [Semantic Versioning guidelines](http://semver.org/) for
# License
OpenThread is released under the [BSD 3-Clause license](https://github.com/openthread/openthread/blob/master/LICENSE). See the [`LICENSE`](https://github.com/openthread/openthread/blob/master/LICENSE) file for more information.
OpenThread is released under the [BSD 3-Clause license](https://github.com/openthread/openthread/blob/master/LICENSE). See the [`LICENSE`](https://github.com/openthread/openthread/blob/master/LICENSE) file for more information.
Please only use the OpenThread name and marks when accurately referencing this software distribution. Do not use the marks in a way that suggests you are endorsed by or otherwise affiliated with Nest, Google, or The Thread Group.
# Need help?
There are numerous avenues for OpenThread support:
* Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
* Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
* Google Groups — [discussion and announcements at openthread-users](https://groups.google.com/forum/#!forum/openthread-users)
The openthread-users Google Group is the recommended place for users to discuss OpenThread and interact directly with the OpenThread team.
+7 -2
View File
@@ -43,7 +43,10 @@
- Preprocessor `#include` directives shall use brace (“<”) and (“>”) style for all public headers, including C and C++ standard library, or other first- and third-party public library headers.
- Preprocessor `#include` directives should use double quote (‘“‘) and (‘“‘) style for all private or relative headers.
- Preprocessor `#include` directives should be grouped, ordered, or sorted as follows:
- This compilation unit's corresponding header, if any.
- If the unit is a core/private header file, `"openthread-core-config.h"` should be the first header file included.
- If the unit is a core/private `.c` or `.cpp` file:
- If the unit has a corresponding header file, the unit's corresponding header file should be included before any other header file.
- If the unit has no corresponding header file, then it should directly include `"openthread-core-config.h"` before any other header file.
- C++ Standard Library headers
- C Standard Library headers
- Third-party library headers
@@ -111,6 +114,8 @@
- OpenThread uses the `make pretty` build target to reformat code and enforce code format and style. The `make pretty-check` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
- The `make pretty` and `make pretty-check` build targets require [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1).
### File Names
- File names should match the names and types of what is described in the file. If a file contains many declarations and definitions, the author should choose the one that predominantly describes or that makes the most sense.
- File contents and names should be limited in the scope of what they contain. It may also be possible that there is too much stuff in one file and you need to break it up into multiple files.
@@ -171,7 +176,7 @@
## Standards
- OpenThread uses and enfores both Python 2 and Python 3. Support for Python 2 is a result of the fact that some current Linux distributions and Macs are still using 2.x as default.
- OpenThread uses and enforces both Python 2 and Python 3. Support for Python 2 is a result of the fact that some current Linux distributions and Macs are still using 2.x as default.
## Conventions and Best Practices
+612 -225
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -1998,7 +1998,8 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH = @abs_top_srcdir@/include
INCLUDE_PATH = @abs_top_srcdir@/include \
@abs_top_builddir@/include
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
+11 -1
View File
@@ -32,8 +32,18 @@ EXTRA_DIST = \
$(srcdir)/Doxyfile.in \
$(srcdir)/header.html \
$(srcdir)/images/Open-Thread-Logo-200x42.png \
$(srcdir)/images/openthread_contrib.png \
$(srcdir)/images/openthread_logo.png \
$(srcdir)/images/ot-contrib-arm.png \
$(srcdir)/images/ot-contrib-at.png \
$(srcdir)/images/ot-contrib-dialog.png \
$(srcdir)/images/ot-contrib-ms.png \
$(srcdir)/images/ot-contrib-nest.png \
$(srcdir)/images/ot-contrib-nordic.png \
$(srcdir)/images/ot-contrib-nxp.png \
$(srcdir)/images/ot-contrib-qc.png \
$(srcdir)/images/ot-contrib-qorvo.png \
$(srcdir)/images/ot-contrib-synopsys.png \
$(srcdir)/images/ot-contrib-ti.png \
draft-rquattle-spinel-unified.html \
draft-rquattle-spinel-unified.txt \
$(NULL)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 21 KiB

@@ -42,6 +42,8 @@ Char | Name | Description
`s` | DATATYPE_INT16 | Signed 16-bit integer.
`L` | DATATYPE_UINT32 | Unsigned 32-bit integer.
`l` | DATATYPE_INT32 | Signed 32-bit integer.
`X` | DATATYPE_UINT64 | Unsigned 64-bit integer.
`x` | DATATYPE_INT64 | Signed 64-bit integer.
`i` | DATATYPE_UINT_PACKED | Packed Unsigned Integer. See (#packed-unsigned-integer).
`6` | DATATYPE_IPv6ADDR | IPv6 Address. (Big-endian)
`E` | DATATYPE_EUI64 | EUI-64 Address. (Big-endian)
@@ -0,0 +1,67 @@
# Feature: Channel Monitoring {#feature-channel-monitor}
Channel monitoring is a feature that allows the NCP to periodically
monitor all channels to help determine the cleaner channels (channels
with less interference).
The presence of this feature can be detected by checking for the
presence of the `CAP_CHANNEL_MONITOR` capability in `PROP_CAPS`.
## Properties
### PROP 4614: SPINEL_PROP_CHANNEL_MONITOR_SAMPLE_INTERVAL (#prop-channel-monitor-sample-interval)
* Type: Read-Only
* Packing-Encoding: `L`
If channel monitoring is enabled and active, every sample interval, a
zero-duration Energy Scan is performed, collecting a single RSSI sample
per channel. The RSSI samples are compared with a pre-specified RSSI
threshold.
### PROP 4615: SPINEL_PROP_CHANNEL_MONITOR_RSSI_THRESHOLD (#prop-channel-monitor-rssi-threshold)
* Type: Read-Only
* Packing-Encoding: `c`
This value specifies the threshold used by channel monitoring
module. Channel monitoring maintains the average rate of RSSI
samples that are above the threshold within (approximately) a
pre-specified number of samples (sample window).
### PROP 4616: SPINEL_PROP_CHANNEL_MONITOR_SAMPLE_WINDOW (#prop-channel-monitor-sample-window)
* Type: Read-Only
* Packing-Encoding: `L`
The averaging sample window length (in units of number of channel
samples) used by channel monitoring module. Channel monitoring will
sample all channels every sample interval. It maintains the average rate
of RSSI samples that are above the RSSI threshold within (approximately)
the sample window.
### PROP 4617: SPINEL_PROP_CHANNEL_MONITOR_SAMPLE_COUNT (#prop-channel-monitor-sample-count)
* Type: Read-Only
* Packing-Encoding: `L`
Total number of RSSI samples (per channel) taken by the channel
monitoring module since its start (since Thread network interface
was enabled).
### PROP 4618: SPINEL_PROP_CHANNEL_MONITOR_CHANNEL_OCCUPANCY (#prop-channel-monitor-channel-occupancy)
* Type: Read-Only
* Packing-Encoding: `A(t(cU))`
Data per item is:
* `C`: Channel
* `U`: Channel occupancy indicator
The channel occupancy value represents the average rate/percentage of
RSSI samples that were above RSSI threshold ("bad" RSSI samples) within
(approximately) latest sample window RSSI samples.
Max value of `0xffff` indicates all RSSI samples were above RSSI
threshold (i.e. 100% of samples were "bad").
@@ -85,7 +85,7 @@ is larger than `PROP_JAM_DETECT_WINDOW` is undefined.
### PROP 4613: PROP_JAM_DETECT_HISTORY_BITMAP
* Type: Read-Only
* Packed-Encoding: `LL`
* Packed-Encoding: `X`
* Default Value: Implementation-specific
* RECOMMENDED for `CAP_JAM_DETECT`
@@ -95,6 +95,3 @@ each bit corresponds to one second interval starting with bit 0 for the
most recent interval and bit 63 for the oldest intervals (63 sec earlier).
The bit is set to 1 if the jamming detection module observed/detected
high signal level during the corresponding one second interval.
The value is read-only and is encoded as two `L` (uint32) values in
little-endian format (first `L` (uint32) value gives the lower bits
corresponding to more recent history).
+49 -9
View File
@@ -141,6 +141,7 @@ Currently defined values are:
* 10: `CAP_TRNG`: Support for true random number generation. See (#feature-trng).
* 11: `CAP_CMD_MULTI`: Support for `CMD_PROP_VALUE_MULTI_GET` ((#cmd-prop-value-multi-get)), `CMD_PROP_VALUE_MULTI_SET` ((#cmd-prop-value-multi-set), and `CMD_PROP_VALUES_ARE` ((#cmd-prop-values-are)).
* 12: `CAP_UNSOL_UPDATE_FILTER`: Support for `PROP_UNSOL_UPDATE_FILTER` ((#prop-unsol-update-filter)) and `PROP_UNSOL_UPDATE_LIST` ((#prop-unsol-update-list)).
* 13: `CAP_MCU_POWER_SAVE`: Support for controlling NCP's MCU power state (`PROP_MCU_POWER_STATE`).
* 16: `CAP_802_15_4_2003`
* 17: `CAP_802_15_4_2006`
* 18: `CAP_802_15_4_2011`
@@ -192,7 +193,7 @@ This value is encoded as an unsigned 8-bit integer.
The host **MUST** only use this property from NLI 0. Behavior when used
from other NLIs is undefined.
### PROP 7: PROP_POWER_STATE {#prop-power-state}
### PROP 7: PROP_POWER_STATE {#prop-power-state} (deprecated)
* Type: Read-Write
* Packed-Encoding: `C`
@@ -201,10 +202,12 @@ Octets: | 1
--------|------------------
Fields: | POWER_STATE
This property is **deprecated**. `MCU_POWER_STATE` provides similar
functionality.
Describes the current power state of the NCP. By writing to this
property you can manage the lower state of the NCP. Enumeration is
encoded as a single unsigned byte.
Defined values are:
* 0: `POWER_STATE_OFFLINE`: NCP is physically powered off.
@@ -258,7 +261,7 @@ Unlike most other properties, setting this property to true when the
value of the property is already true **MUST** fail with a last status
of `STATUS_ALREADY`.
### PROP 10: PROP_HOST_POWER_STATE {#prop-host-power-state}
### PROP 12: PROP_HOST_POWER_STATE {#prop-host-power-state}
* Type: Read-Write
* Packed-Encoding: `C`
@@ -327,6 +330,48 @@ it was entering a low-power state.
The host **MUST** only use this property from NLI 0. Behavior when used
from other NLIs is undefined.
### PROP 13: PROP_MCU_POWER_STATE {#prop-mcu-power-state}
* Type: Read-Write
* Packed-Encoding: `C`
* Required capability: CAP_MCU_POWER_SAVE
This property specifies the desired power state of NCP's micro-controller
(MCU) when the underlying platform's operating system enters idle mode (i.e.,
all active tasks/events are processed and the MCU can potentially enter a
energy-saving power state).
The power state primarily determines how the host should interact with the NCP
and whether the host needs an external trigger (a "poke") to NCP before it can
communicate with the NCP or not. After a reset, the MCU power state MUST be
`SPINEL_MCU_POWER_STATE_ON`.
Defined values are:
* 0: `SPINEL_MCU_POWER_STATE_ON`: NCP's MCU stays on and active all the time.
When the NCP's desired power state is set to this value, host can send
messages to NCP without requiring any "poke" or external triggers. MCU is
expected to stay on and active. Note that the `ON` power state only determines
the MCU's power mode and is not related to radio's state.
* 1: `SPINEL_MCU_POWER_STATE_LOW_POWER`: NCP's MCU can enter low-power
(energy-saving) state. When the NCP's desired power state is set to
`LOW_POWER`, host is expected to "poke" the NCP (e.g., an external trigger
like an interrupt) before it can communicate with the NCP (send a message
to the NCP). The "poke" mechanism is determined by the platform code (based
on NCP's interface to the host).
While power state is set to `LOW_POWER`, NCP can still (at any time) send
messages to host. Note that receiving a message from the NCP does NOT
indicate that the NCP's power state has changed, i.e., host is expected to
continue to "poke" NCP when it wants to talk to the NCP until the power
state is explicitly changed (by setting this property to `ON`).
Note that the `LOW_POWER` power state only determines the MCU's power mode
and is not related to radio's state.
* 2: `SPINEL_MCU_POWER_STATE_OFF`: NCP is fully powered off.
An NCP hardware reset (via a RESET pin) is required to bring the NCP back
to `SPINEL_MCU_POWER_STATE_ON`. RAM is not retained after reset.
### PROP 4104: PROP_UNSOL_UPDATE_FILTER {#prop-unsol-update-filter}
* Required only if `CAP_UNSOL_UPDATE_FILTER` is set.
@@ -465,7 +510,7 @@ The frame metadata field consists of the following fields:
Field | Description | Type | Len | Default
:--------|:-----------------------------|:-----------|-------|----------
MD_POWER | (dBm) RSSI/TX-Power | `c` int8 | 1 | -128
MD_RSSI | (dBm) RSSI | `c` int8 | 1 | -128
MD_NOISE | (dBm) Noise floor | `c` int8 | 1 | -128
MD_FLAG | Flags (defined below) | `S` uint16 | 2 |
MD_PHY | PHY-specific data | `d` data | >=2 |
@@ -477,11 +522,6 @@ the host:
* MD_NOISE
* MD_FLAG
When specifying `MD_POWER` for a packet to be transmitted, the actual
transmit power is never larger than the current value of `PROP_PHY_TX_POWER`
((#prop-phy-tx-power)). When left unspecified (or set to the value -128),
an appropriate transmit power will be chosen by the NCP.
The bit values in `MD_FLAG` are defined as follows:
Bit | Mask | Name | Description if set
@@ -30,3 +30,11 @@ If the NCP supports dynamic log level control, setting this property
changes the log level accordingly. Getting the value returns the current
log level. If the dynamic log level control is not supported, setting this
property returns a `PROP_LAST_STATUS` with `STATUS_INVALID_COMMAND_FOR_PROP`.
### PROP 16386: PROP_DEBUG_TEST_WATCHDOG {#prop-debug-test-watchdog}
* Type: Read-Only
* Packed-Encoding: Empty
Reading this property will causes NCP to start `while(true) ;` loop and
thus triggering a watchdog. This is intended for testing the watchdog
functionality on the underlying platform/NCP.
@@ -22,6 +22,7 @@ IPv6 Prefix + Prefix Length
* Type: Read-Write
* Packed-Encoding: `A(t(6CLLC))`
This property provides all unicast addresses.
Array of structures containing:
* `6`: IPv6 Address
@@ -39,3 +40,30 @@ turned on, ping request ICMP packets will not be passed to the host.
Default value is `false`.
### PROP 102: SPINEL_PROP_IPV6_MULTICAST_ADDRESS_TABLE {#prop-ipv6-multicast-address-table}
* Type: Read-Write
* Packed-Encoding: `A(t(6))`
Array of structures containing:
* `6`: Multicast IPv6 Address
### PROP 103: PROP_IPv6_ICMP_PING_OFFLOAD_MODE
* Type: Read-Write
* Packed-Encoding: `C`
* Unit: Enumeration
Allow the NCP to directly respond to ICMP ping requests. If this is
turned on, ping request ICMP packets will not be passed to the host.
This property allows enabling responses sent to unicast only, multicast
only, or both.
Values:
* 0: `IPV6_ICMP_PING_OFFLOAD_DISABLED`
* 1: `IPV6_ICMP_PING_OFFLOAD_UNICAST_ONLY`
* 2: `IPV6_ICMP_PING_OFFLOAD_MULTICAST_ONLY`
* 3: `IPV6_ICMP_PING_OFFLOAD_ALL`
Default value is `IPV6_ICMP_PING_OFFLOAD_DISABLED`.
@@ -202,3 +202,9 @@ Structure Parameters:
* Packed-Encoding: `b`
* Required capability: `CAP_MAC_WHITELIST`
### PROP 4873: PROP_MAC_CCA_FAILURE_RATE {#prop-mac-cca-failure-rate}
* Type: Read Only
* Packed-Encoding: `S`
This property provides the current CCA (Clear Channel Assessment) failure rate.
Maximum value `0xffff` corresponding to 100% failure rate.
+20 -12
View File
@@ -14,9 +14,9 @@ following allocation plan:
Property ID Range | Description
:---------------------|:-----------------
0 - 127 | Reserved for frequently-used properties
128 - 15,359 | Unallocated
128 - 15,359 | Technology-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
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.
These ranges are:
Name | Range (Inclusive) | Documentation
-------|------------------------------|--------------
Core | 0x00 - 0x1F, 0x1000 - 0x11FF | (#prop-core)
PHY | 0x20 - 0x2F, 0x1200 - 0x12FF | (#prop-phy)
MAC | 0x30 - 0x3F, 0x1300 - 0x13FF | (#prop-mac)
NET | 0x40 - 0x4F, 0x1400 - 0x14FF | (#prop-net)
Tech | 0x50 - 0x5F, 0x1500 - 0x15FF | Technology-specific
IPv6 | 0x60 - 0x6F, 0x1600 - 0x16FF | (#prop-ipv6)
Stream | 0x70 - 0x7F, 0x1700 - 0x17FF | (#prop-core)
Debug | 0x4000 - 0x4400 | (#prop-debug)
Name | Range (Inclusive) | Description
-------------|--------------------------------|------------------------
Core | 0x000 - 0x01F, 0x1000 - 0x11FF | Spinel core
PHY | 0x020 - 0x02F, 0x1200 - 0x12FF | Radio PHY layer
MAC | 0x030 - 0x03F, 0x1300 - 0x13FF | MAC layer
NET | 0x040 - 0x04F, 0x1400 - 0x14FF | Network
Thread | 0x050 - 0x05F, 0x1500 - 0x15FF | Thread
IPv6 | 0x060 - 0x06F, 0x1600 - 0x16FF | IPv6
Stream | 0x070 - 0x07F, 0x1700 - 0x17FF | Stream
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
ranges: a primary range (which is encoded as a single byte)
+341 -13
View File
@@ -32,17 +32,35 @@ The IPv6 address of the leader. (Note: May change to long and short address of l
### PROP 81: PROP_THREAD_PARENT
* Type: Read-Only
* Packed-Encoding: `ES`
* LADDR, SADDR
* Packed-Encoding: `ESLccCC`
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
* Type: Read-Only
* Packed-Encoding: `A(t(ES))`
* Packed-Encoding: `A(t(ESLLCCcCc)`
Table containing the long and short addresses of all
the children of this node.
Table containing info about all the children of this node.
Data per item is:
* `E`: Extended address
* `S`: RLOC16
* `L`: Timeout (in seconds)
* `L`: Age (in seconds)
* `L`: Network Data version
* `C`: Link Quality In
* `c`: Average RSS (in dBm)
* `C`: Mode (bit-flags)
* `c`: Last RSSI (in dBm)
### PROP 83: PROP_THREAD_LEADER_RID
* Type: Read-Only
@@ -84,7 +102,7 @@ The local stable network data.
### PROP 90: PROP_THREAD_ON_MESH_NETS
* Type: Read-Write
* Packed-Encoding: `A(t(6CbCb))`
* Packed-Encoding: `A(t(6CbCbS))`
Data per item is:
@@ -95,6 +113,8 @@ Data per item is:
* `b`: "Is defined locally" flag. Set if this network was locally
defined. Assumed to be true for set, insert and replace. Clear if
the on mesh network was defined by another node.
* `S`: The RLOC16 of the device that registered this on-mesh prefix entry.
This value is not used and ignored when adding an on-mesh prefix.
### PROP 91: PROP_THREAD_OFF_MESH_ROUTES
* Type: Read-Write
@@ -114,6 +134,8 @@ Data per item is:
route is this device itself (i.e., route was added by this device)
This value is ignored when adding an external route. For any added
route the next hop is this device.
* `S`: The RLOC16 of the device that registered this route entry.
This value is not used and ignored when adding a route.
### PROP 92: PROP_THREAD_ASSISTING_PORTS
* Type: Read-Write
@@ -208,19 +230,20 @@ disabled.
### PROP 5387: PROP_THREAD_NEIGHBOR_TABLE
* Type: Read-Only
* Packed-Encoding: `A(t(ESLCcCbLL))`
* Packed-Encoding: `A(t(ESLCcCbLLc))`
Data per item is:
* `E`: Extended/long address
* `E`: Extended address
* `S`: RLOC16
* `L`: Age
* `C`: Link Quality In
* `c`: Average RSS
* `c`: Average RSS (in dBm)
* `C`: Mode (bit-flags)
* `b`: `true` if neighbor is a child, `false` otherwise.
* `L`: Link Frame Counter
* `L`: MLE Frame Counter
* `c`: The last RSSI (in dBm)
### PROP 5388: PROP_THREAD_CHILD_COUNT_MAX
* Type: Read-Write
@@ -252,7 +275,7 @@ Data per item is:
* `U`: PSKd
* `L`: Timeout in seconds
* `E`: Extended/long address (optional)
* `E`: IEEE EUI-64 (optional)
Passess Pre-Shared Key for the Device to the NCP in the commissioning process.
When the Extended address is ommited all Devices which provided a valid PSKd
@@ -272,7 +295,7 @@ Set to true to enable the native commissioner. It is mandatory before adding the
* Packed-Encoding: `b`
* 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}
@@ -280,6 +303,8 @@ Set to true to enable the TMF proxy.
* Packed-Encoding: `dSS`
* Required capability: `CAP_THREAD_TMF_PROXY`
This property is deprecated. Please see `SPINEL_PROP_THREAD_UDP_PROXY_STREAM`.
Data per item is:
* `d`: CoAP frame
@@ -293,7 +318,6 @@ Fields: | Length | CoAP | locator | port
This property allows the host to send and receive TMF messages from
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}
* Type: Read-Write
@@ -331,3 +355,307 @@ Response messages.
* All zeros to clear the steering data (indicating no steering data).
* All 0xFFs to set the steering data (bloom filter) to accept/allow all.
* A specific EUI64 which is then added to steering data/bloom filter.
### PROP 5399: SPINEL_PROP_THREAD_ROUTER_TABLE {#prop-thread-router-table}
* Type: Read-Only
* Packed-Encoding: `A(t(ESCCCCCCb)`
Data per item is:
* `E`: IEEE 802.15.4 Extended Address
* `S`: RLOC16
* `C`: Router ID
* `C`: Next hop to router
* `C`: Path cost to router
* `C`: Link Quality In
* `C`: Link Quality Out
* `C`: Age (seconds since last heard)
* `b`: Link established with Router ID or not.
### PROP 5400: SPINEL_PROP_THREAD_ACTIVE_DATASET (#prop-thread-active-dataset)
* Type: Read-Write
* Packing-Encoding: `A(t(iD))`
This property provides access to current Thread Active Operational Dataset.
A Thread device maintains the Operational Dataset that it has stored locally
and the one currently in use by the partition to which it is attached. This
property corresponds to the locally stored Dataset on the device.
Operational Dataset consists of a set of supported properties (e.g., channel,
master key, network name, PAN id, etc). Note that not all supported properties
may be present (have a value) in a Dataset.
The Dataset value is encoded as an array of structures containing pairs of
property key (as `i`) followed by the property value (as `D`). The property
value must follow the format associated with the corresponding spinel
property.
On write, any unknown/unsupported property keys must be ignored.
The following properties can be included in a Dataset list:
* SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP
* SPINEL_PROP_PHY_CHAN
* SPINEL_PROP_PHY_CHAN_SUPPORTED (Channel Mask Page 0)
* SPINEL_PROP_NET_MASTER_KEY
* SPINEL_PROP_NET_NETWORK_NAME
* SPINEL_PROP_NET_XPANID
* SPINEL_PROP_MAC_15_4_PANID
* SPINEL_PROP_IPV6_ML_PREFIX
* SPINEL_PROP_NET_PSKC
* SPINEL_PROP_DATASET_SECURITY_POLICY
### PROP 5401: SPINEL_PROP_THREAD_PENDING_DATASET (#prop-thread-pending-dataset)
* Type: Read-Write
* Packing-Encoding: `A(t(iD))`
This property provide access to current Thread Pending Operational Dataset
locally stored on the device.
The formatting of this property follows the same rules as in
SPINEL_PROP_THREAD_ACTIVE_DATASET.
In addition supported properties in SPINEL_PROP_THREAD_ACTIVE_DATASET, the
following properties can also be included in the Pending Dataset:
* SPINEL_PROP_DATASET_PENDING_TIMESTAMP
* SPINEL_PROP_DATASET_DELAY_TIMER
### PROP 5402: SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET (#prop-thread-mgmt-set-active-dataset)
* Type: Write only
* Packing-Encoding: `A(t(iD))`
The formatting of this property follows the same rules as in
SPINEL_PROP_THREAD_ACTIVE_DATASET.
This is write-only property. When written, it triggers a MGMT_ACTIVE_SET meshcop
command to be sent to the leader with the given Dataset. The spinel frame response
should be a `LAST_STATUS` with the status of the transmission of MGMT_ACTIVE_SET
command.
In addition to supported properties in SPINEL_PROP_THREAD_ACTIVE_DATASET, the
following property can be included in the Dataset (to allow for custom raw
TLVs):
* SPINEL_PROP_DATASET_RAW_TLVS
### PROP 5403: SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET (#prop-thread-mgmt-set-pending-dataset)
* Type: Write only
* Packing-Encoding: `A(t(iD))`
This property is similar to SPINEL_PROP_THREAD_PENDING_DATASET and follows the
same format and rules.
In addition to supported properties in SPINEL_PROP_THREAD_PENDING_DATASET, the
following property can be included the Dataset (to allow for custom raw TLVs to
be provided):
* SPINEL_PROP_DATASET_RAW_TLVS
### PROP 5404: SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP (#prop-dataset-active-timestamps)
* Type: No direct read or write
* Packing-Encoding: `X`
This property represents the Active Timestamp field in a Thread Operational
Dataset.
This can only be included in one of the Dataset related properties below:
* SPINEL_PROP_THREAD_ACTIVE_DATASET
* SPINEL_PROP_THREAD_PENDING_DATASET
* SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_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)
* Type: No direct read or write
* Packing-Encoding: `X`
This property represents the Pending Timestamp field in a Thread Operational
Dataset.
It can only be included in one of the Pending Dataset properties:
* SPINEL_PROP_THREAD_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)
* Type: No direct read or write
* Packing-Encoding: `L`
This property represents the Delay Timer field in a Thread Operational Dataset.
Delay timer (in ms) specifies the time renaming until Thread devices overwrite
the value in the Active Operational Dataset with the corresponding values in the
Pending Operational Dataset.
It can only be included in one of the Pending Dataset properties:
* SPINEL_PROP_THREAD_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)
* Type: No direct read or write
* Packing-Encoding: `SC`
This property represents the Security Policy field in a Thread Operational
Dataset.
The content is:
* `S` : Key Rotation Time (in units of hour)
* `C` : Security Policy Flags (as specified in Thread 1.1 Section 8.10.1.15)
It can only be included in one of the Dataset related properties below:
* SPINEL_PROP_THREAD_ACTIVE_DATASET
* SPINEL_PROP_THREAD_PENDING_DATASET
* SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_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)
* Type: No direct read or write
* Packing-Encoding: `D`
This property defines extra raw TLVs that can be added to an Operational
DataSet.
It can only be included in one of the following Dataset properties:
* SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET
* SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
### PROP 5409: SPINEL_PROP_THREAD_CHILD_TABLE_ADDRESSES (#prop-thread-child-table-addresses)
* Type: Read-Only
* Packing-Encoding: `A(t(ESA(6))`
This property provides the list of all addresses associated with every child
including any registered IPv6 addresses.
Data per item is:
* `E`: Extended address of the child
* `S`: RLOC16 of the child
* `A(6)`: List of IPv6 addresses registered by the child (if any)
### PROP 5410: SPINEL_PROP_THREAD_NEIGHBOR_TABLE_ERROR_RATES (#prop-thread-neighbor-table-error-rates)
* Type: Read-Only
* Packing-Encoding: `A(t(ESSScc))`
* Required capability: `CAP_ERROR_RATE_TRACKING`
This property provides link quality related info including
frame and (IPv6) message error rates for all neighbors.
With regards to message error rate, note that a larger (IPv6)
message can be fragmented and sent as multiple MAC frames. The
message transmission is considered a failure, if any of its
fragments fail after all MAC retry attempts.
Data per item is:
* `E`: Extended address of the neighbor
* `S`: RLOC16 of the neighbor
* `S`: Frame error rate (0 -> 0%, 0xffff -> 100%)
* `S`: Message error rate (0 -> 0%, 0xffff -> 100%)
* `c`: Average RSSI (in dBm)
* `c`: Last RSSI (in dBm)
### PROP 5411: SPINEL_PROP_THREAD_ADDRESS_CACHE_TABLE (#prop-thread-address-cache-table)
* Type: Read-Only
* Packing-Encoding: `A(t(6SC))`
This property provides Thread EID IPv6 address cache table.
Data per item is:
* `6` : Target IPv6 address
* `S` : RLOC16 of target
* `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
+32
View File
@@ -0,0 +1,32 @@
VERSION=0.1
all: arm32v7_linux x86_linux sim
arm32v7_linux: arm32v7_ubuntu_wpantund
docker build -t openthread/wpantund_arm32v7_linux arm32v7_ubuntu_wpantund && \
docker push openthread/wpantund_arm32v7_linux && \
docker tag openthread/wpantund_arm32v7_linux openthread/wpantund_arm32v7_linux:$(VERSION) && \
docker push openthread/wpantund_arm32v7_linux:$(VERSION)
x86_linux: x86_ubuntu_wpantund
docker build -t openthread/wpantund_amd64_linux x86_ubuntu_wpantund && \
docker push openthread/wpantund_amd64_linux && \
docker tag openthread/wpantund_amd64_linux openthread/wpantund_amd64_linux:$(VERSION) && \
docker push openthread/wpantund_amd64_linux:$(VERSION)
sim: ot_sim
docker build -t openthread/sim ot_sim && \
docker push openthread/sim && \
docker tag openthread/sim openthread/sim:$(VERSION) && \
docker push openthread/sim:$(VERSION)
publish_manifest:
docker manifest create openthread/wpantund openthread/wpantund_arm32v7_linux openthread/wpantund_amd64_linux
docker manifest annotate openthread/wpantund openthread/wpantund_arm32v7_linux --os linux --arch arm --variant 7
docker manifest annotate openthread/wpantund openthread/wpantund_amd64_linux --os linux --arch amd64
docker manifest push --purge openthread/wpantund
docker manifest create openthread/wpantund:$(VERSION) openthread/wpantund_arm32v7_linux:$(VERSION) openthread/wpantund_amd64_linux:$(VERSION)
docker manifest annotate openthread/wpantund:$(VERSION) openthread/wpantund_arm32v7_linux:$(VERSION) --os linux --arch arm --variant 7
docker manifest annotate openthread/wpantund:$(VERSION) openthread/wpantund_amd64_linux:$(VERSION) --os linux --arch amd64
docker manifest push --purge openthread/wpantund:$(VERSION)
+27
View File
@@ -0,0 +1,27 @@
## Running wpantund from a Docker container:
For a device that has a Thread radio attached to port /dev/ttyUSB0, start wpantund as follows:
```
docker run --rm --detach -e "OPENTHREAD_DEVICE_PORT=/dev/ttyUSB0" --cap-add=NET_ADMIN --device=/dev/ttyUSB0 --name=wpantund openthread/wpantund
```
Once wpantund is running, one can control the Thread interface with wpanctl as follows:
```
docker exec -it wpantund wpanctl
```
## Content
arm32v7_ubuntu_wpantund
- wpantund running on ARMv7 (e.g. Raspberry Pi)
x86_ubuntu_wpantund
- wpantund running on x86
ot_sim
- OpenThread Posix simulator
@@ -0,0 +1,50 @@
# Ubuntu image with tools required to build OpenThread
FROM arm32v7/ubuntu:18.04 as wpantund-dev
LABEL maintainer="Marcin K Szczodrak"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y build-essential git make autoconf autoconf-archive \
automake dbus libtool gcc g++ libreadline-dev libdbus-1-dev libboost-dev
# wpantund
RUN mkdir -p ~/src && \
cd ~/src && \
git clone --recursive https://github.com/openthread/wpantund.git && \
cd wpantund && \
git checkout full/master && \
./configure --sysconfdir=/etc --enable-shared=no && \
make && \
make install
#FROM debian:stretch-slim
FROM arm32v7/ubuntu:18.04
LABEL maintainer="Marcin K Szczodrak"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y libdbus-1-3 libreadline-dev net-tools
RUN mkdir -p /dev/net && \
mknod /dev/net/tun c 10 200 && \
chmod 600 /dev/net/tun
COPY --from=wpantund-dev /usr/local/share/man/man1/wpanctl.1 /usr/local/share/man/man1/wpanctl.1
COPY --from=wpantund-dev /usr/local/share/man/man1/wpantund.1 /usr/local/share/man/man1/wpantund.1
COPY --from=wpantund-dev /usr/local/share/wpantund /usr/local/share/wpantund
COPY --from=wpantund-dev /usr/local/include/wpantund /usr/local/include/wpantund
COPY --from=wpantund-dev /usr/local/bin/wpanctl /usr/local/bin/wpanctl
COPY --from=wpantund-dev /usr/local/sbin/wpantund /usr/local/sbin/wpantund
COPY --from=wpantund-dev /etc/dbus-1/system.d/wpantund.conf /etc/dbus-1/system.d/wpantund.conf
COPY --from=wpantund-dev /etc/wpantund.conf /etc/wpantund.conf
ENTRYPOINT mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun && \
service dbus start && \
start-stop-daemon --start --background --quiet --exe /usr/local/sbin/wpantund -- -s $OPENTHREAD_DEVICE_PORT && \
tail -F /dev/null
+19
View File
@@ -0,0 +1,19 @@
FROM alpine:3.6 as openthread-dev
LABEL maintainer="Marcin K Szczodrak"
RUN apk add -U autoconf automake ca-certificates flex git g++ libtool linux-headers make
# openthread
RUN git clone --recursive https://github.com/openthread/openthread.git && \
cd /openthread && \
./bootstrap && \
make -f examples/Makefile-posix
FROM alpine:3.6
LABEL maintainer="Marcin K Szczodrak"
RUN apk add --no-cache libstdc++
COPY --from=openthread-dev /openthread/output/x86_64-unknown-linux-gnu/bin/ot-cli-ftd /bin/ot-cli-ftd
COPY --from=openthread-dev /openthread/output/x86_64-unknown-linux-gnu/bin/ot-cli-mtd /bin/ot-cli-mtd
RUN ln -s /bin/ot-cli-ftd /bin/node
+36
View File
@@ -0,0 +1,36 @@
## Starting simulator
To start the OpenThread simulator, run:
```
docker run --rm -d --name otsim openthread/sim tail -F /dev/null
```
or
```
./start_sim
```
This runs in background a docker container with environment setup to simulate OpenThread nodes.
## Adding a Thread node
To start simulating an OpenThread node #1, run:
```
docker exec -it otsim node 1
```
or
```
./add_node 1
```
This runs a program called node, which is an OpenThread FTD binary, inside the docker container's simulator environment.
## Stopping simulator
To stop the OpenThread simualtor, run:
```
docker stop otsim
```
or
```
./stop_sim
```
This stop the docker daemon process.
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it otsim node $1
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker run --rm -d --name otsim openthread/sim tail -F /dev/null
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker stop otsim
+50
View File
@@ -0,0 +1,50 @@
# Ubuntu image with tools required to build OpenThread
FROM ubuntu:18.04 as wpantund-dev
LABEL maintainer="Marcin K Szczodrak"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y build-essential git make autoconf autoconf-archive \
automake dbus libtool gcc g++ libreadline-dev libdbus-1-dev libboost-dev
# wpantund
RUN mkdir -p ~/src && \
cd ~/src && \
git clone --recursive https://github.com/openthread/wpantund.git && \
cd wpantund && \
git checkout full/master && \
./configure --sysconfdir=/etc --enable-shared=no && \
make && \
make install
#FROM debian:stretch-slim
FROM ubuntu:18.04
LABEL maintainer="Marcin K Szczodrak"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y libdbus-1-3 libreadline7 net-tools
RUN mkdir -p /dev/net && \
mknod /dev/net/tun c 10 200 && \
chmod 600 /dev/net/tun
COPY --from=wpantund-dev /usr/local/share/man/man1/wpanctl.1 /usr/local/share/man/man1/wpanctl.1
COPY --from=wpantund-dev /usr/local/share/man/man1/wpantund.1 /usr/local/share/man/man1/wpantund.1
COPY --from=wpantund-dev /usr/local/share/wpantund /usr/local/share/wpantund
COPY --from=wpantund-dev /usr/local/include/wpantund /usr/local/include/wpantund
COPY --from=wpantund-dev /usr/local/bin/wpanctl /usr/local/bin/wpanctl
COPY --from=wpantund-dev /usr/local/sbin/wpantund /usr/local/sbin/wpantund
COPY --from=wpantund-dev /etc/dbus-1/system.d/wpantund.conf /etc/dbus-1/system.d/wpantund.conf
COPY --from=wpantund-dev /etc/wpantund.conf /etc/wpantund.conf
ENTRYPOINT mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun && \
service dbus start && \
start-stop-daemon --start --background --quiet --exe /usr/local/sbin/wpantund -- -s $OPENTHREAD_DEVICE_PORT && \
tail -F /dev/null
+6 -2
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="openthread.configuration.props" />
<PropertyGroup Label="Globals">
@@ -43,6 +43,10 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>
%(PreprocessorDefinitions);
OPENTHREAD_CONFIG_FILE="openthread-windows-config.h";
</PreprocessorDefinitions>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>
@@ -152,4 +156,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
-1
View File
@@ -64,7 +64,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\tests\unit\test_aes.cpp" />
<ClCompile Include="..\..\tests\unit\test_fuzz.cpp" />
<ClCompile Include="..\..\tests\unit\test_hmac_sha256.cpp" />
<ClCompile Include="..\..\tests\unit\test_link_quality.cpp" />
<ClCompile Include="..\..\tests\unit\test_lowpan.cpp" />
@@ -18,9 +18,6 @@
<ClCompile Include="..\..\tests\unit\test_aes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\tests\unit\test_fuzz.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\tests\unit\test_hmac_sha256.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="openthread.configuration.props" />
<PropertyGroup Label="Globals">
@@ -49,6 +49,8 @@
..\..\include;
..\..\src;
..\..\src\core;
..\..\third_party\mbedtls;
..\..\third_party\mbedtls\repo\include;
</AdditionalIncludeDirectories>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
@@ -59,8 +61,10 @@
<ClCompile Include="..\..\src\cli\cli_dataset.cpp" />
<ClCompile Include="..\..\src\cli\cli_instance.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>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
@@ -10,14 +10,14 @@
<ClCompile Include="..\..\src\cli\cli.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cli\cli_uart.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cli\cli_dataset.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cli\cli_instance.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cli\cli_uart.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
+1 -1
View File
@@ -59,7 +59,7 @@
<ClCompile Include="..\..\src\cli\cli.cpp" />
<ClCompile Include="..\..\src\cli\cli_dataset.cpp" />
<ClCompile Include="..\..\src\cli\cli_uart.cpp" />
<ClCompile Include="..\..\src\cli\cli_udp.cpp" />
<ClCompile Include="..\..\src\cli\cli_udp_example.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
@@ -10,14 +10,14 @@
<ClCompile Include="..\..\src\cli\cli.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cli\cli_udp.cpp">
<ClCompile Include="..\..\src\cli\cli_dataset.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ClCompile>
<ClCompile Include="..\..\src\cli\cli_uart.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cli\cli_dataset.cpp">
<ClCompile Include="..\..\src\cli\cli_udp_example.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</ItemGroup>
</Project>
@@ -58,18 +58,28 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\ncp\changed_props_set.cpp" />
<ClCompile Include="..\..\src\ncp\ncp_base.cpp" />
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp" />
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.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_spi.cpp" />
<ClCompile Include="..\..\src\ncp\spinel.c" />
<ClCompile Include="..\..\src\ncp\spinel_decoder.cpp" />
<ClCompile Include="..\..\src\ncp\spinel_encoder.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\ncp\changed_props_set.hpp" />
<ClInclude Include="..\..\src\ncp\ncp_base.hpp" />
<ClInclude Include="..\..\src\ncp\ncp_buffer.hpp" />
<ClInclude Include="..\..\src\ncp\ncp_spi.hpp" />
<ClInclude Include="..\..\src\ncp\spinel.h" />
<ClInclude Include="..\..\src\ncp\spinel_decoder.hpp" />
<ClInclude Include="..\..\src\ncp\spinel_encoder.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
@@ -15,20 +15,44 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\ncp\changed_props_set.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_dispatcher.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\spinel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\spinel_decoder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\spinel_encoder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_spi.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\ncp\changed_props_set.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ncp\ncp_base.hpp">
<Filter>Header Files</Filter>
</ClInclude>
@@ -41,5 +65,11 @@
<ClInclude Include="..\..\src\ncp\spinel.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ncp\spinel_decoder.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ncp\spinel_encoder.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>
@@ -58,18 +58,28 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\ncp\changed_props_set.cpp" />
<ClCompile Include="..\..\src\ncp\hdlc.cpp" />
<ClCompile Include="..\..\src\ncp\ncp_base.cpp" />
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp" />
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.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_uart.cpp" />
<ClCompile Include="..\..\src\ncp\spinel.c" />
<ClCompile Include="..\..\src\ncp\spinel_decoder.cpp" />
<ClCompile Include="..\..\src\ncp\spinel_encoder.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\ncp\changed_props_set.hpp" />
<ClInclude Include="..\..\src\ncp\hdlc.hpp" />
<ClInclude Include="..\..\src\ncp\ncp_base.hpp" />
<ClInclude Include="..\..\src\ncp\ncp_buffer.hpp" />
<ClInclude Include="..\..\src\ncp\ncp_uart.hpp" />
<ClInclude Include="..\..\src\ncp\spinel.h" />
<ClInclude Include="..\..\src\ncp\spinel_decoder.hpp" />
<ClInclude Include="..\..\src\ncp\spinel_encoder.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
@@ -15,12 +15,27 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\ncp\changed_props_set.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\hdlc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_ftd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_mtd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_radio.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_base_dispatcher.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\ncp_buffer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -30,8 +45,17 @@
<ClCompile Include="..\..\src\ncp\spinel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\spinel_decoder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ncp\spinel_encoder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\ncp\changed_props_set.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ncp\hdlc.hpp">
<Filter>Header Files</Filter>
</ClInclude>
@@ -47,5 +71,11 @@
<ClInclude Include="..\..\src\ncp\spinel.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ncp\spinel_decoder.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ncp\spinel_encoder.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="openthread.configuration.props" />
<Import Project="openthread.configuration.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{30723C38-BA3B-44C9-8D64-C5861A26934F}</ProjectGuid>
<Keyword>StaticLibrary</Keyword>
@@ -42,6 +42,7 @@
_CRT_SECURE_NO_WARNINGS;
OPENTHREAD_CONFIG_FILE="openthread-windows-config.h";
OPENTHREAD_FTD=1;
OPENTHREAD_ENABLE_NCP_SPI=1;
OTBUILD;
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
@@ -58,12 +59,12 @@
<ClCompile Include="..\..\examples\platforms\posix\flash-windows-stubs.c" />
<ClCompile Include="..\..\examples\platforms\posix\logging.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\random.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\utils\settings.cpp" />
<ClCompile Include="..\..\examples\platforms\utils\settings_flash.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\examples\platforms\posix\platform-posix.h" />
@@ -22,9 +22,6 @@
<ClCompile Include="..\..\examples\platforms\posix\misc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\examples\platforms\posix\platform.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\examples\platforms\posix\random.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -34,10 +31,13 @@
<ClCompile Include="..\..\examples\platforms\posix\spi-stubs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\examples\platforms\posix\system.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\examples\platforms\posix\uart-windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\examples\platforms\utils\settings.cpp">
<ClCompile Include="..\..\examples\platforms\utils\settings_flash.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
+24 -2
View File
@@ -72,13 +72,18 @@
<ClCompile Include="..\..\src\core\api\tasklet_api.cpp" />
<ClCompile Include="..\..\src\core\api\thread_api.cpp" />
<ClCompile Include="..\..\src\core\api\thread_ftd_api.cpp" />
<ClCompile Include="..\..\src\core\api\udp_api.cpp" />
<ClCompile Include="..\..\src\core\coap\coap.cpp" />
<ClCompile Include="..\..\src\core\coap\coap_header.cpp" />
<ClCompile Include="..\..\src\core\coap\coap_secure.cpp" />
<ClCompile Include="..\..\src\core\common\crc16.cpp" />
<ClCompile Include="..\..\src\core\common\instance.cpp" />
<ClCompile Include="..\..\src\core\common\locator.cpp" />
<ClCompile Include="..\..\src\core\common\logging.cpp" />
<ClCompile Include="..\..\src\core\common\message.cpp" />
<ClCompile Include="..\..\src\core\common\notifier.cpp" />
<ClCompile Include="..\..\src\core\common\settings.cpp" />
<ClCompile Include="..\..\src\core\common\string.cpp" />
<ClCompile Include="..\..\src\core\common\tasklet.cpp" />
<ClCompile Include="..\..\src\core\common\timer.cpp" />
<ClCompile Include="..\..\src\core\common\tlvs.cpp" />
@@ -89,6 +94,7 @@
<ClCompile Include="..\..\src\core\crypto\mbedtls.cpp" />
<ClCompile Include="..\..\src\core\crypto\pbkdf2_cmac.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_filter.cpp" />
<ClCompile Include="..\..\src\core\mac\mac_frame.cpp" />
@@ -103,27 +109,33 @@
<ClCompile Include="..\..\src\core\meshcop\joiner.cpp" />
<ClCompile Include="..\..\src\core\meshcop\joiner_router.cpp" />
<ClCompile Include="..\..\src\core\meshcop\leader.cpp" />
<ClCompile Include="..\..\src\core\meshcop\meshcop.cpp" />
<ClCompile Include="..\..\src\core\meshcop\meshcop_tlvs.cpp" />
<ClCompile Include="..\..\src\core\meshcop\panid_query_client.cpp" />
<ClCompile Include="..\..\src\core\meshcop\timestamp.cpp" />
<ClCompile Include="..\..\src\core\meshcop\meshcop_tlvs.cpp" />
<ClCompile Include="..\..\src\core\net\dhcp6_client.cpp" />
<ClCompile Include="..\..\src\core\net\dhcp6_server.cpp" />
<ClCompile Include="..\..\src\core\net\icmp6.cpp" />
<ClCompile Include="..\..\src\core\net\ip6.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_address.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_filter.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_headers.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_mpl.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_routes.cpp" />
<ClCompile Include="..\..\src\core\net\netif.cpp" />
<ClCompile Include="..\..\src\core\net\udp6.cpp" />
<ClCompile Include="..\..\src\core\thread\address_resolver.cpp" />
<ClCompile Include="..\..\src\core\thread\announce_begin_server.cpp" />
<ClCompile Include="..\..\src\core\thread\announce_sender.cpp" />
<ClCompile Include="..\..\src\core\thread\child_table.cpp" />
<ClCompile Include="..\..\src\core\thread\energy_scan_server.cpp" />
<ClCompile Include="..\..\src\core\thread\data_poll_manager.cpp" />
<ClCompile Include="..\..\src\core\thread\key_manager.cpp" />
<ClCompile Include="..\..\src\core\thread\link_quality.cpp" />
<ClCompile Include="..\..\src\core\thread\lowpan.cpp" />
<ClCompile Include="..\..\src\core\thread\mesh_forwarder.cpp" />
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_ftd.cpp" />
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_mtd.cpp" />
<ClCompile Include="..\..\src\core\thread\mle.cpp" />
<ClCompile Include="..\..\src\core\thread\mle_router.cpp" />
<ClCompile Include="..\..\src\core\thread\network_data.cpp" />
@@ -132,10 +144,12 @@
<ClCompile Include="..\..\src\core\thread\network_data_local.cpp" />
<ClCompile Include="..\..\src\core\thread\network_diagnostic.cpp" />
<ClCompile Include="..\..\src\core\thread\panid_query_server.cpp" />
<ClCompile Include="..\..\src\core\thread\router_table.cpp" />
<ClCompile Include="..\..\src\core\thread\src_match_controller.cpp" />
<ClCompile Include="..\..\src\core\thread\thread_netif.cpp" />
<ClCompile Include="..\..\src\core\thread\topology.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\jam_detector.cpp" />
<ClCompile Include="..\..\src\core\utils\missing_strnlen.c" />
@@ -152,10 +166,13 @@
<ClInclude Include="..\..\src\core\common\context.hpp" />
<ClInclude Include="..\..\src\core\common\debug.hpp" />
<ClInclude Include="..\..\src\core\common\encoding.hpp" />
<ClInclude Include="..\..\src\core\common\instance.hpp" />
<ClInclude Include="..\..\src\core\common\locator.hpp" />
<ClInclude Include="..\..\src\core\common\logging.hpp" />
<ClInclude Include="..\..\src\core\common\message.hpp" />
<ClInclude Include="..\..\src\core\common\notifier.hpp" />
<ClInclude Include="..\..\src\core\common\new.hpp" />
<ClInclude Include="..\..\src\core\common\string.hpp" />
<ClInclude Include="..\..\src\core\common\tasklet.hpp" />
<ClInclude Include="..\..\src\core\common\timer.hpp" />
<ClInclude Include="..\..\src\core\common\tlvs.hpp" />
@@ -179,9 +196,10 @@
<ClInclude Include="..\..\src\core\meshcop\joiner.hpp" />
<ClInclude Include="..\..\src\core\meshcop\joiner_router.hpp" />
<ClInclude Include="..\..\src\core\meshcop\leader.hpp" />
<ClInclude Include="..\..\src\core\meshcop\meshcop.hpp" />
<ClInclude Include="..\..\src\core\meshcop\meshcop_tlvs.hpp" />
<ClInclude Include="..\..\src\core\meshcop\panid_query_client.hpp" />
<ClInclude Include="..\..\src\core\meshcop\timestamp.hpp" />
<ClInclude Include="..\..\src\core\meshcop\tlvs.hpp" />
<ClInclude Include="..\..\src\core\net\icmp6.hpp" />
<ClInclude Include="..\..\src\core\net\ip6.hpp" />
<ClInclude Include="..\..\src\core\net\ip6_address.hpp" />
@@ -193,10 +211,12 @@
<ClInclude Include="..\..\src\core\net\udp6.hpp" />
<ClInclude Include="..\..\src\core\thread\address_resolver.hpp" />
<ClInclude Include="..\..\src\core\thread\announce_begin_server.hpp" />
<ClInclude Include="..\..\src\core\thread\announce_sender.hpp" />
<ClInclude Include="..\..\src\core\thread\energy_scan_server.hpp" />
<ClInclude Include="..\..\src\core\net\dhcp6.hpp" />
<ClInclude Include="..\..\src\core\net\dhcp6_client.hpp" />
<ClInclude Include="..\..\src\core\net\dhcp6_server.hpp" />
<ClInclude Include="..\..\src\core\thread\child_table.hpp" />
<ClInclude Include="..\..\src\core\thread\data_poll_manager.hpp" />
<ClInclude Include="..\..\src\core\thread\key_manager.hpp" />
<ClInclude Include="..\..\src\core\thread\link_quality.hpp" />
@@ -213,12 +233,14 @@
<ClInclude Include="..\..\src\core\thread\network_diagnostic.hpp" />
<ClInclude Include="..\..\src\core\thread\network_diagnostic_tlvs.hpp" />
<ClInclude Include="..\..\src\core\thread\panid_query_server.hpp" />
<ClInclude Include="..\..\src\core\thread\router_table.hpp" />
<ClInclude Include="..\..\src\core\thread\src_match_controller.hpp" />
<ClInclude Include="..\..\src\core\thread\thread_netif.hpp" />
<ClInclude Include="..\..\src\core\thread\thread_tlvs.hpp" />
<ClInclude Include="..\..\src\core\thread\thread_uri_paths.hpp" />
<ClInclude Include="..\..\src\core\thread\topology.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\jam_detector.hpp" />
<ClInclude Include="..\..\src\core\utils\wrap_string.h" />
@@ -117,6 +117,9 @@
<ClCompile Include="..\..\src\core\api\thread_ftd_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\api\udp_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\coap\coap.cpp">
<Filter>Source Files\coap</Filter>
</ClCompile>
@@ -126,6 +129,9 @@
<ClCompile Include="..\..\src\core\coap\coap_secure.cpp">
<Filter>Source Files\coap</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\instance.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\locator.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
@@ -135,6 +141,15 @@
<ClCompile Include="..\..\src\core\common\message.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\notifier.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\settings.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\string.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\tasklet.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
@@ -150,6 +165,9 @@
<ClCompile Include="..\..\src\core\crypto\aes_ccm.cpp">
<Filter>Source Files\crypto</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\mac\link_raw.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\mac\mac.cpp">
<Filter>Source Files\mac</Filter>
</ClCompile>
@@ -177,6 +195,9 @@
<ClCompile Include="..\..\src\core\net\ip6_filter.cpp">
<Filter>Source Files\net</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\net\ip6_headers.cpp">
<Filter>Source Files\net</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\net\ip6_mpl.cpp">
<Filter>Source Files\net</Filter>
</ClCompile>
@@ -189,6 +210,9 @@
<ClCompile Include="..\..\src\core\thread\address_resolver.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\child_table.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\data_poll_manager.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
@@ -207,6 +231,12 @@
<ClCompile Include="..\..\src\core\thread\mesh_forwarder.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_ftd.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_mtd.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\mle.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
@@ -228,6 +258,9 @@
<ClCompile Include="..\..\src\core\thread\panid_query_server.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\router_table.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\src_match_controller.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
@@ -297,6 +330,9 @@
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp">
<Filter>Source Files\utils</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\utils\parse_cmdline.cpp">
<Filter>Source Files\utils</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp">
<Filter>Source Files\utils</Filter>
</ClCompile>
@@ -318,6 +354,9 @@
<ClCompile Include="..\..\src\core\thread\announce_begin_server.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\announce_sender.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\crc16.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
@@ -347,6 +386,9 @@
<ClInclude Include="..\..\src\core\common\encoding.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\instance.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\locator.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
@@ -356,9 +398,15 @@
<ClInclude Include="..\..\src\core\common\message.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\notifier.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\new.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\string.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\tasklet.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
@@ -425,6 +473,12 @@
<ClInclude Include="..\..\src\core\thread\announce_begin_server.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\announce_sender.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\child_table.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\data_poll_manager.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
@@ -470,6 +524,9 @@
<ClInclude Include="..\..\src\core\thread\panid_query_server.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\router_table.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\src_match_controller.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
@@ -542,6 +599,9 @@
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp">
<Filter>Header Files\utils</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\utils\parse_cmdline.hpp">
<Filter>Header Files\utils</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp">
<Filter>Header Files\utils</Filter>
</ClInclude>
+26 -6
View File
@@ -45,6 +45,7 @@
OPENTHREAD_FTD=1;
HAVE_STDBOOL_H=1;
HAVE_STDINT_H=1;
OT_STRING_WINDOWS_WORKAROUND=1;
OTBUILD;
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
@@ -81,13 +82,18 @@
<ClCompile Include="..\..\src\core\api\tasklet_api.cpp" />
<ClCompile Include="..\..\src\core\api\thread_api.cpp" />
<ClCompile Include="..\..\src\core\api\thread_ftd_api.cpp" />
<ClCompile Include="..\..\src\core\api\udp_api.cpp" />
<ClCompile Include="..\..\src\core\coap\coap.cpp" />
<ClCompile Include="..\..\src\core\coap\coap_header.cpp" />
<ClCompile Include="..\..\src\core\coap\coap_secure.cpp" />
<ClCompile Include="..\..\src\core\common\crc16.cpp" />
<ClCompile Include="..\..\src\core\common\instance.cpp" />
<ClCompile Include="..\..\src\core\common\locator.cpp" />
<ClCompile Include="..\..\src\core\common\logging.cpp" />
<ClCompile Include="..\..\src\core\common\message.cpp" />
<ClCompile Include="..\..\src\core\common\notifier.cpp" />
<ClCompile Include="..\..\src\core\common\settings.cpp" />
<ClCompile Include="..\..\src\core\common\string.cpp" />
<ClCompile Include="..\..\src\core\common\tasklet.cpp" />
<ClCompile Include="..\..\src\core\common\timer.cpp" />
<ClCompile Include="..\..\src\core\common\tlvs.cpp" />
@@ -111,27 +117,33 @@
<ClCompile Include="..\..\src\core\meshcop\joiner.cpp" />
<ClCompile Include="..\..\src\core\meshcop\joiner_router.cpp" />
<ClCompile Include="..\..\src\core\meshcop\leader.cpp" />
<ClCompile Include="..\..\src\core\meshcop\meshcop.cpp" />
<ClCompile Include="..\..\src\core\meshcop\meshcop_tlvs.cpp" />
<ClCompile Include="..\..\src\core\meshcop\panid_query_client.cpp" />
<ClCompile Include="..\..\src\core\meshcop\timestamp.cpp" />
<ClCompile Include="..\..\src\core\meshcop\meshcop_tlvs.cpp" />
<ClCompile Include="..\..\src\core\net\dhcp6_client.cpp" />
<ClCompile Include="..\..\src\core\net\dhcp6_server.cpp" />
<ClCompile Include="..\..\src\core\net\icmp6.cpp" />
<ClCompile Include="..\..\src\core\net\ip6.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_address.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_filter.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_headers.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_mpl.cpp" />
<ClCompile Include="..\..\src\core\net\ip6_routes.cpp" />
<ClCompile Include="..\..\src\core\net\netif.cpp" />
<ClCompile Include="..\..\src\core\net\udp6.cpp" />
<ClCompile Include="..\..\src\core\thread\address_resolver.cpp" />
<ClCompile Include="..\..\src\core\thread\announce_begin_server.cpp" />
<ClCompile Include="..\..\src\core\thread\announce_sender.cpp" />
<ClCompile Include="..\..\src\core\thread\child_table.cpp" />
<ClCompile Include="..\..\src\core\thread\data_poll_manager.cpp" />
<ClCompile Include="..\..\src\core\thread\energy_scan_server.cpp" />
<ClCompile Include="..\..\src\core\thread\key_manager.cpp" />
<ClCompile Include="..\..\src\core\thread\link_quality.cpp" />
<ClCompile Include="..\..\src\core\thread\lowpan.cpp" />
<ClCompile Include="..\..\src\core\thread\mesh_forwarder.cpp" />
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_ftd.cpp" />
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_mtd.cpp" />
<ClCompile Include="..\..\src\core\thread\mle.cpp" />
<ClCompile Include="..\..\src\core\thread\mle_router.cpp" />
<ClCompile Include="..\..\src\core\thread\network_data.cpp" />
@@ -140,10 +152,12 @@
<ClCompile Include="..\..\src\core\thread\network_data_local.cpp" />
<ClCompile Include="..\..\src\core\thread\network_diagnostic.cpp" />
<ClCompile Include="..\..\src\core\thread\panid_query_server.cpp" />
<ClCompile Include="..\..\src\core\thread\router_table.cpp" />
<ClCompile Include="..\..\src\core\thread\src_match_controller.cpp" />
<ClCompile Include="..\..\src\core\thread\thread_netif.cpp" />
<ClCompile Include="..\..\src\core\thread\topology.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\jam_detector.cpp" />
<ClCompile Include="..\..\src\core\utils\missing_strlcat.c" />
@@ -160,6 +174,7 @@
<ClInclude Include="..\..\include\openthread\dataset_ftd.h" />
<ClInclude Include="..\..\include\openthread\dhcp6_client.h" />
<ClInclude Include="..\..\include\openthread\dhcp6_server.h" />
<ClInclude Include="..\..\include\openthread\error.h" />
<ClInclude Include="..\..\include\openthread\icmp6.h" />
<ClInclude Include="..\..\include\openthread\instance.h" />
<ClInclude Include="..\..\include\openthread\ip6.h" />
@@ -168,14 +183,11 @@
<ClInclude Include="..\..\include\openthread\link.h" />
<ClInclude Include="..\..\include\openthread\message.h" />
<ClInclude Include="..\..\include\openthread\netdata.h" />
<ClInclude Include="..\..\include\openthread\openthread.h" />
<ClInclude Include="..\..\include\openthread\tasklet.h" />
<ClInclude Include="..\..\include\openthread\thread.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\udp.h" />
<ClInclude Include="..\..\src\core\api\link_raw.hpp" />
<ClInclude Include="..\..\src\core\coap\coap.hpp" />
<ClInclude Include="..\..\src\core\coap\coap_header.hpp" />
<ClInclude Include="..\..\src\core\coap\coap_secure.hpp" />
@@ -184,10 +196,13 @@
<ClInclude Include="..\..\src\core\common\crc16.hpp" />
<ClInclude Include="..\..\src\core\common\debug.hpp" />
<ClInclude Include="..\..\src\core\common\encoding.hpp" />
<ClInclude Include="..\..\src\core\common\instance.hpp" />
<ClInclude Include="..\..\src\core\common\locator.hpp" />
<ClInclude Include="..\..\src\core\common\logging.hpp" />
<ClInclude Include="..\..\src\core\common\message.hpp" />
<ClInclude Include="..\..\src\core\common\notifier.hpp" />
<ClInclude Include="..\..\src\core\common\new.hpp" />
<ClInclude Include="..\..\src\core\common\string.hpp" />
<ClInclude Include="..\..\src\core\common\tasklet.hpp" />
<ClInclude Include="..\..\src\core\common\timer.hpp" />
<ClInclude Include="..\..\src\core\common\tlvs.hpp" />
@@ -198,6 +213,7 @@
<ClInclude Include="..\..\src\core\crypto\mbedtls.hpp" />
<ClInclude Include="..\..\src\core\crypto\pbkdf2_cmac.h" />
<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_filter.hpp" />
<ClInclude Include="..\..\src\core\mac\mac_frame.hpp" />
@@ -211,9 +227,10 @@
<ClInclude Include="..\..\src\core\meshcop\joiner.hpp" />
<ClInclude Include="..\..\src\core\meshcop\joiner_router.hpp" />
<ClInclude Include="..\..\src\core\meshcop\leader.hpp" />
<ClInclude Include="..\..\src\core\meshcop\meshcop.hpp" />
<ClInclude Include="..\..\src\core\meshcop\meshcop_tlvs.hpp" />
<ClInclude Include="..\..\src\core\meshcop\panid_query_client.hpp" />
<ClInclude Include="..\..\src\core\meshcop\timestamp.hpp" />
<ClInclude Include="..\..\src\core\meshcop\tlvs.hpp" />
<ClInclude Include="..\..\src\core\net\dhcp6.hpp" />
<ClInclude Include="..\..\src\core\net\dhcp6_client.hpp" />
<ClInclude Include="..\..\src\core\net\dhcp6_server.hpp" />
@@ -228,9 +245,10 @@
<ClInclude Include="..\..\src\core\net\udp6.hpp" />
<ClInclude Include="..\..\src\core\openthread-core-config.h" />
<ClInclude Include="..\..\src\core\openthread-core-default-config.h" />
<ClInclude Include="..\..\src\core\openthread-instance.h" />
<ClInclude Include="..\..\src\core\thread\address_resolver.hpp" />
<ClInclude Include="..\..\src\core\meshcop\announce_begin_server.hpp" />
<ClInclude Include="..\..\src\core\meshcop\announce_sender.hpp" />
<ClInclude Include="..\..\src\core\thread\child_table.hpp" />
<ClInclude Include="..\..\src\core\thread\data_poll_manager.hpp" />
<ClInclude Include="..\..\src\core\thread\energy_scan_server.hpp" />
<ClInclude Include="..\..\src\core\thread\key_manager.hpp" />
@@ -248,12 +266,14 @@
<ClInclude Include="..\..\src\core\thread\network_diagnostic.hpp" />
<ClInclude Include="..\..\src\core\thread\network_diagnostic_tlvs.hpp" />
<ClInclude Include="..\..\src\core\thread\panid_query_server.hpp" />
<ClInclude Include="..\..\src\core\thread\router_table.hpp" />
<ClInclude Include="..\..\src\core\thread\src_match_controller.hpp" />
<ClInclude Include="..\..\src\core\thread\thread_netif.hpp" />
<ClInclude Include="..\..\src\core\thread\thread_tlvs.hpp" />
<ClInclude Include="..\..\src\core\thread\thread_uri_paths.hpp" />
<ClInclude Include="..\..\src\core\thread\topology.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\jam_detector.hpp" />
<ClInclude Include="..\..\src\core\utils\wrap_string.h" />
@@ -117,6 +117,9 @@
<ClCompile Include="..\..\src\core\api\thread_ftd_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\api\udp_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\coap\coap.cpp">
<Filter>Source Files\coap</Filter>
</ClCompile>
@@ -126,6 +129,9 @@
<ClCompile Include="..\..\src\core\coap\coap_secure.cpp">
<Filter>Source Files\coap</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\instance.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\locator.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
@@ -135,6 +141,15 @@
<ClCompile Include="..\..\src\core\common\message.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\notifier.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\settings.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\string.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\tasklet.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
@@ -177,6 +192,9 @@
<ClCompile Include="..\..\src\core\net\ip6_filter.cpp">
<Filter>Source Files\net</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\net\ip6_headers.cpp">
<Filter>Source Files\net</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\net\ip6_mpl.cpp">
<Filter>Source Files\net</Filter>
</ClCompile>
@@ -189,6 +207,9 @@
<ClCompile Include="..\..\src\core\thread\address_resolver.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\child_table.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\data_poll_manager.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
@@ -207,6 +228,12 @@
<ClCompile Include="..\..\src\core\thread\mesh_forwarder.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_ftd.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\mesh_forwarder_mtd.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\mle.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
@@ -231,6 +258,9 @@
<ClCompile Include="..\..\src\core\thread\panid_query_server.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\router_table.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\src_match_controller.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
@@ -297,6 +327,9 @@
<ClCompile Include="..\..\src\core\utils\child_supervision.cpp">
<Filter>Source Files\utils</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\utils\parse_cmdline.cpp">
<Filter>Source Files\utils</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\utils\slaac_address.cpp">
<Filter>Source Files\utils</Filter>
</ClCompile>
@@ -306,6 +339,9 @@
<ClCompile Include="..\..\src\core\thread\announce_begin_server.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\thread\announce_sender.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\meshcop\announce_begin_client.cpp">
<Filter>Source Files\meshcop</Filter>
</ClCompile>
@@ -347,6 +383,9 @@
<ClInclude Include="..\..\src\core\common\encoding.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\instance.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\locator.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
@@ -356,9 +395,15 @@
<ClInclude Include="..\..\src\core\common\message.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\notifier.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\new.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\string.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\tasklet.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
@@ -422,6 +467,9 @@
<ClInclude Include="..\..\src\core\thread\address_resolver.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\child_table.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\data_poll_manager.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
@@ -473,6 +521,9 @@
<ClInclude Include="..\..\src\core\thread\panid_query_server.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\router_table.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\thread\src_match_controller.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
@@ -542,6 +593,9 @@
<ClInclude Include="..\..\src\core\utils\child_supervision.hpp">
<Filter>Header Files\utils</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\utils\parse_cmdline.hpp">
<Filter>Header Files\utils</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\utils\slaac_address.hpp">
<Filter>Header Files\utils</Filter>
</ClInclude>
@@ -551,6 +605,9 @@
<ClInclude Include="..\..\src\core\meshcop\announce_begin_server.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\meshcop\announce_sender.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\meshcop\announce_begin_client.hpp">
<Filter>Header Files\meshcop</Filter>
</ClInclude>
@@ -563,12 +620,6 @@
<ClInclude Include="..\..\src\core\openthread-core-default-config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\openthread-instance.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\openthread\types.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
<ClInclude Include="..\..\examples\drivers\windows\include\openthread-core-windows-config.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -596,6 +647,9 @@
<ClInclude Include="..\..\include\openthread\dhcp6_server.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
<ClInclude Include="..\..\include\openthread\error.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
<ClInclude Include="..\..\include\openthread\icmp6.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
@@ -620,9 +674,6 @@
<ClInclude Include="..\..\include\openthread\netdata.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
<ClInclude Include="..\..\include\openthread\openthread.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
<ClInclude Include="..\..\include\openthread\tasklet.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
@@ -635,7 +686,7 @@
<ClInclude Include="..\..\include\openthread\udp.h">
<Filter>Header Files\openthread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\api\link_raw.hpp">
<ClInclude Include="..\..\src\core\mac\link_raw.hpp">
<Filter>Header Files\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\utils\wrapper_string.h">
-1
View File
@@ -54,7 +54,6 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\third_party\mbedtls\hardware_entropy.c" />
<ClCompile Include="..\..\third_party\mbedtls\repo\library\aes.c" />
<ClCompile Include="..\..\third_party\mbedtls\repo\library\bignum.c" />
<ClCompile Include="..\..\third_party\mbedtls\repo\library\ccm.c" />
@@ -13,9 +13,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\third_party\mbedtls\hardware_entropy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\third_party\mbedtls\repo\library\aes.c">
<Filter>Source Files\repo\library</Filter>
</ClCompile>
+1 -2
View File
@@ -52,12 +52,11 @@
HAVE_STDINT_H=1;
</PreprocessorDefinitions>
<DisableSpecificWarnings>4132;4242;4245;4603;4627;4986;4987;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level4</WarningLevel>
<WarningLevel>Level3</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\third_party\mbedtls\hardware_entropy.c" />
<ClCompile Include="..\..\third_party\mbedtls\repo\library\aes.c" />
<ClCompile Include="..\..\third_party\mbedtls\repo\library\bignum.c" />
<ClCompile Include="..\..\third_party\mbedtls\repo\library\ccm.c" />
@@ -13,9 +13,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\third_party\mbedtls\hardware_entropy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\third_party\mbedtls\repo\library\aes.c">
<Filter>Source Files\repo\library</Filter>
</ClCompile>
-6
View File
@@ -56,11 +56,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "otNodeApi", "otNodeApi.vcxp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "otTestRunner", "otTestRunner.csproj", "{D5577E51-FA31-4802-8669-1DB32805935E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenThread", "OpenThread.vcxproj", "{F8C22844-9B93-4978-80DF-8AF2B37A7ABB}"
ProjectSection(ProjectDependencies) = postProject
{ED0EA262-C222-42C7-98D3-E70C72978ED2} = {ED0EA262-C222-42C7-98D3-E70C72978ED2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spinel_k", "spinel_k.vcxproj", "{A55766B5-58B6-4519-835E-5A4B7C164B5A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ottmp", "ottmp.vcxproj", "{1EAFF7C8-8215-4EDA-83B2-EEB56CECE84D}"
@@ -382,7 +377,6 @@ Global
{CAC8A00E-C6C8-4CF0-BA5A-C9A9A601C6DB} = {61E8A4A0-8138-49DB-97B4-3BEC87C8E133}
{B7C6F344-7287-4930-AF38-223622BD8CBB} = {61E8A4A0-8138-49DB-97B4-3BEC87C8E133}
{D5577E51-FA31-4802-8669-1DB32805935E} = {35F6AB71-5BD2-4D53-8A51-D75CCD4CCC3D}
{F8C22844-9B93-4978-80DF-8AF2B37A7ABB} = {76EA541E-CAB1-4DB5-A39F-E3DB2A78CDDD}
{A55766B5-58B6-4519-835E-5A4B7C164B5A} = {95BD0669-04C8-4EEB-B3CC-0535B03F4468}
{1EAFF7C8-8215-4EDA-83B2-EEB56CECE84D} = {61E8A4A0-8138-49DB-97B4-3BEC87C8E133}
EndGlobalSection
+3 -2
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="openthread.configuration.props" />
<PropertyGroup Label="Globals">
@@ -41,6 +41,7 @@
%(PreprocessorDefinitions);
OPENTHREAD_FTD=1;
OTAPI_EXPORTS;
OPENTHREAD_CONFIG_FILE="openthread-windows-config.h";
</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>
@@ -66,4 +67,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+3 -2
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="openthread.configuration.props" />
<PropertyGroup Label="Globals">
@@ -38,6 +38,7 @@
<ClCompile>
<PreprocessorDefinitions>
%(PreprocessorDefinitions);
OPENTHREAD_CONFIG_FILE="openthread-windows-config.h";
OPENTHREAD_FTD=1;
OTDLL;
</PreprocessorDefinitions>
@@ -66,4 +67,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+3 -2
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="openthread.configuration.props" />
<PropertyGroup Label="Globals">
@@ -38,6 +38,7 @@
<PreprocessorDefinitions>
%(PreprocessorDefinitions);
OPENTHREAD_FTD=1;
OPENTHREAD_CONFIG_FILE="openthread-windows-config.h";
OTAPI_EXPORTS;
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
@@ -75,4 +76,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+297
View File
@@ -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) ""
+9 -7
View File
@@ -42,17 +42,17 @@ OBJCOPY = arm-none-eabi-objcopy
BuildJobs ?= 10
configure_OPTIONS = \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--enable-cli \
--enable-diag \
--with-examples=cc2538 \
--with-platform-info=CC2538 \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--with-ncp-bus=uart \
--enable-radio-only \
--enable-linker-map \
--with-examples=cc2538 \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
@@ -68,6 +68,8 @@ COMMONCFLAGS := \
-I$(CONFIG_FILE_PATH) \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
CPPFLAGS += \
$(COMMONCFLAGS) \
$(target_CPPFLAGS) \
+10 -8
View File
@@ -42,20 +42,20 @@ OBJCOPY = arm-none-eabi-objcopy
BuildJobs ?= 10
configure_OPTIONS = \
--enable-cli-app=mtd \
--enable-ncp-app=mtd \
--enable-cli \
--enable-mtd \
--enable-ncp \
--with-ncp-bus=uart \
--with-examples=cc2650 \
--with-platform-info=cc2650 \
--enable-radio-only \
--enable-linker-map \
--with-examples=cc2650 \
MBEDTLS_CPPFLAGS="$(CC2650_MBEDTLS_CPPFLAGS)" \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
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)/third_party/ti/cc26xxware
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/repo/include
@@ -70,6 +70,8 @@ COMMONCFLAGS := \
$(CC2650_CONFIG_FILE_CPPFLAGS)\
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
CPPFLAGS += \
$(COMMONCFLAGS) \
$(target_CPPFLAGS) \
+297
View File
@@ -0,0 +1,297 @@
#
# Copyright (c) 2017, 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=cc2652 \
MBEDTLS_CPPFLAGS="$(CC2652_MBEDTLS_CPPFLAGS)" \
$(NULL)
DEFAULT_LOGGING ?= 1
CC2652_MBEDTLS_CPPFLAGS = \
-DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"' \
-DMBEDTLS_USER_CONFIG_FILE='\"cc2652-mbedtls-config.h\"' \
-I$(PWD)/examples/platforms/cc2652/crypto \
-I$(PWD)/third_party/ti/devices/cc13x2_cc26x2 \
-I$(PWD)/third_party/mbedtls \
-I$(PWD)/third_party/mbedtls/repo/include \
$(NULL)
CC2652_CONFIG_FILE_CPPFLAGS = \
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-cc2652-config.h\"' \
-I$(PWD)/examples/platforms/cc2652/ \
$(NULL)
COMMONCFLAGS := \
-fdata-sections \
-ffunction-sections \
-Os \
-g \
$(CC2652_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 = cc2652
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) ""
+24 -6
View File
@@ -42,19 +42,35 @@ OBJCOPY = arm-none-eabi-objcopy
BuildJobs ?= 10
configure_OPTIONS = \
--enable-cli-app=all \
--enable-ncp-app=all \
--enable-cli \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--with-ncp-bus=uart \
--with-examples=da15000 \
--with-platform-info=DA15000 \
--enable-radio-only \
--enable-linker-map \
--with-examples=da15000 \
MBEDTLS_CPPFLAGS="$(DA15000_MBEDTLS_CPPFLAGS)" \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
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)/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/adapters/include
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/bsp/memory/include
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/interfaces/ftdf/include
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/bsp/config
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/dialog/DialogSDK/interfaces/ftdf/src
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/mbedtls/repo/include
DA15000_MBEDTLS_CPPFLAGS += -I$(PWD)/third_party/mbedtls
DA15000_MBEDTLS_CPPFLAGS += -include$(PWD)/examples/platforms/da15000/custom_config_qspi.h
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-da15000-config.h\"'
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/da15000/
@@ -67,6 +83,8 @@ COMMONCFLAGS := \
-I$(CONFIG_FILE_PATH) \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
CPPFLAGS += \
$(COMMONCFLAGS) \
$(target_CPPFLAGS) \
+39 -13
View File
@@ -42,36 +42,58 @@ OBJCOPY = arm-none-eabi-objcopy
BuildJobs ?= 10
configure_OPTIONS = \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--enable-cli \
--enable-diag \
--with-examples=efr32 \
--with-platform-info=EFR32 \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--with-ncp-bus=uart \
--enable-radio-only \
--enable-linker-map \
--with-examples=efr32 \
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
#
# Differentiate between boards
# - BRD4304A / SLWSTK6000B / MGM12P Module
# - BRD4161A / SLWSTK6000B / Wireless Starter Kit
# - BRD4166A / SLTB004A / Thunderboard Sense 2
#
ifeq ($(BOARD),BRD4304A)
MCU = EFR32MG12P432F1024GM48
else
ifeq ($(BOARD),BRD4161A)
MCU = EFR32MG12P432F1024GL125
else
ifeq ($(BOARD),BRD4166A)
MCU = EFR32MG12P332F1024GL125
else
$(error Please provide a value for BOARD variable e.g BOARD=BRD4161A (currently supported BRD4304A, BRD4161A or BRD4166A) )
endif
endif
endif
EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
EFR32_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"efr32-mbedtls-config.h\"'
EFR32_MBEDTLS_CPPFLAGS += -DEFR32MG12P432F1024GL125
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/crypto
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v1.1/util/third_party/mbedtls/configs
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v1.1/platform/CMSIS/Include
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v1.1/util/third_party/mbedtls/sl_crypto/include
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v1.1/platform/Device/SiliconLabs/EFR32MG12P/Include
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v1.1/platform/emlib/inc
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.3/platform/CMSIS/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.3/platform/Device/SiliconLabs/EFR32MG12P/Include
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/repo/include
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-efr32-config.h\"'
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32/
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(shell echo $(BOARD) | tr A-Z a-z)
COMMONCFLAGS := \
-fdata-sections \
@@ -80,8 +102,12 @@ COMMONCFLAGS := \
-g \
-D$(CONFIG_FILE) \
-I$(CONFIG_FILE_PATH) \
-I$(HAL_CONF_DIR) \
-D$(MCU) \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
CPPFLAGS += \
$(COMMONCFLAGS) \
$(target_CPPFLAGS) \
+8 -24
View File
@@ -42,34 +42,16 @@ OBJCOPY = arc-elf32-objcopy
BuildJobs ?= 10
configure_OPTIONS = \
--enable-cli-app=all \
--enable-ncp-app=all \
--enable-cli \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--with-ncp-bus=uart \
--with-examples=emsk \
--with-platform-info=EMSK \
--enable-radio-only \
--enable-linker-map \
--with-examples=emsk \
$(NULL)
ifeq ($(CERT_LOG),1)
configure_OPTIONS += --enable-cert-log
endif
ifeq ($(COMMISSIONER),1)
configure_OPTIONS += --enable-commissioner
endif
ifeq ($(JOINER),1)
configure_OPTIONS += --enable-joiner
endif
ifeq ($(DHCP6_SERVER),1)
configure_OPTIONS += --enable-dhcp6-server
endif
ifeq ($(DHCP6_CLIENT),1)
configure_OPTIONS += --enable-dhcp6-client
endif
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
@@ -85,6 +67,8 @@ COMMONCFLAGS := \
-I$(CONFIG_FILE_PATH) \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
CPPFLAGS += \
$(COMMONCFLAGS) \
$(target_CPPFLAGS) \
+5 -4
View File
@@ -30,7 +30,6 @@
TARGET = arm-bcm2708hardfp-linux-gnueabi
PPREFIX = gp712
INFO = GP712
#CROSS_COMPILE = $(TARGET)-
AR = $(CROSS_COMPILE)ar
@@ -47,14 +46,14 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
BuildJobs ?= 9
configure_OPTIONS = \
--enable-cli-app=ftd \
--enable-cli \
--enable-diag \
--enable-ftd \
--enable-mtd \
--with-examples=$(PPREFIX) \
--with-platform-info=$(INFO) \
$(NULL)
DEFAULT_LOGGING ?= 1
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
ifeq ($(CLI_LOGGING),1)
configure_OPTIONS += --enable-cli-logging
@@ -73,6 +72,8 @@ COMMONCFLAGS := \
-Wall \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
CPPFLAGS += \
$(COMMONCFLAGS) \
$(target_CPPFLAGS) \
+9 -7
View File
@@ -42,17 +42,17 @@ OBJCOPY = arm-none-eabi-objcopy
BuildJobs ?= 10
configure_OPTIONS = \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--enable-cli \
--enable-diag \
--with-examples=kw41z \
--with-platform-info=KW41Z \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--with-ncp-bus=uart \
--enable-radio-only \
--enable-linker-map \
--with-examples=kw41z \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
@@ -68,6 +68,8 @@ COMMONCFLAGS := \
-I$(CONFIG_FILE_PATH) \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
CPPFLAGS += \
$(COMMONCFLAGS) \
$(target_CPPFLAGS) \
+42 -10
View File
@@ -40,33 +40,47 @@ RANLIB = arm-none-eabi-ranlib
OBJCOPY = arm-none-eabi-objcopy
BuildJobs ?= 10
GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.`)
configure_OPTIONS = \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--enable-cli \
--enable-diag \
--with-examples=nrf52840 \
--with-platform-info=NRF52840 \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--enable-linker-map \
--with-examples=nrf52840 \
MBEDTLS_CPPFLAGS="$(NRF52840_MBEDTLS_CPPFLAGS)" \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
ifdef SRC_PATH
configure_OPTIONS += --srcdir="$(SRC_PATH)"
endif
ifeq ($(NCP_SPI),1)
configure_OPTIONS += --with-ncp-bus=spi
else
configure_OPTIONS += --with-ncp-bus=uart
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))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
NRF52840_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
NRF52840_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"nrf52840-mbedtls-config.h\"'
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/nrf52840/crypto
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/crypto
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_cc310/include
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/nrfx/mdk
NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/cmsis
NRF52840_MBEDTLS_CPPFLAGS += -DNRF52840_XXAA
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-nrf52840-config.h\"'
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/nrf52840/
@@ -80,8 +94,26 @@ COMMONCFLAGS := \
-I$(CONFIG_FILE_PATH) \
$(NULL)
ifeq ($(CERT_LOG),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT=1
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
ifneq ($(CERT_LOG),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
endif
ifeq ($(USB),1)
COMMONCFLAGS += -DUSB_CDC_AS_SERIAL_TRANSPORT=1
endif
ifeq ($(DISABLE_CC310), 1)
NRF52840_MBEDTLS_CPPFLAGS += -DDISABLE_CC310=1
endif
ifeq ($(DISABLE_SPI),1)
COMMONCFLAGS += -DSPIS_TRANSPORT_DISABLE=1
endif
ifeq ($(shell expr $(GCCVersion) \>= 7), 1)
COMMONCFLAGS += -Wno-expansion-to-defined
endif
CPPFLAGS += \
+43 -31
View File
@@ -41,6 +41,38 @@ RM_F := rm -f
BuildJobs ?= 10
# If the user has asserted COVERAGE, alter the configuration options
# accordingly.
configure_OPTIONS = \
--enable-application-coap \
--enable-application-coap-secure \
--enable-border-agent \
--enable-border-router \
--enable-cert-log \
--enable-child-supervision \
--enable-cli \
--enable-commissioner \
--enable-dhcp6-client \
--enable-dhcp6-server \
--enable-diag \
--enable-dns-client \
--enable-ftd \
--enable-jam-detection \
--enable-joiner \
--enable-legacy \
--enable-mac-filter \
--enable-mtd \
--enable-mtd-network-diagnostic \
--enable-ncp \
--with-ncp-bus=uart \
--enable-radio-only \
--enable-raw-link-api \
--enable-service \
--enable-udp-proxy \
--with-examples=posix \
$(NULL)
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
@@ -54,6 +86,16 @@ COMMONCFLAGS := \
-I$(CONFIG_FILE_PATH) \
$(NULL)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
ifeq ($(VIRTUAL_TIME),1)
COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME=1
endif
ifeq ($(VIRTUAL_TIME_UART),1)
COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME_UART=1
endif
CPPFLAGS += \
$(COMMONCFLAGS) \
$(NULL)
@@ -73,9 +115,6 @@ LDFLAGS += \
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)
@@ -84,34 +123,7 @@ ResultPath = output
TopResultDir = $(ResultPath)
AbsTopResultDir = $(PWD)/$(TopResultDir)
TargetTuple = $(shell ${AbsTopSourceDir}/third_party/nlbuild-autotools/repo/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g')
# If the user has asserted COVERAGE, alter the configuration options
# accordingly.
configure_OPTIONS = \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--with-examples=posix \
--with-platform-info=POSIX \
--enable-application-coap \
--enable-border-router \
--enable-cert-log \
--enable-child-supervision \
--enable-commissioner \
--enable-dhcp6-client \
--enable-dhcp6-server \
--enable-diag \
--enable-dns-client \
--enable-jam-detection \
--enable-joiner \
--enable-legacy \
--enable-mac-filter \
--enable-mtd-network-diagnostic \
--enable-raw-link-api \
--enable-tmf-proxy \
$(NULL)
TargetTuple = $(shell ${AbsTopSourceDir}/third_party/nlbuild-autotools/repo/third_party/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g')
ifndef BuildJobs
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
+264
View File
@@ -0,0 +1,264 @@
#
# Copyright (c) 2017, 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 \
--enable-linker-map \
--with-examples=samr21 \
$(NULL)
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-samr21-config.h\"'
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/samr21/
COMMONCFLAGS := \
-fdata-sections \
-ffunction-sections \
-Os \
-g \
-D$(CONFIG_FILE) \
-I$(CONFIG_FILE_PATH) \
$(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) \
-specs=nano.specs \
-specs=nosys.specs \
-Wl,--gc-sections \
-Wl,--entry=Reset_Handler \
$(NULL)
ECHO := @echo
MAKE := make
MKDIR_P := mkdir -p
LN_S := ln -s
RM_F := rm -f
INSTALL := /usr/bin/install
INSTALLFLAGS := -p
BuildPath = build
TopBuildDir = $(BuildPath)
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
ResultPath = output
TopResultDir = $(ResultPath)
AbsTopResultDir = $(PWD)/$(TopResultDir)
TargetTuple = samr21
ARCHS = cortex-m0plus
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-m0plus
#
cortex-m0plus_target_ABI = cortex-m0plus
cortex-m0plus_target_CPPFLAGS = -mcpu=cortex-m0plus -mfloat-abi=soft -mthumb
cortex-m0plus_target_CFLAGS = -mcpu=cortex-m0plus -mfloat-abi=soft -mthumb
cortex-m0plus_target_CXXFLAGS = -mcpu=cortex-m0plus -mfloat-abi=soft -mthumb
cortex-m0plus_target_LDFLAGS = -mcpu=cortex-m0plus -mfloat-abi=soft -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) ""
+2 -2
View File
@@ -41,11 +41,11 @@ EXTRA_DIST = \
# Always build (e.g. for 'make all') these subdirectories.
if OPENTHREAD_ENABLE_EXAMPLES
SUBDIRS = \
platforms \
$(NULL)
if OPENTHREAD_EXAMPLES
SUBDIRS += \
apps \
$(NULL)
+26 -98
View File
@@ -27,23 +27,27 @@
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
include $(top_srcdir)/examples/platforms/Makefile.platform.am
bin_PROGRAMS = \
$(NULL)
CPPFLAGS_COMMON = \
CPPFLAGS_COMMON += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/core \
-I$(top_srcdir)/examples/platforms \
$(NULL)
LDADD_COMMON = \
LDADD_COMMON += \
$(NULL)
LDFLAGS_COMMON = \
LDFLAGS_COMMON += \
$(NULL)
SOURCES_COMMON = \
LIBTOOLFLAGS_COMMON += \
$(NULL)
SOURCES_COMMON += \
main.c \
$(NULL)
@@ -59,99 +63,7 @@ LDADD_COMMON += \
$(NULL)
endif # OPENTHREAD_ENABLE_DIAG
if OPENTHREAD_EXAMPLES_POSIX
LDADD_COMMON += \
$(top_builddir)/examples/platforms/posix/libopenthread-posix.a \
-lstdc++ \
$(NULL)
endif # OPENTHREAD_EXAMPLES_POSIX
if OPENTHREAD_EXAMPLES_CC2538
LDADD_COMMON += \
$(top_builddir)/examples/platforms/cc2538/libopenthread-cc2538.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/cc2538/cc2538.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_CC2538
if OPENTHREAD_EXAMPLES_CC2650
CPPFLAGS_COMMON += \
-I$(top_srcdir)/third_party/ti/cc26xxware \
$(NULL)
LDADD_COMMON += \
$(top_builddir)/examples/platforms/cc2650/libopenthread-cc2650.a \
$(top_srcdir)/third_party/ti/cc26xxware/driverlib/bin/gcc/driverlib.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/third_party/ti/cc26xxware/linker_files/cc26x0f128.lds \
$(NULL)
endif #OPENTHREAD_EXAMPLES_CC2650
if OPENTHREAD_EXAMPLES_DA15000
LDADD_COMMON += \
$(top_builddir)/examples/platforms/da15000/libopenthread-da15000.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/da15000/da15000.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_DA15000
if OPENTHREAD_EXAMPLES_EFR32
LDADD_COMMON += \
$(top_builddir)/examples/platforms/efr32/libopenthread-efr32.a \
$(top_srcdir)/third_party/silabs/gecko_sdk_suite/v1.1/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg12_gcc_release.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/third_party/silabs/gecko_sdk_suite/v1.1/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/efr32mg12p.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_EFR32
if OPENTHREAD_EXAMPLES_EMSK
LDADD_COMMON += \
$(top_builddir)/examples/platforms/emsk/libopenthread-emsk.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/emsk/emsk.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_EMSK
if OPENTHREAD_EXAMPLES_GP712
LDADD_COMMON += \
$(top_builddir)/examples/platforms/gp712/libopenthread-gp712.a \
$(top_srcdir)/third_party/Qorvo/gp712/libQorvoRPi.a \
$(NULL)
endif # OPENTHREAD_EXAMPLES_GP712
if OPENTHREAD_EXAMPLES_NRF52840
LDADD_COMMON += \
$(top_builddir)/examples/platforms/nrf52840/libopenthread-nrf52840.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/nrf52840/nrf52840.ld \
$(NULL)
endif
if OPENTHREAD_EXAMPLES_KW41Z
LDADD_COMMON += \
$(top_builddir)/examples/platforms/kw41z/libopenthread-kw41z.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/kw41z/MKW41Z512xxx4.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_KW41Z
if OPENTHREAD_ENABLE_CLI_FTD
if OPENTHREAD_ENABLE_FTD
bin_PROGRAMS += \
ot-cli-ftd \
$(NULL)
@@ -165,17 +77,23 @@ ot_cli_ftd_LDADD = \
$(top_builddir)/src/cli/libopenthread-cli-ftd.a \
$(top_builddir)/src/core/libopenthread-ftd.a \
$(LDADD_COMMON) \
$(top_builddir)/src/core/libopenthread-ftd.a \
$(LDADD_COMMON) \
$(NULL)
ot_cli_ftd_LDFLAGS = \
$(LDFLAGS_COMMON) \
$(NULL)
ot_cli_ftd_LIBTOOLFLAGS = \
$(LIBTOOLFLAGS_COMMON) \
$(NULL)
ot_cli_ftd_SOURCES = \
$(SOURCES_COMMON) \
$(NULL)
if OPENTHREAD_ENABLE_CLI_MTD
if OPENTHREAD_ENABLE_MTD
bin_PROGRAMS += \
ot-cli-mtd \
$(NULL)
@@ -189,12 +107,18 @@ ot_cli_mtd_LDADD = \
$(top_builddir)/src/cli/libopenthread-cli-mtd.a \
$(top_builddir)/src/core/libopenthread-mtd.a \
$(LDADD_COMMON) \
$(top_builddir)/src/core/libopenthread-mtd.a \
$(LDADD_COMMON) \
$(NULL)
ot_cli_mtd_LDFLAGS = \
$(LDFLAGS_COMMON) \
$(NULL)
ot_cli_mtd_LIBTOOLFLAGS = \
$(LIBTOOLFLAGS_COMMON) \
$(NULL)
ot_cli_mtd_SOURCES = \
$(SOURCES_COMMON) \
$(NULL)
@@ -205,6 +129,10 @@ ot_cli_mtd_LDFLAGS += -Wl,-Ma
endif
if OPENTHREAD_BUILD_COVERAGE
CPPFLAGS_COMMON += \
-DOPENTHREAD_ENABLE_COVERAGE \
$(NULL)
CLEANFILES = $(wildcard *.gcda *.gcno)
endif # OPENTHREAD_BUILD_COVERAGE
+55 -12
View File
@@ -26,14 +26,25 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <openthread/config.h>
#include <assert.h>
#include <openthread-core-config.h>
#include <openthread/config.h>
#include <openthread/cli.h>
#include <openthread/diag.h>
#include <openthread/openthread.h>
#include <openthread/platform/platform.h>
#include <openthread/tasklet.h>
#include <openthread/platform/logging.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
void *otPlatCAlloc(size_t aNum, size_t aSize)
@@ -56,12 +67,25 @@ int main(int argc, char *argv[])
{
otInstance *sInstance;
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
size_t otInstanceBufferLength = 0;
uint8_t *otInstanceBuffer = NULL;
#if OPENTHREAD_EXAMPLES_POSIX
if (setjmp(gResetJump))
{
alarm(0);
#if OPENTHREAD_ENABLE_COVERAGE
__gcov_flush();
#endif
execvp(argv[0], argv);
}
#endif
PlatformInit(argc, argv);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
size_t otInstanceBufferLength = 0;
uint8_t *otInstanceBuffer = NULL;
#endif
pseudo_reset:
otSysInit(argc, argv);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
// Call to query the buffer size
@@ -84,16 +108,35 @@ int main(int argc, char *argv[])
otDiagInit(sInstance);
#endif
while (1)
while (!otSysPseudoResetWasRequested())
{
otTaskletsProcess(sInstance);
PlatformProcessDrivers(sInstance);
otSysProcessDrivers(sInstance);
}
// otInstanceFinalize(sInstance);
otInstanceFinalize(sInstance);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
// free(otInstanceBuffer);
free(otInstanceBuffer);
#endif
goto pseudo_reset;
return 0;
}
/*
* Provide, if required an "otPlatLog()" function
*/
#if OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_APP
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
{
OT_UNUSED_VARIABLE(aLogLevel);
OT_UNUSED_VARIABLE(aLogRegion);
OT_UNUSED_VARIABLE(aFormat);
va_list ap;
va_start(ap, aFormat);
otCliPlatLogv(aLogLevel, aLogRegion, aFormat, ap);
va_end(ap);
}
#endif
+76 -89
View File
@@ -27,123 +27,55 @@
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
include $(top_srcdir)/examples/platforms/Makefile.platform.am
bin_PROGRAMS = \
$(NULL)
CPPFLAGS_COMMON = \
CPPFLAGS_COMMON += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/core \
-I$(top_srcdir)/examples/platforms \
$(NULL)
LDADD_COMMON = \
LDADD_COMMON += \
$(NULL)
LDFLAGS_COMMON = \
LDFLAGS_COMMON += \
$(NULL)
SOURCES_COMMON = \
LIBTOOLFLAGS_COMMON += \
$(NULL)
SOURCES_COMMON += \
main.c \
$(NULL)
LDADD_MBEDTLS = \
$(NULL)
LDADD_DIAG = \
$(NULL)
if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
LDADD_COMMON += \
LDADD_MBEDTLS += \
$(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
$(NULL)
endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
if OPENTHREAD_ENABLE_DIAG
LDADD_COMMON += \
LDADD_DIAG += \
$(top_builddir)/src/diag/libopenthread-diag.a \
$(NULL)
endif
if OPENTHREAD_EXAMPLES_POSIX
if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
LDADD_COMMON += \
$(top_builddir)/examples/platforms/posix/libopenthread-posix.a \
-lstdc++ \
$(OPENTHREAD_NCP_SPINEL_ENCRYPTER_LIBS) \
$(NULL)
endif # OPENTHREAD_EXAMPLES_POSIX
endif # OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
if OPENTHREAD_EXAMPLES_CC2538
LDADD_COMMON += \
$(top_builddir)/examples/platforms/cc2538/libopenthread-cc2538.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/cc2538/cc2538.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_CC2538
if OPENTHREAD_EXAMPLES_CC2650
CPPFLAGS_COMMON += \
-I$(top_srcdir)/third_party/ti/cc26xxware \
$(NULL)
LDADD_COMMON += \
$(top_builddir)/examples/platforms/cc2650/libopenthread-cc2650.a \
$(top_srcdir)/third_party/ti/cc26xxware/driverlib/bin/gcc/driverlib.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/third_party/ti/cc26xxware/linker_files/cc26x0f128.lds \
$(NULL)
endif # OPENTHREAD_EXAMPLES_CC2650
if OPENTHREAD_EXAMPLES_DA15000
LDADD_COMMON += \
$(top_builddir)/examples/platforms/da15000/libopenthread-da15000.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/da15000/da15000.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_DA15000
if OPENTHREAD_EXAMPLES_EFR32
LDADD_COMMON += \
$(top_builddir)/examples/platforms/efr32/libopenthread-efr32.a \
$(top_srcdir)/third_party/silabs/gecko_sdk_suite/v1.1/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg12_gcc_release.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/third_party/silabs/gecko_sdk_suite/v1.1/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/efr32mg12p.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_EFR32
if OPENTHREAD_EXAMPLES_EMSK
LDADD_COMMON += \
$(top_builddir)/examples/platforms/emsk/libopenthread-emsk.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/emsk/emsk.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_EMSK
if OPENTHREAD_EXAMPLES_NRF52840
LDADD_COMMON += \
$(top_builddir)/examples/platforms/nrf52840/libopenthread-nrf52840.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/nrf52840/nrf52840.ld \
$(NULL)
endif
if OPENTHREAD_EXAMPLES_KW41Z
LDADD_COMMON += \
$(top_builddir)/examples/platforms/kw41z/libopenthread-kw41z.a \
$(NULL)
LDFLAGS_COMMON += \
-T $(top_srcdir)/examples/platforms/kw41z/MKW41Z512xxx4.ld \
$(NULL)
endif # OPENTHREAD_EXAMPLES_KW41Z
if OPENTHREAD_ENABLE_NCP_FTD
if OPENTHREAD_ENABLE_FTD
bin_PROGRAMS += \
ot-ncp-ftd \
$(NULL)
@@ -157,17 +89,27 @@ ot_ncp_ftd_LDADD = \
$(top_builddir)/src/ncp/libopenthread-ncp-ftd.a \
$(top_builddir)/src/core/libopenthread-ftd.a \
$(LDADD_COMMON) \
$(LDADD_MBEDTLS) \
$(LDADD_DIAG) \
$(top_builddir)/src/core/libopenthread-ftd.a \
$(LDADD_COMMON) \
$(LDADD_MBEDTLS) \
$(LDADD_DIAG) \
$(NULL)
ot_ncp_ftd_LDFLAGS = \
$(LDFLAGS_COMMON) \
$(NULL)
ot_ncp_ftd_LIBTOOLFLAGS = \
$(LIBTOOLFLAGS_COMMON) \
$(NULL)
ot_ncp_ftd_SOURCES = \
$(SOURCES_COMMON) \
$(NULL)
if OPENTHREAD_ENABLE_NCP_MTD
if OPENTHREAD_ENABLE_MTD
bin_PROGRAMS += \
ot-ncp-mtd \
$(NULL)
@@ -181,22 +123,67 @@ ot_ncp_mtd_LDADD = \
$(top_builddir)/src/ncp/libopenthread-ncp-mtd.a \
$(top_builddir)/src/core/libopenthread-mtd.a \
$(LDADD_COMMON) \
$(LDADD_MBEDTLS) \
$(LDADD_DIAG) \
$(top_builddir)/src/core/libopenthread-mtd.a \
$(LDADD_COMMON) \
$(LDADD_MBEDTLS) \
$(LDADD_DIAG) \
$(NULL)
ot_ncp_mtd_LDFLAGS = \
$(LDFLAGS_COMMON) \
$(NULL)
ot_ncp_mtd_LIBTOOLFLAGS = \
$(LIBTOOLFLAGS_COMMON) \
$(NULL)
ot_ncp_mtd_SOURCES = \
$(SOURCES_COMMON) \
$(NULL)
if OPENTHREAD_ENABLE_RADIO_ONLY
bin_PROGRAMS += \
ot-ncp-radio \
$(NULL)
endif
ot_ncp_radio_CPPFLAGS = \
$(CPPFLAGS_COMMON) \
$(NULL)
ot_ncp_radio_LDADD = \
$(top_builddir)/src/ncp/libopenthread-ncp-radio.a \
$(top_builddir)/src/core/libopenthread-radio.a \
$(LDADD_COMMON) \
$(top_builddir)/src/core/libopenthread-radio.a \
$(LDADD_COMMON) \
$(NULL)
ot_ncp_radio_LDFLAGS = \
$(LDFLAGS_COMMON) \
$(NULL)
ot_ncp_radio_LIBTOOLFLAGS = \
$(LIBTOOLFLAGS_COMMON) \
$(NULL)
ot_ncp_radio_SOURCES = \
$(SOURCES_COMMON) \
$(NULL)
if OPENTHREAD_ENABLE_LINKER_MAP
ot_ncp_ftd_LDFLAGS += -Wl,-Map=ot-ncp-ftd.map
ot_ncp_mtd_LDFLAGS += -Wl,-Map=ot-ncp-mtd.map
ot_ncp_radio_LDFLAGS += -Wl,-Map=ot-ncp-radio.map
endif
if OPENTHREAD_BUILD_COVERAGE
CPPFLAGS_COMMON += \
-DOPENTHREAD_ENABLE_COVERAGE \
$(NULL)
CLEANFILES = $(wildcard *.gcda *.gcno)
endif # OPENTHREAD_BUILD_COVERAGE
+50 -12
View File
@@ -26,14 +26,24 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <openthread/config.h>
#include <assert.h>
#include <openthread-core-config.h>
#include <openthread/config.h>
#include <openthread/diag.h>
#include <openthread/ncp.h>
#include <openthread/openthread.h>
#include <openthread/platform/platform.h>
#include <openthread/tasklet.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
void *otPlatCAlloc(size_t aNum, size_t aSize)
@@ -56,12 +66,25 @@ int main(int argc, char *argv[])
{
otInstance *sInstance;
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
size_t otInstanceBufferLength = 0;
uint8_t *otInstanceBuffer = NULL;
#if OPENTHREAD_EXAMPLES_POSIX
if (setjmp(gResetJump))
{
alarm(0);
#if OPENTHREAD_ENABLE_COVERAGE
__gcov_flush();
#endif
execvp(argv[0], argv);
}
#endif
PlatformInit(argc, argv);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
size_t otInstanceBufferLength = 0;
uint8_t *otInstanceBuffer = NULL;
#endif
pseudo_reset:
otSysInit(argc, argv);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
// Call to query the buffer size
@@ -84,16 +107,31 @@ int main(int argc, char *argv[])
otDiagInit(sInstance);
#endif
while (1)
while (!otSysPseudoResetWasRequested())
{
otTaskletsProcess(sInstance);
PlatformProcessDrivers(sInstance);
otSysProcessDrivers(sInstance);
}
// otInstanceFinalize(sInstance);
otInstanceFinalize(sInstance);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
// free(otInstanceBuffer);
free(otInstanceBuffer);
#endif
goto pseudo_reset;
return 0;
}
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_APP)
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
{
OT_UNUSED_VARIABLE(aLogLevel);
OT_UNUSED_VARIABLE(aLogRegion);
va_list ap;
va_start(ap, aFormat);
otNcpPlatLogv(aLogLevel, aLogRegion, aFormat, ap);
va_end(ap);
}
#endif
+9 -6
View File
@@ -29,7 +29,6 @@
#pragma once
#define OTDLL 1
#include <openthread/openthread.h>
#include <openthread/border_router.h>
#include <openthread/thread_ftd.h>
#include <openthread/commissioner.h>
@@ -72,7 +71,7 @@ public enum class otLinkModeFlags : unsigned int
None = 0,
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. */
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. */
};
@@ -148,13 +147,17 @@ public:
#pragma region Link Layer
property signed int /*int8_t*/ MaxTransmitPower
property signed int /*int8_t*/ TransmitPower
{
signed int get() { return otLinkGetMaxTransmitPower(DeviceInstance); }
signed int get() {
int8_t value;
ThrowOnFailure(otPlatRadioGetTransmitPower(DeviceInstance, &value));
return value;
}
void set(signed int value)
{
if (value > 127) throw Exception::CreateException(E_INVALIDARG);
otLinkSetMaxTransmitPower(DeviceInstance, (int8_t)value);
ThrowOnFailure(otPlatRadioSetTransmitPower(DeviceInstance, (int8_t)value);
}
}
@@ -211,7 +214,7 @@ public:
uint64_t get()
{
uint64_t addr;
otLinkGetJoinerId(DeviceInstance, (otExtAddress*)&addr);
otJoinerGetId(DeviceInstance, (otExtAddress*)&addr);
return addr;
}
}
+53 -2
View File
@@ -26,8 +26,8 @@
# POSSIBILITY OF SUCH DAMAGE.
#
ifeq ($(TMF_PROXY),1)
configure_OPTIONS += --enable-tmf-proxy
ifeq ($(BORDER_AGENT),1)
configure_OPTIONS += --enable-border-agent
endif
ifeq ($(BORDER_ROUTER),1)
@@ -35,6 +35,7 @@ configure_OPTIONS += --enable-border-router
endif
ifeq ($(CERT_LOG),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_APP
configure_OPTIONS += --enable-cert-log
endif
@@ -42,6 +43,10 @@ ifeq ($(COAP),1)
configure_OPTIONS += --enable-application-coap
endif
ifeq ($(COAPS),1)
configure_OPTIONS += --enable-application-coap-secure
endif
ifeq ($(COMMISSIONER),1)
configure_OPTIONS += --enable-commissioner
endif
@@ -82,6 +87,10 @@ ifeq ($(LEGACY),1)
configure_OPTIONS += --enable-legacy
endif
ifeq ($(LINK_RAW),1)
configure_OPTIONS += --enable-raw-link-api
endif
ifeq ($(MAC_FILTER),1)
configure_OPTIONS += --enable-mac-filter
endif
@@ -89,3 +98,45 @@ endif
ifeq ($(MTD_NETDIAG),1)
configure_OPTIONS += --enable-mtd-network-diagnostic
endif
ifeq ($(SERVICE),1)
configure_OPTIONS += --enable-service
endif
ifeq ($(UDP_PROXY),1)
configure_OPTIONS += --enable-udp-proxy
endif
ifeq ($(DEBUG_UART),1)
CFLAGS += -DOPENTHREAD_CONFIG_ENABLE_DEBUG_UART=1
CXXFLAGS += -DOPENTHREAD_CONFIG_ENABLE_DEBUG_UART=1
endif
ifeq ($(DEBUG_UART_LOG),1)
CFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART
CXXFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART
endif
ifeq ($(FULL_LOGS),1)
# HINT: Add more here, or comment out ones you do not need/want
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_API=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_ARP=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_CLI=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_COAP=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_ICMP=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_IP6=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MAC=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MEM=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MLE=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_NETDATA=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_NETDIAG=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_PKT_DUMP=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_PLATFORM=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_PREPEND_REGION=1
endif
CFLAGS += ${LOG_FLAGS}
CXXFLAGS += ${LOG_FLAGS}
+151 -36
View File
@@ -1,54 +1,169 @@
# OpenThread on Windows #
These components are the building blocks to get OpenThread integrated into the Windows
networking stack and provide an interface for applications to control it.
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 ##
[ndis]: https://msdn.microsoft.com/en-us/windows/hardware/drivers/network/ndis-drivers
[lwf]: https://msdn.microsoft.com/en-us/windows/hardware/drivers/network/ndis-filter-drivers
[miniport]: https://msdn.microsoft.com/en-us/windows/hardware/drivers/network/ndis-miniport-drivers2
[ioctl]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa363219(v=vs.85).aspx
[oid]: https://msdn.microsoft.com/en-us/library/windows/hardware/ff566707(v=vs.85).aspx
[nbl]: https://msdn.microsoft.com/en-us/windows/hardware/drivers/network/net-buffer-architecture
Details on the architecture can be found [here](https://openthread.io/platforms/windows10).
![Windows Architecture](../../../doc/images/windows_design.png)
## Building OpenThread using Windows
This design allows for support of both simple radio devices and devices running the complete
OpenThread stack.
To build locally using the Windows platform, use Visual Studio 2015. To build for the POSIX and TI CC2538 platforms, use Bash on Ubuntu on Windows.
### otApi.dll ###
All the following steps assume you have already cloned and checked out a branch.
This is the dynamic libray for applications to control the OpenThread stack from user mode. It
exposes all the control path APIs from `openthread.h`. It interfaces with the driver by the use
of [IOCTL][ioctl]s. The IOCTLs allow otApi.dll to serialize and send commands, and poll for notifications,
which can then be returned back to the client.
### Visual Studio 2015
### otLwf.sys ###
To build OpenThread on Windows you need to install the following:
This is where most of the real logic lives. `otLwf.sys` is an [NDIS][ndis] Light Weight Filter ([LWF][lwf]) driver.
It plugs into the networking stack, binding to a protocol driver (TCPIP) at the top, and an NDIS [Miniport][miniport]
at the bottom. It's job is to take IPv6 packets from TCPIP and pass the necessary data down to the Miniport
in order to send the packets out over the network.
* Any Visual Studio 2015 edition. The [Community](https://www.microsoft.com/en-us/download/details.aspx?id=48146) edition is free. Generally most of the optional features will be required.
* The [Windows 10 Driver Kit](https://go.microsoft.com/fwlink/p/?LinkId=526733).
`otLwf.sys` supports operating in two modes: Full Stack and Tunnel. Full Stack mode is where OpenThread is
running on the host (in Windows) and a simple radio device is connected externally. Tunnel mode is where
OpenThread is running on the external device and Windows is merely a pass through for commands and packets.
Once all these are installed, open the Solution file `etc/visual-studio/openthread.sln`. Select the Configuration and Platform (i.e. Release/x64) and then Build All (F6).
In both cases, `otLwf.sys` uses the Spinel command interface for interacting with the connected device. When operating
in Full Stack mode, `otLwf.sys` uses only the low level PHY/MAC commands. In Tunnel mode, it uses the higher layer
Spinel commands and lets the device manage the actual Thread stack.
### Bash on Ubuntu on Windows
### ottmp.sys ###
[Bash on Ubuntu on Windows](https://msdn.microsoft.com/en-us/commandline/wsl/about) is a new feature to Windows 10. To set it up, follow the steps [here](https://msdn.microsoft.com/commandline/wsl/install_guide). Other FAQs can be found [here](https://msdn.microsoft.com/en-us/commandline/wsl/faq).
This is the component responsible passing the Spinel commands from `otLwf.sys` down to the device. It is responsible
for abstracting the actual mechanism (USB, Serial, SPI) used for communicating with the device. It handles the device
arrival/removal and the encoding/decoding of data when communicating with it. The current implementation only handles
Serial devices.
Once installed, open the "Bash on Ubuntu on Windows" app. Do the following to install everything necessary to build OpenThread.
### Device ###
Make sure line ending are UNIX style:
Windows supports OpenThread devices that implement the Spinel protocol. It supports devices that support either the raw
link-layer PHY/MAC commands and devices that support the Thread commands (and devices that support both). By default,
Windows will operate in Full Stack mode, only sending raw link-layer commands.
```
git config core.autocrlf false
git rm --cached -r . && git reset --hard
```
Install the compilers:
```
apt install gcc
apt install g++
```
Install Python (with pexpect):
```
apt install python
apt install python-pip
pip install pexpect
```
To build the TI CC2538 platform, you need to install the correct toolchain:
```
add-apt-repository ppa:team-gcc-arm-embedded/ppa
apt-get update
apt-get install gcc-arm-embedded
```
Set up the build environment:
```
./bootstrap
```
### Platforms
Before building, manually configure features as desired. For example:
```
./configure --enable-cli --enable-diag --enable-commissioner --enable-joiner --with-examples=posix
make
```
Or clean and build with desired features enabled:
```
make -f examples/Makefile-<platform-name> clean
COMMISSIONER=1 JOINER=1 make -f examples/Makefile-<platform-name>
```
For detailed instructions on building and creating binaries for Windows-supported platforms, see each platform's respective README:
* [POSIX](https://github.com/openthread/openthread/tree/master/examples/platforms/posix)
* [TI CC2538](https://github.com/openthread/openthread/tree/master/examples/platforms/cc2538)
* [Nordic nRF52840](https://github.com/openthread/openthread/tree/master/examples/platforms/nrf52840)
## Installing OpenThread on Windows
Microsoft has made available a test VHD specifically modified for virtually testing OpenThread. To get access, please email `nibanks` via his `@microsoft.com` email address.
Once the Windows VHD is loaded and you have gone through OOBE, see `C:\OpenThread\readme.txt` for additional instructions on how to set everything up.
> **Note:** Since none of the binaries mentioned below are production signed; you need to enable test signing on the machine: `bcdedit /set testsigning on`. All these binaries require Windows 10 at a minimum.
Since most of these drivers are still under development, it is recommended to also have a kernel debugger configured for the test machine.
### otlwf.sys & otapi.dll
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 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. Open an admin command prompt in the temporary location
1. Run the `install_otlwf.cmd` file
1. On **non-IoT platforms**, install the [Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145)
1. **Note:** A reboot is required, but can be done after all installation is complete.
### ottmp.sys (Miniport for Serial Devices)
The miniport driver `ottmp.sys` binds to serial devices on the machine and exposes them to `otlwf.sys`. It is only needed if you are connecting to an actual device (such as the TI CC2538 or Nordic Semiconductor nRF52840 device).
1. Open an admin command prompt (same location as above).
1. Run the install_ottmp.cmd file.
1. **Note:** A reboot is required, but can be done after all installation is complete.
1. Once the test machine boots and the serial device is connected, manually restart the miniport so that it can find the serial device. **This will have to be done for every reboot**:
```
devcon.exe restart *ottmp*
```
### Command Line Tool Usage
The command line tool `otCli.exe` exposes many of the APIs in `otApi.dll` via the command line. It is included with the same release binaries downloaded above. See the [CLI example README](https://github.com/openthread/openthread/blob/master/examples/apps/cli/README.md) for more details.
The main differences between `otCli.exe` on Windows and the `ot-cli` on Linux, are the following:
* On Linux, the CLI runs the actual OpenThread stack in-proc. On Windows, it just provides an interface to control the OpenThread stack running either in the installed driver or on the physical device.
* On Windows, the CLI supports multiple interfaces simultaneously via the `instance` and `instancelist` commands.
The `instance` command allows for getting/setting the current instance that the rest of the commands act on.
```
> instance 0
Done
> instance
[0] {01234567-89AB-CDEF-0123-4567890ABCDE} (Compartment 1)
```
The `instancelist` command queries for all available instances/interfaces on the machine.
```
> instancelist
1 instances found:
[0] {01234567-89AB-CDEF-0123-4567890ABCDE} (Compartment 1)
```
### Sample Universal App
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
The Python certification tests approximate the testing done for real certification. On Windows they are run using virtual OpenThread devices. To set up the environment:
1. Install Python 3.6 to `C:\Python36` for all users. Make sure to add the install path to `PATH`.
1. Install the Python crypto libraries: `python.exe C:\Python36\Scripts\pip.exe install pycryptodome==3.4.3`
1. Copy Python cert scripts to the machine (to a 'scripts' folder)
To run all the tests:
```
otTestRunner.exe scripts Cert_* parallel:4 retry:2
```
+18 -7
View File
@@ -35,8 +35,6 @@
#ifndef __OTLWFIOCTL_H__
#define __OTLWFIOCTL_H__
#include <openthread/types.h>
__inline LONG ThreadErrorToNtstatus(otError error) { return (LONG)-((int)error); }
// User-mode IOCTL path for CreateFile
@@ -200,7 +198,7 @@ typedef enum _OTLWF_NOTIF_TYPE
#define IOCTL_OTLWF_OT_EXTENDED_ADDRESS \
OTLWF_CTL_CODE(107, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
// GUID - InterfaceGuid
// otExtAddress - aExtendedAddress
// otExtAddress - aExtAddress
#define IOCTL_OTLWF_OT_EXTENDED_PANID \
OTLWF_CTL_CODE(108, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
@@ -457,8 +455,8 @@ typedef enum _OTLWF_NOTIF_TYPE
OTLWF_CTL_CODE(156, METHOD_BUFFERED, FILE_WRITE_DATA)
// GUID - InterfaceGuid
#define IOCTL_OTLWF_OT_MAX_TRANSMIT_POWER \
OTLWF_CTL_CODE(157, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
//#define IOCTL_OTLWF_OT_TRANSMIT_POWER \
// OTLWF_CTL_CODE(157, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
// GUID - InterfaceGuid
// int8_t - aPower
@@ -542,7 +540,7 @@ typedef struct otCommissionConfig
// GUID - InterfaceGuid
// otExtAddress - aEui64
#define IOCTL_OTLWF_OT_HASH_MAC_ADDRESS \
#define IOCTL_OTLWF_OT_JOINER_ID \
OTLWF_CTL_CODE(172, METHOD_BUFFERED, FILE_READ_DATA)
// GUID - InterfaceGuid
// otExtAddress - aEui64
@@ -717,8 +715,21 @@ typedef struct otCommissionConfig
OTLWF_CTL_CODE(200, METHOD_BUFFERED, FILE_WRITE_DATA)
// GUID - InterfaceGuid
#define IOCTL_OTLWF_OT_NEXT_ROUTE \
OTLWF_CTL_CODE(201, METHOD_BUFFERED, FILE_READ_DATA)
// GUID - InterfaceGuid
// BOOLEAN - aLocal (input)
// uint8_t - aIterator (input)
// uint8_t - aNewIterator (output)
// otExternalRouteConfig - aConfig (output)
#define IOCTL_OTLWF_OT_MAX_ROUTER_ID \
OTLWF_CTL_CODE(202, METHOD_BUFFERED, FILE_READ_DATA)
// GUID - InterfaceGuid
// uint8_t - aMaxRouterId
// OpenThread function IOCTL codes
#define MIN_OTLWF_IOCTL_FUNC_CODE 100
#define MAX_OTLWF_IOCTL_FUNC_CODE 200
#define MAX_OTLWF_IOCTL_FUNC_CODE 202
#endif //__OTLWFIOCTL_H__
+8 -5
View File
@@ -29,14 +29,12 @@
/**
* @file
* @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_
#define OTNODE_H_
#include <openthread/openthread.h>
#ifndef OTNODEAPI
#define OTNODEAPI __declspec(dllimport)
#endif
@@ -146,9 +144,14 @@ OTNODEAPI uint16_t OTCALL otNodeGetAddr16(otNode* aNode);
OTNODEAPI const char* OTCALL otNodeGetAddr64(otNode* aNode);
/**
* Gets the node's hash mac address
* Gets the node's eui-64 address
*/
OTNODEAPI const char* OTCALL otNodeGetHashMacAddress(otNode* aNode);
OTNODEAPI const char* OTCALL otNodeGetEui64(otNode* aNode);
/**
* Gets the node's joiner id
*/
OTNODEAPI const char* OTCALL otNodeGetJoinerId(otNode* aNode);
/**
* Sets the channel for the node
+87 -60
View File
@@ -1476,7 +1476,7 @@ otThreadSetChildTimeout(
OTAPI
const
uint8_t *
otExtAddress *
OTCALL
otLinkGetExtendedAddress(
_In_ otInstance *aInstance
@@ -1490,7 +1490,7 @@ otLinkGetExtendedAddress(
free(Result);
Result = nullptr;
}
return (uint8_t*)Result;
return Result;
}
OTAPI
@@ -1498,15 +1498,15 @@ otError
OTCALL
otLinkSetExtendedAddress(
_In_ otInstance *aInstance,
const otExtAddress *aExtendedAddress
const otExtAddress *aExtAddress
)
{
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_ADDRESS, aExtendedAddress));
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_ADDRESS, aExtAddress));
}
OTAPI
const uint8_t *
const otExtendedPanId *
OTCALL
otThreadGetExtendedPanId(
_In_ otInstance *aInstance
@@ -1515,12 +1515,13 @@ otThreadGetExtendedPanId(
if (aInstance == nullptr) return nullptr;
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);
Result = nullptr;
}
return (uint8_t*)Result;
return Result;
}
OTAPI
@@ -1528,11 +1529,11 @@ otError
OTCALL
otThreadSetExtendedPanId(
_In_ otInstance *aInstance,
const uint8_t *aExtendedPanId
const otExtendedPanId *aExtendedPanId
)
{
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
@@ -1547,18 +1548,6 @@ otLinkGetFactoryAssignedIeeeEui64(
(void)QueryIOCTL(aInstance, IOCTL_OTLWF_OT_FACTORY_EUI64, aEui64);
}
OTAPI
void
OTCALL
otLinkGetJoinerId(
_In_ otInstance *aInstance,
_Out_ otExtAddress *aHashMacAddress
)
{
if (aInstance == nullptr) return;
(void)QueryIOCTL(aInstance, IOCTL_OTLWF_OT_HASH_MAC_ADDRESS, aHashMacAddress);
}
OTAPI
otError
OTCALL
@@ -1665,29 +1654,6 @@ otThreadSetPSKc(
return DwordToThreadError(SendIOCTL(aInstance->ApiHandle, IOCTL_OTLWF_OT_PSKC, Buffer, sizeof(Buffer), nullptr, 0));
}
OTAPI
int8_t
OTCALL
otLinkGetMaxTransmitPower(
_In_ otInstance *aInstance
)
{
int8_t Result = 0;
if (aInstance) (void)QueryIOCTL(aInstance, IOCTL_OTLWF_OT_MAX_TRANSMIT_POWER, &Result);
return Result;
}
OTAPI
void
OTCALL
otLinkSetMaxTransmitPower(
_In_ otInstance *aInstance,
int8_t aPower
)
{
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_MAX_TRANSMIT_POWER, aPower);
}
OTAPI
const otIp6Address *
OTCALL
@@ -1705,7 +1671,7 @@ otThreadGetMeshLocalEid(
}
OTAPI
const uint8_t *
const otMeshLocalPrefix *
OTCALL
otThreadGetMeshLocalPrefix(
_In_ otInstance *aInstance
@@ -1719,7 +1685,7 @@ otThreadGetMeshLocalPrefix(
free(Result);
Result = nullptr;
}
return (uint8_t*)Result;
return Result;
}
OTAPI
@@ -1727,11 +1693,11 @@ otError
OTCALL
otThreadSetMeshLocalPrefix(
_In_ otInstance *aInstance,
const uint8_t *aMeshLocalPrefix
const otMeshLocalPrefix *aMeshLocalPrefix
)
{
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
@@ -1875,6 +1841,42 @@ otBorderRouterGetNextOnMeshPrefix(
return aError;
}
OTAPI
otError
OTCALL
otBorderRouterGetNextRoute(
_In_ otInstance *aInstance,
_Inout_ otNetworkDataIterator *aIterator,
_Out_ otExternalRouteConfig *aConfig
)
{
if (aInstance == nullptr || aConfig == nullptr) return OT_ERROR_INVALID_ARGS;
BOOLEAN aLocal = TRUE;
PackedBuffer3<GUID,BOOLEAN,otNetworkDataIterator> InBuffer(aInstance->InterfaceGuid, aLocal, *aIterator);
BYTE OutBuffer[sizeof(uint8_t) + sizeof(otExternalRouteConfig)];
otError aError =
DwordToThreadError(
SendIOCTL(
aInstance->ApiHandle,
IOCTL_OTLWF_OT_NEXT_ROUTE,
&InBuffer, sizeof(InBuffer),
OutBuffer, sizeof(OutBuffer)));
if (aError == OT_ERROR_NONE)
{
memcpy(aIterator, OutBuffer, sizeof(uint8_t));
memcpy(aConfig, OutBuffer + sizeof(uint8_t), sizeof(otExternalRouteConfig));
}
else
{
ZeroMemory(aConfig, sizeof(otExternalRouteConfig));
}
return aError;
}
OTAPI
otPanId
OTCALL
@@ -2286,13 +2288,14 @@ OTAPI
otError
OTCALL
otDatasetSendMgmtActiveGet(
_In_ otInstance *aInstance,
_In_ otInstance *aInstance,
const otOperationalDatasetComponents *aDatasetComponents,
const uint8_t *aTlvTypes,
uint8_t aLength,
_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;
DWORD BufferSize = sizeof(GUID) + sizeof(uint8_t) + aLength;
@@ -2301,6 +2304,7 @@ otDatasetSendMgmtActiveGet(
if (Buffer == nullptr) return OT_ERROR_NO_BUFS;
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));
if (aLength > 0)
memcpy_s(Buffer + sizeof(GUID) + sizeof(uint8_t), BufferSize - sizeof(GUID) - sizeof(uint8_t), aTlvTypes, aLength);
@@ -2319,7 +2323,7 @@ otError
OTCALL
otDatasetSendMgmtActiveSet(
_In_ otInstance *aInstance,
const otOperationalDataset *aDataset,
const otOperationalDataset *aDataset,
const uint8_t *aTlvs,
uint8_t aLength
)
@@ -2348,13 +2352,14 @@ OTAPI
otError
OTCALL
otDatasetSendMgmtPendingGet(
_In_ otInstance *aInstance,
_In_ otInstance *aInstance,
const otOperationalDatasetComponents *aDatasetComponents,
const uint8_t *aTlvTypes,
uint8_t aLength,
_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;
DWORD BufferSize = sizeof(GUID) + sizeof(uint8_t) + aLength;
@@ -2363,6 +2368,7 @@ otDatasetSendMgmtPendingGet(
if (Buffer == nullptr) return OT_ERROR_NO_BUFS;
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));
if (aLength > 0)
memcpy_s(Buffer + sizeof(GUID) + sizeof(uint8_t), BufferSize - sizeof(GUID) - sizeof(uint8_t), aTlvTypes, aLength);
@@ -3204,6 +3210,18 @@ otThreadGetRouterIdSequence(
return Result;
}
OTAPI
uint8_t
OTCALL
otThreadGetMaxRouterId(
_In_ otInstance *aInstance
)
{
uint8_t Result = 0;
if (aInstance) (void)QueryIOCTL(aInstance, IOCTL_OTLWF_OT_MAX_ROUTER_ID, &Result);
return Result;
}
OTAPI
otError
OTCALL
@@ -3427,7 +3445,7 @@ otThreadErrorToString(
switch (aError)
{
case OT_ERROR_NONE:
retval = "None";
retval = "OK";
break;
case OT_ERROR_FAILED:
@@ -3510,8 +3528,8 @@ otThreadErrorToString(
retval = "InvalidSourceAddress";
break;
case OT_ERROR_WHITELIST_FILTERED:
retval = "WhitelistFiltered";
case OT_ERROR_ADDRESS_FILTERED:
retval = "AddressFiltered";
break;
case OT_ERROR_DESTINATION_ADDRESS_FILTERED:
@@ -3526,10 +3544,6 @@ otThreadErrorToString(
retval = "Already";
break;
case OT_ERROR_BLACKLIST_FILTERED:
retval = "BlacklistFiltered";
break;
case OT_ERROR_IP6_ADDRESS_CREATION_FAILURE:
retval = "Ipv6AddressCreationFailure";
break;
@@ -3923,6 +3937,19 @@ otJoinerStop(
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_JOINER_STOP));
}
OTAPI
otError
OTCALL
otJoinerGetId(
_In_ otInstance *aInstance,
_Out_ otExtAddress *aJoinerId
)
{
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
ZeroMemory(aJoinerId, sizeof(otExtAddress));
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_JOINER_ID, aJoinerId));
}
OTAPI
int8_t
OTCALL
+1 -1
View File
@@ -21,9 +21,9 @@
#define OTDLL
#define OTAPI EXTERN_C __declspec(dllexport)
#include <openthread/openthread.h>
#include <openthread/border_router.h>
#include <openthread/dataset_ftd.h>
#include <openthread/error.h>
#include <openthread/thread_ftd.h>
#include <openthread/commissioner.h>
#include <openthread/joiner.h>
-1
View File
@@ -29,7 +29,6 @@
#include <windows.h>
#include <stdio.h>
#include <openthread/openthread.h>
#include <openthread/cli.h>
#include <openthread/platform/uart.h>
#include <openthread/platform/misc.h>
+1 -1
View File
@@ -956,7 +956,7 @@ otLwfCmdSendMacFrameAsync(
Packet->mPsdu,
(uint32_t)Packet->mLength,
Packet->mChannel,
Packet->mPower
Packet->mInfo.mRxInfo.mRssi
);
if (!NT_SUCCESS(status))
{
@@ -786,7 +786,7 @@ otLwfEventWorkerThread(
NT_ASSERT(otCtxToFilter(pFilter->otCtx) == pFilter);
// Disable Icmp (ping) handling
otIcmp6SetEchoEnabled(pFilter->otCtx, FALSE);
otIcmp6SetEchoMode(pFilter->otCtx, OT_ICMP6_ECHO_HANDLER_DISABLED);
// Register callbacks with OpenThread
otSetStateChangedCallback(pFilter->otCtx, otLwfStateChangedCallback, pFilter);
@@ -1019,11 +1019,11 @@ otLwfEventWorkerThread(
SPINEL_DATATYPE_STRUCT_S( // Vendor-data
SPINEL_DATATYPE_UINT_PACKED_S
),
&pFilter->otReceiveFrame.mPower,
&pFilter->otReceiveFrame.mInfo.mRxInfo.mRssi,
&noiseFloor,
&flags,
&pFilter->otReceiveFrame.mChannel,
&pFilter->otReceiveFrame.mLqi,
&pFilter->otReceiveFrame.mInfo.mRxInfo.mLqi,
&errorCode))
{
otLwfRadioReceiveFrame(pFilter, errorCode);
+122 -34
View File
@@ -95,6 +95,7 @@ OTLWF_IOCTL_HANDLER IoCtls[] =
{ "IOCTL_OTLWF_OT_PARTITION_ID", REF_IOCTL_FUNC_WITH_TUN(otPartitionId) },
{ "IOCTL_OTLWF_OT_RLOC16", REF_IOCTL_FUNC_WITH_TUN(otRloc16) },
{ "IOCTL_OTLWF_OT_ROUTER_ID_SEQUENCE", REF_IOCTL_FUNC(otRouterIdSequence) },
{ "IOCTL_OTLWF_OT_MAX_ROUTER_ID", REF_IOCTL_FUNC(otMaxRouterId) },
{ "IOCTL_OTLWF_OT_ROUTER_INFO", REF_IOCTL_FUNC(otRouterInfo) },
{ "IOCTL_OTLWF_OT_STABLE_NETWORK_DATA_VERSION", REF_IOCTL_FUNC_WITH_TUN(otStableNetworkDataVersion) },
{ "IOCTL_OTLWF_OT_MAC_BLACKLIST_ENABLED", REF_IOCTL_FUNC(otMacBlacklistEnabled) },
@@ -102,7 +103,7 @@ OTLWF_IOCTL_HANDLER IoCtls[] =
{ "IOCTL_OTLWF_OT_REMOVE_MAC_BLACKLIST", REF_IOCTL_FUNC(otRemoveMacBlacklist) },
{ "IOCTL_OTLWF_OT_NEXT_MAC_BLACKLIST", REF_IOCTL_FUNC(otNextMacBlacklist) },
{ "IOCTL_OTLWF_OT_CLEAR_MAC_BLACKLIST", REF_IOCTL_FUNC(otClearMacBlacklist) },
{ "IOCTL_OTLWF_OT_MAX_TRANSMIT_POWER", REF_IOCTL_FUNC(otMaxTransmitPower) },
{ "IOCTL_OTLWF_OT_TRANSMIT_POWER", REF_IOCTL_FUNC(otTransmitPower) },
{ "IOCTL_OTLWF_OT_NEXT_ON_MESH_PREFIX", REF_IOCTL_FUNC(otNextOnMeshPrefix) },
{ "IOCTL_OTLWF_OT_POLL_PERIOD", REF_IOCTL_FUNC(otPollPeriod) },
{ "IOCTL_OTLWF_OT_LOCAL_LEADER_PARTITION_ID", REF_IOCTL_FUNC(otLocalLeaderPartitionId) },
@@ -116,7 +117,7 @@ OTLWF_IOCTL_HANDLER IoCtls[] =
{ "IOCTL_OTLWF_OT_JOINER_START", REF_IOCTL_FUNC(otJoinerStart) },
{ "IOCTL_OTLWF_OT_JOINER_STOP", REF_IOCTL_FUNC(otJoinerStop) },
{ "IOCTL_OTLWF_OT_FACTORY_EUI64", REF_IOCTL_FUNC(otFactoryAssignedIeeeEui64) },
{ "IOCTL_OTLWF_OT_HASH_MAC_ADDRESS", REF_IOCTL_FUNC(otHashMacAddress) },
{ "IOCTL_OTLWF_OT_JOINER_ID", REF_IOCTL_FUNC(otJoinerId) },
{ "IOCTL_OTLWF_OT_ROUTER_DOWNGRADE_THRESHOLD", REF_IOCTL_FUNC_WITH_TUN(otRouterDowngradeThreshold) },
{ "IOCTL_OTLWF_OT_COMMISSIONER_PANID_QUERY", REF_IOCTL_FUNC(otCommissionerPanIdQuery) },
{ "IOCTL_OTLWF_OT_COMMISSIONER_ENERGY_SCAN", REF_IOCTL_FUNC(otCommissionerEnergyScan) },
@@ -145,6 +146,7 @@ OTLWF_IOCTL_HANDLER IoCtls[] =
{ "IOCTL_OTLWF_OT_REMOVE_MAC_FIXED_RSS", REF_IOCTL_FUNC_WITH_TUN(otRemoveMacFixedRss) },
{ "IOCTL_OTLWF_OT_NEXT_MAC_FIXED_RSS", REF_IOCTL_FUNC(otNextMacFixedRss) },
{ "IOCTL_OTLWF_OT_CLEAR_MAC_FIXED_RSS", REF_IOCTL_FUNC_WITH_TUN(otClearMacFixedRss) },
{ "IOCTL_OTLWF_OT_NEXT_ROUTE", REF_IOCTL_FUNC(otNextRoute) },
};
// intentionally -1 in the end due to that IOCTL_OTLWF_OT_ASSIGN_LINK_QUALITY (#161) is removed now.
@@ -1254,12 +1256,13 @@ otLwfIoCtl_otExtendedPanId(
if (InBufferLength >= sizeof(otExtendedPanId))
{
status = ThreadErrorToNtstatus(otThreadSetExtendedPanId(pFilter->otCtx, (uint8_t*)InBuffer));
status = ThreadErrorToNtstatus(otThreadSetExtendedPanId(pFilter->otCtx, (otExtendedPanId*)InBuffer));
*OutBufferLength = 0;
}
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);
status = STATUS_SUCCESS;
}
@@ -1374,7 +1377,7 @@ otLwfIoCtl_otFactoryAssignedIeeeEui64(
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
otLwfIoCtl_otHashMacAddress(
otLwfIoCtl_otJoinerId(
_In_ PMS_FILTER pFilter,
_In_reads_bytes_(InBufferLength)
PUCHAR InBuffer,
@@ -1391,9 +1394,8 @@ otLwfIoCtl_otHashMacAddress(
if (*OutBufferLength >= sizeof(otExtAddress))
{
otLinkGetJoinerId(pFilter->otCtx, (otExtAddress*)OutBuffer);
status = ThreadErrorToNtstatus(otJoinerGetId(pFilter->otCtx, (otExtAddress*)OutBuffer));
*OutBufferLength = sizeof(otExtAddress);
status = STATUS_SUCCESS;
}
else
{
@@ -1538,7 +1540,7 @@ enum
{
kThreadMode_RxOnWhenIdle = (1 << 3),
kThreadMode_SecureDataRequest = (1 << 2),
kThreadMode_FullFunctionDevice = (1 << 1),
kThreadMode_FullThreadDevice = (1 << 1),
kThreadMode_FullNetworkData = (1 << 0),
};
@@ -1562,7 +1564,7 @@ otLwfTunIoCtl_otLinkMode(
if (aLinkMode->mRxOnWhenIdle) numeric_mode |= kThreadMode_RxOnWhenIdle;
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;
status =
@@ -1613,7 +1615,7 @@ otLwfTunIoCtl_otLinkMode_Handler(
aLinkMode->mRxOnWhenIdle = ((numeric_mode & kThreadMode_RxOnWhenIdle) == kThreadMode_RxOnWhenIdle);
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);
*OutBufferLength = sizeof(otLinkModeConfig);
@@ -1934,12 +1936,13 @@ otLwfIoCtl_otMeshLocalPrefix(
if (InBufferLength >= sizeof(otMeshLocalPrefix))
{
status = ThreadErrorToNtstatus(otThreadSetMeshLocalPrefix(pFilter->otCtx, InBuffer));
status = ThreadErrorToNtstatus(otThreadSetMeshLocalPrefix(pFilter->otCtx, (otMeshLocalPrefix*)InBuffer));
*OutBufferLength = 0;
}
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);
status = STATUS_SUCCESS;
}
@@ -4509,6 +4512,37 @@ otLwfIoCtl_otRouterIdSequence(
return status;
}
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
otLwfIoCtl_otMaxRouterId(
_In_ PMS_FILTER pFilter,
_In_reads_bytes_(InBufferLength)
PUCHAR InBuffer,
_In_ ULONG InBufferLength,
_Out_writes_bytes_(*OutBufferLength)
PVOID OutBuffer,
_Inout_ PULONG OutBufferLength
)
{
NTSTATUS status = STATUS_INVALID_PARAMETER;
UNREFERENCED_PARAMETER(InBuffer);
UNREFERENCED_PARAMETER(InBufferLength);
if (*OutBufferLength >= sizeof(uint8_t))
{
*(uint8_t*)OutBuffer = otThreadGetMaxRouterId(pFilter->otCtx);
*OutBufferLength = sizeof(uint8_t);
status = STATUS_SUCCESS;
}
else
{
*OutBufferLength = 0;
}
return status;
}
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
otLwfIoCtl_otRouterInfo(
@@ -4787,7 +4821,7 @@ otLwfIoCtl_otClearMacBlacklist(
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
otLwfIoCtl_otMaxTransmitPower(
otLwfIoCtl_otTransmitPower(
_In_ PMS_FILTER pFilter,
_In_reads_bytes_(InBufferLength)
PUCHAR InBuffer,
@@ -4801,15 +4835,13 @@ otLwfIoCtl_otMaxTransmitPower(
if (InBufferLength >= sizeof(int8_t))
{
otLinkSetMaxTransmitPower(pFilter->otCtx, *(int8_t*)InBuffer);
status = STATUS_SUCCESS;
status = ThreadErrorToNtstatus(otPlatRadioSetTransmitPower(pFilter->otCtx, *(int8_t*)InBuffer));
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(int8_t))
{
*(int8_t*)OutBuffer = otLinkGetMaxTransmitPower(pFilter->otCtx);
status = ThreadErrorToNtstatus(otPlatRadioGetTransmitPower(pFilter->otCtx, (int8_t*)OutBuffer));
*OutBufferLength = sizeof(int8_t);
status = STATUS_SUCCESS;
}
else
{
@@ -4833,12 +4865,12 @@ otLwfIoCtl_otNextOnMeshPrefix(
{
NTSTATUS status = STATUS_INVALID_PARAMETER;
if (InBufferLength >= sizeof(BOOLEAN) + sizeof(uint8_t) &&
*OutBufferLength >= sizeof(uint8_t) + sizeof(otBorderRouterConfig))
if (InBufferLength >= sizeof(BOOLEAN) + sizeof(uint32_t) &&
*OutBufferLength >= sizeof(uint32_t) + sizeof(otBorderRouterConfig))
{
BOOLEAN aLocal = *(BOOLEAN*)InBuffer;
uint8_t aIterator = *(uint8_t*)(InBuffer + sizeof(BOOLEAN));
otBorderRouterConfig* aConfig = (otBorderRouterConfig*)((PUCHAR)OutBuffer + sizeof(uint8_t));
uint32_t aIterator = *(uint32_t*)(InBuffer + sizeof(BOOLEAN));
otBorderRouterConfig* aConfig = (otBorderRouterConfig*)((PUCHAR)OutBuffer + sizeof(uint32_t));
if (aLocal)
{
status = ThreadErrorToNtstatus(
@@ -4860,7 +4892,59 @@ otLwfIoCtl_otNextOnMeshPrefix(
*OutBufferLength = sizeof(uint8_t) + sizeof(otBorderRouterConfig);
if (status == STATUS_SUCCESS)
{
*(uint8_t*)OutBuffer = aIterator;
*(uint32_t*)OutBuffer = aIterator;
}
}
else
{
*OutBufferLength = 0;
}
return status;
}
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
otLwfIoCtl_otNextRoute(
_In_ PMS_FILTER pFilter,
_In_reads_bytes_(InBufferLength)
PUCHAR InBuffer,
_In_ ULONG InBufferLength,
_Out_writes_bytes_(*OutBufferLength)
PVOID OutBuffer,
_Inout_ PULONG OutBufferLength
)
{
NTSTATUS status = STATUS_INVALID_PARAMETER;
if (InBufferLength >= sizeof(BOOLEAN) + sizeof(uint32_t) &&
*OutBufferLength >= sizeof(uint32_t) + sizeof(otExternalRouteConfig))
{
BOOLEAN aLocal = *(BOOLEAN*)InBuffer;
uint32_t aIterator = *(uint32_t*)(InBuffer + sizeof(BOOLEAN));
otExternalRouteConfig* aConfig = (otExternalRouteConfig*)((PUCHAR)OutBuffer + sizeof(uint32_t));
if (aLocal)
{
status = ThreadErrorToNtstatus(
otBorderRouterGetNextRoute(
pFilter->otCtx,
&aIterator,
aConfig)
);
}
else
{
status = ThreadErrorToNtstatus(
otNetDataGetNextRoute(
pFilter->otCtx,
&aIterator,
aConfig)
);
}
*OutBufferLength = sizeof(uint8_t) + sizeof(otExternalRouteConfig);
if (status == STATUS_SUCCESS)
{
*(uint32_t*)OutBuffer = aIterator;
}
}
else
@@ -5836,20 +5920,22 @@ otLwfIoCtl_otSendActiveGet(
*OutBufferLength = 0;
UNREFERENCED_PARAMETER(OutBuffer);
if (InBufferLength >= sizeof(uint8_t))
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t))
{
uint8_t aLength = *(uint8_t*)InBuffer;
PUCHAR aTlvTypes = aLength == 0 ? NULL : InBuffer + sizeof(uint8_t);
const otOperationalDatasetComponents *aDatasetComp = (otOperationalDatasetComponents*)InBuffer;
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;
if (InBufferLength >= sizeof(uint8_t) + aLength + sizeof(otIp6Address))
aAddress = (otIp6Address*)(InBuffer + sizeof(uint8_t) + aLength);
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength + sizeof(otIp6Address))
aAddress = (otIp6Address*)(InBuffer + sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength);
status = ThreadErrorToNtstatus(
otDatasetSendMgmtActiveGet(
pFilter->otCtx,
aDatasetComp,
aTlvTypes,
aLength,
aAddress)
@@ -5915,20 +6001,22 @@ otLwfIoCtl_otSendPendingGet(
*OutBufferLength = 0;
UNREFERENCED_PARAMETER(OutBuffer);
if (InBufferLength >= sizeof(uint8_t))
if (InBufferLength >= sizeof(otOperationalDataset) + sizeof(uint8_t))
{
uint8_t aLength = *(uint8_t*)InBuffer;
PUCHAR aTlvTypes = aLength == 0 ? NULL : InBuffer + sizeof(uint8_t);
const otOperationalDatasetComponents *aDatasetComp = (otOperationalDatasetComponents*)InBuffer;
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;
if (InBufferLength >= sizeof(uint8_t) + aLength + sizeof(otIp6Address))
aAddress = (otIp6Address*)(InBuffer + sizeof(uint8_t) + aLength);
if (InBufferLength >= sizeof(otOperationalDatasetComponents) + sizeof(uint8_t) + aLength + sizeof(otIp6Address))
aAddress = (otIp6Address*)(InBuffer + sizeof(otOperationalDataset) + sizeof(uint8_t) + aLength);
status = ThreadErrorToNtstatus(
otDatasetSendMgmtPendingGet(
pFilter->otCtx,
aDatasetComp,
aTlvTypes,
aLength,
aAddress)
+4 -2
View File
@@ -181,6 +181,7 @@ DECL_IOCTL_FUNC_WITH_TUN2(otNetworkDataVersion);
DECL_IOCTL_FUNC_WITH_TUN2(otPartitionId);
DECL_IOCTL_FUNC_WITH_TUN2(otRloc16);
DECL_IOCTL_FUNC(otRouterIdSequence);
DECL_IOCTL_FUNC(otMaxRouterId);
DECL_IOCTL_FUNC(otRouterInfo);
DECL_IOCTL_FUNC_WITH_TUN2(otStableNetworkDataVersion);
DECL_IOCTL_FUNC(otMacBlacklistEnabled);
@@ -188,7 +189,7 @@ DECL_IOCTL_FUNC(otAddMacBlacklist);
DECL_IOCTL_FUNC(otRemoveMacBlacklist);
DECL_IOCTL_FUNC(otNextMacBlacklist);
DECL_IOCTL_FUNC(otClearMacBlacklist);
DECL_IOCTL_FUNC(otMaxTransmitPower);
DECL_IOCTL_FUNC(otTransmitPower);
DECL_IOCTL_FUNC(otNextOnMeshPrefix);
DECL_IOCTL_FUNC(otPollPeriod);
DECL_IOCTL_FUNC(otLocalLeaderPartitionId);
@@ -202,7 +203,7 @@ DECL_IOCTL_FUNC(otCommissionerStop);
DECL_IOCTL_FUNC(otJoinerStart);
DECL_IOCTL_FUNC(otJoinerStop);
DECL_IOCTL_FUNC(otFactoryAssignedIeeeEui64);
DECL_IOCTL_FUNC(otHashMacAddress);
DECL_IOCTL_FUNC(otJoinerId);
DECL_IOCTL_FUNC_WITH_TUN2(otRouterDowngradeThreshold);
DECL_IOCTL_FUNC(otCommissionerPanIdQuery);
DECL_IOCTL_FUNC(otCommissionerEnergyScan);
@@ -231,5 +232,6 @@ DECL_IOCTL_FUNC_WITH_TUN(otAddMacFixedRss);
DECL_IOCTL_FUNC_WITH_TUN(otRemoveMacFixedRss);
DECL_IOCTL_FUNC(otNextMacFixedRss);
DECL_IOCTL_FUNC_WITH_TUN(otClearMacFixedRss);
DECL_IOCTL_FUNC(otNextRoute);
#endif // _IOCONTROL_H

Some files were not shown because too many files have changed in this diff Show More