Commit Graph

21 Commits

Author SHA1 Message Date
Yakun Xu 3018886993 [windows] fix warnings (#3435) 2019-01-07 09:04:50 -08:00
Jonathan Hui 9d585edc46 [types] move types into specific headers (#2946) 2018-08-08 11:19:41 -07: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
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 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
Jonathan Hui 69d98d4a53 [code-style] apply clang-format 2018-02-09 21:43:42 +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 fdc3ea2732 [test-link-quality] Add check for GetLastRss() in link quality unit test (#2006) 2017-07-17 20:49:44 -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
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 6e3d663009 Remove LinkQualityInfo::kUnknownRss and use OT_RADIO_RSSI_INVALID instead (#1897) 2017-06-12 11:05:40 -07:00
Jonathan Hui fbfd76a990 Apply #include code style. (#1723) 2017-05-05 11:28:29 -07:00
Shu Chen 66f6e7088d Add otPlatRadioGetReceiveSensitivity() API (#1715)
* Add otPlatRadioGetReceiveSensitivity() API

* Add a new otPlatRadioGetReceiveSensitivity() API to get sensitivity value;

* Use the receive sensitivity value as the noise floor for link metric computation;

* Remove some unused noise floor related functions.

* Add SPINEL_PROP_PHY_RX_SENSITIVITY Spinel/NCP property
2017-05-04 20:38:37 -07:00
Jonathan Hui 1eabda6a08 Change top-level namespace from 'Thread' to 'ot'. (#1664) 2017-04-27 22:29:05 -07:00
DuaneEllis-TI d65418c12f Add support for wrap_string.h and others (#1642) 2017-04-27 10:17:09 -07:00
Jonathan Hui d0c687505b Move openthread.h to openthread/openthread.h. 2017-03-02 10:24:55 -08:00
Nick Banks 25cea9414b Windows Unit Test Support (#629)
Window Unit Test Support
2016-09-20 18:11:19 -07:00
Jonathan Hui 44350178ad Change copyright to The OpenThread Authors. (#583)
- Add a top-level file named AUTHORS which identifies the copyright
holders of the project.
2016-09-13 15:57:11 -07:00
Nick Banks ffbe65c6dd otInstance Declarations (#473)
* Add otInstance type declaration and update ot APIs to take it as input.
2016-09-12 14:29:43 -07:00
Jonathan Hui 28a564548c Remove globals from link_quality.cpp. 2016-09-07 13:30:22 -07:00
Abtin Keshavarzian cb33898827 Enhance the calculation of link quality metrics (#197)
This commit adds a new class `LinkQualityInfo` which stores all
relevant information about quality of a link, including average
received signal strength (RSS), link margin, and link quality value.
The RSS average is obtained using an adaptive exponential moving
average filter. A unit-test is also added for the new class.

The Neighbor class now includes an instance of LinkQualityInfo. The
RSS average is updated from 'mac.cpp' whenever a valid/verified packet
is received from the corresponding neighbor. The mesh_forwarder,
mle_router, and mle modules are modified to use the new methods from
the newly added class.

This change addresses issue #175.
2016-06-27 14:15:11 -07:00