Commit Graph

58 Commits

Author SHA1 Message Date
Nick Banks 7edada12e4 Add option for Radio layer to support retries and CSMA backoff logic. (#896)
* Add option for Radio layer to support tries and CSMA backoff logic.
2016-10-27 19:39:04 -07:00
Nick Banks f600840499 Merge Windows Driver Code (#817)
This is the first of the Windows implementation code that will be merged. This is only the driver code.

Also note the updates to the appveyor configuration. It now builds, installs and queries the status of driver directly on the build machine. Then it builds an 'artifact' which is essentially the binaries packaged up.
2016-10-25 13:38:29 -07:00
Shu Chen 1365d80749 Unify settings block length with type 'uint16_t' (#877) 2016-10-25 08:43:51 -07:00
Shu Chen 46f920cf6a Dataset storage (#866)
* Store active dataset and pending dataset in non-volatile memory.

  * Retrieve active dataset and pending dataset from non-volatile memory after each reboot.

  * Leader will generate the active dataset if it is not initialized.

  * Clear pending dataset after it replaces active dataset.

  * Create different pseudo flash files for posix nodes.
2016-10-24 22:13:23 -07:00
pvanhorn 405b89f955 Allow message pool management by platform code. (#858)
* allow message pool management by platform code.
2016-10-24 14:45:19 -07:00
Nick Banks 7a19067515 Some Logging Cleanup (#810)
* Remove unnecessary WPP definition.
* Various other small fixes.
2016-10-20 10:30:53 -07:00
Lu Wang 8468ffdb77 Settings Driver (#775)
* Settings Driver
2016-10-16 21:54:10 -07:00
Nick Banks 86deb6e868 Platform Support for Dynamic Memory Allocation (#767)
* Add support for platform implementation of dynamic memory allocation.
2016-10-14 09:02:38 -07:00
Robert Quattlebaum 9c252dbac7 ncp: Fix handling of FCS for PROP_STREAM_RAW (#809)
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.
2016-10-13 17:28:15 -07:00
Robert Quattlebaum 104ca6d10d Cleanup error code usage. Avoid raising errors when value is unchanged. (#787)
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.
2016-10-12 14:18:55 -07:00
Lu Wang 59f4ec8ae8 CC2538 Flash Driver (#772)
* CC2538 flash driver
2016-10-08 22:26:46 -07:00
Jonathan Hui 3ebef251eb Radio API: set short address, extended address, and panid must not fail. (#774) 2016-10-08 18:49:23 -07:00
Nick Banks 2df41313a9 Add support for radio energy scan API (#749)
* Add support for radio energy scan API
2016-10-06 23:20:50 -07:00
Nick Banks fbc5245d79 Enable Windows WPP Logging Support (#678)
* Enable support for WPP logging.
2016-10-03 10:45:25 -07:00
Robert Quattlebaum d0763e7283 ncp-spinel: Update raw stream to support new metadata format (#717)
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
2016-09-28 17:05:51 -07:00
Buke Po d283c29f23 Support network diagnostic feature. (#652)
* support network diagnostic

* add network diagnostic THCI implementation
2016-09-23 21:06:08 -07:00
rongli add8639049 Support AutoPend for CC2538 (#562) 2016-09-23 11:12:53 -07:00
Robert Quattlebaum 2522d2e2d7 ncp: Add support for PROP_STREAM_RAW (#644)
* 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.
2016-09-22 15:32:13 -07:00
Marcin K Szczodrak 713e2260d1 add missing include to platform headers (#666) 2016-09-22 12:09:55 -07:00
Lu Wang 15f7b2baaa Posix flash (#605)
* Posix flash
2016-09-19 15:51:07 -07:00
Jonathan Hui ef2a1a0c9d When commissioning, set ext addr based on factory-assigned IEEE EUI-64. (#584)
- Add CLI for printing the factory-assigned IEEE EUI-64.
- Add otPlatRadioGetIeeeEui64() API.
2016-09-13 23:37:40 -07:00
Jonathan Hui 44350178ad Change copyright to The OpenThread Authors. (#583)
- Add a top-level file named AUTHORS which identifies the copyright
holders of the project.
2016-09-13 15:57:11 -07:00
Nick Banks ffbe65c6dd otInstance Declarations (#473)
* Add otInstance type declaration and update ot APIs to take it as input.
2016-09-12 14:29:43 -07:00
Lu Wang 8ab7f4c21b Flash API (#485)
* Flash API
2016-09-12 11:09:45 -07:00
Abtin Keshavarzian a0b4120248 Fix spelling typos in comments. (#530) 2016-09-07 11:04:53 -07:00
Lu Wang c05c632d2f Implement CC2538 random driver (#483)
* Implement CC2538 random driver
2016-09-06 21:57:08 -07:00
Marcin K Szczodrak 04564ac96d add missing ot types include (#479) 2016-08-26 11:00:20 -07:00
Lu Wang 3d04344cc9 Enhance otPlatRandomGet API to provide random stream (#471)
* Enhance otPlatRandomGet API to provide random stream
2016-08-25 23:41:40 -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
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
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
Jonathan Hui 2a493e7ec0 Support meshcop datasets and propagation. (#330) 2016-08-04 09:46:48 -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
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
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
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
Abtin Keshavarzian 8590a067e5 Fix typos in header file comments. (#159) 2016-06-15 19:18:19 -07:00
Jonathan Hui 469f925683 Remove otPlat*Init() functions that are no longer used. (#142) 2016-06-14 08:46:49 -07:00
Jonathan Hui 5084009670 Update platform/radio.h doxygen to match implementation. (#138) 2016-06-14 08:45:29 -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 fa84ba7b5e Reduce logging.h to minimal needed for platform and move rest into core. (#104) 2016-06-02 19:40:45 -07:00
Jonathan Hui 1af6a399eb Install public headers. (#102) 2016-06-02 19:07:28 -07:00
Lu Wang 4131e571b8 add enable/disable radio promiscuous mode method and simulated posix … (#84)
* add enable/disable radio promiscuous mode method and simulated posix radio that supports promiscuous mode

* fix code style
2016-05-31 10:13:50 -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
Jonathan Hui 7d2e4a0267 Change API to require all calls be from the same context. (#78)
* Remove atomic driver and all uses of otPlatAtomic* in OpenThread.
* Change posix example to only use a single thread of execution.
2016-05-27 09:16:04 -07:00