Commit Graph

76 Commits

Author SHA1 Message Date
Abtin Keshavarzian 6cf94291b9 Adding openthread API for Energy Scan operation (#448) 2016-08-22 21:20:14 -07:00
Shu Chen b5f97386ba diags: Add output buffer size limitation to avoid overflow issue (#442)
- add aOutputMaxLen parameter in each diagnostics feature process function
- use snprintf() to limit the size of output string
2016-08-22 12:38:29 -07:00
Jonathan Hui 8195ed9c62 Allow client to specify whether or not to filter Thread control traffic. (#423) 2016-08-19 14:35:09 -07:00
Nick Banks 47dcec0bac Update all callbacks to support a client supplied context pointer. (#425)
* Update all callbacks to support a client supplied context pointer.
2016-08-19 11:38:11 -07:00
Shu Chen 9ff00bdbae ncp-spinel: Add STREAM_MFG property for diagnostics module (#403)
It's a generic stream property which doesn't take care of the diagnostics feature details

  - get diags commands from the property with VALUE_SET command
  - return diags output to the property with VALUE_IS command
2016-08-18 18:00:06 -07:00
Jonathan Hui c26fec1692 Implement otIsDiscoverInProgress. (#415) 2016-08-18 12:15:53 -07:00
Jonathan Hui 139e85f781 Make client responsible for configuring IPv6 addresses. (#410)
* OpenThread no longer automatically configures IPv6 addresses based on network data.
* Added IPv6 address configuration to CLI to support certification tests.
* Added notification to indicate when the Thread Network Data is updated.
* Added otIp6PrefixMatch API to compute prefix match.
2016-08-17 16:11:46 -07:00
Marcin K Szczodrak a0c6f50051 Feature/ot plat rssi (#411)
* rename otPlatRadioGetNoiseFloor to otPlatRadioGetRssi

* update cli README with singleton command
2016-08-17 16:11:06 -07:00
Jonathan Hui 5fcc74330f Add API for setting the default/maximum transmit power. (#394) 2016-08-17 14:31:27 -07:00
Marcin K Szczodrak 8c48712617 add IsSingleton to OT's application API (#398) 2016-08-16 19:15:29 -07:00
Jonathan Hui 5755f99cae Provide an API to retrieve the list of on-mesh prefixes. (#392) 2016-08-16 19:10:41 -07:00
Robert Quattlebaum 09a407a961 ncp: Revisions to the Spinel protocol to mesh with recent API changes. (#372)
With the introduction of the `otThreadStart()`/`otThreadStop()` and
`otInterfaceUp()`/`otInterfaceDown()` APIs, the existing spinel
command mapping was not adequate.

This commit makes the following changes:

*   `PROP_NET_ENABLED` is now `PROP_NET_IF_UP`, and maps directly to
    the `otInterfaceUp()`/`otInterfaceDown()` functions.
*   `PROP_NET_STATE` is now `PROP_NET_STACK_UP`, and is now a boolean
    that maps directly to `otThreadStart()`/`otThreadStop()`.

Also, `SPINEL_NET_ROLE_NONE` has now been renamed to
`SPINEL_NET_ROLE_DETACHED`.
2016-08-12 15:41:05 -07:00
Jonathan Hui 8252cd6277 Ensure that Network Name strings are NULL-termianted for client code. (#368)
* otGetNetworkName() no longer returns a pointer into a beacon message.
* Scan results no longer point into a beacon message.
2016-08-12 11:07:09 -07:00
Xiao Ma 8f3279e3e0 Feature/extra clis for thci support (#345)
Update feature extra clis for thci support.

* cli: add set/get PartitionId
* cli: add get information about thread device's parent.
* cli: add set/get the data poll period for sleepy end device.
* cli: add blacklist relative commands to support network topology defined in Harness test case.
* cli: add set/get assigned linkquality during parent selection of attaching.
* cli: add reset to trigger a platform reset.
* Add link-local 16 only for sleepy end device.
2016-08-12 08:58:55 -07:00
Jonathan Hui 3863be7af1 Update return type for network id timeout to unit8_t. (#363) 2016-08-11 14:16:56 -07:00
Shu Chen 7130798123 Add diagnostics module in OpenThread (#343)
* Add diagnostics module in OpenThread

  - provide the same diagnostics interface for both CLI and NCP usage
  - implement common diagnostics features based on existing platform interface defined in 'include/platform/'
  - other more platform specific diagnostics features will be processed under platform layer
  - update CLI interface to support diagnostics feature
  - update both Posix and CC2538 platform to support diagnostics feature

* Add diagnostics module unit test

   - move platform.h from "examples/platform" to "include/platform"
   - add test_diag.cpp to test diagnostics module

* Add a configuration option that would enable/disable diagnostics module

Add --enable-diag configuration option to enable/disable diagnostics module when building OpenThread.
2016-08-11 10:26:51 -07:00
Shu Chen cefea1a3c6 Include platform details in version information (#347)
- add --with-platform-info configuration option to specify platform information
- add otGetVersionString() interface to get OpenThread version
2016-08-10 20:02:29 -07:00
Jonathan Hui 4050c68577 Enable -Wconversion on clang and fix all warnings. (#358) 2016-08-10 11:52:22 -07:00
Jonathan Hui b665529dac Add OT APIs for manipulating the active and pending datasets. (#336) 2016-08-05 11:44:24 -07:00
Jonathan Hui 2a493e7ec0 Support meshcop datasets and propagation. (#330) 2016-08-04 09:46:48 -07:00
Jonathan Hui b326f01821 Implement MLE Discovery Request and Response. (#322) 2016-08-03 13:16:35 -07:00
Jonathan Hui 6879e829a7 Update Valid Prefix Set configuration and Border Router TLV. (#316) 2016-08-02 09:42:52 -07:00
Robert Quattlebaum ffe6af9bb6 otPlatform: New non-volatile settings API (#320)
* otPlatform: New non-volatile settings API

This is the new API for the storage and retrieval of non-volatile
settings. Platforms would implement this API in order to allow various
types of information to be preserved across resets or power loss.

* fixup! otPlatform: New non-volatile settings API
2016-08-01 15:08:27 -07:00
Robert Quattlebaum 1d6ed8f66a ncp: New API otNcpStreamWrite() (#318)
This API will initially be used for writing debug logs messages to
the host, but may in the future be expanded for other purposes.

This change also fixes a misspelling of "Property" in various
internal methods.
2016-08-01 14:59:35 -07:00
Abtin Keshavarzian 440ea46775 Add NCP as a log region option in logging.h (#304)
This commit adds new log region for  NCP (kLogRegionNcp). It also
adds the support for posix platform logging implementation.
2016-07-29 17:52:09 -07:00
Jonathan Hui 143ea37a0a Add API to set the IEEE 802.15.4 Extended Address. (#289) 2016-07-28 10:55:23 -07:00
Robert Quattlebaum f2f8a7a0fc Added platform APIs for handling resets. (#284)
This change includes the addition of two new platform API functions:

* `otPlatReset()`
* `otPlatGetResetReason()`

They are pretty straightforward. Every platform must implement both, but
`otPlatReset()` is allowed to simply return if the platform doesn't support
being reset (like the posix platform).

This commit addresses issue #283.
2016-07-26 12:00:36 -07:00
Marcin K Szczodrak 318fe4b415 turn on warnings and errors (#280) 2016-07-25 21:19:07 -07:00
Jonathan Hui 3313b66342 Add API to constrain the use of the Router/Leader role. (#285) 2016-07-25 19:14:50 -07:00
Jonathan Hui 8c39011d9c Separate out interface up/down from Thread start/stop. (#278)
* Redefine otEnable/otDisable to just initialize/uninitialize the OpenThread stack.
* Remove otInit API since it is replaced by otEnable.
* Add otInterfaceUp/otInterfaceDown APIs to bring up/down IPv6 interface.
* Add otThreadStart/otThreadStop APIs to start/stop Thread protocol operation.
* Updated NCP implementation to utilize new APIs.
2016-07-25 17:52:47 -07:00
Marcin K Szczodrak c595b240fb new radio fsm (#275)
* remove Idle calls
* apply radio state changes to posix radio
* apply radio state changes to cc2538
2016-07-25 14:55:58 -07:00
Robert Quattlebaum 5920d44488 ncp: First pass at NCP support for a SPI slave interface. (#254)
In order to avoid some race conditions, this change necessitated
some minor changes to the SPI slave platform API. Specifically,
the callback function now includes most of the arguments passed
to `otPlatSpiSlavePrepareTransaction()`.

This has not been tested outside of doing a simple compile test.
Once we have a platform up and running we can iron out the
bugs.
2016-07-11 11:58:28 -07:00
Jonathan Hui 9baa18e6e6 Rename otPlatSerial* to otPlatUart*. (#253) 2016-07-07 12:18:58 -07:00
Robert Quattlebaum 274b05c5e4 platform/spi-slave: Header for otPlatSpiSlave API (#248)
This commit introduces the header for the `otPlatSpiSlave` API. The
actual implementation of this API is not yet in place, so additional
work needs to be done to make this API useful.

This commit addresses issue #245.
2016-07-06 18:54:57 -07:00
Jonathan Hui a7d69c1726 Add macros for the channel bit-vector used with otActiveScan. (#236) 2016-07-06 18:53:45 -07:00
Jonathan Hui 8f8b332fd6 Add API to retrieve Leader Data information. (#231) 2016-07-04 10:11:47 -07:00
Jonathan Hui 4b487f1aa6 Add API to retrieve EID cache diag information. (#229) 2016-07-01 13:27:50 -07:00
Jonathan Hui 51e5609456 Add API to retrieve whitelist diag information. (#228) 2016-07-01 13:10:57 -07:00
Jonathan Hui 510f1d57f1 Add API to retrieve child diag information. (#226) 2016-07-01 12:10:52 -07:00
Jonathan Hui 50acd07a17 Add API to retrieve router diag information. (#225) 2016-07-01 10:47:40 -07:00
Abtin Keshavarzian d365f3aaa3 Add note/comment to describe the behavior of otAddUnicastAddress() (#220)
This commit changes the documentation for `otAddUnicastAddress` in
"openthread.h" to describe/clarify its behavior.
2016-06-28 12:27:14 -07:00
Abtin Keshavarzian cb33898827 Enhance the calculation of link quality metrics (#197)
This commit adds a new class `LinkQualityInfo` which stores all
relevant information about quality of a link, including average
received signal strength (RSS), link margin, and link quality value.
The RSS average is obtained using an adaptive exponential moving
average filter. A unit-test is also added for the new class.

The Neighbor class now includes an instance of LinkQualityInfo. The
RSS average is updated from 'mac.cpp' whenever a valid/verified packet
is received from the corresponding neighbor. The mesh_forwarder,
mle_router, and mle modules are modified to use the new methods from
the newly added class.

This change addresses issue #175.
2016-06-27 14:15:11 -07:00
Jonathan Hui 3635bb9691 Remove redefinition of OT_NETWORK_NAME_SIZE. (#212) 2016-06-24 20:45:30 -07:00
Jonathan Hui a43fb455d9 Add ability to configure whether or not OpenThread handles ICMPv6 Echo Request/Reply messages. (#207) 2016-06-24 12:43:02 -07:00
Jonathan Hui 43f092a7f9 Add ability to configure unsecure ports to the IPv6 datagram filter. (#196) 2016-06-23 07:56:50 -07:00
Jonathan Hui 4369a31411 Make public headers C99 compliant. (#186)
* Add -std=c99 and -pedantic-errors to CFLAGS.
2016-06-21 13:04:51 -07:00
Robert Quattlebaum dae1d3801d ncp: Various changes in order to better support address change events (#165)
There are two logical sets of changes presented here:

* core/thread/mle: Follow remove/change/add pattern for unicast addresses

  The goal here is to avoid modifying an address after it has been added to
  the netif. That way we get reliable removal/insertion eventing. This
  pattern has other advantages which will likely become apparent later.

* openthread-types: Add `OT_IP6_ML_ADDR_CHANGED` flag

  This allows us to know precisely when the mesh local address has changed
  its value.
2016-06-17 10:03:25 -07:00
Abtin Keshavarzian 8590a067e5 Fix typos in header file comments. (#159) 2016-06-15 19:18:19 -07:00
Jonathan Hui a7e34a6f17 Add notifications on configuration and state changes from OpenThread. (#146)
Example state changes that will cause a notification:
- IPv6 address added/removed
- Device state (offline, detached, attached)
- Device role (disabled, detached, child, router, leader)
- Partition ID
- Key Sequence
- Child added/removed
2016-06-15 12:17:05 -07:00
Jonathan Hui 469f925683 Remove otPlat*Init() functions that are no longer used. (#142) 2016-06-14 08:46:49 -07:00