Commit Graph

277 Commits

Author SHA1 Message Date
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
Abtin Keshavarzian 98f9eaf8da Enable data poll triggered indirect retransmissions to a sleepy child (#1432)
If transmission of an indirect frame (frame to a sleepy child)
fails, the sender retransmits the frame following the reception of
a new data request command (a new data poll) from the sleepy child.

It is ensured that the re-transmissions use the same security frame
counter, key id, and data sequence number as the earlier attempts.
To realize this, info about the indirect transmissions (such as attempt
counter, frame counter, key id) is saved in the child table.

In `openthread-core-default-config.h` a set of new OpenThread options
are added to allow the maximum number of attempts to be configured
for both direct and indirect transmissions.
2017-03-08 12:35:27 -08:00
Robert Lubos 746a40a340 Automatic Joiners removal in Commissioner (#1421)
* Implement automatic Joiner removal feature.

* Save some RAM in JoinerRouter class.

* Specify timeout for each Joiner separately.

* Update Windows API files.
2017-03-08 05:19:12 -08:00
Hubert Miś 6eaacdd4a4 Add platform API to check state of the radio. (#1413) 2017-03-08 05:17:06 -08:00
Hubert Miś 7ac9e93237 Store IID of ML-EID in NVM. (#1423) 2017-03-07 10:56:31 -08:00
Nick Banks 974421da98 Windows App Updates (#1431)
* Initial new API helpers

* Finish up API helper

* Update App to use new API helpers

* More cleanup and added support for preferred router ID

* Clean up state change handlers

* Add logging

* Some more clean up and redesign

* Added small readme for Windows App.
2017-03-07 10:29:30 -08:00
Nick Banks 2549d03f1f Add Dynamic Memory Support to otLwf.sys (#1414)
* Add Dynamic Memory Support

* Use single list for free buffers. Null mNext on return of new buffer.

* Use Paged memory for Buffers.
2017-03-06 13:39:56 -08:00
pvanhorn 04caca7cc8 Implement the use of otPlatRadioDefaultTxPower API. (#1417)
* Implement the use of otPlatRadioDefaultTxPower API.

* Add implementation of otPlatRadioSetDefaultTxPower for windows.
2017-03-03 11:09:33 -08:00
Abtin Keshavarzian de48acf9fb Update comments: Source Match feature and poll period selection (#1400)
This commit adds/updates comments. It contains no code/logic change.

- Adds comments to describe expected behavior and use of source
  address match feature and the related radio platform functions.

- Updates comments to describe the selection of poll period and the
  `SetAssignPollPeriod()`.
2017-03-02 21:47:08 -08:00
Jonathan Hui 31b389fb4e Change otMessage type to not hide pointer. (#1416) 2017-03-02 12:43:59 -08:00
Jonathan Hui b490f2ef3e Icmp6 cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui a6dac9270c Diag API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui e919576978 Move include/platform to include/openthread/platform. 2017-03-02 10:24:55 -08:00
Jonathan Hui d0c687505b Move openthread.h to openthread/openthread.h. 2017-03-02 10:24:55 -08:00
Jonathan Hui 075bff327c Move openthread-types.h to openthread/types.h. 2017-03-02 10:24:55 -08:00
Jonathan Hui da35770140 CLI API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui 32f148fe8c NCP API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui 7f680552eb Thread API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui 52497fa45c Instance API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui da9b2978ad Operational Dataset API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui 421878f468 Network Data API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui 0746a44a7c Link API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui 98da7f3166 IPv6 API cleanup. 2017-03-02 10:24:55 -08:00
Jonathan Hui 669c792118 DHCPv6 Client and Server API cleanup. 2017-03-02 10:24:55 -08:00