Commit Graph

63 Commits

Author SHA1 Message Date
Marcin K Szczodrak e1771f6cc4 posix uart termios typo (#463) 2016-08-25 21:37:49 -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 9b6afb31c0 Require compiler warnings. (#418) 2016-08-18 12:22:12 -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 ceb2a9b22a Do not allow enabling Thread protocols when PAN ID is set to broadcast. (#405) 2016-08-17 14:32:55 -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
Abtin Keshavarzian 66dce223d6 logging: Change the posix log fprintf to use \r only. (#351) 2016-08-09 12:14:19 -07:00
Abtin Keshavarzian 08f6ffd4fe Change the posix logging implementation (#348)
This commit changes the posix logging implementation to write the
entire log line in a single `fprintf()` command. This change helps
keep the open thread logs separate from other wpantund logs (syslog)
in simulator (posix) run.
2016-08-08 13:12:13 -07:00
Abtin Keshavarzian 0ab0c0da7b Ncp: Update the ncp implementation to use new buffering model (#329)
This commit modifies the `NcpBase` and `NcpUart` classes to use new
Ncp buffer model (defined `in NcpFrameBuffer` class).

Here are the main changes in this commit:

- It changes the 'NcpUart` to adopt the `NcpFrameBuffer` for storing the
  outbound frames. This allows multiple frames to be queued for tx.

- `NcpUart` is changed so that the outgoing frames are encoded and
  sent over to Uart in smaller chunks. This helps reduce the required
  buffer size for storing the encoded outbound uart data.

- The spinel command handler methods in `NcpBase` are modified to return
  ThreadError status to indicate success or failure (e.g., when there is no
  buffer space for a response frame).

- If the response to a spinel command cannot be sent (no buffer space) the
  `NcpBase` remembers the set of TIDs (transaction ids) of such commands
  so to reply later with error status `SPINEL_STATUS_NOMEM` when buffer
  space becomes available. This ensures that spinel commands will get
  a response even in case of full buffer.

- The `NcpSpi` class is modified to address the changes from `NcpBase` but
  this commit does not change the buffer model for the `NcpSpi`. It adds
  `spi-stubs.c` to enable building the ncp app with spi feature under
  posix platform.
2016-08-05 18:06:06 -07:00
Jonathan Hui 2a493e7ec0 Support meshcop datasets and propagation. (#330) 2016-08-04 09:46:48 -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
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 d1dcccfabb Pull out frames in Disabled and Sleep states. (#292)
This change avoids:
* processing stale messages that are queued in the socket.
* busy-looping in the Disabled and Sleep states.
2016-07-27 23:26:17 -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 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
Jonathan Hui 075ced5806 Update path to executables. (#267) 2016-07-14 20:57:51 -07:00
rongli 674dd7f2af cc2538: fix radio driver issue which would impact device acting as SED (#256) 2016-07-09 13:35:40 -07:00
Jonathan Hui 9baa18e6e6 Rename otPlatSerial* to otPlatUart*. (#253) 2016-07-07 12:18:58 -07:00
Jonathan Hui ee2922b6fb Add guard to avoid re-enabling the receiver. (#247) 2016-07-06 18:54:10 -07:00
Jonathan Hui 58a6db6183 Fix link to cli readme. (#235) 2016-07-01 17:50:40 -07:00
Jonathan Hui dc8e7de3ad Fix cc2538 examples. (#224) 2016-06-30 09:49:45 -07:00
Jonathan Hui 4cddb988a3 Update to reflect new binary name. (#221) 2016-06-28 12:26:37 -07:00
Jonathan Hui db436d91ae Unify example apps across all example platforms. (#215) 2016-06-27 17:19:37 -07:00
Jonathan Hui 8ca07553f6 Fix bug in reading IEEE 802.15.4 Extended Address from a MAC header. (#201) 2016-06-23 14:14:44 -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
Jonathan Hui 7ecccade06 Change executable names for examples to ot-cli and ot-ncp. (#173) 2016-06-20 08:44:12 -07:00
rongli db85fd2e4b fill mChannel field of received mac frame for cc2538 (#169) 2016-06-17 08:45:46 -07:00
Jonathan Hui a0bf11477c Initial example for the CC2538. (#148) 2016-06-15 13:56:37 -07:00
Jonathan Hui c7f2d4b917 Fix relative link to src/cli/README.md. (#153) 2016-06-15 11:54:28 -07:00
Jonathan Hui a24bbf09c0 Fix IEEE 802.15.4 Frame Pending handling. (#139)
* Only set Frame Pending in ACK in response to a Data Request message.
* Data Request sender uses the Frame Pending value in the ACK.
2016-06-14 08:46:11 -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
Charles Ackerman 0a65eca0ab Update README.md (#123) 2016-06-09 18:03:27 -07:00
Jonathan Hui 6c310bf6bf Add simple command prompt '>'. (#117) 2016-06-08 09:20:36 -07:00
Jonathan Hui 32361a6a2a Updates to fully support and test a standalone library install. (#108) 2016-06-03 12:05:57 -07:00
Jonathan Hui b865607619 Remove posix radio driver's dependency on internal library code. (#105) 2016-06-02 20:05:00 -07:00
Jonathan Hui c3009d0361 Move example apps to C-only API. (#99) 2016-06-02 18:38:27 -07:00
Marcin K Szczodrak ef9de65117 reorg apps and platforms (#89) 2016-06-01 16:01:22 -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
Marcin K Szczodrak cc2e961f4b node id and compilation fixes (#85) 2016-05-27 13:30:35 -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
Jonathan Hui 25f1fe5a21 Expose LQI from radio up through Thread stack. (#70)
* 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.
2016-05-26 15:08:11 -07:00
Lu Wang 96adf87cd0 add otPlatRadioGetCaps method to check radio capabilities (#53)
add doxygen for otRadioCaps

remove tmp file
2016-05-20 23:20:05 -07:00
Robert Quattlebaum 12a7060a85 ncp: Network Control Processor (NCP) implementation (#31) (#45)
In addition to the "SoC/CLI" implementation that is already included,
OpenThread needs a Network Control Processor (NCP) implementation to
facilitate applications where the Host Controller is logically
separate from the controller that implements the Thread stack (Which
is the NCP). This task also necessitates the definition of the
protocol that the Host Controller and the NCP use to communicate with
each other.

This commit represents a functional starting point for both of these.
The initial name of the line protocol is "Spinel" (Named after the
[gemstone][1]). The long-term goal is to standardize the Spinel
protocol to be the official line protocol for host-to-NCP comunication
for Thread.

A [draft of the Spinel protocol document][2] is included in this
commit. At this point everything is subject to change, but as-is the
protocol has been demonstrated to work fairly well.

The NCP implementation in the has been tested and is working well
enough for basic connectivity, but it is far from complete. A Host
implementation is not yet provided in the tree, but will eventually be
included. A separate host implementation for Linux has been written
and is anticipated to be released as a separate project over the next
few weeks.

[1]: https://en.wikipedia.org/wiki/Spinel
[2]: https://github.com/openthread/openthread/blob/feature/ncp-spinel/src/ncp/PROTOCOL.md#spinel-host-controller-interface
2016-05-19 17:46:16 -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