Commit Graph

300 Commits

Author SHA1 Message Date
pvanhorn 7862f1107e Add support for the Host Power State feature. (#1772)
* Add support for the Host Power State feature.

* Fix compiler ewrrors.

* Fix compiler errors round 2.

* Add newlines to end of file.

* Address review comments.

* Arrange to send the power state response again if the first attempt fails.

* Fix compiler issue.
2017-05-19 11:33:38 -07:00
Shu Chen 9bcc2ccfe4 Move PSKc Get and Set functions to thread_ftd (#1782) 2017-05-18 20:52:39 -07:00
Giedrius 8fa20a51f1 CoAP: add default request handler (#1718) 2017-05-15 12:01:21 -07:00
Jonathan Hui 39b1162b1e Combine CoAP Client and Server into a single CoAP agent. (#1745) 2017-05-12 11:51:19 -07:00
Abtin Keshavarzian b096efe932 Remove use of OPENTHREAD_CONFIG option from API header file thread_ftd.h (#1749)
This commit removes the use of an OpenThread configuration option
`OPENTHREAD_CONFIG_ENABLE_STEERING_DATA_SET_OOB` from API header file
`thread_ftd.h`. It also changes the `otThreadSetSteeringData()` to
return `NotCapable` error when this option is disabled. This commit
also includes minor typo fixes in the comments of the same file(s).
2017-05-11 20:48:07 -07:00
Jonathan Hui 2d8617d682 Update doxygen for public APIs. (#1753) 2017-05-11 10:00:51 -07:00
Abtin Keshavarzian 9f3ee5cd52 Add/Update logs in MeshForwarder when a received frame is being dropped (#1747) 2017-05-10 15:33:01 -07:00
rongli 027ad9eb03 Update TmfFilter as specification (#1733) 2017-05-09 23:10:24 -07:00
Giedrius 9aabd7f813 Generic uint CoAP option support (#1736) 2017-05-09 12:56:59 -07:00
Jonathan Hui f90e33a4d5 Add support for TI CCS. (#1731) 2017-05-08 14:45:55 -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
Abtin Keshavarzian 2e6a3ecb69 Adding new ot API otNetDataGetNextRoute() in netdata.h (#1725)
New method for iterating through the "external route" entries in the
network data.
2017-05-05 09:10:32 -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
Abtin Keshavarzian bb4ffe373c Adding "Child Supervision" feature (#1608)
Child supervision feature provides a mechanism for parent to ensure
that a message is sent to each sleepy child within a fixed interval,
namely the supervision interval. If there is no transmission to the
child within the supervision interval, child supervisor enqueues and
sends a supervision message (a data message with empty payload) to the
child.

On the child side, this is used to check the connectivity to the
parent. If the child does not hear from its parent for a supervision
check timeout interval it assumes that it may be disconnected and
tries to re-attach to the parent.
2017-05-04 20:20:05 -07:00
Giedrius 8a6371ccdc Add more CoAP code and option enums (#1716) 2017-05-04 09:49:08 -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
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
rongli 41a38ce026 add limitation on some commissioner relative operations (#1670)
* add limitation on some commissioner relative operations

* update cert scripts to start commissioner rightly
2017-04-28 22:03:20 -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
DuaneEllis-TI d65418c12f Add support for wrap_string.h and others (#1642) 2017-04-27 10:17:09 -07:00
Buke Po 7705bf4c22 Border agent proxy (#1590)
* initial commit for border agent proxy
2017-04-27 10:13:00 -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
Abtin Keshavarzian 6043cd8f1b Add/Update logs in MeshForwarder class (#1649)
This commit contains the following changes:

- Adds new logs when a new message is being prepared for indirect tx
  to a sleepy child.

- Adds new logs when an Ipv6 message being dropped from reassembly list
  due to reassembly timeout or missing fragments (in case of MTD).
2017-04-25 10:24:58 -07:00
Jonathan Hui 115b52e6c4 Require platform TRNG to provide requested output length or error. (#1650) 2017-04-25 09:22:53 -07:00
Abtin Keshavarzian 0d9e403286 Update formatting in NcpSpi and spi-slave.h files (#1648)
This commit contains node logic change. It makes some formatting
changes in the comments, also renames method/function argument/param
variable names to follow the style guideline (e.g.,
`anInputBuf -> aInputBuf`).
2017-04-24 18:46:27 -07:00
DuaneEllis-TI 358ca8ee77 Support #1619 - MTD vrs FTD builds, and Makefile.am If/Else/Endif issues (#1620)
* Convert FTD/MTD methods and remove if/else/endif from Makefiles
2017-04-20 20:55:40 -07:00
Abtin Keshavarzian 1baa0ffb65 Add/Update the logs in Mac class (#1629)
This commit contains the following changes:

- Updates logs for a failed tx or rx to include info about the
  frame (len, seq number, type, src/dst address, etc.).

- Adds detailed logs about transmitted or received Beacon frames
  (network name, xpanid, protocol id, version, joinability, native
  flag, ...)

- Adds helper method `ToInfoString()` to `Frame` and `BeaconPyalod`
  classes to provide a debug info string representation of the
  object.
2017-04-20 12:41:02 -07:00
Jonathan Hui b36358a362 Remove extern "C" from cpp files. (#1595) 2017-04-17 10:48:56 -07:00
Abtin Keshavarzian 116cbf371d Update otPlatRadioReceiveDone() description to add kThreadError_NoBufs error. (#1597) 2017-04-16 21:55:06 -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
Abtin Keshavarzian fbdb812f6a Adding SourceMatchController class. (#1559)
This commit adds a new class `SourceMatchController` which
contains all (existing) logic to maintain the source match table
and control when/how to enable or disable the source matching
feature.

It also updates `Child` class by changing the access level of
member variables related to the source matching feature (e.g.,
number of indirect queued messages) to private to ensure that
they are only modified by the new `SourceMatchController` class
while providing simple getter methods for use by other classes.

The changes in this commit also address two corner-case issues
related to source address matching feature:

- First issue where we could possibly enable the source address
  matching after successfully adding a short address while still
  having remaining pending entries.

- Second issue where an entry would not be added properly from a
  `SetSrcMatchAsShort()` call for a child, if there were more
  than one message queued for the child.
2017-04-07 10:45:36 -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
Abtin Keshavarzian 10194c0bfc Adding DataPollManager to manage the (periodic) data poll transmission (#1508)
This commit introduces a new class `DataPollManager`. This class
contains all the logic related to sending of the data poll messages
and managing the data poll transmission period.

The data poll interval is derived based on combination of value
from user (from `SetExternalPollPeriod()`) and the internal state
of the OpenThread. Data poll manager may send data polls more
frequently during attach process or when expecting a control-message
from parent or in case of data poll transmission failures or data
poll timeouts.
2017-04-02 22:54:59 -07:00
Buke Po 98795b6c60 support udp socket connect (#1526) 2017-03-29 21:04:35 -07:00
pszkotak 2fa7a13c1b Add initial commissioning commands support to the NCP (#1393)
* Add initial commissioning commands support to the NCP

* Make GetPropertyHandler_THREAD_COMMISSIONER_ENABLED send true only if commissioner active, move commissioner state enum to oepnthread/types.h

* Use enum to return commissioner state, make spinel property return true only if Commissioner State Active

* Fix spinel documentation
2017-03-29 11:37:21 -07:00
pvanhorn 02400eecb2 Create and use an enum for Route Config mPreference. (#1525) 2017-03-29 08:49:48 -07:00
Giedrius e5d15f1911 CoAP option update (#1523)
* Do not drop CoAP requests with unknown options

If packets are dropped due to unrecognized options, then it should be done
according to RFC7252 Section 5.4.1., otherwise leave it for the user.

* Implement CoAP Header GetFirstOption

* Implement in Header
* Add to CoAP API
* Use in code

* Remove CoAP Header GetCurrentOption

* Correction in the comments

* Initialize CoAP Header before parsing
2017-03-29 05:54:43 -07:00
Adam Eliot 89521040c3 Most recent RSSI in child/neighbour tables (#1519)
* Added most recent RSSI to child and neighbour tables

* Align = signs in mle_router Get{Router/Child}Info

* Fixed build errors, was using the wrong config before so wasnt actualy building the code
2017-03-28 09:41:57 -07:00
Nick Banks a4ccc9a7ee Remove _CRT_SECURE_NO_WARNINGS Usage (#1517)
* Remove usage of deprecated/unsafe CRT functions.
2017-03-28 09:19:25 -07:00
Robert Quattlebaum 73564c399a Add implementations for strlcpy/strlcat when missing (#737)
This commit shows how to add implementations of missing functions for
platforms where those functions are not present. In this case we are
adding the `strlcpy()` and `strlcat()`, which are "safe" replacements
for `strncpy()` and `strncat()` that behave in a way more consistent
with developer expectations.

After this commit, adding additional replacements for missing
functions should be fairly straightforward.

[1]: http://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one
[2]: https://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html
2017-03-27 10:06:36 -07:00
Hubert Miś 68de8f669a [CoAP Server] Message deduplication (#1500)
* Message deduplication in CoAP server.

* Limit number of responses in CoAP server deduplication queue.
2017-03-23 02:01:58 -07:00
Abtin Keshavarzian 0ad2cc0b5b Enable dynamic log level selection (#1492)
This commit adds support for the dynamic log level selection. Config
option `OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL` can be used to
enable/disable this feature (default setting is disabled).

Note that the `OPENTHREAD_CONFIG_LOG_LEVEL` specifies the log level at
compile/build time. The dynamic log level feature (if enabled) only
allows decreasing log level from the compile time setting.

This commit also adds `SPINEL_PROP_DEBUG_NCP_LOG_LEVEL` as a new
spinel property to control the log level. The set/get handlers for
this property along with its documentation are also added.

This commit modifies some of the log related macros/methods so
to harmonize them all to require an `otInstance` as their first
argument.
2017-03-21 16:24:58 -07:00
Hubert Miś 163c54537f Add API function to check if MAC layer is during transmission operation. (#1447) 2017-03-20 09:38:07 -07:00
Łukasz Duda 3316daa43c Add initial implementation of DNS Client (#1460)
* [DNS] Initial DNS Client implementation.
2017-03-17 14:43:08 -07:00
Hubert Miś ebc23928f5 Platform deinitialization function. (#1451) 2017-03-10 09:02:32 -08:00
Nick Banks 1c18f45bfe Update OpenThread Logging to include otInstance Pointer (#1436)
* Update OpenThread Logging to include otInstance Pointer.
2017-03-08 12:40:49 -08:00