Commit Graph

46 Commits

Author SHA1 Message Date
Martin Turon bb84b9a1f2 spinel-cli: Stability improvements to ping (#561)
* Improve ping reliability by making it fully async. Eliminate 5_1_07 from XFAIL list.
* Some non-core changes: readd missing StreamSocket class, improve handling of  command.
2016-09-12 09:50:25 -07:00
Jonathan Hui 563685e187 travis: enable code coverage reporting. (#516) 2016-09-08 14:14:25 -07:00
Jonathan Hui 9e39426f01 Remove globals from mbedcrypto.cpp. 2016-09-07 13:30:22 -07:00
Jonathan Hui 28a564548c Remove globals from link_quality.cpp. 2016-09-07 13:30:22 -07:00
Jonathan Hui e22c123904 Remove globals from message.cpp. 2016-09-07 13:30:22 -07:00
Jonathan Hui 32b6d343c4 Remove globals from timer.cpp. 2016-09-07 13:30:22 -07:00
Jonathan Hui 7f899dc6dd Remove globals from ip6.cpp. 2016-09-07 13:30:22 -07:00
Xiao Ma 5fbadbf445 Update default "CACHE_ENTRIES" and "MAX_CHILDREN" to support required minimum children. (#519)
* Update default "CACHE_ENTRIES" and "MAX_CHILDREN" to support required minimum children.
* Update Cert_5_1_07_MaxChildCount.py due to maximum children number change.
2016-09-05 20:19:07 -07:00
Jonathan Hui 584690c2a9 Revert an incorrect change to the test script. (#518) 2016-09-02 16:20:45 -07:00
Martin Turon 73060ae8e1 spinel-cli: Add NCP build to TravisCI (#364)
* ncp: Added spinel-cli and initial travis CI test suite integration.

This PR adds a command line tool, named spinel-cli, that converts ot-cli shell commands (as documented in https://github.com/openthread/openthread/blob/master/src/cli/README.md) to spinel NCP commands (as documented in https://github.com/openthread/openthread/blob/master/src/ncp/PROTOCOL.md).

Also added is a patch to node.py that provides a way to run the existing continuous integration certification test suite against an NCP build rather than a CLI build (by prefacing the command to start the test with the environment variable setting NODE_TYPE=ncp-sim):

cd tests/scripts/thread-cert
NODE_TYPE=ncp-sim top_builddir=../../.. python Cert_5_1_02_ChildAddressTimeout.py
The power of this tool is three fold:

1) As a path to add testing of the NCP in simulation to continuous integration
2) As a path to automated testing of testbeds running NCP firmware on hardware
3) As a simple debugging tool for NCP builds of OpenThread

openthread$ cd tools/spinel-cli/
spinel-cli$ ./spinel-cli.py
Opening pipe to ../../examples/apps/ncp/ot-ncp 1
spinel-cli > help

Available commands (type help <name> for more information):
============================================================
channel            extaddr       mode              route
child              extpanid      netdataregister   router
childtimeout       h             networkidtimeout  routerupgradethreshold
clear              help          networkname       scan
contextreusedelay  history       panid             state
counter            ifconfig      ping              thread
debug              ipaddr        prefix            v
debug-term         keysequence   q                 version
eidcache           leaderdata    quit              whitelist
enabled            leaderweight  releaserouterid
exit               masterkey     rloc16

spinel-cli > version
OPENTHREAD/gd4d4e9d-dirty; Aug 11 2016 14:40:44
Done
spinel-cli > thread start
Done
spinel-cli > state
leader
Done
spinel-cli >

The tool provides three ways to connect to an NCP image:

1) pipe to stdin/stdout of a command line tool (default): -p ./ot-ncp
2) serial connection to a hardware device: -u /dev/ttyUSB0
3) socket connection to the port of a helper tool such as ncp-spi-driver: -s 1234

