The way the FCS was handled previously was based on assumptions (Like
the `mLength` field of `RadioPacket` didn't include a CRC) that were incorrect.
This change fixes that issue and also simplifies how the protocol handles the
FCS bytes for `PROP_STREAM_RAW`.
This commit addresses #808.
This change is attempting to address two issues:
1. Returning `kThreadError_Busy`, when `kThreadError_Already`,
`kThreadError_InvalidState`, or even the lazy
`kThreadError_Failed` would be more-appropriate/less-misleading.
2. Setters returning an error when the value to be changed is already
set to the requested value.
Number one hurts debuggability. Number two makes the code more fragile.
The cases where both intersect can be maddening.
This change replaces cases inappropriately returning
`kThreadError_Busy` with a better, more specific error code. It also
makes some "setter" functions (Including `otInterfaceUp()` and
`otThreadStart()`) return success if the value is already set.
This commit updates the raw packet reporting mechanism to use
the [new Spinel metadata format][1] with `PROP_STREAM_RAW`.
To do this, a new boolean was needed for the `RadioPacket` structure
to allow us to differentiate packets that we received over the
air versus packets we have transmitted.
Since the format of the 802.15.4-PHY-specific metadata hasn't yet
been defined, that field (Along with the vendor data field) is left
unspecified.
[1]: https://cdn.rawgit.com/darconeous/openthread/5b887f3a4e7df5c0c806ca1ba80fb1d9619cf8f2/doc/draft-spinel-protocol.html#frame-metadata-format
* ncp: Add support for `PROP_STREAM_RAW`
This change allows the NCP to be a packet sniffer when used with host
software that supports this feature.
See the section of the Spinel protocol document titled ["Sniffing Raw
Packets"][1] for an example of how this property is intended to be
used.
[1]: https://cdn.rawgit.com/openthread/openthread/654f953fdaf34e457bee61eb674908141d0a5f8e/doc/draft-spinel-protocol.html#rfc.appendix.F.10
* Allow sniffer to see raw outbound packets on the Pcap interface.
* Remove some of the metadata from the raw frames until the format can be better thought out
* Add optional support for 802.15.4 FCS reporting.
* 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.
* 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
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.
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.
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.
* 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.
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.
* Add an LQI field to the radio packet structure.
* Add an LQI field to the ThreadMessageInfo.
* Add an LQI field to the scan result.
* Print LQI value in CLI scan result.
The following checks were added:
1) Any unsecure 6LoWPAN Mesh frames are dropped.
2) Any unsecure 6LoWPAN Fragment frames are only added to unsecure reassembly buffers.
3) Any unsecure MAC Data Poll frames are dropped.
4) Any unsecure IPv6 datagrams must have:
a) Destination with link-local scope,
b) Next Header set to UDP,
c) UDP Destination Port set to MLE,
d) Length long enough to carry IPv6 and UDP headers.