Commit Graph

52 Commits

Author SHA1 Message Date
Jonathan Hui dee72c99a3 Disable receiver when changing the channel config. (#873) 2016-10-25 08:42:11 -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
Jonathan Hui 35e7fbf733 Update otLog*() to not require line separators. (#854) 2016-10-20 19:55:12 -07:00
Lu Wang 8468ffdb77 Settings Driver (#775)
* Settings Driver
2016-10-16 21:54:10 -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
Jonathan Hui 2f9f0d697c Update path in README. (#781) 2016-10-10 10:58:02 -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 c3fc8fb798 Build ot-cli.exe as usermode Windows executable (#649)
* Build ot-cli.exe as usermode Windows executable.
2016-10-03 10:51:05 -07:00
Robert Lubos 5eb602d443 Add current time to posix RNG seed. (#730) 2016-09-30 08:56:05 -07:00
Wojciech Bober 081a5acd07 Added FCS generation to posix radio (#709) 2016-09-30 08:55:23 -07:00
Jonathan Hui 69a7c3d2e2 Miscellaneous MAC cleanup. (#706)
- Call otPlatRadioReceive() on SetChannel().
- Only call NextOperation() in the idle state.
- Call otPlatRadioReceive() with the proper channel in HandleBeginTransmit().
- Remove unnecessary mBeginTransmit tasklet.
2016-09-28 09:06:43 -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
Buke Po 3452933fc5 Enable CLI logging (#670)
* enable uart logging
2016-09-23 20:43:49 -07:00
rongli add8639049 Support AutoPend for CC2538 (#562) 2016-09-23 11:12:53 -07:00
Shu Chen 5fdc27f1f8 Allocate another 1K bytes to CC2538 stack (#654)
Reduce the size of message buffer to save 1k bytes SRAM space for stack.
2016-09-22 09:40:29 -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
Lu Wang 043a664cca Use Openthread Hardware Entropy Collector (#484)
* create new file named as hardware_entropy.c for mbedtls to use OT hardware entropy source
2016-09-13 18:38:45 -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
Robert Quattlebaum 9b1de7bbb2 posix/uart: Fixes for failure to terminate (#568)
These changes address various issues found in the POSIX platform UART
driver which lead to the process not terminating properly when the
parent dies or closes `stdin`/`stdout`. Some of the errors could even
lead to unexpected program termination.

Among the various errors corrected are:

*   Using `assert()` to terminate under normal operating conditions.
*   `posixUartProcess()` only checked `s_in_fd` for readability and
    did not check `s_out_fd` for writability. It also caused data
    corruption if `write()` ever returned less than all of the bytes
    sent.
*   `ISIG` was being set on the termios flags. This can cause problems
    when the serial API is used for binary data (Like when used with
    the NCP app). (This requires the CLI be explicitly able to be able
    to handle CTRL-C when built for POSIX)
*   Socket errors weren't being tracked on `select()`.
*   The platform main loop would (possibly) terminate if `select()`
    failed with `EINTR`, which makes it difficult to attach to the
    process with a debugger.
2016-09-12 13:47:18 -07:00
Lu Wang 70e9f76623 - Allocate 1k bytes to CC2538 stack (#502)
- Free 2k bytes RAM for other's use via reducing the default size of message buffer
2016-09-11 21:11:11 -07:00
Jonathan Hui bcc1261749 Clean up mac/radio interaction. (#538)
- Remove unnecessary calls to otPlatRadioReceive().
- Allow calls to otPlatRadioReceiveDone() whenever the radio is active.
2016-09-08 08:47:01 -07:00
Lu Wang c05c632d2f Implement CC2538 random driver (#483)
* Implement CC2538 random driver
2016-09-06 21:57:08 -07:00
Lu Wang 6e5a22080e Add .ARM.exidx section (#521) 2016-09-06 19:59:41 -07:00
Nick Banks 51baf4ab4d Add POLLIN to the poll flags for the posix example. (#505) 2016-09-01 11:59:13 -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
Abtin Keshavarzian afb28f0f97 NcpSpi: Ensure spi tx frame preparation and callbacks happen from the same tasklet. (#455)
This commit changes the `NcpSpi` class implementation such that SPI
tx frame preparation always happens from the same task `mPrepareTxFrameTask`
This ensures that the callbacks to base class `Ncp` are also invoked from the
the same task (and not from the the task calling `OutboundFrameEnd()`).
2016-08-25 22:16:22 -07:00
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
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 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
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
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 dc8e7de3ad Fix cc2538 examples. (#224) 2016-06-30 09:49:45 -07:00