Commit Graph

558 Commits

Author SHA1 Message Date
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
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
Jonathan Hui f46fbb844d [pskc] switch to using otPSKc struct (#3769) 2019-04-18 08:45:14 -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
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
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
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 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
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
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 0de1fff570 [style] remove redundant declarations (#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 2ab9b49042 [style] use C++-style casts (#3705) 2019-03-22 08:12:26 -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
Jonathan Hui 950c7c8612 [meshcop] avoid shift exponent too large in ChannelTlv processing (#3673) 2019-03-12 10:47:25 -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
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
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
Piotr Szkotak 530a4d23ad [slaac] remove otIp6SlaacUpdate leftover from the ip6.h header (#3612) 2019-02-21 16:22:01 -08:00
mateusz- 2d6e9085f8 [doc] fix incorrect SNTP comment (#3613) 2019-02-20 09:47:40 -08:00
Łukasz Duda 8c13df5a51 [cli] add command to retrieve mle counters (#3605) 2019-02-19 11:37:45 -08:00
Martin Turon c04bf5ea24 [ble] BLE API improvements: add l2cap and gatt services registration (#3563) 2019-02-13 08:57:13 -08:00
Abtin Keshavarzian 445827108b [ip6] update documentation for otIp6ReceiveCallback (#3584) 2019-02-12 06:03:57 -08:00
Kamil Sroka 84a2706393 [build] don't define UINT32_MAX for C (#3581) 2019-02-11 13:04:56 -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 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
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
Jonathan Hui f9659b3733 [router-table] add arg bounds check to Release() (#3521) 2019-01-28 08:38:42 -08:00
Abtin Keshavarzian 6d0bce85a0 [thread-netif] change Up()/Down() to void (no return) (#3513) 2019-01-25 08:37:59 -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 c2a10ec446 [ip6] only allow external mcast addrs when iface is up (#3504) 2019-01-24 09:04:13 -08:00
Jeff Bumgardner 4bc819c307 [docs] Doxygen tag updates (#3496) 2019-01-23 14:28:40 -08:00
Yakun Xu f40f49ff32 [dhcp] remove dhcp server api (#3476) 2019-01-18 11:34:40 -08:00
Yakun Xu d57b747c98 [udp] expose UDP receiver API (#3477) 2019-01-18 06:50:39 -08:00
Kamil Sroka 57a0fda5da [sntp] fix Keil build with SNTP_CLIENT=1 (#3460) 2019-01-16 00:17:32 -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
Yakun Xu 0f4bae97e9 [message] add const to read APIs (#3458) 2019-01-14 13:53:20 -08:00
Jonathan Hui dfd2b9b032 [api] fix typos (#3431) 2019-01-07 09:03:55 -08:00
Abtin Keshavarzian 42c46368f1 [docs] fix typos in comments (#3417) 2019-01-02 10:24:08 -08:00