Commit Graph

29 Commits

Author SHA1 Message Date
Shu Chen 4c06b47c34 [channelmask] add radio supported and preferred channel mask (#3732)
Add new radio platform APIs:
 * otPlatRadioGetSupportedChannelMask(); // supported channel mask: the device is allowed to be on;
 * otPlatRadioGetPreferredChannelMask(); // preferred channel mask: the device prefers to form on.

Implement some default radio platform APIs.

Add spinel property `SPINEL_PROP_PHY_CHAN_PREFERRED` to retrieve Preferred ChannelMask.
2019-04-08 10:35:18 -07:00
Yakun Xu dd1e0f4695 [cli] add legacy stub in cli (#3729)
This commit adds stubs for legacy APIs.
2019-04-02 09:11:46 -07:00
Abtin Keshavarzian 8f112eeb5a [locator] adding Get<Type> to InstanceLocator (#3714)
This commit changes how the objects in OpenThread access each other.
It adds a template `Get<Type>()` method in `InstanceLocator`. This
method returns a reference to a given `Type` object belonging to the
OpenThread instance (e.g. `Get<MeshForwarder>()` returns a reference
to `MeshForwarder` object on the OpenThread instance). The
`InstanceLocator` is used as base class of all OpenThread classes so
every class can easily access any other object. This commit also
changes how the main instance is retrieved in `InstanceLocator` for
the single-instance case. The method `GetInstance()` directly uses the
raw buffer `gInstanceRaw`. This change helps make the `GetInstance()`
and in turn all `Get<Type>()` methods in-line. This commit also
removes the existing getters across all classes to use the new
`Get<Type>()` model.
2019-04-02 09:07:25 -07:00
Yakun Xu ceed19c4b5 [posix-app] cause compile failure for SPI bus (#3630) 2019-02-26 15:52:47 -08:00
Yakun Xu 127e3bb84e [posix-app] clean up posix app defines (#3611) 2019-02-26 13:28:37 -08:00
Yakun Xu db67b3a980 [posix] fix build for SPI bus (#3546) 2019-02-01 10:01:41 -08:00
Robert Lubos 9cb48245e5 [cli] fix GetOwner function for console cli backend (#3486)
Current implementation of GetOwner function for single-instance CLI
assumed that `cli_uart` backend is used. This caused application
crash when different backend was used and `cli_uart` was not
initialized (and in result sUartServer static pointer was not set).

This commit fixes the issue by moving static CLI Server pointer and
the mInterpreter field to the to the base Server class and providing
getter method to obtain the Interpreter instance. With this approach,
any backend derived from the Server class will be able to initialize
the static pointer and will provide a valid reference to the
Interpreter class instance.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-22 16:07:46 -08:00
Jonathan Hui 061e54627c [cli] rename cli_udp_example to cli_udp (#3480) 2019-01-22 09:06:10 -08:00
Yakun Xu f40f49ff32 [dhcp] remove dhcp server api (#3476) 2019-01-18 11:34:40 -08:00
Yakun Xu 0ace247e41 [android] disable warning no virtual destructor (#3466)
Change-Id: Ib1e28d064886af3cc5103395c284d772b3c85504
2019-01-17 02:54:43 -08:00
Yakun Xu 5eee323b8d [coap] process CoAP header in message (#3419)
This commit refines Coap::Header into Coap::Message to avoid declaring
the big Coap::Header in stack which was causing problems in low-memory
systems such as CC2538.

A UDP reserves 56 bytes by default, which will not be used before an
outbound message goes down to transport layer and after an inbound
message is delievered to CoAP agent. To get better performance, this commit
utilizes these reserved bytes of cache basic header of CoAP message
including CoAP version, code, message ID and token. These cached data
are parsed when CoAP agent receives a CoAP message and are dumped into
the correct place of a CoAP Message before sending by lower layer.

To make sure there is enough reserved bytes for an inbound message, This
commit removes headers in UDP layer before delivering a ot::Message to
handlers.
2019-01-15 05:00:21 -08:00
Yakun Xu ae2b01947d [android] disable UART echo (#3421) 2019-01-02 10:34:46 -08:00
Abtin Keshavarzian 34004c2c57 [posix-app] adopt new HDLC buffer models (#3371)
This commit updates the `HdlcInterface` and `RadioSpinel` to use the
new HDLC buffer model. In particular, for received spinel frames the
decoder uses an `Hdlc::MultiFrameBuffer` which is capable of storing
multiple frames in a FIFO queue manner.

With this model, the received and decoded spinel frames are directly
placed in the FIFO buffer. This allows `RadioSpinel` code during
`WaitResponse()` (when waiting for specific Spinel response frame) to
simply save/keep a notification frame in the queue buffer (without
requiring to copy the frame) so that it can read and process the
saved frame later. If a received frame can be processed at the time,
the frame is then simply discarded from the queue buffer.
2018-12-21 14:33:35 -08:00
Yakun Xu dd4025ebb0 [android] build spi-hdlc-adapter in OpenThread (#3342) 2018-12-05 17:51:00 -08:00
Yakun Xu 22d6d1abf0 [android] correct version on android (#3340) 2018-12-03 09:24:22 -08:00
Shu Chen e531b267b9 [android] fix a typo in Android.mk (#3329) 2018-11-28 10:11:52 -08:00
Abtin Keshavarzian 8d12513591 [mac] adding sub-MAC layer (#3262)
This commit introduces sub-MAC layer (class `Mac::SubMac`) in
OpenThread implementing a subset of IEEE802.15.4 MAC primitives which
are shared by both MAC layer (in FTD/MTD modes) and Raw Link (Radio
only mode).

The sub-MAC layer handles the following (if not provided by radio
platform):

  - Ack timeout for frame transmission,
  - CSMA backoff logic,
  - Frame re-transmissions,
  - Energy scan on a single channel and RSSI sampling.

It also act as the interface (to radio platform) for setting/getting
radio configurations such as short or extended addresses and PAN Id.

In addition, this commit contains following improvements in `Mac`:
- The implementation of `STAY_AWAKE_BETWEEN_FRAGMENTS` (delay sleep)
  feature is simplified by adding a new state variable tracking if
  sleep is being delayed and canceling sleep delay on start of any
  operation.
- Member variables in `Mac` class are re-ordered to avoid alignment
  gaps.
- `Mac` timers are combined into one which is used for Active Scan,
  Data Poll timeout, and delaying sleep.
2018-11-28 10:09:35 -08:00
Shu Chen 2a3384c650 [android] include user defined configuration in Android.mk (#3320)
It introduces a way that user can define product specific configuration
for OpenThread build in Android Environment.

Also ensure that ot-cli and ot-ncp use the same mbedtls config with
ot-core.
2018-11-27 09:10:35 -08:00
Abtin Keshavarzian 0863b652b2 [posix-app] add HdlcInterface class (#3293)
This commit adds a new class `HdlcInterface` under POSIX App which
performs HDLC encoding/decoding and read/write operations on the
interface to Radio Co-Processor (RCP). `RadioSpinel` is updated to
use the new class.
2018-11-13 15:16:48 -08:00
Jonathan Hui 8d02956c36 [mbedtls] fix build 2018-11-02 15:37:01 -07:00
Abtin Keshavarzian 9a7fc691b1 [mac] move "Mac::ChannelMask" to its own files "mac/channel_mask.hpp|cpp" (#3244) 2018-11-01 09:04:46 -07:00
Abtin Keshavarzian 309bd09d75 [logging] remove aInstance as input parameter to logging macros (#3184) 2018-10-25 09:14:43 -07:00
Yakun Xu 2af44beb74 [posix-app] simplify saving settings (#3108) 2018-10-09 11:12:56 -07:00
Shu Chen 5c08fb8e3b [diags] support platform specific diags in radio-only ncp (#3024) 2018-09-12 05:42:19 -10:00
Shu Chen 3174c590c3 [utils] implement a common method for command line parsing (#3001) 2018-09-05 00:40:02 -07:00
Jonathan Hui f0bb0982ee [examples] change example platform namespacing (#2927) 2018-08-03 14:13:47 -05:00
Yakun Xu 601b99b394 [android] use spi instead of uart (#2942) 2018-08-02 00:54:48 -05:00
Jonathan Hui b8181ce76d [android] fix removal of tmf_proxy.cpp in Android.mk (#2872) 2018-07-09 22:15:19 -05:00
Yakun Xu 93bb67024f [posix-app] add Makefile for building with android build system (#2864) 2018-07-09 11:15:43 -05:00