Commit Graph

98 Commits

Author SHA1 Message Date
Simon Lin c73320ff3e [mlr] add MulticastListenersTable on BBR (#5292)
This commit adds the Multicast Listener Table for BBR:

- Implements Multicast Listener Table on BBR
  - Adds registered MAs to MulticastListenerTable
  - Reject when the table is full or the multicast address is invalid
    and return failed status
  - Respond with unsuccessful status along with failed addresses
  - Expire Listeners from MulticastListenerTable per second (using
    MinHeap for better performance)
- MLR enhancement
  - Re-register only failed multicast addresses (used to register all
    registering multicast addresses)
- Reference Device only APIs
  - Some APIs are defined for reference devices and tests.
- Add tests
  - Add unit test: test_multicast_listener_table.cpp (runs for 1.2-bbr
    only)
  - Add functional tests
2020-08-21 08:40:58 -07:00
Abtin Keshavarzian 8fd46dde18 [time-ticker] adding 'TimeTicker' class (#5379)
This commit adds `TimeTicker` class which emits periodic ticks (with
one second period interval) to a set of registered tick receiver
modules. The `TimeTicker` would invoke `HandleTimeTick()` method
periodically on the registered receiver objects.

The `TimeTicker` model helps simplify the implementation of many
modules (such as `MeshForwarder`, `MleRoutuer`, `AddressResolver`,
`Ip6`, `DuaManager`, etc) which require periodic update/check of some
state (avoid each class using its own timer).
2020-08-19 14:04:41 -07:00
Moandor 1f05edabf4 [build] allow custom config file in Android.mk (#5418)
This commit moves OPENTHREAD_CONFIG_FILE to OPENTHREAD_PROJECT_CFLAGS
in Android.mk to allow projects to specify their own config files.
2020-08-18 21:08:28 -07:00
Li Cao 7db8c6815c [low-power] add csl feature for Thread 1.2 (#4557)
This commit implements the CSL feature in Thread 1.2.

- Add macro definitions for low power to control the compiling of
  source code.

- Add data and methods for running CSL in Mac and SubMac. This mainly
  includes setting CSL parameters, starting/stopping CSL, and the
  timer handling process.

- Add otPlatTimeGetAPI and implementation.

- Add CSL transmission implementation. CSL transmission is a new kind
  of transmission, the related definition and implementaion for the
  whole transmitting process is added.

- Add calling of start/stop CSL in certain cases.

- Implement CSL synchronization maintainence. If a CSL cordinator
  didn't get a frame containing CSL IE for CSLTimeout, the CSL
  receiver is regarded as de-synchronized.

- Add Cli interface for using CSL.

- Implement enhanced Ack with IE. The original code can only generate
  auto ack for Imm-Ack. As CSL requires CSL IE included in enhanced
  ack. This PR implements it.

- Add basic functional test for CSL transmission. More tests
  corresponding to test plan would be added later.
2020-08-18 10:55:33 -07:00
Yakun Xu 8370395c47 [cli] remove multiple servers support (#5387) 2020-08-14 22:15:32 -07:00
Abtin Keshavarzian 36b9ecbf11 [neighbor-table] add 'NeighborTable' class (#5354)
This commit adds a `NeighborTable` class which provides helper methods
dealing with neighbor, e.g., finding a `Neighbor` (i.e., a `Child`
from `ChildTable`, a `Router` from `RouterTable`, or parent or parent
candidate entries), or iterating through all neighbors.  These methods
use the newly added `Neighbor::AddressMacther` to simplify the
implementation. The `NeighborTable` methods replace the similar ones
in `Mle` and `MleRouter`.
2020-08-10 09:07:52 -07:00
Simon Lin 00f3043a06 [mlr] send MLR.req for local multicast addresses (#5248)
This commit includes:

- Adding compile configurations necessary for MLR features
- Adding source/header files necessary for MLR features
- Send MLR.req for local MAs on ThreadNetif
  - At most one MLR.req is outstanding
  - Reregistration according to PBBR configuration
  - Renewing periods according to PBBR configuration
- BBRs receive MLR.req with minimal processing and send MLR.rsp
- Add a test to verify that MLR.req is sent for local MAs.
2020-07-22 08:38:05 -07:00
Yakun Xu 89cd4b59f8 [url] move url to library (#5233)
This commit moves the URL parser to src/lib.

Also includes the following changes:
- Split URL on initialization.
- Make a GetValue() const method.
- Check aLastValue.
- Add some negative tests.
2020-07-15 23:39:02 -07:00
Rongli Sun daf89169c6 [bbr] rename file name with bbr_ prefix (#5240) 2020-07-15 12:25:58 -07:00
Yakun Xu f79406418a [android] enable commissioner (#5128) 2020-06-20 18:09:53 -07:00
Yakun Xu 8248c3d9df [posix] use real time signal for microsecond timer (#5122) 2020-06-19 16:12:55 -07:00
Jonathan Hui 1326d64a64 [style] replace NULL with nullptr (#5109) 2020-06-17 22:44:54 -07:00
Abtin Keshavarzian 54ad5a3960 [discover-scanner] adding Mle::DiscoverScanner (#5075)
This commit adds new class `DiscoverScanner` which implements the MLE
Discover Scan process (moving and simplifying all the code related to
this from `Mle` and `MeshForwarder` into same file/class).
2020-06-17 10:38:03 -07:00
Jonathan Hui d81d769e68 [style] advance C++ language standard to C++11 (#5077) 2020-06-16 13:02:53 -07:00
Jiacheng Guo 115616c6bf [posix] add radio url (#4935)
Radio url provides a unified interface for users to specify the radio
peripheral device and arguments to the OpenThread core stack.
2020-05-29 17:34:29 -07:00
Rongli Sun 2e85801083 [dua] Domain Unicast Address generation (#4854)
This commit includes
[Y] add `OPENTHREAD_CONFIG_DUA_ENABLE` option for DUA feature
[Y] generate DUA via SLAAC
[Y] update test script to verify communication via DUA
2020-04-29 22:57:50 -07:00
Yakun Xu 5632c271b8 [posix] use enumerations for RCP bus (#4871)
This commit changes the way to define RCP bus type. It now defines two
enumerations for UART and SPI. This ensures only a single bus type is
enabled, and helps keep compatible with projects using UART bus.
2020-04-21 23:23:12 -07:00
Jiacheng Guo 8de4ab4740 [spinel] platform independent spinel radio (#4705)
This change refactors radio-spinel into a platform independent
header-only library so that other platforms (baremetal/RTOS) can
enable Thread with RCP mode as well.
2020-04-20 20:50:58 -07:00
Jiacheng Guo a47ea011b1 [ip6] disable security for link-local packets from unsecure ports (#4782)
If this feature is enabled, OpenThread will automatically disable
link-level security for packets sent with unsecure source ports. Once
a secure packet is received on the unsecure port, this port will be
removed from the unsecure port list.
2020-04-10 12:26:53 -07:00
Jiacheng Guo c265aebe9e [android] export CFLAGS and include directories (#4797)
This allows libraries depending on ot-core not to specify OpenThread
path and share the OpenThread configs.
2020-04-06 22:58:04 -07:00
Jonathan Hui c64d296c94 [network-data] implement network data notifier (#4783)
This commit centralizes the timing logic for transmitting SVR_DATA.ntf
messages that are used to update network data at the leader.

This component helps ensure the following:

- At most one SVR_DATA.ntf message is outstanding at any given time.

- A timer to rety sending SVR_DATA.ntf messages if sending fails due
  to lack of memory buffers.

- A timer to rate limit SVR_DATA.ntf messages that are acknowledged
  but no corresponding change in the Thread Network Data was observed.

- Utilizes ot::Notifier to trigger logic on role, child state, and
  network data changes.
2020-04-06 21:27:51 -07:00
Simon Lin 8423ed3042 [simulation] enhance simulation for OTNS (#4268)
This commit is to support OTNS by:
- raising the max number of simulating nodes to 999 if OTNS=1
- implementing the status-push mechanism

To build:

$ make -f examples/Makefile-simulation OTNS=1

This commit should have no change of OpenThread behaviors on platforms
except simulation.
2020-04-01 10:19:36 -07:00
Piotr Koziar ec9968e1d1 [meshcop] rename leader.cpp to meshcop_leader.cpp (#4754) 2020-03-30 09:14:16 -07:00
kangping e28608cd0b [network-diagnostic] improve usability of Network Diagnostic API (#4619)
This commit improves usability of Network Diagnostic API by:

- Define native structures to represent various Network Diagnostic TLV
  values.

- Add facility function otThreadGetNextDiagnosticTlv to parse plain
  otMessage into structured data.

- Dump parsed DIAG_GET.ans/.rsp message in readable format for
  networkdiagnostic CLI command.
2020-03-26 13:43:40 -07:00
Rongli Sun 315a27bf08 [bbr] add backbone router service (#4430)
- Introduce BACKBONE_ROUTER option for Backbone Router function.
- Implement Backbone Router service registration.
  - Add basic Backbone Router service.
  - Primary Backbone Router restores its Dataset when reattached after
    short reset, increases sequence number and re-register to Leader.
  - Add configurable jitter for Backbone Router service registration.
- Add Backbone Router service test.
2020-03-26 08:54:23 -07:00
Abtin Keshavarzian 54e884569b [mle-types] adding new files mle_types.hpp/cpp (#4679)
The newly added `mle_types.hpp/cpp` files include MLE specific types
(e.g. `DeviceMode`) and constants.
2020-03-13 22:06:04 -07:00
Yakun Xu 653745911f [build] rename posix-app to posix (#4661) 2020-03-11 11:42:30 -07:00
Li Cao f9ad60600e [android] add switch to use SPI in Android.mk (#4626) 2020-03-06 20:04:58 -08:00
Yakun Xu fb16fd44d7 [build] move hdlc to lib/hdlc (#4590)
This commit moves hdlc from src/ncp to src/lib/hdlc, src/spinel is also
moved to src/lib/spinel.
2020-02-27 08:49:01 -08:00
Yakun Xu 24a24f1f9e [build] move openthread-system.h under openthread (#4593)
This commit moves openthread-system.h to a directory named openthread
so that projects depends on OpenThread can use it without installing
OpenThread project.
2020-02-24 13:16:03 -08:00
Yakun Xu abf108a9b1 [android] build ot-ctl on Android.mk (#4567) 2020-02-19 11:46:23 -08:00
Yakun Xu 8546bceeab [build] move spinel into src/utils (#4558)
Move spinel from src/ncp into src/utils and remove dependency on
OpenThread's core configurations.
2020-02-19 11:45:35 -08:00
Yakun Xu 1f2bed8e7d [posix-host] use c++ for all platform code (#4547)
- Switched to C++ for all drivers.
- Removed C utilities.
- Renamed sim.c to virtual_time.cpp.
- Changed platformSim prefix to virtualTime.
2020-02-13 06:15:47 -08:00
Yakun Xu 954a9f284e [android] move OPENTHREAD_POSIX_RCP_UART_ENABLE (#4549)
The macro OPENTHREAD_POSIX_RCP_UART_ENABLE should be defined for all
builds, not only for CI tests.

This commit also sorts the definitions removed duplicate definitions.
2020-02-11 14:40:31 -08:00
Jiacheng Guo c0313240d2 [android] build CLI and NCP libraries (#4528)
This enables other repositories to link against these libraries.
2020-02-07 08:28:52 -08:00
Jonathan Hui 71a7e47c81 [utils] remove strnlen (#4483) 2020-01-22 13:39:25 -08:00
Jonathan Hui 708c250fe5 [utils] remove strlcpy (#4483) 2020-01-22 13:39:25 -08:00
Jonathan Hui 5c9b60b855 [utils] remove strlcat (#4483) 2020-01-22 13:39:25 -08:00
Zhanglong Xia f0c063f8e9 [posix-host] add SPI interface support (#4431) 2020-01-21 19:24:42 -08:00
Jonathan Hui 37d136d0fb [config] rename ENABLE_DYNAMIC_LOG_LEVEL to LOG_LEVEL_DYNAMIC_ENABLE (#4418) 2019-12-18 15:43:44 -08:00
Yakun Xu af73358d3f [android] make Android.mk more extensible (#4359) 2019-11-27 08:18:49 +08:00
Yakun Xu 9f2ff3bcbf [build] add flag to enable dynamic logging level (#4335) 2019-11-18 14:48:21 -08: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
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 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
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 0baaf1afba [config] mac (#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