Commit Graph

1559 Commits

Author SHA1 Message Date
rongli a8496c80a1 [configure]: update mac_filter help string (#2004) thread-reference-20170716 2017-07-15 07:30:16 -07:00
rongli a45764c432 [cert-mgmt] workaround: reuse existing active/pending dataset for partial dataset from thread device (#2002) 2017-07-15 07:29:35 -07:00
Buke Po e14598c680 [scheduler] move schedulers into otInstance (#1997) 2017-07-14 16:23:22 -07:00
Jonathan Hui 028368e4ee [build] create separate linker map files for each application binary (#1992)
Previously, a global 'map.map' filename was used.  However, when
building FTD and MTD versions of a given application, the 'map.map'
files would overwrite each other.  This commit gives different filenames
to each .map file for a given binary.
2017-07-14 12:00:32 -07:00
rongli 9405d614a3 [dataset] Thread device should send /c/ps when attaching (#2000)
On attach, a device clears its network pending dataset.  If the device
has a newer local pending dataset, it should generate and send a /c/ps
message to the Leader.
2017-07-14 08:46:22 -07:00
Buke Po aa55ce5619 [travis-ci] adjust tests order to reduce overall time. (#1998) 2017-07-14 08:38:06 -07:00
Buke Po d4836a4426 [mbedtls] move heap into otInstance. (#1996) 2017-07-14 08:37:12 -07:00
Abtin Keshavarzian 4a1bbc8044 [ncp] fix spacing/alignments and typos in comment (#1994) 2017-07-14 08:36:22 -07:00
rongli e350d4e49f [mle] fix reattach attempts after reset (#1995) 2017-07-13 21:37:21 -07:00
Jonathan Hui 12040b7275 [mle] reset last heard on receiving MLE Parent Request (#1991)
When a child is not attached, set the last heard and timeout values on
receiving an MLE Parent Request message.  This ensures that the child
state is not prematurely timed out when a child is trying to attach.
2017-07-13 13:49:27 -07:00
Shu Chen 11d668fb06 [link-quality] update mLastRss in LinkQualityInfo::AddRss() (#1988) 2017-07-13 10:26:04 -07:00
Buke Po 5c9dab6ebf [posix] exit if socket operations fails (#1987) 2017-07-13 07:35:28 -07:00
Abtin Keshavarzian 6672093658 [mesh-forwarder] remove BUSY error log in ScheduleTransmissionTask() (#1986)
This commit removes the `error` from `ScheduleTransmissionTask()` and
also removes the corresponding log line printing the error. The BUSY
error log is not really helpful as `ScheduleTransmissionTask` is
posted whenever a new messages is queued and within this method it is
first checked if we are busy (i.e., in middle of an earlier tx) and
simply return and wait for end of current tx to process the next one.
2017-07-13 07:33:35 -07:00
Thomas 2a6a0b0a6a [mle] solution for MLE Announce processing corner case (#1984)
* Solution for MLE Announce processing corner case

Adding an additional check to prevent executing SendAnnounce in case  localtimestamp and timestamp are equal
2017-07-13 07:29:26 -07:00
Buke Po 06b523f3bd [tests] separate large tests to lower peak memory (#1989)
After Travis updated its environment, Travis fails distcheck due to insufficient memory. Although OpenThread itself doesn't use much memory, the address sanitizer does.

This commit separates large scale test cases to lower peak memory usage when running certification tests on Travis.
2017-07-13 07:27:10 -07:00
Hubert Miś f4fbac1254 [radio] delayed transmission support (#1976)
* [radio] Add call from radio to MAC layer to indicate transmission start.

This call is used to start ACK timer. When transmission requested by the MAC
layer is delayed by the radio layer (e.g. due to BLE activity) ACK timer should
not be started when MAC requests transmission but when tranmission is started.
This commit provides required functions.

* [nRF52840] Queue transmission in radio platform to allow delayed transmission after BLE activity.

* Add note that otPlatRadioTxStarted() should be called by main OpenThread thread.
2017-07-12 11:22:05 -07:00
rongli 502c6ca5d6 [mac filter] add rssfilter support and integrate whitelist/blacklist to AddressFilter (#1967)
* [mac filter] add rssfilter support and integrate whitelist/blacklist
- provide RssIn filter function to fix the received signal strength for test purpose.
- provide Address filter function which integrates whitelist and blacklist, save (~300B) RAM.
- update cli and spinel-cli to reflect new otLinkFilterX() APIs.
- keep whitelist/blacklist spinel properties the same as before while implemented with new otLinkFilterX() APIs.
- THCI: add setOutBoundLinkQuality() API for DEV-1530
- THCI: update Allow/Block relative APIs
- update some test scripts due to new OT_ERROR_ALEADY when adding duplicate address to whitelist

* update for comments

* add MAC_FIXED_RSS spinel property

* rebase and apply new OutboundFrameBegin(aHeader)

* update OpenThread.py
2017-07-11 22:38:49 -07:00
Jonathan Hui 16d76db592 [docs] add Qorvo GP712 (#1981) 2017-07-11 14:17:54 -07:00
Abtin Keshavarzian 676fd5c014 [build] update configure options in travis script and Makefile-posix (#1975) 2017-07-11 13:32:41 -07:00
Jonathan Beri 3c66ad874e Add Qorvo logo (#1980) 2017-07-11 12:32:00 -07:00
Hubert Miś 4fa7d3a52d [nRF52840] enable I-code cache in nRF52840 by default (#1977) 2017-07-11 10:51:08 -07:00
Abtin Keshavarzian 52a11d0a93 [supervision] Fix timer callbacks to follow the new model (#1974) 2017-07-11 10:49:35 -07:00
Jonathan Hui 38c95256ca [settings] updates to non-volatile frame counter storage (#1973)
Frame counter values are stored to non-volatile memory whether or not
the device is attached to a network, since MLE messages are sent prior
to being attached to a network.
2017-07-11 10:49:13 -07:00
Buke Po dffb1b881c [mbedtls] implement heap for mbedtls (#1970)
* Implement heap for mbedTLS.

* Add unit test for mbedTLS heap.
2017-07-11 10:28:21 -07:00
Jonathan Hui 274ec794b7 [mle] do not remove child on receiving an MLE parent request. (#1968)
MLE Parent Request messages may be sent by an existing child that is
searching for parents or trying to reattach.  Simply receiving an MLE
Parent Request message should not result in Router(s) flushing any
existing state and associated messages for the Child.

This commit makes the following changes:

- RemoveNeighbor() is no longer called from HandleParentRequest.

- MLE Parent Response messages are explicitly marked for direct
  transmission.

- A new method MeshForwarder::RemoveMessages() is introduced to remove
  all messages (direct and indirect) matching a particular sub-type for
  a given child.

- All queued MLE messages are removed for a given child upon receiving
  an MLE Child ID Request message.

- No queued data messages for a given child are removed.
2017-07-11 10:27:15 -07:00
Abtin Keshavarzian 92b0ddca0a [link-quality] introduce RssAverager and keep track of average RSS for a received message (#1961)
This commit  introduces a new class `RssAverager` (which contains the
existing averaging logic from`LinkQualityInfo` class). It also updates
`Message` class to maintain the average RSS for a received message
(note that a message may be composed of multiple 802.15.4 fragments
data frames each received with different signal strength). The
`MeshForwarder::LogIp6Message()` is updated to log the RSS value for
received/dropped messages.
2017-07-11 09:10:54 -07:00
erja-gp 3078359e38 [platforms] new platform Qorvo GP712. (#1942) 2017-07-11 09:10:00 -07:00
Shu Chen 129c419107 [timer] multiple microseconds timer support (#1962)
* [timer] multiple microseconds timer support

* Remove TimerSchedulerLocator, Timer inherit from Ip6Locator instead to get TimerScheduler.

* Add separate UsecTimer and UsecTimerScheduler for multiple microseconds timer support.

* [timer] refine Timer names

* Rename alarm header files to alarm-milli.h and alarm-micro.h

* Rename alarm APIs to start with otPlatAlarmMilli and otPlatAlarmMicro

* Rename Timer classes to TimerMilli/TimerMilliScheduler and TimerMicro/TimerMicroScheduler

* [Timer] Refactor Timer code structure

* Create TimerBase and TimerSchedulerBase class for common functions;

* Use TimerMilli/TimerMicro and TimerMilliScheduler/TimerMicroScheduler for different functions;

* Define AlarmApi, so then TimerMilliScheduler/TimerMicroScheduler could use different AlarmApi.
2017-07-10 16:01:27 -07:00
Abtin Keshavarzian 529c291f7a [ncp-buffer] Frame Priority Support (#1948)
This commit adds support for setting two levels of priority (high or
low) to frames stored in `NcpFrameBuffer`. High-priority frames are
read before any queued low-priority frames. Within the same priority
level FIFO order is preserved.

The `NcpBase` is updated to send/queue the spinel response frames (with
non- zero `tid`) as higher-priority frames. This ensures faster response
time for spinel commands.

This commit also adds/updates test cases for unit testing the NCP
buffer and its new priority feature.
2017-07-10 08:47:23 -07:00
rongli 529b188609 [network diagnostic] updates to consistent with spec (#1964) 2017-07-07 09:10:58 -07:00
Shu Chen 93f892bdbe [tests] Fix some unit tests random fail issue (#1966) 2017-07-07 06:40:07 -07:00
rongli 19d9b6c371 [cert-thci] support both old and new listSecurityPolicy passing ways for back-compatibility (#1963) 2017-07-06 20:46:39 -07:00
Abtin Keshavarzian 474fc26695 [supervision] Update logs to show when a supervision message is sent/received (#1960)
This commit updates the logs in supervision module to indicate when
a supervision message is sent to a sleepy child It also adds a new
log in `MeshForwarder::HandleReceivedFrame()` to indicate when an
empty payload frame is received.
2017-07-06 09:59:23 -07:00
Jonathan Hui f56d6a9ca8 Save Data Sequence Number on indirect tx, regardless of sec mode. (#1959) 2017-07-06 09:58:56 -07:00
Jonathan Hui 5f97abc356 Remove restore method for local operational dataset. (#1958)
With the local operational dataset being retrieved from non-volatile storage
on demand, the restore method is now no longer necessary.

This PR also fixes a bug in initializing the in-memory dataset representation
when no operational dataset exists in non-volatile storage.
2017-07-06 09:58:38 -07:00
Abtin Keshavarzian 10b72cfa5d [ncp] Add new spinel property MAC_DATA_POLL_PERIOD and its get/set handlers (#1952)
The spinel-protocol draft is also updated.
2017-07-05 14:53:14 -07:00
Shu Chen fd6a52dba9 [alarm-API] Update usec-alarm API to use single 32-bit microsecond (#1949)
* Update the usec-alarm API to use single 32-bit microsecond
* Update nRf52840's alarm implementation to support the new usec-alarm API
* So both milliseconds timer and microsecond timer will maintain 32-bit time
2017-07-05 10:07:19 -07:00
Abtin Keshavarzian f17b98d84a [spinel] Remove #include <openthread/config.h> from spinel.c` (#1951)
The `<openthread/config.h>` header file is already included from
OpenThread specific platform header file `spinel_platform.h`.
2017-07-05 09:43:02 -07:00
Abtin Keshavarzian acd9b2988a [ncp] Add SPINEL_CAP_ROLE_SLEEPY to SPINEL_PROP_CAPS list of capabilities. (#1950) 2017-07-05 09:42:46 -07:00
Xiao Ma ee84e1f83c [EFR32] Upgrade to RAIL Lib 1.6.0. (#1946) 2017-07-05 09:42:20 -07:00
Jonathan Hui 0d27c3e00b Remove RAM buffers for local operational datasets. (#1929)
The local Active and Pending Operational Datsets are stored in non-volatile
memory.  This commit dynamically retrieves those datasets from non-volatile
memory when they are needed.

This commit also simplifies the use of the Operational Datasets by having the
RAM buffer store the local Operational Dataset when in the detached state.
2017-07-05 09:41:08 -07:00
Abtin Keshavarzian bbab3074ed [instance] single OpenThread instance optimizations (#1926)
This commit new configuration option `enable-multiple-instances` and
its corresponding option `OPENTHREAD_ENABLE_MULTIPLE_INSTANCES`. When
enabled OpenThread supports handling of multiple instances. By default
this is disabled.

This commit also adds two optimizations for single instance case to
simplify the code and also help reduce memory/RAM usage:

(1) OpenThread objects/classes typically keep a reference to a higher
level object (e.g., many classes keep track of owning `ThreadNetif`)
to be able to access other objects/methods within OpenThread class
hierarchy. In single instance mode, the reference member variables are
removed and instead global functions are used to access the singleton
objects from one class to the other. To implement this, a group of
`<Object>Locator` classes are defined (e.g., `ThreadNetifLocator`,
etc.) which are then used as base class of other OpenThread classes.

(2) OpenThread objects which provide a callback/handler (e.g.,
`Timer`, `Tasklet`, etc.) have `void *mContext` member variable which
is used to keep track of the owner of the object. In single instance
mode the `mConext` member variables are removed since the owner is
expected to be a singleton and can be uniquely determined from the
callback function.

To implement this, two changes are made: First the handler methods are
modified to provide a reference to the object (e.g., `Timer` handler
will provide a `Timer &aTimer` as a parameter of its handler
callback). Second, a new base class `Context` is introduced which
hides the implementation providing an arbitrary context information. A
new static method `GetOwner(aContext)` is added to classes which own a
callback providing objects. This method help convert a `Context` to
the reference of the owner class object.
2017-06-30 11:48:26 -07:00
Shu Chen 5128602b49 [Timer] Remove unused HoursToMsec() and MsecToHours() (#1947) 2017-06-29 09:46:25 -07:00
rongli 6a15261b8b [cert] update for new security policy passing way (#1944) 2017-06-28 22:10:01 -07:00
Vaas Krishnamurthy e9216475f1 [mac] hold-off sleep and tx during fragments (#1888)
* Pause transmission while waiting for data.

* Adding feature to keep radio awake between fragments.

In some platforms, it is more energy efficient to keep the radio awake
between fragments (both received and sent) instead of sleeping and
immediately waking up. This feature can be enabled using
OPENTHREAD_CONFIG_STAY_AWAKE_BETWEEN_FRAGMENTS.
2017-06-28 12:25:48 -07:00
rongli f8f167bc40 [cert] increase retransmission period for data poll (#1943) 2017-06-28 09:33:49 -07:00
Hubert Miś 449841f819 [nRF52840] Enable default logging option for certification tests. (#1940) 2017-06-27 09:14:03 -07:00
Hubert Miś 50ee0d864e [nRF52840] Update radio driver (#1941) 2017-06-27 08:51:58 -07:00
Abtin Keshavarzian 8924a545c0 Use OT_UNUSED_VARIABLE(variable) to replace (void)variable (#1934) 2017-06-26 22:22:37 -07:00
Yuwen Lan f27654ec36 [meshcop] do not check keep-alive timeout when active commissioner re-petitions (#1931)
* Do not check keep-alive timeout when a recorded active commissioner re-petitions

* Force resign before accepting when active commissioner re-petitions

* Reduce duplicate code by putting mTimer.stop() inside of ResignCommissioner()
2017-06-26 22:11:41 -07:00