Commit Graph

3098 Commits

Author SHA1 Message Date
Abtin Keshavarzian a80098bbc1 [toranj] add thread commissioning test (single joiner) (#3792) 2019-05-02 08:45:51 -07:00
Yakun Xu ae4ef9eb3e [timer] fix elapsed overflow (#3789)
This commit fixes a bug in the commissioner when a joiner's expiration
time has alerady elapsed.

This commit also introduces convenience methods for computing time
elapsed and diffs.
2019-05-02 08:44:37 -07:00
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
Abtin Keshavarzian d348ce2bbc [dtls] convert some of the info level logs to debug level (#3788) 2019-04-30 14:12:28 -07:00
Jonathan Hui 79e0dd21ce [docker] copy source rather than git clone to support CI (#3787) 2019-04-30 09:25:44 -07:00
Duda, Lukasz 0208d10563 [metadata] enhance ReadFrom and RemoveFrom methods (#3786) 2019-04-26 15:36:02 -07:00
Duda, Lukasz 1bd5920186 [joiner] remove potential memory leak (#3786) 2019-04-26 15:36:02 -07:00
Duda, Lukasz f45f822800 [coap] check error code on appending metadata (#3786) 2019-04-26 15:36:02 -07:00
Joseph Newman 988be2a7f6 [efr32] further UART driver refactoring (#3776)
- No  longer  queue  2x  32-byte  buffers  for   UART  receive.  Upon
  investigation, the  RAIL library switches these  buffers in software
  (within the  same ISR context as  `receiveDone`), so it  seems to be
  pointless  from  a   performance  perspective  in  queuing  multiple
  buffers. Instead, now work with 64-byte buffers.

- Refactored `updateReceiveProgress` so that extra variable
  `mLastCount` isn't required.

- Extensive testing at higher baud rates revealed race conditions and
  some issues with detecting buffer full conditions.

- Added comments to clarify the logic

- Removed asserts after returning from RAIL library
  functions. Contrary to my previous arguments, if the behaviour of
  the RAIL library functions changes in the future (with regards to
  the errors it returns), then somebody would have to remember to
  check these asserts were still appropriate.
2019-04-26 08:41:52 -07:00
rongli cee20c6a66 [data-poll-manager] fix unexpected interval (#3780) 2019-04-26 08:38:13 -07:00
Jiacheng Guo f5ee3a5e65 [posix-app] timeout for rcp radio driver (#3749) 2019-04-24 16:06:39 -07:00
Jonathan Hui c972c5cb93 [network-data] add bounds check when comparing server data (#3781) 2019-04-24 10:17:07 -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
rongli 2be525b352 [mle] allow attach and link sync between different Thread versions (#3779) 2019-04-23 09:00:45 -07:00
Abtin Keshavarzian f184a9462b [meshcop] clip long strings for vendor name, model, version, data (#3778)
This commit ensures that if the passed-in string args (vendor name,
model, sw version, data or provisioning URL) in `Joiner::Start()`
are too long, they are clipped to the max size defined by the
corresponding TLVs.
2019-04-23 08:59:40 -07:00
Abtin Keshavarzian 99f5790a49 [ncp] add spinel_meshcop_joiner_state_t enumeration (#3774)
This commit defines an enumeration in spinel for Joiner state which
is related to property `SPINEL_PROP_MESHCOP_JOINER_STATE`.
2019-04-22 10:04:54 -07:00
Jonathan Hui 5adac06d08 [logging] fix BeaconPayload::ToInfoString() print of network name (#3771)
`BeaconPayload::GetNetworkName()` does not return a NULL-terminated string.

This commit fixes `BeaconPayload::ToInfoString()` to pass a NULL-terminated
string to the string formatter.
2019-04-18 13:42:33 -07:00
Jonathan Hui a09d8da38c [mpl] discard datagrams with multiple MPL Options (#3764)
Credit to OSS-Fuzz.
2019-04-18 13:29:59 -07:00
Piotr Szkotak 8ff7950cd2 [nrf52840] update Nordic example CDC ACM driver (#3772) 2019-04-18 08:46:28 -07:00
Jonathan Hui 24307f1ba9 [pskc] set random PSKc when generating a new Active Dataset (#3769)
When generating a new Active Dataset, the current PSKc value is used. Because
the PSKc is initialized to all zeros, new Active Datasets have a default
PSKc value of all zeros.

This commit checks if the PSKc has been set (i.e. not all zeros) and, if not
set, generates a random PSKc when creating a new Active Dataset.
2019-04-18 08:45:14 -07:00
Jonathan Hui f46fbb844d [pskc] switch to using otPSKc struct (#3769) 2019-04-18 08:45:14 -07:00
Abtin Keshavarzian 987e96ba0d [ncp] update MESHCOP_JOINER_COMMISSIONING to allow vendor info to be given (#3767)
This commit updates `SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING`
definition to allow vendor info (name, model, sw version, data) to be
specified. All new parameters are optional and if not specified in the
spinel frame (or an empty string is given), OpenThread default values
will be used instead.

This change in `SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING` format keeps
it backward compatible with previous definition, ensuring any driver
using the previous format will be parsed in the same way.
2019-04-17 19:08:11 -07:00
Shu Chen bd2e3ef8f9 [radio-spinel] exit if it fails to get radio channelmask from rcp (#3760) 2019-04-16 11:16:53 -07:00
rongli 8fd8d1e0f9 [mle] enter fast poll mode when dequeue delayed MLE Data Request (#3761) 2019-04-16 10:28:14 -07:00
Joseph Newman 02463bdda1 [efr32] improve USART driver error handling (#3745)
* efr32 uart dma changes
* correct handling of queue full
2019-04-16 09:40:01 -07:00
Jonathan Hui d6e58b15ca [mle] do not apply active dataset from settings after attaching (#3762)
A device should use the Active Dataset in use by the partition that it is
attached to, not the one stored locally in non-volatile.
2019-04-16 08:23:10 -07:00
Kamil Sroka 9fa48b54a8 [nrf528xx] don't return OT_ERROR_FAILED from otPlatRadioTransmit (#3757) 2019-04-16 08:22:29 -07:00
Abtin Keshavarzian db3ea162a8 [message] add and use AppendTlv (#3752)
This commit adds a new method `AppendTlv` to `Message` class which
appends a fully formed TLV to the message. This commit also changes
the core modules to use the new method when appending a TLV.
2019-04-16 08:21:45 -07:00
Łukasz Duda 62b35b67c3 [nrf52840] update README.md after SDK release (#3759) 2019-04-15 08:38:18 -07:00
Łukasz Duda d3fdf84ee0 [platform] return error on incorrect otPlatRadioDisable usage (#3756) 2019-04-15 08:36:47 -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
Jonathan Hui b7b085c9f9 [fuzz] advance alarm time to cover timer handlers (#3753) 2019-04-11 11:59:20 -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
Abtin Keshavarzian eab62dd699 [spi-hdlc-adapter] allow log level to be changed (#3747)
This commit contains the following improvements  in
`spi-hdlc-adapter`:

- It changes the default syslog log level to `LOG_WARNING`.
- It enhances the `--verbose[=num]` option to allow negative values
  to reduce the log level. Note that this change keeps the behavior
  backward compatible (it is an add-on).
- It updates the `print_help()` and the `README.md` files to document
  new behavior of `--verbose` option.
2019-04-10 08:33:20 -07:00
Yakun Xu 2bacf31731 [travis] support clang code coverage (#3741) 2019-04-10 08:31:53 -07:00
Jonathan Hui 5f95995c65 [nlbuild-autotools] update to 1.6.6 (#3746) 2019-04-09 20:58:00 -07:00
Jonathan Hui 68260c2ed3 Update to reflect upstream repository 'https://github.com:nestlabs/nlbuild-autotools' at tag '1.6.6'. 2019-04-09 19:59:02 +00:00
Jonathan Hui 5ce1e001d2 Squashed 'third_party/nlbuild-autotools/repo/' changes from 75faaf5f..d4c1c470
d4c1c470 Merge pull request #18 from bukepo/code-coverage/fix-for-clang
21fb7d7b bump version and update changes
271abad7 Add code coverage for clang
3597c61e Merge pull request #17 from nestlabs/bug/fix-repos-remake-issue

git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: d4c1c47033060e6f6bbd6b9203e2d1ed26107979
2019-04-09 19:59:02 +00:00
Jonathan Hui ae04d59280 [lowpan] suppress unchecked return warning in Lowpan::Compress() (#3740) 2019-04-08 21:25:37 -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
Joseph Newman 5d2e6cd0d9 [efr32] take advantage of DMA for efr32 USART receive (#3730) 2019-04-08 10:39:45 -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 7c3bce3a4f [toranj] verify "RCPVersion" is gettable on posix-app mode (#3735)
This commit updates the `test-001` to allow extra properties to
be verified when running under posix-app model. The new test
ensures "POSIXApp:RCPVersion" is gettable.
2019-04-06 22:57:25 -07:00
Abtin Keshavarzian 6e718a1c76 [ncp-base] fix the #if check for posix-app (#3735) 2019-04-06 22:57:25 -07:00
ozanoner 37a662197f [coap] remove otCoapMessage from CoapSecure::DefaultHandler() (#3737) 2019-04-06 21:54:07 -07:00
Łukasz Duda 9847be8328 [build] fix build with announce sender enabled (#3739) 2019-04-06 21:41:45 -07:00