Commit Graph

51 Commits

Author SHA1 Message Date
Jonathan Hui ac89fd5496 [style] return void where code always returns OT_ERROR_NONE (#3543) 2019-02-01 09:03:24 -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
Jonathan Hui f6afc5599a [style] apply OT_UNUSED_VARIABLE (#3299) 2018-11-17 12:04:41 -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
Jonathan Hui 5a489836cd [naming] rename FFD to FTD (#3102) 2018-09-27 09:33:03 -07:00
Biswajit 06bff96310 [mle] API to provide MLE Parent Response information (#3027) 2018-09-21 18:28:41 -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
Jonathan Hui c116441212 [api] change type from uint8_t * to otMeshLocalPrefix (#2966) 2018-08-17 08:59:37 -07:00
Jonathan Hui 920197398b [api] change type from uint8_t* to otExtendedPanId (#2960) 2018-08-15 10:12:49 -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
Yakun Xu 96ed7ccd24 [ncp] add radio only mode NCP app (#2085) 2018-04-16 09:28:00 -07:00
Abtin Keshavarzian ad4b597262 [settings] adding Settings class (#2606) 2018-03-19 22:45:04 +00:00
Jonathan Hui 69d98d4a53 [code-style] apply clang-format 2018-02-09 21:43:42 +00:00
Abtin Keshavarzian f366e4f987 [logging] remove otLogFunc<Entry/Exit> macros (#2438) 2017-12-22 16:41:05 +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
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
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
Jonathan Hui 5ecab16f86 [configure] replace --with-platform-info using project config (#2077) 2017-08-08 22:10:07 -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
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
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 8924a545c0 Use OT_UNUSED_VARIABLE(variable) to replace (void)variable (#1934) 2017-06-26 22:22:37 -07:00
Adam Eliot 8b4d468c3c Added ip level counters (#1892)
* Added ip level counters

* Fixed style issue

* Added const to function prototype

* Removed SPINEL_ from the property return strings

* Added descriptions for ipv6 counters and moved counter logic out of logging function

* Added public API to get the IPv6 counters

* Fixed build errors with bad call to otThreadGetIPv6Counters

* Changed otThreadGetIp6Counters to return a const *

* make pretty
2017-06-14 20:58:15 -07:00
Mike 8dc31d6e27 Enable defines (#1877)
* Add dhcp6 client define, and update openthred-config include scheme

* #1663 - update include to use quotes instead of angle brackets

* #1663 - update file to use underscore instead of dash

* #1663 - remove extra space

* #1663 - update location of new header file and update files to point to it

* #1663 - update location of new header file and update files to point to it

* #1663 update makefile.am to include new header

* update for make pretty changes

* more pretty fixes

* cleanup, and remove automatic mbedtls change

* remove debugging change

* #1663 - Remove extra space, and change include to use angle brackets instead of quotes.

* rename the enable defines file to openthred_config

* #1663 clean up for code review

* #1663 - clean up last nits

* #1663 - missed merge conflicts - file openthread-config.h -> openthread/openthread_config.h
2017-06-12 13:26:44 -07:00
Shu Chen 6e3d663009 Remove LinkQualityInfo::kUnknownRss and use OT_RADIO_RSSI_INVALID instead (#1897) 2017-06-12 11:05:40 -07:00
rongli e9e78fc3a3 still return the parent info even if device is router (#1875) 2017-06-04 10:36:45 -07:00
Shu Chen 4460fb1815 Don't return parent info if the device is not a child (#1868)
* Fix the issue that the previous parent information could be retrieved
  even after the device is not a child

* Print more parent information in CLI
2017-06-02 09:03:48 -07:00
Abtin Keshavarzian 9c09577d52 NcpBase: Implement get handler for IPV6_LL_ADDR spinel property (#1826)
This commit add a new API `otThreadGetLinkLocalIp6Address()` to
get the Thread link-local address (which is is derived using
IEEE802.15.4 Extended Address as Interface Identifier).  The new
API is then used to implement the get handler for spinel property
`IPV6_LL_ADDR` in `NcpBase` class.
2017-06-01 13:20:44 -07:00
Jonathan Hui 427ef53900 Cleanup device role names. (#1820) 2017-05-25 15:36:43 -07:00
Jonathan Hui 344a78f39f Cleanup MLE attach names. (#1816) 2017-05-24 08:41:38 -07:00
Jonathan Hui 48b9299544 Clean up error names. (#1764) 2017-05-23 09:34:35 -07:00
Shu Chen 9bcc2ccfe4 Move PSKc Get and Set functions to thread_ftd (#1782) 2017-05-18 20:52:39 -07:00
Jonathan Hui cf59c5826f Co-locate settings structs and document rules for updating. (#1754) 2017-05-11 10:00:29 -07:00
Jonathan Hui fbfd76a990 Apply #include code style. (#1723) 2017-05-05 11:28:29 -07:00
Jonathan Hui da7ba8ba19 Require Thread Master Key to be 16 bytes. (#1724)
- Update code to use `otMasterKey` type.
2017-05-05 09:21:43 -07:00
Vaas Krishnamurthy 8d5a701adb Set steering data and enable MLE discovery response filtering. (#1685)
Enable OPENTHREAD_CONFIG_ENABLE_STEERING_DATA_SET_OOB to be able to set
steering data out of band on FFDs.

On joining device, enable filtering MLE discovery responses based on Factory assigned EUI64.
2017-05-03 13:24:02 -07:00
Buke Po 9a35b0de05 Make Network Diagnostic optional for MTD. (#1686)
* make network diagnostic optional for mtd
2017-05-01 20:07:39 -07:00
Shu Chen 90d62a4e22 Remove some Leader/Router related features from MTD build (#1680)
* Unify the location of "#if OPENTHREAD_FTD" which include/exclude the whole file

Also correct some comments in xxx_api.cpp

* Remove Address Resolver related features from MTD build

* Remove some Leader/Router related features from MTD build

* Remove Leader/Router related APIs from MTD build

* Remove Leader/Router related functions from MTD build
2017-04-30 20:46:22 -07:00
Jonathan Hui 1eabda6a08 Change top-level namespace from 'Thread' to 'ot'. (#1664) 2017-04-27 22:29:05 -07:00
Buke Po 024c44de5c Add PSKc API (#1635)
* add pskc api

* add pskc cli

* add NCP api of PSKc

* apply PSKc from network

* implement PSKC api for windows

* add name for pskc property

* clear active and pending dataset when settings pskc
2017-04-27 16:32:34 -07:00
Abtin Keshavarzian f392421d2c Update otThreadDiscover() to include input argument for setting Joiner flag. (#1658) 2017-04-26 11:10:51 -07:00
Shu Chen 0a830ecefe Reduce MTD code size by removing some unused MeshCoP features (#1361)
* Seperate FTD-only dataset APIs;

* Remove some unused MeshCoP functions from MTD build;

* Remove some unused CLI functions from MTD build.
2017-04-25 11:51:12 -07:00
Jonathan Hui b36358a362 Remove extern "C" from cpp files. (#1595) 2017-04-17 10:48:56 -07:00
Jonathan Hui 04d3032bab Do not revert to non-volatile settings when changed by application. (#1586)
- Invalidate Active and Pending Datasets when configs are changed via APIs.
- Do not allow client to change network configurations while Thread is enabled.
2017-04-13 08:41:35 -07:00
Jonathan Hui a5c3fb6aaf Add accessor methods to neighbor/child/router objects. (#1577) 2017-04-11 13:25:11 -07:00
rongli 2ba9933882 not configure discovery scan duration (#1502) 2017-04-06 09:56:31 -07:00
Adam Eliot 94fab38d4a Parent last rssi (#1558)
* Added thread api call to get the last rssi for the parent
2017-04-05 19:21:33 -07:00
Giedrius 77fed906ac Fix otSendMacDataRequest API (#1521)
* Fix otSendMacDataRequest API

* Add otSendMacDataRequest declaration to API headers
* Move otSendMacDataRequest from thread to link API

* Update otSendMacDataRequest to otLinkSendDataRequest
2017-03-29 05:52:32 -07:00
rongli 9a175befed Fix bugs in Announce (#1471) 2017-03-16 09:04:51 -07:00
Jonathan Hui e919576978 Move include/platform to include/openthread/platform. 2017-03-02 10:24:55 -08:00