Commit Graph

14 Commits

Author SHA1 Message Date
Abtin Keshavarzian be218c4cc1 Update NcpFrameBuffer callbacks, add NCP frame tags, update unit test (#1799)
This commit contains the following changes to the `NcpFrameBuffer`
class:

It updates `NcpFrameBuffer` callbacks by adding `FrameAddedCallback`
and `FrameRemovedCallback` which are respectively invoked when a frame
is added/removed to/from the NCP buffer.

It also adds new concept of NCP frame tag which is a unique (within
the queued NCP frames) value associated with every successfully
queued/added frame in `NcpFrameBufffer`. The tags are passed in the
callbacks to indicate the frame that was added or removed.  New
methods are added to get the tag of the frame at front/top of the
queue and the tag associated with last (successfully) added frame. The
tags are used to track when a NCP frame is removed, which enable us to
detect when the reply to a specific spinel exchange is sent (e.g.,
this is used to track the reply to `SPINEL_HOST_POWER_STATE_ONLINE`
property).

The `NcpBase`, `NcpSpi`, and `NcpUart` implementation are modified to
use the new callbacks and tag related methods.

This commit also updates the `test_ncp_buffer` unit test:

- Additional checks are added to test the new callbacks behavior

- Tests are updated to verify the tag related methods and their
  functionality.

- A new fuzz test is added for NCP buffer where over many iteration, a
  random number of frame with random content and random length are
  added to the NCP frame buffer. It is then verified that frames with
  same content are read back.
2017-05-25 19:16:00 -07:00
Jonathan Hui 48b9299544 Clean up error names. (#1764) 2017-05-23 09:34:35 -07:00
Jonathan Hui fbfd76a990 Apply #include code style. (#1723) 2017-05-05 11:28:29 -07:00
Jonathan Hui 1eabda6a08 Change top-level namespace from 'Thread' to 'ot'. (#1664) 2017-04-27 22:29:05 -07:00
Nick Banks 2549d03f1f Add Dynamic Memory Support to otLwf.sys (#1414)
* Add Dynamic Memory Support

* Use single list for free buffers. Null mNext on return of new buffer.

* Use Paged memory for Buffers.
2017-03-06 13:39:56 -08:00
Jonathan Hui d0c687505b Move openthread.h to openthread/openthread.h. 2017-03-02 10:24:55 -08:00
Abtin Keshavarzian ab13e718c6 Update the NCP code to use otMessage and otMessageQueue APIs (#1151)
This change updates the NCP related files to use `otMessage` and
`otMessageQueue` APIs to replace the direct calls into OpenThread
internal `Message` and `MessageQueue` classes.
2017-01-18 22:03:42 -08:00
Nick Banks 25cea9414b Windows Unit Test Support (#629)
Window Unit Test Support
2016-09-20 18:11:19 -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
Jonathan Hui e22c123904 Remove globals from message.cpp. 2016-09-07 13:30:22 -07:00
Jonathan Hui 6d958ba51b Fix compiler warnings in unit tests. (#488) 2016-08-29 11:41:59 -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
Abtin Keshavarzian a46d258ce7 Ncp: Introducing NcpFrame Buffer class and its unit test. (#264)
This commit is part of ncp buffer redesign - issue #59.
2016-07-25 11:17:29 -07:00