spinel-cli$ ./spinel-cli.py --help
Options:
  -h, --help            show this help message and exit
  -u UART, --uart=UART
  -p PIPE, --pipe=PIPE
  -s SOCKET, --socket=SOCKET
  -n NODEID, --nodeid=NODEID
  -q, --quiet
  -v, --verbose
2016-09-02 15:32:17 -07:00
Jonathan Hui 73c64f403f Verify that IPv6 addresses are configured for on-mesh prefixes. (#512) 2016-09-01 19:14:59 -07:00
Jonathan Hui 6d958ba51b Fix compiler warnings in unit tests. (#488) 2016-08-29 11:41:59 -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 9b6afb31c0 Require compiler warnings. (#418) 2016-08-18 12:22:12 -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
Marcin K Szczodrak d83fea07c3 add time delay after a simulated node starts (#327) 2016-08-03 13:16:45 -07:00
Jonathan Hui 6879e829a7 Update Valid Prefix Set configuration and Border Router TLV. (#316) 2016-08-02 09:42:52 -07:00
Jonathan Hui 672fe3047f Update Address Solicit. (#314)
* Add Status TLV to Address Solicit message.
* Process Status TLV when receiving Address Solicit message.
2016-08-02 09:12:41 -07:00
Marcin K Szczodrak c7b6bc93c5 add OT_CLI_PATH sys environment variable to node.py test suite (#321) 2016-08-01 15:00:31 -07:00
Marcin K Szczodrak 309685f9f0 enable parallel builds (#303)
* add automate test-driver for openthread

*  enable parallel builds and tests

* enable adding flags to compiler

* Fix typo
2016-08-01 08:48:23 -07:00
Marcin K Szczodrak 318fe4b415 turn on warnings and errors (#280) 2016-07-25 21:19:07 -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
Abtin Keshavarzian a46d258ce7 Ncp: Introducing NcpFrame Buffer class and its unit test. (#264)
This commit is part of ncp buffer redesign - issue #59.
2016-07-25 11:17:29 -07:00
Jonathan Hui 9754e72496 Add python3 support. (#270) 2016-07-21 06:31:34 -07:00
Jonathan Hui 9baa18e6e6 Rename otPlatSerial* to otPlatUart*. (#253) 2016-07-07 12:18:58 -07:00
Jonathan Hui 0dc1a6a321 Cover all python test scripts by partitioning across different build instances. (#233) 2016-07-04 10:12:06 -07:00
Jonathan Hui db436d91ae Unify example apps across all example platforms. (#215) 2016-06-27 17:19:37 -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 e9be30ae21 Fix code style. (#194) 2016-06-22 13:21:47 -07:00
Jonathan Hui 1571c9ef9c Update pretty and pretty-check make variables. (#192) 2016-06-22 09:12:49 -07:00
turon 31bc49de32 test: Lowpan module unit tests (#151)
* Added initial unit tests for 6LoWPAN layer decompression. Extended unit test framework with helper functions for setting up ASCI hex test vectors.

* Added missing license headers. Cleanly broke C++ into .hpp vs .h.

* Added multicast test vectors to 6lo decompression unit tests.

* Make pretty.

* Added Lowpan::Compress unit test.

* Allow extended initializer lists for unit test build.

* Split out sTestVectorLowpan into pure C99 file as it uses struct { .mField = initializers; } which may upset stricter C++ compilers such as clang++.

* Fix make distcheck - add stubs to test_lowpan for unhandled driver callbacks.

* Resolve most comments besides otDump suggestion.
2016-06-21 13:05:31 -07:00
Jonathan Hui 7ecccade06 Change executable names for examples to ot-cli and ot-ncp. (#173) 2016-06-20 08:44:12 -07:00
turon 3576322262 Added platform/toolchain.h toolchain abstraction layer via macros. (#107)
* Added platform/toolchain.h toolchain abstraction layer via macros:
   OT_TOOL_PACKED_BEGIN
   OT_TOOL_PACKED_END
   OT_TOOL_DEPRECATED(symbol)

* Make pretty.  Rekick travis-ci.

* Added doxygen.  Resolved review comments.

* Fixed doxygen sample for OT_TOOL_PACKED to include type name.

* Renamed OT_TOOL_PACKED_FIELD to simplify code searches for usage. Fixed all nested instances to use new naming.

* Fixed OT_TOOL_PACKED_FIELD renaming in doxygen.

* Make pretty.

* Documentation clarifications.

* Moved example into overview section.

* Fixed sdcc comment.

* Revised sdcc comment.

* Fix code style in toolchain packed doxygen example.

* Fixed example.  Moved toolchain test to better match code style.

* Added test for OT_TOOL_PACKED_FIELD.

* Added support for clang.  Just routes to gcc __attributes__.  Verified by running unit test through clang on macos.
2016-06-11 21:35:52 -07:00
Jonathan Hui e03396282e Make building cli, ncp, and examples optional. (#132)
By default, only core is built.  Added the following configure options:
--enable-cli
--enable-ncp
--with-examples=TARGET
2016-06-11 10:32:05 -07:00
Jonathan Hui 32361a6a2a Updates to fully support and test a standalone library install. (#108) 2016-06-03 12:05:57 -07:00
Marcin K Szczodrak ef9de65117 reorg apps and platforms (#89) 2016-06-01 16:01:22 -07:00
pvanhorn ba0955a030 Timer logic improvements. (#96)
* Change timer logic to always fire the earliest timer first. Add unit tests for OT timers.

* Fix formatting error.

* Fix format errors.
2016-06-01 12:17:59 -07:00
Jonathan Hui e2a85d62e3 Require radio driver to provide transmit and receive buffers. (#87)
Some radio chips have memory-mapped regions for transmit and receive buffers.
This change allows the radio driver to pass those buffers, when available,
directly to upper layers and avoid unnecessary copies.
2016-05-27 14:17:48 -07:00
Marcin K Szczodrak cc2e961f4b node id and compilation fixes (#85) 2016-05-27 13:30:35 -07:00
Jonathan Hui e3f0e69ea6 Replace CLI response buffer with direct output via CLI server. (#75)
* Added new Output method that allows format strings.
* Added an output FIFO to the CLI serial server.
2016-05-26 13:30:34 -07:00
Jonathan Hui 961fea2c59 Remove exit() call, it is no longer needed by the test scripts. (#73) 2016-05-26 11:53:32 -07:00
Jonathan Hui d1b0fed201 Add code style formatting (pretty) and checker (pretty-check) targets. (#52)
* Add 'pretty' target to reformat sources to be compliant with code style.
* Add 'pretty-check' target to check if sources are compliant with code style.
* Update travis-ci script to use 'pretty-check' and enforce code style.
* The 'pretty' and 'pretty-check' targets rely on the 'astyle' tool.
2016-05-19 15:46:29 -07:00
Robert Quattlebaum 059763bfcc travis: Update travis to do a make distcheck instead of just make check (#46)
* travis: Do a `make distcheck` instead of just `make check`

Doing a `make distcheck` instead of just a `make check` ensures that
the build system is sane and that the results from `make dist` have
everything needed.

* build-system: Fixes for `make distcheck`

This commit fixes the `distcheck` target by addressing the following
issues:

 *  Repaired ability to perform builds when the build directory is not
    the source directory.
 *  Addressed an issue with the tarball name that occurs the very
    first time `make` is run.
2016-05-19 13:34:40 -07:00
Jonathan Hui c8908cf687 Fix 'make dist'. (#40)
* Include header files for distribution.
* Include tests scripts for distribution.
* Include docs for distribution.
2016-05-16 21:41:38 -07:00
Marcin K Szczodrak 99870fae01 adjust license text width (#22) 2016-05-12 22:39:11 -07:00
Jonathan Hui 4f9945c533 Initial commit 2016-05-10 22:49:53 -07:00