Compare commits

..

2016 Commits

Author SHA1 Message Date
Marven Gilhespie 3dbd91aa2b [efr32] dynamic multi-protocol support for MG12 and MG21 (#4321) 2019-11-13 20:42:04 +01:00
Yakun Xu 1626cc4013 [daemon] add readline support to ot-ctl (#4320) 2019-11-13 07:37:52 +01:00
Yakun Xu b95281666d [radio] process tx AES without otInstance (#4318)
`otPlatRadioFrameUpdated()` is declared not to access any state within
OpenThread. However, the current implementation does read the extended
address. This commit moves the AES process into `Mac::TxFrame`, which
is free of `otInstance` and eliminates the current deep callback
stacks when the radio driver wants to process tx AES from interrupt
context.
2019-11-13 07:36:18 +01:00
Łukasz Duda 4758624a7a [doc] clarify mac counters meaning (#4307) 2019-11-13 07:31:43 +01:00
Rongli Sun 6877ee83eb [thci] configure FED by disable routerrole (#4317) 2019-11-13 07:24:50 +01:00
Simon Lin 88df5fb4ac [thci] add delay to joinNetwork and ping (#4319)
Recent updates to the Thread Group Test Harness have caused 5.2.3,
5.5.2 tests to fail.

This commit:
- adds more delay interval to address the Test Harness' change in
  delays
- merge Test Harness' OpenThread THCI change for updateRouterStatus

The reduction in ping delay and joinNetwork delay have caused test
5.5.2 to fail by side affects described in DEV-2008. Even though it is
a Test Harness validation issue rather than an OpenThread THCI issue,
we increase the ping & joinNetwork delay so that we have a more stable
regression environment.

Both 5.2.3 and 5.5.2 pass on Harness 2.0.0 with this commit.
2019-11-12 19:46:36 +01:00
Abtin Keshavarzian 19695b0f8e [ncp] add support in spinel/NCP to generate PSKc from pass-phrase (#4294) 2019-11-12 18:24:11 +01:00
Abtin Keshavarzian 090ed57141 [commissioner] change GeneratePskc to use otPskc/Pskc types (#4294) 2019-11-12 18:24:11 +01:00
Abtin Keshavarzian 09a9aa4e34 [dataset-manager] check the read length from message on reading TLVs (#4313) 2019-11-11 17:53:15 +01:00
Abtin Keshavarzian bd7bd470ed [dataset-manager] simplify checks in HandleSet (#4313)
This commit simplifies the `VerifyOrExit()`/`ExitNow()` failure
checks in `DatasetManager::HandleSet()` by starting the `state`
as `kReject` and setting to `kAccept` after all checks are passed.
2019-11-11 17:53:15 +01:00
Abtin Keshavarzian 07e4e44998 [dataset-manager] append SecurityPolicyTlv when present (#4313)
This commit updates `DatasetManager::SendSetRequest()` to include
the `SecurityPolicyTlv` when it is present in the dataset.
2019-11-11 17:53:15 +01:00
Marven Gilhespie de1a439594 [efr32] fix COAPS switch build error (#4310)
third_party/mbedtls/ecp.c was excluded for mg12 and mg21.
2019-11-11 17:41:16 +01:00
Abtin Keshavarzian 8feaf6de1e [toranj] add test-case covering address cache entry removal on SED attach (#4293)
This test verifies that address cache entry associated with a SED
child addresses is removed from new parent node ensuring we would not
have a routing loop.
2019-11-11 17:40:05 +01:00
Kamil Sroka 8cfc772623 [nrf52840] update nrf_security to 0.9.1 (#4311) 2019-11-09 01:18:41 +01:00
Abtin Keshavarzian 335b305ba8 [tasklet] use circular linked list (#4309)
This commit contains the following changes:
- Changes `TaskletScheduler` to use a circular linked list.
- Adds `Tasklet::IsPosted()` which indicates whether a tasklet
  is posted or not (by checking `mNext` pointer against NULL).
- Simplifies  processing of tasklets from `ProcessQueuedTasklets()`
  by creating a copy of current list and clearing the main list
  (this way, a newly posted tasklet would automatically trigger
  a call to `otTaskletsSignalPending()`).
2019-11-09 01:17:01 +01:00
Abtin Keshavarzian 8b4f3fff31 [dhcp6-client] use NetifUnicastAddress in IdentityAssociation struct (#4308) 2019-11-09 01:10:23 +01:00
Abtin Keshavarzian 11d3d9bbf2 [netif] remove unused type LinkAddress (#4308) 2019-11-09 01:10:23 +01:00
Abtin Keshavarzian e8c64a7469 [key-manager] use Notifier::Update when changing security policy (#4308) 2019-11-09 01:10:23 +01:00
Abtin Keshavarzian 82d044b3d1 [coap] fix typos and format in comments (#4308) 2019-11-09 01:10:23 +01:00
Jonathan Hui c8c26b7ac0 [operational-dataset] only generate active dataset once (#4304)
Add check to see if Active Timestamp already exists in the Active
Operational Dataset. If Active Timestamp exists, do not generate
Active Operational Dataset again.
2019-11-07 04:51:47 -08:00
Rongli Sun 75bb2a9dd1 [address-resolver] update EID-to-RLOC cache when attaching MTD child (#4282)
This commits removes deprecated EID-to-RLOC cache if there is entry for
the unicast address registered by MTD child in case this child switches
its parent.
2019-11-07 04:48:50 -08:00
Abtin Keshavarzian aab693f9c3 [timer] add helper methods for common timer use patterns and simplify code (#4243)
This commit adds helper methods in `Timer` class which cover commonly
repeated use patterns by other modules.

Method `FireAt()` allows a timer to be started with a given fire time.
`FireAtIfEarlier()` (re-)schedules the timer with a given a fire time
only if the timer is not running or if the new given fire time is
earlier than the current fire time.

Modules mle, coap, ip6-mpl, joiner-router, dns-clinet, and sntp-client
are updated to use the new methods.
2019-11-07 04:45:34 -08:00
Abtin Keshavarzian ecf7a7050f [toranj] add test covering wpantund auto add of routes per on-mesh prefix (#4221) 2019-11-07 04:43:27 -08:00
Jing 082c1c79f5 [harness-automation] save case failure times (#4261)
Save failure times for each case for judging if case passes randomly.
2019-11-06 07:03:16 -08:00
Jonathan Hui 56354634b9 [mle] clean up Mle::HandleAdvertisement neighbor handling (#4297)
Avoid redudnant search for neighbor entries.
2019-11-06 07:02:19 -08:00
Jonathan Hui aa76e6c955 [mle] move security checks into message handlers (#4297)
- Mle::HandleDataResponse
- Mle::HandleChildIdResponse
- MleRouter::HandleDataRequest
- MleRouter::HandleTimeSync
2019-11-06 07:02:19 -08:00
Jonathan Hui 4aab013e06 [mle] fix MleRouter::HandleLinkAccept message validation (#4297)
This commit moves the message security check to the top of
MleRouter::HandleLinkAccept.
2019-11-06 07:02:19 -08:00
Jonathan Hui de8033fad4 [mle] fix MleRouter::HandleChildUpdateResponse msg validation (#4297)
This commit moves the message security check to the top of
MleRouter::HandleChildUpdateResponse.
2019-11-06 07:02:19 -08:00
Jonathan Hui 779b7851bf [mle] respond to Child Update Request from non-parent (#4297)
This allows an end device to indicate that it is not a child of	the
Child Update Request transmitter.
2019-11-06 07:02:19 -08:00
Jonathan Hui 7703bad23f [mle] remove redundant GetNeighbor calls in MleRouter::HandleLinkReqest (#4297) 2019-11-06 07:02:19 -08:00
Jonathan Hui 9bcef319bb [mle] fix Mle::HandleChildUpdateResponse message validation (#4297)
This commit moves the message security check to	the top	of
Mle::HandleChildUpdateResponse.
2019-11-06 07:02:19 -08:00
Jonathan Hui ec303c16a4 [mle] include Response TLV when sending Child Update Response (#4297)
This commit always includes a Response TLV in a Child Update Response,
whenever the corresponding request includes a Challenge TLV.
2019-11-06 07:02:19 -08:00
Jonathan Hui ea564113ef [travis] disable arm-gcc-8 until compiler bug is fixed (#4306) 2019-11-06 00:24:05 -08:00
Łukasz Duda 7cd4ffcc2c [nrf528xx] add support for reading state of an output pin (#4302) 2019-11-04 06:47:02 -08:00
Kamil Sroka e98de3f358 [nrf52840] use nrf_security for hardware accelerated cryptography (#4267)
Previously simple CC310 cryptographic accelerator library was used
with the glue layer using MbedTLS _ALT function substitution mechanism.
This solution wasn't well tested from a security point of view.

The new cryptographic library is built from the nrf_security project:
https://github.com/NordicPlayground/nrfxlib/tree/master/nrf_security.
It provides both CC310 libraries with MbedTLS API and special glue layers
for situations where both hardware and software implementation is used
(i.e for AES as the hardware supports only 128bit keys so software is used
for 256bit keys).

The new library is based on the CC312 codebase in a version stated
to be ready for production, however the Nordic Semiconductor ASA
port to make the code base work for CC310 devices is currently given out
in an experimental state. The new library is based on CC312 codebase
because it introduces mbed TLS integration for HW cryptographic
features in Arm CryptoCell devices.
2019-11-04 06:46:03 -08:00
Simon Lin b69f463b3f [cc2538] set frame pending correctly (#4263) 2019-11-04 04:42:48 -08:00
Jonathan Hui fc0c86d384 [configure] use "no" instead of "none" in AC_ARG_WITH (#4298) 2019-11-04 00:04:53 -08:00
Rongli Sun 20220169f8 [thci] remove default guardtime configuration (#4296) 2019-11-04 00:04:39 -08:00
Rongli Sun cde2b1ce4f [key-manager] only start guard timer on switch to next key index (#4296) 2019-11-04 00:04:39 -08:00
Jonathan Hui 16c01d58c0 [third-party] change end of line character from CRLF do LF (#4299) 2019-11-01 20:55:23 -07:00
Kamil Sroka 904a4d6516 [security] use Random::Crypto for challenge generation (#4275) 2019-11-01 10:46:11 -07:00
Simon Lin f942d13334 [mle] remove sleepy child in all roles (#4234)
This commit fixes an issue that indirect messages for sleepy child are
not correctly cleared in some cases.

This issue can cause sleepy nodes unable to reattach for a long time,
or even forever.
2019-11-01 08:50:22 -07:00
wgtdkp 9c54a4ed0e [meshcop] remove redundant message copying (#4254)
This commit removes redundant message copying when a joiner router is
handling a RLY_TX.ntf message.
2019-10-31 21:58:10 -07:00
Jeff Bumgardner ab97703b04 [docs] note that use of the public Heap API is discouraged (#4285) 2019-10-31 21:42:17 -07:00
Jonathan Hui c8eaeba6b4 [third-party] change end of line character from CRLF do LF (#4292) 2019-10-31 15:26:28 -07:00
Abtin Keshavarzian 112d1bb008 [ncp] add support for clearing all/subset of counters (#4286)
This commit adds support in NCP/spinel for clearing counters. It also
adds new `PROP_CNTR_ALL_IP_COUNTERS` property to get all IPv6
counters. All (MAC, MLE, IPv6, and NCP) counters can be cleared by
writing (`PROP_VALUE_SET` with any value) to `SPINEL_PROP_CNTR_RESET`
property. A specific subset of counters (MAC, MLE, IP) can be cleared
by writing (any value) to the corresponding spinel property
(`ROP_CNTR_ALL_MAC_COUNTERS`, `PROP_CNTR_MLE_COUNTERS`, or
`PROP_CNTR_ALL_IP_COUNTERS`).
2019-10-31 15:23:22 -07:00
Abtin Keshavarzian 7d80c16df8 [link] add public OT API otLinkResetCounters to reset MAC counters (#4286) 2019-10-31 15:23:22 -07:00
Abtin Keshavarzian bf03f40bd7 [mesh-forwarder] add method ResetCounters to clear IP counter (#4286)
This commit also adds a public API `otThreadResetIp6Counters()`.
2019-10-31 15:23:22 -07:00
Abtin Keshavarzian 795cd14f8c [mac] Adding SetTemporaryChannel()/ClearTemporaryChannel() (#4283)
This commit adds new method in `Mac` namely `SetTemporaryChannel()`
and `ClearTemporaryChannel()` to allow user to temporarily change the
radio channel and use a different channel (during receive) instead of
the PAN channel (from `SetPanChannel()`). A subsequent call to
`ClearTemporaryChannel()` would clear the temporary channel and adopt
the PAN channel again. The new implementation replaces and simplifies
the previous `<Acquire/Release>RadioChannel()` model.
2019-10-31 12:58:01 -07:00
Abtin Keshavarzian 21da048a00 [mac] add Mac::GenerateRandomPanId() (#4283)
This commit adds a helper function `Mac::GenerateRandomPanId()` which
generates a random PAN Identifier (excluding the broadcast PAN Id
`kPanIdBroadcast`).
2019-10-31 12:58:01 -07:00
Jonathan Hui a1cf4397ae [posix-app] fix implementation of CCA ED threshold config (#4295) 2019-10-31 12:56:03 -07:00
Marven Gilhespie abd1875957 [efr32] fix LED gpio port and pin allocation for BRD4166A (#4277)
This bug is inherited from SDKv2.6v bspconfig.h which is also incorrect.
2019-10-31 08:51:49 -07:00
Kamil Sroka 67f4357c5d [nrf528xx] add NRFX timer configuration to sdk_config.h (#4288) 2019-10-30 11:01:52 -07:00
Kamil Sroka f24b1860a9 [nrf528xx] add nrf5AlarmGetRawCounter (#4287) 2019-10-30 11:00:30 -07:00
Rongli Sun fce4508e2f [mle] remove redundant RemoveChildren when router id changes (#4281) 2019-10-30 10:58:12 -07:00
Abtin Keshavarzian efd9ebaa9c [notifier] add Update method (#4274)
This commit adds a new `Notifier::Update()` method which performs a
commonly used pattern in the code where a variable is updated with a
new given value and if the variable value does change a related
notifier `OT_CHANGED_<NAME>` is signaled.
2019-10-29 13:29:38 -07:00
Jonathan Hui fd57343641 [neighbor] add methods to check neighbor state (#4280) 2019-10-29 09:05:36 -07:00
Rafał Kuźnia 5a7e19062c [mac] add option to change direct/indirect TX retry number (#4256)
Add MAC option to change number of direct TX retries:
- add member variable containing maximum number of direct TX retries
- add getter/setter methods

Add public API for direct and indirect TX retries
- otLinkGetMaxFrameRetriesDirect
- otLinkSetMaxFrameRetriesDirect
- otLinkGetMaxFrameRetriesIndirect
- otLinkSetMaxFrameRetriesIndirect

Add NCP support for direct and indirect TX retry configuration.

Rename config definition for direct and direct TX retries.

Add cli command handler for direct and indirect TX retries.
2019-10-29 09:04:26 -07:00
Abtin Keshavarzian aa6318b4dd [toranj] add option to build script to enable tests (#4257) 2019-10-28 21:00:34 -07:00
Abtin Keshavarzian 68d2b8e2f9 [netif] use OT_ARRAY_END() when iterating over external address arrays (#4242) 2019-10-28 20:57:21 -07:00
Abtin Keshavarzian 48973e10e8 [slaac-address] use OT_ARRAY_END macro (#4242) 2019-10-28 20:57:21 -07:00
Marven Gilhespie a718c4e170 [efr32] Added otSysEventSignalPending and NVIC configuration to efr32mg21 (#4279) 2019-10-28 14:09:20 -07:00
Marven Gilhespie 13f138284f [efr32] move __START definition to Makefile-efr32mgxx makefiles (#4278)
Allows external projects to use SDK library generated in OpenThread
with constructors called at startup.
2019-10-28 14:07:47 -07:00
Abtin Keshavarzian 988dc85639 [mac] adding mac_types.hpp/cpp (#4276)
This commit add `mac_types` module which includes definitions for
different MAC types such as PanID, Address, Extended PAN Identifier,
Network Name, etc. These definitions are moved from `mac_frame` into
new the newly added files.
2019-10-28 08:55:48 -07:00
Yakun Xu 9cb3fa50ef [cli] get preferred and supported channel mask (#4253) 2019-10-24 22:30:34 -07:00
Kamil Sroka 7fddb6c9db [heap] export heap API (#4143) 2019-10-24 22:28:51 -07:00
konradderda c3ca842658 [nrf528xx] add wildcards to PRETTY_FILES list for nrf528xx sources (#4272) 2019-10-24 22:27:00 -07:00
Rongli Sun eac27c0f45 [cli] add hex string payload for udp send (#4241) 2019-10-24 10:33:08 -07:00
Abtin Keshavarzian ed8c9f18df [mac] set tx frame as empty when tx aborted during frame preparation (#4265)
The TxDone callbacks can be invoked with `OT_ERROR_ABORT` from two
different paths: Either when OpenThread itself cannot prepare the tx
frame (e.g., message was removed while waiting for MAC to handle a tx
request and ask next layers to prepare the frame) or when the radio
platform itself need to abort the tx.

This commit changes the code such that in the first case, the frame
length is set to zero to mark it as empty. The empty frame helps
differentiate between the two cases and ensures that a previously tx
frame is not incorrectly used from the TxDone callbacks.

The TxDone callback handlers (in `MeshForwarder`, `DataPollHanlder`,
`IndirectSender` and `DataPollHandler` are updated to check for frame
not being empty when processing the frame.
2019-10-24 08:46:54 -07:00
Jonathan Hui aaafa1a480 [fuzz] add stub for CCA ED radio APIs (#4269) 2019-10-23 20:07:11 -07:00
Krzysztof Taborowski 4871f12645 [third-party] change end of line character from CRLF do LF (#4250)
Also remove .gitattibutes from third-party
2019-10-23 12:31:02 -07:00
Yakun Xu c4e7156f41 [coap] force set message id for CON and NON types (#4255) 2019-10-22 11:37:57 -07:00
Zhanglong Xia 5858bd1d28 [spi-hdlc-adapter] remove unused variables (#4252) 2019-10-22 11:24:52 -07:00
konradderda fb14009916 [radio] handle CCA ED threshold property configuration (#4246)
Changes:
- Radio interface simply passes calls to platform functions
- Platform implementation for nRF52840 and nRF52833
- Placeholders for other platforms (resulting with
  OT_ERROR_NOT_IMPLEMENTED)
- Spinel property configuration handlers
2019-10-16 10:50:26 -07:00
Zhanglong Xia 3f2c2290ac [efr32mg12] update the channel range of channel config entry (#4214) 2019-10-16 10:47:09 -07:00
Abtin Keshavarzian 233f8406e3 [topology] remove unused (non const) GetExtAddress() method (#4249) 2019-10-15 21:40:59 -07:00
Abtin Keshavarzian 956fa518a7 [tests] update test_child to use Clear() instead of memset (#4248) 2019-10-15 15:46:17 -07:00
Li Cao 0e45ba6d77 [tests] fix the wrong port of dtls (#4244) 2019-10-15 10:18:04 -07:00
Yakun Xu 45be16f86e [posix-app] make set an atomic operation (#4235) 2019-10-15 09:07:21 -07:00
Simon Lin ca798e267d [coap] optimize call to GetMatchedResponseCopy (#4182)
Method ResponsesQueue::EnqueueResponse was using
GetMatchedResponseCopy to check if matched response already exists in
the cache. The code might clone message only to release it right away,
which is not efficient.

This commit:

1. Adds a new method ResponsesQueue::FindMatchedResponse which tries
   to find and return the matched response in the queue, without
   cloning the message

2. Optimize EnqueueResponse by using FindMatchedResponse

3. Re-implements GetMatchedResponseCopy using FindMatchedResponse to
   to reduce code redundancy.
2019-10-14 21:05:55 -07:00
Zhanglong Xia d9e333e091 [travis] add library size report support (#4239) 2019-10-14 10:28:49 -07:00
wgtdkp 69e23e2c60 [mbedtls] fix wrong ECDSA enabling macro (#4238) 2019-10-14 10:27:56 -07:00
wgtdkp ff789e4ded [api] add API to get Thread Version (#4225) 2019-10-14 10:24:30 -07:00
Zhanglong Xia ea0cc8f3bb [nrf528xx] correct the link of nRF5 Command Line Tool in README (#4236) 2019-10-11 09:58:21 -07:00
Yakun Xu f7801c7fab [coap] remove otCoapMessageSetMessageId() (#4227)
Message ID is managed by CoAP agent. Allowing user setting it may
result in invalid usage. This commit removes this API and adds a new
API to initialize CoAP response message.
2019-10-11 09:53:41 -07:00
Yakun Xu f691ea3edf [examples] provide APIs to manipulate 802.15.4 frames (#4156)
This commit exposes utility functions for radio drivers to manipulate
MAC frames.
2019-10-11 09:50:20 -07:00
Simon Lin 28ffcd1bc6 [posix] always set ACK FP for data requests when SrcMatch is disabled (#4232) 2019-10-10 10:08:36 -07:00
Jonathan Hui 98fb9dfaf4 [instance] fix typo in OT_CHANGED_IP6_MULTICAST_* (#4230) 2019-10-09 15:01:32 -07:00
Łukasz Duda 00fa340747 [nrf528xx] change casting type to remove SES warning (#4229) 2019-10-09 08:50:29 -07:00
wgtdkp 350b83acb0 [udp] suppress warning of unused parameter (#4228) 2019-10-09 08:49:47 -07:00
Zhanglong Xia 96e1ffa307 [posix] use common source match table implementation (#4160) 2019-10-09 08:44:19 -07:00
Jing 0d9263cc0e [harness-automation] update to support both external and internal Test Harness (#3883)
1. add new role support for border router and its 8 cases 7.1.x

2. update cases referring to Test Harness v50.x

3. for version larger than R1.4.0, not trigger saving results
   web-operation since it will auto save.

4. use "python3 -m black -l 119 -S" to format harness-automation
   directory

5. correct required golden device numbers
2019-10-09 08:42:09 -07:00
Yakun Xu 862a2b3d02 [script] use python version specified in test script (#4226) 2019-10-08 09:29:27 -07:00
Simon Lin cc91b2c72b [mle] fix MleRouter::UpdateRoutes (#4146)
- Move updating link quality ahead of updating routes to fix potential
  wrong routing path switch

  - In each do-while loop, the method traverse each router id and
    update the routing path to the router (RU) according to new
    Route64 TLV received from the neighbor, and also update link
    quality out to the neighbor (LU) when the router id is that of the
    receiver. So, there could be RUs before LU and also after LU. The
    RUs before LU are using wrong link quality to the neighbor for
    comparison, thus could cause lower cost routing path be replaced
    by higher cost routing path or even lost.

  - This commit moves LU ahead of RUs to make sure all RUs are using
    correct link quality to the neighbor for calculation.

- Remove the unnecessary do-while loop

  - The do-while loop is unnecessary after LU is moved.

  - For each RU, the calculation depends on following factors:

    - F1: Routing cost to the router using current nexthop

    - F2: Routing cost to the router using the neighbor as nexthop

  - So, each RU is independent of each other, and all RUs can be
    updated in one loop.

- Skip RU when router == neighbor is satisfied

  - The original RU code actually do nothing when router == neighbor
    is satisfied. Real routing updates only happen in if (router !=
    neighbor) blocks.

  - Logically speaking, the routing path to the neighbor can not be
    updated by processing Route64 TLV from the neighbor itself.

  - By skipping earlier, the code is more clear and easier to
    understand.

- Replace (cost + mRouterTable.GetLinkCost(*neighbor) <=
  kMaxRouteCost) with (cost + mRouterTable.GetLinkCost(*neighbor) <
  kMaxRouteCost)

  - Even through the routing path with cost == kMaxRotueCost can be
    established, it will never be utilized in the current OT
    implementation. In method MleRouter::GetNextHop, nexthop is only
    used if ((routeCost + GetLinkCost(router->GetNextHop())) <
    linkCost). Since linkCost <= kMaxRouteCost, nexthop with routing
    path cost >= kMaxRouteCost will never be used.

  - Use cost < kMaxRouteCost to indicate finite routing cost and cost
    >= kMaxRouteCost to indicate infinite routing cost for consistency
2019-10-08 09:21:00 -07:00
Jonathan Hui 386746b1bf [travis] switch to ubuntu bionic (#4222) 2019-10-07 13:56:05 -07:00
Łukasz Duda 1de6a3dfda [toolchain] add definition of UINT16_MAX (#4224) 2019-10-07 13:55:39 -07:00
Abtin Keshavarzian fb2de8fe45 [sntp-clinet] remove memset(zero) from constructors (#4195) 2019-10-04 15:35:53 -07:00
Abtin Keshavarzian c1d123d177 [mle] remove memset from DelayedResponseHeader constructors (#4195) 2019-10-04 15:35:53 -07:00
Abtin Keshavarzian 26743fae04 [dns-client] remove memset(zero) from constructor (#4195) 2019-10-04 15:35:53 -07:00
Abtin Keshavarzian 726d8e96e3 [core] make metadata (saved in Message) non-packed (#4195) 2019-10-04 15:35:53 -07:00
Abtin Keshavarzian c5d4fc5cbe [topology] adding Child:Clear() and Router::Clear() (#4195) 2019-10-04 15:35:53 -07:00
Abtin Keshavarzian 4feadec950 [time] adding Time class (#4195)
This commit adds `Time` class which represents an instance of time
(it is a simple wrapper over a `uint32_t` corresponding to a
numerical time value). The `Time` class provides helpful operator
overloads:
- Operators `+` and `-` with a `Time` instance and a `Duration` to
  get a `Time` instance after or before.
- Operator `-` with two `Time` instances to calculate the `Duration`
  duration between two time instances.
- Operators `<`, `<=`, `>`,'>=', '==' and `!=` to compare two `Time`
  instances. They correctly handle the wrapping of numeric time value.

The core modules are updated to use the new `Time` and `Duration`
types which help make the code simpler. This commit also updates the
 unit test `test_timer` to add test cases for newly added types.
2019-10-04 15:35:53 -07:00
Jonathan Hui 43be2b821f [tests] require python3 and drop support for python2 (#4220) 2019-10-04 11:03:58 -07:00
Marven Gilhespie 43c8a709db [efr32] add radio.c debug counters for efr32mg12 and efr32mg21 (#4217)
Also adds Silicon Laboratories, Inc. to AUTHORS file.
2019-10-04 11:03:18 -07:00
Abtin Keshavarzian 3888226c3f [toranj] add test covering wpantund host route management feature (#4218) 2019-10-04 09:39:00 -07:00
Rafał Kuźnia 3a248f649a [nrf52840] add UART and BLE bootloader support (#4212)
This commit introduces serial and BLE DFU bootloader support
* Added new linker script for serial and BLE DFU bootloaders
* Added new nRF52840 switches (BOOTLOADER_USB/UART/BLE)
* Deprecated BOOTLOADER=1 switch
2019-10-02 10:53:42 -07:00
Rongli Sun d40b273a84 [mesh-forwarder] support DHCP traffic forward when DHCP is disabled (#4219) 2019-10-02 10:21:21 -07:00
Jonathan Hui 378183e21e [tlvs] use uint32_t for TLV size to avoid overflows (#4216) 2019-10-01 08:36:39 -07:00
Abtin Keshavarzian 86b3cfef56 [mac-frame] set kMtu from config param and inline simple getters (#4215) 2019-10-01 08:36:20 -07:00
konradderda f657451951 [nrf528xx] always enable NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT (#4210)
If all of COMMISSIONER/JOINER/TIME_SYNC switches are not enabled and
CC310 is not disabled, RNG always produces the same values (even after
issuing a reset). This is caused by mbed TLS library which by default
uses 256 keys internally but CC310 AES module can handle only 128 bit
keys. We can enable NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT options for
all configurations to enable software implementation when keys longer
than 128 bits are used.
2019-10-01 08:35:27 -07:00
Abtin Keshavarzian f29a2f1257 [mac] prioritize a pending poll tx after handling of frame tx (#4211)
This commit ensures to prioritize a pending poll tx request after
handling a (direct) frame tx request. This addresses the situation
where back-to-back frame tx requests could have delayed a data poll
tx request.
2019-09-27 10:19:43 -07:00
konradderda 2dedd82ef3 [nrf528xx] change directory structure for nrf528xx family (#4206)
Merged nrf528xx sub-directories to simplify maintenance and porting of
new nrf528xx family platforms in the future.

Crucial changes:

- Moved all source files to common 'src' directory

- Merged all *.c files and treated platform specific fragments of code
  with conditional compilation

- Created simple automake file
  [examples/platforms/nrf528xx/Makefile.am] that includes
  conditional-include blocks
2019-09-27 10:17:29 -07:00
Abtin Keshavarzian 51217542ba [commissioner] log commissioner state changes (#4207) 2019-09-25 16:33:22 -07:00
Abtin Keshavarzian 900764d2ee [commissioner] make simple getter methods inline (#4207) 2019-09-25 16:33:22 -07:00
Abtin Keshavarzian 9aed664596 [commissioner] update how Provisioning URL is stored (#4207)
This commit updates how the `Commissioner` stores the Provisioning URL
(now saved as null terminated string). It also updates the related
APIs (including the public `otCommissionerGetProvisioningUrl`) and its
use in `NcpBase`.
2019-09-25 16:33:22 -07:00
Abtin Keshavarzian 621ad11055 [commissioner] iterate over joiners using pointer (#4207) 2019-09-25 16:33:22 -07:00
Yakun Xu fff7a38cf1 [build] fix missing definitions in configure.ac (#4201)
This commit adds missing definitions in configure.ac to fix configure
with options like `--disable-FEATURE`. This is because some features
are enabled by default, if missing defining as `0`, the
`--disable-FEATURE` will not work.
2019-09-25 16:30:14 -07:00
huamenggg 6cfb4162d7 [coap] add IsBound() check in Coap::Send (#4205) 2019-09-24 10:35:58 -07:00
huamenggg a1cffd2545 [platform-netif] set link type to void (#4198)
This commit sets link type to void so that only one link-local
address will exist.
2019-09-21 02:19:10 +08:00
Jonathan Hui 8be8bf1fdf [meshcop] improve HandleCommissioningGet implementation (#4194)
- Fix insufficient length checks.
- Avoid using a large stack buffer.
2019-09-20 14:39:49 +08:00
Abtin Keshavarzian 4916f1c0c5 [mac] add Mac::NetworkName class (#4169)
This commit adds `Mac::NetworkName` class as C++ wrapper over the
`otNetworkName`. It also adds `NetworkName::Data` to represent the
network name as a pointer to a char array buffer (not necessarily null
terminated) with a given length. This representation is used by
`Mac::BeaconPlayload` and `MeshCop::NetworkNameTlv`. This commit also
adds a unit test for `Mac::NetworkName` class.
2019-09-20 14:39:28 +08:00
Simon Lin bf2ad6d166 [posix-sim] add method route_list & route_table to Node (#4142)
This commit implements the router_list and router_table methods for
Node in simulator.

This commit also includes a simple test to verify correctness.
2019-09-20 14:38:29 +08:00
Yakun Xu 6fd3a24a43 [coap] add message free on error in Cli::CoapSecure::DefaultHandler (#4193) 2019-09-20 05:36:05 +08:00
Zhanglong Xia c81fc67b82 [api] change commissioner API from c++ style to c style (#4192) 2019-09-19 23:09:48 +08:00
huamenggg 05eb406106 [dataset] support pskc in DatasetManager::SendSetRequest (#4189) 2019-09-19 22:32:58 +08:00
Yakun Xu addaefe5e1 [build] no feature defines in config.h (#4157) 2019-09-19 15:13:23 +08:00
Abtin Keshavarzian 1f6c85cb69 [commissioner] use Mac::ExtAddress helper methods (#4181) 2019-09-19 15:12:04 +08:00
Abtin Keshavarzian 48b64f8d30 [address-resolver] use ExtAddress helper methods (#4181) 2019-09-19 15:12:04 +08:00
Abtin Keshavarzian d81af29640 [ip6-address] use ExtAddress helper methods (#4181) 2019-09-19 15:12:04 +08:00
Abtin Keshavarzian 20145cb42f [core] always implement operator != in terms of == (#4188) 2019-09-18 19:13:11 -07:00
Abtin Keshavarzian 1555b21910 [key-manager] add Pskc class (#4174)
This commit adds a `Pskc` as a wrapper over `otPskc` and also
renames all the uses of `PSK` into `Psk` to follow our variable
and type naming convention which treats an acronym as a whole
word.
2019-09-18 19:11:07 -07:00
huamenggg 1ac791b79d [posix-app] allow pseudo reset (#4184) 2019-09-18 07:47:30 -07:00
huamenggg 6d1981b112 [commissioner] add GetNextJoinerInfo() function (#4179) 2019-09-18 07:46:37 -07:00
Jonathan Hui bb56fa906a [meshcop] enforce max length on commissioner id (#4178) 2019-09-17 17:11:49 -07:00
Jonathan Hui 68426e236f [network-data] set max length to 254 (#4177)
As specified by Thread Conformance Specification.
2019-09-17 17:11:29 -07:00
Jonathan Hui 767a8eb9bb [tlvs] add length check in Tlv::Find for extended tlvs (#4176) 2019-09-17 17:11:15 -07:00
Stuart Longland ebf665eb6a [cc2538] interrupt driven radio driver (#4137)
- Add a configuration flag that enables the reception of 802.15.4
radio frames by way of a hardware interrupt so that frames are not
missed whilst the CPU is busy processing something else.

- Move otPlatRadioGetPromiscuous into separate function. The only
place `readFrame` uses `aInstance` is when calling
`otPlatRadioGetPromiscuous`, which then ignores `aInstance` anyway.
So make a private function that reads the hardware register which
`readFrame` and `otPlatRadioGetPromiscuous` can call.

- Use cc2538RadioGetPromiscuous in readFrame. This allows us to drop
the problematic `aInstance` pointer. Whilst we're here, make the
function `static` since nothing else outside of `radio.c` calls it.

- Call readFrame on incoming data. If the interrupt fires, call
`readFrame` to pull that data in. When polling, also check (with the
interrupts disabled) just in case.

- Enable correct NVIC interrupt. `startup-gcc.c` enables alternate
interrupt mappings, which places the radio receive interrupt at number
26; which is in the very first register.

- Avoid debug logs in receiveFrame. If we call this method from an
interrupt handler, we want to avoid calling `snprintf` and similar
functions as these are generally not interrupt-safe. Instead, use an
extra byte of RAM to store the number of bytes dropped so we can log
it from a safe context. This is only needed when both interrupts _and_
platform logging are enabled.
2019-09-17 17:10:01 -07:00
Jeff Bumgardner 992ca4fdda [docs] update Doxygen groupings for new APIs (#4166) 2019-09-17 09:39:14 -07:00
Yakun Xu 3d9480c99a [posix-app] log filename when die (#4155)
This commit aims at adding the filename when die.

Other enhancements:
- Enable PLATFORM region by default for posix-app
- Disable warning for zero variadic macro arguments
- Use VerifyOrExit to implement other assert utilities
- Do not call fprintf() and print exit code in assert utility

To print dying message to stderr, add -v when launching the app.
To get the exit code, use echo $? just after the app died.
2019-09-17 09:38:17 -07:00
Yakun Xu 69f173ebae [posix-app] fix crash on os ifconfig down (#4171)
This commit fixes a crash issue triggered by system command ifconfig
down.  This is because OpenThread's tries removing addresses when the
platform network interface is already down.
2019-09-17 04:05:02 -07:00
huamenggg 9a0ef5304a [meshcop] add IsBound check in JoinerRouter::HandleStateChanged (#4170) 2019-09-17 01:41:10 -07:00
Simon Lin ff66a71c6a [coap] finish cached coap response before sending (#4175) 2019-09-17 01:37:07 -07:00
Zhanglong Xia c0ef327664 [radio] add radio coex control api (#4158) 2019-09-16 23:12:37 -07:00
Jonathan Hui 87ef3b1d51 [cli] avoid NULL dereference with udp send -s 0 command (#4164) 2019-09-16 18:08:47 -07:00
Yakun Xu e4dc606ec8 [script] add a script to make source pretty (#4167)
This commit adds a script to make source pretty in a temporary
directory.
2019-09-16 18:08:29 -07:00
Abtin Keshavarzian 3514458d5d [tlv] handle Extended TLV and simplify searching for TLV in a message (#4152)
This commit contains the following change in `Tlv` class:

- Changes `GetSize()`, `GetValue()` and `GetNext()` to ensure they
  work correctly independent of whether the TLV is an Extended TLV
  or not.
- Defines a new common private static method `Tlv::Find()` which
  is then used to simplify `Tlv::Get()` and `Tlv::GetOffset()` and
  `Tlv::GetValueOffset()` implementations.
- This change also ensures `Tlv::Get()` (which finds and reads a
  TLV of a given type within a message) work correctly for Extended
  TLVs.
2019-09-12 09:30:22 -07:00
Łukasz Duda 0e489b07e2 [network-diagnostic] limit number of entries in Child Table TLV (#4163)
This commit fixes Thread Certification Test Case Router_5_7_3 where
Child Table TLV was damaged.

This commit also ensures that only Base TLV format is used.

The bug was introduced introduced in d796b0.
2019-09-12 09:20:21 -07:00
Simon Lin 4dc58da927 [mle] always echo back AR TLV in Child ID/Update Response (#4162)
This commit ensures that a Child ID/Update Response message always
includes an Address Registration TLV when the Child ID/Update Request
message	includes an Address Registration TLV, even when there are no
IPv6 addresses to include.

This commit reverts a change in commit 1133983.
2019-09-12 08:51:39 -07:00
Yakun Xu 8595924e6c [utils] remove stdint and stdbool wrappers (#4154)
This commit removes the wrap_stdint.h and wrap_stdbool.h because
OpenThread enforces C99, which includes these headers in its standard
library.
2019-09-11 11:17:02 -07:00
huamenggg 050682ddc3 [tmf] add method to read entry from ChildTableTlv (#4147)
This commit add a method to read entry from ChildTableTlv. The
GetEntry() cannot be used because the current read ChildTableTlv
operation doesn't read child table entries.
2019-09-11 11:09:55 -07:00
Yakun Xu 957d79d786 [api] force linker failures when using disabled features (#4127) 2019-09-10 08:42:02 -07:00
Abtin Keshavarzian 0b220613ab [key-manager] add MasterKey class (wrapper over otMasterKey) (#4150)
The `MasterKey` class mainly provides overloads of operators `==`
and `!=` which help simplfy the code comparing keys.
2019-09-09 18:07:41 -07:00
Abtin Keshavarzian 472a03af88 [mac-frame] helper methods to copy ExtAddress in normal/reverse byte order (#4144)
This commit updates `Mac::ExtAddress` and `Mac::Address` to add
helper methods to copy address from/to a byte array in normal or
reverse bye order. This commit also adds a unit test for the two
Address classes.
2019-09-09 17:13:06 -07:00
Abtin Keshavarzian 276d866935 [mac] add Mac::ExtendedPanId type (wrapping otExtendedPanId) (#4149) 2019-09-09 17:03:06 -07:00
Kamil Sroka ad6af37d99 [crypto] don't add entropy source if it's done by mbedTLS (#4140)
If platform uses MbedTLS feature to add entropy source during context
init (by platform entropy, HAVEGE or MBEDTLS_ENTROPY_HARDWARE_ALT) we
shouldn't add second entropy source. This saves time and power as we
don't have to poll two different entropy sources/poll same entropy
source twice.
2019-09-09 09:23:05 -07:00
Jonathan Hui a154692422 [cli] add error check to udp send command (#4148) 2019-09-08 21:40:15 -07:00
Abtin Keshavarzian 7761d3cc21 [toranj] add test to verify child sending data poll within its timeout (#4136)
This commit adds a `toranj` test-case. This test covers the situation
where the data poll interval is set to a value larger than child's
timeout interval. The test verifies that the sleepy child would send a
data poll within its timeout interval (ensuring that child stays in
parent's child table).
2019-09-08 21:37:52 -07:00
Abtin Keshavarzian 5e33f42f15 [data-poll-sender] always honor the default child timeout based poll interval (#4136)
This commit changes the `DataPollSender` to ensure that a child device
will always send a data poll within its timeout interval. This
addresses an issue where a large user-specified poll period could
cause the device to adopt a poll period longer than the default child
timeout (causing parent to kick the child out of its child table).

This commit also simplifies the selection code for a new poll period
by adding a helper `UpdateIfLarger()` method to update the period only
if it's larger than a given new value.
2019-09-08 21:37:52 -07:00
Abtin Keshavarzian a11dafb686 [network-diagnostics] use the child timeout directly (#4136)
This commit changes the `NetworkDiagnostic::FillRequestedTlvs()` to
directly use the child timeout value in appended `TimeoutTlv`. This
addresses an issue where a user-specified long data poll interval
could cause the timeout TLV in diags response to be set higher than
actual child's timeout value.
2019-09-08 21:37:52 -07:00
wgtdkp 2d3fd3b047 [meshcop] fix sending MGMT_DATASET_CHANGED.ntf to commissioner (#4145) 2019-09-06 09:45:25 -07:00
Simon Lin eb5b42a86e [mle] reset MLE adv timer when cost changes to/from infinite (#4129) 2019-09-04 22:02:26 -07:00
Kamil Sroka e7ea31b16f [crypto] seed PRNG from DRBG when possible (#4141) 2019-09-04 12:06:27 -07:00
Kamil Sroka fac99c7091 [nrf528xx] remove default value for BuildJobs (#4139) 2019-09-04 12:03:56 -07:00
Marven Gilhespie 87105e0694 [efr32] add sleepy demo for efr32mg21 (#4138)
Sleepy Demo added to the efr32mg21 directory.

Updated efr32mg21 alarm.c to use changes for efr32mg12 in commit 89dca58.
2019-09-04 12:02:58 -07:00
Abtin Keshavarzian ef4adde7be [data-poll-handler] always process data poll when acked with "frame pending" (#4131)
This commit removes the extra check remaining from before the change
from #3785 and the related follow-ups. Before having the "Acked with
FP" feature, we relied on number of indirect msg in queue (for the
child) or state of src-match-table to determine/guess if the data poll
was acked with fp or not. That is now redundant and can be incorrect
(e.g., if a message was removed/evicted after data poll was acked with
fp set).

If the data poll is acked with "frame pending" flag set, the child
would stay in rx expecting a frame from parent. If we have no frame
for the child, parent would send an empty frame to let the child know
that it can go to sleep (and avoid the child having a data timeout and
retx the data poll).

This change is required for new platform abstractions like Thread over
BLE (ToBLE) where we may not have the ack or frame-pending notion at
the link layer and rely on next layer to follow a "data poll" with
empty frame (when there is no pending frame).
2019-08-30 13:16:41 -07:00
Simon Lin 3c402a7485 [commissioner] only allow attached device to become commissioner (#4120)
The commit addresses the issue that running "commissioner start"
command when device role is detached will cause commissioner not be
able to start or stop.
2019-08-30 09:04:42 -07:00
Rafał Kuźnia 528e7d5992 [nrf528xx] fix compiler warning (#4135)
sInstance was unused without OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT.
2019-08-30 09:01:45 -07:00
Abtin Keshavarzian ed0939c45a [mac] move static variable definition into Mac class (#4132)
Reasons for this the change:

- Namespace/scope variables under Mac class only.

- Allow us in future to potentially break mac.cpp into multiple files
  (e.g. mac_ftd?).
2019-08-30 09:01:08 -07:00
Simon Lin 45b3baf040 [heap] increase default internal heap size for DTLS (#4130)
Test Case 8.1.1 on cc2538 OT TB has a fail probability of 19% due to
DTLS handshake failure. This commit fixes this issue by increasing
heap size by 128B (6144B -> 6272B), resulting in 100% Pass.
2019-08-30 08:59:28 -07:00
Rongli Sun 4a9b611d05 [core] EID-to-RLOC cache map optimization (#4091)
This commit adds EID-to-RLOC map cache entries by inspecting packets
received, aiming to reduce RealmLocal multicast AQ when response is
expected.
2019-08-30 08:58:16 -07:00
Simon Lin c3be816e07 [thci] fix setXpanId bug and code cleanup (#4121)
This commit fixes a bug where setXpanId might raise exception when
called with xPanId of length 16.

This commit also renames __convertLongToString to __convertLongToHex
to better reflect its functionality and optimizes its implementation.
2019-08-30 08:53:50 -07:00
Ciaran Woodward 3ddc4fe98c [docs] fix reference to old function name in link.h (#4134)
otSetChildTimeout -> otThreadSetChildTimeout
2019-08-29 13:22:09 -07:00
Abtin Keshavarzian 3cd4be9392 [mac] add IsJoinable (private) method (#4133) 2019-08-29 13:21:19 -07:00
Yakun Xu 6b42ce5845 [nrf52840] simple implementation of app_error_handler (#4124)
This commit provides a simple implementation of app_error_handler(),
which resolves the link error with DEBUG=1.

This commit also adds DEBUG=1 flag in CI tests of nrf52840 platform to
prevent this error from happening again.
2019-08-28 12:54:19 -07:00
Christian Stauffer 864e3458f5 [ip6] add IPv6 fragmentation and reassembly support (#3948) 2019-08-28 10:31:55 -07:00
Jiacheng Guo 3198a3be69 [posix] do not exit upon recv getting EINTR (#4126) 2019-08-27 08:39:29 -07:00
Yakun Xu 711c03aa1e [travis] remove postgresql source list (#4125)
Avoid CI failures caused by pgdg.list.
2019-08-27 08:36:05 -07:00
Jonathan Hui 6334107e19 [address-resolver] restart address queries when RLOC changes (#4123) 2019-08-26 10:21:10 -07:00
Hubert Miś f71d88983e [nrf52xxx] update radio driver to version 1.5.0 (#4122) 2019-08-23 10:07:08 -07:00
Jonathan Hui d796b056c5 [child-table] add support for more than 64 children (#4118) 2019-08-23 09:15:37 -07:00
Jintao Lin f3f8654b0f [nrf52xxx] use Rx SFD time in Rx timestamp for promiscuous mode (#4106) 2019-08-23 09:14:50 -07:00
Abtin Keshavarzian 5569ecfa0b [toranj] test-case covering attach between single parent/child with poor link (#4114) 2019-08-22 12:04:12 -07:00
Abtin Keshavarzian 9869ab5df9 [mle] process "Parent Response" from current parent candidate (#4114)
This commit updates MLE to continue to process a repeated
"Parent Response" from current parent candidate to ensure that the
challenge and frame counter are correctly updated.
2019-08-22 12:04:12 -07:00
Yakun Xu 79c61a5700 [diag] clean up unnecessary variables and code (#4102) 2019-08-22 08:38:56 -07:00
Zhanglong Xia 27cac08e8a [radio] add coex metrics (#4108)
- Add platform get coex metrics API
- Add spinel property for coex metrics
2019-08-21 12:25:27 -07:00
Yakun Xu bbd289e278 [posix-app] remove node id from logging (#4110)
* Simplified posix-app logging
* typedef otLogLevel to signed int so that when dynamic logging and
  reference_device is enabled, there will not be always true error.
2019-08-21 09:58:27 -07:00
wgtdkp fcc936fe45 [border-agent] fix appending extended UDP Encapsulation TLV (#4104) 2019-08-20 11:51:02 -07:00
Abtin Keshavarzian 27336a95cf [sub-mac] relax the requirement for TxDone callback (#4113)
This commit changes the `SubMac::BeginTrasnmit()` by moving the call
to `Transmit()` on radio platform after the state change to
`kStateTransmit` (and pcap callback). This relaxes the requirement for
radio platform implementation and allow it to invoke `TxDone` callback
directly from the `Transmit()` call itself (instead of requiring
`TxDone` to be called only after the `Transmit()` call returns).
2019-08-20 08:39:24 -07:00
Yakun Xu 1812d8cfda [build] remove unused definitions from configure.ac (#4109) 2019-08-20 08:38:21 -07:00
Rafał Kuźnia f31c87b46e [utils] add option to use external heap (#4041)
This commit introduces a new API call otHeapSetCAllocFree

The API is available to the application from `heap.h` header and is
enabled when `EXTERNAL_HEAP` common switch is set. The call must be
invoked before the OpenThread instance is initialized.

This allows the OpenThread to use an external heap for allocation, for
example from FreeRTOS.
2019-08-19 12:01:54 -07:00
Abtin Keshavarzian 2a0d6c402f [posix-sim] remove unused variable (#4103) 2019-08-19 07:44:51 -07:00
Jonathan Hui 711598eb17 [cli] fix inconsistent printf format specifier (#4101) 2019-08-19 07:43:18 -07:00
Yakun Xu 979e454117 [posix-app] refine OpenThread POSIX-app API (#4073)
This commit makes it easier to OpenThread POSIX-app as a library.

* Remove ot prefix from non-public platform-specific APIs.
* Avoid main() calls non-public platform APIs.
* Parse arguments outside of POSIX-app library.
* Add option to log to stderr.
* Add LOG_OUTPUT flag
* Delete assert() in RadioSpinel::Receive()
2019-08-15 16:24:15 -07:00
Yakun Xu e1da9f3eee [travis-ci] merge pretty check (#4096)
This commit combines the pretty checks between C/C++ and python into
one job to reduce the number of jobs and save Travis time overall.

This commit also moves pretty check and size report logic from Travis
scripts into a separate script to improve overall usability and
maintainability.
2019-08-15 15:47:52 -07:00
jrodriguez42 7a27590222 [dhcp6] add multicast solicit and accept more general replies (#4076) 2019-08-15 12:31:53 -07:00
wgtdkp a388d6ef33 [border-agent] handle error responses from leader (#4097)
This commit removes an assumption in the border agent that COM_PET.rsp
from the leader 1is CHANGED.  It is possible for the leader to return
a 4.XX error response. In that case, the border agent should forward
the error response.
2019-08-15 08:43:59 -07:00
Yakun Xu cdc3751e59 [diag] fix processing platform command (#4099) 2019-08-14 22:21:58 -07:00
wgtdkp d4bcb16b1d [border-agent] send error responses with correct error code (#4098)
This commit fixes a bug where the border agent does not create error
responses with correct error codes.
2019-08-14 12:37:37 -07:00
Jeffrey Hayes c6d7674b2c [mle] enable state update timer when enabling router role (#4094)
The state update timer should be started when enabling router role and
attached to a network.
2019-08-14 12:34:51 -07:00
Jonathan Hui d0214bffe6 [ip6] fix default source address selection (#4082)
Thread defines a mesh-local scope for IPv6 unicast addresses. However,
the mesh-local scope can only be inferred by inclusion of the
mesh-local prefix.

This commit updates the IPv6 source address selection to infer the
destination address scope based on a prefix match with currently
assigned addresses.
2019-08-14 12:33:36 -07:00
Marven Gilhespie 89dca58915 [efr32] fallback to use relative timer if absolute timer fails to start (#4081)
Added a fallback to the efr32mg12 where if an alarm set with an
absolute expiry time (t0 + dt) has failed to start then we fallback to
using a relative timer (dt).

It has been observed in testing that alarms have stopped working on
the efr32mg12. This has caused other issues such as buffers not being
freed or the network splitting as no further alarms are scheduled.

The cause is due to an alarm being set to expire slightly in the
past. In this case we fallback to using a relative timer using only
the dt value. For the cases where it fails it will be set to 1ms into
the future from the time the RAIL_SetTimer is called.

RAIL maintains time in microseconds but is being rounded down for the
time returned in milliseconds by otPlatAlarmMilliGetNow. We used a 1ms
minimum delta to ensure that the absolute time would be in the next
millisecond but this could still fail. We therefore use a relative
timer in this case which on the cases where it fails should be 1ms
ahead of current time.
2019-08-14 12:32:50 -07:00
Jonathan Hui 0dde90edcb [fuzz] avoid tasklet execution if platform was reset (#4093) 2019-08-13 08:49:51 -07:00
Yakun Xu 80f982301c [dtls] remove unnecessary member variables (#4090) 2019-08-12 10:46:51 -07:00
Rongli Sun 72d7513b03 [tests] update inspect along with #3878 changes (#4088) 2019-08-12 09:08:55 -07:00
Abtin Keshavarzian f9f8d2c690 [key-manager] update ComputeKey to use BigEndian::WriteUnit32 (#4087) 2019-08-12 09:07:10 -07:00
Abtin Keshavarzian 7d42350693 [key-manager] add a common GenerateNonce used by both MAC and MLE (#4086) 2019-08-12 09:06:16 -07:00
Jonathan Hui c5be94a7dc [dtls] set mReceiveMessage to NULL when done processing (#4085) 2019-08-12 09:03:38 -07:00
Abtin Keshavarzian f73b6b9337 [mle] save network info on mle mode change (#4078)
This commit ensures to save the network info in non-volatile settings
when the MLE device mode is changed (`Mle::SetDevcieMode()`)
independent of whether the device is currently attached or not. This
helps address the situation where there is a single router/leader
device in network and user changes the MLE thread mode to make it a
sleepy (where due to device being the only node in the network it
would not attach). Then, later upon device reset (without the change
in this commit) the device would have started again as router/leader.
Note that network info is saved/updated in non-volatile memory after a
successful attach.
2019-08-12 09:03:04 -07:00
Abtin Keshavarzian 278315c6e5 [config] fix config check helper messages (#4067)
This commit updates helper error message in `core-config-check.h`
file and adds some of the missing changed config option. It also adds
a comment to indicate that error message is intended as a hint to
what the new configuration parameter name may be.
2019-08-09 08:30:20 -07:00
Yakun Xu 4143fb4a39 [posix-sim] implement UART flush (#4072) 2019-08-08 12:10:50 -07:00
Yakun Xu f740fda8d6 [test] support full log (#4071)
This is useful when more logs are enabled and the logs contain
"leader", "child", "router" or "leader".
2019-08-08 08:34:14 -07:00
Abtin Keshavarzian 5d09ce7124 [config] remove duplicate unused definitions and fix comments (#4069)
This commit removes the unused duplicate definition in `tmf.h` for
`OPENTHREAD_CONFIG_INFORM_PREVIOUS_PARENT_ON_REATTACH` (this is
defined in `config/mle.h`). Also updates the comment/documentation
for `DHCP6_SERVER_NUM_PREFIXES` and `JOINER_MAX_CANDIDATES`.
2019-08-08 08:32:33 -07:00
Abtin Keshavarzian 0508f19c09 [config] fix config option OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER (#4068)
This commit fixes the wrong name used in `npc_uart.cpp`. Note that
this config parameter is part of `configure.ac` definitions.
2019-08-08 08:32:05 -07:00
Abtin Keshavarzian 18cd02e6b1 [mac] update the log message for frame tx failure (#4059)
The new model handles the case where frame retries are not handled
by sub-mac layer (e.g., delegated to radio platform).

This helps improve the log message in posix-app model where the retx
is handled by the RCP and not on the host side.
2019-08-08 08:31:12 -07:00
Abtin Keshavarzian 700bb6b5a8 [radio] adding Radio::Callback class (#4045)
This commit adds a `Radio::Callback` class which provides all the
callbacks (as C++ methods) mirroring the radio platform layer
callbacks (including the diags related radio callbacks).
2019-08-08 08:29:38 -07:00
Abtin Keshavarzian 142d98c0ee [radio] add Radio class abstracting radio platform APIs (#4045)
This commit adds a a `Radio` class which provides all `otPlatRadio`
platform APIs (as C++ methods). All OT core modules use the new
`Radio` methods to interact with radio platform APIs.
2019-08-08 08:29:38 -07:00
Abtin Keshavarzian b1d92846c0 [radio] add radio folder to core (#4045)
This commit renames existing `phy` folder into `radio`. It also
renames some of the related files in this folder. It also moves
all default/weak `otPlatRadio` implementations to a common
`radio_platform_defaults.cpp` file.
2019-08-08 08:29:38 -07:00
Marven Gilhespie 6ebc517408 [efr32] fix assert triggered in otPlatRadioTransmit (#3768) (#4060)
* Removed assert if RAIL_StartTx() fails. It will report the error and continue

* Updated Makefile.am to fix missing header and prettified radio.c

* Added OPENTHREAD_CONFIG_NCP_UART_ENABLE to efr32mg12 config
2019-08-06 09:32:24 -07:00
Rafał Kuźnia 28a9620758 [ncp] set NCP instance pointer to NULL during pseudo reset (#4065)
This commit fixes the problem with initializing the NCP with
wpantund. The bug was apparent when the NCP image was built with the
FULL_LOGS switch set.

The reason for the bug was that after the pseudo reset the OpenThread
stack wrote logs to NCP's otPlatLog implementation that used the not
yet initialized NCP object. This put the mUartSendTask and
mUpdateChangedPropsTask to the TaskletScheduler linked list.

Later when the NCP itself was initialized, the mNext pointer in the
tasklets mUartSendTask and mUpdateChangedPropsTask was set to null,
causing all tasklets scheduled after the mUartSendTask to be lost. The
NCP reset status could not be in such case sent to the wpantund. The
wpantund then retried resetting the NCP, which repeated the process
until the wpantund gave up.
2019-08-06 09:16:08 -07:00
Yakun Xu c7a7d1e7f5 [posix] always set timestamp (#4066)
This sets frame rx timestamp regardless of promiscuous mode enabled or
not. This is useful for debugging time related issues.
2019-08-06 09:11:42 -07:00
Mirek 70a9046f79 [docs] fix diag README link (#4064) 2019-08-06 09:07:43 -07:00
Yakun Xu 116f9cbdbc [travis] generate size report (#4026)
This commit splits the jobs into 2 stages: lint, test.  In the lint
stage, generate size diff report and post into the pull request.
2019-08-06 09:05:54 -07:00
Abtin Keshavarzian 78f602df42 [data-poll-handler] update the logging of indirect tx failure (#4058)
This commit changes data poll handler to log an indirect tx failure
only when the tx attempt counter is increased (i.e., when there is a
no-ack error).
2019-08-05 11:10:31 -07:00
Zhanglong Xia 14875e1380 [posix] fix time sync issue (#4057)
#4015 missed setting the timestamp when TIME_SYNC is enabled.
2019-08-05 10:42:14 -07:00
Jonathan Hui f37c3256e7 [docs] remove AppVeyor from CONTRIBUTING.md (#4056) 2019-08-05 09:05:52 -07:00
Jonathan Hui b44fab7327 [travis] add GCC 9 to build matrix (#4055) 2019-08-05 09:05:23 -07:00
Zhanglong Xia a03d4ee9be [udp] update the returned value of API otUdpOpen() (#4054) 2019-08-05 09:03:23 -07:00
Jonathan Hui af573f5e72 [dataset] only master key is needed to attach (#4051) 2019-08-05 09:02:25 -07:00
Abtin Keshavarzian 2eab474025 [ncp] use OT public link API to get factory-assigned EUI64 (#4047)
This commit changes the get handler for `SPINEL_PROP_HWADDR` to
use the public OT link API `otLinkGetFactoryAssignedIeeeEui64`
instead of the platform API. It also adds implementation of
this API under `OPENTREAD_RADIO` mode (for RCP build).
2019-08-05 08:52:17 -07:00
Abtin Keshavarzian 939ac82bf2 [indirect-sender] add FrameContext class (#4005)
This commit adds a `FrameContext` type (containing all info that need
to be saved along with a prepared frame for indirect transmission) and
its support in `IndirectSender` and `DataPollHandler`. While the
`FrameContext` is defined by the `IndirectSender`, the lower-layer
`DataPollHandler` is expected to provide the buffer/object for it to
be stored (when the frame is prepared). This model allows different
implementations of `DataPollHandler` to adopt different strategies on
how to store the context.
2019-08-02 14:19:32 -07:00
Abtin Keshavarzian 6d07a3eb31 [radio-spinel] remove extra log on tx done failure (#4052)
This commit removes the extra logging of spinel error status on
tx done callback. The error will be logged from `LogIfFail()` at
the exit of the `HandleTransmitDone()`.
2019-08-02 08:39:14 -07:00
Yakun Xu 6c6aad2a01 [mac] define TxFrame and RxFrame types (#4040)
This commit defines RxFrame for receiving frames and TxFrame for
transmitting frames. The motivation is to prevent invalid uses of
Mac::Frame methods, because some of them are only available for rx
frames and some only for tx frames.
2019-08-01 15:28:19 -07:00
Yakun Xu 8782bf8b3e [config] set message buffer size based on CPU word length (#4049)
Message buffers store pointers which have different sizes on different
system. Setting message buffer size according to the CPU word length
so that message buffer size will be doubled on 64bit system compared
to that on 32bit system. As a result, the first message always have
some bytes left for small packets.
2019-08-01 10:32:05 -07:00
Abtin Keshavarzian 31ce3d45c8 [style] harmonize boolean checks (#4048)
This commit simplifies boolean checks containing `== false` to use the
`!` operator instead, and removes redundant `== true` checks. This
commit aims to harmonize the boolean checks across core modules.
2019-08-01 10:30:08 -07:00
Yakun Xu 74bfb58d2a [tests] add delay for test_diag (#4046)
This change seems to make the test_diag case stable. The root cause
may be that distcheck enables address sanitizer, which may cause the
program to respond slower.
2019-08-01 08:52:50 -07:00
Abtin Keshavarzian fee0468ca9 [diags] make Diags class be an InstanceLocator (#4044) 2019-08-01 08:35:37 -07:00
Matt Smith 1083dd0ccb [logging] replace tab char with 4 spaces (#4043) 2019-08-01 08:34:04 -07:00
Jonathan Hui 6adff12a7e [git] add *.flash to gitignore (#4042)
Also remove files accidentally checked in.
2019-07-31 17:58:42 -07:00
Abtin Keshavarzian 04896eadee [config] add checks for earlier config options (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 02da206f39 [config] remaining configure options (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 149640da49 [config] tmf (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 926b9e8661 [config] time sync (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 8d61b4b99e [config] sntp client (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 5e395ddf54 [config] platform (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 60f0412cf3 [config] parent search (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui df379636da [config] ncp (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 953c9db6b7 [config] mle (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 0baaf1afba [config] mac (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 14fc1318db [config] logging (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui abdf557c6b [config] link raw (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui a3b6d11851 [config] link quality (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 31ffd1645e [config] joiner (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 4a475d5673 [config] ip6 (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 297ab4742f [config] dns client (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui a608896cd3 [config] diag (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 0a14116b3d [config] dhcp6 server (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 0d6f2be1dc [config] dhcp6 client (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui f72f792874 [config] commissioner (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 6c8a9a8661 [config] coap (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 5ab52e50f6 [config] cli (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui aa82391db1 [config] child supervision (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 01ebc18f97 [config] channel monitor (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 1021946d6d [config] channel manager (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui f18497395a [config] border router (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 0ded98b011 [config] announce sender (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui d823575caf [config] dtls (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 512d23398e [config] move default configs to src/core/config (#4020) 2019-07-31 14:16:30 -07:00
Yakun Xu a5ed9ce573 [spinel] use 64bit timestamp for rx frames (#4037)
This commit changes the default timestamp of rx frames to be 64bit,
which is aimed to ensure the timestamp never wraps. This commit
changes the protocol of spinel.

NOTE: Changing spinel protocol is not allowed normally. However, since
the timestamp is only used by sniffer, an exception is made due to the
improved efficiency. Pyspinel is also updated accordingly.
2019-07-31 08:56:37 -07:00
Abtin Keshavarzian 0546a2f972 [mle] adding DeviceMode class (#4035)
This commit adds a `Mle::DeviceMode` class which is warpper over
a device mode bitmask (`uint8_t`) and provides the common helper
functions like `IsRxOnWhenIdle()`, `IsFullThreadDevice()`, etc.
2019-07-30 15:13:37 -07:00
Łukasz Duda 3d3315bf61 [thci] remove unused methods (#4034) 2019-07-29 22:53:09 -07:00
Yakun Xu d041699ad3 [radio] use a single variable for frame timestamp (#4015)
This commit replaces mSec and mUsec in otRadioFrame with a single
mTimestamp to record when the frame is received.

The timestamp MUST be the time when SFD was received when TIME_SYNC or
CSL (Thread 1.2) is enabled, otherwise, it is the time when rx was
done.

This change reduces memory required to represent a radio frame.
2019-07-29 22:52:37 -07:00
Łukasz Duda 4cb7d1fe77 [nrf528xx] do not override OPENTHREAD_CONFIG_LOG_OUTPUT from Makefile file (#4033) 2019-07-29 10:38:42 -07:00
Seth Rickard ec42022e53 [cc1352] limit DRBG to only use 128-bit AES keys (#4032)
The CC2650 only has hardware acceleration for 128-bit AES keys. The
CC1352 and CC2652 have hardware acceleration for 128- and 256-bit keys.
However, the current driver does not implement larger than 128-bit keys.
2019-07-29 09:44:18 -07:00
Jonathan Hui beac7ae438 [fuzz] add stub for otPlatUartFlush() (#4031) 2019-07-29 08:26:17 -07:00
Marven Gilhespie e0fdc20f47 [efr32] revert uart.c to commit 4c06b47c34 (#4030)
Fixes NCP often entering a uninitialized:fault state during reset.
Readded otSysEventSignalPending to efr32mg12 uart.c
2019-07-29 08:25:55 -07:00
Abtin Keshavarzian 66cd36b638 [mesh-forwarder] drop direct supervision message (#4029)
This commit changes `MeshForwarder` to drop a direct supervision
message. A direct supervision message is possible in the case where a
sleepy child switches its mode (becomes non-sleepy) while there is a
pending indirect supervision message in the send queue for it. The
message would be then converted to a direct tx. This commit also
removes the definitions/methods (e.g. `SendEmptyFrame()`) that were
being used for prepartion of supervision message which are no longer
needed.
2019-07-29 08:23:35 -07:00
Jonathan Hui ce18a1edaa [mle] remove unused member variables (#4027) 2019-07-29 08:22:18 -07:00
Jonathan Hui 97c935c870 [dtls] fix when SSL Server is enabled (#4024)
A call to `mbedtls_ssl_set_client_transport_id()` is necessary when using
the SSL Server module. This commit ensures a call to the aforementioned
function when using CoAP Secure with PSK cipher suite.
2019-07-29 08:21:52 -07:00
Mirek ec6057c524 [cli] make output of panid consistent with input (#4028) 2019-07-26 09:00:24 -07:00
Abtin Keshavarzian aec0e0b2a0 [data-poll-sender] add logic to select poll destination (#4023)
This commit changes the interaction of `Mac` and `DataPollSender` such
that the selection of a data poll destination MAC address is delegated
to `DataPollSender` (related code is moved into `DataPollSender` from
`Mac`).
2019-07-25 21:35:18 -07:00
Yakun Xu 425e4a3326 [posix-app] fix using GNU readline on macOS (#4014) 2019-07-24 10:12:42 -07:00
Stuart Longland 4bfdfa0132 [platform] add a UART flush operation (#4003)
This commit allows the CLI to flush its transmit buffer of pending
data so that it can resume writing to the buffer.

This allows for reducing the size of the transmit buffer used for the
CLI whilst still retaining the ability to transmit long blocks of text
(which is required by the Thread certification tests) without locking
up the use of that memory on constrained devices like CC2538.
2019-07-23 21:01:16 -07:00
Łukasz Duda e583eef413 [nrf528xx] use nrfx_spis driver (#4016)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2019-07-23 13:50:29 -07:00
huamenggg a307039927 [posix-app] fix missing sentinel in execl() (#4007)
This commit fixes a build error on OpenWRT.

Error: missing sentinel in function execl.
2019-07-23 12:49:04 -07:00
Jonathan Hui bcbe8e2179 [style] remove extra ';' (#4017) 2019-07-23 09:45:18 -07:00
Jonathan Hui e87bc42184 [diag] move factory diags into core (#4010)
- Simplifies make files by not having to deal with separate library.
- Combine factory diags source into single source file.
2019-07-23 08:47:16 -07:00
Zhanglong Xia a5124493d9 [platform] add platform check for core configuration option (#4008) 2019-07-23 08:45:58 -07:00
Zhanglong Xia 5d2e8e1e57 [posix-app] add platform log to record when program exits (#3989) 2019-07-22 18:51:07 -07:00
Abtin Keshavarzian be64623b36 [toranj] update child mode change test for msg direct/indirect conversion (#4001)
This commit updates `test-027-child-mode-change` to verify the
behavior of a parent node related to conversion of queued messages
(indirect to direct tx) upon the child's mode change from sleepy to
non-sleepy).
2019-07-22 09:45:33 -07:00
Abtin Keshavarzian e9e900a5dc [indirect-sender] convert queued child messages when mode changes (#4001)
This commit ensures all queued messages for a child are accordingly
converted (indirect to direct transmission) when a child switches its
mode from sleepy to non-sleepy.
2019-07-22 09:45:33 -07:00
Jonathan Hui 3a6cefd48c [meshcop] avoid clearing non-trival type in DelayedJoinEntHeader (#4012) 2019-07-22 09:38:47 -07:00
Jonathan Hui a211901f62 [network-data] compare TLV length in Leader::IsStableUpdated() (#4011) 2019-07-22 09:38:30 -07:00
Paweł Wańczyk db8c4c8339 [diag] diagnostic module improvements (#3969)
Added diagnostic statistic clearing.
Improved tx power setting.
Provide RSSI of the last received packet.
2019-07-18 21:24:58 -07:00
Abtin Keshavarzian 050cc07206 [toranj] update test-002 to verify immediate command after a reset (#4006)
This commit updates toranj `test-002` to verify behavior of `wpantund`
when a command is issued immediately after a `reset`.
2019-07-18 21:24:05 -07:00
Marven Gilhespie 11e18b858b [efr32] Removed hal-config-board.h from sleepy-demo, moved needed defines into brdxxxx/hal-config.h (#4004)
Fixes build error on efr32mg12/brd4304a that resulted in a conflicting
define of BSP_LED_POLARITY.  Removed hal-config-board.h from sleepy
demo and moved some definitions into each hal-config.h in order to
build.
2019-07-17 08:50:42 -07:00
Abtin Keshavarzian 73c27837cf [indirect-sender] log when preparing a message for indirect tx (#4002) 2019-07-17 08:48:30 -07:00
Piotr Szkotak 8a640a2cfa [travis] extend ncp transport coverage (#4000)
This commit makes the travis run scan-build twice, for the UART and
the SPI NCP configurations respectively.
2019-07-17 08:48:04 -07:00
Marven Gilhespie 6d7098c0a8 [efr32] add otSysEventSignalPending calls and weak function to efr32mg12 (#3999)
Initialization of NVIC and priorities.
2019-07-17 08:46:13 -07:00
Yakun Xu 06a914da0a [build] add flag for big endian (#3996) 2019-07-17 08:43:57 -07:00
rongli 59fcb1c9ad [toranj] add partition id set/get to test-001-get-set (#3998) 2019-07-16 13:56:53 -07:00
Yakun Xu 901ea13cdb [android] always enable mac filter (#3997) 2019-07-16 10:45:16 -07:00
Jonathan Hui cc66f47972 [emsk] remove unsupported platform (#3995) 2019-07-16 09:04:55 -07:00
Jonathan Hui 6393901e52 [spi-hdlc-adapter] add cast to unsigned int on call to usleep (#3994) 2019-07-16 09:04:34 -07:00
Yakun Xu e80f46a993 [posix-sim] use multicast to simulate radio (#3993)
This commit uses multicast to simulate radio transmissions. This
avoids sending a frame multiple times and avoids duplicated packets in
captures.

This implementation uses two separate sockets for tx and rx. The
current implementation of thread-cert requires the sniffer to report
the sender of each packet. This issue can be addressed by stateful
tracking state of each node, but left for future work.
2019-07-16 09:03:42 -07:00
Li Cao b289c94122 [tests] fix mac header ie parsing problem (#3976) 2019-07-16 08:47:38 -07:00
Abtin Keshavarzian d4ce582f95 [data-poll-handler] adding DataPollHandler class (#3952)
This commit adds a new class `DataPollHandler` which sits between
`Mac` layer and `IndirectSender`. It interfaces to `Mac` to handle any
received data poll and perform indirect frame transmission including
the re-transmission logic of frames (per poll). All state info (per
child) for handling of indirect frame retransmission is now defined
and managed by the `DataPollHanlder` class itself. This commit updates
the `IndiretSender` to interface with the `DataPollHandler` class and
handle preparation of frames from `Message` for indirect transmission.
2019-07-16 08:38:29 -07:00
Abtin Keshavarzian a222a82e04 [mesh-forwarder] add PrepareDataFrame() (#3952)
This commit refactors and updates the existing code to add a generic
method `MeshForwarder::PrepareDataFrame()`. This method constructs a
MAC data from from a given IPv6 message at the offset set in the
message. This method enables link security when message is MLE type
and requires fragmentation.
2019-07-16 08:38:29 -07:00
Abtin Keshavarzian 7c548bba23 [mac] add new operation for indirect data frame transmission (#3952)
This commit adds a new operation for indirect data frame transmission
in `Mac` class (only available on FTD build). The indirect tx request
is handled before a direct tx request. This commit also changes how
the number of retries and CMSA attempts (for a frame) are determined
`Mac` class itself now sets these according to request type.
2019-07-16 08:38:29 -07:00
Abtin Keshavarzian 54e7a9b7af [indirect-sender] define ChildInfo for child indirect tx related info (#3952)
This commit defines `IndirectSender::ChildInfo` class in child sender
module which contains all the info needed to store (per child) for
handling of indirect transmissions to the child. The `Child` class
inherits from the new class. This helps keep the indirect tx info in
the same file.
2019-07-16 08:38:29 -07:00
Abtin Keshavarzian f56e12d205 [indirect-sender] adding new class IndirectSender (#3952)
This commit adds a new module/class `IndirectSender` for handling
of the indirect transmission to sleepy children. The commit just
moves the existing code form `MeshForwarder` into the new class.
2019-07-16 08:38:29 -07:00
Yakun Xu 6db6ad8045 [dtls] fix connection from host interface (#3992) 2019-07-15 08:53:27 -07:00
huamenggg 9d57e4b9b9 [posix-app] add HOST flag for cross compiling (#3991)
This commit add 'HOST' to provide the option for changing compile
target host for OpenWRT.
2019-07-15 08:52:18 -07:00
Yakun Xu 9b51c2ed1d [posix] merge virtual time and real time radio (#3974) 2019-07-12 11:27:20 -07:00
Abtin Keshavarzian 1b8dc87586 [mac] change the sub-mac callback model (#3987)
This commit changes the sub-mac callback model to simplify it such
that `SubMac::Callback` is itself an `InstanceLocator` and directly
calls into the correct next layers (`Mac` or `LinkRaw`). This model
relaxes the need for the other classes to sub-class the `Callback`
and will have `SubMac` itself define a `mCallbacks` instance (which
is an empty class) instead of tracking a reference to a callback
object.
2019-07-12 11:14:19 -07:00
Yakun Xu ae014b3f6d [posix] close files on exec (#3977)
This commit adds the *_CLOEXEC flags when opening files. This ensures
files are closed when spawning new processes.

* use LOG_DAEMON as syslog facility
* remove setenv() when forkpty
2019-07-12 09:40:06 -07:00
Abtin Keshavarzian cac09b7a70 [toranj] fix typo in method name "prepare_listener" (#3984) 2019-07-12 00:57:04 -04:00
Łukasz Duda 557d816e2c [nrf52840] update documentation and fix broken link (#3986)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2019-07-11 11:47:34 -04:00
Jonathan Hui f924adcb60 [style] update python style to conform to PEP 8 (#3951)
With the exception of line length set to 119 vs. 79.

Add tests/ and tools/ to py-pretty-check.
2019-07-11 11:45:55 -04:00
Yakun Xu a938ee2845 [cli] fix some links in src/cli/README.md (#3980) 2019-07-10 06:28:06 -07:00
Zhanglong Xia c1a64613d6 [settings] remove useless functions (#3971) 2019-07-10 06:13:49 -07:00
Zhanglong Xia 97708013c8 [settings] reformat doxygen (#3970) 2019-07-10 06:10:39 -07:00
Zhanglong Xia 6468973718 [spi-hdlc-adapter] add delay after reset the RCP chip (#3968) 2019-07-10 06:07:10 -07:00
Ciaran Woodward 6a2c3ba10c [coap] Improve behaviour of CoAP multicast requests & responses (#3967)
This commit prevents the CoAP stack from sending automatic 'Not
Found' responses to multicast CoAP requests, as suggested in RFC7252
8.2:

   When a server is aware that a request arrived via multicast, the
   server MAY always ignore the request, in particular if it doesn't
   have anything useful to respond (e.g., if it only has an empty
   payload or an error response).

This commit also allows CoAP requests that are sent to multicast
addresses to receive multiple responses, which will all be processed
by the same handler callback (For instance, a multicast GET to
discover network resources).
2019-07-10 06:06:21 -07:00
Jonathan Hui 141437dd28 [codecov] enable coverage reporting on PRs (#3965) 2019-07-09 20:06:46 -07:00
Abtin Keshavarzian d92733661c [posix-app] simplify makefiles (#3975)
* [cli] ensure legacy callback APIs are defined as `OT_TOOL_WEAK`

* [posix-app] simplify the makefile (link in ncp lib).

This commit simplifies the posix-app makefiles by removing the
`inc_<module>` source files (which included certain modules from
the `ncp` folder). Instead the library `libopenthread-ncp-ftd.a`
is included when linking thethe final posix-app executables
`ot-ncp`,  `ot-cli` and/or, `o-daemon`.

* [posix-app] ensure header files from ncp folder have "ncp/" prefix

This commit changes the posix-app platform makefile such that
the header files from `src/ncp` folder require "ncp/" prefix.
2019-07-09 13:24:41 -07:00
Rongli Sun 21221d9903 [build] rename CERT_LOG to REFERENCE_DEVICE (#3960)
Also, remove from configure.ac.
2019-07-09 09:09:59 -07:00
Zhanglong Xia 668256290d [spi-hdlc-adapter] add syslog to record signal (#3966) 2019-07-09 04:38:23 -07:00
Yakun Xu d0285164a0 [cli] remove otPtr introduced by windows platform (#3973) 2019-07-09 04:36:08 -07:00
Zhanglong Xia 67993c6d58 [docs] fix typo in file README_COAP.md (#3972) 2019-07-09 04:34:50 -07:00
Abtin Keshavarzian f0e9ab2a9f [andriod] update makefile to include api/random_noncrypto_api.cpp (#3963) 2019-07-09 04:32:10 -07:00
Jonathan Hui 968f15f540 [logs] compile Mac::Frame::ToInfoString at NOTE log level (#3962)
This fixes a linker error when buiding with OT_LOG_LEVEL_NOTE.

MeshForwarder depends on Mac::Frame::ToInfoString at the NOTE level.
2019-07-09 04:31:28 -07:00
Zhanglong Xia 8de5fbeae7 [posix-app] close the settings file when reset (#3958)
Currently, the Setting file won't be closed after ot-ncp is reset.
Once ot-ncp receives a RESET command from wpantund, it will reopen
the Setting file and create a new file Id.

This commit closes the Setting file when ot-ncp is reset.
2019-07-08 21:21:14 -07:00
Christian Stauffer b983974aec [cli] delete redundant and unnecessary includes (#3959) 2019-07-03 10:54:50 -07:00
Abtin Keshavarzian be994b66cf [random-manager] move entropy and rng related code into RandomManager (#3953)
This commit moves all the related code for managing entropy and crypto
and non-crypto random number generation into the `RandomManager`
class. This helps simplify the initialization process by having all
modules use a shared common init counter (`sInitCount`). This commit
also ensures that the shared instance of the non-crypto pseudo random
number generator is seeded only once.
2019-07-03 10:54:17 -07:00
Rongli Sun 0d75bbe3fa [cert] support partition id configuration for ncp device (#3955) 2019-07-02 19:27:09 -07:00
Jonathan Hui 60b01a8a4b [vagrant] remove vagrant file (#3954) 2019-07-02 18:49:27 +02:00
Marven Gilhespie 0bb0b7424d [efr32] add mg21 support and changes to mg12 radio inteface code (#3922)
* renamed efr32 in two for mg12 and mg21 and radio changes for mg12

Change to radio interface code, check the txBusy flag before
attempting to transmit a packet Cleaner auto state transition code and
safer event handling Use HAL_PA_VOLTAGE in all hal-config.h files

* uart flow control mode is configured from board /hal-config.h

Allows a different flow control mode for each EFR32 board as
necessary.  (hw flow control is not presently implemented on
Thunderboard Sense so HAL_USART_FLOW_CONTROL_NONE mode should be used
for BRD4166A, other boards use HAL_USART_FLOW_CONTROL_HWUART)
2019-07-02 18:43:28 +02:00
Jonathan Hui af46ffa53b [coverage] exclude logging code from coverage report (#3947) 2019-07-02 00:18:02 +02:00
Martin Turon ce26bffb50 [mac] change frame length type from uint8_t to uint16_t (#3939)
This adds support for MAC frames greater than 255 bytes in preparation
for other link layers that support larger frames.
2019-06-28 00:26:17 -07:00
Yakun Xu c826edc0c4 [posix-app] enhance RCP failure info (#3950)
By default, posix-app disables platform region logs. Even when
platform logs are enabled, logs	are sent to syslog without printing to
stderr.

This commit prints error information to	stderr on exit, providing the
user more direct information about failures. This commit also
eliminates the "wait no child process" error message.
2019-06-28 00:22:23 -07:00
Parker Evans 3fded34be1 [commissioner] add error checking to GetLeaderAloc and SendPetition in Start (#3949)
Adding the SendPetition error handling in Start and moving it before
updating the state fixes the potential issue of locking up the
commissioner in the OT_COMMISSIONER_STATE_PETITION state without
having actually sent the petition.
2019-06-27 00:06:36 -07:00
Jonathan Hui 016b1b1523 [address-resolver] fix TLV length in response messages (#3945) 2019-06-26 03:43:41 -07:00
Jonathan Hui 03fac0ff48 [message] adjust offset when cloning a message subset (#3944) 2019-06-26 03:42:59 -07:00
Jonathan Hui a6ae39893b [travis] set default build env to xenial (#3943) 2019-06-26 03:42:41 -07:00
Jonathan Hui 2142b0008d [scan-build] resolve warnings from scan-build-7 (#3943)
Resolve warnings when using clang static analyzer v7.
2019-06-26 03:42:41 -07:00
Yakun Xu e6eaf5c80b [posix-sim] enhance microsecond alarm implementation (#3942)
This commit enhances the microsecond timer implementation with POSIX
timer API. This only enhances simulation on Linux because the API is
not supported on macOS.

The call to timer_settime() schedules a microsecond precision alarm.
When the alarm fires, the process is signalled with
OPENTHREAD_CONFIG_MICRO_TIMER_SIGNAL. The signal handler does nothing,
but the process will resume and the existing micro timer process can
be performed on time.
2019-06-26 00:26:32 -07:00
Abtin Keshavarzian ce8f1172a8 [mac] simplify how HandleReceivedFrame() passes frame to next layer (#3941) 2019-06-25 00:23:03 -07:00
Abtin Keshavarzian adecc05755 [mesh-forwarder] clear children's indirect msg and src match table on stop (#3933)
This commit ensures to clear the indirect message pointer on all
children and reset the indirect message count (which in turn clear the
source match table) from `MeshForwarder::Stop()`. This addresses the
issue where on an `Stop()`/`Start()` call the source match table can
become out of sync with the send queue and/or a child may hold on to
an already freed `Message`.
2019-06-21 15:41:26 -07:00
Jeff Bumgardner 44596e2299 [docs] add Samsung to supporters and image cleanup (#3940) 2019-06-21 12:25:49 -07:00
Jonathan Hui 8224b3c49f [mle] add field-specific length methods to Challenge/Response TLVs (#3937) 2019-06-21 08:34:52 -07:00
Rongli Sun ea9a6d2b14 [network-diagnostic] specify link-local source for link-local destination (#3935)
In #3284, the source for network diagnostic is explicitly specified as RLOC.
However when link-local address is the destination, link-local source is
preferred.
2019-06-20 22:19:40 -07:00
Rongli Sun 7e28a2317a [coap] fix payload marker removal and add payload marker check (#3936) 2019-06-20 22:08:24 -07:00
Abtin Keshavarzian f11ff54775 [data-poll-sender] rename DataPollManager as DataPollSender (#3932)
This commit renames the `DataPollManager` to `DataPollSender` and
also moves the files in `src/core/mac` folder.
2019-06-20 12:27:46 -07:00
Jonathan Hui 8df0b5f421 [docs] update link to GNU Arm Embedded Toolchain (#3931) 2019-06-20 09:38:46 -07:00
Jonathan Hui d1ded876f9 [meshcop] add MeshLocalPrefixTlv::GetMeshLocalPrefixLength() (#3930) 2019-06-20 09:38:25 -07:00
Li Cao 0a084bbb9a [tests] change string concatenation format in python scripts (#3929) 2019-06-20 09:35:41 -07:00
Jonathan Hui 896ac0ab69 [examples] add headers to pretty check (#3927) 2019-06-20 09:35:10 -07:00
Jonathan Hui b4c53e6bda [netif] remove virtual methods (#3925) 2019-06-20 09:30:56 -07:00
Jonathan Hui 1631d23a13 [netif] remove interface id specification from interfaces (#3925) 2019-06-20 09:30:56 -07:00
Jonathan Hui df16da30f8 [netif] remove support for multiple netif instances (#3925) 2019-06-20 09:30:56 -07:00
Jonathan Hui 1b37f64ac3 [mle] remove unused MleRouter::RemoveNeighbor method (#3926) 2019-06-19 10:28:44 -07:00
Jonathan Hui b694b00951 [tlvs] allow longer length to support forward compatibility (#3919) 2019-06-18 11:49:05 -07:00
Abtin Keshavarzian 67f159c5e3 [data-poll-manager] remove code handling NO_BUFS error (#3918)
This commit remove the logic in `DataPollManager` related to handling
the `NO_BUFS` error case when sending a data poll. This logic is no
longer needed since the data poll tx logic is now handled by `Mac`
layer directly and there is no need to allocate/use a `Message` instance
for data poll (which could lead to `NO_BUFs` error situation).
2019-06-18 11:48:44 -07:00
Abtin Keshavarzian 936d4efe93 [mac] move data poll tx into Mac and DataPollManager (#3915)
This commit moves the implementation of data poll transmission
related logic into `Mac` and `DataPollManagr` from `MeshForwarder`.
2019-06-18 09:17:25 -07:00
Jeff Bumgardner 8a039efcf8 [docs] add SiLabs to list of supporters (#3923) 2019-06-17 13:07:15 -07:00
Rongli Sun 73ffd2a9dc [thci] bug fixes and clean up the code style (#3817)
This commit squashes the approved updates, mainly include
1) bug fix or enhancement
   - make pollperiod take effect
   - fix the issue in finding the address of the specific address
     (case-sensitive issue introduced in #3639)
   - make `__sendCommand` more robust for possible extra serial output

3) Update along with master code and other minor updates
   - the command used to find specific address (#3856)
   - the IP6Prefix string len (from 20 to 19)
   - correct typos

2) Code Style
   - use single quotes for code
   - update to use `print ()` and format `%`
   - format via with `black` tool locally
     `python3 -m black -l 79 -S tools/harness-thci -t py27`
   - add travis python check example for THCI with `flake8` tool

notes: require OT code with #3856 (get specific address) and #3862 (`joiner id`)
2019-06-17 09:03:55 -07:00
Jonathan Hui 932cd78f04 [style] apply missing const declarations (#3921) 2019-06-14 12:45:39 -07:00
Jonathan Hui 6dfd716da1 [auto-start] remove auto-start feature (#3920) 2019-06-14 12:40:30 -07:00
Abtin Keshavarzian b4c56c447e [mac] inline shorter methods / rename frame preparing methods (#3914) 2019-06-14 09:33:40 -07:00
Abtin Keshavarzian 6f290088f2 [mesh-forwarder] enhance data poll log message (#3913) 2019-06-14 09:32:12 -07:00
Łukasz Duda 8c0c32548d [doc] remove unused definitions (#3917) 2019-06-13 09:07:38 -07:00
Łukasz Duda d0c7ff2bb4 [nrf528xx] update nRF IEEE Radio Driver to version 1.4.0 (#3916)
Signed-off-by: Duda, Lukasz <Lukasz.Duda@nordicsemi.no>
2019-06-13 08:35:28 -07:00
Jonathan Hui caf268c45e [route-table] remove unused Ip6::Routes (#3911) 2019-06-13 08:32:05 -07:00
Abtin Keshavarzian dbc04a8a05 [dataset] choose a preferred channel when forming new dataset (#3910)
This commit changes the `ActiveDataset::CreateNewNetwork()` to select
a random channel from the preferred channel mask if it is not empty,
otherwise a random channel from the supported mask is picked.
2019-06-12 08:45:29 -07:00
Abtin Keshavarzian d614d4a080 [mac] rename methods requesting frame transmission (#3909) 2019-06-12 08:36:54 -07:00
Jonathan Hui 485ab9ed38 [coap] add checks for OT_ERROR_NO_BUFS (#3904)
- Update Coap::Message::SetToken() to return error.
- Update Coap::Message::SetDefaultResponseHeader() to return error.
- Add error checking around calls to the above.
2019-06-11 10:27:54 -07:00
Abtin Keshavarzian 65f1ac44db [spinel] remove unused definitions (#3890)
This commit removes unused macro definitions in spinel header file.
2019-06-11 10:27:38 -07:00
Abtin Keshavarzian 9d7fc71917 [spinel] validate decoded/unpacked UTF8 string (#3889)
This commit adds `spinel_validate_utf8()` function which verifies
whether a given (null terminated) sequence of bytes (string) follows
the UTF8 encoding format. This function is then used to check any
decoded/unpacked spinel UTF8 type. This commit also adds test-cases
in spinel to check the behavior of the new function with a set of
UTF8 valid and invalid strings.
2019-06-11 10:27:17 -07:00
Jonathan Hui 738c1b3574 [tests] remove windows-specific test support (#3907) 2019-06-10 08:45:14 -07:00
Jonathan Hui 46bad7bee6 [cli] remove "s_" prefix from static methods (#3905) 2019-06-10 08:44:48 -07:00
Abtin Keshavarzian e95789e819 [doc] remove spinel-protocol-src documentation files (#3903)
This commit removes the files under `doc/spinel-protocol-src`
since all the related docs are moved to `spinel.h` or other related
header files.
2019-06-07 12:09:57 -07:00
Abtin Keshavarzian a508e5ebe5 [spinel] add framing and data type docs in header file (#3903)
This commit also adds the SPI framing protocol documentation in
`ncp_spi.h`.
2019-06-07 12:09:57 -07:00
Abtin Keshavarzian 0ffb4ff1d4 [toolchain] remove the unused definition UINT32_MAX 2019-06-07 11:21:21 -07:00
Abtin Keshavarzian 2a5403d94a [sntp-clinet] simplify uint64 constants 2019-06-07 11:21:21 -07:00
Abtin Keshavarzian d52aa05b54 [ncp] spinel prop to get a new dataset (use when forming new network) (#3902)
This commit adds a new property `SPINEL_PROP_THREAD_NEW_DATASET` in
spinel to create a new Operational Dataset to use when forming a new
network. This property maps to `otDatasetCreateNewNetwork()`
2019-06-07 09:08:33 -07:00
wgtdkp 49150943c1 [dtls] invoke callback after DTLS disconnect timeout (#3897) 2019-06-06 11:57:09 -07:00
Kamil Sroka c14cc60962 [windows] remove unsupported platform (#3878) 2019-06-06 11:55:18 -07:00
Kamil Sroka e482edb0f1 [mbedtls] add threading errors translation (#3900) 2019-06-05 11:02:49 -07:00
Yakun Xu 73f17031a1 [random] assert aMax is bigger than aMin (#3894) 2019-06-05 10:14:09 -07:00
Abtin Keshavarzian 7c10be51fa [message] remove the AllMessageQueue in MessagePool (#3893)
This commit removes the all-messages queue from `MessagePool`. This
simplifies the `Message` header `MessageInfo` and allow a message
to be inserted into one linked list.
2019-06-05 10:13:40 -07:00
Kamil Sroka 8c08fd8815 [build] rename ncp_radio to rcp (#3580) 2019-06-05 10:12:50 -07:00
Seth Rickard b9d20b590e [cc13x2,cc26x2] update CC13X2 CC26X2 driverlib (#3888) 2019-06-04 15:04:46 -07:00
Li Cao f51598ea6c [android_mk] add random_crypto_api.cpp to Android.mk (#3895) 2019-06-04 07:31:33 -07:00
Zhanglong Xia 782ce52a6e [ncp] update static checking for diag output buffer size (#3891) 2019-06-04 07:29:18 -07:00
rongli bc8e3e31a9 [dhcp] fix solicit request issue (#3887) 2019-06-03 08:26:28 -07:00
Joseph Newman 5d6ed3dd71 [settings] add option to store settings in volatile storage (#3811) 2019-06-03 08:24:49 -07:00
Abtin Keshavarzian 2266b5eb27 [instance] update order of member variables (#3886)
This commit updates order of member variable definitions in the
Instance class to ensure that objects that may be used by others are
initialized first. In particular, Tasklet and Timer Schedulers, and
RandomManager are initialized first. On FTD/MTD, this is followed by
Notifier, Settings, and MessagePool objects.
2019-05-31 09:15:58 -07:00
Joseph Newman f5dcae4093 [time-sync] reset sequence upon joining a new partition (#3884)
- reset sequence upon joining a new partition
- ensure leader is always authoritative
2019-05-31 09:14:08 -07:00
Łukasz Duda 6d1d7b2404 [cli] count failed ping try (#3882) 2019-05-31 09:10:40 -07:00
Abtin Keshavarzian df0a5787c4 [hdlc] update MultiFrameBuffer to allow saved frames to be re-read (#3881)
This commit updates the `MultiFrameBuffer` class implementation mainly
how the saved frames in buffer are read. The new code allows a user to
re-read the frames again. This change makes the implementation simpler
and more flexible. The corresponding unit test is also updated to
verify new behavior.
2019-05-31 09:09:42 -07:00
Łukasz Duda 99937016c0 [cli] extend ipaddr command for selective address printing (#3856) 2019-05-29 13:46:56 -07:00
Jonathan Hui 787184d4bb [docs] enhance commissioning docs for CLI (#3862)
- Separate into separate README files.
- Add quick start guide.
2019-05-28 18:25:50 -07:00
Jonathan Hui 204d0a91a3 [commissioner] add callback for joiner events (#3862) 2019-05-28 18:25:50 -07:00
Jonathan Hui 1abf57dd2f [commissioner] add callback for state changes (#3862) 2019-05-28 18:25:50 -07:00
Jonathan Hui 68beda5b07 [cli] move commissioner to separate source files (#3862) 2019-05-28 18:25:50 -07:00
Jonathan Hui 9cd11a2761 [cli] move joiner to separate source files (#3862) 2019-05-28 18:25:50 -07:00
Yakun Xu 6b4f8a8829 [mac] keep the second energy scan sample (#3871)
This commit fixes an issue where the second sample is skipped
because the timer had not expired yet.
2019-05-28 11:50:02 -07:00
Kamil Sroka 754da79286 [doc] define missing groups (#3876) 2019-05-28 10:19:36 -07:00
Yakun Xu 2695dc982f [cli] fix coap secure typo (#3873) 2019-05-28 10:15:52 -07:00
Abtin Keshavarzian 9df0bac4d9 [mle] skip saving NetworkInfo before first device attach (#3870)
This commit changes the `Mle::Store()` behavior such that if a device
is not attached and there is no previously saved `NetworkInfo`
(indicating that the device has never been attached before) we skip
saving/updating the `NetworkInfo`. Note that on a device reset the
MLE/MAC frame counters (which are part of `NetworkInfo`) would reset
but device would also start with a new randomly generated extended
address (so the security nonces would not be repeated).
2019-05-28 10:15:20 -07:00
Kamil Sroka ec3d8fbf22 [cc2538] fix entropy.c (#3861) 2019-05-28 10:14:04 -07:00
Yakun Xu df62add5a2 [cc2538] fix radio disabled for entropy get (#3872)
Restore RFCORE_XREG_FRMCTRL0 after generating random values.
2019-05-28 10:13:33 -07:00
Jeff Bumgardner fb11d96e61 [docs] update logo for new branding (#3869) 2019-05-24 19:10:26 -07:00
Abtin Keshavarzian 4aca025685 [toranj] update test-032 to cover addr reg after parent reset (#3829) 2019-05-24 15:19:20 -07:00
Abtin Keshavarzian b5d86fa319 [mle] only include mesh-local address in Child Update Response (#3829)
This commit changes preparation of "Child Update Response" (on a
child) such that only the mesh-local address is included in Address
Registration TLV. If the child has more addresses to register it
follows up with its own "Child Update Request".
2019-05-24 15:19:20 -07:00
Abtin Keshavarzian d7c0e9e716 [commissioner] add provisioning URL member variable (#3863)
This commit moves the definition of Provisioning URL TLV member
variable to `Commissioner` class (from `Dtls` class).
2019-05-24 11:31:15 -07:00
Jonathan Hui e458ef8f5f [nlbuild-autotools] update to 1.6.11 (#3868) 2019-05-24 11:24:30 -07:00
Jonathan Hui c566e458c4 [nlbuild-autotools] update to 'https://github.com:nestlabs/nlbuild-autotools' tag '1.6.11'. 2019-05-23 21:00:46 +00:00
Jonathan Hui c87b283453 Squashed 'third_party/nlbuild-autotools/repo/' changes from d4c1c470..6b6a11dc
6b6a11dc Changed the bootstrap shebang from sh to bash to address a bashism that arrived at 1.6.10.
e97e9053 Merge pull request #22 from nestlabs/feature/improve-bootstrap-diagnostics
e367ac5d Added additional up-front checks to the bootstrap script to ensure the required executables are available. On failure to find those executables, offer users actionable steps to resolve the error.
299a9e4e Added additional up-front checks to ensure the required executables are available. On failure to find those executables, offer users actionable steps to resolve the error.
3c6f52e3 Fixed spaces / tab issue.
806f45ec Merge pull request #21 from nestlabs/bug/do-not-use-default-goal-in-headers
4f0cbeb1 Now that both automake and pure make headers and footers are co-mingled, address an issues in which the .DEFAULT_GOAL specifications in the repos.mak footer were conflicting with makefiles that wanted a different default goal by moving those .DEFAULT_GOAL specifications to Makefile-bootstrap.
d5901db8 Merge pull request #20 from nestlabs/feature/downrev-m4
f589293b Added content for and updated default version to 1.6.8.
6edebaaa Rebased several automake header macros implementations on their pure make equivalents.
a64a84c5 Reworked how verbose progress is handled to simplify specification of progress macros.
13b17fcb Leverage both automake and pure make headers and footers by including the latter in the former.
a50c3fe6 Downgraded m4 from 1.4.17 to 1.4.5 since 1.4.5 seems to be the last version of m4 that does not abort on invocation in the m4 *rintf and friends compatibility and portability library.
987a35b7 Merge pull request #19 from nestlabs/bug/fix-nl-filtered-canonical
690d12e0 * Addressed issues with NL_FILTERED_CANONICAL in which the desired   content to be filtered was not filtering correctly and in which   the desired filtered canonical variables were not emitted in   makefiles.
c141c281 Addressed an issue with _NL_FILTERED_CANONICAL in which the desired filtered canonical variables were not emitted in makefiles.
1a22c8f0 Addressed an issue with _NL_FILTERED_CANONICAL in which the desired content to be filtered was not filtering correctly.

git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: 6b6a11dc98c6cc1f2faf2e729d0971704a5b5f28
2019-05-23 21:00:46 +00:00
Kamil Sroka 2279ef610e [nrf52840] fix included headers in aes_alt.h (#3860) 2019-05-23 09:19:19 -07:00
wgtdkp 98ed5f16d7 [meshcop] fix bug of cipher suites check (#3858) 2019-05-23 09:19:03 -07:00
Yakun Xu 50949cbad9 [channel-manager] fix interval units (#3857) 2019-05-22 21:28:39 -07:00
Łukasz Duda eb46303ff8 [cli] clean up IPv6 address printing (#3855) 2019-05-22 10:59:04 -07:00
Łukasz Duda 9e7162253c [api] expose API to obtain RLOC (#3854) 2019-05-22 10:57:58 -07:00
Jonathan Hui bcfa791912 [mpl] add extra validation when removing MPL Option (#3851) 2019-05-22 10:57:04 -07:00
Duda, Lukasz 8d462f316e [cert] add additional validation for Cert_6_1_06 (#3853)
Also fix link quality configuration.
2019-05-22 10:56:19 -07:00
Duda, Lukasz 7310a34646 [cert] add additional validation for Router_5_1_11 test (#3853) 2019-05-22 10:56:19 -07:00
Jonathan Hui 26550d53c6 [mle] fix bug in MLE attach behavior (#3850)
Bug was introdcued in 5a7faa5.

A device performing MLE attach first sends an MLE Parent Request looking
for routers. If no MLE Parent Response is received from a neighboring router
where the link quality is 3 in both directions, the device shall send a
second MLE Parent Request that includes both routers and REEDs.

This commit adds the bi-directional link quality check to determine whether
a second MLE Parent Request should be sent.
2019-05-22 08:37:59 -07:00
Abtin Keshavarzian a9e63fe85d [toranj] add test for ML prefix change during attach (#3844) 2019-05-21 21:36:23 -07:00
Abtin Keshavarzian ddda77cd85 [ncp] emit link-local and mesh-local addresses before full table (#3844)
This commit changes the emitted properties from NCP such that the
mesh-local address (and prefix) are emitted before the entire IP
address table. This ensures that a host driver is aware of the
mesh-local prefix when it receives the full address table and can
correctly filter RLOC addresses (if desired).
2019-05-21 21:36:23 -07:00
Abtin Keshavarzian a1b2d354b1 [ncp] emit router entry addition/removal from neighbor table (#3838)
This commit updates `NcpBase` to emit `VALUE_INSERTED/REMOVED` spinel
message to host for `PROP_NEIGHBOR_TABLE` when a router neighbor entry
is added or removed.
2019-05-21 21:35:39 -07:00
Abtin Keshavarzian c0bc29197a [mle-router] signal child/router entry being added or removed (#3838)
This commit updates the neighbor table callback to signal when
either a child or a router neighbor entry is being added or removed.
This change replaces and enhances the previous APIs relalted to child
table callback.
2019-05-21 21:35:39 -07:00
Yakun Xu 167362130c [android] disable some optional features (#3821)
This commit removes unnecessary features of OpenThread on Android platform.
This commit also removes features disabled in openthread-config-android.h so
that these definitions can be overridden in Android.mk without warning.
2019-05-21 18:01:53 -07:00
Kamil Sroka fcac459e05 [nrf528xx] add missing include guards (#3849) 2019-05-21 09:44:22 -07:00
Jonathan Hui 86ac0865a3 [docs] update quick start guides to use dataset method (#3834) 2019-05-21 09:02:07 -07:00
Łukasz Duda 72b0708085 [thci] correct conversion of IPv6 prefix (#3846) 2019-05-21 08:32:46 -07:00
Jonathan Hui 8bb50d4ccd [ip6] add additional parse validation to Ip6::Address::FromString (#3843) 2019-05-20 20:37:19 -07:00
Kamil Sroka 607f7711e6 [nrf528xx] check for otPlatEntropyGet() reentrancy (#3842) 2019-05-20 13:49:21 -07:00
Kamil Sroka f2b19befb1 [mbedtls] add missing entropy/ctr_drbg errors to MbedTls::MapError() (#3841) 2019-05-20 12:21:17 -07:00
Kamil Sroka 32eead3290 [entropy] fix included headers in public API (#3840) 2019-05-20 08:57:28 -07:00
Abtin Keshavarzian 20aedd3dd4 [ncp] allow PARENT_RESPONSE_INFO property to be filtered by host (#3837) 2019-05-20 08:55:59 -07:00
Abtin Keshavarzian 2eba610ef6 [ncp-buffer] include APIs using otMessage only in FTD/MTD builds (#3836)
This commit changes the `NcpFrameBuffer` and `SpinelEncoder` classes
to include the support for adding of `otMessage` to the buffer and the
related APIs in the FTD/MTD builds (exclude it from the RADIO (RCP)
build).

Remove `Message` related source files from radio mode Makefile.
2019-05-20 08:54:31 -07:00
Abtin Keshavarzian 7b0537fb54 [tests] make pretty and update makefile (#3835)
* change the include order (make pretty)
* include header files in PRETTY_FILES
2019-05-20 08:52:49 -07:00
Jonathan Hui fa395d7205 [time-sync] remove reference operator in C API (#3833) 2019-05-20 08:50:43 -07:00
Łukasz Duda 8b544f000d [nrf52xx] notify if ACK was sent with frame pending bit set (#3831) 2019-05-17 18:53:07 -07:00
Kamil Sroka 56fa9ac9cd [entropy] allow for entropy source sharing (#3818) 2019-05-17 12:41:03 -07:00
Kamil Sroka fc580c39e6 [nrf52811] decrease number of buffers to free some RAM (#3818) 2019-05-17 12:41:03 -07:00
Jonathan Hui b7b0eecfe2 [ip6] add additional parse validation to Ip6::Address::FromString (#3830) 2019-05-16 21:39:32 -07:00
Kamil Sroka 4ee45b67d8 [nrf52840] add flag for enabling mbedTLS built-in threading support (#3828) 2019-05-16 21:39:15 -07:00
Jonathan Hui 7f0168cbc7 [da15000] remove unsupported platform (#3827) 2019-05-16 21:37:19 -07:00
Jonathan Hui ed23f050ad [cli] move dataset docs into separate file (#3825)
- Add quick start for forming network and attaching.
2019-05-16 21:36:52 -07:00
Jonathan Hui 934efbdf69 [dataset] add API to create new dataset for forming a network (#3825) 2019-05-16 21:36:52 -07:00
Jonathan Hui 73fea7a02c [channel-mask] move ChooseRandomChannel() to ChannelMask (#3825) 2019-05-16 21:36:52 -07:00
Jonathan Hui fa91da10ac [cli] add dataset init command to modify existing dataset (#3825) 2019-05-16 21:36:52 -07:00
Yakun Xu 6d155bebd2 [udp] expose an API to send UDP datagram (#3822)
This commit exposes an API to send UDP datagram, this is usefully when the
UDP receiver handler needs to send messages.
2019-05-16 14:22:03 -07:00
Abtin Keshavarzian 1284384bd8 [toranj] add test for SED attaching with multiple IP addrs (#3813) 2019-05-16 12:23:52 -07:00
Abtin Keshavarzian 0b396918c1 [mle] send shorter "Child ID Request" if needed to avoid frag (#3813)
This commit addresses the attach failure issue by an SED child trying
to register multiple IPv6 addresses in MLE "Child ID Request" message.
If the MLE "Child ID Request" requires fragmentation at 6LoWPAN layer,
this commit changes the code to abort the transmission and drop the
message and instead signal to MLE layer to prepare a shorter "Child ID
Request" by only including the mesh-local address in the `Address
Registration TLV`. After the child attaches, the new code will ensure
to trigger a "Child Update Request" exchange for the child to register
the remaining IPv6 addresses with its parents.
2019-05-16 12:23:52 -07:00
Jonathan Hui 06197eb7f5 [docs] fixup see-also in doxygen (#3824) 2019-05-16 08:28:51 -07:00
Łukasz Duda 21ad4f5da3 [nrf528xx] fix IAR warning (#3823)
This commit fixes IAR warning: undefined behavior: "the order of
volatile accesses is undefined in this statement"
2019-05-15 12:00:12 -07:00
Łukasz Duda 1a4b249a95 [ip6] add support for parsing embedded IPv4 address (#3819)
This commit facilitates the creation of the IPv6 address for NAT64 usage.
2019-05-15 08:55:05 -07:00
Łukasz Duda f42f6e5103 [nrf528xx] use Nordic's OUI in factory assigned IEEE EUI-64 (#3816) 2019-05-14 08:41:20 -07:00
Yakun Xu 4eca76a536 [spinel] fix outdated comment (#3814)
`OPENTHREAD_ENABLE_POSIX_APP` was merged into
`OPENTHREAD_PLATFORM_POSIX_APP`.
2019-05-13 10:35:12 -07:00
Abtin Keshavarzian 06ebaa767b [notifier] fix the #if check testing LOG_CORE being enabled (#3812) 2019-05-11 21:13:36 -07:00
Yakun Xu 27980027be [test] fix unclosed file (#3810)
This commit fixes python warning "ResourceWarning: unclosed file" when set
pexpect to None.
2019-05-11 09:58:06 -07:00
Yakun Xu 20a03b4075 [posix] use monotonic raw timer (#3809)
This commit enhances both posix-app and posix simulation to use the clock
CLOCK_MONOTONIC_RAW, which is supported on Linux and macOS. However, if
this clock is not available, it will fall back to CLOCK_MONOTONIC (for
BSD system).

On windows, it continues to use `gettimeofday()`.
2019-05-11 09:57:34 -07:00
Jiacheng Guo 5a7faa539f [mle] maintain best parent candidate during router-only search (#3803)
* maintain best parent candidate during router-only search
* add margin for duplicate parent request check
2019-05-11 09:56:26 -07:00
Yakun Xu 55da08861e [posix-app] add option to skip reset RCP (#3800)
This commit adds option `--no-reset` to OpenThread POSIX app to suppress
sending soft reset command when initializing OpenThread radio on host.
This is for NCP SPI bus scenario, where spi-hdlc-adapter is involved who
will trigger hardware reset at start.
2019-05-10 06:35:28 -07:00
Yakun Xu 333d5f7afb [spi-hdlc-adapter] reset NCP/RCP on exit (#3801)
This commit triggers resetting NCP/RCP on exit, which ensures NCP/RCP
get back to uninitialized state so that they will not respond to 15.4
messages.

Note, host should disable soft reset by passing `--no-reset` for RCP.
Thus OpenThread POSIX app doesn't need to reset RCP when it exits.
2019-05-09 21:28:20 -07:00
Thomas 246c5eaf33 [gp712] enforce cross compilation by default (#3805) 2019-05-09 14:21:46 -07:00
ltaoti 37f3a201bb [cc1352] fixes for integration with Texas Instruments examples (#3799)
* Fix otPlatRadioEnable always returning busy error

* Remove const from constructors
2019-05-09 14:20:11 -07:00
Thomas 505ba9cbeb [gp712] add include <stdbool.h> to resolve build issues (#3804) 2019-05-08 08:38:36 -07:00
Jonathan Hui 9368ea6c3a [6lowpan] return OT_ERROR_PARSE on MeshHeader::Init() failures (#3796) 2019-05-06 08:48:28 -07:00
Jonathan Hui 6f679e8fb0 [docs] update coap(s) docs (#3795) 2019-05-06 08:48:02 -07:00
Jonathan Hui d4063fe9b8 [cli] clean up coaps example implementation (#3795) 2019-05-06 08:48:02 -07:00
Marven Gilhespie 1b9c50112e [efr32] add support for entering EM2 low-power mode for sleepy devices (#3758)
Changes to EFR32 platform to allow entering EM2 low-power mode for sleepy devices
sleepy-demo applications added to examples/platforms/efr32.
2019-05-03 09:10:39 -07:00
Ciaran Woodward 0aa39f8d13 [doc] Add Cascoda to contributor list (#3794) 2019-05-02 09:08:27 -07:00
Jonathan Hui 408536b034 [docker] add build status badge (#3793) 2019-05-02 08:46:06 -07:00
Abtin Keshavarzian a80098bbc1 [toranj] add thread commissioning test (single joiner) (#3792) 2019-05-02 08:45:51 -07:00
Yakun Xu ae4ef9eb3e [timer] fix elapsed overflow (#3789)
This commit fixes a bug in the commissioner when a joiner's expiration
time has alerady elapsed.

This commit also introduces convenience methods for computing time
elapsed and diffs.
2019-05-02 08:44:37 -07:00
Ciaran Woodward 267a3b3e29 [cli] add 'childip' command to cli for getting ip addresses of MTD children (#3791) 2019-04-30 18:40:40 -07:00
Yakun Xu 617f8958dd [mesh-forwarder] verify data request is ack with fp=1 (#3785) 2019-04-30 18:37:48 -07:00
Abtin Keshavarzian d348ce2bbc [dtls] convert some of the info level logs to debug level (#3788) 2019-04-30 14:12:28 -07:00
Jonathan Hui 79e0dd21ce [docker] copy source rather than git clone to support CI (#3787) 2019-04-30 09:25:44 -07:00
Duda, Lukasz 0208d10563 [metadata] enhance ReadFrom and RemoveFrom methods (#3786) 2019-04-26 15:36:02 -07:00
Duda, Lukasz 1bd5920186 [joiner] remove potential memory leak (#3786) 2019-04-26 15:36:02 -07:00
Duda, Lukasz f45f822800 [coap] check error code on appending metadata (#3786) 2019-04-26 15:36:02 -07:00
Joseph Newman 988be2a7f6 [efr32] further UART driver refactoring (#3776)
- No  longer  queue  2x  32-byte  buffers  for   UART  receive.  Upon
  investigation, the  RAIL library switches these  buffers in software
  (within the  same ISR context as  `receiveDone`), so it  seems to be
  pointless  from  a   performance  perspective  in  queuing  multiple
  buffers. Instead, now work with 64-byte buffers.

- Refactored `updateReceiveProgress` so that extra variable
  `mLastCount` isn't required.

- Extensive testing at higher baud rates revealed race conditions and
  some issues with detecting buffer full conditions.

- Added comments to clarify the logic

- Removed asserts after returning from RAIL library
  functions. Contrary to my previous arguments, if the behaviour of
  the RAIL library functions changes in the future (with regards to
  the errors it returns), then somebody would have to remember to
  check these asserts were still appropriate.
2019-04-26 08:41:52 -07:00
rongli cee20c6a66 [data-poll-manager] fix unexpected interval (#3780) 2019-04-26 08:38:13 -07:00
Jiacheng Guo f5ee3a5e65 [posix-app] timeout for rcp radio driver (#3749) 2019-04-24 16:06:39 -07:00
Jonathan Hui c972c5cb93 [network-data] add bounds check when comparing server data (#3781) 2019-04-24 10:17:07 -07:00
Jonathan Hui 4e45b45796 [dataset] allow setting partially complete active dataset (#3773)
When a partial dataset is stored, the device will attempt to attach to a
Thread network using the limited parameters available. If the device
successfully attaches, the device will then obtain the complete Active
Dataset from its Parent. If the device is router-capable, it will not
become a Router/Leader until it has successfully retrieved a complete Active
Dataset.

Saving a partial dataset supports out-of-band commissioning scenarios.
2019-04-23 22:10:40 -07:00
rongli c5537e1b01 [data-poll-manager] add StopFastPolls() support (#3763) 2019-04-23 22:10:08 -07:00
rongli 2be525b352 [mle] allow attach and link sync between different Thread versions (#3779) 2019-04-23 09:00:45 -07:00
Abtin Keshavarzian f184a9462b [meshcop] clip long strings for vendor name, model, version, data (#3778)
This commit ensures that if the passed-in string args (vendor name,
model, sw version, data or provisioning URL) in `Joiner::Start()`
are too long, they are clipped to the max size defined by the
corresponding TLVs.
2019-04-23 08:59:40 -07:00
Abtin Keshavarzian 99f5790a49 [ncp] add spinel_meshcop_joiner_state_t enumeration (#3774)
This commit defines an enumeration in spinel for Joiner state which
is related to property `SPINEL_PROP_MESHCOP_JOINER_STATE`.
2019-04-22 10:04:54 -07:00
Jonathan Hui 5adac06d08 [logging] fix BeaconPayload::ToInfoString() print of network name (#3771)
`BeaconPayload::GetNetworkName()` does not return a NULL-terminated string.

This commit fixes `BeaconPayload::ToInfoString()` to pass a NULL-terminated
string to the string formatter.
2019-04-18 13:42:33 -07:00
Jonathan Hui a09d8da38c [mpl] discard datagrams with multiple MPL Options (#3764)
Credit to OSS-Fuzz.
2019-04-18 13:29:59 -07:00
Piotr Szkotak 8ff7950cd2 [nrf52840] update Nordic example CDC ACM driver (#3772) 2019-04-18 08:46:28 -07:00
Jonathan Hui 24307f1ba9 [pskc] set random PSKc when generating a new Active Dataset (#3769)
When generating a new Active Dataset, the current PSKc value is used. Because
the PSKc is initialized to all zeros, new Active Datasets have a default
PSKc value of all zeros.

This commit checks if the PSKc has been set (i.e. not all zeros) and, if not
set, generates a random PSKc when creating a new Active Dataset.
2019-04-18 08:45:14 -07:00
Jonathan Hui f46fbb844d [pskc] switch to using otPSKc struct (#3769) 2019-04-18 08:45:14 -07:00
Abtin Keshavarzian 987e96ba0d [ncp] update MESHCOP_JOINER_COMMISSIONING to allow vendor info to be given (#3767)
This commit updates `SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING`
definition to allow vendor info (name, model, sw version, data) to be
specified. All new parameters are optional and if not specified in the
spinel frame (or an empty string is given), OpenThread default values
will be used instead.

This change in `SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING` format keeps
it backward compatible with previous definition, ensuring any driver
using the previous format will be parsed in the same way.
2019-04-17 19:08:11 -07:00
Shu Chen bd2e3ef8f9 [radio-spinel] exit if it fails to get radio channelmask from rcp (#3760) 2019-04-16 11:16:53 -07:00
rongli 8fd8d1e0f9 [mle] enter fast poll mode when dequeue delayed MLE Data Request (#3761) 2019-04-16 10:28:14 -07:00
Joseph Newman 02463bdda1 [efr32] improve USART driver error handling (#3745)
* efr32 uart dma changes
* correct handling of queue full
2019-04-16 09:40:01 -07:00
Jonathan Hui d6e58b15ca [mle] do not apply active dataset from settings after attaching (#3762)
A device should use the Active Dataset in use by the partition that it is
attached to, not the one stored locally in non-volatile.
2019-04-16 08:23:10 -07:00
Kamil Sroka 9fa48b54a8 [nrf528xx] don't return OT_ERROR_FAILED from otPlatRadioTransmit (#3757) 2019-04-16 08:22:29 -07:00
Abtin Keshavarzian db3ea162a8 [message] add and use AppendTlv (#3752)
This commit adds a new method `AppendTlv` to `Message` class which
appends a fully formed TLV to the message. This commit also changes
the core modules to use the new method when appending a TLV.
2019-04-16 08:21:45 -07:00
Łukasz Duda 62b35b67c3 [nrf52840] update README.md after SDK release (#3759) 2019-04-15 08:38:18 -07:00
Łukasz Duda d3fdf84ee0 [platform] return error on incorrect otPlatRadioDisable usage (#3756) 2019-04-15 08:36:47 -07:00
Jonathan Hui bd517c9bf2 [ip6] clean up return values for otIp6Send() (#3751)
- Return OT_ERROR_PARSE when encountering mal-formatted headers.
- Return OT_ERROR_NO_ROUTE when there is no route to host.
- Document possible return values for `otIp6Send()`.
2019-04-12 08:48:35 -07:00
Jonathan Hui b7b085c9f9 [fuzz] advance alarm time to cover timer handlers (#3753) 2019-04-11 11:59:20 -07:00
Abtin Keshavarzian b1ac8a4f19 [joiner] remove static requirement for vendor parameters in Start() (#3748)
This commit updates the `Joiner` class implementation to remove the
requirement for `Start()` vendor related parameters (vendor name,
model, sw version, data) to be static (string). This is done without
requiring the `Joiner` class to use member variables to store/copy
the strings by preparing the "Joiner Finalize" message early on (note
that these parameters are included in this message) and keeping track
of the dynamically allocated `Coap::Message` pointer instead.
2019-04-11 10:11:59 -07:00
Abtin Keshavarzian eab62dd699 [spi-hdlc-adapter] allow log level to be changed (#3747)
This commit contains the following improvements  in
`spi-hdlc-adapter`:

- It changes the default syslog log level to `LOG_WARNING`.
- It enhances the `--verbose[=num]` option to allow negative values
  to reduce the log level. Note that this change keeps the behavior
  backward compatible (it is an add-on).
- It updates the `print_help()` and the `README.md` files to document
  new behavior of `--verbose` option.
2019-04-10 08:33:20 -07:00
Yakun Xu 2bacf31731 [travis] support clang code coverage (#3741) 2019-04-10 08:31:53 -07:00
Jonathan Hui 5f95995c65 [nlbuild-autotools] update to 1.6.6 (#3746) 2019-04-09 20:58:00 -07:00
Jonathan Hui 5ce1e001d2 Squashed 'third_party/nlbuild-autotools/repo/' changes from 75faaf5f..d4c1c470
d4c1c470 Merge pull request #18 from bukepo/code-coverage/fix-for-clang
21fb7d7b bump version and update changes
271abad7 Add code coverage for clang
3597c61e Merge pull request #17 from nestlabs/bug/fix-repos-remake-issue

git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: d4c1c47033060e6f6bbd6b9203e2d1ed26107979
2019-04-09 19:59:02 +00:00
Jonathan Hui 68260c2ed3 Update to reflect upstream repository 'https://github.com:nestlabs/nlbuild-autotools' at tag '1.6.6'. 2019-04-09 19:59:02 +00:00
Jonathan Hui ae04d59280 [lowpan] suppress unchecked return warning in Lowpan::Compress() (#3740) 2019-04-08 21:25:37 -07:00
Shu Chen a43a263a0c [api] remove otLinkGetPhyChannel*() Link APIs (#3736) 2019-04-08 21:25:16 -07:00
Yakun Xu bbb19c2aa2 [radio] only allow disable in sleep state (#3733)
There's missing error definition for otPlatRadioDisable(). This commit adds
an error case OT_ERROR_INVALID_STATE to make sure this is only called
when the radio is in sleep mode.
2019-04-08 21:24:52 -07:00
Joseph Newman 5d2e6cd0d9 [efr32] take advantage of DMA for efr32 USART receive (#3730) 2019-04-08 10:39:45 -07:00
Shu Chen 4c06b47c34 [channelmask] add radio supported and preferred channel mask (#3732)
Add new radio platform APIs:
 * otPlatRadioGetSupportedChannelMask(); // supported channel mask: the device is allowed to be on;
 * otPlatRadioGetPreferredChannelMask(); // preferred channel mask: the device prefers to form on.

Implement some default radio platform APIs.

Add spinel property `SPINEL_PROP_PHY_CHAN_PREFERRED` to retrieve Preferred ChannelMask.
2019-04-08 10:35:18 -07:00
Yakun Xu 174d076722 [radio-spinel] parse frame rx timestamp (#3731)
This commit parses rx timestamp of radio frame received by RCP, no matter
data frames or ACK frames.

* add OT_NUM_ERRORS as number of defined errors.
* allow empty SPINEL_DATATYPE_DATA and SPINEL_DATATYPE_DATA_WLEN when
parsing spinel packets.
2019-04-07 21:34:40 -07:00
Abtin Keshavarzian 7c3bce3a4f [toranj] verify "RCPVersion" is gettable on posix-app mode (#3735)
This commit updates the `test-001` to allow extra properties to
be verified when running under posix-app model. The new test
ensures "POSIXApp:RCPVersion" is gettable.
2019-04-06 22:57:25 -07:00
Abtin Keshavarzian 6e718a1c76 [ncp-base] fix the #if check for posix-app (#3735) 2019-04-06 22:57:25 -07:00
ozanoner 37a662197f [coap] remove otCoapMessage from CoapSecure::DefaultHandler() (#3737) 2019-04-06 21:54:07 -07:00
Łukasz Duda 9847be8328 [build] fix build with announce sender enabled (#3739) 2019-04-06 21:41:45 -07:00
Yakun Xu 33b903bc62 [posix-app] fix conversion warnings (#3738)
This commit fixes conversion warnings and also adjusts one travis test to
check these kind of issues.
2019-04-06 21:40:54 -07:00
Abtin Keshavarzian 83c9270c29 [joiner] update Joiner implementations
This commit contains the following changes to `Joiner` class
implementations:

- Notifier events are signaled on all `Joiner` state changes
  and are logged (through use of `Joiner::SetState()`).
- Discover scan during join uses filtering (removes the need
  to perform filtering by the `Joiner` class itself).
- `Joiner::Stop()` is changed to allow it to be called at any
  stage of join process and it correctly cleans all states.
- Priority assignment to discovered networks is updated/fixed
  (prioritizing networks with an exact match of Joiner ID in their
  Steering Data compared to ones that allow all joiners, and
  sub-prioritize based on signal strength).
- Logs are updated.
2019-04-04 09:14:30 -07:00
Abtin Keshavarzian 873a710a1a [mle] update discover scan filtering
This commit makes improvements to MLE Discover Scan implementation,
mainly the steering data filtering logic:
- The SHA-256 of EUI64 (Joiner ID) and then the related bloom filter
  CRC-CCIT and CRC-ANSI indexes are calculated and saved at start of
  scan operation (removing the need to re-calculate them on every scan
  result).
- When filtering is enabled, a Discover Scan result with no Steering
  Data is now rejected.
- `Mle` class member variables related to discover scan operation
  are renamed to start with `mDisocver` prefix.
2019-04-04 09:14:30 -07:00
Yuzhuo Yang c02a985609 [diag] use OT_ARRAY_LENGTH to unify code and shrink image size (#3677) 2019-04-03 21:52:07 -07:00
Abtin Keshavarzian 6dc3b28b3f [radio-spinel] add meta-data (CSMA/retry counts) in STREAM_RAW property set (#3727)
This commit updates `RadioSpinel::RadioTrasnmit()` to include the
`otRadioFrame` parameters (max CSMA backoffs, max frame retries, and
CSMA-CA enabled flag) as part of meta-data in `PROP_STREAM_RAW`
property `VALUE_SET` command.
2019-04-03 17:03:27 -07:00
Abtin Keshavarzian a4614ac795 [ncp] decode meta-data (CSMA/retry counts) in STREAM_RAW property set (#3727)
This commit adds logic to decode and use the optional meta-data fields
in a `VALUE_SET` command (frame tx request) for `PROP_STREAM_RAW` in
raw-link or radio only (RCP) mode. The optional meta-data fields map
to definitions in `otRadioFrame` to specify number of CSMA backoffs
attempts, frame retry attempts, whether to enable CSMA-CA for this
frame or not. If any optional field is not included, default value
is used instead. This aligns the implementation with specification
of `PROP_STREAM_RAW` in `spinel.h`.
2019-04-03 17:03:27 -07:00
Yakun Xu 8c0fed1c22 [posix-app] fix alarm issue when time changed (#3728)
Current posix app uses gettimeofday() to get time, which will be affected
by system time changes, and results in alarm not fired. This commit uses
clock_gettime() instead to avoid this issue.
2019-04-02 14:59:17 -07:00
Abtin Keshavarzian c862afc6b3 [mac-filter] hide the mFiltered in public filter APIs (#3722)
This commit improves the `Mac::Filter` implementation. It mainly
removes the internally used `mFiltered` variable from the public
`otMacFilterEntry` definition and moves it inside `Mac::Filter`
private definitions.
2019-04-02 10:20:22 -07:00
Abtin Keshavarzian b6a539c8d5 [code-utils] add OT_ARRAY_END() macro (#3722)
This commit adds `OT_ARRAY_END(aArray)` macro which returns a
pointer to the end of a given array (pointing to the past-the-end
element).
2019-04-02 10:20:22 -07:00
Yakun Xu dd1e0f4695 [cli] add legacy stub in cli (#3729)
This commit adds stubs for legacy APIs.
2019-04-02 09:11:46 -07:00
Abtin Keshavarzian 8f112eeb5a [locator] adding Get<Type> to InstanceLocator (#3714)
This commit changes how the objects in OpenThread access each other.
It adds a template `Get<Type>()` method in `InstanceLocator`. This
method returns a reference to a given `Type` object belonging to the
OpenThread instance (e.g. `Get<MeshForwarder>()` returns a reference
to `MeshForwarder` object on the OpenThread instance). The
`InstanceLocator` is used as base class of all OpenThread classes so
every class can easily access any other object. This commit also
changes how the main instance is retrieved in `InstanceLocator` for
the single-instance case. The method `GetInstance()` directly uses the
raw buffer `gInstanceRaw`. This change helps make the `GetInstance()`
and in turn all `Get<Type>()` methods in-line. This commit also
removes the existing getters across all classes to use the new
`Get<Type>()` model.
2019-04-02 09:07:25 -07:00
Łukasz Duda 9dfa4e2b31 [nrf528xx] remove unnecessary dependencies from app_error_weak implementation (#3725) 2019-04-01 09:06:43 -07:00
Abtin Keshavarzian 2daa892f56 [dataset] use Read/Save method names instead of Get/Set (#3723)
This commit renames methods in `DatasetLocal`, `DatasetManager`,
'ActiveDataset' and `PendingDataset` to use `Read()` and `Save()`
in place of `Get()` and `Set()` respectively. This aligns the
names with `Setting` class indicating that these method do
read/save Dataset info in non-volatile memory.
2019-04-01 09:05:58 -07:00
Jiacheng Guo 88912d23ae [nrf52840] signal event in usb cdc (#3715) 2019-04-01 09:05:10 -07:00
dismirlian 81fd8a8b10 [examples] software implementation of source match table (#3717)
* [examples] add software implementation of source match table

* [efr32] modify radio driver to use generic implementation of source match table

* [efr32] configure soft source match table PAN ID
2019-04-01 08:52:47 -07:00
Jonathan Hui 19544490e3 [style] replace reinterpret_cast with static_cast where possible (#3718) 2019-03-28 22:29:58 -07:00
Joseph Newman ecad71733d [ncp] add service spinel bindings (#3659)
* add spinel bindings for service add/remove/get
* add leader services query
2019-03-28 22:29:25 -07:00
Jeff Bumgardner ca0b1d8229 [docs] fix instances of "the the" in comments (#3720) 2019-03-27 18:44:41 -07:00
Łukasz Duda 0b6cd5b115 [nrf528xx] add otSysEventSignalPending call in spi-slave driver (#3716) 2019-03-27 08:47:13 -07:00
Jonathan Hui 3b41c7ef44 [fuzz] advance alarm time to cover timer handlers (#3710) 2019-03-26 12:17:31 -07:00
dismirlian 24d5d3db66 [efr32] minor enhancements to radio driver (#3713)
* Add static linkage to local functions

* Simplify clearing checksum of source match table entry
2019-03-26 08:53:10 -07:00
Jonathan Hui 1fefe2e683 [dtls] return error on multiple calls to Dtls::Open() (#3709) 2019-03-25 08:36:19 -07:00
Jonathan Hui a9e0fe9ec6 [udp] add Udp::IsBound() method (#3708) 2019-03-25 08:35:56 -07:00
Yakun Xu 23ff1015d4 [core] change return type of otMessageRead() (#3707) 2019-03-22 08:12:55 -07:00
Jonathan Hui 49c4b63491 [style] make parameter names consistent across decls and defs (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui d32ca03a8b [style] remove redundant control flow (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui 0de1fff570 [style] remove redundant declarations (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui 63cf08d04a [style] const-qualify pointer args where possible (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui cadfc6d299 [style] remove static member access through instances (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui c7cd21f8b7 [style] remove const values in declarations (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui e00114b3f1 [style] mark single-arg constructors as explicit (#3705)
Avoids unintentional implicit conversions.
2019-03-22 08:12:26 -07:00
Jonathan Hui f2d93917c2 [style] remove using decls from global namespace in headers (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui 8656101724 [style] remove unused using decls (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui 2ab9b49042 [style] use C++-style casts (#3705) 2019-03-22 08:12:26 -07:00
Jonathan Hui 8ed382207d [efr32] fix build issues when sub-GHz support is not configured (#3704) 2019-03-22 08:11:56 -07:00
Yakun Xu 5f220682cd [tests] add an inspector for travis certification tests (#3700)
This commit adds a debugger to inspect nodes status.
2019-03-22 08:11:39 -07:00
rongli 1b8b797919 [netdata] fix stable network data version when service updates (#3702) 2019-03-21 12:13:20 -07:00
Yakun Xu e3d0368070 [travis] remove unused sources (#3701)
This commit removes unused sources from apt update list to avoid fetch
failures.
2019-03-21 08:21:18 -07:00
Jonathan Hui 4f734fa24f [udp] return error on source port mismatch in Udp::SendTo() (#3698) 2019-03-20 03:18:51 -07:00
Jonathan Hui b6ef4988f3 [travis] add travis_retry to before_install (#3697) 2019-03-19 21:17:45 -07:00
Jonathan Hui aaaae937d3 [style] prefer OT_UNUSED_VARIABLE (#3696) 2019-03-19 21:17:33 -07:00
Irving-cl a637cdccf4 [tests] add test case Cert_9_2_02 (#3589)
1. Add new test case **Cert_9_2_02**. Since the test case contains 2
topologies, added 2 new files:
- `Cert_9_2_02A_MGMTCommissionerSet.py`,
- `Cert_9_2_02B_MGMTCommissionerSet.py`.

2. Add mesh_cop tlvs parsing. The corresponding file is
`mesh_cop.py`. The mesh_cop tlvs are used in many cases. For example,
`CommissionerSessionId` is used in both the parsing of **Commissioning
Data**(in mle) and the parsing of **CoAP**. Collected all mesh_cop
tlvs refered in Thread into this file with some unused tlvs
unimplemented.

3. Reuse `SubTlvsFactory` in `network_data.py`. `SubTlvsFactory` are
used to choose the corresponding factory of specific tlv and do the
parsing of it. The `NetworkLayerTlvsFactory` in `network_layer.py` had
exactly the same function with it (almost the same code). Moved the
`SubTlvsFactory` into a new file `tlvs_parsing.py` and change the
usage in `network_data.py` and `network_layer.py`. This helps us
remove some redundant code.

4. Some format issues. Remove some trailing spaces.
2019-03-19 21:17:15 -07:00
Łukasz Duda a3f398b30f [doc] update documentation of CLI counters command (#3695) 2019-03-19 14:00:55 -07:00
Jonathan Hui c0de3be7f3 [dtls] cleanup method names (#3694)
- Rename Close() to Disconnect() to better pair with Connect()
- Rename Stop() to Close() to better pair with Open()
- Make Setup() private.
2019-03-18 22:58:38 -07:00
Jonathan Hui a39f2c86d3 [dtls] do not allow Open() or Bind() when DTLS session is started (#3694) 2019-03-18 22:58:38 -07:00
Abtin Keshavarzian 8bddf61ae2 [toranj] add test to cover OT/NCP SLAAC module behavior (#3688)
This commit updates and renames the existing `test-026-slaac-address`
to indicate that it covers the behavior of `wpantund` related to
SLAAC address management (in `test-026` we disable NCP SLAAC module).

It adds a new test `test-030-slaac-address-ncp` to cover behavior of
OpenThread/NCP SLAAC module:

- Verify that adding prefix (with SLAAC flag) causes a corresponding
  SLAAC IPv6 address to be added.
- Verify that removing the prefix would remove the SLAAC address.
- Verify behavior when same prefix is added and removed on multiple nodes
  (with or without SLAAC flag).
- Check behavior when an IPv6 address with the same prefix already exists.
- Check behavior when the address with same prefix is removed (SLAAC module
  should add a SLAAC address upon removal of the address).
- Verify that removal of prefix does not remove user-added addresses with
  same prefix.
- Verify disabling SLAAC module removes any previously added SLAAC
  addresses, and re-enabling it adds them back (with same IID).
- Check behavior when prefix is added while SLAAC module is disabled and
  then enabled later.
2019-03-18 22:58:13 -07:00
Jonathan Hui 037896c5cd [meshcop] fix doxygen in ChannelMaskTlv::SetChannelMask() (#3693) 2019-03-18 16:54:20 -07:00
Yakun Xu 728e19b47a [cli] avoid input overflow (#3691) 2019-03-18 09:01:02 -07:00
Jonathan Hui fab45352f5 [meshcop] process ChannelMaskTlv in message (#3690)
Allows arbitrary number of Channel Mask entries.
2019-03-15 21:46:02 -07:00
Zhanglong Xia 61e9288805 [ip6] correct annotations (#3692) 2019-03-15 21:39:23 -07:00
Yakun Xu ea459d4cc3 [posix-app] fix debug flag (#3689) 2019-03-14 21:58:48 -07:00
Abtin Keshavarzian 6256b5cdde [link-raw] log frame tx attempt failures (#3687)
This commit adds logs to indicate frame tx attempt failures on
`LinkRaw` class for RCP model.
2019-03-14 19:55:21 -07:00
Zhanglong Xia 1af2933449 [efr32] enable BRD4170A to support 915MHz and 2.4GHz by default (#3664) 2019-03-14 09:44:35 -07:00
Yakun Xu dea08b2db7 [posix-app] add readline for CLI (#3511) 2019-03-13 23:32:32 -07:00
Jonathan Hui 160ef467e6 [dtls] handle MBEDTLS_ERR_PEM_ALLOC_FAILED in Dtls::MapError() (#3674) 2019-03-13 23:20:56 -07:00
Abtin Keshavarzian 89396ab5d3 [ncp] add SLAAC related spinel capability and property (#3667)
This commit adds `SPINEL_CAP_SLAAC` which indicates to host whether
SLAAC feature is supported. It also adds `SPINEL_PROP_SLAAC_ENABLED`
spinel property to let host enable/disable SLAAC module at run-time.
2019-03-13 23:20:41 -07:00
Abtin Keshavarzian cce16b6dda [slaac] add IsEnabled() method and public API otIp6IsSlaacEnabled (#3667) 2019-03-13 23:20:41 -07:00
Zhanglong Xia ce24abb7bb [api] rename ChannelMaskPage0 to ChannelMask (#3665) 2019-03-13 07:49:25 -07:00
Kamil Sroka a99816a225 [nrf52811] add emulation on nRF52840 to README.md (#3682) 2019-03-12 23:27:42 -07:00
Łukasz Duda 039aab3fa0 [nrf52840] handle NRF_ERROR_BUSY from SD in flash driver (#3680) 2019-03-12 23:27:16 -07:00
Yakun Xu a6a2f963d9 [posix-app] more baudrates on macOS (#3675) 2019-03-12 23:26:32 -07:00
Jonathan Hui 950c7c8612 [meshcop] avoid shift exponent too large in ChannelTlv processing (#3673) 2019-03-12 10:47:25 -07:00
Jonathan Hui e82531507b [meshcop] make length checks more strict on ChannelMaskTlv parsing (#3672) 2019-03-12 10:47:12 -07:00
Jonathan Hui 92e4d89f64 [travis] check/fix EOF newline on pretty/pretty-check (#3671) 2019-03-12 10:46:58 -07:00
Jonathan Hui 498034fba5 [travis] remove posix-app-ncp test due to frequent failures (#3683) 2019-03-12 10:43:11 -07:00
Łukasz Duda 70b29674f6 [build] fix warning in SLAAC module in Keil (#3666) 2019-03-11 22:07:47 -07:00
Abtin Keshavarzian 906fe0dffc [spinel] add spinel definition guideline (#3663) 2019-03-11 21:28:04 -07:00
Abtin Keshavarzian 9c2b8815ba [ncp] report 2.4GHz and/or 915MHz support from SPINEL_PROP_CAPS (#3662) 2019-03-11 21:27:41 -07:00
Abtin Keshavarzian dd69fabd2d [spinel-decoder] fix comments (#3661) 2019-03-11 09:40:32 -07:00
Yakun Xu f695ccae22 [dtls] simplify logging (#3660) 2019-03-11 09:38:58 -07:00
Yuzhuo Yang da9ba9cbdc [diag] add radio sleep / receive mode for RF certification (#3657)
Bug: 127894959
2019-03-11 09:37:52 -07:00
Abtin Keshavarzian 58f144a7f7 [slaac] enhance and simplify SLAAC support (#3621)
This commit enhances the SLAAC support in OpenThread core. It contains
the following changes and features:

The `Utils::Slaac` class is updated to include all the related code
for managing SLAAC addresses (e.g., `Slaac` class maintains the
address buffer and directly subscribes to `Notifier` to listen for
Network Data changes to update SLAAC addresses).

The SLAAC address module is changed to support and use semantically
opaque IID generation algorithm (RFC 7217) instead of random IID
generation. This ensures that SLAAC addresses are random but stable
(i.e., the same SLAAC address is added on a device for the same
prefix) and aligns the implementation with Thread specification
requirement.

The semantically opaque IID generation logic is updated to follow RFC
7217 with SHA-256 as the pseudo-random function, and a 256 bit secret
key (generated once using true random number generator and saved in
non-volatile settings).

A new feature is added to allow SLAAC support to be enabled or
disabled during network operation. When enabled, SLAAC addresses are
generated and added to the interface. When disabled, any previously
added SLAAC address is removed.

This commit also adds "SLAAC prefix filter" feature which allows
OpenThread users to register a filter handler with SLAAC module. The
handler is invoked by SLAAC module when it is about to add a SLAAC
address based on a prefix. The returned boolean value from the handler
determines whether the address should be filtered or not.
2019-03-11 09:35:07 -07:00
RaKu 6453c9f033 [nrf52840] do not specify interface protocol in USB CDC (#3658)
bInterfaceProtocol descriptor previously indicated that AT V.250 commands
were supported by the device. This could cause issues with applications
managing modems.
2019-03-08 08:28:26 -08:00
Yakun Xu 7a0eb2c2e7 [dtls] refine CoAP secure and DTLS (#3632)
`CoapSecure` is always used by joiner, border agent or commissioner.
DTLS should not be shared with the application `CoapSecure`.

This commit includes the following changes:
* allow multiple DTLS by using `TimerMilliContext`
* move `CoAP::mSocket` into `Dtls`
* move `ThreadNetif::mDtls` into `CoapSecure`
* remove unnecessary getters of `Dtls` and `CoapSecure`
2019-03-08 08:11:41 -08:00
Zhanglong Xia 96725a985e [phy] add support for OQPSK modulation in 915MHz band (#3378) 2019-03-08 08:09:55 -08:00
Jonathan Hui 4610811781 [docs] udpate borderrouter repo name to ot-br-posix (#3655) 2019-03-08 07:51:59 -08:00
Jonathan Hui 5e4d07cb23 [dtls] fix bug in resetting dtls state on error (#3653) 2019-03-07 09:12:56 -08:00
Jonathan Hui 2805ca463b [meshcop] fix buffer overflow in Commissioner Session ID compare (#3652)
Credit to OSS-Fuzz.
2019-03-07 09:12:43 -08:00
Jonathan Hui 0938be7f84 [dhcp6] clean up Prefix Agent state management in DHCPv6 server (#3646)
* introduce a new class for managing Prefix Agent state
* combine prefix and ALOC into the same class
2019-03-07 09:12:20 -08:00
Abtin Keshavarzian 62971bfe93 [router-table] simplify router table code (#3644)
This commit adds a simple internal helper class `RouterIdSet` in
`RouterTable` to store the allocated router IDs bitset. This commit
also renames the `for` loop variable names (`routerId` when iterating
over all router IDs and `index` used for `mRouters` array index)
2019-03-05 10:51:13 -08:00
Yakun Xu 4acd8b7aab [build] fix SLAAC switch (#3645) 2019-03-05 10:45:22 -08:00
Jiacheng Guo ab12b47182 [posix] do not exit on EINTR in UART (#3643) 2019-03-04 08:38:28 -08:00
rongli 11339835e4 [mle] do not echo back ML-EID registered by MTD (#3640)
* do not echo back ML-EID registered by MTD
* update the address registration check in Cert_7_1_01 and Cert_7_1_03
2019-03-04 08:36:27 -08:00
Irving-cl dcc13419c3 [thci] match meshlocalprefix accurately to classify the addresses correctly (#3639) 2019-03-04 08:31:16 -08:00
Yakun Xu bf794ca5f2 [mle] fix oob steering data length (#3638) 2019-02-28 23:45:45 -08:00
Yakun Xu 6705fe83f3 [time-sync] fix time sync and typo (#3637)
* fix typo in common-switches
* fix segment fault with time sync enabled
2019-02-28 10:28:16 -08:00
Stuart Longland 74ad300556 [cc2538] fix RSSI calibration when CC2592 is in use (#3636)
* Define parameter for RSSI offset.

This defines the RSSI offset as an overridable parameter in the CC2538
configuration for users that have installed a CC2592 on their board but
have hard-wired the HGM pin either to `VDD` or `GND`.

* Calibrate RSSI according to HGM state.

I had actually misread the datasheet a little bit, having gotten
sensitivity and RSSI offset confused.  The values I needed for the
sensitivity were actually in the table *above* where I got the original
figures here from.

This puts the *correct* figures in place, and also defines a function
that returns the RSSI offset based on the state of the HGM pin (or
returns a static value if we omit CC2592 support or disable HGM
control).

* Expose RSSI offset setting in Makefile

* Document RSSI offset parameter
2019-02-28 08:18:56 -08:00
Łukasz Duda db945a5278 [nrf528xx] update platforms README.md (#3633) 2019-02-28 08:17:00 -08:00
wgtdkp d3791348d1 [tests] enhance Cert_8_1_01_Commissioning (#3457) 2019-02-27 19:16:02 -08:00
Piotr Szkotak 096632a475 [nrf528xx] add radio and random platform fixes (#3634)
* [nrf52811] add radio and random platform fixes

* [nrf528xx] handle all radio driver rx/tx errors
2019-02-27 12:41:41 -08:00
Joseph Newman f9884b8afc [efr32] implement otPlatRadioEnergyScan API (#3631)
* refactor for energy scan API

* rename enum, init status in init func, tidy up and fix issue in GetRssi

* add cast and fix start energy scan error return
2019-02-27 12:03:51 -08:00
Yakun Xu ceed19c4b5 [posix-app] cause compile failure for SPI bus (#3630) 2019-02-26 15:52:47 -08:00
wgtdkp dc947f0152 [tests] support testing commissioning (#3441)
Add support for testing commissioning process, including:

1. Add DTLS, Thread Discovery and commissioning messages(JOIN_FIN.req etc) parsing;
2. Support parsing log from UART response, and construct decrypted messages;
3. Common commands for commissioning related verification;
2019-02-26 15:49:57 -08:00
Yakun Xu cc37bd1dfb [coaps] fix disconnected (#3623)
When DTLS is disconnected, the socket should also be disconnected from
the previous peer.
2019-02-26 15:41:59 -08:00
Yakun Xu 127e3bb84e [posix-app] clean up posix app defines (#3611) 2019-02-26 13:28:37 -08:00
Jonathan Hui e7acaa8879 [mesh-forwarder] do not allow eviction of message being processed (#3629)
Processing a message may trigger an Address Solicit message to be sent.
Because Thread control messages have higher priority, it is possible for the
Address Solicit message to evict the data message that caused the generation
of the Address Solicit message.

This commit present a message that's being processed from being evicted.

Credit to OSS-Fuzz.
2019-02-25 18:57:36 -08:00
Jonathan Hui 13bd1db1f7 [dtls] do not free mbedtls context if one is already being used (#3628) 2019-02-25 18:36:51 -08:00
Jonathan Hui a3548df579 [network-data] add check for prefix length (#3626) 2019-02-25 18:36:36 -08:00
Jeff Bumgardner d912393c7f [docs] add STMicroelectronics to the list of supporters (#3627) 2019-02-25 16:01:54 -08:00
Joseph Newman 02d33b9bb9 [efr32] fix cannot compile with log output OPENTHREAD_CONFIG_LOG_OUTPUT_APP (#3625) 2019-02-25 09:27:37 -08:00
Jonathan Hui 5cf3540f6e [efr32] unify flash config around SETTINGS_CONFIG_PAGE_NUM (#3620) 2019-02-25 09:26:26 -08:00
Yakun Xu a0db3b5b46 [posix-app] fix daemon uart send done (#3622) 2019-02-22 21:56:02 -08:00
Kamil Sroka 203bce7ae7 [nrf528xx] update usbd (#3618) 2019-02-22 09:00:57 -08:00
Jonathan Hui 3eb5a106ff [fuzz] process pending tasklets to increase coverage (#3617) 2019-02-22 09:00:23 -08:00
Jonathan Hui b7a9e7afd7 [tests] add conditionals around unit tests (#3616) 2019-02-22 09:00:01 -08:00
Stuart Longland fd2503e792 [cc2538] add support for CC2538-CC2592-EM (#3609)
* [cc2538] Define registers for control of CC2592.

In order to set up the signals needed to drive the CC2592 front-end, we
need to expose a few registers in the radio module that route internal
module signals to pins on Port C.

TI also recommend hooking the HGM pin of the CC2592 to a GPIO pin so
that the high-gain mode can be software-controlled.  It can be connected
to any GPIO pin, but they call out PD2 specifically for this, so we need
to configure GPIO port C & D.  Since we're here, we'll add B as well.

Some macros of convenience are also added for accessing the Nth element
in an array of 32-bit registers, as well as computing the bit mask of
the Nth GPIO pin.

* [cc2538] Define configuration settings for CC2592.

By default, we disable support for the CC2592 as we do not wish to break
existing OpenThread instances.  The configuration parameters allow
customisation of the locations for the `PA_EN`, `LNA_EN` and `HGM`
signals (within the constraints of the CC2538) for cases where people
have moved the signals around on custom boards.

The defaults work with designs derived off the CC2538-CC2592 EM
reference design.

* [cc2538] Define control interface for HGM pin.

Since the `HGM` signal is under software control, we need to be able to
allow the software to turn it on or off as required.  This exposes two
functions, one of which queries the current state (by looking at the
GPIO register bit-mask), and the other provides a means to change the
state.

* [cc2538] Implement control and calibration of the CC2592.

This implements the control functions defined earlier and adds the
necessary logic for initialising the CC2592.

The transmit and receive power levels are also calibrated.

* [cc2538] Define CC2592 options in Makefile.

This allows building of a CC2538-CC2592 EM image by specifying
`CC2592=1` on the command line.
2019-02-22 08:59:19 -08:00
Piotr Szkotak 530a4d23ad [slaac] remove otIp6SlaacUpdate leftover from the ip6.h header (#3612) 2019-02-21 16:22:01 -08:00
Jonathan Hui 7ddeb2123f [mesh-forwarder] avoid assert when processing direct transmissions (#3614) 2019-02-20 18:10:51 -08:00
Jonathan Hui 84eb7493ca [mle] remove assert in Mle::FillConnectivityTlv() when detached (#3610) 2019-02-20 18:10:38 -08:00
mateusz- 2d6e9085f8 [doc] fix incorrect SNTP comment (#3613) 2019-02-20 09:47:40 -08:00
Abtin Keshavarzian 795a7e9197 [mbedtls] include debug.h (#3608)
The `<mbedtls/debug.h>` is included in `mbedtls.cpp` file which is
needed for `mbedtls_debug_set_threshold()`.
2019-02-19 20:47:05 -08:00
Jonathan Hui 87838428a0 [lowpan] try to compress fewer headers on compression errors (#3597) 2019-02-19 20:46:28 -08:00
Jonathan Hui d8d1d91422 [lowpan] indicate compress error when processing beyond msg buf (#3597) 2019-02-19 20:46:28 -08:00
Jonathan Hui 62e4c0a2e9 [lowpan] leave msg offset and buf writer unmodified on error (#3597) 2019-02-19 20:46:28 -08:00
Jonathan Hui 49641e1d4e [lowpan] introduce buffer writer to lowpan compressor (#3597) 2019-02-19 20:46:28 -08:00
Martin Turon 0f2502833e [nrf52840] add nrfjprog target for flashing (#3478) 2019-02-19 20:46:02 -08:00
Marven Gilhespie 18c496d915 [efr32] update to Silicon Labs Flex SDK v2.5 (#3596) 2019-02-19 12:09:49 -08:00
Łukasz Duda 9297f3559d [cli] allow to define ping interval in milliseconds (#3607) 2019-02-19 12:04:23 -08:00
Łukasz Duda 8c13df5a51 [cli] add command to retrieve mle counters (#3605) 2019-02-19 11:37:45 -08:00
hjian2017 403f7f8109 [cli] correct dataset examples in README (#3604) 2019-02-19 09:00:29 -08:00
Piotr Szkotak 697aa0259c [nrf52811] fix uart hwfc define in the platform config (#3606) 2019-02-19 08:54:57 -08:00
Piotr Szkotak 80c98ac824 [nrf528xx] update radio driver to version 1.3.0 (#3603) 2019-02-19 08:44:49 -08:00
Irving-cl cf7bc35bbe [tests] add traffic check in test case Cert_7_1_01 (#3405) 2019-02-18 13:41:30 -08:00
Łukasz Duda 968f9b6898 [nrf528xx] improve flash API (#3602) 2019-02-18 11:11:13 -08:00
Piotr Szkotak cb8761b7d0 [nrf528xx] update app_error_weak.c (#3601) 2019-02-18 11:10:56 -08:00
Abtin Keshavarzian b0110db4e5 [link-raw] remove the redundant logs in link-raw api (#3598) 2019-02-16 13:11:51 -08:00
Łukasz Duda 62d5be594d [nrf528xx] improve platform specific configs (#3595) 2019-02-15 09:34:28 -08:00
Łukasz Duda ab0d639ccb [doc] improve doxygen comments (#3594) 2019-02-15 09:29:48 -08:00
RaKu 905f8c7153 [nrf528xx] always enable diag module (#3593)
Disabling diag module causes linker errors due to unresolved symbols when building NCP example with NCP_SPI flag set to 1 on some toolchains.
2019-02-15 09:22:14 -08:00
Abtin Keshavarzian e02c970269 [mac] assert on failure of otPlatRadioEnable() (#3592) 2019-02-15 09:20:15 -08:00
Yakun Xu b08fab42bb [posix-app] fix aliasing issues in platform UDP (#3591) 2019-02-14 13:26:06 -08:00
Jonathan Hui 5ca9db0035 [style] remove snake case from style guide (#3586)
For better or worse, the existing C code style follows camel case. Rather
than changing the code, simply update the style guide.
2019-02-14 13:09:00 -08:00
Jonathan Hui 1627a42864 [mpl] fix bug in comparing sequence numbers (#3588)
Fix serial number arithmetic due to value wrap.
2019-02-14 11:33:39 -08:00
Łukasz Duda 6170948e27 [mpl] fix inserting mechanism and timer handling (#3587) 2019-02-14 08:54:18 -08:00
Yakun Xu 2f2aba80dd [platform-netif] disable icmp echo (#3590) 2019-02-13 21:37:54 -08:00
Abtin Keshavarzian 7a69ae36a1 [slaac] add config option to enable/disable SLAAC support (#3512)
This commit adds `OPENTHREAD_CONFIG_ENABLE_SLAAC` as a build
configuration option to enable/disable SLAAC support within
OpenThread. This feature is disabled by default. This commit also
adds `SLAAC` to `common-switches` list to allow builds to enable
this feature easily.
2019-02-13 18:17:18 -08:00
Krzysztof Bogucki 96de36385a [ip6] messages sent to Service Locator will not be filtered out (#3585)
Messages sent to Service Locator will not be filtered out, when thread
control traffic filtering is enabled via SetReceiveIp6FilterEnabled().
2019-02-13 08:59:33 -08:00
Yakun Xu 14d4d88727 [mbedtls] guard allocator with accurate macro (#3575)
This commit guards using mbedTLS's buffer allocator API with a more accurate
macro, so that even in single instance mode, we can use other memory
allocator.
2019-02-13 08:58:41 -08:00
Martin Turon c04bf5ea24 [ble] BLE API improvements: add l2cap and gatt services registration (#3563) 2019-02-13 08:57:13 -08:00
Jonathan Hui 038edf53b2 [mpl] allow multiple entries from the same Seed ID (#3557)
This commit improves MPL delivery performance by allowing a single Seed ID
to burst multiple MPL packets without suppressing previous transmissions.
2019-02-12 08:34:11 -08:00
Abtin Keshavarzian 445827108b [ip6] update documentation for otIp6ReceiveCallback (#3584) 2019-02-12 06:03:57 -08:00
Abtin Keshavarzian 778f99798e [notifier] enhance documentation (#3583) 2019-02-12 06:03:13 -08:00
Abtin Keshavarzian 490b5739a8 [toranj] add test-case for data poll transmission and poll interval (#3570) 2019-02-11 21:50:22 -08:00
Kamil Sroka 84a2706393 [build] don't define UINT32_MAX for C (#3581) 2019-02-11 13:04:56 -08:00
Yakun Xu 9bd0467b6f [posix-app] fix aliasing issue (#3579) 2019-02-11 13:03:26 -08:00
Yakun Xu cced005256 [posix-app] fix write in daemon mode (#3576)
In daemon mode, UART write should be processed even when no client
is connected. This commit writes UART to STDERR in such situation.

* add test for daemon mode
* remove useless code for UART restore
* fix a typo of assert
* set FD_CLOEXEC flag to better support reset.
2019-02-11 10:58:18 -08:00
Yakun Xu 0810ed6572 [posix-app] explictly set optind (#3574)
This allows another options parser before initializing OpenThread.
2019-02-11 10:54:03 -08:00
Łukasz Duda 9c2dba773e [nrf528xx] test all transport variants in CI (#3573) 2019-02-11 10:52:08 -08:00
Irving-cl 2ac8890c41 [tests] fix class name for Cert_9_2_04 (#3572) 2019-02-11 10:50:58 -08:00
Abtin Keshavarzian 4219b5bb04 [ncp] add static assert to check size of changed set entries array (#3571) 2019-02-11 10:50:20 -08:00
Abtin Keshavarzian 7494216415 [instance] update the documentation for Get<Type> definition (#3569) 2019-02-08 08:43:06 -08:00
Abtin Keshavarzian 3ba1c79910 [mac] use ot::Instance reference in scan callback handlers (#3568)
This commit changes the scan callback handlers to use `ot::Instance`
as a parameter replacing a given `void *` context.
2019-02-08 08:42:29 -08:00
Jonathan Hui 8a037c8aa5 [travis] add build checks for qpg6095 platform (#3567) 2019-02-08 08:41:47 -08:00
Łukasz Duda 070fd834e8 [nrf52811] add support for nRF52811 platform (#3566) 2019-02-08 08:41:22 -08:00
Jonathan Hui 46d0b62ec7 [travis] move platform builds to common functions (#3562) 2019-02-07 08:44:40 -08:00
RaKu bfe0c492d9 [nrf52840] disable compilation of unused transports (#3561)
Add DISABLE_TRANSPORTS switch which disables build of all transports and examples using them.
Disable compilation of USB and UART transports if NCP_SPI switch is set. This also disables
the build of CLI example.
2019-02-07 08:42:27 -08:00
Abtin Keshavarzian f01e3f34e5 [mac] always emit OT_CHANGED_THREAD_CHANNEL on channel change (#3560) 2019-02-06 08:42:53 -08:00
Abtin Keshavarzian f31f8c1f3c [link-raw] handle get/set channel when LinkRaw is enabled (#3559)
This commit updates `otLinkGetChannel()` and `otLinkSetChannel()`
to handle the situation where raw-link mode is enabled.
2019-02-06 08:42:37 -08:00
Abtin Keshavarzian bd4ca8113d [ncp] add support for getting MLE counters (#3558)
A new spinel property `SPINEL_PROP_CNTR_MLE_COUNTERS` is defined,
which can be used to get Thread MLE counters (`otMleCounters`).
2019-02-06 08:41:50 -08:00
Jonathan Hui 3070948ec5 [travis] enhance samr21 build checks (#3556)
- enable gcc 7 and 8 build checks
- upgrade to asf-standalone-archive-3.45.0.85
2019-02-06 08:40:54 -08:00
Abtin Keshavarzian d2e9bdfca3 [notifier] auto-register callback from its constructor (#3555)
This commit helps simplify the implementation and use of `Notifier`
by having the `Callback` constructor registering the callback with
the `Notifier`.
2019-02-04 21:51:41 -08:00
Abtin Keshavarzian ede320712e [mle] use IsAttached() to start border agent (#3554) 2019-02-04 21:08:11 -08:00
Abtin Keshavarzian ab871b5025 [mle] skip saving network info on role change to detached (#3553)
This commit changes the behavior of `Mle` to skip the saving of
network info (to non-volatile memory) on role change to detached. Note
that `Store()` does only update the MAC/MLE counters if device is not
attached. The MAC/MLE counters update is tracked already by
`KeyManager`.
2019-02-04 21:07:54 -08:00
Abtin Keshavarzian e990ede832 [settings] skip non-volatile save with same NetworkInfo/ParentInfo (#3552)
This commit adds new check in `settings.cpp` for saving of
`NetworkInfo` and `ParentInfo` in non-volatile memory to verify that
the new value is different from previously saved content. This reduces
number of writes after a device reboot.
2019-02-04 21:06:22 -08:00
Abtin Keshavarzian 7698c21020 [mle] use local ref to KeyManager/Mac/MleRouter for reused objects in methods (#3551) 2019-02-04 21:05:53 -08:00
Abtin Keshavarzian 29d637683f [settings-flash] ensure SETTINGS_CONFIG_PAGE_NUM >=2 (#3416)
This commit adds code to ensure `SETTINGS_CONFIG_PAGE_NUM` is at
least two. This helps simplify the code and also address
Coverity warnings for unreachable code.
2019-02-04 20:46:23 -08:00
Oleksandr Grytsov c31ab99080 [samr21] Define SETTINGS_CONFIG_PAGE_NAME with const (#3491)
Currently SETTINGS_CONFIG_PAGE_NAME is defined indirectly by addresses of
__d_nv_mem_start and __d_nv_mem_end. But such definition doesn't allow to
perform compile time sanity check. Define this macro with const value 16.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov e7a6bde56d [samr21] Implement otPlatLog for SAMR21 XPLAINED PRO board (#3491)
Use EDBG DGI SPI interface to put log.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 513b0f8b8d [samr21] Pass ack frame to otPlatRadioTxDone (#3491)
SAMR21 RF doesn't provide ACK frame payload. Create it manually and pass to
otPlatRadioTxDone.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov cf7b57a5cf [samr21] Set RF state to OT_RADIO_STATE_RECEIVE on tx finished (#3491)
OT doesn't always call otPlatRadioReceive to set rx state explicitly. It
causes RF is in wrong state in some cases. SAMR21 RF is switched to
rx state internally when tx is finished and OT platform radio state should
be updated accordingly. This fix is set sState to OT_RADIO_STATE_RECEIVE
when tx is done.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov f304177726 [samr21] Add hardware acceleration for the AES block cipher (#3491)
samr21 has HW aes-128 module. It couldn't be used before as mbedtls uses
256 bit random generator. Recently mbedtls introduces
MBEDTLS_CTR_DRBG_USE_128_BIT_KEY flag which makes mbedtls to use 128 bit
random generator. It limits the security of generated keys but allows
to use HW aes-128 module for encrypt/decrypt 802.15.4 frames.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 0073a49dbd [samr21] Update README.md to latest ASF 3.45.0 (#3491)
* update reference to ASF 3.45.0 and gcc 7.3.1
* update other links

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov c4a7e8570d [samr21] Add possibility to define board with command line (#3491)
By default Makefile-samr21 builds for SAM R21 Xplained Pro board. Another
board can be specified with BOARD variable through command line:

    make -f examples/Makefile-samr21 BOARD=<TARGET_BOARD>

Currently supported following boards: SAMR21_XPLAINED_PRO,
SAMR21G18_MODULE, SAMR21B18_MODULE.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 9fee87c071 [samr21] Remove memcpy from otPlatRadioTransmit (#3491)
samr21 rf driver requires that first byte of transmit buffer should be
psdu length. The psdu was copied to a local buffer with one byte shift then
the local buffer was passed to rf driver. This copying is removed by
extending length of sTransmitPsdu by 1 byte and use &sTransmitPsdu[1] as
transmit frame psdu.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 68d527a530 [samr21] Fix compilation issue with gcc 7.3.1 (#3491)
Internal compiler.h defines __always_inline macro and includes cdefs.h
indirectly. cdefs.h also defines this macro. As result we have redefined
macro error which can't be suppressed. The fix is to use custom compiler.h
which is copy of ASF compiler.h bu defines __always_inline only if it is
not yet defined.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Jeffrey Hayes 2c866feb48 [efr32] random number generation fix (#3367) 2019-02-04 15:59:18 -08:00
Markov Vladislav 28cf269481 [topology] add static assertion to exclude counter overflow (#3550) 2019-02-04 10:53:09 -08:00
Jonathan Hui 362f97df1e [fuzz] return valid radio transmit buffer (#3549) 2019-02-04 10:52:00 -08:00
Jonathan Hui 404d946150 [cli] validate ping interval is positive to avoid Timer::Start() assert (#3548) 2019-02-04 10:51:45 -08:00
Jonathan Hui b2bbad7674 [ncp] disable assert and watchdog property when fuzz testing (#3547) 2019-02-04 10:51:31 -08:00
erja-gp 392cfecff8 [qpg6095] add Qorvo QPG6095 platform (#3525) 2019-02-04 10:50:27 -08:00
Yakun Xu b79d5d6a92 [toranj] allow specifying wpantund path (#3544) 2019-02-01 22:13:25 -08:00
Yakun Xu 69aa5c4f04 [posix-app] add daemon mode (#3463)
This commit adds the daemon mode for POSIX CLI app. The daemon simply
receive UART input from a unix socket connection.
2019-02-01 22:05:59 -08:00
Yakun Xu e68e86317e [ci] test with time sync and header ie (#3514)
This commit adds the missing test with ie present by enabling TIME_SYNC
feature, so that IE code are covered.
2019-02-01 16:08:43 -08:00
Yakun Xu db67b3a980 [posix] fix build for SPI bus (#3546) 2019-02-01 10:01:41 -08:00
Łukasz Duda 66476070a5 [toolchain] define __COUNTER__ for keil compiler (#3545) 2019-02-01 09:26:33 -08:00
Jonathan Hui ac89fd5496 [style] return void where code always returns OT_ERROR_NONE (#3543) 2019-02-01 09:03:24 -08:00
Abtin Keshavarzian c7911adcb1 [mle] remove unused attach state kAttachStateSynchronize (#3542)
The attach state `kAttachStateSynchronize` was intended for sending
"Child Update Requests" after a reset (if device was previously
attached) using the `mAttachTimer` for retransmissions. However,
"Child Update" transmissions use `mMessageTransmissionTimer`
instead.
2019-02-01 09:03:10 -08:00
Yakun Xu 5b4e7f9331 [diag] check buffer size definition (#3541) 2019-01-31 13:04:46 -08:00
Abtin Keshavarzian 57e2f4e26d [mle] stop attach timer from SetStateChild() (#3538)
This commit changes `SetStateChild()` to stop `mAttachTimer`. This
ensures that as the `mAttachState` is set to idle, the attach timer is
also stopped (note that the attach timer callback asserts on idle
attach state). This addresses a rare issue where an inopportune device
mode change request on an already attached device while it is
performing periodic parent search (or possibly delaying processing of
a received announce) could cause an assert; `SetDeviceMode()` would
call `SetStateChild()` setting the attach state to idle while attach
timer would continue to run.
2019-01-31 13:03:02 -08:00
Abtin Keshavarzian 987ff3c017 [mle] change SetStateDetached()/SetStateChild() to be void (no return) (#3539) 2019-01-31 08:50:07 -08:00
Abtin Keshavarzian bd41c63a0a [mle] remove redundant mAttachTimer stop (#3537)
The call to `SetStateDetached()` will stop the attach timer.
2019-01-31 08:49:13 -08:00
Jonathan Hui 0e8967f5ed [fuzz] disable HDLC FCS check during fuzz tests (#3536) 2019-01-31 08:48:44 -08:00
Yakun Xu 8dcdc2cf31 [meshcop] border agent of native commissioner (#3535)
This commit enables a node serve as the border agent of native commissioner
by adding the border agent UDP port to unsecure port when the security
policy allows.

To fully test verify this commit, we need a native commissioner, which I
will submit a separate commit to enable that.
2019-01-31 08:48:27 -08:00
Jonathan Hui da12dca4d9 [cli] fix arg count checks in dataset command (#3533) 2019-01-30 08:47:53 -08:00
Jonathan Hui ba9709b674 [dtls] simplify dtls state machine (#3529)
This commit also adds checks to ensure there is only one outstanding
connection at a time.
2019-01-30 08:47:42 -08:00
Abtin Keshavarzian f9d757a161 [router-table] fix allocated router ids bit-vector size (#3534) 2019-01-29 19:09:25 -08:00
Abtin Keshavarzian 144270105d [router-table] add new methods to help iterate over router entries (#3527) 2019-01-29 12:12:56 -08:00
Abtin Keshavarzian e71bd6267e [test] fix PRETTY_FILES definition in unit test makefile (#3532)
The `test_string` source is also made "pretty".
2019-01-29 11:55:16 -08:00
Jonathan Hui 1c2e7033bf [cli] fix ping interval bounds check to avoid Timer::Start() assert (#3531) 2019-01-29 11:54:38 -08:00
Jonathan Hui 96076d3aa4 [coap] process Option Length = 0xf as a format error (#3530) 2019-01-29 08:55:59 -08:00
Jeff Bumgardner 3101ba7f0e [docs] Update README logo soup (#3528) 2019-01-29 08:54:50 -08:00
Yakun Xu 15d1603639 [build] clean up switches for POSIX platform (#3517) 2019-01-29 08:54:09 -08:00
Yakun Xu 504331eadd [mac] remove mDidTx from otRadioFrame (#3520)
mDidTx indicates whether a frame is received or transmitted, which is
only useful for capturing packets. This commit removes this field, and makes
this flag an argument to the pcap callback.
2019-01-28 12:31:15 -08:00
Yakun Xu 7789b90f23 [android] add missing OPENTHREAD_ENABLE_POSIX_APP (#3519) 2019-01-28 11:28:29 -08:00
Jiacheng Guo e893db15b5 [build] add platform udp build switch (#3450) 2019-01-28 10:43:34 -08:00
Yakun Xu 2146acbb18 [coap] make CoapBase::Send() private (#3526)
This commit makes `CoapBase::Send()` private so that only safe methods
are exposed, such as `SendMessage()`, `SendEmptyMessage()`, `SendAck()`.
2019-01-28 08:52:19 -08:00
rongli 47be103a62 [thci] update routerselectionjitter before start thread (#3524) 2019-01-28 08:41:14 -08:00
Jonathan Hui 251207d725 [cli] add lower bounds check to channel selection (#3523) 2019-01-28 08:39:18 -08:00
Jonathan Hui 70cb48f17a [ncp] resolve undefined shift in BorderRouterConfigToFlagByte (#3522) 2019-01-28 08:39:02 -08:00
Jonathan Hui f9659b3733 [router-table] add arg bounds check to Release() (#3521) 2019-01-28 08:38:42 -08:00
Jonathan Hui cb5e076a3e [cli] add length checks for "coaps set psk" (#3518) 2019-01-25 15:36:50 -08:00
Jonathan Hui cc26f1418e [network-data] resolve undefined shift in SetPreference() (#3503) 2019-01-25 15:10:26 -08:00
wgtdkp e341d02876 [meshcop] set message offset when sending JOIN_FIN.rsp (#3516) 2019-01-25 10:07:59 -08:00
Kamil Sroka eb4e460f9f [nordic] update nrfx to 1.6.0 (#3515) 2019-01-25 08:40:42 -08:00
Abtin Keshavarzian 6d0bce85a0 [thread-netif] change Up()/Down() to void (no return) (#3513) 2019-01-25 08:37:59 -08:00
Abtin Keshavarzian f13e35d5f7 [mesh-forwarder] change Start() and Stop() to be void (no error return) (#3509) 2019-01-25 08:36:30 -08:00
Jonathan Hui 249bc59874 [cli] add length check for "service add" (#3508) 2019-01-25 08:36:06 -08:00
Jonathan Hui 993f537a03 [cli] add ping interval bounds check to avoid Timer::Start() assert (#3507) 2019-01-25 08:35:44 -08:00
Jonathan Hui 560d9350b2 [emsk] set SETTINGS_CONFIG_PAGE_NUM = 2 (#3510) 2019-01-24 18:20:27 -08:00
Yakun Xu 5777e017ac [cli] refine CLI APIs (#3501) 2019-01-24 18:19:50 -08:00
Abtin Keshavarzian 0ac326ea57 [mac] update "out of band tx" to check current operation state (#3461)
This commit changes the `SendOutOfBandFrameRequest()` implementation
to check `mOperation` and `mPending<>` state variables to determine
if MAC layer is still busy with a previous OOB tx request (instead of
using the `mOobFrame` pointer variable). This change makes the OOB tx
implementation behave similarly to other APIs (e.g., `ActiveScan()`
or `SendFrameRequest()`). This commit also enhances the documentation
for the OOB Send APIs in header files.
2019-01-24 13:56:19 -08:00
Jonathan Hui b431bc34ce [network-data] avoid overflow in Service TLV length computation (#3506) 2019-01-24 09:06:36 -08:00
Jonathan Hui ce3c712fe6 [cli] validate prefix add/remove argument count (#3505) 2019-01-24 09:04:38 -08:00
Jonathan Hui c2a10ec446 [ip6] only allow external mcast addrs when iface is up (#3504) 2019-01-24 09:04:13 -08:00
Yakun Xu eeff2e225c [cli] move output format to server (#3502) 2019-01-24 09:02:23 -08:00
Jonathan Hui 65db853abc [nrf52840] fix build with DISABLE_BUILTIN_MBEDTLS=1 (#3497) 2019-01-24 09:01:11 -08:00
Jonathan Hui 4ca58d440d [cli-uart] save space for NULL terminator in rx buffer (#3500) 2019-01-23 21:50:56 -08:00
Jonathan Hui aa5673cd48 [cli] add bounds check on channel selection (#3499) 2019-01-23 21:50:38 -08:00
Yakun Xu 9094c12652 [code] add static assert (#3422) 2019-01-23 21:50:19 -08:00
Jonathan Hui a00c538830 [network-data] add prefix length checks (#3498) 2019-01-23 21:49:37 -08:00
Jeff Bumgardner 4bc819c307 [docs] Doxygen tag updates (#3496) 2019-01-23 14:28:40 -08:00
Jonathan Hui 0cc913b6b5 [network-data] add length checks to insert operations (#3495) 2019-01-23 10:16:48 -08:00
Yakun Xu 612d9de236 [posix] fix diagnostics for missing diag alarm (#3494)
This commit fixes a bug that `alarm.c` misses definition of
OPENTHREAD_ENABLE_DIAG for not including `openthread-core-config.h`.
This commit adds the `openthread-core-config.h` to every platform sources.

Also, this commit enhances the `test_diag.py` to make sure diag can send
packets out.
2019-01-23 08:49:27 -08:00
Jonathan Hui 2a14819996 [coap] return error if CoAP options exceeds message length (#3493) 2019-01-23 08:47:48 -08:00
Jonathan Hui 0c487ef140 [mle] do not add ip6 addrs in disabled state (#3492) 2019-01-23 08:47:31 -08:00
Yakun Xu d8c17ceef2 [posix-app] expose mainloop APIs (#3490) 2019-01-23 08:46:33 -08:00
Abtin Keshavarzian dde12296e5 [mac-frame] change const methods to return pointers to const (#3481)
This commit changes the `const` methods in `Mac::Frame` class
returning a pointer type to return a pointer to `const`. It also
changes the implementation of non-`const` methods (e.g., `GetPayload()`
and `GetFooter()`) to re-use the corresponding `const` methods.
2019-01-23 08:43:30 -08:00
Yakun Xu 3fabc4660c [slaac] handle slaac internally (#3484) 2019-01-22 23:34:26 -08:00
Yakun Xu 26c5d0ecb8 [border-agent] reuse Dtls restart (#3489)
`MeshCoP::Dtls` session will restart listening by itself. It's not
necessary for border agent to restart `MeshCoP::Dtls`.
2019-01-22 16:11:07 -08:00
Yakun Xu fe3d910853 [doc] add missing doc for datatset (#3487) 2019-01-22 16:08:33 -08:00
Robert Lubos 9cb48245e5 [cli] fix GetOwner function for console cli backend (#3486)
Current implementation of GetOwner function for single-instance CLI
assumed that `cli_uart` backend is used. This caused application
crash when different backend was used and `cli_uart` was not
initialized (and in result sUartServer static pointer was not set).

This commit fixes the issue by moving static CLI Server pointer and
the mInterpreter field to the to the base Server class and providing
getter method to obtain the Interpreter instance. With this approach,
any backend derived from the Server class will be able to initialize
the static pointer and will provide a valid reference to the
Interpreter class instance.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-22 16:07:46 -08:00
Yakun Xu b1686c61f4 [slaac] only create a single address for a prefix (#3485)
This commit changes the SLAAC policy so that if there is an existing address
with of a prefix, no new address will be created for this SLAAC enabled
prefix.
2019-01-22 09:15:02 -08:00
Abtin Keshavarzian 72aa8d0b3e [router-table] reuse const method GetRouter() in related non-const version (#3483) 2019-01-22 09:13:24 -08:00
Jonathan Hui f9eb4cb517 [fuzz] add CLI UART input to fuzz tests (#3482) 2019-01-22 09:07:13 -08:00
Jonathan Hui 061e54627c [cli] rename cli_udp_example to cli_udp (#3480) 2019-01-22 09:06:10 -08:00
Abtin Keshavarzian 5e50914f1f [mle] simplify Start() (#3472)
This commit simplifies the `Mle::Start()` by combining its parameters.
With the new definition `Start()` would always try to reattach using
any saved active/pending dataset unless it is asked to attach on an
announced network (i.e., `aAnnounceAttach` is `true`).
2019-01-22 09:05:50 -08:00
Yakun Xu f40f49ff32 [dhcp] remove dhcp server api (#3476) 2019-01-18 11:34:40 -08:00
Yakun Xu 820d231067 [cli] cleanup dataset implementation (#3474) 2019-01-18 11:32:36 -08:00
Jonathan Hui f4c10c0ae1 [cli] cleanup CoAP example (#3470) 2019-01-18 11:30:32 -08:00
Yakun Xu d57b747c98 [udp] expose UDP receiver API (#3477) 2019-01-18 06:50:39 -08:00
Yakun Xu 8112a6376f [cli] remove cli udp (#3473) 2019-01-18 06:08:52 -08:00
Abtin Keshavarzian d393f08b6f [ncp-base] define ResponseType for queued spinel response entries (#3471) 2019-01-18 06:05:13 -08:00
Zhanglong Xia eb7a910638 [efr32] add support for OQPSK modulation in 915MHz band (#3315) 2019-01-18 05:43:51 -08:00
Jonathan Hui b25e0bb4c8 [coap] add NULL check in Message::Clone() (#3469) 2019-01-17 07:33:02 -08:00
Yakun Xu e45107dac7 [code-utils] fix wrong pointer size in otALIGN (#3468) 2019-01-17 02:59:32 -08:00
Yakun Xu 16c904955a [test] fix on macOS (#3467) 2019-01-17 02:58:35 -08:00
Yakun Xu 0ace247e41 [android] disable warning no virtual destructor (#3466)
Change-Id: Ib1e28d064886af3cc5103395c284d772b3c85504
2019-01-17 02:54:43 -08:00
Jonathan Hui 15b6bf316b [travis] add arm gcc 8 to build tests (#3465) 2019-01-17 02:53:12 -08:00
Jonathan Hui b268171278 [coap] change assert to avoid index out-of-bounds warning (#3464) 2019-01-17 02:52:37 -08:00
Jonathan Hui 28582ef038 [coap] return error if CoAP header exceeds message length (#3462) 2019-01-16 05:57:02 -08:00
Kamil Sroka 57a0fda5da [sntp] fix Keil build with SNTP_CLIENT=1 (#3460) 2019-01-16 00:17:32 -08:00
Jonathan Hui 803168cf5a [spinel] add bounds checks when decoding uint (#3459) 2019-01-16 00:16:58 -08:00
Jonathan Hui 107a4a2b43 [docker] add wpantund and toranj support (#3454) 2019-01-16 00:16:38 -08:00
Abtin Keshavarzian a8010052bb [spinel] add documentation for spinel properties (#3446) 2019-01-16 00:16:23 -08:00
Yakun Xu 4245f6c420 [coap] refine CoAP classes (#3434)
Currently Coap::Receive and CoapSecure::Receive process different
messages. The former CoAP payload, while the latter DTLS payload.
This commit tries to reduce the confusion so that Coap*::Receive always
processes CoAP messages, just like Coap*::Send. With this commit,
CoapBase handles pure CoAP messages without knowledge of the
underlying transport. And the transport layer can also do its job without
processing CoAP message.

Also, this commit also removes virtual methods from Coap::*.

And here are the changes:

* UdpSocket is moved into sub-classes instead of the base class.
* CoapBase::Receive is now non-virtual method.
* CaopBase::Send is now non-virtual method, replaced by a function
pointer of sub-class of CoapBase.

And the new class relationship is as follows:

```
CoAP layer:              CoapBase
                           / \
                          /   \
                         /     \
Transport Layer:      Coap  CoapSecure

```
2019-01-16 00:15:51 -08:00
Yakun Xu 5eee323b8d [coap] process CoAP header in message (#3419)
This commit refines Coap::Header into Coap::Message to avoid declaring
the big Coap::Header in stack which was causing problems in low-memory
systems such as CC2538.

A UDP reserves 56 bytes by default, which will not be used before an
outbound message goes down to transport layer and after an inbound
message is delievered to CoAP agent. To get better performance, this commit
utilizes these reserved bytes of cache basic header of CoAP message
including CoAP version, code, message ID and token. These cached data
are parsed when CoAP agent receives a CoAP message and are dumped into
the correct place of a CoAP Message before sending by lower layer.

To make sure there is enough reserved bytes for an inbound message, This
commit removes headers in UDP layer before delivering a ot::Message to
handlers.
2019-01-15 05:00:21 -08:00
Jiacheng Guo 1f6d7c8b3b [uart] add lock interface for uart (#3380) 2019-01-15 01:28:33 -08:00
Yakun Xu 0f4bae97e9 [message] add const to read APIs (#3458) 2019-01-14 13:53:20 -08:00
Jonathan Hui 64e62a5314 [fuzz] add NCP UART input to fuzz tests (#3456) 2019-01-14 13:52:17 -08:00
Abtin Keshavarzian 59385b188b [network-data] use enumeration Type for local vs leader (#3455)
This commit changes `NetworkData` to use an enumeration `Type` to
specify whether a `NetworkData` instance represents local network
data or leader network data.
2019-01-14 13:51:50 -08:00
Abtin Keshavarzian 2057a141ef [router-table] rename loop variables in UpdateAllocation() (#3453) 2019-01-11 09:03:42 -08:00
Jonathan Hui 1056c7c93a [style] fix typos (#3451) 2019-01-11 09:03:10 -08:00
Irving-cl f5c49e2dd0 [tests] fix mac key id mode parsing (#3448) 2019-01-11 09:02:52 -08:00
Łukasz Duda 880ecfd749 [docs] fix invalid TODO comment (#3452) 2019-01-10 13:49:12 -08:00
wacmac 103a9db541 [harness-automation] update device category (#3449) 2019-01-10 08:55:39 -08:00
Piotr Szkotak cc0bcd3d68 [nrf52840] do not include libjlinkrtt in the SDK version of OT libs (#3445)
Signed-off-by: Szkotak, Piotr <Piotr.Szkotak@nordicsemi.no>
2019-01-09 15:49:47 -08:00
mateusz- 6d30288d77 [dtls] handle MBEDTLS_ERR_SSL_WANT_READ during send (#3444) 2019-01-09 15:48:50 -08:00
Kamil Sroka 8c793427a3 [nrf52840] fix build with COAPS=1 and SNTP_CLIENT=1 (#3440) 2019-01-09 14:33:58 -08:00
Abtin Keshavarzian a2a9d6502e [mac] simplify the check for frame pending in data request ack (#3438) 2019-01-09 14:33:22 -08:00
Jonathan Hui b6065c0fc1 [dhcp6] use EUI-64 in Client and Server Identifier (#3443) 2019-01-09 09:50:35 -08:00
Abtin Keshavarzian bf48a647b3 [mac] stop timer on pending WaitingForData operation on rx-on-idle change (#3437)
This commit changes `SetRxOnWhenIdle()` to stop the timer (data poll
timeout) if there is a pending `kOperationWaitingForData` when rx-on-
when-idle is being enabled. This addresses an issue where the timer
could remain active if the `SetRxOnwhenIdle(true)` is called before
the operation `kOperationWaitingForData` actually starts. Note that
the data poll timeout timer gets started while current operation is
`kOperationTransmitData` (from `HandleTransmitDone()` on a successful
data request frame transmission with a received ack indicating a
pending frame).
2019-01-09 09:43:51 -08:00
Yakun Xu eb8c6d90bd [diag] quick fix to support long output (#3436)
`Cli::Uart::OutputFormat()` current only supports output
`OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH` bytes, which isn't enough
for command *diag* by default. This PR removes that restriction
by using `Cli::Uart::Output`.

I think this is just a quick fix, an overall enhancement of Cli is
needed so that we can use small stack size but also get better
performance.
2019-01-09 09:43:14 -08:00
Yakun Xu 3018886993 [windows] fix warnings (#3435) 2019-01-07 09:04:50 -08:00
Jonathan Hui dfd2b9b032 [api] fix typos (#3431) 2019-01-07 09:03:55 -08:00
Yakun Xu a42efee470 [script] add script to run cert tests (#3397) 2019-01-07 09:03:36 -08:00
Kamil Sroka 1b4d05ee37 [nrf52840] increase max children count (#3433) 2019-01-04 08:47:28 -08:00
Kamil Sroka 979b50522d [nrf52840] update nRF52840 radio driver to version 1.2.3 (#3432) 2019-01-04 08:45:41 -08:00
Jonathan Hui 7554e344ce [test-driver] update README.md format (#3430) 2019-01-04 08:42:03 -08:00
Jonathan Hui e2056e0927 [nlbuild-autotools] update to 1.6.5 (#3429) 2019-01-04 08:41:38 -08:00
Jonathan Hui 84cb1e0d14 Merge commit '978a3f4d0664c483dbcf93a176353e4cb5f93aea' into nlbuild-autotools 2019-01-03 19:00:11 +00:00
Jonathan Hui 978a3f4d06 Squashed 'third_party/nlbuild-autotools/repo/' changes from ac728423..75faaf5f
75faaf5f Addressed an issue in which the failure to make the 'repos-warning' target order-only caused dependent repo paths to be repeatedly and unnecessarily remade which, in turn, caused git operations and the configuration or build to fail.
1d4fff8c Merge pull request #16 from nestlabs/feature/repos-with-clone
7233d998 Added support for pulling down remote package dependencies using git clone (default) or git submodule depending on the setting of pull.method in repos.conf.
1debcf62 Added support for coverage-local and check-local targets.
4699860c Merge pull request #15 from nestlabs/feature/check-coverage-local
79923820 Added support for coverage-local and check-local targets. Added documentation for all coverage-related targets.
d46f42a9 Addressed a spelling typo identified during code review.
b6a6c1ac Take a different approach to version flapping against 'make distcheck' by leaving VERSION_FILE as an immediate (:=) variable and instead creating a two-level <PACKAGE>_VERSION variable, the first of which is set from VERSION_FILE by default at make recursion level zero (0).
bf97ef6e Address an issue with VERSION_FILE on clean source code control clones or unarchived distribution in which 'make dist' or 'make distcheck' fail. VERSION_FILE should be and is intentionally a deferred (=) rather than an immediate (:=) variable to ensure late evaluation AFTER .local-version MAY be created rather than when the makefile containing it is parsed.
ae96d615 Fixed a typo.
74c4da2c Added support to repos.conf for a 'commit' key such that a hash or tag other than HEAD for a given repository and branch may be synchronized and checked out.
0d8afe93 When the verbose flag is asserted, prnt out the actual series of action commands that will be invoked.
8663c890 * Address a number of issues with building the prepackaged GNU   autotools subset included in nlbuild-autotools for Ubuntu   Bionic.
f2cdbac1 Add support, if necessary, for patching an expanded package.
35a238ed Only attempt to remove libtoolize if the effective user id matches that of the user executing the script.
7a899e8f Update the default version and change log for 1.5.2 and related changes.
48564b57 Since the '--name-only' option only appears in git-2.6 and later and there are production systems using git version as old as git-1.9, do not use '--name-only'.
7479acdf Fix a comment typo.
6c647b1d White space consistency clean-up.
60f989ea Incorporated a formatting suggestion from code review.
638a0c08 Fixed a typo.
33e0c7fc Addressed a number of typos and grammatical errors in comments and help output.
412d0e50 Fixed a typo.
4063134b Merge branch 'master' of github.com:nestlabs/nlbuild-autotools
4946bd54 Updated the date for 1.5.0.
90743059 Added a populate command for 'repos.conf'.
9bbf84f5 Added boilerplate examples for remote repository integration that package integrators can uncomment, adapt, or delete.
7418afd3 Initial revision.
0f9f1217 Ensure 'rm' explicitly includes -f should 'MAKEFLAGS' with '-R' be asserted in the environment.
2e6471f9 Add another clarifying example of building package-local tools from an integrated project.
bad99a91 Added content for and updated default version to 1.5.0.
b556c134 Added support for pulling down remote package dependencies using git submodule.
b9c6ca41 Restore prior change introduced at b07c9c034bc039f41336f447b55a4640c466d2bc.
e05e4fc4 Added a populate command to add 'Makefile-bootstrap' to the project top-level directory.
8ba67ce3 Added a populate command to add 'Makefile-bootstrap' to the project top-level directory.

git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: 75faaf5f7b87cdd15c5d78ec61e8327e551a2a79
2019-01-03 18:54:49 +00:00
Kamil Sroka 380be9610c [nrf52840] fix build with IAR (#3428) 2019-01-03 10:27:38 -08:00
Jonathan Hui 27aecfec5b [posix-app] resolve "implicit conversion changes" warnings (#3426) 2019-01-03 09:20:15 -08:00
Abtin Keshavarzian ba1d46035b [mac] post operation task on rx-on-idle mode change (#3425)
The `SetRxOnWhenIdle()` is changed such that if it needs to stop
operation `WaitingForData`, the next operation gets started from
the `mOperationTask` tasklet. This change makes the behavior of
the `SetRxOnWhenIdle()`  consistent with other MAC APIs (i.e.,
new operations are started only from tasklet or from a radio/timer
callback and not from any MAC APIs). This commit also updates the
`HandleTimer()` to check for operation being `kOperationIdle` when
timer is used for delaying sleep.
2019-01-03 09:19:50 -08:00
Jonathan Hui 0cd21d8d3f [border-agent] check if TLV is valid after reading (#3424) 2019-01-03 09:16:54 -08:00
Zhanglong Xia 0e42d0b8c9 [mac] remove redundant checks (#3408) 2019-01-03 09:16:04 -08:00
Yakun Xu 2a9f8797f7 [posix-app] integrate with platform network interface (#3180) 2019-01-03 09:13:29 -08:00
Yakun Xu ae2b01947d [android] disable UART echo (#3421) 2019-01-02 10:34:46 -08:00
Abtin Keshavarzian 42c46368f1 [docs] fix typos in comments (#3417) 2019-01-02 10:24:08 -08:00
Abtin Keshavarzian 49945221dd [ncp-base] add IgnoreReturnValue when error should be ignored (#3415)
This change adds `IgnoreReturnValue` when the returned error can be
safely ignored. This should help address a Coverity warning.
2019-01-02 09:04:42 -08:00
Abtin Keshavarzian 041c14080a [core] use 1UL instead of 1U when working with uint32_t (#3411)
This commit replaces `1U` constants with `1UL` in bit shift
statements like `1U << shift` when dealing with a variable shift
value that can be larger than 15. This helps make it explicit to the
complier that the constant should be considered as a `uint32_t`.
2019-01-02 09:03:52 -08:00
Abtin Keshavarzian 3a6c5de3da [mle] avoid "1U << 32" when calculating attach start delay backoff (#3410)
This change avoids the use of (potentially) undefined "1U << 32"
when calculating the backoff delay for attach re-attempt in MLE.
Credit for this bug goes to Coverity.
2019-01-02 09:02:40 -08:00
Yakun Xu cdf0b7785d [mbedtls] free mbedtls on initialization failure (#3409) 2019-01-02 09:01:39 -08:00
Jiacheng Guo 08bb4ace81 [posix-app] do nothing if select interrupted with no available fds (#3406) 2019-01-02 08:59:52 -08:00
Yakun Xu e0c802569e [meshcop] correct UDP_PROXY in script and doc (#3420) 2018-12-29 12:45:41 -08:00
wgtdkp 3f6d50a728 [tests] enhance Cert_7_1_03_BorderRouterAsLeader (#3399) 2018-12-29 11:25:39 -08:00
Irving-cl d34f279e5a [tests] enhance Cert_6_1_02_REEDAttach_MED/SED (#3387) 2018-12-29 09:50:12 -08:00
Jonathan Hui 08247dc92f [message] avoid length overflow in SetLength() (#3418)
Credit to OSS-Fuzz.
2018-12-28 17:27:25 -08:00
Abtin Keshavarzian 4b1070444d [border-agent] check read UdpEncapsulationTlv length (#3414)
This commit verifies that the read length of `UdpEncapsulationTlv`
from a message is valid before processing it. Credit to Coverity.
2018-12-28 17:12:09 -08:00
Abtin Keshavarzian aabcd38db5 [socket] use "this" pointer in memset while initialization SockAddr (#3413)
This change helps address a coverity warning (about memory overrun).
2018-12-28 17:11:44 -08:00
Abtin Keshavarzian e5947b5e23 [udp6] init member variable from constructor (#3412)
This commit initializes `mUdpForwarder` and `mUdpForwarderContext`
from `Udp::Udp` class constructor. Credit to coverity.
2018-12-28 17:11:24 -08:00
Yakun Xu 97ace18c17 [udp] call at most one handler (#3398) 2018-12-28 17:09:19 -08:00
rongli 328239878d [data-poll-manager] check user-specified poll period (#3401) 2018-12-27 22:35:57 -08:00
Abtin Keshavarzian 3fb736c566 [ncp-base] limit legacy related member variable definitions to FTD/MTD builds (#3407)
This commit moves the definition of legacy related member variable
in `NcpBase` into a `#if OPENTHREAD_MTD || OPENTHREAD_FTD` block.
This addresses Coverity warning for un-initialized member variables
from constructor.
2018-12-27 16:30:32 -08:00
Jiacheng Guo 0fbb0e6310 [posix-app] enhance build switches (#3404) 2018-12-27 15:59:55 -08:00
Yakun Xu 99c753a6ad [message] allocate message with corresponding component (#3403) 2018-12-27 15:55:16 -08:00
Jiacheng Guo 0e31b0d617 [nrf52840] allow change state handler config in command line (#3402) 2018-12-27 15:51:15 -08:00
Jonathan Hui 4ababdce2d [bootstrap] install arm gcc toolchain on Raspbian (#3392) 2018-12-27 15:44:26 -08:00
Jing eca3e81fd3 [thci] update pollperiod command to accept ms resolution configuration (#3361) 2018-12-27 15:39:46 -08:00
Abtin Keshavarzian 7dc645a856 [hdlc] report frames smaller than FCS size as error frame (#3395)
This commit changes the `Hdlc::Decoder` implementation to report
non-zero length received frames shorter than FCS size as an error
`OT_ERROR_PARSE` (instead of ignoring such frames during decoding).
Since the recent changes in `Hdlc::Decoder` buffer model delegates
the management of the frame buffer to the user of `Decoder`,
clearing frame buffer after an error should be be performed by the
`Decoder` user from the `FrameHandler` callback. The change in this
commit addresses an issue where a small (single-byte) frame would
not have been cleared from the decoder buffer and included in the
next frame. This commit also updates the `test_hdlc` unit test to
cover small frame error.
2018-12-24 15:12:16 -08:00
Jiacheng Guo 52c06c6858 [build] option to disable executable build (#3391) 2018-12-24 15:10:30 -08:00
wgtdkp 35eaaab653 [tests] enhance Cert_5_1_06_RemoveRouterId (#3379) 2018-12-24 15:08:47 -08:00
Abtin Keshavarzian 3108b6a615 [posix-app] discard received HDLC frame on error (#3394)
This commit changes the `HdlcInterface::HandleHdlcFrame()` callback
which handles a received and decoded HDLC frame such that it
discards a bad/incorrect frame from the multi frame buffer (i.e,
discard the frame on any error).
2018-12-22 08:39:39 -08:00
Yakun Xu f2e3555a2a [posix-app] simplify UART on POSIX app (#3384) 2018-12-21 14:35:24 -08:00
Abtin Keshavarzian 34004c2c57 [posix-app] adopt new HDLC buffer models (#3371)
This commit updates the `HdlcInterface` and `RadioSpinel` to use the
new HDLC buffer model. In particular, for received spinel frames the
decoder uses an `Hdlc::MultiFrameBuffer` which is capable of storing
multiple frames in a FIFO queue manner.

With this model, the received and decoded spinel frames are directly
placed in the FIFO buffer. This allows `RadioSpinel` code during
`WaitResponse()` (when waiting for specific Spinel response frame) to
simply save/keep a notification frame in the queue buffer (without
requiring to copy the frame) so that it can read and process the
saved frame later. If a received frame can be processed at the time,
the frame is then simply discarded from the queue buffer.
2018-12-21 14:33:35 -08:00
Abtin Keshavarzian e96cc1b367 [hdlc] update buffer model for Encoder and Decoder (#3371)
This commit updates HDLC implementation to harmonize the buffer model
used by `Hdlc::Encoder` and `Hdlc::Decoder`.

The new model defines a common class `Hdlc::FrameWritePointer` which
provides a minimum set of APIs used by `Encoder/Decoder` for writing
frames, while not defining the underlying buffer space or how the
buffer is managed. `Encoder` or `Decoder` users are expected to use
sub-classes of `FrameWritePointer` to add the buffer space and
implement the frame buffer management scheme.

Two sub-classes `Hdlc::FrameBuffer` and `Hdlc::MultiFrameBuffer` are
also provided which respectively allow storing a single frame or
multiple frames (FIFO queue of frames) in a buffer of given size.

This commit also updates the `NcpUart` code to use the new buffer
model.

Finally, this commit adds an HDLC unit test `test_hdlc.cpp` which
covers the following:

- Verify behavior of `Hdlc::FrameBuffer` (single frame buffer),
- Verify behavior of `Hdlc::MultiFrameBuffer` (FIFO queue),
- Verify behavior of `Hdlc::Encoder` and `Hdlc::Decoder`,
- Test encoder/decoder with randomly generated frames (fuzz test).
2018-12-21 14:33:35 -08:00
Jiacheng Guo 71ef316bbd [mbedtls] build switch to disable mbedtls in makefile (#3389) 2018-12-21 09:32:57 -08:00
Jeff Bumgardner 782597fe1a [docs] Doxygen fix and efr32 README update (#3393) 2018-12-21 09:23:38 -08:00
Kamil Sroka 0724ce514d [nrf52840] fix build with ECDSA=1 (#3388) 2018-12-20 09:11:56 -08:00
Zhanglong Xia 19f2533aff [qos] handle NCP messages based on the priority of the message (#3318) 2018-12-19 13:55:26 -08:00
Zhanglong Xia 4ed2c8c222 [qos] forward messages based on the priority of the message (#3317) 2018-12-19 11:28:34 -08:00
Abtin Keshavarzian f4f92ab3a8 [ncp-base] remove unused method definitions from NcpBase class (#3386) 2018-12-18 15:27:45 -08:00
Rongli Sun a7f4283e5d [cc2538] add 1K stack space (#3385)
In the observed deepest CoAP process when handling JOIN_FIN, the large
local variables in the nested calls may take up to 2.5K, among with
the three local CoAP headers would add about extra 1K since #3210 which
increases CoAP header from 128 to 512.

This commit adjusts stack to be of 5K by increasing 1K to help commissioning
process goes correctly.
2018-12-18 09:29:39 -08:00
Rongli Sun 3e1b9aacb7 [coap] reduce stack occupation (#3385)
In #3210, CoAP header is increased from 128 to 512. Multiple
local CoAP header variables are declared in nested calls during
CoAP process, easily causing limited stack space overflow.

This commit tries to reuse existing local header variable to
reduce stack usage.
2018-12-18 09:29:39 -08:00
Jonathan Hui 2a75d30684 [docker] move dev environment setup to "Script to rule them all" (#3383) 2018-12-17 09:29:23 -08:00
Jonathan Hui 5b0ba23c10 [ecdsa] fix -Wimplicit-int-conversion warnings (#3382) 2018-12-17 09:28:43 -08:00
Abtin Keshavarzian 4e331fec9b [link-raw] update logs (#3373)
This commit changes the logs from `LinkRaw` class. With this change
the logs use debug log level and MAC log region. This change helps
reduce the spinel log traffic from RCP (NCP in radio-only mode).
2018-12-17 09:27:00 -08:00
Abtin Keshavarzian c482301ec7 [coap] remove Coap sub-classes (#3364)
This commit simplifies the COAP modules by renaming `CoapBase` to
`Coap` and removing the now unnecessary sub-classes `ApplicationCoap`
and `ApplicationCoapSecure`.
2018-12-14 12:20:59 -08:00
Abtin Keshavarzian 2610b9d5e0 [coap] update Coap/CoapSecure to use Context tracking Timer/Tasklet (#3364)
This commit simplifies `ResponseQueue`, `CoapBase`, `CoapSecure` to
use `TimerMilliContext` and `TaskeltContext`. This change removes
the need for sub-classes to provide the timer and tasklet callback
handlers.
2018-12-14 12:20:59 -08:00
Abtin Keshavarzian 8d4b424418 [tasklet] adding TaskletContext class (#3364)
This commit adds a new class `TaskletContext` which is a `Taskelt`
that also maintains a user context pointer.
2018-12-14 12:20:59 -08:00
Abtin Keshavarzian 1171a32a8c [timer] adding TimerMilliContext class (#3364)
This commit adds a new class `TimerMilliContext` which is a
millisecond timer that also maintains a user context pointer.
2018-12-14 12:20:59 -08:00
Abtin Keshavarzian 200b3dabcf [mle-router] stop mStateUpdateTimer on mode change (#3376)
This commit ensures to not re-start the `mStateUpdateTimer` from its
callback, when router role is disabled. This addresses the issue where
a mode change (disabling router role) could cause the timer to
continue to fire indefinitely, further causing device to attempt to
reattach from each timer callback.

Thanks to Conor O'Neill (@conormoneill) for discovering and debugging
this issue.
2018-12-14 11:21:55 -08:00
Zhanglong Xia 4279dbc14c [efr32] add support for RTT log (#3285) 2018-12-14 09:25:41 -08:00
Jonathan Hui ff0b30db55 [mle] limit number of child-router links a REED / FED maintains (#3358) 2018-12-13 10:44:30 -08:00
Jonathan Hui ce7b65e117 [tests] update 5.2.7 to not require Link Accept from DUT_ROUTER (#3358) 2018-12-13 10:44:30 -08:00
Abtin Keshavarzian 50fad599fa [link-raw] update to use Mac::Address to reverse extended address (#3377) 2018-12-13 09:04:12 -08:00
Abtin Keshavarzian cae23fd36c [src-match-controller] update to use Mac::Address (#3375)
This commit changes/simplifies the `SourceMatchController` class to
use the `Mac::Address` class API to reverse an extended address
when adding/clearing an address.
2018-12-13 09:03:17 -08:00
Abtin Keshavarzian 6d1c3b9e1d [mac] remove unused method definitions (#3374)
This class removes unused method definitions in `Mac` class. Note
that these methods are now provided and used in `SubMac`.
2018-12-13 09:02:29 -08:00
Yakun Xu cc10b31b9a [nrf52840] only enable ecdsa when OpenThread configures (#3370) 2018-12-13 09:01:52 -08:00
Abtin Keshavarzian cf841b1b71 [mesh-forwarder] fix double logging msg tx to non-sleepy child (#3368)
This commit moves the logging of a message transmission status and
updating of the counters in `MeshForwarder::HandleSentFrameToChild()`
inside an `if` block checking for the message to be indirect. This
change addresses an issue where message transmissions to a non-sleepy
child could be logged and counted twice from both `HandleSentFrame()`
and `HandleSentFrameToChild()`.
2018-12-13 09:00:37 -08:00
Yakun Xu de63012c9e [dhcp6-client] remove dhcp6 client api (#3287) 2018-12-12 09:58:15 -08:00
Łukasz Duda d369956d42 [ecdsa] do not free mpi context before initializing it (#3366) 2018-12-11 22:30:07 -08:00
Yakun Xu c281f284ff [cli] add an API to write string to UART (#3365) 2018-12-11 22:00:30 -08:00
Jonathan Hui edb7982f02 [bootstrap] add -y option to apt-get install (#3356) 2018-12-10 11:43:13 -08:00
Zhanglong Xia c3a0898e74 [mle] simplify the channel mask (#3349) 2018-12-10 11:42:53 -08:00
Abtin Keshavarzian f189cafcc7 [spinel] add capability definitions for FTD, MTD, RADIO configuration (#3357)
This commit adds new spinel capability definitions to specify the
FTD, MTD or RADIO build configurations. Depending on the OpenThread
build configurations the corresponding capability is included in
`SPINEL_PROP_CAPS` list.
2018-12-07 09:02:05 -08:00
Jonathan Hui c06179938c [examples] always build examples/platforms/utils (#3355) 2018-12-07 08:39:35 -08:00
Yakun Xu 04860bf422 [spi-hdlc-adapter] make pretty spi-hdlc-adapter (#3341) 2018-12-06 13:22:35 -08:00
Jonathan Hui 545ccd8dc8 [network-data] retrieve network data when restoring as leader (#3354)
The leader does not maintain network data in non-volatile memeory. As a
result, it is necessary for a recently-restored leader to obtain network
data from a neighboring device.
2018-12-06 08:49:17 -08:00
Łukasz Duda 6023df3a3f [network-data] synchronize 6LoWPAN Contexts after Leader is reset (#3353) 2018-12-06 08:48:15 -08:00
Yakun Xu 7b160157f8 [posix-app] eliminate unnecessary transactions with radio (#3350) 2018-12-05 17:52:26 -08:00
Yakun Xu dd4025ebb0 [android] build spi-hdlc-adapter in OpenThread (#3342) 2018-12-05 17:51:00 -08:00
Jonathan Hui 10897d3e97 [link] move otLinkSetShortAddress() decl to link_raw.h (#3348) 2018-12-05 05:49:13 -08:00
Yakun Xu 4c783e5584 [android] fix untracked pid in Android (#3343) 2018-12-04 14:38:55 -08:00
Jeff Bumgardner b61be18e37 [docs] added new Dockerfiles (#3347) 2018-12-04 13:19:38 -08:00
Jonathan Hui cc7cf137d6 [mbedtls] update to 2.14.0 (#3338) 2018-12-04 09:03:19 -08:00
Jonathan Hui a849306cf6 [mbedtls] update README (#3338) 2018-12-03 21:30:51 -08:00
Jonathan Hui f9b202998b [mbedtls] update mbedtls-config.h to fix build (#3338)
- Add stdio.h for snprintf.

- When `MBEDTLS_ECP_ALT` is defined, need to define mbedtls_ecp_restart_ctx
for build to succeed.
2018-12-03 21:30:36 -08:00
rongli 1253becb72 [meshcop] support operational dataset operations for MTD (#3339)
- This commit unties operational dataset operations from `OPENTHREAD_FTD` option.
- This commit also updates THCI for MTD certification
2018-12-03 21:28:09 -08:00
Hubert Miś 898ba45b0f [ip6] prefer ML-EID as realm-local scope source address (#3284) 2018-12-03 21:22:19 -08:00
Yakun Xu 22d6d1abf0 [android] correct version on android (#3340) 2018-12-03 09:24:22 -08:00
Matt Smith f58b8627b6 [logging] add initial log level config option (#3337)
Add OPENTHREAD_CONFIG_INTIIAL_LOG_LEVEL config setting to enable
starting OpenThread with a lower log level that the maximum compile-time
setting. Useful when OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL is
defined to 1.
2018-12-03 09:10:33 -08:00
Piotr Szkotak 6e25f6f15d [nrf52840] add support for the USB DFU software trigger (#3312) 2018-12-03 09:09:53 -08:00
Abtin Keshavarzian cc1c1a61ac [notifier] update changed flags logging to use multiple lines (#3336)
This commit changes `Notifier::LogChangedFlags()` to allow it to
use multiple lines when there are multiple flags.
2018-12-01 08:22:30 -08:00
Abtin Keshavarzian cd1e417750 [notifier] add strings for newly added OT_CHANGED flags in FlagToString (#3335) 2018-12-01 08:21:33 -08:00
Abtin Keshavarzian 5783c5c4b4 [toranj] adding test-028 for sequential router leader reset recovery (#3334) 2018-11-30 12:27:41 -08:00
Abtin Keshavarzian 305330114a [mle] clear router table before processing RouteTlv (#3334)
This commit removes the call to clear the `mRouterTable` from
`SetStateRouter()` and instead performs it before processing of a
received RouteTlv (before `ProcessRouteTlv()`). This ensures that
router table and router id allocation list are not deleted after a
router node reset recovery.

This change addresses a rare subtle issue where if a router node and a
leader node are reset sequentially within a short time interval, the
router node upon reset can delete the router id allocation list
(RouteTlv) which in turn causes the leader to ignore "MLE Link Accept"
message it receives from router (after leader resets and tries to
recover) and thus cause the leader to form a new partition. This can
potentially lead to a situation where the two nodes stay in two
partitions without merging.
2018-11-30 12:27:41 -08:00
Jonathan Hui 8ad315f725 [mle] print partition id as unsigned int (#3333)
Print partition id as unsigned int to be consistent with all other prints
of partition id.
2018-11-30 10:50:17 -08:00
Jing 6b01499e83 [thci] pass the channel mask as a comma separated channel string (#3321) 2018-11-29 08:53:19 -08:00
Piotr Szkotak a4670d6747 [nrf52840] update softdevice headers to version 6.1.1 (#3332) 2018-11-28 11:35:13 -08:00
Łukasz Duda 9e5df47e61 [nrf52840] make sure nrf_mbr.h is in include path (#3330) 2018-11-28 11:34:19 -08:00
Shu Chen e531b267b9 [android] fix a typo in Android.mk (#3329) 2018-11-28 10:11:52 -08:00
Yakun Xu fc95d5303a [meshcop] initialize commissioner ALOC (#3328) 2018-11-28 10:11:27 -08:00
hjian2017 88c8ed05eb [meshcop] simplify msg copy (#3327) 2018-11-28 10:10:51 -08:00
Abtin Keshavarzian 8d12513591 [mac] adding sub-MAC layer (#3262)
This commit introduces sub-MAC layer (class `Mac::SubMac`) in
OpenThread implementing a subset of IEEE802.15.4 MAC primitives which
are shared by both MAC layer (in FTD/MTD modes) and Raw Link (Radio
only mode).

The sub-MAC layer handles the following (if not provided by radio
platform):

  - Ack timeout for frame transmission,
  - CSMA backoff logic,
  - Frame re-transmissions,
  - Energy scan on a single channel and RSSI sampling.

It also act as the interface (to radio platform) for setting/getting
radio configurations such as short or extended addresses and PAN Id.

In addition, this commit contains following improvements in `Mac`:
- The implementation of `STAY_AWAKE_BETWEEN_FRAGMENTS` (delay sleep)
  feature is simplified by adding a new state variable tracking if
  sleep is being delayed and canceling sleep delay on start of any
  operation.
- Member variables in `Mac` class are re-ordered to avoid alignment
  gaps.
- `Mac` timers are combined into one which is used for Active Scan,
  Data Poll timeout, and delaying sleep.
2018-11-28 10:09:35 -08:00
Jonathan Hui 94dc2c0949 Merge commit '0b6efe3e561bd8654258f97321296be4c147cb22' into mbedtls 2018-11-27 16:04:59 -08:00
Jonathan Hui 0b6efe3e56 Squashed 'third_party/mbedtls/repo/' changes from 76dc065..f00d4be
556d7d9 Merge pull request #532 from sbutcher-arm/version-2.14.0
c1b9892 Update library version number to 2.14.0
b35e59d Refine the language in the ChangeLog
681edee Fix language and formatting in ChangeLog
06d80cf Fix merge of Changelog 128bit CTR_DRBG entry
de13963 Merge remote-tracking branch 'restricted/pr/520' into development-restricted-proposed
cdd1a6c Merge remote-tracking branch 'restricted/pr/510' into development-restricted-proposed
2ab14bb Clarified new platform errors in the ChangeLog
e51d4b3 Merge remote-tracking branch 'public/pr/2054' into development-proposed
6aa9fb4 Add ChangeLog entry
9924bdc Deprecate hardware acceleration errors
bcca58c Add common feature unavailable error
d83448b Merge remote-tracking branch 'public/pr/2052' into development-restricted-proposed
53b45ec Merge remote-tracking branch 'public/pr/2079' into development-restricted-proposed
bbc31b4 Merge remote-tracking branch 'public/pr/2085' into development-restricted-proposed
93a9b49 Merge remote-tracking branch 'public/pr/2077' into development-restricted-proposed
361ce6c Merge remote-tracking branch 'public/pr/2127' into development-restricted-proposed
c818131 Merge remote-tracking branch 'public/pr/2140' into development-restricted-proposed
241823a Merge remote-tracking branch 'public/pr/1641' into development-restricted-proposed
42ab4ae Merge remote-tracking branch 'public/pr/2167' into development-restricted-proposed
51b6abb Merge remote-tracking branch 'public/pr/2165' into development-proposed
f143a78 Adapt ChangeLog
7213744 Fix typo in comment
2981d8f Change to positive flow for all cases
93ace01 Revert positive flow check
b430d9f Change to positive checks
19779c4 Some style and documentation fixes
5ed8c1e Avoid using restartable and alternative ECP imp.
d3445da Adapt ChangeLog
b75ffb5 Don't perform binary comparison of CRL issuer and CA subject
1f8527f Move static x509_name_cmp() in library/x509_crt.c
a8b13d7 Add tests for relaxed CRL-CA name comparison
06f88e9 Merge remote-tracking branch 'public/pr/2007' into development-proposed
76646a4 Merge remote-tracking branch 'public/pr/1777' into development-proposed
2705bea Merge remote-tracking branch 'public/pr/2095' into development-proposed
710f203 Merge branch 'iotssl-1770' into development_thomas_dee
5517755 Improve wording and formatting of ASN.1 write module documentation
cec1c26 Break overly long line in library/x509_create.c
ee334a3 Remove Doxygen tags from documentation of private structure
beffcd8 Update hardcoded certificates in library/certs.c
6e1adee Regenerate test files
381c77c Change serial in test-ca.crt from 0 to 3 to circumvent ASN.1 bug
b12fd31 Adapt ChangeLog
cb93813 Don't perform binary comparison of CRL issuer and CA subject
0f6903d Move static x509_name_cmp() in library/x509_crt.c
52acdb5 Add tests for relaxed CRL-CA name comparison
b963081 Generate tests/data_files/test-ca_cat[12|21].crt from Makefile
386f99c Generate cli-rsa* CSRs and CRTs through Mbed TLS applications
0dd1139 Generate server5.req.ku.sha1 through Mbed TLS application
ebc1f40 Generate server2* CSRs and CRTs through Mbed TLS applications
b837775 Generate test-ca* CSRs and CRTs through Mbed TLS applications
50cb93a Generate server1* CRTs and CSRs through Mbed TLS applications
56e8463 Add 'password' cmd line parameter to cert_req example program
f745733 Add 'md' cmd line parameter to cert_req example program
2b161c3 Fix compilation issue
936d284 Minor fixes
8493f80 conditionaly compile ECDH and ECDSA alt functions
2b5be1e Fix ChangeLog entry for #2069
0bb204c Adapt ChangeLog
7904f94 Merge remote-tracking branch 'public/pr/1099' into development-proposed
4a865ef Add ChangeLog entry for PR #1618 - ARM DSP instruction support
d5bf428 Merge remote-tracking branch 'public/pr/1618' into development-proposed
5706452 Merge remote-tracking branch 'public/pr/2056' into development-proposed
b4e5451 Merge remote-tracking branch 'public/pr/2070' into development-proposed
17a0fab Merge remote-tracking branch 'public/pr/2111' into development-proposed
02ef525 Merge remote-tracking branch 'public/pr/2107' into development-proposed
a07d86e Merge remote-tracking branch 'public/pr/1902' into development
ef263eb Merge remote-tracking branch 'public/pr/1993' into development
3869384 Merge remote-tracking branch 'public/pr/2031' into development
da09561 Merge remote-tracking branch 'public/pr/2142' into development
ddc9e26 Merge remote-tracking branch 'public/pr/1627' into development
78dd2e5 Merge remote-tracking branch 'public/pr/1806' into development
1daecb4 Merge remote-tracking branch 'public/pr/1281' into development
e783f4a Merge remote-tracking branch 'public/pr/1609' into development
b10c660 Detect unsigned integer overflow in mbedtls_ecp_check_budget()
abdf67e Cast number of operations to `uint` in MBEDTLS_ECP_BUDGET
0eb8fb8 Correct typo in documentation of MBEDTLS_SSL_RENEGOTIATION
76cf60b Remove merge conflict marker in ssl-opt.sh
e4f965d Adapt ChangeLog
169712e Merge remote-tracking branch 'restricted/pr/390' into development
a74faba aes: xts: Correct NIST 80-38E to 800-38E
8381fcb aes: xts: Update inaccurate comments
cc40d86 Improve documentation of mbedtls_ssl_get_verify_result()
a966fde Fix some documentation typos and improve a comment
c774e32 Merge remote-tracking branch 'restricted/pr/517' into development
837f821 Merge remote-tracking branch 'public/pr/1990' into development
ca29fdf Fix some typos in documentation and comments
bcedb92 Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
c028afb Merge pull request #2121 from dgreen-arm/mbedtls-jenkinsfile
b51e267 Add Jenkinsfile for PR job
f24c336 Adapt ChangeLog
dd3ab13 Fail when encountering invalid CBC padding in EtM records
198611d Add missing return value check in ECDSA test suite
96f3b4e Remove yotta support from check-files.py
b25cb60 Add a comment to clarify code flow
a5a3e40 Fix missing dereference.
7a28e99 Expand test to ensure no assumption on output
90f31b7 Improve readability by moving counter decrement
a58e011 Fix alignment in a macro definition
b843b15 Fix function name to fit conventions
c0edc96 Add comment on internal function API
d8b73f2 Remove unnecessary calls to init() from free()
c37423f Fix misleading sub-state name and comments
5267b62 Change error description
a27190b Rename platform error code and value
25781f9 Fix missing check in example client
ee68cff Fix or improve some comments (and whitespace)
32df911 Fix documentation of what functions restart when
7e1f3be Adapt ChangeLog
f0bbd7e Misc documentation fixes/improvements.
6346a75 Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
0b44d5c Zeroize sensitive data in aescrypt2 and crypt_and_hash examples
805f2e1 Add missing zeroization of buffered handshake messages
9580528 ssl-opt.sh: fix typo in mtu settings
b459346 ssl-opt.sh: add a check for i686 targets
7782605 ssl-opt.sh: add comments regarding ciphersuite forcing
748face ssl_tls: fix maximum output length
7c6df83 ssl-opt.sh: revert unnecessary "autoreduction" checks
7311c78 ssl-opt.sh: force ciphersuites to reduce mtu size
780f0a4 Reinitialize PK ctx in mbedtls_pk_parse_key before reuse are free
cfa2e33 Omit runtime configuration of calloc/free if macro config enabled
e5fecec Add test for MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO to all.sh
8df1023 Add explicit unsigned-to-signed integer conversion
ac2ead0 Improve deterministic test for prime testing
e3f95ed Fix bias in random number generation in Miller-Rabin test
e0e7ddf Changelog: Add entry for prime validation fix
a0b67c2 Bignum: Deprecate mbedtls_mpi_is_prime()
da31fa1 Bignum: Fix prime validation vulnerability
64eca05 Bignum: Add tests for primality testing
b728c29 Bignum: Remove dead code
3332937 Changelog: Add entry for prime test improvement
b8fc1b0 RSA: Use MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR
a3cb7eb Bignum: Add test for improved prime generation
f301d23 Bignum: Improve primality test for FIPS primes
35f2f30 ssl-opt.sh: change expected pattern from 'resend' to 'autoreduction'
ef43ce6 Dtls: change the way unlimited mtu is set for client hello messages
abe6003 Adapt ChangeLog
095d9cf Fix ordering of free()ing of internal structures in ssl_server2
0fc9cf4 ssl-opt.sh: increase proxy mtu sizes to contain entire datagrams
1624e2e Avoid overly long lines X.509 DN attr array def in x509_create.c
35b6854 Replace reference to RFC 3280 by reference to newer RFC 5280
cfc47ba Correct some indentation and line lengths in x509_create.c
d355e69 Rename `tag` to `default_tag` in x509_attr_descriptor_t
d0e21fb Improve documentation of ASN.1 string-writing functions
d2c9009 Improve documentation of x509_attr_descriptor_t
dc71ef8 Adapt ChangeLog
0c161d1 Fix bounds check in ssl_parse_server_psk_hint()
948fe80 ssl-opt.sh: adjust test timeouts to fit slower targets
6290dae Disable dtls fragmentation for ClientHello messages
52f8491 ssl-opt.sh: adjust tests to fit slower targets
617a321 Adapt ChangeLog
30a9510 Fix memory leak and freeing without initialization in cert_write
16b1bd8 bn_mul.h: add ARM DSP optimized MULADDC code
d264258 Make inclusion of stdio.h conditional in x509_crt.c
95c5575 check-files: exclude .git and third-party files
404aa65 Add ChangeLog entry for Windows threading fix
6e3606e Fix run-test-suites.pl to screen for files
427df37 Don't try to disable ASLR
5c39d7a Remove redundant check in all.sh
bd90a8c In keep-going mode, don't hard-fail on some tests
a9daa5c Look for documentation only in specific directories
65593d2 rsa: pss: Add no possible salt size tests
80d99ea rsa: pss: Extend tests for variable salt length
3725bb2 rsa: pss: Enable use of big hashes with small keys
0592ea7 Merge remote-tracking branch 'public/pr/1140' into development
1afc767 Merge remote-tracking branch 'public/pr/1758' into development
c86993e Merge remote-tracking branch 'public/pr/1970' into development
c0514bf Added ChangeLog entry for yotta support removal
3ad2efd Remove Yotta support from the docs, tests and build scripts
487cdf5 In keep-going mode, don't hard-fail on some auxiliary script
2561a50 Fix "make WINDOWS_BUILD=1 clean" on non-Windows hosts
7c025a9 Generalize dh_flag in mbedtls_mpi_gen_prime
eba6c9b changes requested by @hanno-arm  - renamed `mbedtls_asn1_write_any_string` to `mbedtls_asn1_write_tagged_string`  - renamed `x509_at_oid_from_name` to `x509_attr_descr_from_name`
54a7c62 Minor style changes
5a481f1 Update error.h count for SSL
12e4a8b Improve documentation wording and formatting
1c1c20e Fix some whitespace issues
ff21572 rsa: pss: Use size_t when computing signatures
125af94 Merge branch 'development-restricted' into iotssl-1260-non-blocking-ecc-restricted
53546ea Update library version number to 2.13.1
5d40f67 Merge remote-tracking branch 'public/pr/1927' into development-restricted
d2ef254 Don't define _POSIX_C_SOURCE in header file
f5106d5 Don't declare and define gmtime()-mutex on Windows platforms
323d801 Correct preprocessor guards determining use of gmtime()
03b2bd4 Correct documentation of mbedtls_platform_gmtime_r()
a50fed9 Correct typo in documentation of mbedtls_platform_gmtime_r()
6f70581 Correct POSIX version check to determine presence of gmtime_r()
c52ef40 Improve documentation of mbedtls_platform_gmtime_r()
7dd82b4 platform_utils.{c/h} -> platform_util.{c/h}
5a7fe14 Don't include platform_time.h if !MBEDTLS_HAVE_TIME
9fbbf1c Improve wording of documentation of MBEDTLS_PLATFORM_GMTIME_R_ALT
c946888 Fix typo in documentation of MBEDTLS_PLATFORM_GMTIME_R_ALT
921b76d Replace 'thread safe' by 'thread-safe' in the documentation
9a51d01 Improve documentation of MBEDTLS_HAVE_TIME_DATE
acef292 ChangeLog: Add missing renamings gmtime -> gmtime_r
4e67cca Improve documentation of MBEDTLS_HAVE_TIME_DATE
48a816f Minor documentation improvements
651d586 Style: Add missing period in documentation in threading.h
6a73978 Rename mbedtls_platform_gmtime() to mbedtls_platform_gmtime_r()
be2e4bd Guard decl and use of gmtime mutex by HAVE_TIME_DATE and !GMTIME_ALT
5f95c79 Remove another mentioning of IAR from config.h
272675f Correct documentation of mbedtls_platform_gmtime()
cfeb70c gmtime: Remove special treatment for IAR
94b540a Avoid redefining _POSIX_C_SOURCE
45e3020 Document that IAR gmtime_s() is auto selected
433f911 Check for IAR in gmtime macros
e58088e Clarify docs for MBEDTLS_HAVE_TIME_DATE
c29c34c Improve wording of gmtime feature in ChangeLog
3c9733a Fix typo in comment for gmtime macro defines
193fe89 Add missing _POSIX_C_SOURCE define in threading.h
ca04a01 Document shorthand gmtime macros
8c9a620 Fix missing word in ChangeLog entry for gmtime()
2099606 Use gmtime_s() for IAR
e9b10b2 Define _POSIX_C_SOURCE in threading.c before POSIX detection
c2f948b Fix grammar in docs for MBEDTLS_HAVE_TIME_DATE
43e4ff0 Make definitions easier to understand
521e8a9 Fix to comment to correct module description
82986c1 Disable 3d test with no good openssl version
c1eda67 Disable fragmentation tests with openssl bugs
da642d9 Implicit _endthread call: comment changed
e1b82ad Added spaces after type casts
acedc91 Fix build issue on clang
e46c329 restore missing operation to CMakeLists.txt
85fcb58 Refactor test code for CTR DRBG to clarify test functions
b0ad581 Remove the invalid input for platform module
0ff4e0b Add platform error codes
6275be3 Re-factor test functions and add support for data_t parameters
b7ebbca compile time warning of 128bit ctr_drbg keys and standardized warnings
ce266e4 use single define for 128bit key for ctr_drbg and update test dependencies
6a4f224 ssl-opt.sh: change expected output for large srv packet test with SSLv3
a658d7d Fix style for mbedtls_platform_gmtime()
c99b12b Fix documentation for MBEDTLS_HAVE_DATE_TIME
5e863e0 Adapt ChangeLog
aa71500 Fix bug in SSL ticket implementation removing keys of age < 1s
1d73993 ssl-opt.sh: Add DTLS session resumption tests
aecf8c9 adding more ctr_drbg test vectors (CAVP 14.3)
e4b77b9 ctr_drbg: add a few test vectors from CAVP 14.3
cfc1de7 ctr_drbg: sample vectors from NIST
5ef5a9a ctr_drbg tests: unify validate functions
4c78665 ctr_drbg tests: new validation function that doesn't reseed
ef0624f ctr_drbg tests: make input sizes flexible
ed7da59 ctr_drbg: add comments relating the code with the NIST specification
954f987 change warning about 128bit keys to print
eb73f7a fix trailing white spaces
04354b0 add ChangeLog entry
c9547cc add NIST test vector for 128 bit keys (not passing yet).
604e60d add default value for CTR DRBG key size
a4588d4 enable the use of variable size keys in ctr_drbg (was hard-coded 256bit before)
248e27c Remove redundant statement from x509_get_current_time
a7b9f15 Add ChangeLog entry for configurable gmtime() in platform
1abb368 Make gmtime() configurable at compile-time
ffbdc61 Add test/zeroize.c
0b54419 More grammar alignment
d717743 Fix check-names.sh fail with USE_GMTIME macro
97f3ecb Document dependency on gmtime, gmtime_r & gmtime_s
824dfb3 Add ChangeLog entry for use of gmtime
ce6eebb Use gmtime when target is not windows or posix
aa22030 Further wording improvements
27a0460 Unify the grammar of descriptions
c2e5cdd Explain aescrypt2 better and warn that it doesn't do things properly
6b9cbb8 Copyediting
bb4bbbb Resolve PR review comments
6f90ed8 Fix CI failure
4e64e0b Fix after PR comments
7b01244 Add tests for mbedtls_cipher_crypt API
604ccc6 Add ChangeLog entry
636179a Fix typo
278af45 Fix hmac_drbg failure in benchmark, with threading
c8c12b6 Add NULL pointer check for consistency
78d7e8c Rename internal variable for consistency
4edb9cb Justify some max_ops settings in test_suite_pk
823c915 Fix mis-merged ChangeLog
597dbf8 Adds a filter to run-test-suites.pl to exclude data files
42c73a9 Merge remote-tracking branch 'origin/development' into development
755890f Remove trailing whitespace
e931d0e Replace Windows API threading with CRT functions
5c7e76e Remove trailing whitespace
da4029d ssl_server2: add buffer overhead for a termination character
95e2eca Fix IAR warning
c19fc55 Add missing large and small packet tests for ssl_server2
30e731d Added buffer_size and response_size options for ssl-server2. Added appropriate tests.
79d9b50 Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
558da9c Make SSL error code more generic
b5d668a post-merge: adapt ssl-opt.sh to new error values
d0a66cc post-merge: fix ECDSA test vector testing
da19f4c Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
020c823 fixed segmentation fault
c150f0d fixed missing initializer
c5c9aaf Merge branch 'development' of https://github.com/thomas-dee/mbedtls into development
23f954d Fix string downcast to `PrintableString` as issued in #1033
3efa888 Update ChangeLog with dtls sample IPv6 change
6fd96ad Change the default IP addresses for DTLS samples
ceb7b12 Readme with a short description of each sample program
a4dd783 Fix some typos in comments
bb216bd Fix MSVC 64-bit warnings
196d133 Fix uninitialised variable in some configs
46ba7f3 Avoid running useless code in tests
fd87e35 Improve comments on parity trick
95aedfe Remove redundant test on curve type
11556e2 Clarify initialization of T in mul_comb()
0b23f16 SSL: rework restart state handling
6348181 Explicit state assignments in ecdsa too
4ed1dab ECP: move state changes closer to operations
c9efa00 ECP: Use explicit state assignments
db4a8eb Use ECP_RS_ENTER/LEAVE() macros, as in ECDSA
b948f7d Don't bother to free NULL subcontexts
bfa1972 Remove redundant checks, save a few muls
28d1628 Avoid unnecessary xxx_copy() calls
5bd38b1 Replace memset() calls with xxx_init() calls
92cceb2 Make some names more consistent
ebac5d3 Fix some whitespace & style issues
eaf55be Misc documentation fixes/improvements
7037e22 Improve comments and doc for ECP
daf0491 Rework state saving for verify_chain()
a968843 Improve some comments in verify_chain()
3627a8b Clarify state handling in find_parent(_in)()
83e923b Better initialisation of ver_chain
8b7b96b Fix typo
d55f776 Skip context allocation if restart disabled
aaa9814 Uniformize ifdefs to ECDSA_C+ECP_RESTARTABLE
fe68770 Keep PK layer context in the PK layer
0bbc66c Dynamically allocate/free restart subcontext in PK
15d7df2 Introduce mbedtls_pk_restart_ctx and use it
98a6778 Better document some function arguments
b889d3e Clarify & uniformise test comments
5faafa7 Update X.509 test certs' Readme
c9e16a9 Disable restartable ECC by default
9897cc9 Update ChangeLog
3bf49c4 Enable restart for certificate verify
fed37ed Extract some code to separate function
39eda87 Make more auto variables const
6b7301c Change restart context type.
d27d1a5 Clean up existing SSL restartable ECC code
8b59049 Make verify() actually restartable
c11e4ba Rework type for verify chain
18547b5 Refactor find_parent() to merge two call sites
a4a5d1d Adapt function signatures to rs_ctx + ret
be4ff42 Call crt_check_signature from one place only
d19a41d Add tests for verify_restartable()
bc3f44a Introduce mbedtls_x509_crt_verify_restartable()
21b7719 Add ChangeLog entry for current progress
32033da Test some more handshake flows
23e4162 ECDH: not restartable unless explicitly enabled
1f1f2a1 Adapt ServerKeyEchange processing to restart
862cde5 Add restart support for ECDSA client auth
2350b4e Adapt ECDHE_ECDSA key exchange to restartable EC
b3c8307 Adapt ssl_client2 to restartable EC
171a481 Add a ChangeLog entry for changes so far
31f0ef7 Fix style issues introduced earlier
1f59606 Make PK EC sign/verify actually restartable
c4ee9ac Add tests for restartable PK sign/verify
82cb27b PK: declare restartable sign/verify functions
fd838da Comment cosmetics
66ba48a Make ECDH functions actually restartable
71b2c53 Add tests for restartable ECDH
c90d3b0 Update doc for restartable ECDH functions
af081f5 Make ECDSA sign actually restartable
50b63ba Use ecp_gen_privkey() in ECDSA sign
6754396 Improve sign/key_tries handling
b90883d Prepare infra for restartable sign
eb402f3 Add test for restartable signature
addb10e Create functions for restartable sign
5314f23 Make verify_restartable() actually restartable
a0c5bcc Add infrastructure for ecdsa_verify_restartable()
722e515 Add test for ecdsa_read_signature_restartable()
32aa437 Declare ecdsa_read_signature_restartable()
1ed2505 Add some negative testing for ecdsa_verify()
c751148 Make some macros/functions public
b5a50e7 Always declare restartable function variants
0ff17df Fix ECDSA test descriptions
4b9c51e Rename EARLY_RETURN -> RESTARTABLE
411079f Rm obsolete comment
a7937f9 Add public function generating private keys
1631d63 Make muladd_restartable() actually restartable
54dd652 Introduce muladd_restartable() and its sub-context
a08cd1a Avoid re-checking argument on restart
3a25612 Reset ops_done at the right time
53fbd63 Remove redundant check
884569c Avoid code duplication in ecp_mul()
646393b Move ops count to top-level context
8467e68 Stop checking for argument change
3cade22 Switch to restart context internally
8f28add Update documentation for new design/API
b739a71 Start moving to new design/API
45fd016 Rename multiplication-specific restart context
e58f65a Expand documentation with notes and warnings
e685449 Scale ops count for larger curves
d3a0ca8 Add tests about number of restarts
9c5c78f Fix indicative values of ops counts
1c678e0 Update doc about minimum max_ops value
213541a Make the first precomp loop restartable
ae55707 Turn double loop into single loop
e2d7cb3 Start splitting precompute_comb()
67c83fb Give a constant a name
fc3e0be Separate auxiliary array in precompute_comb()
07bf6f5 Tune T ownership code + comments
085b1df Allow T to be computed in multiple steps
c9c0aa6 Remember precomputed table
c5d844b Full restart support in ecp_mul_comb_core()
2fad7ae Start actually splitting computation
8962ddb Don't write to destination until we're done
78d564a Add check for changing arguments
77af79a Add proper allocation of restart context
62738e9 Further restrict variable scope by moving code
391f441 Move more code to separate function
24be795 Group related code together
4b2336d Move some more code to new function
22be635 Re-order some more code
ec5606a Extract code to separate function
7306dff Group related code together
510d5ca Add early return test + fake implementation
054433c Add mbedtls_ecp_set_max_ops()
5e3c62f Add MBEDTLS_ERR_ECP_IN_PROGRESS
c3a3bc7 Add config flag MBEDTLS_ECP_EARLY_RETURN
225b37a Fix typos in comment

git-subtree-dir: third_party/mbedtls/repo
git-subtree-split: f00d4bea1709e24c6f407b6aa296e8d283bca684
2018-11-27 16:04:59 -08:00
Abtin Keshavarzian 5d6dccf35c [radio-spinel] determine presence of Ack from spinel TxDone frame (#3313)
This commit changes `RadioSpinel` to determine if Ack is present
directly from the received spinel TxDone frame (i.e. check the
remaining unparsed length of spinel frame to determine if ack frame is
included by Radio Co-Processor (RCP)). This change helps simplify the
code by removing the requirement for `RadioSpinel` as the layer
between OpenThread core and RCP to parse the 15.4 frame.
2018-11-27 10:05:18 -08:00
Shu Chen 2a3384c650 [android] include user defined configuration in Android.mk (#3320)
It introduces a way that user can define product specific configuration
for OpenThread build in Android Environment.

Also ensure that ot-cli and ot-ncp use the same mbedtls config with
ot-core.
2018-11-27 09:10:35 -08:00
Abtin Keshavarzian 0190f9bd9c [radio-spinel] always be ready to ready from socket (#3319)
This commit changes the logic in `RadioSpinel` such that the HDLC
socket is always added to read fd set in `UpdateFdSet()` replacing
the existing code where read was not allowed during an ongoing 15.4
frame transmission. Note that during a frame transmission, radio can
potentially receive a frame (e.g. during CSMA backoffs). Also other
spinel frames such as logs can be received during tx.
2018-11-26 12:44:50 -08:00
Stuart Longland fac323d548 [coap] update the Content-Format enumeration (#3316)
Since RFC-7252 a number of additions have been made to the CoAP
Content-Format registry which is maintained by the IANA.  This patch
updates the list in OpenThread.  Notably:

- Standards references are made for each entry
- Some invalid assignments have been removed (notably PKCS10, PKCS7 and
  JWS)
- New entries have been added for COSE, JSON patches, merge patches,
  CBOR, CWT, CoAP groups, SENML and SENSML.
2018-11-26 10:55:54 -08:00
Abtin Keshavarzian 122b8bbfe2 [radio-spinel] simplify state definitions in RadioSpinel. (#3314)
This commit defines as new set of `State` enumerations which
combines the two state variables `otRadioState` and `TxState`
into a single `mState` variable.
2018-11-26 10:30:40 -08:00
Zhanglong Xia 71753b3cb6 [cli] add channel monitor and channel manager commands (#3286) 2018-11-26 10:28:59 -08:00
Jeff Bumgardner cfc4882c3d [docs] tag APIs that are reserved for testing/demo purposes (#3308) 2018-11-19 10:23:40 -08:00
Abtin Keshavarzian 3b158a61e9 [hdlc-interface] ignore errno EINTR in socket read (#3310)
This commit changes `HdlcInterface::Read()` method to ignore `errno`
`EINTR` (interrupt by a signal) during socket `read()`. It also
uses `exit()` on error.
2018-11-19 09:47:08 -08:00
Abtin Keshavarzian 3f3970ccaa [hdlc-interface] wait for socket to be writable when sending a frame (#3309)
This commit changes `HdlcInterface` method `SendFrame()` to handle
the case where the socket associated with the HDLC interface is
not immediately ready to accept the frame. With the change in this
commit `SendFrame()` will block and wait for socket to become
writable within a timeout interval.
2018-11-19 09:46:06 -08:00
Yakun Xu 1801b0713f [ip6] use 64 as aloc prefix length (#3307) 2018-11-17 12:05:40 -08:00
Jonathan Hui cd2521f53a [style] add use of OT_UNUSED_VARIABLE (#3299) 2018-11-17 12:04:41 -08:00
Jonathan Hui e14d763e2e [style] relocate OT_UNUSED_VARIABLE (#3299) 2018-11-17 12:04:41 -08:00
Jonathan Hui f6afc5599a [style] apply OT_UNUSED_VARIABLE (#3299) 2018-11-17 12:04:41 -08:00
Jonathan Hui 2de3258cbd [mle] do not respond to MLE Parent Requests in detached state (#3295) 2018-11-17 12:04:02 -08:00
Abtin Keshavarzian 1fece5f546 [toranj] update test-603 to use verify_within() (#3306) 2018-11-15 15:57:23 -08:00
Abtin Keshavarzian 5baba6fea8 [ncp] add new spinel capability SPINEL_CAP_THREAD_BORDER_ROUTER (#3305)
This capability mirrors `OPENTHREAD_ENABLE_BORDER_ROUTER` feature
informing host that on-mesh prefix or off-mesh routes can be added
on NCP.
2018-11-15 15:53:18 -08:00
Abtin Keshavarzian bfc7985157 [radio-spinel] use a dedicated mAckRadioFrame for acks (#3304)
This commit uses a separate frame buffer (`mAckRadioFrame`) for saving
acks instead of using `mRxRadioFrame` (which is used for received
frames).

This ensures that the ack frame won't be overwritten by a subsequently
received frame.

- Ack frame is read and saved in `HandleTransmitDone()` (which we get
  to from `HandleSpinelFrame() -> HandleResponse() ->
  HandleTransmitDone()`).

- But note that the saved ack frame is not immediately used, it is
  passed from `RadioSpinel::Process()` to next layer using
  `otPlatRadioTxDone()` callback.

- We can technically read and decode multiple spinel frames from a
  single call to `mHdlcInterface.Read()`:

  - So we can possibly get a TxDone spinel frame response where we
    read and save the ack frame;

  - And before getting the chance to get to `Process()`, from the same
    `mHdlcInterface.Read()` we can get a `VALUE_IS(STREAM_RAW)` spinel
    frame (i.e., receive a frame) which would then overwrite the ack
    frame (assuming we use `mRxRadioFrame` to save the ack)

- Using a separate ack frame (`mAckRadioFrame`) addresses this issue.
2018-11-14 18:38:37 -08:00
Abtin Keshavarzian 6e3b9c9758 [radio-spinel] remove dst address check logic in received frame (#3303)
This commit removes the destination address and PAN Id checks in
`RadioSpinel::RadioReceive()` method. Radio Co-Processor (RCP)
typically provides such filtering. If not, the same checks are
performed by OpenThread core in `Mac:: HandleReceivedFrame()`.
2018-11-14 17:33:08 -08:00
Abtin Keshavarzian c7d8ae3693 [mac] log some of the less useful RX errors at debug log level (#3302) 2018-11-14 17:32:26 -08:00
Abtin Keshavarzian 49523f72e6 [radio-spinel] remove unused method HandleHdlcError (#3301) 2018-11-14 17:32:02 -08:00
Jonathan Hui bf72fd8f8d [qos] check frame length when reading UDP header (#3298)
Credit to OSS-Fuzz.
2018-11-14 17:31:29 -08:00
Yakun Xu 33b0ee9330 [netif] add address callback (#3249) 2018-11-13 19:29:52 -08:00
Abtin Keshavarzian 08747cf7a7 [toranj] update test-010 to use verify_within (#3297)
This commit changes `test-010-on-mesh-prefix-config-gateway` to use
`wpan.verify_within` instead of using fixed delays.
2018-11-13 15:49:11 -08:00
Jonathan Hui 1b1a1e7bc6 [mle] avoid shadow declaration with kVersion (#3294)
Credit to OSS-Fuzz.
2018-11-13 15:17:03 -08:00
Abtin Keshavarzian 0863b652b2 [posix-app] add HdlcInterface class (#3293)
This commit adds a new class `HdlcInterface` under POSIX App which
performs HDLC encoding/decoding and read/write operations on the
interface to Radio Co-Processor (RCP). `RadioSpinel` is updated to
use the new class.
2018-11-13 15:16:48 -08:00
Łukasz Duda 5da7469269 [nrf52840] update README.md (#3290) 2018-11-13 15:16:08 -08:00
Joseph Newman bf6e854a85 [efr32] add missing volatile qualifiers (#3292) 2018-11-12 18:23:19 -08:00
Joseph Newman 7d36e8d913 [time-sync] fix incorrect status after boot (#3291) 2018-11-12 18:22:51 -08:00
Łukasz Duda 9f7bc3a6ec [posix] enable sntp client by default (#3289) 2018-11-12 15:55:16 -08:00
Łukasz Duda 6a0f35c63c [coap] remove functional code from assert (#3288) 2018-11-12 15:54:40 -08:00
Łukasz Duda 90dd7a42d0 [nrf52840] fix uart configuration of HWFC (#3277) 2018-11-12 15:52:20 -08:00
Łukasz Duda 90593db103 [nrf52840] suppress warning in mbedtls in Keil and IAR compiler (#3283) 2018-11-09 09:03:23 -08:00
Abtin Keshavarzian 765c45c2ed [ncp] allow pcap without link-raw (#3274)
This commit adds a new spinel property `SPINEL_PROP_PHY_PCAP_ENABLED`
to allow packet capture (pcap) to be enabled independently of
link-raw mode. This allows pcap to be used on NCPs while running full
Thread protocol.
2018-11-09 08:59:20 -08:00
Zhanglong Xia 8440656f88 [cc1352] fix clearing source match entry issue (#3279)
Fixes the same issue on platform cc2650 and cc2652
2018-11-09 06:38:27 -08:00
Jeff Bumgardner fa8dcf7ef4 [docs] update Doxygen TOC (#3282) 2018-11-08 20:38:09 -08:00
Yakun Xu 5d4d74b1b5 [style] use debug.hpp instead of assert.h in core (#3276) 2018-11-08 09:00:49 -08:00
Yakun Xu d22a75be8d [coaps] defer sending coaps message (#3258) 2018-11-08 08:59:36 -08:00
Zhanglong Xia 4693638f77 [qos] process IPv6 packet priority (#3201) 2018-11-07 23:16:34 -08:00
Yakun Xu cf5352fb43 [api] add API to find source address (#3273) 2018-11-07 22:35:39 -08:00
Joseph Newman 4f99bcfaf3 [ncp] notify host asynchronously upon a significant thread network time change (#3238) 2018-11-07 22:32:31 -08:00
Joseph Newman a5f1ed263d [cli] fix network time format specifier (#3278) 2018-11-07 11:35:18 -08:00
Abtin Keshavarzian 720500be71 [ncp] fix constructor initializer list format (#3275) 2018-11-06 15:11:35 -08:00
Yakun Xu 38bd256997 [posix-app] update README.md for USB=0 (#3272) 2018-11-06 10:31:14 -08:00
Jing 6f578589ff [harness-automation] add new test cases according to testplan changes (#3270) 2018-11-05 20:48:48 -08:00
Yakun Xu b9b57cc9e2 [core] rename UDP proxy to UDP forward (#3266)
Thread defines UDP proxy as a feature to allow secure, two-way
communication of Thread Management Commands between the Commissioner
and any Thread Device in the Thread Network via the Border Agent.

This commit renames the existing UDP proxy feature which forwards UDP
packets back and forth between Host and NCP to UDP forward.
2018-11-05 20:48:08 -08:00
Yakun Xu 8533ee3936 [mle] add address outside of constructor (#3251)
This commit adds link local address when MLE is enabled. Adding address in
constructor gives no chance to notify address change with address
callback.
2018-11-05 20:46:08 -08:00
Zhanglong Xia f8909593a9 [api] update message API to create message with priority (#3199) 2018-11-05 12:48:39 -08:00
Zhanglong Xia f5fdf506ad [mac] remove dead code (#3254) 2018-11-05 08:32:37 -08:00
Jonathan Hui 9a1dc1eeae [style] fix code style (#3267) 2018-11-03 18:33:45 -07:00
Abtin Keshavarzian b48498c15a [spinel] add documentation on used commands in "spinel.h" (#3265) 2018-11-03 14:51:05 -07:00
Yakun Xu 85c21ae1df [posix-app] move die functions to misc.c (#3264) 2018-11-03 14:48:13 -07:00
Yakun Xu 9ba3fc1d9b [netif] add notification for up or down (#3248) 2018-11-03 14:44:18 -07:00
Abtin Keshavarzian b6cdb09f38 [mac] move "FillMacCountersTlv()" to NetworkDiagnostic class (#3263) 2018-11-03 08:13:45 -07:00
Łukasz Duda 4a89cc63b6 [sntp] initial implementation of sntp client (#3237) 2018-11-03 08:11:05 -07:00
Jonathan Hui 8f25db11cc [coap] fix header length calculation overflow error (#3260)
Credit to OSS-Fuzz.
2018-11-03 08:09:14 -07:00
Jonathan Hui 7518eb1fb8 [dtls] map OT errors from send callback to MBEDTLS_ERR_NET_SEND_FAILED (#3259)
Credit to OSS-Fuzz.
2018-11-03 08:08:58 -07:00
Jonathan Hui cb1b4c72a8 Merge pull request #3245 from jwhui/mbedtls
[mbedtls] update to 2.13.0
2018-11-03 08:08:22 -07:00
Jonathan Hui e7b7f3f060 [mbedtls] update README 2018-11-02 21:41:34 -07:00
Jonathan Hui 8d02956c36 [mbedtls] fix build 2018-11-02 15:37:01 -07:00
Jonathan Hui c56e5ea0c4 Merge commit 'e2accb88650112777d9e5b8e0a5bb8576d6eab2a' into mbedtls 2018-11-02 15:36:41 -07:00
Jonathan Hui e2accb8865 Squashed 'third_party/mbedtls/repo/' changes from 38b64b0..76dc065
c0a63bd Remove duplication of some entries in the ChangeLog
b70158b Merge pull request #505 from sbutcher-arm/mbedtls-version-2.13.0
4d075cd Update library version number to 2.13.0
b5afb97 Revised and clarified ChangeLog
0bbb4fc Merge branch 'development' into development
552754a Merge remote-tracking branch 'public/pr/1988' into development
68dbc94 Merge remote-tracking branch 'public/pr/1951' into development
e50128a Merge remote-tracking branch 'public/pr/1994' into development
07de4c0 Merge remote-tracking branch 'public/pr/1920' into development
822a9cc Merge remote-tracking branch 'public/pr/1994' into development-restricted
108992e Add MTU auto-reduction test with valgrind
37029eb Skip MTU auto-reduction test when running valgrind
f34a4c1 UDP proxy: Correct debug output for delay_srv option
a591c48 Correct typo in debug message
83ab41c Correct typo in comment
cd9dcda Add const qualifier to handshake header reading functions
39b8bc9 Change wording of debug message
ef7afdf  Rename another_record_in_datagram to next_record_is_in_datagram
c573ac3 Fix typos in debug message and comment in ssl-tls.c
7c48dd1 ssl-opt.sh: Add function extracting val or default val from config.h
dc1e950 DTLS reordering: Add test for buffering a proper fragment
8a552cf Merge remote-tracking branch 'public/pr/1920' into development-restricted
3af567d Merge remote-tracking branch 'restricted/pr/437' into development-restricted
129fa82 Merge remote-tracking branch 'restricted/pr/470' into development-restricted
7f85563 Merge remote-tracking branch 'restricted/pr/491' into development-restricted
97a1c13 Correct typo in documentation of MBEDTLS_SSL_DTLS_MAX_BUFFERING
02f6f5a Adapt ChangeLog
9ce5160 Merge remote-tracking branch 'public/pr/1965' into development
676d3fd Merge remote-tracking branch 'public/pr/1129' into development
9d5a9e1 Merge remote-tracking branch 'public/pr/1625' into development
14dac09 Merge remote-tracking branch 'public/pr/1918' into development
1846e40 Merge remote-tracking branch 'public/pr/1939' into development
9598845 Merge remote-tracking branch 'public/pr/1955' into development
4613772 Merge remote-tracking branch 'public/pr/1915' into development
e604556 ssl-opt.sh: Don't hardcode varname in requires_config_value_xxx()
4103810 Style: Correct indentation in UDP proxy code
eefe084 Style: Spell out PMTU in ssl.h
0207e53 Style: Correct typo in ssl-tls.c
b841b4f ssl-opt.sh: Remove reference to Github issue
3b8b40c ssl-opt.sh: Add function to skip next test
6f032a6 Merge remote-tracking branch 'public/pr/1963' into development
badeb07 Merge remote-tracking branch 'public/pr/1967' into development
b9a0086 ssl-opt.sh: Explain use of --insecure in GnuTLS client tests
ea85848 Merge remote-tracking branch 'public/pr/1979' into development
bc2498a Style: Add numerous comments indicating condition guarded by #endif
cf46945 Style: Add empty line before comment in UDP proxy code
d584777 Style: Group buffering-related forward declarations in ssl_tls.c
360bef3 Reordering: Document that only HS and CCS msgs are buffered
4f432ad Style: Don't use abbreviations in comments
b8f5014 Add explicit MBEDTLS_DEBUG_C-guard around debugging code
f0da667 Style: Add braces around if-branch where else-branch has them
ecbdf1c Style: Correct indentation of debug msgs in mbedtls_ssl_write_record
3f7b973 Correct typo in mbedtls_ssl_flight_transmit()
2800751 DTLS Reordering: Improve doc of MBEDTLS_SSL_DTLS_MAX_BUFFERING
159a37f config.h: Don't use arithmetical exp for SSL_DTLS_MAX_BUFFERING
2f5aa4c all.sh: Add builds allowing to test dropping buffered messages
a1adcca ssl-opt.sh: Add tests exercising freeing of buffered messages
5cd017f ssl-opt.sh: Allow numerical constraints for tests
6e12c1e Enhance debugging output
0e96585 Merge branch 'datagram_packing' into message_reordering
69ca0ad ssl-opt.sh: Remove wrong test exercising MTU implications of MFL
6b6f602 Merge branch 'iotssl-165-dtls-hs-fragmentation-new' into datagram_packing
c92b5c8 ssl-opt.sh: Add tests checking that MFL implies bounds on MTU
eb57008 Fix typo in documentation of mbedtls_ssl_set_datagram_packing()
1841b0a Rename ssl_conf_datagram_packing() to ssl_set_datagram_packing()
f4b010e Limit MTU by maximum fragment length setting
283f5ef Buffering: Free future record epoch after each flight
081bd81 ssl_write_handshake_msg(): Always append CCS messages to flights
c83d2b3 ssl_write_handshake_msg(): Allow alert on client-side SSLv3
34aa187 Force IPv4 for gnutls-cli DTLS tests
a63c1c3 pk_encrypt: Uniformize debugging output
25d882b Fix typos in programs/x509/cert_write.c
ae513a5 Minor formatting improvements in pk_encrypt and pk_decrypt examples
a70fb95 Adapt ChangeLog
bd336c1 Correct memory leak in pk_decrypt example program
55c11ba Correct memory-leak in pk_encrypt example program
b309b92 ssl_buffering_free_slot(): Double-check validity of slot index
12b72c1 UDP proxy: Fix bug in freeing delayed messages
65dc885 Use size_t for msg_len argument in ssl_get_reassembly_buffer_size()
1b20e8e Merge branch 'datagram_packing' into message_reordering
554b0af Fix assertion in mbedtls_ssl_write_record()
7428d4f Merge branch 'datagram_packing' into message_reordering
551835d ssl_write_handshake_msg(): Always append CCS messages to flights
2c98db2 ssl_write_handshake_msg(): Allow alert on client-side SSLv3
6353134 Merge branch 'datagram_packing' into message_reordering
11682cc Uniformly treat MTU as size_t
98081a0 Don't use uint8_t for bitfields
aa24937 Adapt ChangeLog
3546201 Merge branch 'datagram_packing' into message_reordering
a67dee2 Merge branch 'iotssl-2402-basic-pmtu-adaptation' into datagram_packing
f47a4af Fix a typo in comments
b8eec19 Implement PMTU auto-reduction in handshake
170e2d8 Merge branch 'iotssl-165-dtls-hs-fragmentation-new' into datagram_packing
68ae351 Fix some whitespace in documentation
c1d54b7 Add tests with non-blocking I/O
3d183ce Allow client-side resend in proxy MTU tests
903ee3d Merge branch 'datagram_packing' into message_reordering
01315ea Account for future epoch records in the total buffering size
a02b0b4 Add function making space for current message reassembly
175cb8f ssl-opt.sh: Allow resend in DTLS session resumption tests, cont'd
e180139 Add another debug message to ssl_buffer_message()
e356705 ssl-opt.sh: Add test for reassembly after reordering
101bcba UDP proxy: Allow more than one message to be delayed
55e9e2a Free future buffers if next handshake messages can't be reassembled
e605b19 Add function to free a particular buffering slot
96a6c69 Correct bounds check in ssl_buffer_message()
e0b150f Allow limiting the total amount of heap allocations for buffering
2a97b0e Introduce function to return size of buffer needed for reassembly
5bcf2b0 ssl-opt.sh: Allow spurious resend in DTLS session resumption test
e678eaa Reject invalid CCS records early
6b13afe Fix indentation
47db877 ssl_write_record: Consider setting flush variable only if unset
1f5a15d Check retval of remaining_payload_in_datagram in ssl_write_record()
ecff205 Remove stray bracket if MBEDTLS_ZLIB_SUPPORT is defined
f61ff4e ssl_server2: Remove redundant new line
d22c1b2 Merge remote-tracking branch 'upstream-public/pr/1932' into development
2f2d902 Add delay in test to avoid race condition
6611035 Try to further clarify documentation
000281e Fix "unused parameter" warning in small configs
f2f1d40 Improve wording in ChangeLog and documentation
6151298 Add missing requires_gnutls guards
9434713 Move the assertion
6aeaa05 Merge branch 'iotssl-165-dtls-hs-fragmentation-new' into datagram_packing
f362c29 ssl-opt.sh Add dependency on gnutls in two fragmentation tests
7be2e5b ssl-opt.sh: Preserve proxy log, too, if --preserve-logs is specified
4e1a9c1 ssl-opt.sh: Preserve proxy log, too, if --preserve-logs is specified
513815a Fix typo in debugging output
4cb782d Return from ssl_load_buffered_record early if no record is buffered
a1071a5 Compute record expansion at the right time
4532329 Add proxy-enforcement to a MTU test
9829315 Add missing dependency in ssl-opt.sh
58e9dc3 Allow GNUTLS_NEXT_CLI / GNUTLS_NEXT_SERV to be unset in ssl-opt.sh
050dd6a Improve documentation of ssl_set_mtu().
065a2a3 Fix some typos and links in comments and doc
02f3a8a Adjust timeout values for 3d test
caf8741 Fix typo in documentation of UDP proxy argument 'delay_cli'
3a0aad1 Rename `update_digest` to `update_hs_digest`
4422bbb Whitespace fixes
e00ae37 Omit debug output in ssl_load_buffered_message outside a handshake
6e7aaca Move MTU setting to SSL context, not config
0d4b376 Return through cleanup section in ssl_load_buffered_message()
34b03ef Remove redundant `else` statement
56cdfd1 Refine reordering tests
01ea778 UDP proxy: Add option to delay specific handshake messages
56d5eaa Mark SSL ctx unused in ssl_prepare_reassembly_buffer() if !DEBUG
8727304 Disable datagram packing in reordering tests
d488b9e Increase maximum number of buffered handshake messages
f103542 Adapt ChangeLog
b063a5f Update error codes
b34149c Add test for buffering of record from next epoch
5f066e7 Implement future record buffering
e384221 Add test for reordering of handshake messages
37f9532 Implement future message buffering and loading
6d97ef5 Use uniform treatment for future messages and proper HS fragments
44650b7 Introduce function checking sanity of the DTLS HS header
12555c6 Introduce function to parse total handshake length
0271f96 Introduce buffering structure for handshake messages
d7f8ae2 Introduce sub-structure of ssl_handshake_params for buffering
e25e3b7 Add function to check is HS msg is a proper fragment
d07df86 Make allocation of reassembly bitmap optional
56e205e Prepare handshake reassembly in separate function
9e1ec22 Return MBEDTLS_ERR_SSL_EARLY_MESSAGE for future HS messages
aa5d0c4 Add test for buffering out-of-order CCS
2ed6bcc Implement support for remembering CCS messages
40f5084 Add frame for loading and storing buffered messages
e74d556 Introduce function to indicate if record is fully processed
2699459 Move call to ssl_consume_current_message()
1097b34 Extract message-consuming code-path to separate function
4162b11 Make mbedtls_ssl_read_record_layer() static
a4b143a Remove nested loop in mbedtls_ssl_read_record()
02f5907 Correct misleading debugging output
327c93b Add parameter to ssl_read_record() controlling checksum update
e1dcb03 Don't send empty fragments of nonempty handshake messages
4a9d006 Add missing dependency in ssl-opt.sh
bc73e4a Allow GNUTLS_NEXT_CLI / GNUTLS_NEXT_SERV to be unset in ssl-opt.sh
d87a59c Adapt ChangeLog
7ae8a76 Add tests for datagram packing option to ssl-opt.sh
1c9a24c Disable datagram packing for various UDP proxy tests
c430523 Re-enable delayed CCS test
4d61591 Add cmd line option to ssl_client2 for datagram packing
e7675d0 Add cmd line option to ssl_server2 for datagram packing
04da189 Make datagram packing dynamically configurable
12405e7 Increase max_frag_len / MTU in fragmentation ref tests
7e77213 Fix unused variable warning in ssl_session_reset_int()
0defedb Fix unused variable warning in mbedtls_ssl_get_max_record_payload
f29d470 Reset in/out pointers on SSL session reset
4ccbf06 Minor improvements in ssl_session_reset_int()
2a43f6f Introduce function to reset in/out pointers
111fa49 TEST-ONLY: Remove delayed CCS test
b50a253 Move size check for records
67bc7c3 Don't immediately flush datagram after preparing a record
2b1e354 Increase record buffer pointer after preparing a record
3b23590 Log calls to ssl_flight_append() in debugging output
0448462 Increment record sequence number in ssl_write_record()
1985947 Store outgoing record sequence number outside record buffer
5aa4e2c Move deduction of internal record buffer pointers to function
3136ede Compute record expansion in steps to ease readability
141e767 Merge remote-tracking branch 'upstream-public/pr/1942' into development
6fba810 Merge remote-tracking branch 'upstream-public/pr/1938' into development
38110df Add interop test with unreliable connection
d26bb20 Add tests for empty CA list in CertificateRequest, TLS 1.0 & 1.1
0794d49 Skip some tests with valgrind (spurious resend)
1218bc0 Add simple interop tests (reliable connection)
3879fdf Merge remote-tracking branch 'public/pr/1955' into iotssl-165-dtls-hs-fragmentation-new
eb2b15a Improve ChangeLog wording for the commmit that Fixes #1954.
ad0fe92 Adapt ChangeLog
ad17fe9 Fix overly strict bounds check in ssl_parse_certificate_request()
aa9f3fd Merge remote-tracking branch 'upstream-public/pr/930' into development
2d56f0d Add test with unreliable connection
19c62f9 Add test for session resumption
7e89c17 Fix two typos in comments
72c2707 Add tests for MTU with renegotiation
b747c6c Add basic first tests for MTU setting
637e234 Merge remote-tracking branch 'public/pr/1915' into iotssl-165-dtls-hs-fragmentation-new
9468ff1 Implement support for MTU setting
0b1d9b2 Declare ssl_conf_mtu()
01ec4af Add ChangeLog entry
2cb17e2 Make handshake fragmentation follow max_frag_len
28f4bea Start implementing fragmentation
87a346f Always save flight first, (re)send later
9c3a8ca Clarify code a bit in write_handshake_msg()
31c1586 Start separating handshake from record writing
2c069df Fix typo in test_suite_entropy.function
08a4aeb HKDF: Add warning to partial functions
d0a78e9 HKDF: Fix style issue
9dc3be7 Improve wording in ChangeLog
9ebdcff Fix Wformat-overflow warning in ssl_mail_client.c
361f254 Adapt ChangeLog
7864090 Reset session_in/out pointers in ssl_session_reset_int()
446227a Enhance nist_kw with some NULL buffers tests
d1a4762 Use mbedtls_printf instead of printf
d8f4169 Merge remote-tracking branch 'upstream-public/pr/1598' into development
03bd484 Merge remote-tracking branch 'upstream-public/pr/1861' into development
cac0c1a Merge remote-tracking branch 'upstream-public/pr/1378' into development
603aee0 Merge remote-tracking branch 'upstream-public/pr/1816' into development
372b50b Add a ChangeLog entry for #1816
f48163a Merge remote-tracking branch 'upstream-public/pr/1834' into development
58e9c18 Fix Wformat-overflow warning in ssl_mail_client.c
5cb7017 Less obscure test suites template
d2d0112 Style fixes
440d873 Fix macro validation regex
ee6529e Add generate_test_code.py unit tests in all.sh
2179810 Pylint tests in all.sh
539aa06 Fix Python 2 & 3 compatibility in test_generate_test_code.py
32cbcda Fix Pylint errors in Python scripts
6302813 Replaced escaped_split() logic with regex
fcdf685 Make test function parsing robust
4084ec7 Fixed unit tests in test_generate_test_code.py
8d686bf Incorporated code revoew comments.
b31aa44 Fix style errors reported by pylint
aee05bb Add test suite framework summary
63ab501 Fix generate_test_code.py argument --helpers-file in CMakeLists.txt
27a35e7 Wildcard possible targets and document
5fcca46 Rename HexParam_t -> data_t for consistent coding style
62a5d7d Document status/error codes in helper.function
951a2c8 Improve documentation in mbedtls_test.py
e3b26af Improve documentation in generate_test_code.py
b98e6ee Replace asserts with exceptions in mbedtls_test.py
040b6a2 Wrap code to 79 character limit
936ea93 Strip whitespaces added by decode() function
00c4b09 Change intermediate data file extension to .datax
ff560f2 Rename makefile target gen-embedded-test - generate-target-tests
cfd8342 Use integer instead of string as test result
53faf5c Widen the test app columns
8a3628f Set PYTHON using ?= syntax
8f6e8cf Print line number with data file error
3b06f22 Replace asserts with exceptions in generate_test_code.py
c3521df Fix generate_test_code.py unit tests
0fa3504 Add missing MSVC typedefs
667f7f8 Fix generation of #line directives in Python 2
7776141 Don't generate lines with only whitespace
9b06f37 Give execute permissions to Python scripts
b73159d Remove white spaces caught by check-files.py
ddde34c Remove git conflict marker from test_suite_timing.function
7613534 Fix gcc-7 -Wformat-truncation warning
1ec7e6f Python3 compatible generate_test_code.py
78befd9 Rename generate_code.py -> generate_test_code.py
7eb5568 Set OS specific python executable name
b522929 Add support for per test suite helper functions
05d83fa Put parentheses around macro arguments
36e5fac Rephrase confusing function description
317efe8 Adapt new test gcm_bad_parameters() to on target testing changes
f0e42fb Add missing documentation and fix file doc strings
9540261 Incorporated code review comments
d61b837 Update unit tests for change in test suites code generator
b1c2d0f Use switch instead if if-else for dependency and expression checks.
d61a438 incorporate code review comment in embedded_test.function
663d470 Incorporate code review suggestions in mbedtls_test.py
599cd24 Update unit tests for code generator and make code generator more testable.
acc5473 Use FileWrapper class in place of file where line number is required
5e2ac1f Updated generate_code.py unit tests
4b54323 Unit test generate_copy.py
13c6bfb Gaurd test suite headers with suite dependency
8c4d5ba Update CMakeList.txt with new test suites code generator
cf32c45 Add missing headers and fix name change issues
1de892b Update code as old template and generator is replaced with new one
191e904 Replace old template and code generator with new ones. Keep names
975d97e Remove old test suite template and code generator script
2397bba Update test generator for use of struct for hex parameters
d30ca13 Combine hex parameters in a struct
5cfc068 Fix name conflict in function params after hexify/unhexify change
3e5d000 Update Greentea API header
47b4060 Fix RSA test suite bugged by hexify/unhexify change
392267a Fix missing data in the RSA test vectors file
b3a103c Put else in it's own line
d59391a Add support for sending hex parameters
46c9b1f Fix test functions and data after moving hexify/unhexify out
5e7f8df Print Greentea __testcase_name indicator for Greentea to mark the test
a57a420 Add hex parameter dispatch
184447e Add proper handling of hex data
f1aaec9 Intermediate hexify out change
9079170 Adapt code for scripting out hexify/unhexify code
3499a9e Add hex comparison function
0574632 Update Greentea client API calls
ee6c018 Unify test setup errors for sending to host
ec02448 Fix line no. directive
67735d5 Fix name conflict and implicit use of functions from string.h
7a0d84f On target test host test script
fff4904 mbed-os test code generator
1f29be7 Make target for on mbed testing
94aefaf Optimise makefile targets
4481464 Adapt ChangeLog
5b559ac Fix mbedtls_ssl_get_record_expansion() for ChaChaPoly and CBC
9f7798e Revert change of a return variable name
b363382 Add ChangeLog entry for bug #1890
f1124c9 Merge remote-tracking branch 'public/pr/1891' into HEAD
1b9b217 enforce input and output of ccm selftest on stack
5f26b11 Change test dependencies to RC4 from DES
c796573 Add Chacha dependency to the stream cipher field
608a487 Fix memory leak in ecp_mul_comb() if ecp_precompute_comb() fails
6c34268 Merge remote-tracking branch 'restricted/pr/501' into development-restricted
f11a7cd Clarify Changelog entries
193c864 Update version to 2.12.0
37b9fd5 Merge remote-tracking branch 'restricted/pr/490' into development
34acd3c Merge remote-tracking branch 'public/pr/1868' into development
269e999 Remove unnecessary newlines in CONTRIBUTING.md
ee3ded0 Merge remote-tracking branch 'public/pr/1832' into development
729d781 Merge remote-tracking branch 'public/pr/779' into development
2c92949 Merge remote-tracking branch 'public/pr/1198' into development
c88c627 Merge remote-tracking branch 'public/pr/1658' into development
4ed32d0 cpp_dummy_build: Add NIST key wrapping header
488fd08 Add aes KW OIDs as defined
8dd03cd Add tests for the nist key wrapping feature
9cf0d53 Add ChangeLog
9ab746c Add selftests
cb349ac Implement the KW and KWP algorithm
466a57f Key wrapping API definition
5ca06c7 Merge remote-tracking branch 'public/pr/1724' into development
fb3b032 Merge remote-tracking branch 'public/pr/919' into development
ccb43df Merge remote-tracking branch 'public/pr/927' into development
dad05b7 Merge remote-tracking branch 'public/pr/1844' into development
0533054 Revise ChangeLog entry for empty data records fixes
c9a5f02 Move comment to a separate line
116ac43 Merge remote-tracking branch 'public/pr/1852' into development
bdf80d0 Merge remote-tracking branch 'public/pr/1810' into development
463928a Fix code formatting
fced1f2 Merge remote-tracking branch 'public/pr/1854' into development
ecb635e Add ChangeLog entry for #1098 fix.
428cc52 Allow to forward declare of public structs #1215
4072aae Merge remote-tracking branch 'public/pr/1875' into development
a7b3543 Merge remote-tracking branch 'public/pr/1871' into development
6965f77 Fix use of Knowledge Base in documentation
4736e96 add myself to changelog
ca2ea4e Fix issue if salt = NULL and salt_len !=0 in mbedtls_hkdf_extract()
5a5d03f Add test guidelines to CONTRIBUTING.md
10f9663 Added clarification to CONTRIBUTING.md
5cf4d06 Refine the definition of net_sockets.h
cce68be Add a macro to define the memory size in ssl_server2.c
e459f07 Correct logic to exclude i386 inline assenbly when -O0
8e6a22a Add additional i386 tests to all.sh
7a6da6e Expand i386 all.sh tests to full config ASan builds
ccbd464 Increase the memory buffer size for ssl_server2.c
4c761fa Add test for empty app data records to ssl-opt.sh
81f0633 Add ChangeLog entry for empty app data fix
ce6fbac Fix ssl_client2 to send 0-length app data
1a7a17e Check for invalid short Alert messages
3481792 TLSv1.2: Treat zero-length fragments as invalid, unless they are application data
b512bc1 CBC mode: Allow zero-length message fragments (100% padding)
7870ec1 Add API/ABI section to CONTRIBUTING.md
7c1258d all.sh: Return error on keep-going failure
7d728bd Merge remote-tracking branch 'public/pr/1454' into development
922bd1e Merge remote-tracking branch 'public/pr/1752' into development
862e703 Merge remote-tracking branch 'public/pr/921' into development
be685ba Merge remote-tracking branch 'public/pr/1836' into development
4f37bca Fix ChangeLog entry for issue #1663
df15356 Merge remote-tracking branch 'public/pr/1663' into development
fad5470 Merge remote-tracking branch 'public/pr/532' into development
a72098b Merge remote-tracking branch 'public/pr/1778' into development
ca33caf Add definition of purpose and use of networking module
0011503 Repharse comments
6ca436a Update change log
830ce11 Clarify attack conditions in the ChangeLog.
21feae5 Update change log
a47911c Fix memory leak in ssl_setup
0e2c07e Remove unnecessary mark as unused #1098
8744a02 Clarify a few comments
4b9a3ad Disable use of the i386 assembly for option -O0
00af447 Add ChangeLog entry for PR #536
e7aeef0 Merge remote-tracking branch 'public/pr/536' into development
32b0747 Merge remote-tracking branch 'public/pr/1737' into development
727325b Merge remote-tracking branch 'public/pr/1788' into development
24c0dbf Merge remote-tracking branch 'public/pr/1821' into development
cdbb2f2 Merge remote-tracking branch 'public/pr/1563' into development
231d7e5 Add ChangeLog entry for PR #1567.
6331cb0 Fix some whitespace issues in ChangeLog and CMakeLists.txt
d21bd31 Merge remote-tracking branch 'public/pr/1567' into development
6a25cfa Avoid debug message that might leak length
a5fbfd7 Enable snprintf on FreeBSD
a61d123 Minor changes to comments in hkdf.c
cdb5cc5 tests: dhm: Rename Hallman to Hellman
7b42030 Add counter-measure to cache-based Lucky 13
1cc1fb0 Fix Lucky 13 cache attack on MD/SHA padding
382c1db Minor fixes
d50f786 Update the CONTRIBUTING.md file for LTS branches
21f9afe Remove the namespacing from config-no-entropy.h
5ffc220 Documentation error in `mbedtls_ssl_get_session`
991f9fe all_sh: add a check for header inclusion in cpp_dummy_build.cpp
05fa46e Add ChangeLog entry for #992 fix
13dfb4e Revert changes in the configs folder
3fa6c27 Move definition to cipher.h
da2a312 Add entry in ChangeLog
ab8d58c Move definition of MBEDTLS_CIPHER_MODE_STREAM
a931265 Fix ssl-opt.sh not starting when lsof is not available
61fa436 Address review comments - tidy usage of macros to use minimal values
104d858 Add ChangeLog entry
5a9cb61 Use preserve mode to copy headers.
dcae78a Make a buffer limit more specific
470dfba Simplify OID tag parsing in x509_get_cert_ext( )
643df7c Update ssl-opt.sh test to run condition
1ab9b57 Add a ChangeLog entry for memory leak in mbedtls_x509_csr_parse()
034e139 Merge remote-tracking branch 'public/pr/1621' into development
4b6b08e Merge remote-tracking branch 'public/pr/1006' into development
1d97cab Merge remote-tracking branch 'public/pr/1645' into development
bea00bd Merge remote-tracking branch 'public/pr/1783' into development
9e02b97 Add ChangeLog entry for #1257 - key_app_writer writes invalid ASN.1
b056dd8 Remove a redundant dependency clause
19c01ef Merge remote-tracking branch 'public/pr/1258' into development
fd0c240 Merge remote-tracking branch 'public/pr/1793' into development
58093c8 Add ECC extensions test in ssl-opts.sh
05be06c Make the C++ test mandatory by removing the --no-cxx flag from all.sh
45a6719 Add a CXX build to all.sh to execute the C++ dummy test by default
037ec4b Replace tabs with spaces
89c048c Tests: add a test for cpp linking
0211c32 Change the cpp test to be optional
40741f8 Add a test with a cpp executable including all mbed TLS headers
84e62f8 Update ChangeLog
d56654f Update the forum link in the README file
6665b67 Merge remote-tracking branch 'public/pr/1390' into development
9fa21bf Merge remote-tracking branch 'public/pr/1533' into development
95a1c1f Merge remote-tracking branch 'public/pr/1617' into development
bf47099 Adjust to new RSA infrastructure
a522147 Fix compilation errors after updating
4922123 Update the Mbed TLS forum link
7972334 Enable ARIA self test in the unit testing
164b9cd update ChangeLog
b7d39db update ChangeLog
99a3e80 update change log.
1555085 add ChangeLog to this commit.
2682edf Fix build using -std=c99
512b4ee Use gmtime_r to fix thread-safety issue, and use mbedtls_time on Windows
8ee2422 about a issue Replace "new" variable #1782
51d7cfe Fix coverity warnings in benchmark.c
6c34442 Add fix for #1550 and credit to the ChangeLog
6332e36 Fix typo in ChangeLog
6fd941f Remove unneeded namesapcing in header files
7a81426 Fix style issue
6a9257b Add check for return code of bignumber code
5357164 Add ebx to the i386 clobber list for MPI assembly
bf7fe4f Replace check with APPLE with CMAKE_SYSTEM_NAME
5b92352 Document ssl_write_real() behaviour in detail
7ee25d7 Allow 0 as a valid ret value for mbedtls_ssl_write
a562c26 Add ChangeLog entry for mbedtls_ssl_write() docs
3f38cf7 Add entry in ChangeLog
755bb6a Add ecc extensions only if ecc ciphersuite is used
e3402ce Enable APPLE_BUILD in makefile if using system ar
7994766 Fix usage of if_build_succeeded in all.sh zeroize test
21f73b5 Coding style
c51d613 Ensure crosscompiling with make works in Mac OS X
e12f0ac Adapt buffer size for minimal CCM config
1f092b4 Add ChangeLog entry for ChachaPoly ciphersuites
9fece7e Add ChachaPoly ciphersuites to compat.sh
2e58e8e Implement ChachaPoly mode in TLS
c36b432 Add GnuTLS interop for CCM(-8) ciphersuites
ce66d5e Declare ChaCha-Poly ciphersuites
f57bf8b Define specific mode for ChachaPoly
a18034a Adjust to added fields in cipher_base_t
0dadba2 Merge branch 'development' into iotssl-2257-chacha-poly-primitives
8266aca Merge remote-tracking branch 'upstream-restricted/pr/487' into development
2fcd3e4 Change the library version to 2.11.0
925568a Fix version in ChangeLog for fix for #552
c4dd073 test: Add test cases for separately reduced inward/outward buffer sizes
d8213d0 Let MBEDTLS_SSL_MAX_CONTENT_LEN to be split into outward & inward sizes
b6a5bff Add ChangeLog entry for clang version fix. Issue #1072
c7bc9e1 Fix a few typos
cbe248a Merge remote-tracking branch 'public/pr/1727' into development
1f91575 Merge remote-tracking branch 'public/pr/1681' into development
688a456 Merge remote-tracking branch 'public/pr/1734' into development
cdc338b Merge remote-tracking branch 'public/pr/1735' into development
2711ad7 Merge remote-tracking branch 'public/pr/1736' into development
600c5e6 Compilation warning fixes on 32b platfrom with IAR
d9c71da Revert "Turn on MBEDTLS_SSL_ASYNC_PRIVATE by default"
2dbecc0 Merge remote-tracking branch 'public/pr/1602' into development
66a8903 Fix for missing len var when XTS config'd and CTR not
9873696 Merge remote-tracking branch 'public/pr/710' into development
5f57f1e Merge remote-tracking branch 'public/pr/1270' into development
6755905 Merge remote-tracking branch 'public/pr/1602' into development
d5d983e ssl_server2: handle mbedtls_x509_dn_gets failure
6b9bcd6 Remove redundant ret = 1 in dh_client.c
eb8bca6 Add missing platform macro defines in cert_app.c
bce5f78 Add missing platform macro defines in pk_decrypt.c
7d42965 Fix typo in platform macro defines for examples
28abd8e Fix ret code in gen_random_havege.c
25b5af5 Fix ret code in rsa_encrypt.c
7fe4edf Fix ret code in rsa_decrypt.c
7a9d01c Fix ret code in cert_app.c
dabd78f Fix ret code in generic_sum.c
9f3379d Fix ret code in pk_verify.c
82b2726 Fix ret code in pk_sign.c
0a7522c Fix ret code in pk_encrypt.c
5289817 Fix ret code in pk_encrypt.c
f47c9c1 Fix ret code in ecdh_curve25519.c
d905db6 Fix ret code in mpi_demo.c
78dabe0 Fix ret code in pem2der.c
357b0b2 Fix ret code in ssl_cert_test.c
80081a6 Fix ret code in udp_proxy.c
57a0c9b Fix ret code in req_app.c
898b208 Fix ret code in crl_app.c
f9a54d3 Fix ret code in cert_write.c
aacd928 Fix ret code in cert_req.c
67a42ac Fix ret code in ssl_mail_client.c
4be53b5 Fix ret code in ssl_fork_server.c
5517202 Fix ret code in ssl_client1.c
73d4a5f Fix ret code in gen_random_ctr_drbg.c
55a0d56 Fix ret code in gen_entropy.c
a833263 Fix ret code in rsa_verify_pss.c
0a860f6 Fix ret code in rsa_verify.c
3c41e56 Fix ret code in rsa_sign_pss.c
1a66056 Fix ret code in rsa_sign.c
70e1ffd Fix ret code in rsa_genkey.c
ed68488 Fix ret code in key_app_writer.c
0faf1a5 Fix ret code in key_app.c
208c217 Fix ret code in gen_key.c
2602a1f Fix ret code in ecdsa.c
03a992c Fix ret code in dh_server.c
d6bfeff Fix ret code in dh_genprime.c
898841d Fix ret code in dh_client.c
4c47df6 Fix ret code in crypt_and_hash.c
388c1b1 Fix ret code in aescrypt2.c
ace0592 Fix harmless use of uninitialized memory in ssl_parse_encrypted_pms
c306a05 SSL async tests: add a few test cases for error in decrypt
4481744 Fix memory leak in ssl_server2 with SNI + async callback
e247989 SNI + SSL async callback: make all keys async
2636fad ssl_async_resume: free the operation context on error
f5a9996 ssl_server2: get op_name from context in ssl_async_resume as well
ef30742 Clarify "as directed here" in SSL async callback documentation
7457933 SSL async callbacks documentation: clarify resource cleanup
3dae1cf Async callback: use mbedtls_pk_check_pair to compare keys
a668c60 Rename mbedtls_ssl_async_{get,set}_data for clarity
02b86d0 Fix copypasta in the async callback documentation
166ce74 SSL async callback: cert is not always from mbedtls_ssl_conf_own_cert
d6fbfde ssl_async_set_key: detect if ctx->slots overflows
0798158 Fix missing continuation indicator in ssl-opt.sh
20e2bdf SSL async tests: tighten a few log checks in some test cases
94e153a Improve documentation of the async callback's crypto parameters
37d4175 Add test case for SSL async resume after resume
4d9ec4d Fix uninitialized variable in ssl_server2
6331d78 Don't use the printf format %zd
03af7f6 Change boolean bitfield to unsigned
ff2f493 config: List cipher modes in alphabetical order
4ab8acd Merge remote-tracking branch 'public/pr/1075' into development
6ac1cf6 Merge remote-tracking branch 'public/pr/1182' into development
e5cd868 Add ChangeLog entry for PR #1555
c1bf1aa Merge remote-tracking branch 'public/pr/1555' into development
73a4b80 Merge remote-tracking branch 'public/pr/1672' into development
9a8db56 Merge remote-tracking branch 'public/pr/1730' into development
2ff0e52 Fix missing preprocessor condition in AES self-test
c03059d Simplify code in mbedtls_x509_csr_parse
0a8352b Fix harmless use of uninitialized memory in ssl_parse_encrypted_pms
725f1cb SSL async tests: add a few test cases for error in decrypt
3f3ada8 Fix memory leak in ssl_server2 with SNI + async callback
157f6d8 SNI + SSL async callback: make all keys async
d906b81 tests: cipher: Allocate enough space for XTS keys
0931708 benchmark: Add comma at end of help message
f4474e7 ChangeLog: Add an entry for AES-XTS
ed91a79 config: Update documentation for XTS option
c28012a tests: Remove NIST AES-XTS test vectors
142383e aes: xts: Add tests for invalid key sizes
8cfc75f aes: xts: Fix style issues with gf128mul
5f0b06a aes: xts: Fix description of gf128mul
f167deb aes: xts: Add a reference to the standard
c653990 cipher: Add wrappers for AES-XTS
425382d tests: Extend AES-XTS suite
e5c4b07 tests: Make AES-XTS suite more stack friendly
21d79cf aes: Add self test for AES-XTS
cd9fc5e aes: xts: Rename iv to data_unit
d82cd86 aes: xts: Rewrite to avoid use of goto
0a8b020 aes: xts: Enforce NIST SP 800-38E data unit size
5162b93 aes: Use length instead of bits_length in XTS
9366feb aes: xts: Add new context structure
e22ba80 Add XTS test suites to the Makefile
e9ecf00 aes: Remove AES-XEX
010c2cb gf128mul: Inline instead of making a new module
97cc3b1 gf128mul: Remove the jump table
5f77801 Implement AES-XTS mode
380162c Double perf for AES-XEX
daf7045 Add benchmark for AES-XEX
8bb817a Add AES-XEX to the version features
9bbe363 Rename exported symbols to please check-names.sh
fb67fae Add AES-XEX tests cases
75e3661 Add AES-XEX mode to the default config file
0089d36 Implement AES-XEX mode
b053658 Add 2 files for multiplication in GF(128)
9f52aeb tests: Fix name of 33 byte AES cipher tests
1d93759 Conditionally assign APPLE_BUILD var in makefile
c471cd7 Autodetect if running on OS X in makefile
7decfe8 Convert mbedtls_free and mbedtls_calloc into functions
9b04e19 Use grep to detect zeroize test failures on GDB
c06c9ae Add alias APPLE make var of APPLE_BUILD
4ed3880 Fix ChangeLog whitespace errors and add entry for PR #1646
f3987b3 Add ChangeLog entry for CCM*
601144e Add entry to ChangeLog for PR #795
b11de30 Fix braces in mbedtls_memory_buffer_alloc_status()
ae4cafa Merge remote-tracking branch 'public/pr/795' into development
c7638fa Fix ChangeLog entry after merge of HKDF
e47d6fd Merge remote-tracking branch 'public/pr/1497' into development
ebe23ed Fix up the ChangeLog for the new version
f0d7629 Merge remote-tracking branch 'public/pr/1593' into development
ebb6427 Merge remote-tracking branch 'public/pr/1646' into development
263498a Merge remote-tracking branch 'public/pr/1667' into development
dbe80c6 Merge remote-tracking branch 'public/pr/1668' into development
0b11e75 Merge remote-tracking branch 'public/pr/1692' into development
3cde2fc ssl_async_resume: free the operation context on error
4844bf2 Add OFB as additional block mode
cb2c935 aes: Clarify IV requirements for OFB mode
5db1362 Clarify documentation for AES OFB
33cb519 Add decrypt tests to AES OFB Cipher module
b7836e1 Change AES OFB tests to memset sizeof buffer
e416bf9 Reduce stack usage for AES OFB tests
968646c Clarify comments on use of AES OFB block mode
0013144 Fix style and formatting for OFB feature
374bcd4 Add to OFB cipher tests AES-192 and AES-256 OFB
dbe7fbf Remove unused variable in AES OFB test suite
6873c84 Update cipher.h for OFB block mode documentation
ad4e493 Fix AES-OFB support for errors, tests and self-test
7487c5b Add missing OFB entry to null ciphersuite
8c0fd1e Add cipher abstraction and test cases for OFB block mode
0301884 Add test cases for AES OFB block mode
76a5b22 Add OFB block mode to AES-128/192/256
10e0e4d hkdf: Add negative tests
3618962 hkdf: Add tests for extract and expand
798363e Add ChangeLog entry for HKDF
656864b Add an HKDF (RFC 5869) implementation
fcfa4c2 Merge remote-tracking branch 'public/pr/1699' into development
2a1edac Change symlink to hardlink to avoid permission issues
0a0e08a mbedtls_gcm_crypt_and_tag: clarify what each mode does and doesn't do
f30dbdc Update generated file
d75ee64 Fix out-of-tree testing symlinks on Windows
39b1904 Merge branch 'development' into iotssl-2257-chacha-poly-primitives
21a65e0 Fix usage of inline with for some compilers
2adb375 Add option to avoid 64-bit multiplication
80f679b Correct and clarify the documentation of GCM whole-message functions
c041435 Merge remote-tracking branch 'public/pr/1694' into development
d5a09f1 Updated version number to 2.10.0 for release
390641e Merge remote-tracking branch 'public/pr/1693' into development
b5b2543 Fix undefined shifts
ab72727 Add a disabled CMAC define in the no-entropy configuration
1a8ef07 Fix coverity defects
33dd323 Merge remote-tracking branch 'public/pr/1690' into development
d08a2f7 Adapt the ARIA test cases for new ECB function
747fd53 Fixes different off by ones
10438e1 Merge remote-tracking branch 'public/pr/1683' into development
6e962b2 Fix file permissions for ssl.h
d0e55a4 ssl_decrypt_buf: remove code for hashes that aren't used in TLS
94175a5 Refresh generated file
d2db09f Fix typo in documentation
9c82e2c Fix some whitespace issues
e533b22 Fix ordering and repetitions in config.h
3dc62a0 chachapoly: force correct mode for integrated API
26c3b0a Fix return type of internal function
5c38984 Use our habitual INTERNAL_ERROR debug message
a7fe25d Remove tests of #define's that don't exist
1bd9d58 Clarify comment about integer division by a variable
eb6ed71 Merge remote-tracking branch 'public/pr/1267' into development
2041a31 Merge remote-tracking branch 'public/pr/1402' into development
246cb05 Merge remote-tracking branch 'public/pr/1410' into development
b02f789 Merge remote-tracking branch 'public/pr/1470' into development
ba91994 Merge remote-tracking branch 'public/pr/1604' into development
d72700a Add ChangeLog entry for PR#1651
8edf2a3 Merge remote-tracking branch 'public/pr/1654' into development
02b9329 Fix MSan build without MBEDTLS_TIMING_C
0daf4ca Add test vectors for CCM*
4c57939 CCM*: Remove superfluous braces
143b319 CCM*: Make documentation consistent
20b4408 Fix Lucky13 attack protection when using HMAC-SHA-384
997e85c CCM*: Remove nested if
6b4bd3d CCM*: Improve documentation
95ab93d CCM*: Add minimal tests
b5734a2 CCM*: Add implementation
5dc8cfa CCM*: Add public API
45b79cf Treat warnings as errors for IAR
e7d3f8e Fix MicroBlaze register typo.
be78b07 chachapoly: warn against piecewise decryption
fa0c47d Fix typo in doc and copy missing warning
f4f01b6 Check return values from lower modules
1729789 Misc style adjustments
98fae6d ChaCha20: move working state from ctx to stack
9620f9b Rm mbedtls_ prefix form static functions
c22e61a Add ifdef for selftest in header file
fb78c90 Use recently-introduced platform_util module
39f2561 Fix edit mistake in cipher_wrap.c
3798b6b Add some error codes and merge others
234e1ce cipher: add stream test vectors for chacha20(poly1305)
32902e6 cipher: handle ChaCha20 as a stream cipher
c0dfcd4 Simplify selftest functions using macros
ceb1225 chachapoly: add test for state flow
444f711 poly1305: add test with multiple small fragments
59d2c30 chachapoly: add test for parameter validation
a8fa8b8 poly1305: add test for parameter validation
2aca236 chacha20: add test for parameter validation
fce88b2 Fix selftest verbosity in test suites
69767d1 cipher: add chachapoly test vector + unauth case
1465602 poly1305: fix bug in starts() and add test for it
55c0d09 chacha20: fix bug in starts() and add test for it
7296771 chachapoly: add test with unauthentic data
528524b Reduce size of buffers in test suites
d6aea18 Add Chacha20-Poly1305 to benchmark.c
b8bd80a Add FEATURE_NOT_AVAILABLE error codes.
5ef92d3 chachapoly: adjust parameter order
b1ac5e7 poly1305: adjust parameter order
b500f8b Update documentation to match new guidelines.
fe725de cipher: use new functions from chachapoly
346b8d5 chachapoly: split crypt_and_mac() to match GCM API
56206c4 Remove semi-internal chacha20_keystrem_block()
502f189 ChaCha20: allow in-place en/decryption
dca3a5d Rename aead_chacha20_poly1305 to chachapoly
4edd51b Rename poly1305_setkey() to poly1305_starts()
b7e9900 Avoid using %zu in selftest functions
823b7a0 Add missing extern "C" guard to new headers
95d0bdb Adapt the _ALT style to our new standard
ce8314f Add ChangeLog entry for new features.
e6e7968 Minor style and formatting fixes.
b6897f6 Correct signedness of printf specifier in self tests
16b04ce Fix unused function warning under certain configurations.
dca6abb Fix test suite when GCM Is disabled, but AEAD_ChaCha20_Poly1305 is enabled.
6155cc8 Add ChaCha20 test vectors from RFC 7539
4d8f87b Add ChaCha20/Poly1305 ciphers to the selftest program
dedf4a3 Adjust verbose self-test output to match other ciphers.
8fe4701 Add ChaCha20+Poly1305 to the Cipher module
a310c5e Allow some parameters to be NULL if the length is 0.
b8025c5 Implement AEAD-ChaCha20-Poly1305.
adc32c0 Add Poly1305 authenticator algorithm (RFC 7539)
bd92062 Add ChaCha20 to the Cipher module
34b822c Initial implementation of ChaCha20
d0f143b Update CTR doc for the 64-bit block cipher
4f24e95 Update CTR doc for other 128-bit block ciphers
f584286 Slightly tune ARIA CTR documentation
e95092d Change the value of fno-sanitize-recover
a64fba4 Remove double declaration of mbedtls_ssl_list_ciphersuites
2f3a581 Merge remote-tracking branch 'public/pr/1178' into development
f889202 Merge remote-tracking branch 'public/pr/1434' into development
8a1b2c8 Update CTR documentation
8c75421 Add no symbols warning fix to ChangeLog
0e98e88 Silence no symbols warn on apple & Makefile
7f3ef27 silence "no symbols" warnings on apple clang
7124fb6 Use zeroize function from new platform_util
a3712be Merge branch 'development' into iotssl-1941-aria-ciphersuites
0960b80 Move to new header style for ALT implementations
c089312 Add ifdef for selftest in header file
2df4bfe Fix typo in comments
565e4e0 Use more appropriate type for local variable
08c337d Remove useless parameter from function
89924dd Wipe sensitive info from the stack
12e2fbd Style adjustments
d418b0d Fix typo in comment
9d41073 Fix typos from copy-pasting
4d393b9 Add check-files.py to travis.yml
2699de3 Add check-files.py to pre-push.sh
a07039c Add check-files.py to all.sh
10d9ce3 Add script for source integrity checking
c4bd8ec Merge remote-tracking branch 'upstream-public/pr/1446' into development
11999bb Fix minor code style issues
cdd97fd Merge remote-tracking branch 'upstream-public/pr/1433' into development
707e962 Update visualc project files
6087f20 Fix memory leak in mbedtls_x509_csr_parse
a331e0f Merge remote-tracking branch 'upstream-restricted/pr/421' into development-proposed
fb19399 Merge remote-tracking branch 'upstream-public/pr/1498' into development-proposed
09c4e7e Merge remote-tracking branch 'upstream-public/pr/1486' into development-proposed
54306c1 Add more SNI/DTLS tests
f77d3d3 Rename SNI/DTLS tests in ssl-opt.sh script
0b3f00c Avoid -Wformat-truncation warning on gcc7
276b9a6 ssl_server2: get op_name from context in ssl_async_resume as well
9ceae8b Clarify "as directed here" in SSL async callback documentation
ea5fab8 SSL async callbacks documentation: clarify resource cleanup
26d01bc Async callback: use mbedtls_pk_check_pair to compare keys
1febfef Rename mbedtls_ssl_async_{get,set}_data for clarity
6a8cb36 Fix copypasta in the async callback documentation
807d74a SSL async callback: cert is not always from mbedtls_ssl_conf_own_cert
0b53e24 ssl_async_set_key: detect if ctx->slots overflows
deda75a Fix missing continuation indicator in ssl-opt.sh
37289cd SSL async tests: tighten a few log checks in some test cases
20deb01 Improve documentation of the async callback's crypto parameters
12d0cc1 Add test case for SSL async resume after resume
9de55fa Fix uninitialized variable in ssl_server2
5bea9f6 Don't use the printf format %zd
7830073 Change boolean bitfield to unsigned
5ffe41c Turn on MBEDTLS_SSL_ASYNC_PRIVATE by default
ac5e8a3 Document that callbacks must not return arbitrary SSL errors
8f97af7 Don't pass the async config data to async callbacks
e141638 Finish writing an unfinished comment
a36ac4f New wrapper mbedtls_status_is_ssl_in_progress(ret)
0fd90dd ssl_prepare_server_key_exchange: clarify where the signature is written
2481a71 Doxygen formatting improvements
c912572 ssl_server2: merge redundant async_private_error=resume/pk
d326883 Document what the SSL async sign callback needs to do with RSA
ceb541b ssl_server2: rename delay in ssl_async_operation_context_t
22e695f Be more precise about when a variable is unused
ad28bf0 Documentation improvements
168dae8 Comment formatting and whitespace fixes
df13d5c Pass the SSL context to async callbacks
9b562d5 mbedtls_ssl_handshake_free: take the SSL context as argument
2e33337 Fix invalid data being accepted in RSA-decryption-based ciphersuites
b74a1c7 Rename MBEDTLS_SSL_ASYNC_PRIVATE_C to MBEDTLS_SSL_ASYNC_PRIVATE
f112725 Style and grammar fixes
12ab5d4 Don't shadow the variable p
b44692f Merge branch 'mbedtls_ssl_get_key_exchange_md_ssl_tls-return_hashlen' into tls_async_server-2.9
8491406 Remove preprocessor directives around platform_util.h include
6698d2f Fix style for mbedtls_mpi_zeroize()
56e06db Improve mbedtls_platform_zeroize() docs
708c5cb mbedtls_zeroize -> mbedtls_platform_zeroize in docs
d0ef468 Reword config.h docs for MBEDTLS_PLATFORM_ZEROIZE_ALT
bc7bdbf Organize CMakeLists targets in alphabetical order
21b376b Organize output objs in alfabetical order in Makefile
ca1d742 mbedtls_ssl_get_key_exchange_md_tls1_2: return hashlen
0329d72 SSL asynchronous decryption (server side): update ChangeLog
fcca9d8 SSL asynchronous decryption (server side): tests
2c6078e SSL asynchronous decryption (server side)
bcd98a5 ssl_parse_encrypted_pms refactor: prepare, decrypt, return
422ccab ssl_parse_encrypted_pms refactor: prepare for remote private key
d9bfcab SSL asynchronous signature: fix renegotiation tests
e630aed SSL asynchronous signature: ChangeLog entry
dbb14e0 all.sh: run ssl-opt.sh on ECJPAKE, SSL async
9d12b4c SSL asynchronous signature: turn off by default
60ee4ca SSL asynchronous signature: basic test of recovery after error
f9f15ae ssl_write_server_key_exchange refactor: don't use p at all
d3eb061 ssl_write_server_key_exchange refactor: minor cleanup
ebd30ae ssl_write_server_key_exchange refactor: ssl_resume_server_key_exchange
d04d292 Get rid of useless handshake field out_async_start
ab50f83 Improve documentation of async operation start callbacks
7ab013a ssl_write_server_key_exchange refactor: move signature_len out
1004c19 ssl_write_server_key_exchange refactor: don't use p in the signing phase
184a3fa ssl_write_server_key_exchange refactor: create ssl_prepare_server_key_exchange
3ce9b90 ssl_write_server_key_exchange refactor: remove dig_signed_len
3665f1d SSL asynchronous signature: test cases
4bf9a28 SSL asynchronous signature: first implementation
ebd652f ssl_write_server_key_exchange: calculate hashlen explicitly
e1efdf9 ssl_write_server_key_exchange: don't hard-code max hash size
e198df5 ssl_pick_cert: use the public key for can_do
9eb5e9a SSL asynchronous private key operation callbacks: test server
8bf79f6 SSL asynchronous private key operation callbacks: interface
59e83d9 Add conf parameter to mbedtls_ssl_handshake_free
fe1c093 ssl_write_server_key_exchange refactor: remove redundant variable n
81d4e89 Don't rely on private key metadata in SSL
e5b5bd7 Allocate a unique err code for MBEDTLS_ERR_AES_BAD_INPUT_DATA
3f7f817 Check invalid nc_off
14a8b59 Fix doxygen error for MBEDTLS_PLATFORM_ZEROIZE_ALT
c58787f Update docs for MBEDTLS_PLATFORM_ZEROIZE_ALT in config.h
3ea559e Fix alignment in makefile
eecea0e Update zeroize test to use mbedtls_platform_zeroize()
9644983 Add platform_utils and zeroize to visualc files
82934be Do not install zeroize program in CMakeLists
1f6301b Rename mbedtls_zeroize to mbedtls_platform_zeroize
904e1ef Make utils module part of the platform
ae8e306 Fix docs typos for zeroize related features/test
757cd72 Update license headers year and branding
42defd1 Improve docs for zeroize.c and test_zeroize.gdb
1e8ea5f Improve docs for mbedtls_zeroize() and add refs
6606d5c Add config.h docs for MBEDTLS_UTILS_ZEROIZE_ALT
1962405 Justify moving zeroize() to utils in ChangeLog
806f403 Improve detection of program exit code in gdb script
6e34e63 Fix style in programs/test/zeroize.c
7111a0d Change test_zeroize.gdb script breakpoint due to zeroize.c change
88f8f41 Move zeroize func call to end of program in zeroize.c
0bd4237 Fix formatting in utils.c file comment
ecd1891 Change mbedtls_zeroize() to prevent optimizations
2967381 Extend zeroize tests to multiple optimizations
24768bf Improve test_zeroize.gdb breakpoint
b1262a3 Allow compile-time alternate to mbedtls_zeroize()
e32df08 Remove individual copies of mbedtls_zeroize()
d0d7bf6 Add gdb zeroize test when compiling with clang
f2d1792 Document test_zeroize.gdb script
c6b0abd Fix alignment of Makefiles
9a65b1d Add utils.h ChangeLog entry
ddebc49 Add gdb script to test mbedtls_zeroize()
5ab74a1 Add programs/test/zeroize.c to test mbedtls_zeroize
614d9c0 Add a utils.h file that contains common functions
418527b Fix minor issues with command line options
c4ec716 Fix uninitialized var in check-generated-files.sh
dfeda48 Remove VS project files from deleted example apps
5121d4b Remove refs to VS6 from generate_visualc_files.pl
4c1e2ec Check generated-visualc-files in check-generated-files
3c5f949 genereate_visualc_files.pl deletes old files
60bc47d library: Port to Haiku.
8339c8f x509.c: Remove unused includes
df60856 Only redefine _WIN32_WINNT macro when < 0x0501
7869680 Updated abi_check.py docstrings
fe60132 Move a buffer size test before the first relevant read
c33c7c8 Copy DartConfiguration.tcl, needed for make memcheck
533407a Use "#!/usr/bin/env perl" as shebang line.
8d54c06 Use correct version of snprintf on Windows
be03836 Fix some comments regarding what files are symlinked
b2f09c3 Support out-of-tree testing with CMake: add ChangeLog entry.
0114ffc all.sh: Verify out-of-tree testing with CMake
a71d64c all.sh: fix cleanup happening during an out-of-tree build
31b07e2 all.sh: be more conservative when cleaning up CMake artefacts
8405257 Support out-of-tree testing with CMake
38d8165 all.sh: add opposites to all boolean options
8a244c9 all.sh: option parsing: reduce vertical spread
2623296 all.sh: with --no-armcc, don't call armcc from output_env.sh
a6f430f Fix current directory check
127c5af Add copyright to abi_check script
7c2dd58 Add script for ABI compatibility checking
ce5673c Add reference to github issue in compat.sh
b4ef45b all.sh: build with -O -Werror in the full config
df761d5 Fix build with gcc -O -Wall
366e1b0 aria: fix comment on aria_a function
977dc36 aria test suite: uniformize line wrapping
f6b787c Fix typo in documentation (CTR warning)
2166214 aria: improve compiler compat by using __asm
2078725 aria: check arm arch version for asm
8abc349 aria: rationalize buffer sizes in test functions
d82d791 aria: fix more whitespace
906bc90 aria: number of rounds is non-negative
7fc0879 aria: more whitespace fixes
5ad88b6 aria: define constants for block size and max rounds
3c80009 aria: add error codes for hw implementations
f3a46a9 aria: fix some typos in comments
c0bb66f aria: improve compiler inline compatibility
22997b7 block ciphers: improve CTR nonce warning
5aa4e3b aria: align documentation on AES
4231e7f Fix some whitespace and other style issues
fdd4354 config.h: SSL no longer uses ciphers directly
525168c aria: expand config.h entry: ciphersuites & caller
08d1e91 aria: add ChangeLog entry
2268b96 aria: disable by default in config.h
26b54fa aria: document optional asm usage in config.h
377b2b6 aria: optimize byte perms on Arm
fb0e4f0 aria: optimise byte perms on Intel
cac5008 aria: define P3 macro
f205a01 aria: comment implementation of A transform
35ad891 aria: internal names closer to standard document
64744f8 aria: define SLA() as sl(a())
8c76a94 aria: turn macro into static inline function
62e813c Add aria to benchmark program
a41ecda aria: closer to usual comment style
5645393 aria: use mbedtls_zeroize()
c76ceb6 aria: move conditional outside of loop
9cc8924 aria: use unsigned type for bit count
e1ad749 aria: clean up interface of internal macros
a6d639e aria: improve some comments & internal names
442f03b cmake: keep test list in alphabetic order
6b36892 Add compat.sh ARIA run to all.sh
bba6406 compat.sh: add remaining ARIA suites
af37f0f Add remaining ARIA suites to priority list
9decaf5 Document Aria suites as TLS 1.2-only
4db944c Don't declare unsupported ciphersuites
7299dfd compat.sh: add ARIA interop tests with OpenSSL
a0e4708 compat.sh: add self-interop tests for ARIA suites
392c2d2 compat.sh: run 1.2-only tests with DTLS too
841192b fixed a macro to uppercase for a test script (.._TLS_DH_anon_WITH.. -> _DH_ANON_WITH_)
c06e101 ARIA ciphersuites for TLS 1.2
07478d6 something to do with whitespaces
0fb47fe MBEDTLS_ARIA_ALT added as a feature
8df81e0 Test suite for ARIA
6ba68d4 ARIA init and free
3c0b53b ARIA build integration
259fa60 ARIA test vectors for CBC CFB CTR modes
41efbaa ARIA cipher implementation
0afe624 all.sh: add test with MBEDTLS_DEPRECATED_REMOVED
bb51cb3 remove additional zero byte when writing pub der
3d8c907 Compute outgoing MAC in temporary buffer for MAC-then-Encrypt
3f8271e Support only new CLang version
18b3c91 Address Azim's coments
22d989c Suport clang version 3.8
0049f78 check matching issuer crt and key for all algs
9839360 Fix all.sh check_tools function to handle paths
1a83445 Add SNI with DTLS tests to ssl-opt.sh script

git-subtree-dir: third_party/mbedtls/repo
git-subtree-split: 76dc0659f649d5d0eda0ff34322fb3ba7e6492cf
2018-11-02 15:36:26 -07:00
Jeff Bumgardner 8a94ede247 [docs] added link for OpenThread China and updated Doxygen TOC (#3261) 2018-11-02 14:48:20 -07:00
Yakun Xu e914c6ab6a [docs] add otUdpSend() usage (#3220) 2018-11-02 11:28:07 -07:00
Zhanglong Xia e2abb405c2 [clang-format] add diags to make pretty (#3252) 2018-11-01 21:37:46 -07:00
Zhanglong Xia 2aed617140 [tlv] update channel related TLVs to process channel page (#3240) 2018-11-01 21:35:53 -07:00
Yakun Xu 92bcf61a8e [link-raw] fix radio with multiple transmit buffers (#3239) 2018-11-01 21:34:51 -07:00
Sergey Polyakov 706b393a7b [mac] make sure network name is always updated (#3246) 2018-11-01 10:23:32 -07:00
Sergey Polyakov 53ff24a6b4 [mac] make sure network name is always null-terminated (#3246) 2018-11-01 10:23:32 -07:00
Yakun Xu 0743816acd [posix-app] unsupported radio file error (#3247) 2018-11-01 09:11:30 -07:00
Abtin Keshavarzian 9a7fc691b1 [mac] move "Mac::ChannelMask" to its own files "mac/channel_mask.hpp|cpp" (#3244) 2018-11-01 09:04:46 -07:00
Jonathan Hui 5c1aec2299 [cli] fix typo in CoapSecure (#3243) 2018-11-01 09:01:54 -07:00
rongli 1d617b9027 [thci] enhancements for ncp device (#3195)
- differentiate serial login scenarios and improve serial login experience
- shorten command sending and validating process
- fix ping issue (no impact on NCP DUT certification)
2018-11-01 08:38:39 -07:00
Yakun Xu f66753a469 [coaps] directly send DTLS message (#3232) 2018-10-31 13:47:13 -07:00
Jiacheng Guo 5f0791553a [clang-format] use cpp03 (#3194) 2018-10-31 12:31:09 -07:00
Yakun Xu aa0c3a7a70 [script] clang-format bootstrap on macOS (#3242) 2018-10-31 10:18:08 -07:00
Abtin Keshavarzian 728bd3e5a8 [mac] allow same operation to start from done callback handler (#3231)
This commit changes the `Mac` operation scheduling to allow
users to start a new operation from the done callback handler of
a previous operation. For example, calling `Mac::ActiveScan()`
from a previous `mActiveScanHandler` callback handler should
succeed.

This is realized by ensuring to call `FinishOperation()` before
invoking the done callback and after the callback, perform any
pending next operation by calling `PeformNextOperation()`.
2018-10-30 20:31:23 -07:00
Abtin Keshavarzian 3a4a61f7ca [radio] update "radio.h" documentations (#3230)
This commit updates the `radio.h` header file:
- Re-orders the definitions so keep the related functions close.
- Updates the documentation/comments.
- Uses `otPanId` and `otShortAddress` for function parameter types.
2018-10-30 12:24:52 -07:00
Abtin Keshavarzian 13fb20ed26 [mac] add "Mac::ExtAddress::GenerateRandom()" to create random address (#3228)
This commit adds method `GenerateRandom()` to `Mac::ExtAddress` to
generate a random IEEE 802.15.4 Extended Address. This method
replaces the `Mac` class `GenerateExtAddress()` method.
2018-10-30 12:23:32 -07:00
Łukasz Duda 014514442d [crypto] add support for ECDSA signing (#3218) 2018-10-30 12:23:10 -07:00
Joseph Newman e99ce0cf1f [efr32] implement otPlatTime* APIs (#3212) 2018-10-30 12:22:06 -07:00
Jonathan Hui cebfdbbeb3 [examples] change sInstance to instance (#3229) 2018-10-29 19:51:56 -07:00
Abtin Keshavarzian 9f2c56e620 [posix-app] check RCP capabilities and add support for stream log (#3215)
This commit contains the following changes:

- It adds code to `RadioSpinel::Init()` to get and check the RCP
  capabilities (`SPINEL_PROP_CAPS`) ensuring RCP supports radio/raw
  mode (`SPINEL_CAP_MAC_RAW`).

- It adds support for handling stream log `SPINEL_PROP_STREAM_LOG`
  property from RCP.

- It moves the existing code checking spinel version and radio
  capabilities of RCP into helper methods `CheckSpinelVersion()`
  and `CheckRadioCapabilities()`.
2018-10-29 19:50:25 -07:00
Abtin Keshavarzian a1a67fd2b6 [mac] use direct callbacks into mesh forwarder for send/recv (#3214)
This commit changes `Mac` implementation to use direct callbacks into
`MeshForwarder` to inform it of a frame reception or status of a
requested frame transmission. This changes replaces the `Mac::Sender`
and `Mac::Receiver` model.
2018-10-29 19:49:40 -07:00
Jonathan Hui 4452ed66e6 [cli] fix bug in printing coap peer address (#3227) 2018-10-29 12:40:52 -07:00
Yakun Xu 9551d0af7f [posix-app] fix typo of app logging (#3225) 2018-10-29 12:40:32 -07:00
Jonathan Hui d2b4da2dda [efr32] add missing instance header include (#3224) 2018-10-29 12:39:57 -07:00
Jonathan Hui 7c5b15c877 [style] apply clang-format-6.0 changes (#3222) 2018-10-29 12:38:06 -07:00
Jonathan Hui 5e4be05907 [style] change to clang-format-6.0 (#3222) 2018-10-29 12:38:06 -07:00
Yakun Xu dcc9b7e249 [coaps] fix disconnect in CoAP secure (#3221) 2018-10-29 12:37:24 -07:00
Abtin Keshavarzian bbd8b3466f [mac] simplify implementation of ENABLE_BEACON_RSP_WHEN_JOINABLE feature (#3216) 2018-10-26 14:58:10 -07:00
Jonathan Hui 980097c2ef [mbedtls] disable debug by default (#3217) 2018-10-26 13:05:28 -07:00
Łukasz Duda 34c6af0789 [coap] add support for Proxy-Uri option (#3211) 2018-10-25 21:10:16 -07:00
Łukasz Duda 52669a925a [coap] add support for CoAP header exceeding 255 bytes (#3210) 2018-10-25 21:08:17 -07:00
Łukasz Duda 597a81fd0a [dns] simplify defines name and clean up (#3209) 2018-10-25 12:58:29 -07:00
Łukasz Duda fe2a4974a6 [common-switches] add missing switches (#3208) 2018-10-25 12:57:55 -07:00
Łukasz Duda 9e1fa5957c [coap] remove unneeded namespace binding (#3207) 2018-10-25 10:21:34 -07:00
Yakun Xu 38ffdea2fe [posix-app] add option to print version of radio spinel (#3205) 2018-10-25 10:19:33 -07:00
Abtin Keshavarzian bfaa5c174d [posix-app] update default core config header file (#3204) 2018-10-25 10:18:06 -07:00
Kamil Sroka 71d9ba814c [nrf52840] update nRF52840 radio driver to version 1.2.2 (#3203) 2018-10-25 10:17:29 -07:00
Kamil Sroka 2446d36649 [nrf52840] fix possible permanent sleep in multiprotocol (#3202) 2018-10-25 10:16:40 -07:00
Abtin Keshavarzian 309bd09d75 [logging] remove aInstance as input parameter to logging macros (#3184) 2018-10-25 09:14:43 -07:00
Yakun Xu f0b5245f88 [platform-udp] fix processing message received from other interface (#3200) 2018-10-24 20:40:15 -07:00
Abtin Keshavarzian 1fa71a6ca2 [toranj] adding build script for different configs: ncp, rcp, posix-app (#3196) 2018-10-24 20:07:47 -07:00
Zhanglong Xia 8d440789ac [efr32] add a method to download image to specified EFR32 dev board (#3191) 2018-10-24 20:05:25 -07:00
Abtin Keshavarzian 6086e1a094 [core] add support for external OT vendor extension (#3183)
This commit contains the following changes:

- It adds a new configure option "--with-vendor-extension" allowing
  users to add a source file to be built along with OpenThread core
  library. `OPENTHREAD_ENABLE_VENDOR_EXTENSION` indicates whether
  this feature is enabled or not.

- It adds a class `Extension::ExtensionBase` which defines the hooks
  from OpenThread into the vendor extension module. Vendor extension
  code should inherit from this class and provide the implementation
  of the defined methods.

- A source file `extension_example.cpp` is added to provide an example
  on how to implement an OpenThread vendor extension.

- One of the build configuration under Travis CI posix target is
  updated to enable the vendor extension feature (using the example
  code) and verify the build.
2018-10-24 20:04:06 -07:00
Zhanglong Xia c0bfc9929b [efr32] enable platform efr32 to support dev board BRD4170A (#3189) 2018-10-23 22:26:58 -07:00
Zhanglong Xia af56b17bca [qos] rename message priority (#3159) 2018-10-23 15:14:49 -07:00
Yakun Xu 034e5ad03e [coverage] remove empty functions (#3179) 2018-10-23 09:55:30 -07:00
Abtin Keshavarzian a07751ec0d [travis] ensure to exit with error on toranj build failure (#3197) 2018-10-22 22:57:09 -07:00
Yakun Xu c58d9cc0b1 [border-agent] border agent state event (#3186) 2018-10-22 22:47:59 -07:00
rongli 04a2577cc6 [thci] fix paramiko scope issue when connecting to ncp device via ssh (#3192) 2018-10-22 22:31:57 -07:00
Yakun Xu 45567f515f [posix-app] remove pseudo reset (#3190) 2018-10-22 22:22:16 -07:00
e-rk ad610d8db8 [nrf52840] Add CCPREFIX variable to nRF52840 Makefile (#3182) 2018-10-22 21:22:42 -07:00
Shu Chen 71d4ad3e77 [nrf52840] fix the k802154Sync timer (#3181)
It may cause the issue that the timestamp provided by nrf_802154_received_timestamp_raw()
is not consistent with otPlatAlarmMicroGetNow().
2018-10-18 11:15:31 +02:00
Biswajit de1a3e6e32 [ncp] send Parent Response info on NCP FTD configuration (#3147) 2018-10-18 06:30:44 +02:00
Yakun Xu 72fa647805 [coaps] refine definition of CoapSecure::Connect (#3178) 2018-10-17 23:21:53 +02:00
Yakun Xu b0f84aa210 [coap] remove get port (#3177) 2018-10-17 23:18:55 +02:00
Yakun Xu c711dc9d0c [posix-app] support dry run (#3176) 2018-10-17 23:18:26 +02:00
Yakun Xu 465a46c4c8 [posix-app] clean headers in platform-posix.h (#3175) 2018-10-17 23:14:12 +02:00
Abtin Keshavarzian 4c6801ad73 [mac] invoke HandleTransmitDone from tasklet in case OT_ERROR_ABORT (#3173)
This commit re-uses the `mOperationTask` tasklet (in addition to it
being used for starting a scheduled MAC operation) to invoke the
`HandleTransmitDone()` in case of `OT_ERROR_ABORT` failure. This
ensures that frame retransmission attempt (in case of back-to-back
failures) are not done through the same long call chain.
2018-10-17 13:23:30 +02:00
e-rk 8a5b9fc5c0 [nrf52840] fix NCP radio not working on USB CDC UART (#3169) 2018-10-17 13:23:05 +02:00
Jonathan Hui 50bb212d86 [travis] add osx build check (#3164) 2018-10-17 13:22:35 +02:00
Abtin Keshavarzian 5b546fe22d [posix] add radio platform API to get/set tx power (#3152) 2018-10-17 13:22:16 +02:00
Yakun Xu a56666a6d0 [posix-app] define posix app exit code (#3156) 2018-10-16 20:05:57 -07:00
Abtin Keshavarzian 59545f5c61 [link-raw] retrasnmit frames on any error (#3172) 2018-10-16 19:59:55 -07:00
Jonathan Hui b13f22c03e [ip6] rename aEui64 to aExtAddress (#3171) 2018-10-16 19:58:50 -07:00
Shu Chen 71b90a6764 [time-sync] fix build issue with time sync enabled (#3167)
Also enable time sync in a travis check.
2018-10-16 19:58:34 -07:00
Yakun Xu 0b18d8ffad [settings] remove unused APIs (#3160) 2018-10-16 19:57:09 -07:00
Jonathan Hui 3fc9b95f81 [fuzz] exclude -fno-rtti when fuzzer is enabled (#3166) 2018-10-16 01:14:16 -07:00
Jing e18877210a [thci] conditionally import paramiko and change getting joiner state method (#3165) 2018-10-16 01:01:25 -07:00
Yakun Xu a2d0f97ae7 [macos] fix platform UDP on macOS (#3163) 2018-10-15 15:13:53 -07:00
Jonathan Hui 403ebf5c0c [docs] update txpower command (#3162) 2018-10-15 02:21:54 -07:00
Yakun Xu 232379a07c [posix-app] fix warnings on macOS (#3158) 2018-10-15 01:56:22 -07:00
Jonathan Hui ad50e4bedd [travis] fix scan-build check (#3155) 2018-10-15 01:51:28 -07:00
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 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
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
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 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 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 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
3950 changed files with 1058347 additions and 415910 deletions
-65
View File
@@ -1,65 +0,0 @@
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
version: 0.1.{build}
image: Visual Studio 2015
configuration:
- Release
platform:
- x64
- x86
- arm
clone_depth: 10
install:
- cmd: Bcdedit.exe -set TESTSIGNING ON
# Configure logging
- cmd: reg import tools\windows\ThreadEtw.reg
- ps: Restart-Computer -Force
- ps: Start-Sleep -s 10
before_build:
- cmd: ren "C:\Program Files (x86)\Windows Kits\10\include\00wdf" "wdf"
build:
project: etc/visual-studio/openthread.sln
verbosity: minimal
after_build:
- ps: $env:Platform2 = $env:Platform
- ps: If ($env:Platform2 -eq "x86") { $env:Platform2 = "Win32" }
# Set up the release directories
- cmd: .appveyor\make_release.cmd
# Install driver (only runs on x64)
- cmd: .appveyor\install_driver.cmd
test_script:
# Run the unit tests
- cmd: .appveyor\run_unit_tests.cmd
# Run the tests for the driver (only runs on x64)
#- cmd: .appveyor\test_driver.cmd
artifacts:
- path: release
name: release
- path: build\bin\AppPackages
name: app
-43
View File
@@ -1,43 +0,0 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM
IF NOT "%Platform%"=="x64" GOTO :EOF
pushd %APPVEYOR_BUILD_FOLDER%\build\bin\%Platform2%\%Configuration%\sys
REM Install the certifications to the cert stores
certutil -addstore root otLwf.cer
certutil -addstore TrustedPublisher otLwf.cer
cd otLwf
REM Install the NDIS LWF driver, otLwf.sys
netcfg.exe -v -l otlwf.inf -c s -i otLwf
popd
-87
View File
@@ -1,87 +0,0 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM
pushd %APPVEYOR_BUILD_FOLDER%
REM Make the release directories
mkdir release
mkdir release\include
mkdir release\include\openthread\
mkdir release\include\openthread\missing
mkdir release\include\openthread\platform
mkdir release\libs
mkdir release\symbols
mkdir release\symbols\TraceFormat
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\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
copy src\missing\stdbool\stdbool.h release\include\openthread\missing
copy src\missing\stdint\stdint.h release\include\openthread\missing
REM Copy the relavant binaries
copy build\bin\%Platform2%\%Configuration%\sys\otlwf\* release
copy build\bin\%Platform2%\%Configuration%\sys\otlwf.cer release
copy build\bin\%Platform2%\%Configuration%\sys\otlwf.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\sys\ottmp\* release
copy build\bin\%Platform2%\%Configuration%\sys\ottmp.cer release
copy build\bin\%Platform2%\%Configuration%\sys\ottmp.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\dll\otApi.dll release
copy build\bin\%Platform2%\%Configuration%\dll\otApi.lib release\libs
copy build\bin\%Platform2%\%Configuration%\dll\otApi.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\dll\otNodeApi.dll release
copy build\bin\%Platform2%\%Configuration%\dll\otNodeApi.lib release\libs
copy build\bin\%Platform2%\%Configuration%\dll\otNodeApi.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\exe\otCli.exe release
copy build\bin\%Platform2%\%Configuration%\exe\otCli.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\exe\otTestRunner.exe release
copy build\bin\%Platform2%\%Configuration%\exe\otTestRunner.pdb release\symbols
REM Copy the tools
copy tools\windows\* release
copy tools\windows\%Platform%\otInstall.exe release
copy "C:\Program Files (x86)\Windows Kits\10\Tools\%Platform%\devcon.exe" release
REM Generate the trace format files to decode the WPP logs
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64\TracePdb.exe" -f release\symbols\*.pdb -p release\symbols\TraceFormat
popd
-31
View File
@@ -1,31 +0,0 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM
IF "%Platform%"=="arm" GOTO :EOF
vstest.console /logger:Appveyor /inIsolation /platform:%Platform% build\bin\%Platform2%\%Configuration%\dll\UnitTests.dll
-47
View File
@@ -1,47 +0,0 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM
IF NOT "%Platform%"=="x64" GOTO :EOF
pushd %APPVEYOR_BUILD_FOLDER%\release
REM Query the driver state
sc query otlwf
REM Run the basic driver test
otTestRunner.exe ..\tests\scripts\thread-cert Test_otLwf* appveyor
REM Grab the logs
mkdir logs
logman stop Thread -ets
copy %SystemRoot%\System32\LogFiles\WMI\Thread.* logs
popd
-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
-44
View File
@@ -1,44 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#
# astye does not return a non-zero exit code. This wrapper exists with a
# non-zero exit code if there is any output from astyle.
#
die() {
echo " *** ERROR: " $*
exit 1
}
set -x
[ -z "`$@`" ] || {
[ "$3" != "--dry-run" ] || die
}
+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: Cpp03
TabWidth: 4
UseTab: Never
...
+9 -6
View File
@@ -1,8 +1,11 @@
coverage:
ignore:
- "tests/*"
- "third_party/*"
status:
project: false
patch: false
project: off
patch: off
ignore:
- "tests/*"
- "third_party/*"
comment:
layout: "diff, flags, files"
-7
View File
@@ -36,10 +36,3 @@ configure.ac eol=lf
Makefile.am eol=lf
Makefile.in eol=lf
Makefile eol=lf
# Files normalized to always keep Windows line endings
*.vcxproj eol=crlf
*.vcxproj.filters eol=crlf
*.sln eol=crlf
*.rc text eol=crlf
*.inf text eol=crlf
+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.
+14
View File
@@ -1,5 +1,7 @@
*.a
*.bak
*.db
*.flash
*.gcda
*.gcno
*.log
@@ -12,6 +14,7 @@
*.suo
*.trs
*.user
*.bak
*~
.deps
.dirstamp
@@ -31,9 +34,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
+117 -23
View File
@@ -26,71 +26,165 @@
# POSSIBILITY OF SUCH DAMAGE.
#
language: generic
language: python
python: "3.6"
sudo: required
dist: trusty
dist: bionic
before_install:
- .travis/before_install.sh
- travis_retry .travis/before_install.sh
script:
- .travis/script.sh
before_script:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
fi
after_success:
- bash <(curl -s https://codecov.io/bash)
- .travis/after_success.sh
matrix:
stages:
- lint
- test
jobs:
include:
- env: BUILD_TARGET="posix-distcheck" VERBOSE=1
- env: BUILD_TARGET="posix-app-cli" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="posix-app-pty" VERBOSE=1 COVERAGE=1
os: linux
compiler: clang
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1
script: .travis/script.sh
- env: BUILD_TARGET="posix-app-pty" DAEMON=1 VERBOSE=1 COVERAGE=1
os: linux
compiler: gcc
- env: BUILD_TARGET="posix-ncp" VERBOSE=1
script: .travis/script.sh
- env: BUILD_TARGET="android-build" VERBOSE=1
os: linux
compiler: gcc
- env: BUILD_TARGET="pretty-check"
os: linux
- env: BUILD_TARGET="scan-build" CC="clang" CXX="clang++"
dist: trusty
python: "2.7" # The old Android build system only supports python2
script: .travis/script.sh
- env: BUILD_TARGET="posix-distcheck" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: clang
- env: BUILD_TARGET="arm-gcc49"
script: .travis/script.sh
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
- env: BUILD_TARGET="arm-gcc54"
script: .travis/script.sh
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1 VIRTUAL_TIME=1 TIME_SYNC=1
os: linux
compiler: gcc
- env: BUILD_TARGET="arm-gcc63"
script: .travis/script.sh
- env: BUILD_TARGET="posix-ncp" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
- env: BUILD_TARGET="posix" CC="clang" CXX="clang++"
script: .travis/script.sh
- env: BUILD_TARGET="posix-mtd" VERBOSE=1 VIRTUAL_TIME=1
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="scan-build"
os: linux
compiler: clang
- env: BUILD_TARGET="posix" CC="gcc" CXX="g++"
script: .travis/script.sh
- env: BUILD_TARGET="arm-gcc-4"
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="arm-gcc-5"
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="arm-gcc-6"
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="arm-gcc-7"
os: linux
compiler: gcc
script: .travis/script.sh
# Disable Arm GCC 8 until slow compile bug is fixed:
# https://github.com/openthread/openthread/issues/4053
# - env: BUILD_TARGET="arm-gcc-8"
# os: linux
# compiler: gcc
# script: .travis/script.sh
- env: BUILD_TARGET="posix" CC="gcc-5" CXX="g++-5"
os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
script: .travis/script.sh
- env: BUILD_TARGET="posix" CC="gcc-6" CXX="g++-6"
os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
script: .travis/script.sh
- env: BUILD_TARGET="posix" CC="gcc-7" CXX="g++-7"
os: linux
compiler: gcc
addons:
apt:
packages:
- gcc-7
- g++-7
script: .travis/script.sh
- env: BUILD_TARGET="posix" CC="gcc-8" CXX="g++-8"
os: linux
compiler: gcc
addons:
apt:
packages:
- gcc-8
- g++-8
script: .travis/script.sh
- env: BUILD_TARGET="posix" CC="gcc-9" CXX="g++-9"
os: linux
compiler: gcc
addons:
apt:
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
packages:
- gcc-9
- g++-9
script: .travis/script.sh
- env: BUILD_TARGET="posix-ncp-spi" VERBOSE=1
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1 TORANJ_POSIX_APP_RCP_MODEL=1
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="osx" VERBOSE=1
os: osx
language: generic
script: .travis/script.sh
- stage: lint
name: "Pretty Check"
os: linux
addons:
apt:
packages:
- clang-format-6.0
script: .travis/check-pretty
- env:
name: "Size Report"
os: linux
script: .travis/check-size
if: type = pull_request
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
#
# Copyright (c) 2019, 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.
#
[ -n "$BUILD_TARGET" ] || exit 0
set -e
codecov_upload() {
curl -s https://codecov.io/bash > codecov
chmod a+x codecov
# Assume gcov by default, and llvm-cov if CC is clang
if [[ -z $CC ]]; then
./codecov
elif "$CC" --version | grep -q gcc; then
./codecov
elif "$CC" --version | grep -q clang; then
./codecov -x "llvm-cov gcov"
fi
}
main() {
codecov_upload
}
main "$@"
+74 -38
View File
@@ -27,6 +27,8 @@
# POSSIBILITY OF SUCH DAMAGE.
#
[ -n "$BUILD_TARGET" ] || exit 0
die() {
echo " *** ERROR: " $*
exit 1
@@ -37,32 +39,46 @@ set -x
cd /tmp || die
[ $TRAVIS_OS_NAME != linux ] || {
(cd /etc/apt/sources.list.d && sudo rm -rf cassandra.list* couchdb.list* mongodb-3.4.list* rabbitmq_rabbitmq-server.list* chris-lea-redis-server.list* github_git-lfs.list* pgdg.list)
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 != 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
[ $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 != scan-build ] || {
sudo apt-get install clang || die
[ $BUILD_TARGET != posix-app-pty ] || {
sudo apt-get install socat expect || die
JOBS=$(getconf _NPROCESSORS_ONLN)
(
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 != 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,42 +86,62 @@ 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 ] || {
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 != 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
}
[ $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 != arm-gcc-8 ] || {
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
export PATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/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
}
[ $BUILD_TARGET != posix-distcheck ] || {
sudo apt-get install clang || die
sudo apt-get install llvm-3.4-runtime || die
sudo apt-get install llvm-runtime || die
}
[ $BUILD_TARGET != posix -o $CC != clang ] || {
sudo apt-get install clang || die
}
}
[ $TRAVIS_OS_NAME != osx ] || {
sudo easy_install pexpect || die
[ $BUILD_TARGET != cc2538 ] || {
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-mac.tar.bz2 || die
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-mac.tar.bz2 || die
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH || die
arm-none-eabi-gcc --version || 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
}
}
+109
View File
@@ -0,0 +1,109 @@
#!/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
make showcommands spi-hdlc-adapter
test -x out/target/product/generic/system/bin/ot-cli
test -x out/target/product/generic/system/bin/ot-ncp
test -x out/target/product/generic/system/bin/spi-hdlc-adapter
}
main "$@"
+140
View File
@@ -0,0 +1,140 @@
#!/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 expect || true
killall ot-ctl || true
killall ot-daemon || true
killall socat || true
exit $EXIT_CODE
}
build() {
make -f examples/Makefile-posix
make -f src/posix/Makefile-posix PLATFORM_NETIF=1 PLATFORM_UDP=1 UDP_FORWARD=0
}
check() {
trap at_exit INT TERM EXIT
SOCAT_OUTPUT=/tmp/ot-socat
OT_OUTPUT=/tmp/ot-output
socat -d -d pty,raw,echo=0 pty,raw,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-rcp)"
$RADIO_NCP_PATH 1 > $RADIO_PTY < $RADIO_PTY &
if [[ "${DAEMON}" = 1 ]]; then
sudo "$(pwd)/$(ls output/posix/*linux*/bin/ot-daemon)" ${OT_NCP_PATH} ${CORE_PTY} &
sleep 1
OT_CLI_CMD="$(pwd)/$(ls output/posix/*linux*/bin/ot-ctl)"
else
OT_CLI_CMD="$(pwd)/$(ls output/posix/*linux*/bin/ot-cli) ${OT_NCP_PATH} ${CORE_PTY}"
fi
sudo expect <<EOF > "${OT_OUTPUT}" &
spawn ${OT_CLI_CMD}
send "panid 0xface\r\n"
expect "Done"
send "ifconfig up\r\n"
expect "Done"
send "thread start\r\n"
expect "Done"
sleep 5
send "state\r\n"
expect "leader"
expect "Done"
send "extaddr\r\n"
expect "Done"
send "ipaddr\r\n"
expect "Done"
send "coex\r\n"
expect "Done"
wait
EOF
# wait until the node becomes leader
while true; do
sleep 5
if grep -q leader $OT_OUTPUT; then
break
else
echo 'Still waiting for leader'
fi
done
netstat -an | grep -q 61631 || die 'TMF port is not available!'
extaddr=$(awk '/extaddr/{getline; print}' $OT_OUTPUT | tr -d '\r\n')
echo "Extended address is: ${extaddr}"
LEADER_ALOC=fdde:ad00:beef::ff:fe00:fc00
# Retrievie extended address through network diagnostic get
coap_response=$(echo -n '120100' | xxd -r -p | coap-client -m POST coap://[${LEADER_ALOC}]:61631/d/dg -f- | xxd -p | grep 0008)
echo "CoAP response is: ${coap_response}"
# Verify CoAP response contains the extended address
[[ "${coap_response}" = *${extaddr}* ]] && echo 'Success' || die 'failed to get extended address'
}
main() {
case $1 in
check)
check
;;
*)
build
check
;;
esac
}
main "$@"
+74
View File
@@ -0,0 +1,74 @@
#!/bin/bash
#
# Copyright (c) 2019, 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 -x -o pipefail
setup_python()
{
python -m pip install flake8
}
check_python()
{
flake8 --config=script/pystyle.cfg tests tools
}
check_clang()
{
clang-format --version
./bootstrap
./configure
make pretty-check
}
main()
{
case $1 in
setup)
setup_python
;;
python)
check_python
;;
clang)
check_cpp
;;
'')
setup_python
check_python
check_clang
;;
*)
echo "USAGE: $0 [setup|python|clang]"
exit 1
;;
esac
}
main "$@"
+116
View File
@@ -0,0 +1,116 @@
#!/bin/bash
#
# Copyright (c) 2019, 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 -x -o pipefail
setup_arm_gcc_7()
{
if arm-none-eabi-gcc --version | grep -q 'Arm Embedded Processors 7'; then
return 0
fi
(cd /tmp/
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2)
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH
arm-none-eabi-gcc --version
}
size_nrf52840()
{
[ ${TRAVIS_PULL_REQUEST} != false ]
mkdir ../output
export MERGE_BASE_SHA=$(git merge-base HEAD ${TRAVIS_BRANCH})
# pull request
OPENTHREAD_FLAGS="BORDER_AGENT=1 BORDER_ROUTER=1 CHANNEL_MANAGER=1 CHANNEL_MONITOR=1 CHILD_SUPERVISION=1 COAP=1 COAPS=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DIAGNOSTIC=1 DISABLE_DOC=1 DNS_CLIENT=1 ECDSA=1 FULL_LOGS=1 JAM_DETECTION=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 SLAAC=1 SNTP_CLIENT=1 TIME_SYNC=1 UDP_FORWARD=1"
git checkout -- .
git clean -xfd
./bootstrap
make -f examples/Makefile-nrf52840 ${OPENTHREAD_FLAGS}
mv output/nrf52840 ../output/nrf52840-b
git checkout -f ${MERGE_BASE_SHA}
git submodule update --init
# base branch
git checkout -- .
git clean -xfd
./bootstrap
make -f examples/Makefile-nrf52840 ${OPENTHREAD_FLAGS}
mv output/nrf52840 ../output/nrf52840-a
curl -s "${SIZE_REPORT_URL}/bash" > size-report
chmod a+x size-report
./size-report init OpenThread
./size-report size ../output/nrf52840-a/bin/ot-cli-ftd ../output/nrf52840-b/bin/ot-cli-ftd
./size-report size ../output/nrf52840-a/bin/ot-cli-mtd ../output/nrf52840-b/bin/ot-cli-mtd
./size-report size ../output/nrf52840-a/bin/ot-ncp-ftd ../output/nrf52840-b/bin/ot-ncp-ftd
./size-report size ../output/nrf52840-a/bin/ot-ncp-mtd ../output/nrf52840-b/bin/ot-ncp-mtd
./size-report size ../output/nrf52840-a/bin/ot-rcp ../output/nrf52840-b/bin/ot-rcp
./size-report size ../output/nrf52840-a/lib/libopenthread-cli-ftd.a ../output/nrf52840-b/lib/libopenthread-cli-ftd.a
./size-report size ../output/nrf52840-a/lib/libopenthread-cli-mtd.a ../output/nrf52840-b/lib/libopenthread-cli-mtd.a
./size-report size ../output/nrf52840-a/lib/libopenthread-ftd.a ../output/nrf52840-b/lib/libopenthread-ftd.a
./size-report size ../output/nrf52840-a/lib/libopenthread-mtd.a ../output/nrf52840-b/lib/libopenthread-mtd.a
./size-report size ../output/nrf52840-a/lib/libopenthread-ncp-ftd.a ../output/nrf52840-b/lib/libopenthread-ncp-ftd.a
./size-report size ../output/nrf52840-a/lib/libopenthread-ncp-mtd.a ../output/nrf52840-b/lib/libopenthread-ncp-mtd.a
./size-report size ../output/nrf52840-a/lib/libopenthread-rcp.a ../output/nrf52840-b/lib/libopenthread-rcp.a
./size-report size ../output/nrf52840-a/lib/libopenthread-radio.a ../output/nrf52840-b/lib/libopenthread-radio.a
./size-report post
}
main()
{
case $1 in
setup)
setup_arm_gcc_7
;;
nrf52840)
size_nrf52840
;;
'')
setup_arm_gcc_7
size_nrf52840
;;
*)
echo "USAGE: $0 [setup|nrf52840]"
exit 1
;;
esac
}
main "$@"
+408 -132
View File
@@ -34,172 +34,448 @@ die() {
set -x
[ $BUILD_TARGET != pretty-check ] || {
export PATH=/tmp/astyle/build/gcc/bin:$PATH || die
./bootstrap || die
./configure || die
make pretty-check || die
}
python --version || die
[ $BUILD_TARGET != scan-build ] || {
./bootstrap || die
export CPPFLAGS="-DMBEDTLS_DEBUG_C"
export CPPFLAGS="${CPPFLAGS} -I${TRAVIS_BUILD_DIR}/third_party/mbedtls"
export CPPFLAGS="${CPPFLAGS} -I${TRAVIS_BUILD_DIR}/third_party/mbedtls/repo/include"
export CPPFLAGS="${CPPFLAGS} -DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
# UART transport
export CPPFLAGS="${CPPFLAGS} \
-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 \
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 \
-DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 \
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
-DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \
-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \
-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 \
-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 \
-DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1"
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-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 || die
scan-build --status-bugs -analyze-headers -v make || die
--enable-builtin-mbedtls=no \
--enable-cli \
--enable-executable=no \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--with-examples=posix || die
scan-build --status-bugs -analyze-headers -v make -j2 || die
# SPI transport
scan-build ./configure \
--enable-builtin-mbedtls=no \
--enable-cli \
--enable-executable=no \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--with-examples=posix || die
scan-build --status-bugs -analyze-headers -v make -j2 || die
}
[ $BUILD_TARGET != arm-gcc49 ] || {
[ $BUILD_TARGET != android-build ] || {
(cd .. && ${TRAVIS_BUILD_DIR}/.travis/check-android-build) || die
}
build_cc1352() {
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1 JOINER=1 SLAAC=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
}
build_cc2538() {
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1 JOINER=1 SLAAC=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
}
build_cc2650() {
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
}
build_cc2652() {
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1 JOINER=1 SLAAC=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
}
build_kw41z() {
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1 JOINER=1 SLAAC=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
}
build_nrf52811() {
# Default OpenThread switches for nRF52811 platform
OPENTHREAD_FLAGS="BORDER_ROUTER=1 COAP=1 DNS_CLIENT=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1"
# UART transport
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-nrf52811 $OPENTHREAD_FLAGS || die
arm-none-eabi-size output/nrf52811/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52811/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52811/bin/ot-rcp || die
# SPI transport for NCP
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
NCP_SPI=1 make -f examples/Makefile-nrf52811 $OPENTHREAD_FLAGS || die
arm-none-eabi-size output/nrf52811/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52811/bin/ot-rcp || die
# Build without transport (no CLI or NCP applications)
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52811 || die
}
build_nrf52840() {
# Default OpenThread switches for nRF52840 platform
OPENTHREAD_FLAGS="BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COAPS=1 COMMISSIONER=1 DEBUG=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 ECDSA=1 FULL_LOGS=1 IP6_FRAGM=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 SLAAC=1 SNTP_CLIENT=1 UDP_FORWARD=1"
# UART transport
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || 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-rcp || die
# USB transport with bootloader e.g. to support PCA10059 dongle
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
USB=1 BOOTLOADER=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || 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-rcp || die
# SPI transport for NCP
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
NCP_SPI=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || 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-rcp || die
# Build without transport (no CLI or NCP applications)
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
# Software cryptography
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
DISABLE_BUILTIN_MBEDTLS=0 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || 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-rcp || die
# Software cryptography with threading support
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
DISABLE_BUILTIN_MBEDTLS=0 MBEDTLS_THREADING=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || 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-rcp || die
}
build_qpg6095() {
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-qpg6095 || die
arm-none-eabi-size output/qpg6095/bin/ot-cli-ftd || die
arm-none-eabi-size output/qpg6095/bin/ot-cli-mtd || die
arm-none-eabi-size output/qpg6095/bin/ot-ncp-ftd || die
arm-none-eabi-size output/qpg6095/bin/ot-ncp-mtd || die
}
build_samr21() {
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.45.0.85.zip || die
unzip -qq asf-standalone-archive-3.45.0.85.zip || die
mv xdk-asf-3.45.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1 JOINER=1 SLAAC=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-gcc-4 ] || {
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/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
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=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
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
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[ $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
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
COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=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
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
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[ $BUILD_TARGET != arm-gcc63 ] || {
export PATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/bin:$PATH || die
[ $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-emsk || die
arc-elf32-size output/emsk/bin/ot-cli-ftd || die
arc-elf32-size output/emsk/bin/ot-cli-mtd || die
arc-elf32-size output/emsk/bin/ot-ncp-ftd || die
arc-elf32-size output/emsk/bin/ot-ncp-mtd || die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[ $BUILD_TARGET != arm-gcc-7 ] || {
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[ $BUILD_TARGET != arm-gcc-8 ] || {
export PATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH || die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[ $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
export CPPFLAGS=" \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
CPPFLAGS=-DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1 make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--with-examples=posix \
--disable-docs \
--disable-tests \
--with-vendor-extension=./src/core/common/extension_example.cpp || die
make -j 8 || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-mtd \
--with-examples=posix \
--disable-docs \
--disable-tests || die
make -j 8 || die
export CPPFLAGS=" \
-DOPENTHREAD_CONFIG_ANOUNCE_SENDER_ENABLE=1 \
-DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--enable-radio-only \
--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` || 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
REFERENCE_DEVICE=1 make -f examples/Makefile-posix distcheck || die
}
[ $BUILD_TARGET != posix-32-bit ] || {
./bootstrap || die
COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
REFERENCE_DEVICE=1 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
# readline supports pipe, editline does not
REFERENCE_DEVICE=1 COVERAGE=1 READLINE=readline make -f src/posix/Makefile-posix || die
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli) -v" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check || die
}
[ $BUILD_TARGET != posix-app-pty ] || {
./bootstrap
.travis/check-posix-app-pty || die
}
[ $BUILD_TARGET != posix-mtd ] || {
./bootstrap || die
REFERENCE_DEVICE=1 COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
}
[ $BUILD_TARGET != posix-ncp-spi ] || {
CPPFLAGS="-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1"
./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-examples=posix" || die
}
[ $BUILD_TARGET != posix-app-ncp ] || {
./bootstrap || die
REFERENCE_DEVICE=1 COVERAGE=1 VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
# enable code coverage for OpenThread posix radio
REFERENCE_DEVICE=1 COVERAGE=1 READLINE=readline make -f src/posix/Makefile-posix || die
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" 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
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
}
[ $BUILD_TARGET != toranj-test-framework ] || {
./tests/toranj/start.sh || die
}
[ $BUILD_TARGET != osx ] || {
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f src/posix/Makefile-posix || die
}
+2
View File
@@ -14,3 +14,5 @@ Nordic Semiconductor
Texas Instruments Incorporated
NXP Semiconductors
Synopsys, Inc.
Cascoda Limited
Silicon Laboratories, Inc
+390
View File
@@ -0,0 +1,390 @@
#
# 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)
OPENTHREAD_DEFAULT_VERSION := $(shell cat $(LOCAL_PATH)/.default-version)
OPENTHREAD_SOURCE_VERSION := $(shell git -C $(LOCAL_PATH) describe --always --match "[0-9].*" 2> /dev/null)
OPENTHREAD_COMMON_FLAGS := \
-DPACKAGE=\"openthread\" \
-DPACKAGE_BUGREPORT=\"openthread-devel@googlegroups.com\" \
-DPACKAGE_NAME=\"OPENTHREAD\" \
-DPACKAGE_STRING=\"OPENTHREAD\ $(OPENTHREAD_DEFAULT_VERSION)\" \
-DPACKAGE_VERSION=\"$(OPENTHREAD_SOURCE_VERSION)\" \
-DPACKAGE_TARNAME=\"openthread\" \
-DVERSION=\"$(OPENTHREAD_DEFAULT_VERSION)\" \
-DPACKAGE_URL=\"http://github.com/openthread/openthread\" \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
$(NULL)
# Enable required features for on-device tests.
ifeq ($(TARGET_BUILD_VARIANT),eng)
OPENTHREAD_COMMON_FLAGS += \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
$(NULL)
endif
# Enable all optional features for CI tests.
ifeq ($(TARGET_PRODUCT),generic)
OPENTHREAD_COMMON_FLAGS += \
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=0 \
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 \
$(NULL)
endif
include $(CLEAR_VARS)
LOCAL_MODULE := spi-hdlc-adapter
LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES := tools/spi-hdlc-adapter/spi-hdlc-adapter.c
include $(BUILD_EXECUTABLE)
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 := \
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
$(OPENTHREAD_COMMON_FLAGS) \
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_POSIX=1 \
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
$(NULL)
LOCAL_CPPFLAGS := \
-Wno-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/diags_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/logging_api.cpp \
src/core/api/message_api.cpp \
src/core/api/netdata_api.cpp \
src/core/api/random_crypto_api.cpp \
src/core/api/random_noncrypto_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_message.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/message.cpp \
src/core/common/notifier.cpp \
src/core/common/random_manager.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/diags/factory_diags.cpp \
src/core/mac/channel_mask.cpp \
src/core/mac/data_poll_handler.cpp \
src/core/mac/data_poll_sender.cpp \
src/core/mac/mac.cpp \
src/core/mac/mac_filter.cpp \
src/core/mac/mac_frame.cpp \
src/core/mac/mac_types.cpp \
src/core/mac/sub_mac.cpp \
src/core/mac/sub_mac_callbacks.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/netif.cpp \
src/core/net/udp6.cpp \
src/core/radio/radio_callbacks.cpp \
src/core/radio/radio_platform.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/device_mode.cpp \
src/core/thread/energy_scan_server.cpp \
src/core/thread/indirect_sender.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/ncp/hdlc.cpp \
src/ncp/spinel.c \
src/ncp/spinel_decoder.cpp \
src/ncp/spinel_encoder.cpp \
src/posix/platform/alarm.c \
src/posix/platform/entropy.c \
src/posix/platform/hdlc_interface.cpp \
src/posix/platform/logging.c \
src/posix/platform/misc.c \
src/posix/platform/radio_spinel.cpp \
src/posix/platform/settings.cpp \
src/posix/platform/system.c \
src/posix/platform/uart.c \
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/platform_util.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 $(OT_EXTRA_BUILD_CONFIG)
ifeq ($(filter -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=%,$(LOCAL_CFLAGS)),)
LOCAL_CFLAGS += \
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
$(NULL)
endif
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 \
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
$(NULL)
LOCAL_CFLAGS := \
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
$(OPENTHREAD_COMMON_FLAGS) \
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
-DOPENTHREAD_CONFIG_UART_CLI_RAW=1 \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_POSIX=1 \
-DOPENTHREAD_POSIX_APP_TYPE=2 \
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
$(NULL)
LOCAL_CPPFLAGS := \
-Wno-non-virtual-dtor \
$(NULL)
LOCAL_LDLIBS := \
-lutil
LOCAL_SRC_FILES := \
src/cli/cli.cpp \
src/cli/cli_coap.cpp \
src/cli/cli_commissioner.cpp \
src/cli/cli_console.cpp \
src/cli/cli_dataset.cpp \
src/cli/cli_joiner.cpp \
src/cli/cli_server.cpp \
src/cli/cli_uart.cpp \
src/cli/cli_udp.cpp \
src/posix/main.c \
$(NULL)
include $(OT_EXTRA_BUILD_CONFIG)
ifeq ($(filter -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=%,$(LOCAL_CFLAGS)),)
LOCAL_CFLAGS += \
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
$(NULL)
endif
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 \
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
$(NULL)
LOCAL_CFLAGS := \
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
$(OPENTHREAD_COMMON_FLAGS) \
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_POSIX=1 \
-DOPENTHREAD_POSIX_APP_TYPE=1 \
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
$(NULL)
LOCAL_CPPFLAGS := \
-Wno-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)
include $(OT_EXTRA_BUILD_CONFIG)
ifeq ($(filter -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=%,$(LOCAL_CFLAGS)),)
LOCAL_CFLAGS += \
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
$(NULL)
endif
LOCAL_STATIC_LIBRARIES = ot-core
include $(BUILD_EXECUTABLE)
+6 -7
View File
@@ -37,7 +37,7 @@ The OpenThread Project follows the "Fork-and-Pull" model for accepting contribut
Setup your GitHub fork and continuous-integration services:
1. Fork the [OpenThread repository](https://github.com/openthread/openthread) by clicking "Fork" on the web UI.
2. Enable [Travis CI](https://travis-ci.org/) and [AppVeyor](https://ci.appveyor.com/) by logging in the respective services with your GitHub account and enabling your newly created fork. We use Travis CI for Linux-based continuous integration checks and AppVeyor for Windows-based continuous integration checks. All contributions must pass these checks to be accepted.
2. Enable [Travis CI](https://travis-ci.org/) by logging in the respective service with your GitHub account and enabling your newly created fork. We use Travis CI for Linux-based continuous integration checks. All contributions must pass these checks to be accepted.
Setup your local development environment:
@@ -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 v6.0.0](http://releases.llvm.org/download.html#6.0.0) 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.
@@ -135,8 +134,8 @@ git checkout <branch-name>
git push origin <branch-name>
```
This will trigger the Travis CI and AppVeyor continuous-integration checks. You can view the results in the respective services. Note that the integration checks will report failures on occasion. If a failure occurs, you may try rerunning the test via the Travis and/or AppVeyor web UI.
This will trigger the Travis CI continuous-integration checks. You can view the results in the respective services. Note that the integration checks will report failures on occasion. If a failure occurs, you may try rerunning the test via the Travis web UI.
#### Submit Pull Request
Once you've validated the Travis CI and AppVeyor results, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
Once you've validated the Travis CI results, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
+6 -15
View File
@@ -32,25 +32,18 @@ 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 \
--enable-cli \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--with-examples=posix \
--enable-commissioner \
--enable-joiner \
--enable-dhcp6-client \
--enable-dhcp6-server \
--enable-dns-client \
--enable-application-coap \
--enable-border-router \
--enable-mac-filter \
$(NULL)
SUBDIRS = \
include \
src \
third_party \
src \
examples \
tests \
tools \
@@ -58,8 +51,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
+37 -144
View File
@@ -1,178 +1,61 @@
[![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]
[![Build Status][ot-docker-dev-svg]][ot-docker-dev]
---
# What is OpenThread?
# What is OpenThread?
OpenThread is...
OpenThread released by Google is...
<a href="http://threadgroup.org/technology/ourtechnology#certifiedproducts">
<img src="https://cdn.rawgit.com/openthread/openthread/ab4c4e1e/doc/images/certified.svg" alt="Thread Certified Component" width="150px" align="right">
</a>
**...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.
**...an open-source implementation of the [Thread](http://threadgroup.org/technology/ourtechnology) networking protocol.** Google 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/ot-br-posix) 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
[ot-logo]: doc/images/openthread_logo.png
[ot-travis]: https://travis-ci.org/openthread/openthread
[ot-travis-svg]: https://travis-ci.org/openthread/openthread.svg?branch=master
[ot-appveyor]: https://ci.appveyor.com/project/jwhui/openthread
[ot-appveyor-svg]: https://ci.appveyor.com/api/projects/status/r5qwyhn9p26nmfk3?svg=true
[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.
[ot-docker-dev]: https://hub.docker.com/r/openthread/environment
[ot-docker-dev-svg]: https://img.shields.io/docker/cloud/build/openthread/environment.svg?label=docker%20%7C%20dev
# 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="https://www.cascoda.com/"><img src="doc/images/ot-contrib-cascoda.png" alt="Cascoda" width="200px"></a><a href="https://www.google.com/"><img src="doc/images/ot-contrib-google.png" alt="Google" 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.particle.io/"><img src="doc/images/ot-contrib-particle.png" alt="Particle" width="200px"></a><a href="http://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.samsung.com/"><img src="doc/images/ot-contrib-samsung.png" alt="Samsung" width="200px"></a><a href="https://www.silabs.com/"><img src="doc/images/ot-contrib-silabs.png" alt="Silicon Labs" width="200px"></a><a href="https://www.st.com/"><img src="doc/images/ot-contrib-stm.png" alt="STMicroelectronics" 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>
<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>
# Getting started
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.
All end-user documentation and guides are located at [openthread.io](https://openthread.io). If you're looking to do things like...
### IEEE 802.15.4 Platform Support
* 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
* [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)
...then [openthread.io](https://openthread.io) is the place for you.
See the [Wiki Platform page](https://github.com/openthread/openthread/wiki/Platforms) for more detailed information on supported platforms.
> Note: For users in China, end-user documentation is available at [openthread.google.cn](https://openthread.google.cn).
### 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.
+10 -4
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
@@ -72,6 +75,8 @@
- The symbol used for the guard should be the file name, converted to all uppercase, with any spaces (“ “) or dots (“.”) converted to underscores (“_”).
- Function and Method Prototypes
- All void functions or methods shall explicitly declare and specify the void type keyword.
- Unused parameters
- All unused parameters shall be declared as such using the `OT_UNUSED_VARIABLE` macro at the top of a function or method before all local variable declarations.
### C
@@ -111,6 +116,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 v6.0.0](http://releases.llvm.org/download.html#6.0.0).
### 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.
@@ -122,8 +129,7 @@
- Names shall not give any idea of type, such as is done with System Hungarian notation.
- Case
- C preprocessor symbols should be all uppercase.
- All OpenThread names in the C language shall be in *snake case*.
- All OpenThread class, namespace, structure, method, function, enumeration, and type names in the C++ language shall be in *upper camel case*. Exception: the top level OpenThread namespace 'ot'.
- All OpenThread class, namespace, structure, method, function, enumeration, and type names in the C/C++ language shall be in *upper camel case*. Exception: the top level OpenThread namespace 'ot'.
- All OpenThread instantiated names of instances of classes, namespaces, structures, methods, functions, enumerations, and types as well as method and function parameters in the C++ language shall be in *lower camel case*.
- Symbol Qualification
- All OpenThread C public data types and free functions should have `ot` prepended to their name.
@@ -171,7 +177,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 Python 3.
## Conventions and Best Practices
+288 -689
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
+14 -3
View File
@@ -32,10 +32,21 @@ 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 \
draft-rquattle-spinel-unified.html \
draft-rquattle-spinel-unified.txt \
$(srcdir)/images/ot-contrib-arm.png \
$(srcdir)/images/ot-contrib-cascoda.png \
$(srcdir)/images/ot-contrib-google.png \
$(srcdir)/images/ot-contrib-nordic.png \
$(srcdir)/images/ot-contrib-nxp.png \
$(srcdir)/images/ot-contrib-particle.png \
$(srcdir)/images/ot-contrib-qc.png \
$(srcdir)/images/ot-contrib-qorvo.png \
$(srcdir)/images/ot-contrib-samsung.png \
$(srcdir)/images/ot-contrib-silabs.png \
$(srcdir)/images/ot-contrib-stm.png \
$(srcdir)/images/ot-contrib-synopsys.png \
$(srcdir)/images/ot-contrib-ti.png \
$(srcdir)/images/ot-contrib-zephyr.png \
$(NULL)
#
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.8 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: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

-114
View File
@@ -1,114 +0,0 @@
#
# Copyright (c) 2016, Nest Labs, Inc.
# 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.
#
XML2RFC_CACHE_DIR ?= $(HOME)/.cache/xml2rfc
TOOL_PREFIX = $(DOCKER) run --rm --user=`id -u`:`id -g` -v `pwd`:/rfc -v $(XML2RFC_CACHE_DIR):/var/cache/xml2rfc paulej/rfctools
DOCKER ?= docker
MD2RFC ?= $(TOOL_PREFIX) md2rfc
XML2RFC ?= $(TOOL_PREFIX) xml2rfc
MMARK ?= $(TOOL_PREFIX) mmark
SED ?= sed
RM_F ?= rm -f
MKDIR_P ?= mkdir -p
SOURCE_DATE := $(shell (TZ=UTC git log -n 1 --date=iso-strict-local --pretty=format:%ad 2> /dev/null || date -u +"%Y-%m-%dT%H:%M:%SZ" ) | sed 's/+00:00$$/Z/')
SOURCE_VERSION ?= $(shell git describe --dirty --always --match "--PoIsOn--" 2> /dev/null)
# -------------
SRC := $(wildcard draft-*.md) $(wildcard draft-*.md.in)
XML := $(patsubst %.md,%.xml,$(patsubst %.md.in,%.xml,$(SRC)))
TXT := $(patsubst %.md,%.txt,$(patsubst %.md.in,%.txt,$(SRC)))
HTML := $(patsubst %.md,%.html,$(patsubst %.md.in,%.html,$(SRC)))
all: $(XML) $(TXT) $(HTML)
clean:
$(RM_F) $(XML) $(TXT) $(HTML) $(patsubst %.md.in,%.md,$(wildcard draft-*.md.in))
$(XML2RFC_CACHE_DIR):
$(MKDIR_P) "$(XML2RFC_CACHE_DIR)"
%.md: %.md.in
$(SED) 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/g;s/@SOURCE_DATE@/$(SOURCE_DATE)/g' < $< > $@
%.xml: %.md
$(MMARK) -xml2 -page $< $@
$(SED) -i "" -e 's/fullname="James Woodyatt"/fullname="James Woodyatt" role="editor"/' $@
%.html: %.xml $(XML2RFC_CACHE_DIR)
$(XML2RFC) --html $<
%.txt: %.xml $(XML2RFC_CACHE_DIR)
$(XML2RFC) --text $<
# -------------
draft-rquattle-spinel-basis.xml: \
draft-rquattle-spinel-basis.md \
spinel-commands.md \
spinel-data-packing.md \
spinel-example-sessions.md \
spinel-feature-host-buffer-offload.md \
spinel-feature-network-save.md \
spinel-frame-format.md \
spinel-framing.md \
spinel-prop-core.md \
spinel-prop-debug.md \
spinel-prop-ipv6.md \
spinel-prop-mac.md \
spinel-prop-net.md \
spinel-prop-phy.md \
spinel-prop.md \
spinel-status-codes.md \
spinel-tech-thread.md \
spinel-test-vectors.md \
$(NULL)
draft-rquattle-spinel-unified.xml: \
draft-rquattle-spinel-unified.md \
spinel-commands.md \
spinel-data-packing.md \
spinel-example-sessions.md \
spinel-feature-host-buffer-offload.md \
spinel-feature-network-save.md \
spinel-frame-format.md \
spinel-framing.md \
spinel-prop-core.md \
spinel-prop-debug.md \
spinel-prop-ipv6.md \
spinel-prop-mac.md \
spinel-prop-net.md \
spinel-prop-phy.md \
spinel-prop.md \
spinel-status-codes.md \
spinel-tech-thread.md \
spinel-test-vectors.md \
$(NULL)
@@ -1,109 +0,0 @@
%%%
title = "Spinel: A protocol basis for control and management of IPv6 network interface co-processors"
abbrev = "Spinel Basis"
category = "std"
docName = "draft-rquattle-spinel-basis"
ipr = "trust200902"
keyword = ["Spinel", "IPv6", "NCP"]
date = @SOURCE_DATE@
[pi]
editing = "yes"
compact = "yes"
subcompact = "yes"
comments = "yes"
[[author]]
initials = "R."
surname = "Quattlebaum"
fullname = "Robert S. Quattlebaum"
organization = "Nest Labs, Inc."
[author.address]
email = "rquattle@nestlabs.com"
[author.address.postal]
street = "3400 Hillview Ave."
city = "Palo Alto"
region = "California"
code = "94304"
country = "USA"
[[author]]
initials = "j.h."
surname = "woodyatt"
fullname = "james woodyatt"
organization = "Nest Labs, Inc."
role = "editor"
[author.address]
email = "jhw@nestlabs.com"
[author.address.postal]
street = "3400 Hillview Ave."
city = "Palo Alto"
region = "California"
code = "94304"
country = "USA"
%%%
.# Abstract
This document specifies the basis of the Spinel protocol, which facilitates the control and management of IPv6 network interfaces on devices where general purpose application processors offload network functions at their interfaces to network co-processors (NCP) connected by simple communication links like serial data channels. Spinel was initially designed for use with Thread network co-processors, but its basis is general purpose and intended to be easily adapted to other types of IPv6 network interface.
{mainmatter}
# Introduction #
Spinel is a host-controller protocol designed to enable interoperation over simple serial connections between general purpose device operating systems (OS) and network co-processors (NCP) for the purpose of controlling and managing their IPv6 network interfaces, achieving the following goals:
* Adopt a layered approach to the protocol design, allowing future support for other types of IPv6 link.
* Minimize the number of required commands/methods by supporting a rich, property-based programming interface.
* Support NCPs capable of multiple simultaneous IPv6 interfaces.
* Support NCPs capable of communicating simultaneously on more than one physical link.
* Gracefully handle the addition of new features and capabilities without necessarily breaking backward compatibility.
* Be as minimal and light-weight as possible without unnecessarily sacrificing flexibility.
On top of this core framework, properties and commands enable various common features of IPv6. In related and forthcoming documents, the Spinel protocol is extended to support NCP implementations for specific IPv6 link types, e.g. Thread.
{{spinel-frame-format.md}}
{{spinel-data-packing.md}}
{{spinel-commands.md}}
{{spinel-prop.md}}
{{spinel-status-codes.md}}
{{spinel-tech-thread.md}}
{{spinel-feature-network-save.md}}
{{spinel-feature-host-buffer-offload.md}}
{{spinel-feature-jam-detect.md}}
{{spinel-feature-gpio.md}}
{{spinel-feature-trng.md}}
{{spinel-security-considerations.md}}
{backmatter}
{{spinel-framing.md}}
{{spinel-test-vectors.md}}
{{spinel-example-sessions.md}}
{{spinel-basis-glossary.md}}
# Acknowledgments #
Thread is a registered trademark of The Thread Group, Inc.
Special thanks to Nick Banks, Jonathan Hui, Abtin Keshavarzian, Piotr Szkotak, Arjuna Sivasithambaresan and Martin Turon for their substantial contributions and feedback related to this document.
This document was prepared using [mmark](https://github.com/miekg/mmark) by (Miek Gieben) and [xml2rfc (version 2)](http://xml2rfc.ietf.org/).
@@ -1,174 +0,0 @@
%%%
title = "Spinel Host-Controller Protocol"
abbrev = "Spinel Protocol (Unified)"
category = "info"
docName = "draft-rquattle-spinel-unified-@SOURCE_VERSION@"
ipr = "noDerivativesTrust200902"
keyword = ["Spinel", "IPv6", "NCP"]
date = @SOURCE_DATE@
submissionType = "independent"
[pi]
editing = "yes"
compact = "yes"
subcompact = "yes"
comments = "yes"
[[author]]
initials = "R."
surname = "Quattlebaum"
fullname = "Robert S. Quattlebaum"
organization = "Nest Labs, Inc."
[author.address]
email = "rquattle@nestlabs.com"
[author.address.postal]
street = "3400 Hillview Ave."
city = "Palo Alto"
region = "California"
code = "94304"
country = "USA"
[[author]]
role = "editor"
initials = "J.H."
surname = "Woodyatt"
fullname = "James Woodyatt"
organization = "Nest Labs, Inc."
[author.address]
email = "jhw@nestlabs.com"
[author.address.postal]
street = "3400 Hillview Ave."
city = "Palo Alto"
region = "California"
code = "94304"
country = "USA"
%%%
.# Abstract
This document describes the Spinel protocol, which facilitates the control and
management of IPv6 network interfaces on devices where general purpose
application processors offload network functions at their interfaces to network
co-processors (NCP) connected by simple communication links like serial data
channels. While initially developed to support Thread(R), Spinel's layered
design allows it to be easily adapted to other similar network technologies.
This document also describes various Spinel specializations, including support
for the Thread(R) low-power mesh network technology.
{mainmatter}
# Introduction #
Spinel is a host-controller protocol designed to enable interoperation over simple serial connections between general purpose device operating systems (OS) and network co-processors (NCP) for the purpose of controlling and managing their IPv6 network interfaces, achieving the following goals:
* Adopt a layered approach to the protocol design, allowing future
support for other network protocols.
* Minimize the number of required commands/methods by providing a
rich, property-based API.
* Support NCPs capable of being connected to more than one network
at a time.
* Gracefully handle the addition of new features and capabilities
without necessarily breaking backward compatibility.
* Be as minimal and light-weight as possible without unnecessarily
sacrificing flexibility.
On top of this core framework, we define the properties and commands
to enable various features and network protocols.
## About this Draft ##
This document is currently in a draft status and is changing often.
This section discusses some ideas for changes to the protocol that
haven't yet been fully specified, as well as some of the impetus for
the current design.
### Scope ###
The eventual intent is to have two documents: A Spinel basis document
which discusses the network-technology-agnostic mechanisms and a
Thread(R) specialization document which describes all of the Thread(R)-specific
implementation details. Currently, this document covers both.
### Renumbering ###
Efforts are currently maintained to try to prevent overtly
backward-incompatible changes to the existing protocol, but if you are
implementing Spinel in your own products you should expect there to be
at least one large renumbering event and major version number change
before the standard is considered "baked". All changes will be clearly
marked and documented to make such a transition as easy as possible.
To allow conclusive detection of protocol (in)compatibility between
the host and the NCP, the following commands and properties are
already considered to be "baked" and will not change:
* Command IDs zero through eight. (Reset, No-op, and Property-Value
Commands)
* Property IDs zero through two. (Last status, Protocol Version, and
NCP Version)
Renumbering would be undertaken in order to better organize the
allocation of property IDs and capability IDs. One of the initial
goals of this protocol was for it to be possible for a host or NCP to
only implement properties with values less than 127 and for the NCP to
still be usable---relegating all larger property values for extra
features or other capabilities that aren't strictly necessary. This
would allow simple implementations to avoid the need to implement
support for PUIs ((#packed-unsigned-integer)).
As time has gone by and the protocol has become more fleshed out, it
has become clear that some of the initial allocations were inadequate
and should be revisited if we want to try to achieve the original
goal.
{{spinel-frame-format.md}}
{{spinel-data-packing.md}}
{{spinel-commands.md}}
{{spinel-prop.md}}
{{spinel-status-codes.md}}
{{spinel-tech-thread.md}}
{{spinel-feature-network-save.md}}
{{spinel-feature-host-buffer-offload.md}}
{{spinel-feature-jam-detect.md}}
{{spinel-feature-gpio.md}}
{{spinel-feature-trng.md}}
{{spinel-security-considerations.md}}
{backmatter}
{{spinel-framing.md}}
{{spinel-test-vectors.md}}
{{spinel-example-sessions.md}}
{{spinel-basis-glossary.md}}
# Acknowledgments #
Thread is a registered trademark of The Thread Group, Inc.
Special thanks to Nick Banks, Jonathan Hui, Abtin Keshavarzian, Yakun Xu,
Piotr Szkotak, Arjuna Sivasithambaresan and Martin Turon for their
substantial contributions and feedback related to this document.
This document was prepared using [mmark](https://github.com/miekg/mmark)
by (Miek Gieben) and [xml2rfc (version 2)](http://xml2rfc.ietf.org/).
@@ -1,25 +0,0 @@
# Glossary #
<!-- RQ -- Alphabetize before finalization. -->
FCS
: Final Checksum. Bytes added to the end of a packet to help determine if the packet was received without corruption.
NCP
: Network Control Processor.
NLI
: Network Link Identifier. May be a value between zero and three. See (#nli-network-link-identifier) for more information.
OS
: Operating System, i.e. the IPv6 node using Spinel to control and manage one or more of its IPv6 network interfaces.
PHY
: Physical layer. Refers to characteristics and parameters related to the physical implementation and operation of a networking medium.
PUI
: Packed Unsigned Integer. A way to serialize an unsigned integer using one, two, or three bytes. Used throughout the Spinel protocol. See (#packed-unsigned-integer) for more information.
TID
: Transaction Identifier. May be a value between zero and fifteen. See (#tid-transaction-identifier) for more information.
-330
View File
@@ -1,330 +0,0 @@
# Commands
## CMD 0: (Host->NCP) CMD_NOOP {#cmd-noop}
Octets: | 1 | 1
--------|--------|----------
Fields: | HEADER | CMD_NOOP
No-Operation command. Induces the NCP to send a success status back to
the host. This is primarily used for liveliness checks.
The command payload for this command SHOULD be empty. The receiver
MUST ignore any non-empty command payload.
There is no error condition for this command.
## CMD 1: (Host->NCP) CMD_RESET {#cmd-reset}
Octets: | 1 | 1
--------|--------|----------
Fields: | HEADER | CMD_RESET
Reset NCP command. Causes the NCP to perform a software reset. Due to
the nature of this command, the TID is ignored. The host should
instead wait for a `CMD_PROP_VALUE_IS` command from the NCP indicating
`PROP_LAST_STATUS` has been set to `STATUS_RESET_SOFTWARE`.
The command payload for this command SHOULD be empty. The receiver
MUST ignore any non-empty command payload.
If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
instead with the value set to the generated status code for the error.
## CMD 2: (Host->NCP) CMD_PROP_VALUE_GET {#cmd-prop-value-get}
Octets: | 1 | 1 | 1-3
--------|--------|--------------------|---------
Fields: | HEADER | CMD_PROP_VALUE_GET | PROP_ID
Get property value command. Causes the NCP to emit a
`CMD_PROP_VALUE_IS` command for the given property identifier.
The payload for this command is the property identifier encoded in the
packed unsigned integer format described in (#packed-unsigned-integer).
If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
instead with the value set to the generated status code for the error.
## CMD 3: (Host->NCP) CMD_PROP_VALUE_SET {#cmd-prop-value-set}
Octets: | 1 | 1 | 1-3 | *n*
--------|--------|--------------------|---------|------------
Fields: | HEADER | CMD_PROP_VALUE_SET | PROP_ID | VALUE
Set property value command. Instructs the NCP to set the given
property to the specific given value, replacing any previous value.
The payload for this command is the property identifier encoded in the
packed unsigned integer format described in (#packed-unsigned-integer), followed by
the property value. The exact format of the property value is defined
by the property.
If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
with the value set to the generated status code for the error.
## CMD 4: (Host->NCP) CMD_PROP_VALUE_INSERT {#cmd-prop-value-insert}
Octets: | 1 | 1 | 1-3 | *n*
--------|--------|-----------------------|---------|------------
Fields: | HEADER | CMD_PROP_VALUE_INSERT | PROP_ID | VALUE
Insert value into property command. Instructs the NCP to insert the
given value into a list-oriented property, without removing other
items in the list. The resulting order of items in the list is defined
by the individual property being operated on.
The payload for this command is the property identifier encoded in the
packed unsigned integer format described in (#packed-unsigned-integer), followed by
the value to be inserted. The exact format of the value is defined by
the property.
If the type signature of the property specified by `PROP_ID` consists
of a single structure enclosed by an array (`A(t(...))`), then the
contents of `VALUE` MUST contain the contents of the structure (`...`)
rather than the serialization of the whole item (`t(...)`). Specifically,
the length of the structure MUST NOT be prepended to `VALUE`. This
helps to eliminate redundant data.
If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
with the value set to the generated status code for the error.
## CMD 5: (Host->NCP) CMD_PROP_VALUE_REMOVE {#cmd-prop-value-remove}
Octets: | 1 | 1 | 1-3 | *n*
--------|--------|-----------------------|---------|------------
Fields: | HEADER | CMD_PROP_VALUE_REMOVE | PROP_ID | VALUE
Remove value from property command. Instructs the NCP to remove the
given value from a list-oriented property, without affecting other
items in the list. The resulting order of items in the list is defined
by the individual property being operated on.
Note that this command operates *by value*, not by index!
The payload for this command is the property identifier encoded in the
packed unsigned integer format described in (#packed-unsigned-integer), followed by
the value to be removed. The exact format of the value is defined by
the property.
If the type signature of the property specified by `PROP_ID` consists
of a single structure enclosed by an array (`A(t(...))`), then the
contents of `VALUE` MUST contain the contents of the structure (`...`)
rather than the serialization of the whole item (`t(...)`). Specifically,
the length of the structure MUST NOT be prepended to `VALUE`. This
helps to eliminate redundant data.
If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
with the value set to the generated status code for the error.
## CMD 6: (NCP->Host) CMD_PROP_VALUE_IS {#cmd-prop-value-is}
Octets: | 1 | 1 | 1-3 | *n*
--------|--------|-------------------|---------|------------
Fields: | HEADER | CMD_PROP_VALUE_IS | PROP_ID | VALUE
Property value notification command. This command can be sent by the
NCP in response to a previous command from the host, or it can be sent
by the NCP in an unsolicited fashion to notify the host of various
state changes asynchronously.
The payload for this command is the property identifier encoded in the
packed unsigned integer format described in (#packed-unsigned-integer), followed by
the current value of the given property.
## CMD 7: (NCP->Host) CMD_PROP_VALUE_INSERTED {#cmd-prop-value-inserted}
Octets: | 1 | 1 | 1-3 | *n*
--------|--------|-------------------------|---------|------------
Fields: | HEADER | CMD_PROP_VALUE_INSERTED | PROP_ID | VALUE
Property value insertion notification command. This command can be
sent by the NCP in response to the `CMD_PROP_VALUE_INSERT` command, or
it can be sent by the NCP in an unsolicited fashion to notify the host
of various state changes asynchronously.
The payload for this command is the property identifier encoded in the
packed unsigned integer format described in (#packed-unsigned-integer), followed by
the value that was inserted into the given property.
If the type signature of the property specified by `PROP_ID` consists
of a single structure enclosed by an array (`A(t(...))`), then the
contents of `VALUE` MUST contain the contents of the structure (`...`)
rather than the serialization of the whole item (`t(...)`). Specifically,
the length of the structure MUST NOT be prepended to `VALUE`. This
helps to eliminate redundant data.
The resulting order of items in the list is defined by the given
property.
## CMD 8: (NCP->Host) CMD_PROP_VALUE_REMOVED {#cmd-prop-value-removed}
Octets: | 1 | 1 | 1-3 | *n*
--------|--------|------------------------|---------|------------
Fields: | HEADER | CMD_PROP_VALUE_REMOVED | PROP_ID | VALUE
Property value removal notification command. This command can be sent
by the NCP in response to the `CMD_PROP_VALUE_REMOVE` command, or it
can be sent by the NCP in an unsolicited fashion to notify the host of
various state changes asynchronously.
Note that this command operates *by value*, not by index!
The payload for this command is the property identifier encoded in the
packed unsigned integer format described in (#packed-unsigned-integer), followed by
the value that was removed from the given property.
If the type signature of the property specified by `PROP_ID` consists
of a single structure enclosed by an array (`A(t(...))`), then the
contents of `VALUE` MUST contain the contents of the structure (`...`)
rather than the serialization of the whole item (`t(...)`). Specifically,
the length of the structure MUST NOT be prepended to `VALUE`. This
helps to eliminate redundant data.
The resulting order of items in the list is defined by the given
property.
## CMD 18: (Host->NCP) CMD_PEEK {#cmd-peek}
Octets: | 1 | 1 | 4 | 2
--------|--------|----------|---------|-------
Fields: | HEADER | CMD_PEEK | ADDRESS | COUNT
This command allows the NCP to fetch values from the RAM of the NCP
for debugging purposes. Upon success, `CMD_PEEK_RET` is sent from the
NCP to the host. Upon failure, `PROP_LAST_STATUS` is emitted with
the appropriate error indication.
Due to the low-level nature of this command, certain error conditions
may induce the NCP to reset.
The NCP MAY prevent certain regions of memory from being accessed.
The implementation of this command has security implications.
See (#security-considerations) for more information.
This command requires the capability `CAP_PEEK_POKE` to be present.
## CMD 19: (NCP->Host) CMD_PEEK_RET {#cmd-peek-ret}
Octets: | 1 | 1 | 4 | 2 | *n*
--------|--------|--------------|---------|-------|-------
Fields: | HEADER | CMD_PEEK_RET | ADDRESS | COUNT | BYTES
This command contains the contents of memory that was requested by
a previous call to `CMD_PEEK`.
This command requires the capability `CAP_PEEK_POKE` to be present.
## CMD 20: (Host->NCP) CMD_POKE {#cmd-poke}
Octets: | 1 | 1 | 4 | 2 | *n*
--------|--------|----------|---------|-------|-------
Fields: | HEADER | CMD_POKE | ADDRESS | COUNT | BYTES
This command writes the bytes to the specified memory address
for debugging purposes.
Due to the low-level nature of this command, certain error conditions
may induce the NCP to reset.
The implementation of this command has security implications.
See (#security-considerations) for more information.
This command requires the capability `CAP_PEEK_POKE` to be present.
## CMD 21: (Host->NCP) CMD_PROP_VALUE_MULTI_GET {#cmd-prop-value-multi-get}
* Argument-Encoding: `A(i)`
* Required Capability: `CAP_CMD_MULTI`
Fetch the value of multiple properties in one command. Arguments are
an array of property IDs. If all properties are fetched successfully,
a `CMD_PROP_VALUES_ARE` command is sent back to the host containing
the propertyid and value of each fetched property. The order of the
results in `CMD_PROP_VALUES_ARE` match the order of properties given
in `CMD_PROP_VALUE_GET`.
Errors fetching individual properties are reflected as indicating a
change to `PROP_LAST_STATUS` for that property's place.
Not all properties can be fetched using this method. As a general rule
of thumb, any property that blocks when getting will fail for that
individual property with `STATUS_INVALID_COMMAND_FOR_PROP`.
## CMD 22: (Host->NCP) CMD_PROP_VALUE_MULTI_SET {#cmd-prop-value-multi-set}
* Argument-Encoding: `A(iD)`
* Required Capability: `CAP_CMD_MULTI`
Octets: | 1 | 1 | *n*
--------|--------|--------------------------|----------------------
Fields: | HEADER | CMD_PROP_VALUE_MULTI_SET | Property/Value Pairs
With each property/value pair being:
Octets: | 2 | 1-3 | *n*
--------|--------|---------|------------
Fields: | LENGTH | PROP_ID | PROP_VALUE
This command sets the value of several properties at once in the given
order. The setting of properties stops at the first error, ignoring
any later properties.
The result of this command is generally `CMD_PROP_VALUES_ARE` unless
(for example) a parsing error has occured (in which case
`CMD_PROP_VALUE_IS` for `PROP_LAST_STATUS` would be the result). The
order of the results in `CMD_PROP_VALUES_ARE` match the order of
properties given in `CMD_PROP_VALUE_MULTI_SET`.
Since the processing of properties to set stops at the first error,
the resulting `CMD_PROP_VALUES_ARE` can contain fewer items than the
requested number of properties to set.
Not all properties can be set using this method. As a general rule
of thumb, any property that blocks when setting will fail for that
individual property with `STATUS_INVALID_COMMAND_FOR_PROP`.
## CMD 23: (NCP->Host) CMD_PROP_VALUES_ARE {#cmd-prop-values-are}
* Argument-Encoding: `A(iD)`
* Required Capability: `CAP_CMD_MULTI`
Octets: | 1 | 1 | *n*
--------|--------|---------------------|----------------------
Fields: | HEADER | CMD_PROP_VALUES_ARE | Property/Value Pairs
With each property/value pair being:
Octets: | 2 | 1-3 | *n*
--------|--------|---------|------------
Fields: | LENGTH | PROP_ID | PROP_VALUE
This command is emitted by the NCP as the response to both the
`CMD_PROP_VALUE_MULTI_GET` and `CMD_PROP_VALUE_MULTI_SET` commands. It
is roughly analogous to `CMD_PROP_VALUE_IS`, except that it contains
more than one property.
This command SHOULD NOT be emitted asynchronously, or in response to
any command other than `CMD_PROP_VALUE_MULTI_GET` or
`CMD_PROP_VALUE_MULTI_SET`.
The arguments are a list of structures containing the emitted property
and the associated value. These are presented in the same order as
given in the associated initiating command. In cases where getting or
setting a specific property resulted in an error, the associated slot
in this command will describe `PROP_LAST_STATUS`.
@@ -1,167 +0,0 @@
# Data Packing
Data serialization for properties is performed using a light-weight
data packing format which was loosely inspired by D-Bus. The format of
a serialization is defined by a specially formatted string.
This packing format is used for notational convenience. While this
string-based datatype format has been designed so that the strings may
be directly used by a structured data parser, such a thing is not
required to implement Spinel. Indeed, higly constrained applications
may find such a thing to be too heavyweight.
Goals:
* Be lightweight and favor direct representation of values.
* Use an easily readable and memorable format string.
* Support lists and structures.
* Allow properties to be appended to structures while maintaining
backward compatibility.
Each primitive datatype has an ASCII character associated with it.
Structures can be represented as strings of these characters. For
example:
* `C`: A single unsigned byte.
* `C6U`: A single unsigned byte, followed by a 128-bit IPv6
address, followed by a zero-terminated UTF8 string.
* `A(6)`: An array of concatenated IPv6 addresses
In each case, the data is represented exactly as described. For
example, an array of 10 IPv6 address is stored as 160 bytes.
## Primitive Types
Char | Name | Description
-----|:--------------------|:------------------------------
`.` | DATATYPE_VOID | Empty data type. Used internally.
`b` | DATATYPE_BOOL | Boolean value. Encoded in 8-bits as either 0x00 or 0x01. All other values are illegal.
`C` | DATATYPE_UINT8 | Unsigned 8-bit integer.
`c` | DATATYPE_INT8 | Signed 8-bit integer.
`S` | DATATYPE_UINT16 | Unsigned 16-bit integer.
`s` | DATATYPE_INT16 | Signed 16-bit integer.
`L` | DATATYPE_UINT32 | Unsigned 32-bit integer.
`l` | DATATYPE_INT32 | Signed 32-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)
`e` | DATATYPE_EUI48 | EUI-48 Address. (Big-endian)
`D` | DATATYPE_DATA | Arbitrary data. See (#data-blobs).
`d` | DATATYPE_DATA_WLEN | Arbitrary data with prepended length. See (#data-blobs).
`U` | DATATYPE_UTF8 | Zero-terminated UTF8-encoded string.
`t(...)` | DATATYPE_STRUCT | Structured datatype with prepended length. See (#structured-data).
`A(...)` | DATATYPE_ARRAY | Array of datatypes. Compound type. See (#arrays).
All multi-byte values are little-endian unless explicitly stated
otherwise.
## Packed Unsigned Integer
For certain types of integers, such command or property identifiers,
usually have a value on the wire that is less than 127. However, in
order to not preclude the use of values larger than 255, we would need
to add an extra byte. Doing this would add an extra byte to the
majority of instances, which can add up in terms of bandwidth.
The packed unsigned integer format is based on the [unsigned integer
format in EXI][EXI], except that we limit the maximum value to the
largest value that can be encoded into three bytes(2,097,151).
[EXI]: https://www.w3.org/TR/exi/#encodingUnsignedInteger
For all values less than 127, the packed form of the number is simply
a single byte which directly represents the number. For values larger
than 127, the following process is used to encode the value:
1. The unsigned integer is broken up into *n* 7-bit chunks and placed
into *n* octets, leaving the most significant bit of each octet
unused.
2. Order the octets from least-significant to most-significant.
(Little-endian)
3. Clear the most significant bit of the most significant octet. Set
the least significant bit on all other octets.
Where *n* is the smallest number of 7-bit chunks you can use to
represent the given value.
Take the value 1337, for example:
1337 => 0x0539
=> [39 0A]
=> [B9 0A]
To decode the value, you collect the 7-bit chunks until you find an
octet with the most significant bit clear.
## Data Blobs
There are two types for data blobs: `d` and `D`.
* `d` has the length of the data (in bytes) prepended to the data
(with the length encoded as type `S`). The size of the length
field is not included in the length.
* `D` does not have a prepended length: the length of the data is
implied by the bytes remaining to be parsed. It is an error for
`D` to not be the last type in a type in a type signature.
This dichotomy allows for more efficient encoding by eliminating
redundency. If the rest of the buffer is a data blob, encoding the
length would be redundant because we already know how many bytes are
in the rest of the buffer.
In some cases we use `d` even if it is the last field in a type signature.
We do this to allow for us to be able to append additional fields
to the type signature if necessary in the future. This is usually the
case with embedded structs, like in the scan results.
For example, let's say we have a buffer that is encoded with the
datatype signature of `CLLD`. In this case, it is pretty easy to tell
where the start and end of the data blob is: the start is 9 bytes from
the start of the buffer, and its length is the length of the buffer
minus 9. (9 is the number of bytes taken up by a byte and two longs)
The datatype signature `CLLDU` is illegal because we can't determine
where the last field (a zero-terminated UTF8 string) starts. But the
datatype `CLLdU` *is* legal, because the parser can determine the
exact length of the data blob-- allowing it to know where the start
of the next field would be.
## Structured Data
The structure data type (`t(...)`) is a way of bundling together
several fields into a single structure. It can be thought of as a
`d` type except that instead of being opaque, the fields in the
content are known. This is useful for things like scan results where
you have substructures which are defined by different layers.
For example, consider the type signature `Lt(ES)t(6C)`. In this
hypothetical case, the first struct is defined by the MAC layer, and
the second struct is defined by the PHY layer. Because of the use of
structures, we know exactly what part comes from that layer.
Additionally, we can add fields to each structure without introducing
backward compatability problems: Data encoded as `Lt(ESU)t(6C)` (Notice
the extra `U`) will
decode just fine as `Lt(ES)t(6C)`. Additionally, if we don't care
about the MAC layer and only care about the network layer, we could
parse as `Lt()t(6C)`.
Note that data encoded as `Lt(ES)t(6C)` will also parse as `Ldd`,
with the structures from both layers now being opaque data blobs.
## Arrays
An array is simply a concatenated set of *n* data encodings. For example,
the type `A(6)` is simply a list of IPv6 addresses---one after the other.
The type `A(6E)` likewise a concatenation of IPv6-address/EUI-64 pairs.
If an array contains many fields, the fields will often be surrounded
by a structure (`t(...)`). This effectively prepends each item in the
array with its length. This is useful for improving parsing performance
or to allow additional fields to be added in the future in a backward
compatible way. If there is a high certainty that additional
fields will never be added, the struct may be omitted (saving two bytes
per item).
This specification does not define a way to embed an array as a field
alongside other fields.
@@ -1,210 +0,0 @@
# Example Sessions
## NCP Initialization
<!-- RQ -- FIXME: This example session is incomplete. -->
Check the protocol version to see if it is supported:
* CMD_VALUE_GET:PROP_PROTOCOL_VERSION
* CMD_VALUE_IS:PROP_PROTOCOL_VERSION
Check the NCP version to see if a firmware update may be necessary:
* CMD_VALUE_GET:PROP_NCP_VERSION
* CMD_VALUE_IS:PROP_NCP_VERSION
Check interface type to make sure that it is what we expect:
* CMD_VALUE_GET:PROP_INTERFACE_TYPE
* CMD_VALUE_IS:PROP_INTERFACE_TYPE
If the host supports using vendor-specific commands, the vendor should
be verified before using them:
* CMD_VALUE_GET:PROP_VENDOR_ID
* CMD_VALUE_IS:PROP_VENDOR_ID
Fetch the capability list so that we know what features this NCP
supports:
* CMD_VALUE_GET:PROP_CAPS
* CMD_VALUE_IS:PROP_CAPS
If the NCP supports CAP_NET_SAVE, then we go ahead and recall the network:
* CMD_NET_RECALL
## Attaching to a network
<!-- RQ -- FIXME: This example session is incomplete. -->
We make the assumption that the NCP is not currently associated
with a network.
Set the network properties, if they were not already set:
* CMD_VALUE_SET:PROP_PHY_CHAN
* CMD_VALUE_IS:PROP_PHY_CHAN
* CMD_VALUE_SET:PROP_NET_XPANID
* CMD_VALUE_IS:PROP_NET_XPANID
* CMD_VALUE_SET:PROP_MAC_15_4_PANID
* CMD_VALUE_IS:PROP_MAC_15_4_PANID
* CMD_VALUE_SET:PROP_NET_NETWORK_NAME
* CMD_VALUE_IS:PROP_NET_NETWORK_NAME
* CMD_VALUE_SET:PROP_NET_MASTER_KEY
* CMD_VALUE_IS:PROP_NET_MASTER_KEY
* CMD_VALUE_SET:PROP_NET_KEY_SEQUENCE_COUNTER
* CMD_VALUE_IS:PROP_NET_KEY_SEQUENCE_COUNTER
* CMD_VALUE_SET:PROP_NET_KEY_SWITCH_GUARDTIME
* CMD_VALUE_IS:PROP_NET_KEY_SWITCH_GUARDTIME
Bring the network interface up:
* CMD_VALUE_SET:PROP_NET_IF_UP:TRUE
* CMD_VALUE_IS:PROP_NET_IF_UP:TRUE
Bring the routing stack up:
* CMD_VALUE_SET:PROP_NET_STACK_UP:TRUE
* CMD_VALUE_IS:PROP_NET_STACK_UP:TRUE
Some asynchronous events from the NCP:
* CMD_VALUE_IS:PROP_NET_ROLE
* CMD_VALUE_IS:PROP_NET_PARTITION_ID
* CMD_VALUE_IS:PROP_THREAD_ON_MESH_NETS
## Successfully joining a pre-existing network
<!-- RQ -- FIXME: This example session is incomplete. -->
This example session is identical to the above session up to the point
where we set PROP_NET_IF_UP to true. From there, the behavior changes.
* CMD_VALUE_SET:PROP_NET_REQUIRE_JOIN_EXISTING:TRUE
* CMD_VALUE_IS:PROP_NET_REQUIRE_JOIN_EXISTING:TRUE
Bring the routing stack up:
* CMD_VALUE_SET:PROP_NET_STACK_UP:TRUE
* CMD_VALUE_IS:PROP_NET_STACK_UP:TRUE
Some asynchronous events from the NCP:
* CMD_VALUE_IS:PROP_NET_ROLE
* CMD_VALUE_IS:PROP_NET_PARTITION_ID
* CMD_VALUE_IS:PROP_THREAD_ON_MESH_NETS
Now let's save the network settings to NVRAM:
* CMD_NET_SAVE
## Unsuccessfully joining a pre-existing network
This example session is identical to the above session up to the point
where we set PROP_NET_IF_UP to true. From there, the behavior changes.
* CMD_VALUE_SET:PROP_NET_REQUIRE_JOIN_EXISTING:TRUE
* CMD_VALUE_IS:PROP_NET_REQUIRE_JOIN_EXISTING:TRUE
Bring the routing stack up:
* CMD_VALUE_SET:PROP_NET_STACK_UP:TRUE
* CMD_VALUE_IS:PROP_NET_STACK_UP:TRUE
Some asynchronous events from the NCP:
* CMD_VALUE_IS:PROP_LAST_STATUS:STATUS_JOIN_NO_PEERS
* CMD_VALUE_IS:PROP_NET_STACK_UP:FALSE
## Detaching from a network
TBD
## Attaching to a saved network
<!-- RQ -- FIXME: This example session is incomplete. -->
Recall the saved network if you haven't already done so:
* CMD_NET_RECALL
Bring the network interface up:
* CMD_VALUE_SET:PROP_NET_IF_UP:TRUE
* CMD_VALUE_IS:PROP_NET_IF_UP:TRUE
Bring the routing stack up:
* CMD_VALUE_SET:PROP_NET_STACK_UP:TRUE
* CMD_VALUE_IS:PROP_NET_STACK_UP:TRUE
Some asynchronous events from the NCP:
* CMD_VALUE_IS:PROP_NET_ROLE
* CMD_VALUE_IS:PROP_NET_PARTITION_ID
* CMD_VALUE_IS:PROP_THREAD_ON_MESH_NETS
## NCP Software Reset
<!-- RQ -- FIXME: This example session is incomplete. -->
* CMD_RESET
* CMD_VALUE_IS:PROP_LAST_STATUS:STATUS_RESET_SOFTWARE
Then jump to (#ncp-initialization).
## Adding an on-mesh prefix
TBD
## Entering low-power modes
TBD
## Sniffing raw packets
<!-- RQ -- FIXME: This example session is incomplete. -->
This assumes that the NCP has been initialized.
Optionally set the channel:
* CMD_VALUE_SET:PROP_PHY_CHAN:x
* CMD_VALUE_IS:PROP_PHY_CHAN
Set the filter mode:
* CMD_VALUE_SET:PROP_MAC_PROMISCUOUS_MODE:MAC_PROMISCUOUS_MODE_MONITOR
* CMD_VALUE_IS:PROP_MAC_PROMISCUOUS_MODE:MAC_PROMISCUOUS_MODE_MONITOR
Enable the raw stream:
* CMD_VALUE_SET:PROP_MAC_RAW_STREAM_ENABLED:TRUE
* CMD_VALUE_IS:PROP_MAC_RAW_STREAM_ENABLED:TRUE
Enable the PHY directly:
* CMD_VALUE_SET:PROP_PHY_ENABLED:TRUE
* CMD_VALUE_IS:PROP_PHY_ENABLED:TRUE
Now we will get raw 802.15.4 packets asynchronously on
PROP_STREAM_RAW:
* CMD_VALUE_IS:PROP_STREAM_RAW:...
* CMD_VALUE_IS:PROP_STREAM_RAW:...
* CMD_VALUE_IS:PROP_STREAM_RAW:...
This mode may be entered even when associated with a network.
In that case, you should set `PROP_MAC_PROMISCUOUS_MODE` to
`MAC_PROMISCUOUS_MODE_PROMISCUOUS` or `MAC_PROMISCUOUS_MODE_NORMAL`, so that
you can avoid receiving packets from other networks or that are destined
for other nodes.
@@ -1,114 +0,0 @@
# Feature: GPIO Access {#feature-gpio-access}
This feature allows the host to have control over some or all of the
GPIO pins on the NCP. The host can determine which GPIOs are available
by examining `PROP_GPIO_CONFIG`, described below. This API supports a
maximum of 256 individual GPIO pins.
Support for this feature can be determined by the presence of `CAP_GPIO`.
## Properties ##
### PROP 4096: PROP\_GPIO\_CONFIG ###
* Argument-Encoding: `A(t(CCU))`
* Type: Read-write (Writable only using `CMD_PROP_VALUE_INSERT`,
(#cmd-prop-value-insert))
An array of structures which contain the following fields:
* `C`: GPIO Number
* `C`: GPIO Configuration Flags
* `U`: Human-readable GPIO name
GPIOs which do not have a corresponding entry are not supported.
The configuration parameter contains the configuration flags for the
GPIO:
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
|DIR|PUP|PDN|TRIGGER| RESERVED |
+---+---+---+---+---+---+---+---+
|O/D|
+---+
* `DIR`: Pin direction. Clear (0) for input, set (1) for output.
* `PUP`: Pull-up enabled flag.
* `PDN`/`O/D`: Flag meaning depends on pin direction:
* Input: Pull-down enabled.
* Output: Output is an open-drain.
* `TRIGGER`: Enumeration describing how pin changes generate
asynchronous notification commands (TBD) from the NCP to the host.
* 0: Feature disabled for this pin
* 1: Trigger on falling edge
* 2: Trigger on rising edge
* 3: Trigger on level change
* `RESERVED`: Bits reserved for future use. Always cleared to zero
and ignored when read.
As an optional feature, the configuration of individual pins may be
modified using the `CMD_PROP_VALUE_INSERT` command. Only the GPIO
number and flags fields MUST be present, the GPIO name (if present)
would be ignored. This command can only be used to modify the
configuration of GPIOs which are already exposed---it cannot be used
by the host to add addional GPIOs.
### PROP 4098: PROP\_GPIO\_STATE ###
* Type: Read-Write
Contains a bit field identifying the state of the GPIOs. The length of
the data associated with these properties depends on the number of
GPIOs. If you have 10 GPIOs, you'd have two bytes. GPIOs are numbered
from most significant bit to least significant bit, so 0x80 is GPIO 0,
0x40 is GPIO 1, etc.
For GPIOs configured as inputs:
* `CMD_PROP_VAUE_GET`: The value of the associated bit describes the
logic level read from the pin.
* `CMD_PROP_VALUE_SET`: The value of the associated bit is ignored
for these pins.
For GPIOs configured as outputs:
* `CMD_PROP_VAUE_GET`: The value of the associated bit is
implementation specific.
* `CMD_PROP_VALUE_SET`: The value of the associated bit determines
the new logic level of the output. If this pin is configured as an
open-drain, setting the associated bit to 1 will cause the pin to
enter a Hi-Z state.
For GPIOs which are not specified in `PROP_GPIO_CONFIG`:
* `CMD_PROP_VAUE_GET`: The value of the associated bit is
implementation specific.
* `CMD_PROP_VALUE_SET`: The value of the associated bit MUST be
ignored by the NCP.
When writing, unspecified bits are assumed to be zero.
### PROP 4099: PROP\_GPIO\_STATE\_SET ###
* Type: Write-only
Allows for the state of various output GPIOs to be set without
affecting other GPIO states. Contains a bit field identifying the
output GPIOs that should have their state set to 1.
When writing, unspecified bits are assumed to be zero. The value of
any bits for GPIOs which are not specified in `PROP_GPIO_CONFIG` MUST
be ignored.
### PROP 4100: PROP\_GPIO\_STATE\_CLEAR ###
* Type: Write-only
Allows for the state of various output GPIOs to be cleared without
affecting other GPIO states. Contains a bit field identifying the
output GPIOs that should have their state cleared to 0.
When writing, unspecified bits are assumed to be zero. The value of
any bits for GPIOs which are not specified in `PROP_GPIO_CONFIG` MUST
be ignored.
@@ -1,95 +0,0 @@
# Feature: Host Buffer Offload
The memory on an NCP may be much more limited than the memory on
the host processor. In such situations, it is sometimes useful
for the NCP to offload buffers to the host processor temporarily
so that it can perform other operations.
Host buffer offload is an optional NCP capability that, when
present, allows the NCP to store data buffers on the host processor
that can be recalled at a later time.
The presence of this feature can be detected by the host by
checking for the presence of the `CAP_HBO`
capability in `PROP_CAPS`.
## Commands
### CMD 12: (NCP->Host) CMD_HBO_OFFLOAD
* Argument-Encoding: `LscD`
* `OffloadId`: 32-bit unique block identifier
* `Expiration`: In seconds-from-now
* `Priority`: Critical, High, Medium, Low
* `Data`: Data to offload
### CMD 13: (NCP->Host) CMD_HBO_RECLAIM
* Argument-Encoding: `Lb`
* `OffloadId`: 32-bit unique block identifier
* `KeepAfterReclaim`: If not set to true, the block will be
dropped by the host after it is sent to the NCP.
### CMD 14: (NCP->Host) CMD_HBO_DROP
* Argument-Encoding: `L`
* `OffloadId`: 32-bit unique block identifier
### CMD 15: (Host->NCP) CMD_HBO_OFFLOADED
* Argument-Encoding: `Li`
* `OffloadId`: 32-bit unique block identifier
* `Status`: Status code for the result of the operation.
### CMD 16: (Host->NCP) CMD_HBO_RECLAIMED
* Argument-Encoding: `LiD`
* `OffloadId`: 32-bit unique block identifier
* `Status`: Status code for the result of the operation.
* `Data`: Data that was previously offloaded (if any)
### CMD 17: (Host->NCP) CMD_HBO_DROPPED
* Argument-Encoding: `Li`
* `OffloadId`: 32-bit unique block identifier
* `Status`: Status code for the result of the operation.
## Properties
### PROP 10: PROP_HBO_MEM_MAX {#prop-hbo-mem-max}
* Type: Read-Write
* Packed-Encoding: `L`
Octets: | 4
--------|-----------------
Fields: | `PROP_HBO_MEM_MAX`
Describes the number of bytes that may be offloaded from the NCP to
the host. Default value is zero, so this property must be set by the
host to a non-zero value before the NCP will begin offloading blocks.
This value is encoded as an unsigned 32-bit integer.
This property is only available if the `CAP_HBO`
capability is present in `PROP_CAPS`.
### PROP 11: PROP_HBO_BLOCK_MAX {#prop-hbo-block-max}
* Type: Read-Write
* Packed-Encoding: `S`
Octets: | 2
--------|-----------------
Fields: | `PROP_HBO_BLOCK_MAX`
Describes the number of blocks that may be offloaded from the NCP to
the host. Default value is 32. Setting this value to zero will cause
host block offload to be effectively disabled.
This value is encoded as an unsigned 16-bit integer.
This property is only available if the `CAP_HBO`
capability is present in `PROP_CAPS`.
@@ -1,100 +0,0 @@
# Feature: Jam Detection {#feature-jam-detect}
Jamming detection is a feature that allows the NCP to report when it
detects high levels of interference that are characteristic of intentional
signal jamming.
The presence of this feature can be detected by checking for the
presence of the `CAP_JAM_DETECT` (value 6) capability in `PROP_CAPS`.
## Properties
### PROP 4608: PROP_JAM_DETECT_ENABLE {#prop-jam-detect-enable}
* Type: Read-Write
* Packed-Encoding: `b`
* Default Value: false
* REQUIRED for `CAP_JAM_DETECT`
Octets: | 1
--------|-----------------
Fields: | `PROP_JAM_DETECT_ENABLE`
Indicates if jamming detection is enabled or disabled. Set to true
to enable jamming detection.
This property is only available if the `CAP_JAM_DETECT`
capability is present in `PROP_CAPS`.
### PROP 4609: PROP_JAM_DETECTED {#prop-jam-detected}
* Type: Read-Only
* Packed-Encoding: `b`
* REQUIRED for `CAP_JAM_DETECT`
Octets: | 1
--------|-----------------
Fields: | `PROP_JAM_DETECTED`
Set to true if radio jamming is detected. Set to false otherwise.
When jamming detection is enabled, changes to the value of this
property are emitted asynchronously via `CMD_PROP_VALUE_IS`.
This property is only available if the `CAP_JAM_DETECT`
capability is present in `PROP_CAPS`.
### PROP 4610: PROP_JAM_DETECT_RSSI_THRESHOLD
* Type: Read-Write
* Packed-Encoding: `c`
* Units: dBm
* Default Value: Implementation-specific
* RECOMMENDED for `CAP_JAM_DETECT`
This parameter describes the threshold RSSI level (measured in
dBm) above which the jamming detection will consider the
channel blocked.
### PROP 4611: PROP_JAM_DETECT_WINDOW
* Type: Read-Write
* Packed-Encoding: `c`
* Units: Seconds (1-64)
* Default Value: Implementation-specific
* RECOMMENDED for `CAP_JAM_DETECT`
This parameter describes the window period for signal jamming
detection.
### PROP 4612: PROP_JAM_DETECT_BUSY
* Type: Read-Write
* Packed-Encoding: `i`
* Units: Seconds (1-64)
* Default Value: Implementation-specific
* RECOMMENDED for `CAP_JAM_DETECT`
This parameter describes the number of aggregate seconds within
the detection window where the RSSI must be above
`PROP_JAM_DETECT_RSSI_THRESHOLD` to trigger detection.
The behavior of the jamming detection feature when `PROP_JAM_DETECT_BUSY`
is larger than `PROP_JAM_DETECT_WINDOW` is undefined.
### PROP 4613: PROP_JAM_DETECT_HISTORY_BITMAP
* Type: Read-Only
* Packed-Encoding: `LL`
* Default Value: Implementation-specific
* RECOMMENDED for `CAP_JAM_DETECT`
This value provides information about current state of jamming detection
module for monitoring/debugging purpose. It returns a 64-bit value where
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).
@@ -1,74 +0,0 @@
# Feature: Network Save
The network save/recall feature is an optional NCP capability that, when
present, allows the host to save and recall network credentials and
state to and from nonvolatile storage.
The presence of the save/recall feature can be detected by checking for
the presence of the `CAP_NET_SAVE` capability in `PROP_CAPS`.
Network clear feature allows host to erase all network credentials and
state from non-volatile memory.
## Commands
### CMD 9: (Host->NCP) CMD_NET_SAVE
Octets: | 1 | 1
--------|--------|--------------
Fields: | HEADER | CMD_NET_SAVE
Save network state command. Saves any current network credentials and
state necessary to reconnect to the current network to non-volatile
memory.
This operation affects non-volatile memory only. The current network
information stored in volatile memory is unaffected.
The response to this command is always a `CMD_PROP_VALUE_IS` for
`PROP_LAST_STATUS`, indicating the result of the operation.
This command is only available if the `CAP_NET_SAVE` capability is
set.
### CMD 10: (Host->NCP) CMD_NET_CLEAR
Octets: | 1 | 1
--------|--------|---------------
Fields: | HEADER | CMD_NET_CLEAR
Clear saved network settings command. Erases all network credentials
and state from non-volatile memory. The erased settings include any data
saved automatically by the network stack firmware and/or data saved by
`CMD_NET_SAVE` operation.
This operation affects non-volatile memory only. The current network
information stored in volatile memory is unaffected.
The response to this command is always a `CMD_PROP_VALUE_IS` for
`PROP_LAST_STATUS`, indicating the result of the operation.
This command is always available independent of the value of
`CAP_NET_SAVE` capability.
### CMD 11: (Host->NCP) CMD_NET_RECALL
Octets: | 1 | 1
--------|--------|----------------
Fields: | HEADER | CMD_NET_RECALL
Recall saved network state command. Recalls any previously saved
network credentials and state previously stored by `CMD_NET_SAVE` from
non-volatile memory.
This command will typically generated several unsolicited property
updates as the network state is loaded. At the conclusion of loading,
the authoritative response to this command is always a
`CMD_PROP_VALUE_IS` for `PROP_LAST_STATUS`, indicating the result of
the operation.
This command is only available if the `CAP_NET_SAVE` capability is
set.
@@ -1,77 +0,0 @@
# Feature: True Random Number Generation {#feature-trng}
This feature allows the host to have access to any strong hardware
random number generator that might be present on the NCP, for things
like key generation or seeding PRNGs.
Support for this feature can be determined by the presence of `CAP_TRNG`.
Note well that implementing a cryptographically-strong software-based true
random number generator (that is impervious to things like temperature
changes, manufacturing differences across devices, or unexpected output
correlations) is non-trivial without a well-designed, dedicated hardware
random number generator. Implementors who have little or no experience in
this area are encouraged to not advertise this capability.
## Properties ##
### PROP 4101: PROP_TRNG_32 ###
* Argument-Encoding: `L`
* Type: Read-Only
Fetching this property returns a strong random 32-bit integer that is suitable
for use as a PRNG seed or for cryptographic use.
While the exact mechanism behind the calculation of this value is
implementation-specific, the implementation must satisfy the following
requirements:
* Data representing at least 32 bits of fresh entropy (extracted from the
primary entropy source) MUST be consumed by the calculation of each query.
* Each of the 32 bits returned MUST be free of bias and have no statistical
correlation to any part of the raw data used for the calculation of any
query.
Support for this property is REQUIRED if `CAP_TRNG` is included in the
device capabilities.
### PROP 4102: PROP_TRNG_128 ###
* Argument-Encoding: `D`
* Type: Read-Only
Fetching this property returns 16 bytes of strong random data suitable for
direct cryptographic use without further processing(For example, as an
AES key).
While the exact mechanism behind the calculation of this value is
implementation-specific, the implementation must satisfy the following
requirements:
* Data representing at least 128 bits of fresh entropy (extracted from the
primary entropy source) MUST be consumed by the calculation of each query.
* Each of the 128 bits returned MUST be free of bias and have no statistical
correlation to any part of the raw data used for the calculation of any
query.
Support for this property is REQUIRED if `CAP_TRNG` is included in the
device capabilities.
### PROP 4103: PROP_TRNG_RAW_32 ###
* Argument-Encoding: `D`
* Type: Read-Only
This property is primarily used to diagnose and debug the behavior
of the entropy source used for strong random number generation.
When queried, returns the raw output from the entropy source used to
generate `PROP_TRNG_32`, prior to any reduction/whitening and/or mixing
with prior state.
The length of the returned buffer is implementation specific and should be
expected to be non-deterministic.
Support for this property is RECOMMENDED if `CAP_TRNG` is included in the
device capabilities.
@@ -1,83 +0,0 @@
# Frame Format ##
A frame is defined simply as the concatenation of
* A header byte
* A command (up to three bytes, see (#packed-unsigned-integer) for format)
* An optional command payload
Octets: | 1 | 1-3 | *n*
--------|--------|-----|-------------
Fields: | HEADER | CMD | CMD_PAYLOAD
## Header Format ###
The header byte is broken down as follows:
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| FLG | NLI | TID |
+---+---+---+---+---+---+---+---+
<!-- RQ -- Eventually, when https://github.com/miekg/mmark/issues/95
is addressed, the above table should be swapped out with this:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| FLG || NLI || TID ||||
-->
### FLG: Flag
The flag field of the header byte (`FLG`) is always set to the value
two (or `10` in binary). Any frame received with these bits set to
any other value else MUST NOT be considered a Spinel frame.
This convention allows Spinel to be line compatible with BTLE HCI. By
defining the first two bit in this way we can disambiguate between
Spinel frames and HCI frames (which always start with either `0x01`
or `0x04`) without any additional framing overhead.
### NLI: Network Link Identifier
The Network Link Identifier (NLI) is a number between 0 and 3, which is associated by the OS with one of up to four IPv6 zone indices corresponding to conceptual IPv6 interfaces on the NCP. This allows the protocol to support IPv6 nodes connecting simultaneously to more than one IPv6 network link using a single NCP instance. The first Network Link Identifier (0) MUST refer to a distinguished conceptual interface provided by the NCP for its IPv6 link type. The other three Network Link Identifiers (1, 2 and 3) MAY be dissociated from any conceptual interface.
### TID: Transaction Identifier
The least significant bits of the header represent the Transaction
Identifier(TID). The TID is used for correlating responses to the
commands which generated them.
When a command is sent from the host, any reply to that command sent
by the NCP will use the same value for the TID. When the host receives
a frame that matches the TID of the command it sent, it can easily
recognize that frame as the actual response to that command.
The TID value of zero (0) is used for commands to which a correlated
response is not expected or needed, such as for unsolicited update
commands sent to the host from the NCP.
### Command Identifier (CMD) ####
The command identifier is a 21-bit unsigned integer encoded in up to
three bytes using the packed unsigned integer format described in
(#packed-unsigned-integer). This encoding allows for up to 2,097,152 individual
commands, with the first 127 commands represented as a single byte.
Command identifiers larger than 2,097,151 are explicitly forbidden.
CID Range | Description
----------------------|------------------
0 - 63 | Reserved for core commands
64 - 15,359 | *UNALLOCATED*
15,360 - 16,383 | Vendor-specific
16,384 - 1,999,999 | *UNALLOCATED*
2,000,000 - 2,097,151 | Experimental use only
### Command Payload (Optional) ####
Depending on the semantics of the command in question, a payload MAY
be included in the frame. The exact composition and length of the
payload is defined by the command identifier.
-223
View File
@@ -1,223 +0,0 @@
# Framing Protocol
Since this NCP protocol is defined independently of the physical
transport or framing, any number of transports and framing protocols
could be used successfully. However, in the interests of compatibility,
this document provides some recommendations.
## UART Recommendations ###
The recommended default UART settings are:
* Bit rate: 115200
* Start bits: 1
* Data bits: 8
* Stop bits: 1
* Parity: None
* Flow Control: Hardware
These values may be adjusted depending on the individual needs of
the application or product, but some sort of flow control **MUST** be used.
Hardware flow control is preferred over software flow control. In the
absence of hardware flow control, software flow control (XON/XOFF) **MUST**
be used instead.
We also **RECOMMEND** an Arduino-style hardware reset, where the DTR
signal is coupled to the `R̅E̅S̅` pin through a 0.01µF capacitor. This
causes the NCP to automatically reset whenever the serial port is
opened. At the very least we **RECOMMEND** dedicating one of your host
pins to controlling the `R̅E̅S̅` pin on the NCP, so that you can
easily perform a hardware reset if necessary.
### UART Bit Rate Detection ###
When using a UART, the issue of an appropriate bit rate must be
considered. A bitrate of 115200 bits per second has become a defacto
standard baud rate for many serial peripherals. This rate, however,
is slower than the theoretical maximum bitrate of the 802.15.4 2.4GHz
PHY (250kbit). In most circumstances this mismatch is not significant
because the overall bitrate will be much lower than either of these
rates, but there are circumstances where a faster UART bitrate is
desirable. Thus, this document proposes a simple bitrate detection
scheme that can be employed by the host to detect when the attached
NCP is initially running at a higher bitrate.
The algorithm is to send successive NOOP commands to the NCP at increasing
bitrates. When a valid `CMD_LAST_STATUS` response has been received, we
have identified the correct bitrate.
In order to limit the time spent hunting for the appropriate bitrate,
we RECOMMEND that only the following bitrates be checked:
* 115200
* 230400
* 1000000 (1Mbit)
The bitrate MAY also be changed programmatically by adjusting
`PROP_UART_BITRATE`, if implemented.
### HDLC-Lite {#hdlc-lite}
*HDLC-Lite* is the recommended framing protocol for transmitting
Spinel frames over a UART. HDLC-Lite consists of only the framing,
escaping, and CRC parts of the larger HDLC protocol---all other parts
of HDLC are omitted. This protocol was chosen because it works well
with software flow control and is widely implemented.
To transmit a frame with HDLC-lite, the 16-bit CRC must first be
appended to the frame. The CRC function is defined to be CRC-16/CCITT,
otherwise known as the [KERMIT CRC][].
[KERMIT CRC]: http://reveng.sourceforge.net/crc-catalogue/16.htm#crc.cat.kermit
Individual frames are terminated with a frame delimiter octet called
the 'flag' octet (`0x7E`).
The following octets values are considered *special* and should be
escaped when present in data frames:
Octet Value | Description
------------|-----------------------
0x7E | Frame Delimiter (Flag)
0x7D | Escape Byte
0x11 | XON
0x13 | XOFF
0xF8 | Vendor-Specific
When present in a data frame, these octet values are escaped by
prepending the escape octet (`0x7D`) and XORing the value with `0x20`.
When receiving a frame, the CRC must be verified after the frame is
unescaped. If the CRC value does not match what is calculated for the
frame data, the frame MUST be discarded. The implementation MAY
indicate the failure to higher levels to handle as they see fit, but
MUST NOT attempt to process the deceived frame.
Consecutive flag octets are entirely legal and MUST NOT be treated as
a framing error. Consecutive flag octets MAY be used as a way to wake
up a sleeping NCP.
When first establishing a connection to the NCP, it is customary to
send one or more flag octets to ensure that any previously received
data is discarded.
## SPI Recommendations ###
We RECOMMEND the use of the following standard SPI signals:
* `C̅S̅`: (Host-to-NCP) Chip Select
* `CLK`: (Host-to-NCP) Clock
* `MOSI`: Master-Output/Slave-Input
* `MISO`: Master-Input/Slave-Output
* `I̅N̅T̅`: (NCP-to-Host) Host Interrupt
* `R̅E̅S̅`: (Host-to-NCP) NCP Hardware Reset
The `I̅N̅T̅` signal is used by the NCP to indicate to the host that
the NCP has frames pending to send to it. When asserted, the host
SHOULD initiate a SPI transaction in a timely manner.
We RECOMMEND the following SPI properties:
* `C̅S̅` is active low.
* `CLK` is active high.
* `CLK` speed is larger than 500 kHz.
* Data is valid on leading edge of `CLK`.
* Data is sent in multiples of 8-bits (octets).
* Octets are sent most-significant bit first.
This recommended configuration may be adjusted depending on the
individual needs of the application or product.
### SPI Framing Protocol ####
Each SPI frame starts with a 5-byte frame header:
Octets: | 1 | 2 | 2
--------|-----|----------|----------
Fields: | HDR | RECV_LEN | DATA_LEN
* `HDR`: The first byte is the header byte (defined below)
* `RECV_LEN`: The second and third bytes indicate the largest frame
size that that device is ready to receive. If zero, then the other
device must not send any data. (Little endian)
* `DATA_LEN`: The fourth and fifth bytes indicate the size of the
pending data frame to be sent to the other device. If this value
is equal-to or less-than the number of bytes that the other device
is willing to receive, then the data of the frame is immediately
after the header. (Little Endian)
The `HDR` byte is defined as:
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
|RST|CRC|CCF| RESERVED |PATTERN|
+---+---+---+---+---+---+---+---+
* `RST`: This bit is set when that device has been reset since the
last time `C̅S̅` was asserted.
* `CRC`: This bit is set when that device supports writing a 16-bit
CRC at the end of the data. The CRC length is NOT included in DATA_LEN.
* `CCF`: "CRC Check Failure". Set if the CRC check on the last received
frame failed, cleared to zero otherwise. This bit is only used if both
sides support CRC.
* `RESERVED`: These bits are all reserved for future used. They
MUST be cleared to zero and MUST be ignored if set.
* `PATTERN`: These bits are set to a fixed value to help distinguish
valid SPI frames from garbage (by explicitly making `0xFF` and `0x00`
invalid values). Bit 6 MUST be set to be one and bit 7 MUST be
cleared (0). A frame received that has any other values for these bits
MUST be dropped.
Prior to a sending or receiving a frame, the master MAY send a
5-octet frame with zeros for both the max receive frame size and the
the contained frame length. This will induce the slave device to
indicate the length of the frame it wants to send (if any) and
indicate the largest frame it is capable of receiving at the moment.
This allows the master to calculate the size of the next transaction.
Alternatively, if the master has a frame to send it can just go ahead
and send a frame of that length and determine if the frame was accepted
by checking that the `RECV_LEN` from the slave frame is larger than
the frame the master just tried to send. If the `RECV_LEN` is smaller
then the frame wasn't accepted and will need to be transmitted again.
This protocol can be used either unidirectionally or bidirectionally,
determined by the behavior of the master and the slave.
If the the master notices `PATTERN` is not set correctly, the master
should consider the transaction to have failed and try again after 10
milliseconds, retrying up to 200 times. After unsuccessfully trying
200 times in a row, the master MAY take appropriate remedial action
(like a NCP hardware reset, or indicating a communication failure to a
user interface).
At the end of the data of a frame is an optional 16-bit CRC, support for
which is indicated by the `CRC` bit of the `HDR` byte being set. If these
bits are set for both the master and slave frames, then CRC checking is
enabled on both sides, effectively requiring that frame sizes be two bytes
longer than would be otherwise required. The CRC is calculated using the
same mechanism used for the CRC calculation in HDLC-Lite (See (#hdlc-lite)).
When both of the `CRC` bits are set, both sides must verify that the `CRC`
is valid before accepting the frame. If not enough bytes were clocked out
for the CRC to be read, then the frame must be ignored. If enough bytes
were clocked out to perform a CRC check, but the CRC check fails, then
the frame must be rejected and the `CRC_FAIL` bit on the next frame (and
ONLY the next frame) MUST be set.
## I²C Recommendations {#i2c-recommendations}
TBD
<!-- RQ
-- It may make sense to have a look at what Bluetooth HCI is doing
for native I²C framing and go with that.
-->
## Native USB Recommendations ###
TBD
<!-- RQ
-- It may make sense to have a look at what Bluetooth HCI is doing
for native USB framing and go with that.
-->
-544
View File
@@ -1,544 +0,0 @@
## Core Properties {#prop-core}
### PROP 0: PROP_LAST_STATUS {#prop-last-status}
* Type: Read-Only
* Encoding: `i`
Octets: | 1-3
-------:|-------------
Fields: | LAST_STATUS
Describes the status of the last operation. Encoded as a packed
unsigned integer.
This property is emitted often to indicate the result status of
pretty much any Host-to-NCP operation.
It is emitted automatically at NCP startup with a value indicating
the reset reason.
See (#status-codes) for the complete list of status codes.
### PROP 1: PROP_PROTOCOL_VERSION {#prop-protocol-version}
* Type: Read-Only
* Encoding: `ii`
Octets: | 1-3 | 1-3
--------|----------------|---------------
Fields: | MAJOR_VERSION | MINOR_VERSION
Describes the protocol version information. This property contains
four fields, each encoded as a packed unsigned integer:
* Major Version Number
* Minor Version Number
This document describes major version 4, minor version 3 of this protocol.
The host **MUST** only use this property from NLI 0. Behavior when used
from other NLIs is undefined.
#### Major Version Number
The major version number is used to identify large and incompatible
differences between protocol versions.
The host MUST enter a FAULT state if it does not explicitly support
the given major version number.
#### Minor Version Number
The minor version number is used to identify small but otherwise
compatible differences between protocol versions. A mismatch between
the advertised minor version number and the minor version that is
supported by the host SHOULD NOT be fatal to the operation of the
host.
### PROP 2: PROP_NCP_VERSION {#prop-ncp-version}
* Type: Read-Only
* Packed-Encoding: `U`
Octets: | *n*
--------|-------------------
Fields: | NCP_VESION_STRING
Contains a string which describes the firmware currently running on
the NCP. Encoded as a zero-terminated UTF-8 string.
The format of the string is not strictly defined, but it is intended
to present similarly to the "User-Agent" string from HTTP. The
RECOMMENDED format of the string is as follows:
STACK-NAME/STACK-VERSION[BUILD_INFO][; OTHER_INFO]; BUILD_DATE_AND_TIME
Examples:
* `OpenThread/1.0d26-25-gb684c7f; DEBUG; May 9 2016 18:22:04`
* `ConnectIP/2.0b125 s1 ALPHA; Sept 24 2015 20:49:19`
The host **MUST** only use this property from NLI 0. Behavior when used
from other NLIs is undefined.
### PROP 3: PROP_INTERFACE_TYPE {#prop-interface-type}
* Type: Read-Only
* Encoding: `i`
Octets: | 1-3
--------|----------------
Fields: | INTERFACE_TYPE
This integer identifies what the network protocol for this NCP.
Currently defined values are:
* 0: Bootloader
* 2: ZigBee IP(TM)
* 3: Thread(R)
The host MUST enter a FAULT state if it does not recognize the
protocol given by the NCP.
### PROP 4: PROP_INTERFACE_VENDOR_ID {#prop-interface-vendor-id}
* Type: Read-Only
* Encoding: `i`
Octets: | 1-3
--------|----------------
Fields: | VENDOR_ID
Vendor identifier.
### PROP 5: PROP_CAPS {#prop-caps}
* Type: Read-Only
* Packed-Encoding: `A(i)`
Octets: | 1-3 | 1-3 | ...
--------|-------|-------|-----
Fields: | CAP_1 | CAP_2 | ...
Describes the supported capabilities of this NCP. Encoded as a list of
packed unsigned integers.
A capability is defined as a 21-bit integer that describes a subset of
functionality which is supported by the NCP.
Currently defined values are:
* 1: `CAP_LOCK`
* 2: `CAP_NET_SAVE`
* 3: `CAP_HBO`: Host Buffer Offload. See (#feature-host-buffer-offload).
* 4: `CAP_POWER_SAVE`
* 5: `CAP_COUNTERS`
* 6: `CAP_JAM_DETECT`: Jamming detection. See (#feature-jam-detect)
* 7: `CAP_PEEK_POKE`: PEEK/POKE debugging commands.
* 8: `CAP_WRITABLE_RAW_STREAM`: `PROP_STREAM_RAW` is writable.
* 9: `CAP_GPIO`: Support for GPIO access. See (#feature-gpio-access).
* 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)).
* 16: `CAP_802_15_4_2003`
* 17: `CAP_802_15_4_2006`
* 18: `CAP_802_15_4_2011`
* 21: `CAP_802_15_4_PIB`
* 24: `CAP_802_15_4_2450MHZ_OQPSK`
* 25: `CAP_802_15_4_915MHZ_OQPSK`
* 26: `CAP_802_15_4_868MHZ_OQPSK`
* 27: `CAP_802_15_4_915MHZ_BPSK`
* 28: `CAP_802_15_4_868MHZ_BPSK`
* 29: `CAP_802_15_4_915MHZ_ASK`
* 30: `CAP_802_15_4_868MHZ_ASK`
* 48: `CAP_ROLE_ROUTER`
* 49: `CAP_ROLE_SLEEPY`
* 52: `CAP_NET_THREAD_1_0`
* 512: `CAP_MAC_WHITELIST`
* 513: `CAP_MAC_RAW`
* 514: `CAP_OOB_STEERING_DATA`
* 1024: `CAP_THREAD_COMMISSIONER`
* 1025: `CAP_THREAD_TMF_PROXY`
Additionally, future capability allocations SHALL be made from the
following allocation plan:
Capability Range | Description
----------------------|------------------
0 - 127 | Reserved for core capabilities
128 - 15,359 | *UNALLOCATED*
15,360 - 16,383 | Vendor-specific
16,384 - 1,999,999 | *UNALLOCATED*
2,000,000 - 2,097,151 | Experimental use only
### PROP 6: PROP_INTERFACE_COUNT {#prop-interface-count}
* Type: Read-Only
* Packed-Encoding: `C`
Octets: | 1
--------|-----------------
Fields: | `INTERFACE_COUNT`
Describes the number of concurrent interfaces supported by this NCP.
Since the concurrent interface mechanism is still TBD, this value MUST
always be one.
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}
* Type: Read-Write
* Packed-Encoding: `C`
Octets: | 1
--------|------------------
Fields: | POWER_STATE
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.
(Enumerated for completeness sake, not expected on the wire)
* 1: `POWER_STATE_DEEP_SLEEP`: Almost everything on the NCP is shut
down, but can still be resumed via a command or interrupt.
* 2: `POWER_STATE_STANDBY`: NCP is in the lowest power state that
can still be awoken by an event from the radio (e.g. waiting for
alarm)
* 3: `POWER_STATE_LOW_POWER`: NCP is responsive (and possibly
connected), but using less power. (e.g. "Sleepy" child node)
* 4: `POWER_STATE_ONLINE`: NCP is fully powered. (e.g. "Parent"
node)
<!-- RQ
-- We should consider reversing the numbering here so that 0 is
`POWER_STATE_ONLINE`. We may also want to include some extra
values between the defined values for future expansion, so
that we can preserve the ordered relationship. -- -->
### PROP 8: PROP_HWADDR {#prop-hwaddr}
* Type: Read-Only\*
* Packed-Encoding: `E`
Octets: | 8
--------|------------
Fields: | HWADDR
The static EUI64 address of the device, used as a serial number.
This value is read-only, but may be writable under certain
vendor-defined circumstances.
### PROP 9: PROP_LOCK {#prop-lock}
* Type: Read-Write
* Packed-Encoding: `b`
Octets: | 1
--------|------------
Fields: | LOCK
Property lock. Used for grouping changes to several properties to
take effect at once, or to temporarily prevent the automatic updating
of property values. When this property is set, the execution of the
NCP is effectively frozen until it is cleared.
This property is only supported if the `CAP_LOCK` capability is present.
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}
* Type: Read-Write
* Packed-Encoding: `C`
* Default value: 4
Octets: | 1
--------|------------------
Fields: | `HOST_POWER_STATE`
Describes the current power state of the *host*. This property is used
by the host to inform the NCP when it has changed power states. The
NCP can then use this state to determine which properties need
asynchronous updates. Enumeration is encoded as a single unsigned
byte. These states are defined in similar terms to `PROP_POWER_STATE`
((#prop-power-state)).
Defined values are:
* 0: `HOST_POWER_STATE_OFFLINE`: Host is physically powered off and
cannot be woken by the NCP. All asynchronous commands are
squelched.
* 1: `HOST_POWER_STATE_DEEP_SLEEP`: The host is in a low power state
where it can be woken by the NCP but will potentially require more
than two seconds to become fully responsive. The NCP **MUST**
avoid sending unnecessary property updates, such as child table
updates or non-critical messages on the debug stream. If the NCP
needs to wake the host for traffic, the NCP **MUST** first take
action to wake the host. Once the NCP signals to the host that it
should wake up, the NCP **MUST** wait for some activity from the
host (indicating that it is fully awake) before sending frames.
* 2: **RESERVED**. This value **MUST NOT** be set by the host. If
received by the NCP, the NCP **SHOULD** consider this as a synonym
of `HOST_POWER_STATE_DEEP_SLEEP`.
* 3: `HOST_POWER_STATE_LOW_POWER`: The host is in a low power state
where it can be immediately woken by the NCP. The NCP **SHOULD**
avoid sending unnecessary property updates, such as child table
updates or non-critical messages on the debug stream.
* 4: `HOST_POWER_STATE_ONLINE`: The host is awake and responsive. No
special filtering is performed by the NCP on asynchronous updates.
* All other values are **RESERVED**. They MUST NOT be set by the
host. If received by the NCP, the NCP **SHOULD** consider the value as
a synonym of `HOST_POWER_STATE_LOW_POWER`.
<!-- RQ
-- We should consider reversing the numbering here so that 0 is
`POWER_STATE_ONLINE`. We may also want to include some extra
values between the defined values for future expansion, so
that we can preserve the ordered relationship. -- -->
After setting this power state, any further commands from the host to
the NCP will cause `HOST_POWER_STATE` to automatically revert to
`HOST_POWER_STATE_ONLINE`.
When the host is entering a low-power state, it should wait for the
response from the NCP acknowledging the command (with `CMD_VALUE_IS`).
Once that acknowledgement is received the host may enter the low-power
state.
If the NCP has the `CAP_UNSOL_UPDATE_FILTER` capability, any unsolicited
property updates masked by `PROP_UNSOL_UPDATE_FILTER` should be honored
while the host indicates it is in a low-power state. After resuming to the
`HOST_POWER_STATE_ONLINE` state, the value of `PROP_UNSOL_UPDATE_FILTER`
**MUST** be unchanged from the value assigned prior to the host indicating
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 4104: PROP_UNSOL_UPDATE_FILTER {#prop-unsol-update-filter}
* Required only if `CAP_UNSOL_UPDATE_FILTER` is set.
* Type: Read-Write
* Packed-Encoding: `A(I)`
* Default value: Empty.
Contains a list of properties which are *excluded* from generating
unsolicited value updates. This property **MUST** be empty after reset.
In other words, the host may opt-out of unsolicited property updates
for a specific property by adding that property id to this list.
Hosts **SHOULD NOT** add properties to this list which are not
present in `PROP_UNSOL_UPDATE_LIST`. If such properties are added,
the NCP **MUST** ignore the unsupported properties.
<!-- RQ
-- The justification for the above behavior is to attempt to avoid possible
future interop problems by explicitly making sure that unknown
properties are ignored. Since unknown properties will obviously not be
generating unsolicited updates, it seems fairly harmless. An
implementation may print out a warning to the debug stream.
Note that the error is still detectable: If you VALUE\_SET unsupported
properties, the resulting VALUE\_IS would contain only the supported
properties of that set(since the unsupported properties would be
ignored). If an implementation cares that much about getting this
right then it needs to make sure that it checks
PROP\_UNSOL\_UPDATE\_LIST first.
-- -->
Implementations of this property are only **REQUIRED** to support
and use the following commands:
* `CMD_PROP_VALUE_GET` ((#cmd-prop-value-get))
* `CMD_PROP_VALUE_SET` ((#cmd-prop-value-set))
* `CMD_PROP_VALUE_IS` ((#cmd-prop-value-is))
Implementations of this property **MAY** optionally support and use
the following commands:
* `CMD_PROP_VALUE_INSERT` ((#cmd-prop-value-insert))
* `CMD_PROP_VALUE_REMOVE` ((#cmd-prop-value-remove))
* `CMD_PROP_VALUE_INSERTED` ((#cmd-prop-value-inserted))
* `CMD_PROP_VALUE_REMOVED` ((#cmd-prop-value-removed))
Host implementations which are aiming to maximize their compatability across
different firmwre implementations **SHOULD NOT** assume the availability of the
optional commands for this property.
The value of this property **SHALL** be independent for each NLI.
### PROP 4105: PROP_UNSOL_UPDATE_LIST {#prop-unsol-update-list}
* Required only if `CAP_UNSOL_UPDATE_FILTER` is set.
* Type: Read-Only
* Packed-Encoding: `A(I)`
Contains a list of properties which are capable of generating
unsolicited value updates. This list can be used when populating
`PROP_UNSOL_UPDATE_FILTER` to disable all unsolicited property
updates.
This property is intended to effectively behave as a constant
for a given NCP firmware.
Note that not all properties that support unsolicited updates need to
be listed here. Scan results, for example, are only generated due to
direct action on the part of the host, so those properties **MUST NOT**
not be included in this list.
The value of this property **MAY** be different across available
NLIs.
## Stream Properties {#prop-stream}
### PROP 112: PROP_STREAM_DEBUG {#prop-stream-debug}
* Type: Read-Only-Stream
* Packed-Encoding: `D`
Octets: | *n*
--------|------------
Fields: | UTF8_DATA
This property is a streaming property, meaning that you cannot explicitly
fetch the value of this property. The stream provides human-readable debugging
output which may be displayed in the host logs.
The location of newline characters is not assumed by the host: it is
the NCP's responsibility to insert newline characters where needed,
just like with any other text stream.
To receive the debugging stream, you wait for `CMD_PROP_VALUE_IS`
commands for this property from the NCP.
### PROP 113: PROP_STREAM_RAW {#prop-stream-raw}
* Type: Read-Write-Stream
* Packed-Encoding: `dD`
Octets: | 2 | *n* | *n*
--------|----------------|------------|----------------
Fields: | FRAME_DATA_LEN | FRAME_DATA | FRAME_METADATA
This stream provides the capability of sending and receiving raw packets
to and from the radio. The exact format of the frame metadata and data is
dependent on the MAC and PHY being used.
This property is a streaming property, meaning that you cannot explicitly
fetch the value of this property. To receive traffic, you wait for
`CMD_PROP_VALUE_IS` commands with this property id from the NCP.
Implementations may OPTIONALLY support the ability to transmit arbitrary
raw packets. Support for this feature is indicated by the presence of the
`CAP_WRITABLE_RAW_STREAM` capability.
If the capability `CAP_WRITABLE_RAW_STREAM` is set, then packets written
to this stream with `CMD_PROP_VALUE_SET` will be sent out over the radio.
This allows the caller to use the radio directly, with the stack being
implemented on the host instead of the NCP.
#### Frame Metadata Format {#frame-metadata-format}
Any data past the end of `FRAME_DATA_LEN` is considered metadata and is
OPTIONAL. Frame metadata MAY be empty or partially specified. Partially
specified metadata MUST be accepted. Default values are used for all
unspecified fields.
The same general format is used for `PROP_STREAM_RAW`, `PROP_STREAM_NET`,
and `PROP_STREAM_NET_INSECURE`. It can be used for frames sent from the
NCP to the host as well as frames sent from the host to the NCP.
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_NOISE | (dBm) Noise floor | `c` int8 | 1 | -128
MD_FLAG | Flags (defined below) | `S` uint16 | 2 |
MD_PHY | PHY-specific data | `d` data | >=2 |
MD_VEND | Vendor-specific data | `d` data | >=2 |
The following fields are ignored by the NCP for packets sent to it from
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
---------|--------|:------------------|:----------------
15 | 0x0001 | MD_FLAG_TX | Packet was transmitted, not received.
13 | 0x0004 | MD_FLAG_BAD_FCS | Packet was received with bad FCS
12 | 0x0008 | MD_FLAG_DUPE | Packet seems to be a duplicate
0-11, 14 | 0xFFF2 | MD_FLAG_RESERVED | Flags reserved for future use.
The format of `MD_PHY` is specified by the PHY layer currently in use,
and may contain information such as the channel, LQI, antenna, or other
pertainent information.
### PROP 114: PROP_STREAM_NET {#prop-stream-net}
* Type: Read-Write-Stream
* Packed-Encoding: `dD`
Octets: | 2 | *n* | *n*
--------|----------------|------------|----------------
Fields: | FRAME_DATA_LEN | FRAME_DATA | FRAME_METADATA
This stream provides the capability of sending and receiving data packets
to and from the currently attached network. The exact format of the frame
metadata and data is dependent on the network protocol being used.
This property is a streaming property, meaning that you cannot explicitly
fetch the value of this property. To receive traffic, you wait for
`CMD_PROP_VALUE_IS` commands with this property id from the NCP.
To send network packets, you call `CMD_PROP_VALUE_SET` on this property with
the value of the packet.
Any data past the end of `FRAME_DATA_LEN` is considered metadata, the
format of which is described in (#frame-metadata-format).
### PROP 115: PROP_STREAM_NET_INSECURE {#prop-stream-net-insecure}
* Type: Read-Write-Stream
* Packed-Encoding: `dD`
Octets: | 2 | *n* | *n*
--------|----------------|------------|----------------
Fields: | FRAME_DATA_LEN | FRAME_DATA | FRAME_METADATA
This stream provides the capability of sending and receiving unencrypted
and unauthenticated data packets to and from nearby devices for the
purposes of device commissioning. The exact format of the frame
metadata and data is dependent on the network protocol being used.
This property is a streaming property, meaning that you cannot explicitly
fetch the value of this property. To receive traffic, you wait for
`CMD_PROP_VALUE_IS` commands with this property id from the NCP.
To send network packets, you call `CMD_PROP_VALUE_SET` on this property with
the value of the packet.
Any data past the end of `FRAME_DATA_LEN` is considered metadata, the
format of which is described in (#frame-metadata-format).
@@ -1,32 +0,0 @@
## Debug Properties {#prop-debug}
### PROP 16384: PROP_DEBUG_TEST_ASSERT {#prop-debug-test-assert}
* Type: Read-Only
* Packed-Encoding: `b`
Reading this property will cause an assert on the NCP. This
is intended for testing the assert functionality of
underlying platform/NCP. Assert should ideally cause the
NCP to reset, but if `assert` is not supported or disabled
boolean value of `false` is returned in response.
### PROP 16385: PROP_DEBUG_NCP_LOG_LEVEL {#prop-debug-ncp-log-level}
* Type: Read-Write
* Packed-Encoding: `C`
Provides access to the NCP log level. Currently defined values are (which follows
the RFC 5424):
* 0: Emergency (emerg).
* 1: Alert (alert).
* 2: Critical (crit).
* 3: Error (err).
* 4: Warning (warn).
* 5: Notice (notice).
* 6: Information (info).
* 7: Debug (debug).
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`.
@@ -1,41 +0,0 @@
## IPv6 Properties {#prop-ipv6}
### PROP 96: PROP_IPV6_LL_ADDR {#prop-ipv6-ll-addr}
* Type: Read-Only
* Packed-Encoding: `6`
IPv6 Address
### PROP 97: PROP_IPV6_ML_ADDR {#prop-ipv6-ml-addr}
* Type: Read-Only
* Packed-Encoding: `6`
IPv6 Address + Prefix Length
### PROP 98: PROP_IPV6_ML_PREFIX {#prop-ipv6-ml-prefix}
* Type: Read-Write
* Packed-Encoding: `6C`
IPv6 Prefix + Prefix Length
### PROP 99: PROP_IPV6_ADDRESS_TABLE {#prop-ipv6-address-table}
* Type: Read-Write
* Packed-Encoding: `A(t(6CLLC))`
Array of structures containing:
* `6`: IPv6 Address
* `C`: Network Prefix Length
* `L`: Valid Lifetime
* `L`: Preferred Lifetime
* `C`: Flags
### PROP 101: PROP_IPv6_ICMP_PING_OFFLOAD
* Type: Read-Write
* Packed-Encoding: `b`
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.
Default value is `false`.
-204
View File
@@ -1,204 +0,0 @@
## MAC Properties {#prop-mac}
### PROP 48: PROP_MAC_SCAN_STATE {#prop-mac-scan-state}
* Type: Read-Write
* Packed-Encoding: `C`
* Unit: Enumeration
Possible Values:
* 0: `SCAN_STATE_IDLE`
* 1: `SCAN_STATE_BEACON`
* 2: `SCAN_STATE_ENERGY`
* 3: `SCAN_STATE_DISCOVER`
Set to `SCAN_STATE_BEACON` to start an active scan.
Beacons will be emitted from `PROP_MAC_SCAN_BEACON`.
Set to `SCAN_STATE_ENERGY` to start an energy scan.
Channel energy result will be reported by emissions
of `PROP_MAC_ENERGY_SCAN_RESULT` (per channel).
Set to `SCAN_STATE_DISOVER` to start a Thread MLE discovery
scan operation. Discovery scan result will be emitted from
`PROP_MAC_SCAN_BEACON`.
Value switches to `SCAN_STATE_IDLE` when scan is complete.
### PROP 49: PROP_MAC_SCAN_MASK {#prop-mac-scan-mask}
* Type: Read-Write
* Packed-Encoding: `A(C)`
* Unit: List of channels to scan
### PROP 50: PROP_MAC_SCAN_PERIOD {#prop-mac-scan-period}
* Type: Read-Write
* Packed-Encoding: `S` (uint16)
* Unit: milliseconds per channel
### PROP 51: PROP_MAC_SCAN_BEACON {#prop-mac-scan-beacon}
* Type: Read-Only-Stream
* Packed-Encoding: `Ccdd` (or `Cct(ESSc)t(iCUdd)`)
Octets: | 1 | 1 | 2 | *n* | 2 | *n*
--------|----|------|---------|----------|---------|----------
Fields: | CH | RSSI | MAC_LEN | MAC_DATA | NET_LEN | NET_DATA
Scan beacons have two embedded structures which contain
information about the MAC layer and the NET layer. Their
format depends on the MAC and NET layer currently in use.
The format below is for an 802.15.4 MAC with Thread:
* `C`: Channel
* `c`: RSSI of the beacon
* `t`: MAC layer properties (802.15.4 layer shown below for convenience)
* `E`: Long address
* `S`: Short address
* `S`: PAN-ID
* `c`: LQI
* NET layer properties (Standard net layer shown below for convenience)
* `i`: Protocol Number
* `C`: Flags
* `U`: Network Name
* `d`: XPANID
* `d`: Steering data
Extra parameters may be added to each of the structures
in the future, so care should be taken to read the length
that prepends each structure.
### PROP 52: PROP_MAC_15_4_LADDR {#prop-mac-15-4-laddr}
* Type: Read-Write
* Packed-Encoding: `E`
The 802.15.4 long address of this node.
This property is only present on NCPs which implement 802.15.4
### PROP 53: PROP_MAC_15_4_SADDR {#prop-mac-15-4-saddr}
* Type: Read-Write
* Packed-Encoding: `S`
The 802.15.4 short address of this node.
This property is only present on NCPs which implement 802.15.4
### PROP 54: PROP_MAC_15_4_PANID {#prop-mac-15-4-panid}
* Type: Read-Write
* Packed-Encoding: `S`
The 802.15.4 PANID this node is associated with.
This property is only present on NCPs which implement 802.15.4
### PROP 55: PROP_MAC_RAW_STREAM_ENABLED {#prop-mac-raw-stream-enabled}
* Type: Read-Write
* Packed-Encoding: `b`
Set to true to enable raw MAC frames to be emitted from `PROP_STREAM_RAW`.
See (#prop-stream-raw).
### PROP 56: PROP_MAC_PROMISCUOUS_MODE {#prop-mac-promiscuous-mode}
* Type: Read-Write
* Packed-Encoding: `C`
Possible Values:
Id | Name | Description
---|-------------------------------|------------------
0 | `MAC_PROMISCUOUS_MODE_OFF` | Normal MAC filtering is in place.
1 | `MAC_PROMISCUOUS_MODE_NETWORK`| All MAC packets matching network are passed up the stack.
2 | `MAC_PROMISCUOUS_MODE_FULL` | All decoded MAC packets are passed up the stack.
See (#prop-stream-raw).
### PROP 57: PROP_MAC_ENERGY_SCAN_RESULT {#prop-mac-escan-result}
* Type: Read-Only-Stream
* Packed-Encoding: `Cc`
This property is emitted during energy scan operation
per scanned channel with following format:
* `C`: Channel
* `c`: RSSI (in dBm)
### PROP 58: PROP_MAC_DATA_POLL_PERIOD {#prop-mac-data-poll-period
* Type: Read-Write
* Packed-Encoding: `L`
The (user-specified) data poll (802.15.4 MAC Data Request) period
in milliseconds. Value zero means there is no user-specified
poll period, and the network stack determines the maximum period
based on the MLE Child Timeout.
If the value is non-zero, it specifies the maximum period between
data poll transmissions. Note that the network stack may send data
request transmissions more frequently when expecting a control-message
(e.g., when waiting for an MLE Child ID Response).
This property is only present on NCPs which implement 802.15.4.
### PROP 4864: PROP_MAC_WHITELIST {#prop-mac-whitelist}
* Type: Read-Write
* Packed-Encoding: `A(T(Ec))`
* Required capability: `CAP_MAC_WHITELIST`
Structure Parameters:
* `E`: EUI64 address of node
* `c`: Optional RSSI-override value. The value 127 indicates
that the RSSI-override feature is not enabled for this
address. If this value is omitted when setting or
inserting, it is assumed to be 127. This parameter is
ignored when removing.
### PROP 4865: PROP_MAC_WHITELIST_ENABLED {#prop-mac-whitelist-enabled}
* Type: Read-Write
* Packed-Encoding: `b`
* Required capability: `CAP_MAC_WHITELIST`
### PROP 4867: SPINEL_PROP_MAC_SRC_MATCH_ENABLED {#prop-mac-src-match-enabled}
* Type: Write
* Packed-Encoding: `b`
Set to true to enable radio source matching or false to disable it. This property
is only available if the `SPINEL_CAP_MAC_RAW` capability is present. The source match
functionality is used by radios when generating ACKs. The short and extended address
lists are used for settings the Frame Pending bit in the ACKs.
### PROP 4868: SPINEL_PROP_MAC_SRC_MATCH_SHORT_ADDRESSES {#prop-mac-src-match-short-addresses}
* Type: Write
* Packed-Encoding: `A(S)`
Configures the list of short addresses used for source matching. This property
is only available if the `SPINEL_CAP_MAC_RAW` capability is present.
Structure Parameters:
* `S`: Short address for hardware generated ACKs
### PROP 4869: SPINEL_PROP_MAC_SRC_MATCH_EXTENDED_ADDRESSES {#prop-mac-src-match-extended-addresses}
* Type: Write
* Packed-Encoding: `A(E)`
Configures the list of extended addresses used for source matching. This property
is only available if the `SPINEL_CAP_MAC_RAW` capability is present.
Structure Parameters:
* `E`: EUI64 address for hardware generated ACKs
### PROP 4870: PROP_MAC_BLACKLIST {#prop-mac-blacklist}
* Type: Read-Write
* Packed-Encoding: `A(T(E))`
* Required capability: `CAP_MAC_WHITELIST`
Structure Parameters:
* `E`: EUI64 address of node
### PROP 4871: PROP_MAC_BLACKLIST_ENABLED {#prop-mac-blacklist-enabled}
* Type: Read-Write
* Packed-Encoding: `b`
* Required capability: `CAP_MAC_WHITELIST`
@@ -1,70 +0,0 @@
## NET Properties {#prop-net}
### PROP 64: PROP_NET_SAVED {#prop-net-saved}
* Type: Read-Only
* Packed-Encoding: `b`
Returns true if there is a network state stored/saved.
### PROP 65: PROP_NET_IF_UP {#prop-net-if-up}
* Type: Read-Write
* Packed-Encoding: `b`
Network interface up/down status. Non-zero (set to 1) indicates up,
zero indicates down.
### PROP 66: PROP_NET_STACK_UP {#prop-net-stack-up}
* Type: Read-Write
* Packed-Encoding: `b`
* Unit: Enumeration
Thread stack operational status. Non-zero (set to 1) indicates up,
zero indicates down.
### PROP 67: PROP_NET_ROLE {#prop-net-role}
* Type: Read-Write
* Packed-Encoding: `C`
* Unit: Enumeration
Values:
* 0: `NET_ROLE_DETACHED`
* 1: `NET_ROLE_CHILD`
* 2: `NET_ROLE_ROUTER`
* 3: `NET_ROLE_LEADER`
### PROP 68: PROP_NET_NETWORK_NAME {#prop-net-network-name}
* Type: Read-Write
* Packed-Encoding: `U`
### PROP 69: PROP_NET_XPANID {#prop-net-xpanid}
* Type: Read-Write
* Packed-Encoding: `D`
### PROP 70: PROP_NET_MASTER_KEY {#prop-net-master-key}
* Type: Read-Write
* Packed-Encoding: `D`
### PROP 71: PROP_NET_KEY_SEQUENCE_COUNTER {#prop-net-key-sequence-counter}
* Type: Read-Write
* Packed-Encoding: `L`
### PROP 72: PROP_NET_PARTITION_ID {#prop-net-partition-id}
* Type: Read-Write
* Packed-Encoding: `L`
The partition ID of the partition that this node is a member of.
### PROP 73: PROP_NET_REQUIRE_JOIN_EXISTING {#prop-net-require-join-existing}
* Type: Read-Write
* Packed-Encoding: `b`
### PROP 74: PROP_NET_KEY_SWITCH_GUARDTIME {#prop-net-key-swtich-guardtime}
* Type: Read-Write
* Packed-Encoding: `L`
### PROP 75: PROP_NET_PSKC {#prop-net-pskc}
* Type: Read-Write
* Packed-Encoding: `D`
@@ -1,69 +0,0 @@
Spinel is largely a property-based protocol, similar to representational state transfer (REST), with a property defined for every attribute that an OS needs to create, read, update or delete in the function of an IPv6 interface. The inspiration of this approach was memory-mapped hardware registers for peripherals. The goal is to avoid, as much as possible, the use of large complicated structures and/or method argument lists. The reason for avoiding these is because they have a tendency to change, especially early in development. Adding or removing a property from a structure can render the entire protocol incompatible. By using properties, you simply extend the protocol with an additional property.
Almost all features and capabilities are implemented using properties. Most new features that are initially proposed as commands can be adapted to be property-based instead. Notable exceptions include "Host Buffer Offload" ((#feature-host-buffer-offload)) and "Network Save" ((#feature-network-save)).
In Spinel, properties are keyed by an unsigned integer between 0 and 2,097,151 (See (#packed-unsigned-integer)).
## Property Methods ###
Properties may support one or more of the following methods:
* `VALUE_GET` ((#cmd-prop-value-get))
* `VALUE_SET` ((#cmd-prop-value-set))
* `VALUE_INSERT` ((#cmd-prop-value-insert))
* `VALUE_REMOVE` ((#cmd-prop-value-remove))
Additionally, the NCP can send updates to the host (either synchronously or asynchronously) that inform the host about changes to specific properties:
* `VALUE_IS` ((#cmd-prop-value-is))
* `VALUE_INSERTED` ((#cmd-prop-value-inserted))
* `VALUE_REMOVED` ((#cmd-prop-value-removed))
## Property Types ###
Conceptually, there are three different types of properties:
* Single-value properties
* Multiple-value (Array) properties
* Stream properties
### Single-Value Properties ####
Single-value properties are properties that have a simple representation of a single value. Examples would be:
* Current radio channel (Represented as an unsigned 8-bit integer)
* Network name (Represented as a UTF-8 encoded string)
* 802\.15.4 PAN ID (Represented as an unsigned 16-bit integer)
The valid operations on these sorts of properties are `GET` and `SET`.
### Multiple-Value Properties ####
Multiple-Value Properties have more than one value associated with them. Examples would be:
* List of channels supported by the radio hardware.
* List of IPv6 addresses assigned to the interface.
* List of capabilities supported by the NCP.
The valid operations on these sorts of properties are `VALUE_GET`, `VALUE_SET`, `VALUE_INSERT`, and `VALUE_REMOVE`.
When the value is fetched using `VALUE_GET`, the returned value is the concatenation of all of the individual values in the list. If the length of the value for an individual item in the list is not defined by the type then each item returned in the list is prepended with a length (See (#arrays)). The order of the returned items, unless explicitly defined for that specific property, is undefined.
`VALUE_SET` provides a way to completely replace all previous values. Calling `VALUE_SET` with an empty value effectively instructs the NCP to clear the value of that property.
`VALUE_INSERT` and `VALUE_REMOVE` provide mechanisms for the insertion or removal of individual items *by value*. The payload for these commands is a plain single value.
### Stream Properties ####
Stream properties are special properties representing streams of data. Examples would be:
* Network packet stream ((#prop-stream-net))
* Raw packet stream ((#prop-stream-raw))
* Debug message stream ((#prop-stream-debug))
* Network Beacon stream ((#prop-mac-scan-beacon))
All such properties emit changes asynchronously using the `VALUE_IS` command, sent from the NCP to the host. For example, as IPv6 traffic is received by the NCP, the IPv6 packets are sent to the host by way of asynchronous `VALUE_IS` notifications.
Some of these properties also support the host send data back to the NCP. For example, this is how the host sends IPv6 traffic to the NCP.
These types of properties generally do not support `VALUE_GET`, as it is meaningless.
@@ -1,72 +0,0 @@
## PHY Properties {#prop-phy}
### PROP 32: PROP_PHY_ENABLED {#prop-phy-enabled}
* Type: Read-Write
* Packed-Encoding: `b` (bool8)
Set to 1 if the PHY is enabled, set to 0 otherwise.
May be directly enabled to bypass higher-level packet processing
in order to implement things like packet sniffers. This property
can only be written if the `SPINEL_CAP_MAC_RAW` capability is present.
### PROP 33: PROP_PHY_CHAN {#prop-phy-chan}
* Type: Read-Write
* Packed-Encoding: `C` (uint8)
Value is the current channel. Must be set to one of the
values contained in `PROP_PHY_CHAN_SUPPORTED`.
### PROP 34: PROP_PHY_CHAN_SUPPORTED {#prop-phy-chan-supported}
* Type: Read-Only
* Packed-Encoding: `A(C)` (array of uint8)
* Unit: List of channels
Value is a list of channel values that are supported by the
hardware.
### PROP 35: PROP_PHY_FREQ {#prop-phy-freq}
* Type: Read-Only
* Packed-Encoding: `L` (uint32)
* Unit: Kilohertz
Value is the radio frequency (in kilohertz) of the
current channel.
### PROP 36: PROP_PHY_CCA_THRESHOLD {#prop-phy-cca-threshold}
* Type: Read-Write
* Packed-Encoding: `c` (int8)
* Unit: dBm
Value is the CCA (clear-channel assessment) threshold. Set to
-128 to disable.
When setting, the value will be rounded down to a value
that is supported by the underlying radio hardware.
### PROP 37: PROP_PHY_TX_POWER {#prop-phy-tx-power}
* Type: Read-Write
* Packed-Encoding: `c` (int8)
* Unit: dBm
Value is the transmit power of the radio.
When setting, the value will be rounded down to a value
that is supported by the underlying radio hardware.
### PROP 38: PROP_PHY_RSSI {#prop-phy-rssi}
* Type: Read-Only
* Packed-Encoding: `c` (int8)
* Unit: dBm
Value is the current RSSI (Received signal strength indication)
from the radio. This value can be used in energy scans and for
determining the ambient noise floor for the operating environment.
### PROP 39: PROP_PHY_RX_SENSITIVITY {#prop-phy-rx-sensitivity}
* Type: Read-Only
* Packed-Encoding: `c` (int8)
* Unit: dBm
Value is the radio receive sensitivity. This value can be used as
lower bound noise floor for link metrics computation.
-58
View File
@@ -1,58 +0,0 @@
# Properties
{{spinel-prop-overview.md}}
## Property Numbering
While the majority of the properties that allow the configuration
of network connectivity are network protocol specific, there are
several properties that are required in all implementations.
Future property allocations **SHALL** be made from the
following allocation plan:
Property ID Range | Description
:---------------------|:-----------------
0 - 127 | Reserved for frequently-used properties
128 - 15,359 | Unallocated
15,360 - 16,383 | Vendor-specific
16,384 - 1,999,999 | Unallocated
2,000,000 - 2,097,151 | Experimental use only
For an explanation of the data format encoding shorthand used
throughout this document, see (#data-packing).
## Property Sections
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)
Note that some of the property sections have two reserved
ranges: a primary range (which is encoded as a single byte)
and an extended range (which is encoded as two bytes).
properties which are used more frequently are generally
allocated from the former range.
{{spinel-prop-core.md}}
{{spinel-prop-phy.md}}
{{spinel-prop-mac.md}}
{{spinel-prop-net.md}}
{{spinel-prop-ipv6.md}}
{{spinel-prop-debug.md}}
@@ -1,9 +0,0 @@
# Security Considerations #
## Raw Application Access ##
Spinel **MAY** be used as an API boundary for allowing processes to configure
the NCP. However, such a system **MUST NOT** give unprivileged processess the
ability to send or receive arbitrary command frames to the NCP. Only the
specific commands and properties that are required should be allowed to be
passed, and then only after being checked for proper format.
@@ -1,66 +0,0 @@
# Status Codes
Status codes are sent from the NCP to the host via
`PROP_LAST_STATUS` using the `CMD_VALUE_IS` command to indicate
the return status of a previous command. As with any response,
the TID field of the FLAG byte is used to correlate the response
with the request.
Note that most successfully executed commands do not indicate
a last status of `STATUS_OK`. The usual way the NCP indicates a
successful command is to mirror the property change back to the
host. For example, if you do a `CMD_VALUE_SET` on `PROP_PHY_ENABLED`,
the NCP would indicate success by responding with a `CMD_VALUE_IS`
for `PROP_PHY_ENABLED`. If the command failed, `PROP_LAST_STATUS`
would be emitted instead.
See (#prop-last-status) for more information on `PROP_LAST_STATUS`.
* 0: `STATUS_OK`: Operation has completed successfully.
* 1: `STATUS_FAILURE`: Operation has failed for some undefined
reason.
* 2: `STATUS_UNIMPLEMENTED`: The given operation has not been implemented.
* 3: `STATUS_INVALID_ARGUMENT`: An argument to the given operation is invalid.
* 4: `STATUS_INVALID_STATE` : The given operation is invalid for the current
state of the device.
* 5: `STATUS_INVALID_COMMAND`: The given command is not recognized.
* 6: `STATUS_INVALID_INTERFACE`: The given Spinel interface is not supported.
* 7: `STATUS_INTERNAL_ERROR`: An internal runtime error has occurred.
* 8: `STATUS_SECURITY_ERROR`: A security or authentication error has occurred.
* 9: `STATUS_PARSE_ERROR`: An error has occurred while parsing the command.
* 10: `STATUS_IN_PROGRESS`: The operation is in progress and will be
completed asynchronously.
* 11: `STATUS_NOMEM`: The operation has been prevented due to memory
pressure.
* 12: `STATUS_BUSY`: The device is currently performing a mutually exclusive
operation.
* 13: `STATUS_PROP_NOT_FOUND`: The given property is not recognized.
* 14: `STATUS_PACKET_DROPPED`: The packet was dropped.
* 15: `STATUS_EMPTY`: The result of the operation is empty.
* 16: `STATUS_CMD_TOO_BIG`: The command was too large to fit in the internal
buffer.
* 17: `STATUS_NO_ACK`: The packet was not acknowledged.
* 18: `STATUS_CCA_FAILURE`: The packet was not sent due to a CCA failure.
* 19: `STATUS_ALREADY`: The operation is already in progress or
the property was already set to the given value.
* 20: `STATUS_ITEM_NOT_FOUND`: The given item could not be found in the property.
* 21: `STATUS_INVALID_COMMAND_FOR_PROP`: The given command cannot be performed
on this property.
* 22-111: RESERVED
* 112-127: Reset Causes
* 112: `STATUS_RESET_POWER_ON`
* 113: `STATUS_RESET_EXTERNAL`
* 114: `STATUS_RESET_SOFTWARE`
* 115: `STATUS_RESET_FAULT`
* 116: `STATUS_RESET_CRASH`
* 117: `STATUS_RESET_ASSERT`
* 118: `STATUS_RESET_OTHER`
* 119: `STATUS_RESET_UNKNOWN`
* 120: `STATUS_RESET_WATCHDOG`
* 121-127: RESERVED-RESET-CODES
* 128 - 15,359: UNALLOCATED
* 15,360 - 16,383: Vendor-specific
* 16,384 - 1,999,999: UNALLOCATED
* 2,000,000 - 2,097,151: Experimental Use Only (MUST NEVER be used
in production!)
@@ -1,333 +0,0 @@
# Technology: Thread(R) {#tech-thread}
This section describes all of the properties and semantics required
for managing a Thread(R) NCP.
Thread(R) NCPs have the following requirements:
* The property `PROP_INTERFACE_TYPE` must be 3.
* The non-optional properties in the following sections **MUST** be
implemented: CORE, PHY, MAC, NET, and IPV6.
All serious implementations of an NCP **SHOULD** also support the network
save feature (See (#feature-network-save)).
## Capabilities {#thread-caps}
The Thread(R) technology defines the following capabilities:
* `CAP_NET_THREAD_1_0` - Indicates that the NCP implements v1.0 of the Thread(R) standard.
* `CAP_NET_THREAD_1_1` - Indicates that the NCP implements v1.1 of the Thread(R) standard.
## Properties {#thread-properties}
Properties for Thread(R) are allocated out of the `Tech` property
section (see (#property-sections)).
### PROP 80: PROP_THREAD_LEADER_ADDR
* Type: Read-Only
* Packed-Encoding: `6`
The IPv6 address of the leader. (Note: May change to long and short address of leader)
### PROP 81: PROP_THREAD_PARENT
* Type: Read-Only
* Packed-Encoding: `ES`
* LADDR, SADDR
The long address and short address of the parent of this node.
### PROP 82: PROP_THREAD_CHILD_TABLE
* Type: Read-Only
* Packed-Encoding: `A(t(ES))`
Table containing the long and short addresses of all
the children of this node.
### PROP 83: PROP_THREAD_LEADER_RID
* Type: Read-Only
* Packed-Encoding: `C`
The router-id of the current leader.
### PROP 84: PROP_THREAD_LEADER_WEIGHT
* Type: Read-Only
* Packed-Encoding: `C`
The leader weight of the current leader.
### PROP 85: PROP_THREAD_LOCAL_LEADER_WEIGHT
* Type: Read-Write
* Packed-Encoding: `C`
The leader weight for this node.
### PROP 86: PROP_THREAD_NETWORK_DATA
* Type: Read-Only
* Packed-Encoding: `D`
The local network data.
### PROP 87: PROP_THREAD_NETWORK_DATA_VERSION
* Type: Read-Only
* Packed-Encoding: `S`
### PROP 88: PROP_THREAD_STABLE_NETWORK_DATA
* Type: Read-Only
* Packed-Encoding: `D`
The local stable network data.
### PROP 89: PROP_THREAD_STABLE_NETWORK_DATA_VERSION
* Type: Read-Only
* Packed-Encoding: `S`
### PROP 90: PROP_THREAD_ON_MESH_NETS
* Type: Read-Write
* Packed-Encoding: `A(t(6CbCb))`
Data per item is:
* `6`: IPv6 Prefix
* `C`: Prefix length in bits
* `b`: Stable flag
* `C`: TLV flags
* `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.
### PROP 91: PROP_THREAD_OFF_MESH_ROUTES
* Type: Read-Write
* Packed-Encoding: `A(t(6CbCbb))`
Data per item is:
* `6`: Route Prefix
* `C`: Prefix length in bits
* `b`: Stable flag
* `C`: Route preference flags
* `b`: "Is defined locally" flag. Set if this route info was locally
defined as part of local network data. Assumed to be true for set,
insert and replace. Clear if the route is part of partition's network
data.
* `b`: "Next hop is this device" flag. Set if the next hop for the
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.
### PROP 92: PROP_THREAD_ASSISTING_PORTS
* Type: Read-Write
* Packed-Encoding: `A(S)`
### PROP 93: PROP_THREAD_ALLOW_LOCAL_NET_DATA_CHANGE
* Type: Read-Write
* Packed-Encoding: `b`
Set to true before changing local net data. Set to false when finished.
This allows changes to be aggregated into single events.
### PROP 94: PROP_THREAD_MODE
* Type: Read-Write
* Packed-Encoding: `C`
This property contains the value of the mode
TLV for this node. The meaning of the bits in this
bitfield are defined by section 4.5.2 of the Thread(R)
specification.
### PROP 5376: PROP_THREAD_CHILD_TIMEOUT
* Type: Read-Write
* Packed-Encoding: `L`
Used when operating in the Child role.
### PROP 5377: PROP_THREAD_RLOC16
* Type: Read-Write
* Packed-Encoding: `S`
### PROP 5378: PROP_THREAD_ROUTER_UPGRADE_THRESHOLD
* Type: Read-Write
* Packed-Encoding: `C`
### PROP 5379: PROP_THREAD_CONTEXT_REUSE_DELAY
* Type: Read-Write
* Packed-Encoding: `L`
### PROP 5380: PROP_THREAD_NETWORK_ID_TIMEOUT
* Type: Read-Write
* Packed-Encoding: `C`
Allows you to get or set the Thread(R) `NETWORK_ID_TIMEOUT` constant, as
defined by the Thread(R) specification.
### PROP 5381: PROP_THREAD_ACTIVE_ROUTER_IDS
* Type: Read-Write/Write-Only
* Packed-Encoding: `A(C)` (List of active thread router ids)
Note that some implementations may not support `CMD_GET_VALUE`
router ids, but may support `CMD_REMOVE_VALUE` when the node is
a leader.
### PROP 5382: PROP_THREAD_RLOC16_DEBUG_PASSTHRU
* Type: Read-Write
* Packed-Encoding: `b`
Allow the HOST to directly observe all IPv6 packets received by the NCP,
including ones sent to the RLOC16 address.
Default value is `false`.
### PROP 5383: PROP_THREAD_ROUTER_ROLE_ENABLED
* Type: Read-Write
* Packed-Encoding: `b`
Allow the HOST to indicate whether or not the router role is enabled.
If current role is a router, setting this property to `false` starts
a re-attach process as an end-device.
### PROP 5384: PROP_THREAD_ROUTER_DOWNGRADE_THRESHOLD
* Type: Read-Write
* Packed-Encoding: `C`
### PROP 5385: PROP_THREAD_ROUTER_SELECTION_JITTER
* Type: Read-Write
* Packed-Encoding: `C`
Specifies the self imposed random delay in seconds a REED waits before
registering to become an Active Router.
### PROP 5386: PROP_THREAD_PREFERRED_ROUTER_ID
* Type: Write-Only
* Packed-Encoding: `C`
Specifies the preferred Router Id. Upon becoming a router/leader the node
attempts to use this Router Id. If the preferred Router Id is not set or
if it can not be used, a randomly generated router id is picked. This
property can be set only when the device role is either detached or
disabled.
### PROP 5387: PROP_THREAD_NEIGHBOR_TABLE
* Type: Read-Only
* Packed-Encoding: `A(t(ESLCcCbLL))`
Data per item is:
* `E`: Extended/long address
* `S`: RLOC16
* `L`: Age
* `C`: Link Quality In
* `c`: Average RSS
* `C`: Mode (bit-flags)
* `b`: `true` if neighbor is a child, `false` otherwise.
* `L`: Link Frame Counter
* `L`: MLE Frame Counter
### PROP 5388: PROP_THREAD_CHILD_COUNT_MAX
* Type: Read-Write
* Packed-Encoding: `C`
Specifies the maximum number of children currently allowed.
This parameter can only be set when Thread(R) protocol operation
has been stopped.
### PROP 5389: PROP_THREAD_LEADER_NETWORK_DATA
* Type: Read-Only
* Packed-Encoding: `D`
The leader network data.
### PROP 5390: PROP_THREAD_STABLE_LEADER_NETWORK_DATA
* Type: Read-Only
* Packed-Encoding: `D`
The stable leader network data.
### PROP 5391: PROP_THREAD_JOINERS {#prop-thread-joiners}
* Type: Insert/Remove Only (optionally Read-Write)
* Packed-Encoding: `A(t(ULE))`
* Required capability: `CAP_THREAD_COMMISSIONER`
Data per item is:
* `U`: PSKd
* `L`: Timeout in seconds
* `E`: Extended/long address (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
are allowed to join the Thread(R) Network.
### PROP 5392: PROP_THREAD_COMMISSIONER_ENABLED {#prop-thread-commissioner-enabled}
* Type: Write only (optionally Read-Write)
* Packed-Encoding: `b`
* Required capability: `CAP_THREAD_COMMISSIONER`
Set to true to enable the native commissioner. It is mandatory before adding the joiner to the network.
### PROP 5393: PROP_THREAD_TMF_PROXY_ENABLED {#prop-thread-tmf-proxy-enabled}
* Type: Read-Write
* Packed-Encoding: `b`
* Required capability: `CAP_THREAD_TMF_PROXY`
Set to true to enable the TMF proxy.
### PROP 5394: PROP_THREAD_TMF_PROXY_STREAM {#prop-thread-tmf-proxy-stream}
* Type: Read-Write-Stream
* Packed-Encoding: `dSS`
* Required capability: `CAP_THREAD_TMF_PROXY`
Data per item is:
* `d`: CoAP frame
* `S`: source/destination RLOC/ALOC
* `S`: source/destination port
Octects: | 2 | *n* | 2 | 2
---------|--------|------|---------|-------
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
* Packed-Encoding:: `b`
This property specifies the value used in Thread(R) MLE Discovery Request
TLV during discovery scan operation. Default value is `false`.
### PROP 5396: PROP_THREAD_DISCOVERY_SCAN_ENABLE_FILTERING {#prop-thread-discovery-scan-enable-filtering}
* Type: Read-Write
* Packed-Encoding:: `b`
This property is used to enable/disable EUI64 filtering during discovery
scan operation. Default value is `false`.
### PROP 5397: PROP_THREAD_DISCOVERY_SCAN_PANID {#prop-thread-discovery-scan-panid}
* Type: Read-write
* Packed-Encoding:: `S`
This property specifies the PANID used for filtering during discovery
scan operation. Default value is `0xffff` (broadcast PANID) which disables
PANID filtering.
### PROP 5398: PROP_THREAD_STEERING_DATA {#prop-thread-steering-data}
* Type: Write-Only
* Packed-Encoding: `E`
* Required capability: `CAP_OOB_STEERING_DATA`
This property can be used to set the steering data for MLE Discovery
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.
@@ -1,174 +0,0 @@
# Test Vectors
## Test Vector: Packed Unsigned Integer
Decimal Value | Packet Octet Encoding
-------------:|:----------------------
0 | `00`
1 | `01`
127 | `7F`
128 | `80 01`
129 | `81 01`
1,337 | `B9 0A`
16,383 | `FF 7F`
16,384 | `80 80 01`
16,385 | `81 80 01`
2,097,151 | `FF FF 7F`
<!-- RQ -- The PUI test-vector encodings need to be verified. -->
## Test Vector: Reset Command
* NLI: 0
* TID: 0
* CMD: 1 (`CMD_RESET`)
Frame:
80 01
## Test Vector: Reset Notification
* NLI: 0
* TID: 0
* CMD: 6 (`CMD_VALUE_IS`)
* PROP: 0 (`PROP_LAST_STATUS`)
* VALUE: 114 (`STATUS_RESET_SOFTWARE`)
Frame:
80 06 00 72
## Test Vector: Scan Beacon
* NLI: 0
* TID: 0
* CMD: 7 (`CMD_VALUE_INSERTED`)
* PROP: 51 (`PROP_MAC_SCAN_BEACON`)
* VALUE: Structure, encoded as `Cct(ESSc)t(iCUd)`
* CHAN: 15
* RSSI: -60dBm
* MAC_DATA: (0D 00 B6 40 D4 8C E9 38 F9 52 FF FF D2 04 00)
* Long address: B6:40:D4:8C:E9:38:F9:52
* Short address: 0xFFFF
* PAN-ID: 0x04D2
* LQI: 0
* NET_DATA: (13 00 03 20 73 70 69 6E 65 6C 00 08 00 DE AD 00 BE EF 00 CA FE)
* Protocol Number: 3
* Flags: 0x20
* Network Name: `spinel`
* XPANID: `DE AD 00 BE EF 00 CA FE`
Frame:
80 07 33 0F C4 0D 00 B6 40 D4 8C E9 38 F9 52 FF FF D2 04 00
13 00 03 20 73 70 69 6E 65 6C 00 08 00 DE AD 00 BE EF 00 CA
FE
## Test Vector: Inbound IPv6 Packet
CMD_VALUE_IS(PROP_STREAM_NET)
<!-- RQ -- FIXME: This test vector is incomplete. -->
## Test Vector: Outbound IPv6 Packet
CMD_VALUE_SET(PROP_STREAM_NET)
<!-- RQ -- FIXME: This test vector is incomplete. -->
## Test Vector: Fetch list of on-mesh networks
* NLI: 0
* TID: 4
* CMD: 2 (`CMD_VALUE_GET`)
* PROP: 90 (`PROP_THREAD_ON_MESH_NETS`)
Frame:
84 02 5A
## Test Vector: Returned list of on-mesh networks
* NLI: 0
* TID: 4
* CMD: 6 (`CMD_VALUE_IS`)
* PROP: 90 (`PROP_THREAD_ON_MESH_NETS`)
* VALUE: Array of structures, encoded as `A(t(6CbC))`
IPv6 Prefix | Prefix Length | Stable Flag | Other Flags
-------------|---------------|-------------|--------------
2001:DB8:1:: | 64 | True | ??
2001:DB8:2:: | 64 | False | ??
Frame:
84 06 5A 13 00 20 01 0D B8 00 01 00 00 00 00 00 00 00 00 00
00 40 01 ?? 13 00 20 01 0D B8 00 02 00 00 00 00 00 00 00 00
00 00 40 00 ??
<!-- TODO: This test vector is incomplete. -->
## Test Vector: Adding an on-mesh network
* NLI: 0
* TID: 5
* CMD: 4 (`CMD_VALUE_INSERT`)
* PROP: 90 (`PROP_THREAD_ON_MESH_NETS`)
* VALUE: Structure, encoded as `6CbCb`
IPv6 Prefix | Prefix Length | Stable Flag | Other Flags
-------------|---------------|-------------|--------------
2001:DB8:3:: | 64 | True | ??
Frame:
85 03 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00 40
01 ?? 01
<!-- RQ -- FIXME: This test vector is incomplete. -->
## Test Vector: Insertion notification of an on-mesh network
* NLI: 0
* TID: 5
* CMD: 7 (`CMD_VALUE_INSERTED`)
* PROP: 90 (`PROP_THREAD_ON_MESH_NETS`)
* VALUE: Structure, encoded as `6CbCb`
IPv6 Prefix | Prefix Length | Stable Flag | Other Flags
-------------|---------------|-------------|--------------
2001:DB8:3:: | 64 | True | ??
Frame:
85 07 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00 40
01 ?? 01
<!-- RQ -- FIXME: This test vector is incomplete. -->
## Test Vector: Removing a local on-mesh network
* NLI: 0
* TID: 6
* CMD: 5 (`CMD_VALUE_REMOVE`)
* PROP: 90 (`PROP_THREAD_ON_MESH_NETS`)
* VALUE: IPv6 Prefix `2001:DB8:3::`
Frame:
86 05 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00
## Test Vector: Removal notification of an on-mesh network
* NLI: 0
* TID: 6
* CMD: 8 (`CMD_VALUE_REMOVED`)
* PROP: 90 (`PROP_THREAD_ON_MESH_NETS`)
* VALUE: IPv6 Prefix `2001:DB8:3::`
Frame:
86 08 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00
+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)
+34
View File
@@ -0,0 +1,34 @@
## 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
codelab_otsim
- For use with the [Docker Simulation Codelab](https://codelabs.developers.google.com/codelabs/openthread-simulation/), contains the OpenThread POSIX example and `wpantund` pre-built and ready to use.
environment
- Development environment with the GNU toolchain and all required OpenThread dependencies installed. OpenThread is not built in this image.
Images built from these Dockerfiles are available to pull from [Docker Hub](https://hub.docker.com/u/openthread/). See [Docker Support on openthread.io](https://openthread.io/guides#docker_support) for more information.
@@ -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
+39
View File
@@ -0,0 +1,39 @@
# Ubuntu image with tools required to build OpenThread
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies:
RUN apt-get update -qq
# Install packages needed for wpantund build and runtime:
RUN apt-get install -y build-essential git make autoconf \
autoconf-archive automake dbus libtool gcc \
g++ gperf flex bison texinfo ncurses-dev \
libexpat-dev python sed python-pip gawk \
libreadline6-dev libdbus-1-dev \
libboost-dev inetutils-ping
RUN apt-get install -y --force-yes gcc-arm-none-eabi
RUN pip install pexpect
# Install 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 && \
make && make install
RUN mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun
# Restart dbus
RUN service dbus restart
# Install OpenThread
RUN cd ~/src && \
git clone --recursive https://github.com/openthread/openthread.git && \
cd openthread && \
./bootstrap && \
make -f examples/Makefile-posix
+27
View File
@@ -0,0 +1,27 @@
# Ubuntu image with tools required to build OpenThread
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update
RUN apt-get install -y git software-properties-common sudo
RUN apt-get install -y iproute2 psmisc rsyslog
# setup openthread
WORKDIR /
COPY . openthread
WORKDIR /openthread
RUN git reset --hard && git clean -xfd
RUN ./script/bootstrap
# setup wpantund
WORKDIR /
RUN git clone https://github.com/openthread/wpantund.git
WORKDIR /wpantund
RUN ./script/bootstrap && ./bootstrap.sh && ./configure && sudo make -j8 && sudo make install
# entrypoint
WORKDIR /
COPY etc/docker/environment/docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["bash"]
+41
View File
@@ -0,0 +1,41 @@
#!/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.
#
#
# Description:
# This file configures docker environemnt to support wpantund
#
set -e
mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun
service dbus restart
service rsyslog start
exec "$@"
+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
-86
View File
@@ -1,86 +0,0 @@
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# -*- mode: ruby -*-
# vi: set ft=ruby :
# cribbed from https://github.com/adafruit/esp8266-micropython-vagrant
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
# Virtualbox VM configuration.
config.vm.provider "virtualbox" do |v|
# extra memory for compilation
v.memory = 2048
end
# downloads and configuration dependencies
config.vm.provision "shell", privileged: false, inline: <<-SHELL
echo "Installing dependencies..."
# quiets some stdin errors
export DEBIAN_FRONTEND=noninteractive
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
sudo apt-get update -qq
# wpandtund runtime & build requirements
sudo apt-get install -y build-essential git make autoconf autoconf-archive \
automake dbus libtool gcc g++ gperf flex bison texinfo \
ncurses-dev libexpat-dev python sed python-pip gawk \
libreadline6-dev libreadline6 libdbus-1-dev libboost-dev
sudo apt-get install -y --force-yes gcc-arm-none-eabi
sudo pip install pexpect
echo "Installing OpenThread & wpandtund..."
mkdir -p ~/src
# install wpantund
cd ~/src
echo "installing wpantund"
git clone --recursive https://github.com/openthread/wpantund.git
cd wpantund
sudo git checkout full/master
./configure --sysconfdir=/etc
make
sudo make install
# dbus sometimes is wonky; forcing restart
sudo service dbus restart
# install OpenThread
cd ~/src
git clone --recursive https://github.com/openthread/openthread.git
cd openthread
./bootstrap
echo "OpenThread and wpantund setup complete! Examples can be found in ~/src/openthread/examples"
SHELL
end
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

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