Commit Graph

124 Commits

Author SHA1 Message Date
Jonathan Hui 075d23370a spinel-cli is now maintained in a separate repo. (#1742) 2017-05-10 15:05:51 -07:00
Abtin Keshavarzian 19440f580b Update README.md for spinel-cli (#1659) 2017-04-26 22:05:57 -07:00
Giuseppe Andreello 6d8d42e9bf Fixed python interpreter directives (#1667)
Changed the interpreter directives from '#!/usr/bin/python' to
'#!/usr/bin/env python' so the OpenThread tests can be run
inside a python virtualenv.
2017-04-26 21:23:02 -07:00
rongli 1ad6665016 THCI: enhancements (#1603) 2017-04-17 10:17:46 -07:00
rongli 3c86327f70 THCI: update for Harness (#1530) 2017-03-29 11:25:46 -07:00
Martin Turon db0e2057ef spinel-cli: Fixes for spinel documentation bugs. (#1478)
* spinel-cli: Fixes for spinel documentation bugs.

* spinel doc: fix PROP_STREAM_DEBUG = 'D'
2017-03-21 13:04:05 -07:00
Robert Quattlebaum 523deb88a8 spi-hdlc-adapter: Debugging and minor performance improvement. (#1468)
This change primarily adds additional debug logging and statistics
counters. It also includes the ability to change the small-packet
size, which was previously hard-coded to a value of 5. The default
value for the small-packet size has been increased to 32, which
improves performance.

We also now do a better job of tracking flow control and slave
liveliness.
2017-03-17 14:43:53 -07:00
rongli 1de5e37d1c THCI: Add long timeout for new joiner (#1469) 2017-03-15 09:43:06 -07:00
Robert Quattlebaum 0449c2bed4 spi-hdlc-adapter: Reliability and Performance Improvements (#1441)
This change includes many improvements which reduce latency, increase
throughput, and improve reliability.

The most significant change from this commit is addressing a frame
corruption bug which would occasionally corrupt frames received from
the slave during periods of congestion. This was occurring because
`push_pull_spi()` was allowed to be called when `sSpiTxIsReady` was
set, even if `sSpiRxPayloadSize` was not equal to zero. Under such
circumstances the previously received frame would be corrupted. This
change makes sure that `push_pull_spi()` does not get called until
`sSpiRxPayloadSize` is zero.

`push_pull_spi()` now only performs a single SPI transaction (instead
of two), which eliminates a significant amount of duplicated code. The
call to `usleep()` has been removed entirely, along with the
associated static `sSpiTransactionDelay`.

Statistics are now gathered and reported at exit. You can also induce
`spi-hdlc-adapter` to dump its statistics while it is running by
sending it a `SIGUSR1` signal.

This change also includes miscellaneous smaller changes.
2017-03-13 12:15:55 -07:00
Robert Quattlebaum b98e3c70eb spinel: Clarify data packing notation and fix implementation. (#1433)
The data packing format that I designed for Spinel was a bit too
clever for its own good. While elegant from a certain perspective, the
behavior of the data blob (`D`), array (`A(...)`), and structure
(`T(...)`) types was way too confusing. I thought that I was (as the
guy who came up with it) immune from such confusion, but after taking
the time to go through all the code and address all of the mishaps in
the code it seems that the subtleties befuddled even its creator on a
time or two.

The specific issue that made me realize I needed to prioritize making
this fix was #1393.

As far as packing types go, this commit makes the following changes:

*   **New type `DATATYPE_DATA_WLEN` (`d`)**: Just like `DATATYPE_DATA`
    except that it ALWAYS prepends the length, irrespective of the
    type's location in the type string. Think of WLEN as being "With
    LENgth". Unless you are adding a property that has a type which is
    just a single data blob, you should use this type instead of
    `DATATYPE_DATA` (`D`). `DATATYPE_DATA` is still useful, so it will
    be sticking around.
*   **Changed type `DATATYPE_STRUCT` (was `T`, now `t`)**: The new
    struct type, ALWAYS prepends the length of the contents of the
    struct, just like `DATATYPE_DATA_WLEN`. The old `T` style struct
    still works and behaves the same way, but its use is now
    deprecated.
*   **Changed type `DATATYPE_ARRAY` (`A`)**: This type has changed in
    documentation only, as no one is currently using it in the way
    that it was originally specified. The change is that this type
    NEVER prepends the length of the entire array, and using it
    alongside other types is now unspecified (it should only be used
    alone).

I also added some convenient macros for building up datatype signature
strings that include structs.

One of the goals of these changes was to make this commit a change in
specification only, not to change what was currently on-the-wire.
However, after updating the spec and then going through and updating
all of the code to use the new nomenclature, I was horrified to find
that, due to the confusing nature of the previous datatype signature
string format, many properties that are arrays were not implemented
correctly --- making them impossible to update or add fields to
without breaking backward compatibility. To add insult to injury, some
of these instances were written by me!

This change updates all of the array properties to reflect how they
should have been implemented to begin with.
2017-03-10 11:48:31 -08:00
Shu Chen fc45943f8c Add "--enable-ftd" build option (#1384)
* Add a new build target: ncp-mtd.

* Platform with "--enable-ftd" build option will build both MTD and FTD.

* Platform without "--enable-ftd" build option will only build MTD.
2017-02-24 10:10:53 -08:00
Buke Po c1dc4f6aa9 [Harness Automation]: enhance exception handling and refine manual reset feature (#1369)
* refine exception handling

* implement manual pdu controller
2017-02-22 09:17:25 -08:00
Buke Po 30db14f429 detect harness configuration (#1367) 2017-02-21 23:19:34 -08:00
Buke Po cc97c869ef THCI: fix some typos and SA issues (#1357) 2017-02-21 06:16:14 -08:00
rongli 829227c550 THCI: update document (#1356) 2017-02-21 06:13:53 -08:00
Buke Po aeda7f8970 [Harness Automation] Fix retrying golden device issue and clean code (#1350)
* fix bad golden device issue

* clean code

* fix small issues reported by pylint
2017-02-20 09:06:41 -08:00
Robert Quattlebaum ccc0020dc0 spi-hdlc-adapter: Add support for raw mode. (#1341)
This commit adds support for two new arguments:

*   `--raw`: Do not encode/decode packets using HDLC. Instead, write
    whole, raw frames to the specified input and output FDs. This is
    useful for emulating a serial port, or when datagram-based sockets
    are supplied for `stdin` and `stdout` (when used with `--stdio`).
*   `--mtu=[MTU]`: Specify the MTU. Currently only used in raw mode.
    Default and maximum value is 2043. Must be greater than zero.

The `--raw` argument will allow `wpantund` to use `spi-hdlc-adapter`
without HDLC escaping by supplying datagram sockets for stdin and
stdout. This should improve performance and reduce latency.

The `--mtu` argument is supplied to benefit the use case where we
are emulating an asynchronous serial port over SPI. In such a case,
you would likely want to lower the MTU significantly to match the
internal buffer size of the MCU.

Version is bumped to 0.04.
2017-02-19 23:12:03 -08:00
Buke Po 1973a03865 fix issues until harness r40 (#1348) 2017-02-19 23:09:15 -08:00
rongli fa04f1c4cb THCI: setMinDelayTimer() API (#1329) 2017-02-17 12:09:36 -08:00
Przemysław Fierek 629516244d Add PDU controller that allows to reboot Nordic dev-kits. (#1201) 2017-02-15 09:11:38 -08:00
Shu Chen 4d293aa67f THCI: Refine joinCommissioned method (#1292) 2017-02-09 18:13:19 -08:00
Abtin Keshavarzian 437d21b34a Make codec.py more robust against spinel property id changes (#1275)
- Add a check to ensure the spinel property id is contains in the
  `SPINEL_PROP_DISPATCH` dictionary.
2017-02-07 19:31:54 -08:00
Shu Chen 82df0a5457 THCI: fix process line count issue in getCommissioningLogs method (#1266) 2017-02-07 05:41:35 -08:00
rongli a682a3c541 THCI: fix JOIN_ENT log (#1262) 2017-02-06 15:05:27 -08:00
Nick Banks f000137674 Update Windows Readme and Scripts (#1216)
* Update design image and general design description.

* Update install scripts

* Update Travis build script

* Remove build/install from readme as it is already in wiki
2017-02-01 10:19:06 -08:00
Xiao Ma 7a777a58a3 THCI: Commit with new assigned Activetimestamp if any instead of default value. (#1206) 2017-01-25 04:45:50 -08:00
Xiao Ma 1007bdd46d Fixs for channelmask process and MLE Announce message. (#1189)
- Processing channel mask bits from left-side.
 - Host swap Ticks field of Timestamp in big-endian order.
 - Set transmit frame counter for Announce message to an incrementing value.
2017-01-24 03:21:41 -08:00
Przemysław Fierek fd86da586b Stabilize the harness automation tool. (#1174) 2017-01-23 23:08:35 -08:00
Shu Chen 50ba50eca2 THCI: Set default security policy flags. (#1197) 2017-01-23 21:09:13 -08:00
Shu Chen ac04542ba4 THCI: set default active dataset for each device. (#1184) 2017-01-22 04:31:35 -08:00
Buke Po f965a97db8 fix sending network diagnostic for it has no Done (#1177) 2017-01-20 06:03:46 -08:00
Xiao Ma 419d251e2f Fix few bugs: (#1164)
- Add additional check for ALOC as the destination address of CoAP request messages.
 - Leader uses RLOC instead of ALOC as source address to response messages.
2017-01-17 19:27:20 -08:00
rongli d5eef91b3e THCI: update default SED polling rate as 3s (#1156) 2017-01-15 17:40:38 -08:00
Abtin Keshavarzian 0bc5c8e85f Spi-hdlc-adapter: Copy the spi path name before passing to syslog() (#1135)
This commit makes a change in `spi-hdlc-adapter` to copy the passed
in spi path (from the argv) in a max 64 char array before passing it
to `syslog()`. This ensures `syslog()` string argument has a limited
size.
2017-01-12 08:52:58 -08:00
Hubert Miś 6ef5ef33fa Add 'parent', 'child' and 'leaderdata' commands to spinel-cli.py (#1136)
* Add 'leaderdata' command to spinel-cli.py.

* Add 'parent' command to the spinel-cli.py.

* Add 'child' command to the spinel-cli.py

* Add THREAD_NEIGHBOR_TABLE property to codec in spinel-cli.
2017-01-12 06:01:25 -08:00
Abtin Keshavarzian 490eabb0e1 Spi-hdlc-adapter: Check for invalid fd errors (#1129)
This commit makes a change to `spi-hdlc-adapter` to check for any
possible error case where either `sHdlcInputFd` or `sHdlcOutputFd`
are invalid (e.g., `dup()` failures) before starting the main loop.
2017-01-11 09:09:54 -08:00
Abtin Keshavarzian afa5d13cfc Spi-hdlc-adapter: Mark unused fn return values, fix comments (#1128)
This commit makes the following changes in spi-hdlc-adapter:

- It adds `IGNORE_RETURN_VALUE()` macro for cases where the returned
  value from a function can/should be safely ignored.

- It creates a local max 32 bytes string copy of the program name
  from `argv[0]` (to ensure the length is limited).

- It fixes some of the typos in comments.
2017-01-11 09:03:45 -08:00
Hubert Miś 8198e8794f Add 'bufferinfo' commane to spinel-cli.py (#1125) 2017-01-10 10:14:27 -08:00
Buke Po 9f00b7048e fix low resolution issue and checking auto dut failure when many devices connected (#1097) 2016-12-21 09:04:20 -08:00
Buke Po 97fbca2063 support interop and harness r34 (#1092) 2016-12-19 21:47:57 -08:00
rongli 307a4a9fcc THCI: apply Default_Harness_SED_Polling_Rate configuration (#1088) 2016-12-19 09:04:24 -08:00
Wojciech Bober 430f4839ff [spinel-py] Allow for waiting for a given property change (#1081)
* [spinel-py] Allow to wait for a particular property

* [spinel-py] Added reset command to codec.py
2016-12-15 09:04:55 -08:00
Wojciech Bober 2455a1e056 [spinel-py] Configure logger only for spinel package (#1080) 2016-12-15 08:45:10 -08:00
Buke Po dc55779df1 Improvements for r33 (#1071)
* get firmware version at runtime

* walkaround harness hang issue
2016-12-13 21:29:50 -08:00
Robert Quattlebaum 0b1d47afde spi-hdlc-adapter: Improved strategy for how SPI transactions are performed. (#1066)
The big change in this commit is a change in the transmission strategy used.
This change isn't fixing any particular bug, but these changes should improve
performance.

Instead of always using a throw-away transaction to figure out the buffer sizes
for the NCP, we now attempt to send any frame we have in the first transaction.
If the NCP has a response that happens to fit in the size of that packet, it
will be processed.

This change also adds a lot more comments better explaining the more
complicated parts of the code.
2016-12-13 14:53:17 -08:00
Buke Po 9077725472 updates to support Thread Harness1.1 R33 (#1053) 2016-12-08 10:22:22 -08:00
Xiao Ma 28fa90b1ce THCI: check in OpenThread icon and testbed xml for manual configuration. (#1043) 2016-12-06 09:02:58 -08:00
PFierek 5e72785d42 Move tunnel interface dependency from a codec to spinel-cli. Issue: #960 (#1041) 2016-12-05 06:24:38 -08:00
rongli 3df876dfaa THCI: add new constant required by Harness (#1034) 2016-12-02 09:02:33 -08:00
Xiao Ma dab99e30a4 THCI: Add OpenThread as testbed device to Harness. (#1029) 2016-12-01 08:52:24 -08:00