This commit defines a set of platform APIs to integrate UDP layer of
OpenThread with that of the platform.
With this commit, services and applications developed upon OpenThread can
also be accessed through platform's own network interface, e.g. socket() on
POSIX.
This commit contains the following changes:
- It adds `otPlatRadioGetVersionString()` as an optional radio
platform API. If the radio platform does not implement this
function, OpenThread core provides a default weak implementation
of this function which return the OpenThread version.
- A public OpenThread API `otGetRadioVersionString()` is added which
provides the radio version string.
- POSIX App is updated to get the version from its RCP and provide
`otPlatRadioGetVersionString()`
- A new spinel capability `SPINEL_CAP_POSIX_APP` is added which
corresponds to `ENABLE_POSIX_APP` configuration.
- A new spinel property `SPINEL_PROP_RCP_VERSION` (only available
in POSIX_APP) is added which gets the RCP version.
This commit makes the following changes in `MeshForwarder`:
- It separates the logging of sent direct and indirect messages,
ensuring that for indirect messages the status (success/failure)
is logged after all retry attempts.
- It updates the log message (status of transmission) for a larger
message requiring fragmentation and multiple frame transmissions
when `CONFIG_DROP_MESSAGE_ON_FRAGMENT_TX_FAILURE` is not enabled.
- It fixes managing of `IpCounters` to only account for messages
with type `kTypeIp6`.
This commit changes `MleRouter::HandleChildUpdateRequest()`:
- If the child entry is modified (i.e., timeout value or
device mode changes) on an already attached child, the child
info is updated and saved in the non-volatile settings.
This ensures that after a parent reset the child can be
recovered correctly.
- If the "Child Update Request" causes a mode change from rx-on
to sleepy on a child in `kStateValid` (already attached), the
source match controller is set to perform source address
matching on the short address.
- This commit also adds a log to indicate mode change of a
child.
This commit distinguishes the attach same process during downgrade from
the one caused by losing connectivity as for the former downgrade
scenario, there must be enough active routers to provide connectivity,
and additional benefits is to avoid the impact of possible flooding parent
responses if there are lots of REEDs in large scale thread network.
This commit renames `NODE_ID` to `gNodeId` in posix app and posix
platform example code. It also ensures to use correct encoding (byte
order) to calculate the `gNodeId` (as `uint64_t`) in posix app.
This commit updates `toranj` framework to allow a different mode of
operation where tests are run using posix-app along with an RCP (NCP
in radio only mode) build. This commit also adds a new job for the
new model in travis CI build matrix.
This commit makes changes to ensure the `Leader::RemoveRloc` methods
remove all matching entries from a `BorderRouterTlv` or `HasRouteTlv`
It adds new methods to `BorderRouterTlv` and `HasRouteTlv` to get the
first entry or last entry and allow an easier way to iterate over all
the entries.
This commit also adds a new helper method `RlocMatch()` to simplify
the comparison of RLOC16 values (exact match vs router id match).
This commit adds check in `Leader::RegisterNetworkData()`to validate
the received network data and ensure it only contains entries matching
the RLOC16 of the device registering the network data. It updates
`RlocLookup()` method to add a new mode to allow or not allow any
entries that do not match the given RLOC16.
This commit changes the code to treat Channel Mask TLV from
Operational Dataset and the MAC layer supported channel mask as
two different (unrelated) network parameters. In particular:
- With this commit, the Channel Mask TLV value is ignored when
applying a Dataset from `Dataset:ApplyConfiguration()`.
- However, when we create an Active Operational Dataset as leader in
`ActiveDataset::GenerateLocal()` method, the MAC layer's supported
channel mask is still used for the Dataset Channel Mask TLV value.
- This commit also adds a check in `Mle::SendAnnounce()` to ensure
that MLE Announcements are not sent on channels that are are not
included in the MAC layer's supported channel mask.
This commit adds support for a set of MLE counters (e.g., counters to
track number of times device entered different roles, or counters
tracking number of attach attempts, partition ID or parent changes).
This commit adds a test-case under `toranj` covering multicast
traffic exchange over a multi-hop network to the following multicast
IPv6 addresses: link-local/mesh-local all-nodes address, link-local
/mesh-local all-routers address, link-local/mesh-local all-thread-
nodes address, and user-specified multicast address.
The new test covers the following:
- Verify all nodes (routers/FED/SED) subscribe to:
* Link-local all nodes, realm-local all nodes,
* Link-local all Thread nodes, realm-local all Thread nodes,
* All MPL forwarder realm-local.
- Verify routers also subscribe to:
* Link-local all routers, realm-local all nodes.
- Verify adding/removing multicast addresses on all devices.
This test verifies the behavior of `AddressResolver` module and
entries in address cache table. It also tests the behavior of nodes
when there are topology changes in the network (e.g., a child switches
parent). In particular, the test covers the address cache update
through snooping.
This commit adds a new script `git-squash-merg` which can help with
performing squash merge of a branch into another. The commit message
includes the list of squashed commits. This script is helpful for
synchronization of git repositories that work with gerrit.
This commit updates the `toranj` tests related to forming/joining
a network to cover newly added capabilities to wpanctl `form`/`join`
commands (allowing all parameters to be given as part of the
command itself).
This commit adds a test-case under `toranj` to verify router table
entries on a network with 4 routers: {r1, r2, r3} forming a loop
with r4 connecting to r3.
This commit adds a new test-case under `toranj` for Child Supervision
feature.
This test uses MAC whitelisting to emulate the situation where a child
is removed from parent's child table while the child continues to stay
attached to the parent (since data polls from child are acked at radio
platform layer). Specifically the test verifies that once supervision
check is enabled on the child, the child detects that it is no longer
in the parent's table and tries to re-attach. The test verifies the
behavior of both the parent and the child when supervision is enabled.
It verifies that the parent is periodically sending supervision
messages to the child and that the child is monitoring the messages
from parent. This test also indirectly verify the child timeout
behavior on a parent.
This commit adds a new test-case under `toranj` frame-work to verify
the behavior of devices under the "inform previous parent" feature.
With this feature enabled, when a child attaches to a new parent, it
will send an IP message (with empty payload) to its previous parent.
Upon receiving this message the previous parent would immediately
remove the child from its child table.
The test network topology consists of two routers/parents and a single
sleepy child. The child is first attached a parent and is then forced
to switch its parent. It's then verified that the child is removed
from first parent's child table.
This commit adds support for Commissioner related APIs in spinel and
NCP including starting/stopping Commissioner, setting Provisioning
URL, adding/removing Joiners, and sending Announce Begin, Energy Scan
Query, PAN ID Query, MGMT_GET/MGMT_SET messages.
This commit adds signal handler in posix example platform for
signals SIGHUP and SIGTERM. Upon receiving either signal the
process is terminated using `exit(0)`.
This commit adds a new method `finalize_all_node()` in `wpan.Node`
class to finalize all previously created instances of `wpan.Node`. It
terminates the associated `wpantund` process and wait.
The child/router entries are generally cleared using `memset()` to avoid
explicitly setting all fields to zero. As a result, it is necessary to
explicitly clear the link quality state to properly initialize the last
RSSI reading. The user-specific constructors are also removed.
This commit makes the following changes:
1. A child that is resynchronizing with its parent after reset always
requests the network data to ensure that it has the latest version.
2. When autoconfiguring SLAAC addresses in response to a network data update
always attempt to add the netif address buffer in case the netif
structure was removed (e.g. due to reset).
This commit adds a new test script for `toranj` test frame-work
covering the situation when IPv6 addresses with same prefix are
added/removed on multiple nodes. The test verifies that the on-mesh
prefix list on all nodes stays consistent and updated as the addresses
are added/removed and nodes are reset.
This commit adds a new test-case under `toranj`. The test covers
the following situation:
- A single parent node with three sleepy and two rx-on children.
- Parent node is reset.
- It is verified that all children are recovered and are present
in the parent's child table after reset.
- It is also verified that all children are restored on parent
through "Child Update" exchange process and none of them get
detached.
This commit addresses an bug where the child info was not being
saved in non-volatile settings. It fixes the following cases in
the code where a child id was used to search for a child (using
`FindChild()`) instead of the RLOC16 address:
- `StoreChild()` is changed to accept a `const Child &` as input
parameter avoiding the need to look up the child by ID or RLOC16.
- `SendChildIdResponse()` and `GetChildInfoById()` are updated to
perform the search for a child using its RLOC16.
The MKW41Z Reference Manual Section 44.6.2.7 states:
- "The 802.15.4 Link Layer software prepares data to be transmitted, by
loading the octets, in order, into the Packet Buffer."
This commit maintains a separate buffer for building the transmit frame
then copies the buffer just before the transmit frame is submitted to the
radio.
This commit introduces changes necessary to support long routes (i.e. route
cost >= 16).
This is an experimental feature that requires changes to the route
information communicated in MLE messages. As a result, it is not compatible
with the Thread 1.1 specification.
This feature is disabled by default.
This commit renames the timer used for Child Update transmissions to
`mMessageTransmissionTimer` and allow it to be used for retx of MLE
Data Request messages when there is no pending or active MLE Child
Update Request. It also adds logic to ensure that the device gets
detached after some number of MLE Data Request attempts with no
response.
This allows the underlying wpantund process associated with a `Node`
instance to be executed while we are waiting for it to be initialized.
It also protects against any unexpected termination of an instance.
This change would help with speed of initialization of all nodes
mainly when there are many instances running in parallel.
This commit updates the documentation of spinel property sections
and also adds a new range 0x080 - 0x08F, 0x1800 - 0x18FF allocated
for MeshCop related properties.
Linker will discard libmbedcrypto_a-cc310_mbedtls.o when searching
mbedTLS library, if it finds weak implementation of
nrf5CryptoInit/Deinit before strong ones. Adding additional
symbols to this file will prevent this behavior and make linker
to search libmbedcrypto_a-cc310_mbedtls.o even after weak
implementations are found.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit updates the APIs `otDatasetSendMgmtActiveGet` and
`otDatasetSendMgmtPendingGet` to be similar to MgmtSet APIs and use an
`otOperationalDatasetComponents` as input to specify the Dataset
components to be requested. The implementation of APIs in
`DatasetManager` and their use in in CLI is also updated.
It also defines new spinel properties `MGMT_GET_ACTIVE_DATASET` and
`THREAD_MGMT_GET_PENDING_DATASET` (with their set handlers) to add
support for sending `MGMT_GET` meshcop command for Active/Pending
Operational Dataset. It also renames the existing properties used for
sending `MGMT_SET` (include `MGMT_SET` in the property name).
It also adds a new property to allow an optional destination IPv6
address to be specified (for sending `MGMT_GET` command) as part of
spinel dictionary representation of Dataset instance.
Add a configure option to enable/disable Header IE support: OPENTHREAD_CONFIG_HEADER_IE_SUPPORT
So then the Header IE generation and parsing feature could be enabled separately.
This commit increases the maximim number of entries that can be
supported by `Ncp::ChangePropsSet` to 64 by using `uint64_t` to
save the flags instead of `uint32_t`.
There are some problems if radio is not reinitialized during pseudo reset:
* It may trigger unexpected otPlatRadioTxDone(), and cause the device to hang;
* The uncleared radio timer queue is invalid, it may block the new added timer which has a larger targer time.
Note: The clock init/deinit is disabled during radio init/deinit.
* [cc2538] Add definitions for FSMSTAT0 and RFERRF bits.
This adds a register definition for `RFCORE_XREG_FSMSTAT0` and defines
the bits in `RFCORE_SFR_RFERRF`.
* [cc2538] Check for error conditions on transmit.
The transmit code first waits for an existing transmission to finish,
then sets things up for the next transmission and waits for the radio to
go into receive mode before proceeding.
If, the radio receive buffer overflows during this time, the radio will
enter a RX overflow state (state 0x11 in `FSMSTAT0`) and will block
there until the RX FIFO is flushed.
In such cases, the CC2538 hard-locks due to the while loop waiting for
the `RX_ACTIVE` bit to be set. While waiting for `RX_ACTIVE`, we need
to check for these overflow conditions, handle them, then re-try our
transmitter set-up.
* [cc2538] Re-try transmit set-up on IDLE
If we enter the idle state, then rather than just setting the channel,
re-try our transmitter set-up since we should be in the correct state
to do this at this point.
This commit adds a new function `verify_within` in `toranj` wpan
library. This function verifies that certain conditions (given as
function handler) pass within a given wait time interval. The
`verify` function is also changed to raise an exception (instead
of immediate `exit(1)`).
The new function is then used in `test-014` to allow faster checks
after device reset while giving longer wait time for test to pass.
This commit moves the border agent service into OpenThread core.
Border agent, commissioner, and joiner shares a single secure CoAP agent,
because they will not be active at the same time.
Other changes include:
- Replaced TMF proxy with UDP proxy, which is more generalized.
- Changed OT_ERROR_NONE string to "OK".
- Defined a special interface id -1 to differentiate packets received by
host side.
Introduce a nrf5RadioPseudoReset() method, it will put the radio to sleep mode,
and clear the pending events during pseudo reset. So to avoid unexpected transmit
done callback after pseudo reset, which may cause the device to hang.
This commit appends new fields to format of `PROP_THREAD_PARENT`
spinel property. The new fields provide age, avrerage RSSI and
last RSSI, etc. This commit also updates the spinel documentation.
This commit adds a `toranj` test for adding/removing IPv6 addresses
on routers, FEDs, and SEDs (on network interface).
The test then covers the following:
- Verify "IPv6:AllAddresses" wpantund property.
- Verify that prefixes are present in network data corresponding
to added addresses (on all nodes).
- Verify that a SED does register the address with its parents
("Thread:ChildTable:Addresses" wpantund property).
- Verify that addresses/prefixes are retained by wpantund over
NPC resets.
- Verify that when an address is removed on network interface
its corresponding prefix is also removed (on all nodes).
This commit updates `wpan.py` module to include newly added wpanctl
commands `add-prefix` and `remove-prefix` and include new `stable`
parameter for `add-route`. It also updates `test-10` to test the
behavior of the new commands.
This commit addresses an issue with forwarding of off-mesh traffic
on FED. It also adds a `toranj` test-case to test adding of off-mesh
routes (on routers and FEDs) and traffic flow to off-mesh addresses.
This commit changes the way the mesh forwarder layer handles transmit
attempt failures due to CCA failures. Prior to this commit, the mesh
forwarder layer would simply drop the packet. This commit keeps the
packet in the queue so that it can be retransmitted at a later time. This
applies to both direct and indirect transmissions.
This commit contains the following changes:
- Adds new logic to `Mac` to track supported channel mask along
get/set methods.
- Adds public OT APIs `otLinkGetSupportedChannelMask()` and
`otLinkSetSupportedChannelMask()` to get/set the channel mask.
- Ensures supported channel mask from `Mac` is included in Dataset
TLVs when a local Dataset is generated.
- Ensures the channel mask at `Mac` gets updated when a new Dataset
configuration is applied.
- Adds `OT_CHANGED` notification for signaling channel mask changes.
- Updates `NcpBase` and `PHY_CHAN_SUPPORTED` spinel property get/set
handlers to adopt the new public APIs.
- Updates `NcpBase` to emit async `PHY_CHAN_SUPPORTED` updated on
OT_CHANGED channel mask notification.
This commit also contains
- Adding `Instance::GetLogLevel()` to get current log level on
device.
- Adding new `otLogMac()` macro to log at MAC region with a run-time
given log level.
This commit changes some of the log messages in `mle`, `ip6`,
`address_resolver` and `router_table` from INFO level to NOTE level.
It also adds missing `otLogNote<>` implementation for windows.
OpenThread network-wide time synchronization service is an experimental feature, not part of the standard Thread protocol.
Feature Overview:
* All the nodes in the same Thread partition sync to the same Thread network-wide time;
* Microsecond level time synchronization precision;
* Flexible time accuracy and time sync period configuration;
* APIs for application layer use case, support both CLI and NCP version.
The feature is wrapped by OPENTHREAD_CONFIG_ENABLE_TIME_SYNC, there's no change to current Thread 1.1
implementation if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is not enabled.
If OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is enabled, the node could:
* Attach to a time sync enabled network, otherwise
* Attach to a standard Thread 1.1 network, otherwise
* Form a new time sync enabled network
In addition, if OPENTHREAD_CONFIG_TIME_SYNC_REQUIRED is also enable, the node could only:
* Attach to a time sync enabled network, otherwise
* Form a new time sync enabled network
Note:
Currently, the feature is only supported on nRF52840 and posix platforms. And the network time
is only synced among Routers and REEDs, the SEDs will be supported later as an optional feature.
This commit moves the methods related to logging mesh header
messages in `mesh_forwarder_ftd.cpp` and limit their scope to FTD
build. This helps reduce the code size of MTD build with logs
enabled.
This changes addresses the situation where we have a single device
in network configured as sleepy end-device going through attach
backoff intervals and then user changes the device mode to be
non-sleepy and FTD. This change ensures that device become leader
quickly.
This commit adds new logic in `Notifier` class (and how it is used) to
ensure when state/configuration is changed, each of the OT_CHANGED_*
events (e.g., channel, network name) is signaled for the first time
(even in case new set value is same as before).
This change addresses an issue where if user sets a parameter (using
OpenThread public APIs) before starting Thread operation the event
indicating the change would not be emitted.
This commit also defines `otChangedFlags` and `Notifier::Flags`
types, and updates the logging in `Notifier` to use `String` class.
This commit adds a new method `MeshForwarder::LogMeshMessage()` to log
info about messages with `MeshHeader` (messages that are forwarded by
device). The new logs indicate when a message is received/sent or
possibly dropped. The immediate source and destination for the
received or sent frame is logged. The new logs include info from
`MeshHeader` such as mesh source, mesh destination, number of hops
left. If the message is fragmented, info from fragment header such as
datagram tag and offset is included in the logs. For a non-fragmented
or a first fragment, `LogMeshMessage()` will also decompress the IPv6
and transport (UDP/TCP) headers and provide info from them such as
IPv6 source/destination addresses, UDP/TCP checksum, source/destination
port numbers.
In addition to the new logs, this commit add the following changes:
- Adds `\t` to log lines which are grouped (make it easier to read).
- Adds `const` qualifiers to some methods in `Lowpan::MeshHeader`.
- Adds new method in `FragmentHeader` to init it from a `Message`.
- Refactors/updates some methods in `Lowpan` class (e.g., adding new
public method to decompress LOWPAN_NHC UDP header).
This commit fixes a bug when calling `MeshForwarder::Stop()` while the
discover operation is ongoing. In particular, while the send queue is
flushed, `mDiscoverTimer` is not stopped, resulting in a NULL pointer
dereference in the timer handler.
This commit also moves common cleanup code for the discover operation into
a single method.
* pending dataset should not be restored from local when ClearNetwork
* update the condition for stop /c/as registration attempts during dataset transition
This commit adds a new `toranj` test script to test IPv6 traffic
exchange over multiple hops in a network with chain topology:
r1 ----- r2 ---- r3 ----- r4
/\ | | /\
/ \ | | / \
fed1 sed1 sed2 sed3 sed4 fed4
Traffic flow:
- From first router to last router
- From SED child of last router to SED child of first router
- From FED child of first router to FED child of last router
The test covers the following:
- Verifies Address Query process over multi-hop to routers and FEDs
- Verifies Mesh Header frame forwarding over multiple routers.
- Verifies forwarding of large IPv6 messages (1000 bytes) requiring
lowpan fragmentation.
* add BRD4304A (MGM12P Module) board support
* make hal-config.h board-specific
Copied existing hal-config.h for BRD4161A and BRD4166A. For BRD4304A
used hal-config from Silabs Thread 2.6.2.0 ncp-uart-hw project without
WDOG, VUART, VCOM, UARTNCP and BSP_SERIAL_APP_PORT settings.
* enable FEM for the platforms that require it
This commit changes the posix platform radio implementation by not
invoking the `RadioReceiveDone` callback with error `OT_ERROR_ABORT`.
This is added to help remove extra logs when simulating OpenThread in
posix mode.
This commit adds a new template class `ot::String<size>` which
implements a fixed-length character string. This class is then used as
return value of `ToString()` methods from different classes. This
simplifies the `ToString()` implementation and its use. This commit
also adds a unit test for `String`.
This commit makes the following changes in `NcpSpi` class:
- It adds a new class `SpiFrame` which provides helper methods to
parse and update the header fields in the header of an SPI frame.
- It simplifies/enhances the `SpiTransactionComplete()` callback
implementation by combining the parsing of input/output frame
headers with the rx/tx frame processing.
- It adds a check for correct pattern bits in a received frame
flag byte (frames with incorrect pattern bits are ignored).
- Code format is changed to follow the "pretty" style.
- Fixes a rare issue with a possible incorrect accept length on
the first SPI transaction after NCP reset.
This commit adds MLE Data Request timeout and retransmissions for
rx-off-when-idle devices. rx-on-when-idle devices do not require explicit
retransmissions because MLE Advertisements will trigger an rx-on-when-idle
device to send the MLE Data Request again. However, if an rx-off-when-idle
device fails to receive an MLE Data Response, it will never attempt to
request again.
Thread 1.1.1 Section 5.9.4 states: "Note that failures to transmit due to
failed clear channel assessments do not count as a failure to receive an
ACK."
This commit adds a new log level `NOTE` between `INFO` and `WARN`. The
`INFO` level is intended for informational message about behavior of
the network (e.g., info about received/transmitted messages). `NOTE`
level is intended for normal but significant events that require
special handling (e.g., device getting detached) and are expected to
be less frequent that `INFO` level events and logs.
After attaching to a network, a device may need to wait until receiving the
next MLE Advertisement before populating the router table.
This commit makes the following changes:
- When receiving an MLE Advertisement, always process the Route TLV when the
router table is not yet populated.
- Have RouterTable::GetLeaderAge() return max value when the router table
is not yet populated.
- When generating a Connectivity TLV, populate the max routing cost when
no leader information is available.
The NXP KW41Z radio driver prohibited changing channels while in receive
mode; this prevented the leader properly responding to MLE Announces from
orphaned child devices.
This commit adds "attach backoff" feature in MLE. When enabled, an
exponentially increasing backoff wait time is added between attach
attempts. If device is sleepy, the radio will be put to sleep during
the wait time. This ensures that a battery-powered sleepy end-device
does not drain its battery by continuously searching for a parent to
attach to (when there is no router/parent for it to attach).
`OPENTHREAD_CONFIG_ENABLE_ATTACH_BACKOFF` configuration option can be
used to enable/disable this feature. It is enabled by default.
This commit makes the following changes in `TrickleTimer` class:
- Member variable are renamed to follow the code style guideline.
- New methods added for handling of "end of interval" vs. "middle
of interval" timer fired callbacks.
- The random range selections for mode `kModeNormal` are updated
to follow RFC6206.
* Replaced 'the the' string with 'the'
* Fix promiscuous mode filtering issue
* Stop ACK wait timer after the ACK was received
* Filter ACK frames durind RX sequence. Only TR sequence will allow ACK frames.
This commit changes how the log level and region prefix strings are
appended to OpenThread's log strings. Instead of the prefix strings
being generated and added at run-time, with the change in this commit
they are appended as part of the format string of `otPlatLog()` during
compile-time.
This commit contains two changes:
- When PAN channel is changed, the CCA success rate tracker is reset
- CCA tracker is updated only for frame transmissions on PAN channel
This commit adds a new `toranj` test script which covers the
following functionalities:
- Adding on-mesh prefixes using wpantund `config-gateway`
command.
- Prefixes with different flags/priorities on routers/end-devices.
- `wpantund` behavior adding SLAAC based IPv6 address.
- `wpantund` retaining user-added prefixes and adding them back
after an NCP reset.
This commit changes how the received MLE Announce messages are
processed.
The new implementation adds a delay before taking action when it
receives an MLE Announce message that has a more recent Active
timestamp (compared to device's current Active Dataset timestamp). A
timeout interval of `kAnnounceProcessTimeout` (250ms) is used before
the device switches to the new channel or pan-id from the received MLE
Announce message. During the timeout interval, device can receive and
parse other MLE Announce messages and it will ignore any with the same
timestamp.
This commit adds helper methods in `Mle` class to check whether
different flags are set in device mode, such as `IsRxOnWhenIdle()`,
`IsFullThreadDevice()`.
This commit adds a new log output model for NCP to use a newly added
spinel stream log property. `OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL`
can be used to be select the new log output model.
This commit defines a new spinel property `SPINEL_PROP_STREAM_LOG`
which provides streaming of formatted log string from NCP along with
an optional metadata structure. OpenThread log level and log region
are included as part of the metadata.
This commit also updates the `toranj` configuration header file to
use the new log output model.
It seems TI (for whatever reason) chose to use a rather unorthadox
mixed-endian representation for the MAC address in the CC2538, where the
most significant 4 octets are given first in little-endian order,
followed by the least significant 4 octets (again in little-endian).
The OpenThread code expects a big-endian representation of the MAC, so
we need to read in and byte-swap each half individually.
This commit adds new methods/classes related to parsing of Channel
Mask Entries in a Channel Mask TLV.
A new class `ChannelMask0Entry` is added for a Channel Mask Entry
with Channel Page 0.
`ChannelMaskTlv::GetFirstEntry()` and`ChannelMaskEntry:GetNext()`
methods are added and can be used to iterate through all the
entries in a Channel Mask TLV.
New method `ChannelMaskTlv::GetMask0Entry()` can be used to search
among all entries to find the one with Channel Page 0 (if one exist).
This commit adds a new feature/class namely `AnnounceSender` which
enables periodic transmission of MLE Announce messages on all
channels. The feature can be enabled using the config option
`OPENTHREAD_CONFIG_ENABLE_ANNOUNCE_SENDER` (disabled by default).
This commit also adds some new helper methods in `Mac::ChannelMask`
to get number of channels in a given mask, and operator overloads
to compare two masks.
This commit changes the attach state machine and how the MLE Announce
messages are sent as part of the attach process. A new attach state
`kAttachStateAnnounce` is added where the device sends MLE Announce on
all channels (in Active Dataset's channel mask).
This commit also adds a new `toranj` test-case which tests the
situation where a device misses a channel change and then reattaches
by sending MLE Announce messages.
The existing router table allocated a router entry for every possible router
id value (63). Beacuse Thread only allows at most 32 active routers in a
given network, allocating 63 router entries is wasteful. This commit
allocates only 32 router entries and dynamically manages the pool of router
entries.
This commit adds a new test-script in `toranj` to test the insecure
traffic exchange (during partial join). The test covers the
following functionalities:
- Using specific insecure port through wpantund `permit-join`
- `wpantund` keeping track of insecure traffic flow (source
address/port) and sending replies insecurely.
- `wpantund` switching to secure mode after receiving a secure
message from a source.
To ensure proper and expedient shutdown of Openthread when the Interface is brought down, this change provides a mechanism to gracefully stop the MAC layer operations. Scans are stopped by preventing any new channel change. New Transmissions are stopped. Existing transmissions are allowed to complete. Any pending operations are cleared.
This commit updates `Mle::SendParentRequest()` method to accept
a type as input parameter indicating whether the "Parent Request"
is targeted for all routers or for all routers and REEDs.
This commit renames some of enumeration constants, types, and variable
names in `Mle` related to attach process. In particular,
- `AttachState` enum & its constants (replacing `ParentRequestState`)
- `mAttachTimer` instead of `mParentRequestTimer
This code does not contain any logic change to the code.
This commit updates the `test-003-join` test script to add a case
for joining without first setting network key and checking the
wpantund state "associating:credentials-needed".
This commit adds a new method `Mle::SetRole()` to update the device
role. This method is used in MLE class instead of direct assignment to
`mRole` variable. The `SetRole()` will ensure to set flag on
`Notifier` (when there is a role change) and also log the role change.
This change simplifies the code and addresses a (rare) issue where
notifier callback would not be invoked on transition from "detached"
to "disabled" role.
This commit changes how MLE Announce messages are sent in response to
a received MLE Announce. In addition to a multicast MLE Announce
message, a unicast MLE Announce is also sent. This behavior can be
controlled using `OPENTHREAD_CONFIG_SEND_UNICAST_ANNOUNCE_RESPONSE`
config option. By default this is enabled.
This commit also changes actions taken after receiving an MLE Announce
in `Mle::HandleAnnounce()` to handle the situation where a device may
receive multiple MLE Announce messages with same info. No action is
taken if the device is detached, and current channel and panid match
the values from the received MLE Announce message.
This commit changes the `Mac` logic for handling ack timeout to put
the radio in receive mode before invoking the `HandleTransmitDone()`
callback with the `OT_ERROR_NO_ACK` status. This ensures that the
radio can be put to sleep after a no-ack error.
This commit adds a new test-case (under `toranj`) related to
controlling of NCP's MCU power state and iterations between
NCP and wpantund (related to MCU sleep).
This commit adds new `toranj` test scripts to test newly added
functionality by `ChannelManager` including:
- Test to check new spinel/wpan properties,
- Test to check channel change request feature,
- Test to check channel selection feature.
This commit also updates the posix/radio `otPlatRadioGetRssi()` to
emulate a simple interference model where it would return either a
high or a low RSSI value with a fixed probability per each channel.
This is used to verify the `ChannelMonitor` sampling logic and channel
selection functionality.
This commit updates `ChannelManager` class to add support for "channel
selection" logic where the `ChannelManager` can select a channel (for
network to switch to) based on the collected channel/link quality data
(by `ChannelMonitor` module). This commit also adds support for auto-
channel-selection functionality where `ChannelManager` will periodically
check to see if network can/should switch to a better channel. This
commit also adds public OpenThread APIs for all newly added
functionalities.
This commit changes the API names (and spinel properties and
documentation) related to "channel monitor" feature to use "channel
occupancy" instead of the term "channel quality" to represent the
rate/percentage of RSSI samples which are higher than a threshold.
This commit adds a new feature under posix platform to emulate
time (platform Alarm APIs) with a given speed up factor (i.e., as
if time runs `x` times faster). The speed up factor can be given
when running the NCP app as an input argument (default is 1).
This commit introduces a new class `ChildTable` as part of OpenThread
core. This class provides methods for iterating through the child
table and searching for a specific child (based on short/extended
address and/or child state). This commit also adds a unit test for the
newly added `ChildTable class.
Once jamming detection is enabled/started, `JamDetector` will also
monitor the Thread device role. RSSI sampling is stopped if the device
role changes to `DISABLED` and is resumed if the role changes. This
commit also adds new logs to this class to indicate when jamming is
detected or cleared and/or when any of the parameters get changed.
This commit adds `cleanup()` function in the `toranj` start script.
The cleanup code removes logs and any flash files, issues a `killall`
to remove any lingering `wpantund` instances (`wpantund` processes may
still be running from previous `wpan.Node` objects which are not yet
garbage collected by python). It also deletes any `wpan<num>` network
interfaces (this addresses the situation where even after `killall
wpantund` the network interface may stay active by kernel for some
short time, not allowing the next test-case to create network
interface with same name).
This commit changes the `spi-hdlc-adapter` retry logic when the slave
is busy (it refuses a transmission). There are three levels, initially
the retries happen almost immediately, then up to certain number of
attempts at a fast rate and finally it drops to a slow rate.
This change helps with the average delay of spinel message exchange
between NCP and host (connected using an SPI interface).
This commit adds a configuration option to enable NCP power state
control `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL`.
When enabled, the platform is expected to provide two functions:
`otPlatSetMcuPowerState()` and `otPlatGetMcuPowerState()`. Host
can then control the power state using the newly added spinel
property `SPINEL_PROP_MCU_POWER_STATE`.
This commit removes the `Start()/Stop()` APIs from `ChildSupervisor`
class. Instead `ChildSupervisor` class itself would decide when to
start/stop. It registers a `Notifier` callback to be notified when the
Thread role changes and/or when a child is added or removed. If MLE
operation is enabled and there is at least one "valid" child in the
child table, child supervision starts, otherwise it is stopped.
This commit updates the `start.sh` script under `toranj` test
framework so that failed tested are tried again up to 3 times.
It also modifies how wpantund project is built and installed
under `toranj`.
Pseudo resets allow for `otPlatReset()` to reset the OpenThread state
without resetting the chip. This is important if the SoC is presenting
itself as a USB device.
The build option `OPENTHREAD_PLATFORM_USE_PSEUDO_RESET` can be used to
force this feature to be enabled or disabled by setting it to `1` or
`0` accordingly. Otherwise it will be set to a platform-specified
default value.
Previously, ICMPv6 Echo Request handling was either enabled or disabled.
This commit allows enabling/disabling the handler for ICMPv6 Echo Requests
sent to unicast and multicast destinations separately.
This commit also adds an associated spinel property and NCP implementation.
This commit reduces stack usage when receiving/updating network data via MLE
by copying the network data directly out of the message and skipping the TLV
read.
This commit reduces stack usage when writing operational datasets to
non-volatile by writing out dataset as given and moving the cleanup of TLVs
when reading the dataset out of non-volatile.
This commit adds the base implementation of `toranj`, a test framework
for OpenThread and `wpantund`.
- It enables testing of combined behavior of OpenThread (in NCP mode),
spinel interface, and `wpantund` driver on linux.
- It can be used to simulate multiple nodes forming complex network
topologies, testing network interactions between many nodes
(e.g., IPv6 traffic exchanges).
This commit also sets up the new test-cases to run as part of travis
pull request validation in OpenThread GitHub projects.
This commit adds `OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE` as
a config option to set the max log string size supported by NCP
`otNcpPlatLogv()`. This commit also increases the default to 150
characters.
This commit caches the Active/Pending Timestamp value in memory so that
subsequent calls to `DatasetLocal::Compare()` does not require reading
from non-volatile settings and allocating another dataset buffer on the
stack to do so.
This commit makes the following changes:
- Only print logs on success.
- Remove use of `HostSwap64()`, which can cause hard faults.
- Add `ExtAddress::ToString()` method.
This commit adds a new config option which determines if the source
and destination IPv6 addresses of received/sent messages are logged
from `MeshForwarder::LogIp6Message()`.
Thread does not support address resolution for link-local unicast addresses.
As a result, any link-local unicast address other than the one based on the
IEEE 802.15.4 Extended Address is not useful.
* Use variables for MCU and board to allow configuration via makefile parameter.
* Add a switch in the efr32 Makefile to choose between supported boards.
* Update efr32 README according to the new possibility to choose between boards.
This commit adds a new header file `common/random.hpp` which
provides functions related to generating random numbers including
a helper function `FillBuffer()` which fills a given buffer with
random bytes. The OpenThread core files are updated to use the
new helper functions.
Updating the bidirectional link quality requires a two-way exchange via MLE
Advertisements. In the worst case, this can take 2.5x the worst-case MLE
Advertisement period. This commit increases the delay after updating link
quality configurations.
This commit changes how `Mac::HandleReceivedFrame()` handles duplicate
received frame when a sleepy device is waiting for data after a data
poll ack from parent indicating a pending frame. This change ensures
that the sleepy device can go to sleep faster and avoid a data poll
timeout.
This commit adds a `Mac::ChannelMask` class to define a channel (a
`uint32_t` bit-vector specifying a set of channels). The `ChannelMask`
class provides methods to add/remove channel to the mask, intersect
two masks, and iterate through the channels in the mask. A unit test
for the new class is also added.
This commit makes the following changes to (platform) makefiles:
- Removes conditional source file inclusions in Makefiles and
adopts the model where the source files themselves would add
`#if` check for the config option (this is the model adopted
in OpenThread core).
- Defines `PLATFORM_SOURCES` to include all the sources files
- Adds `PRETTY_FILES` to specify files for "make pretty-check"
This commit also adds `PRETTY_FILES` in unit test makefile.
This commit adds new logic in `ChannelManager` to help handle
situations where multiple devices within network request channel
change around the same time. This simplifies how the channel change
can be triggered by users allowing them to request a channel change on
all routers/devices simultaneously (this would help with cases where
the Thread network contains multiple partitions).
In particular, this commit adds a jitter delay to start processing of
a channel change request (random delay before a Pending Dataset is
prepared and sent to leader). Also this commit changes how the Pending
Dataset is prepared and sent. The code now checks if there is a valid
Pending Dataset and if it is changing the channel to same one as the
current channel change request, then it skips updating the Pending
Dataset.
This commits adds a new API to `ChannelManager` class (and a
a corresponding public OT API) to get the channel for the last
successfully requested channel change.
Sometimes when transmission is started RAIL_EVENT_RX_OVERFLOW
happens and then otPlatRadioTxDone is never called.
This commit makes sure the RX FIFO is always drained, even when
transmitting so RAIL_EVENT_RX_OVERFLOW never happens.
The existing platform.h is really a part of the examples and not a part of
OpenThread core. This commit moves the platform.h out of the public API
and into the examples directory.
This commit adds a new module/class `ChannelManager` which provides a
mechanism to perform a network-wide channel change. It internally
uses Pending Operational Dataset updates to trigger the channel change
in the network. It also manages retries in case of errors/failures.
This commit also adds public OT APIs for user to request a channel
change and get/set different parameters related to operation of
Channel Manager (e.g., supported channels mask).
This feature can be enabled using `--enable-channel-manager` configure
option (by default it is disabled).
* Increase max spi-align-allowance from 6 to 16
Testing has determined that some SPI slave interfaces sometimes emit
even more than 6 0xFF bytes before sending the first header byte. Upping
this value to 16 in order to provide some future proofing.
* Up version from 0.06 to 0.07
This commit adds `SPINEL_PROP_THREAD_NEIGHBOR_TABLE_ERROR_RATES`
as a new spinel property to get the frame and message error rates
for all neighbors. This property requires the presence of a newly
added Spinel capability `CAP_ERROR_RATE_TRACKING` which indicates
if the error-tracking feature is enabled in OpenThread.
This commit adds `OT_LOG_REGION_CORE` and `OT_LOG_REGION_UTIL` as
two new log regions. The Core is intended for any core module that
does not fit any other category. The `UTIL` is intended for all
modules under `/core/util` folder.
This commit implement a new feature to allow the tracking of tx error
rates at two layers:
- At PHY/MAC layer for MAC frame transmissions (frame tx error rate):
Error rate is maintained per link/neighbor. A frame transmission
attempt is considered failed if the frame is sent over the channel,
but no acknowledgment frame is received from the neighbor.
- Above MAC layer for message transmissions (message error rate):
A larger (IPv6) message may be fragmented and sent as multiple MAC
frames. The message transmission is considered failed, if any of
its fragments fail after all retry attempts. Message error rate is
maintained per link/neighbor and includes both direct and indirect
message transmissions.
Configuration option `OPENTHREAD_CONFIG_ENABLE_TX_ERROR_RATE_TRACKING`
can be used to enable/disable this feature. By default it is enabled.
`otChildInfo` and `otNeighborInfo` structs are updated to provide the
error rates for a child or neighbor.
This commit updates the implementation of `Mac::Address` class
adding getter and setter and other helper methods. When the address
is updated using the setter methods (`SetShort()` or `SetExtended()`
the `Address` class itself will update its type (remembering whether
it is an IEEE 802.15.4 Short Address or an Extended Address). This
helps simplify how this class is used in other modules.
This commit adds the following features:
- Example posix drivers to support virtual time simulation, allowing tests
to run faster than real time.
- A python-based simulation driver that coordinates the virtual time
simulations. Each alarm event and message transmission across all nodes
are scheduled in a single discrete time event queue. As a result, only
a single node is making forward progress at a time.
- Updated tests to utilize new virtual-time simulator, allowing them to run
faster than real time.
- To enable virtual time feature, define VIRTUAL_TIME=1 env var and set
CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1.
Updates mainly include:
1) Remove explict registration APIs
2) Define a new constant to limit the maximum number of addresses to register
3) Fix duplicate delivery to SED for packet sent from the parent to the realm-local multicast address
its sleepy children subscribe (due to not differentiate MPL retransmission)
4) Some other refinements and resolve conflicts when rebase
This commit adds a new method `Child::GetMeshLocalIp6Address()`
to get the mesh-local IPv6 address registered by a child. The
unit test `test_child` is also updated to verify the new method.
This commit changes how a mesh-local IPv6 address is stored in
`Child` class. Instead of storing the entire IPv6 addresses (16
bytes), only the Interface Identifier (8 bytes) is saved. The full
address is derived (when needed) using the mesh-local prefix from
`Mle`. This reduces the memory required for storing registered IPv6
addresses in the child table.
This commit also updates the unit test `test_child` to use mesh-local
IPv6 address as part of the test and verify the behavior of new
implementation.
Remove redundant retargetserial.c as retargeting may
conflict with OT UART. Also retargeting doesn't work
without retargetio.c just consumes flash and RAM.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
This commit adds a new class `SuccessRateTracker` which can be used to
tracker success/failure rate of an operation. It uses an exponentially
moving average IIR filter to maintain the rate using a `uint16_t` as
its storage. Unit test `test_link_quality` is updated to include a new
test case ``ot::TestSuccessRateTracker()` verifying the behavior of
the new class.
This commit uses the new class to track the CCA failure rate (over all
frame transmissions) at MAC layer.
This commit updates/enhances the `Child` class methods related to
managing of the list of IPv6 addresses associated with a child. The
new model provides APIs to add or remove an IPv6 address, check if the
list contains an address, and a method to iterate through all IPv6
addresses of a child. The `mle_router` and `address_resolver` and NCP
implementations are updated to use the new APIs.
This commit also adds a unit test `test_child` to verify the newly
added methods.
This commit changes the checks in `Mle::SendChildUpdateRequest()` so
that if there is no valid/restoring parent the device immediately
becomes detached and will go through full attach process.
This addresses an issue with an end-device failing to re-attach after
reset in case the device can restore its network info from
settings/flash but there is no parent info entry in the settings.
This commit removes the unused errors (such as when the device is not
joinable or PAN Id from message does not match the device's PAN Id) in
`MleRouter::HandleDiscoveryRequest()`. This suppresses the (inaccurate)
MLE warning log "Failed to process Discovery Request" for above
scenarios.
* [ncp] Transforming spinel frames between AP and NCP
NCP Spinel Transformer allows to transform spinel frames sent between
Application Processor (AP) and Network Co-Processor (NCP).
Spinel frames can be transformed by using transformer library
(or libraries) implementing spinel_transformer.hpp. Libraries
can be specified using option --with-ncp-spinel-transformer-libs.
Addidionaly, transformer's outbound buffer can be changed if needed,
using option --with-ncp-spinel-transformer-outbound-buffer-size.
This reverts commit 87d8940abf.
Adding Network Data to the MLE Child Update Response message increases the
message size beyond what can fit in a single IEEE 802.15.4 frame. The
Thread specification requires all fragmented MLE message to have MAC
security enabled.
This commit contains fixes and enchantments for diagnostics module
in OpenThread. In particular, the following changes are made to the
implementation of `otDiagProcessCmdLine()`:
- Fixes an issue with the parsing of command line input (where if
more than 8 arguments were given, it could cause an out-of bound
array access and a possible NCP crash). The new code will check for
this and outputs an error if too many arguments are provided.
- Parsing logic is simplified and now allows for extra spaces between
arguments.
- A local buffer is used to store the arguments to avoid modifying
the passed-in input string.
This commit also simplifies and does a code clean-up of `Diag`
class (variable name changes, removing extra method paramters, and
minor style changes).
The `test_diag` unit test implementation is also updated:
- It includes new test commands.
- The test prints/logs the issued input commands and their
corresponding output (as human-readable printable strings).
This commit aborts the Address Solicit transaction on a partition change.
Doing so avoids having Address Solicit messages being sent to the wrong
Leader address and delays caused by waiting for the previous Address Solicit
transaction to time out.
This commit fixes the following issues:
1. The advertise timer is no longer stopped when sending an Address Solicit
message. This ensures that a REED continues to send MLE Advertisements.
2. The advertise timer is always started after becoming a child, even when
the router upgrade threshold is not yet met. This ensures that a REED
will start sending MLE Advertisements.
Calling the associated response handler simplifies the client's handling of
CoAP transactions.
This commit also fixes a bug in aborting multiple pending transactions.
This commit modifies the method assertSentToNode to confirm if the destination Mac address of
the message is the node's Mac address. Add method check_parent_request, check_parent_response,
check_child_id_request and check_child_id_request to command.py.
REEDs periodically transmit MLE Advertisement messages to support merging
partitions. However, REEDs do not include Route64 TLVs in their MLE
Advertisement messages.
This commit removes the strict requirement check when handling MLE
Advertisement messages, allowing such messages sent by REEDs to trigger
the partition merging process.
Prior to this commit, a REED attempting to become a router clears its
routing table state when sending the Address Solicit message. This causes
the REED to improperly think that it is a singleton when determining whether
or not to merge with another partition.
This commit only updates the routing table state when the REED actually
transitions to becoming a router.
This commit moves restarting the state update timer to the top of
`MleRouter::HandleStateUpdateTimer()`. This ensures that the timer
continues to fire periodically. Prior to this change, the state update
timer is not properly restarted when `mRouterSelectionJitterTimeout`
expires.
This commits contains the following changes related to channel
monitoring feature:
- It adds OT public APIs for this feature.
- It defines new spinel properties (and their documentation).
- It implements `NcpBase` get handlers for the new properties.
This commit adds a Network Data TLV request to the MLE Child Update Request
message when trying to resynchronize with a parent after reset. This
eliminates the need for an MLE Data Request/Response exchange following the
MLE Child Update Request/Response exchange.
This update also makes the following changes:
- Initialize chip using `halInitChipSpecific()` provided by RAIL HAL.
- Use `RAIL_HoldRxPacket()` to move rx processing out of interrupt context
- Eliminate critical sections from `otPlatRadio*` APIs.
- Use UART driver provided by Gecko SDK.
This commits introduces channel monitoring feature which monitors
signal level on all channels to help determine the cleaner channels
(channels with less interference).
When enabled and started, `ChannelMonitor` class will perform a
zero-duration Energy Scan collecting a single RSSI sample per channel,
every sample interval (which is a build-time configurable parameter).
The RSSI samples are then compared with a (build-time configurable) RSSI
threshold. As an indicator of channel quality, the `ChannelMonitor`
class maintains and provides the average rate/percentage of RSS
samples that are above the threshold within (approximately) a
specified sample window length.
The unstable failing lies in when Leader has lower partition id and switches to better partition
formed by original routers. The default RouterSelectionJitter of Leader is 120s, however the
migration waiting time in script is 60s, thus there are chances that the ping happens when the
Leader just becomes router in the new partition but before link sychronization, causing the ping
packet dropped on ROUTER3.
Two options to resolve this: 1) increase the waiting time for migration to a value > 120s or
2) configure router selection jitter to a small value to relax the waiting time requirements.
This commit changes the `ClearChildIndirectMessages(aChild)` method in
`MeshForwarder` to ensure that it also clears the indirect message
pointer on the child entry.
This addresses a subtle bug in the code in the following situation: If
we happen to receive a "Child Id Request" from an already valid child
for which we are in the middle of an indirect transmission, from
`MleRouter::HandleChildIdRequest()` all queued indirect messages for
the child are removed (through `MleRouter::RemoveNeighbor()` call).
This would then free the indirect message while the child still kept a
pointer to the freed message.
This commit changes the `SupervisionListener` implementation by
relaxing the checks for when to start the supervision listener timeout
timer, in particular relaxing the check for role to be `ROLE_CHILD`.
This addresses an issue where timer may not start during (re-)attach
process after a "Child Id Request" transmission where the device
becomes sleepy but it's not yet fully attached as a child.
This commit changes the logic for preparing a data poll (802.15.4 MAC
Data Request) frame and selecting short/extended address. It ensures
that during a parent switch attempt on a sleepy-end-device, the data
polls use the extended address as the source MAC address.
This commit changes the implementation of zero-duration energy scan
operation so that all RSSI samples (for different channels) are taken
within the same tasklet. This ensures that the zero-duration energy
scan operation can be performed quickly and radio is switched to its
normal channel avoiding any delays caused by other tasklets and/or
platform operations.
* Separate radio HAL from imported HAL files in nrf52840 platform.
* Update nRF52840 radio driver
* Update nRF52850 HAL files
* Update README.md files in third_party/NordicSemiconductor
This commit brings/syncs the change in `spinel.c` from wpantund.
This change was done as part of wpantund commit d77e7cbf23 which
addressed some of the fuzzer test issues.
Properly formed Route TLVs should never have more than 32 route entries.
This fix follows a "be liberal in what you accept" approach.
Credit to OSS-Fuzz.
This commit changes how MAC operations (frame tx, active/energy scan,
etc.) get started by adding a new tasklet `mOperationTask` which
is used to start/perform any pending operation. This ensures that
callbacks related to an operation are invoked after the method which
initiates the operation returns. For example, when a new `Mac::Sender`
is registered with a call to `Mac::SendFrameRequest()`, its callback
`FrameRequestHandler` would be invoked after the `SendFrameRequest()`
call itself returns.
The `mOperationTask` serves two purposes. It's mainly used for
starting a new operation. It is also used during Energy Scan to take
an RSSI sample.
This commit contains the following changes: It simplifies the MAC
scan implementation by adding common helper methods such as
`UpdateScanChannel()`. It also fixes an issue where invoking back-to-
back scan could cause the handler to be overwritten with NULL. It adds
support for special case of Energy Scan with zero scan duration to
collect a single RSSI sample per channel.
This commit contains the following changes: (a) It adds a new class
`Notifer` which can be used to register callbacks to be notified of
state or configuration changes within OpenThread. This is used both
internally (by other core OpenThread classes) or externally by
registering `otStateChangedCallback` handlers. (b) This commit also
adds a set of new `OT_CHANGED` flag definitions corresponding to
fields in the Thread Operational Dataset (e.g., the Thread network
channel changes map to `OT_CHANGED_THREAD_CHANNEL`). This ensures that
user is notified of changes to Active Operational Dataset. (c) Finally,
this commit adds support in `NcpBase` for the newly added `OT_CHANGED`
flags by emitting asynchronous spinel property updates corresponding
to the changed configuration properties.
This commit applies a hysteresis to establishing new links or merging
partitions. In particular, this commit introduces new minimum link
margin thresholds that must be met before attempting to establish a
new link or merging to a different partition. Enforcing a mininmum
link margin threshold before establishing new links helps avoid links
that will quickly become invalid due to normal time-varying link
qualities.
This change addresses some issues that was noticed while working to
bring up the OpenThread NCP on the nRF52840. The most important change
is the introduction of the macro `USB_HOST_UART_CONFIG_DELAY_MS`, which
will slightly delay the output of queued data once the fake UART is
opened. On some slow Linux systems, the USB-CDC-UART driver sends the
data so quickly after the port opens that the application hasn't had
time to get the TTY properly configured using tcsetattr(). While this is
technically a host-side problem, fixing this problem host-side is
architecturally infeasible in many cases. Ensuring the reliable delivery
of the first bytes of the HDLC stream from the NCP after a reset is
critical to the host driver being able to identify that a reset has
indeed occurred. Waiting a few milliseconds after the port is opened
allows the reset reason frame to be reliably transmitted.
When an OpenThread NCP starts up, the only thing it should emit is a `CMD_PROP_VALUE_IS` for `PROP_LAST_STATUS`, with a reset reason as the status code.
However, up until this point we have been also dumping out lots of other details which happen to be triggrered by OpenThread's start-up code. This is effectively noise, since a properly implemented host driver would be explicitly fetching the values of properties it needs to know at startup.
This change fixes this by supressing all property updates at startup except `PROP_LAST_STATUS`.
This commit adds a new feature in `NcpBase` to allow spinel responses
for property "get/set" commands to be saved/queued by NCP. This in turn
helps to ensure that the responses are never dropped/missed due to NCP
buffer space not being available at the time of processing of the command.
The responses are sent when NCP buffer space becomes available.
This commit implements a "Periodic Parent Search" feature in MLE.
This feature is disabled by default and can be enabled through
`OPENTHREAD_CONFIG_ENABLE_PERIODIC_PARENT_SEARCH` configuration
option.
When enabled, an end-device/child (while staying attached) will
periodically search for a possible better parent and will switch
if it finds a better one.
The child will periodically check the average RSS value for the
current parent, and only if it is below a specific threshold, a
parent search is performed. Since the parent search process can be
power consuming (child needs to stays in RX mode to collect parent
response) and to limit its impact on battery-powered devices, after a
parent search is triggered, the child will not trigger another one
before a specified longer backoff interval. The check and backoff
intervals along with the RSS threshold used to trigger the parent
search can be set from a set of configuration options.
This commit allows a device to execute the MLE attach protocol without first
having to detach from it's existing parent. This change allows a device to
search for a better parent without disrupting existing connectivity.
This commit involves the following changes:
1. Support sending MLE Parent Request and receiving MLE Parent Response
while attached.
2. If the set of MLE Parent Responses yields a better parent than the
one the device is currently attached to, the device proceeds to complete
the attach process with the better parent.
Calling `PlatformDeinit()` before calling `NVIC_SystemReset()` reduces
the reliability of `otPlatReset()` to always work properly, and doing so
seems superfluous if you are just going to reset the chip anyway.
This fixes issue #2383.
This commit changes the `MleRouter::RestoreChildren()` so that it
can detect invalid child info in non-volatile settings (e.g., if there
are more entries than max allowed/supported children, or if there are
duplicate entries with same ext address in the list). If any error is
detected the non-volatile child info is refreshed (erased and
re-written).
This commit adds code in `NcpFrameBuffer` to check and limit the
number of segments in a frame (being read). This is to help detect
cases where the underlying buffer may get corrupted.
This commit makes the following fixes:
- Relax the length check in `RemoveStoredChild()`
- Remove children that do not match router ID
- Simplify restoring logic and remove `mIsRouterrestoringChildren` state var
This commit adds a new class `OwnerLocator` which is used by the
callback providing types (like `Timer` or `Tasklet`) to remember the
owner of the object. This change help simplify the handling of
callbacks from such objects. The object itself can be used to get
to its owner using `GetOwner<Type>()` method. If support for multiple
OpenThread instances is enabled, an `OwnerLocator` object maintains a
pointer to the owner. But for the single OpenThread instance scenario,
the owner is derived from the single `ot::Instance` object.
Thread (and OpenThread) does not employ any form of transmit power control.
As a result, while OpenThread provides APIs to control transmit power, it
simply buffers and passes the transmit power value straight through to the
radio.
Currently, the transmit power APIs allow specifying an int8_t in units of
dBm. This is overly constraining for platforms that have more advanced ways
of configuring the transmit power.
This commit removes the transmit power configuration from the core. This
provides better flexibility in platform-specific ways to configure transmit
power.
* [core] Make CLI buffer sizes configurable.
At the moment, we allocate 512 bytes for a receive buffer and 1kB for
transmit, which while it doesn't seem a lot, is in fact a big commitment
for a CLI interface. In cases where the platform does its own
buffering, this can be significantly reduced.
These add definitions that mirror the current settings so they may be
changed.
* [cli] Define UART buffers according to config.
Use the definitions produced in the previous commit to set the buffer
sizes.
* [core, cli] Rename OPENTHREAD_CONFIG_CLI_LINE_LENGTH
to `OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH` as per review in pull request 2351.
This commit adds a new field `mIsStateRestoring` to `otChildInfo`
struct to inform the if the child is being restored. This field is
used in `NcpBase` to filter child entries in restoring state.
This commit adds new spinel properties related to Thread Operational
Dataset and implements the corresponding get/set handlers for the
new properties in `NcpBase`.
This commit makes the following changes: It defines the public
`otInstance` as an empty opaque structure which is used by all public
C OpenThread APIs. It defines a new class `ot::Instance` (inheriting
from `otInstance) which is then used in core source files. The
functionality related to the instance is also moved/added into the
newly added `Instance` class (as class/static or member methods).
There may be short windows where a device does not have the proper Thread
Network Data. For example, when a device is coming out of reset and
resynchronizing with the rest of the network.
This commit suppresses MLE Data Response transmissions while the device is
trying to receive the latest Thread Network Data from a neighbor. This
eliminates the possibility that the device may propagate inconsistent
Thread Network Data.
This commit fixes spurious failures in Cert_9_2_15_PendingPartition.py.
Initially fixed size 8k was allocated for stack.
As result there was almost no free RAM. This
change creates stack on all free RAM.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
This commit adds support for encoding/decoding `uint64_t`/`int64_t`
to spinel as primitive types. `X` and `x` are used as format ASCII
character associated with `uint64_t` and `int64_t` respectively.
This commit also updates the `SpinelEncoder` and `SpinelDecoder`
to add methods related to 64-bit long integer. The related unit test
are also updated.
This commit adds new public OpenThread API to set a callback for user
to be notified when a child table entry is being added or removed. This
callback provides info about the child entry and is always invoked before
the `otStateChangedCallback`.
This commit also updates the `NcpBase` implementation to use the new
callback and emit a `VALUE_INSERTED` or `VALUE_REMOVED` async spinel
frame to host whenever child table gets updated. If the async spinel
frame can not be sent (running out of NCP buffer space), an async
`LAST_STATUS(NOMEM)` spinel frame is sent and the entire child table
is sent later (when buffer becomes available) as an async `VALUE_IS`
spinel message.
This commit fixes an overflow issue when forming the Address Registration
TLV within an MLE Child ID Response message. The overflow can cause the
resulting message to be malformed.
This commit adds a new property `SPINEL_PROP_THREAD_ROUTER_TABLE` and
its corresponding get handler to `NcpBase`. The spinel documentation
is also updated. Some of the documentations for the related APIs are
also updated.
The MLE attach logic would only execute if no MLE Parent Response messages
were received and assumed that a Child ID Request/Response exchange would
eventually succeed if an MLE Parent Response message was received.
This commit moves that logic to when an MLE Parent Response is received but
a Child ID Request/Response exchange fails.
This commit changes the order of member variable declarations in
certain classes to group them by size/alignment requirement and
also to avoid having the first member variable of class to inherit
from `InstanceLocator` for a class which its itself a sub-class of
`InstanceLocator` (this is to avoid extra memory padding added for
empty base class).
This commit also re-defines some of the public member variables in
`Ip6` and `Commissioner` classes as a private and provides getter
methods to access them.
This commit changes the model for OpenThread classes so that all
classes track/locate their owning/parent `otInstance` object (i.e.,
the owning `otInstance` object reference is expected to be passed as
an input argument in the object constructor). This replaces and
simplifies current model where some of classes track/locate the parent
`ThreadNetif`, `MeshForwarder`, or `Ip6` object references instead.
This helps harmonize the model across OpenThread source and also
simplify the `Locator` class implementation.
Millisecond and microsecond timers used by OpenThread can overflow during
application run. This commit sets RTC Compare Channel to correct value
after overflow.
This commit changes/fixes the `MeshForwarder::RemoveMessages()` to
check if the message being removed is the current indirect message
stored in child entry and if so, we ensure to clear the pointer in the
entry. It also adds a new private method in `MeshForwarder` called
`RemoveMessageFromSleepyChild()` to refactor the common code used in
both `RemoveMessage()` and `RemoveMessages()`.
This commit simplifies the config header files includes in
OpenThread core and non-public source files. With this change the
"openthread-core-config.h" becomes the main config header file. This
header file includes all other config ones:
1) The `configure` generated `<openthread/config.h>;
2) The project specific one by `OPENTHREAD_PROJECT_CORE_CONFIG_FILE`;
3) The "openthread-core-default-config.h" defining default settings.
With the change in this commit, all header files include "openthread-
core-config.h" as the first `#include`, and in `.cpp` files, the first
`#include` continues to be the unit's corresponding header file. The
new model ensures that the configuration settings are visible and
consistent in all the source files. This commit also updates the
style guide document accordingly.
This commit changes how the outbound datagram IPv6 messages (going
from NCP to host over spinel) are handled. If NCP spinel buffer is
full, new outbound messages are saved in a message queue and are
transfered later (as soon as buffer space becomes available). This
ensures that outbound IPv6 messages are never dropped due to spinel
NCP buffer being full.
To realize this, the following changes are made in this commit: (a)
The behavior of methods `NcpFrameBuffer::InFrameFeedMessage()` and
`SpinelEncoder::WriteMessage()` is changed so that the passed-in
message ownership changes to NCP buffer ONLY when the entire spinel
frame is written and the frame is successfully ended/finished. If the
spinel frame gets discarded (e.g. no buffer space) the caller continues
to own the message instance and should either free or save it. (b)
The unit test `test_ncp_buffer` is changed to address and check for
this change. (c) The `NcpBase::HandleDatagramFromStack()` is modified
to implement/use a message queue to save outbound messages and try again
to send the queued messages from `HandleFrameRemovedFromNcpBuffer()`
callback (when spinel buffer becomes available).
This commit adds a new class `SpinelDecoder` which provides a set of
methods/APIs to help in decoding/reading content using Spinel formating
(it is practically a C++ wrapper over Spinel C APIs). A unit test
`test_spinel_decoder` is also added in this commit.
This commit also updates the `NcpBase` implementation to adopt the new
`SpinelDecoder` class mainly in set, insert, and remove handlers
for different Spinel properties. The new class provides similar advantage
as `SpinelEncoder` by simplifying the handler implementations and adding
type-check safety when parsing/reading the spinel frame.
This commit updates the `MessageQueue` implementation to allow
messages to be added to head/front of the queue. It adds new methods
to the `MessageQueue` class and a corresponding one in public
OpenThread APIs (`otMessageQueueEnqueueAtHead()`). This commit also
updates the `test_message_queue` unit test to add cases/scenarios for
testing the new methods and public APIs.
While the previous partition ID is stored in non-volatile memory, the last
known router ID sequence for that previous partition is not. As a result,
a node coming out of reset that initially fails to reattach to the previous
partition may not be able to reattach until the router ID sequence value
wraps. This commit also limits the time window with which to avoid the
previous partition ID.
Before rotating the key sequence counter, there is a check against the key
rotating guard time. The key switch guard time is intended to prevent
the key sequence counter from advancing too quickly. However, the existing
implementation only allowed the key sequence counter to increment if the
key switch guard time had *not* expired. Because the key rotation period
is larger than the key switch guard time, the key would never rotate.
This commit fixes the logic to check if the key switch guard time *has*
expired, when performing a key rotation.
This commit adds a new class `SpinelEncoder` which provides a set of
methods/APIs to help in encoding/writing content using Spinel formating
(it is practically a C++ wrapper over Spinel C APIs). A unit test
`test_spinel_encoder` is also added in this commit.
This commit also updates the `NcpBase` implementation to adopt the new
`SpinelEncoder` class mainly in implementation of get, insert, and
remove handlers for different Spinel properties. The new class
provides the following advantages: (a) it simplifies the
implementation of handers, particularly get-handlers for properties
with a single type output; (b) it adds type-checking and type-safety
when frames are being created, e.g., if the Spinel format expects a
`SPINEL_DATATYPE_UINT8` but a `uint16_t` value is provided, the new
model will cause a compile-time error (few instances in code where the
types did not match are fixed in this commit).
* New Platform Startup
* Flash memory handling improved
* Ramdom generator improved
* Faster platform reboot
* UART based on interrupts intruduced
* ARM core and linker related files moved to "third_party" folder
* Radio Sleep Fixed
* TLS config fixed
* Software FIFO for UART added
Due to the nature of how frames can be processed in ncp_uart.cpp, it is possible for a call to otPlatWakeHost to execute before the SPINEL_PROP_HOST_POWER_STATE response message has been sent to the host. This order is unexpected and not sufficient for proper operation. Instead the call to otPlatWakeHost should only occur after the SPINEL_PROP_HOST_POWER_STATE response message has been sent and only when a new subsequent message has been made ready for delivery over the UART.
To solve this, the change below detects when the SPINEL_PROP_HOST_POWER_STATE response message has been completely written to mUartBuffer and immediately calls otPlatUartSend() when this condition is met. With this change the expected order of operations can be maintained.
This commit adds logic to inspect forwarded frames and update the address
cache. If an entry exists for the given IPv6 Source Address and the
RLOC16 source differs, the address cache entry is updated.
This change addresses an input validation error when parsing malformed
Spinel string fields. This change may have security implications.
This change also proactively adds an additional sanity check on the
size of the data buffers being passed to the pack/unpack functions,
limiting the maximum input size to 32767 bytes.
With the Spinel data packing format, fields with the type `U` are
zero-terminated strings. Failure to zero-terminate a string is a
syntax error that usually causes `spinel_datatype_vunpack_` to
explicitly fail. However, if there were no bytes left in the unparsed
data buffer when the parser gets to parsing a string field, then this
condition is triggered and undefined behavior results.
This bug could allow an attacker that is already in control of either
the NCP or the host to bypass the zero-termination check on a Spinel
string field, leading to undefined behavior on the other device and,
most likely, Denial Of Service. Note that if an attacker has already
compromised either the NCP or the host, the ability of the attacker to
deny service is a foregone conclusion.
This bug is not a buffer-overflow: this bug results in a garbage
string with no explicit zero termination being returned to the caller.
Such strings usually lead to crashes, not code execution. However, it
is not immediately clear that this bug couldn't be cleverly exploited
in such a way as to enable remote code execution. If such a method was
found this bug would be a vector for a compromised NCP to compromise
the host, and vise versa.
The Thread 1.1.1 Specification currently defines a "singleton" as a Thread
network partition that consists of a single router that has no
router-eligible end device children. At the same time, Thread 1.1.1 does
not provide a way for a router to decipher between a Full End Device (FED)
and a router-eligible end device (REED). This ambiguity can cause two
partitions to avoid merging, since each partition may determine that they
are higher priority than the other.
This commit makes the change to counting only active routers, which
eliminates the ambiguity above.
This commit re-arranges some of the OpenThread configuration
definitions in `openthread-core-default-config.h` such that all the
log related options are close to each other. It also moves the
verification of debug uart dependency into the `logging.cpp` file
Message buffer allocation can fail if there are no available message
buffers. Without a way to evict messages, critical messages (i.e. MLE
Advertisements) needed to maintain the Thread network cannot be generated.
This commit takes a first step towards evicting queued message buffers. In
particular, this commit evicts indirect messages from the head of queue
until there are enough available buffers.
Future commits will seek to implement fairness and priority mechanisms to
better select which messages are evicted from the send queue.
`InformPreviousParent()` uses `Ip6::SendDatagram()` to submit an IPv6
datagram with no next header. However, if `Ip6::SendDatagram()` returns
an error, custody of the message buffer remains with the caller. This
commit ensures the message buffer is properly freed in this case.
This commit updates the `otNetworkDataIterator` to also store the
sub-tlv offset (in addition to main prefix tlv offset and the entry
index). It also updates two methods `GetNextExternalRoute()` and
`GetNextOnMeshPrefix()`. This commit also adds network data unit
test module.
Add a fuction in node.py node_cli.py to node's address.
Add a module command to verify commands.
Spinel-cli.py doesn't request address for dhcp prefix now, so put
Cert_5_2_05_AddressQuery.py in XFAIL on ncp.
This commit adds a new feature for a child to inform its previous
parent when it attaches to a new parent. OpenThread config option
`CONFIG_INFORM_PREVIOUS_PARENT_ON_REATTACH` controls the behavior of
this feature (default is disabled). If this feature is enabled, after
a device attaches to a new parent, it sends an IP message (with empty
payload) to its previous parent.
This commit adds logic to inspect frames being forwarded to determine if
a child has moved to a different parent. If the message was received from
a neighboring router and the IPv6 source address matches that of a child,
the child is assumed to have moved and invalidated.
The Delay Timer value has a 32-bit range. However, the current Timer
implementation does not support the full 32-bit range.
This commit fixes the handling of large Delay Timer values by splitting
the delay across multiple timer triggers.
Credit to OSS-Fuzz.
This commit adds additional check in `MleRouter::RestoreChildren()`
method for repeating/duplicate child entries (child entries with
same extended address) when restoring child table from non-volatile
memory. If there are more than one entry, the last one will be used.
This commit updates the behavior of `ENABLE_BEACON_RSP_WHEN_JOINABLE`
feature. When this feature is enabled, the device will transmit IEEE
802.15.4 Beacons in response to IEEE 802.15.4 Beacon Requests even
while the device is not router-capable and detached.
This commit adds 3 new configurations to travis test build under the
BUILD_TARGET posix. The first two are representatives of common router
and SED devices. The last configuration disables all features.
Also add a method last_mle_message to find the newest mle; Add a method assertAssignedRouterQuantity to confirm if Leader contains the Route64 TLV with 32 assigned router IDs.
Previous behaviour of the joiner would result in the joiner joining
the network with the highest channel number, rather than the most
suitable. This commit utilizes the priority specified in thread spec
1.1.1 section 8.4.4.1.2 to choose the most suited network for joining.
This removes the bug where it would be impossible to join the desired
network due to another network on a higher channel allowing all joiners
in the steering data.
This commit fixes an issue with the `NcpUart::EncodeAndSendToUart()`
code where the last message can be removed from `mTxFrameBuffer`
and if we ran out of buffer and cannot finalize the HDLC encoded
frame, the final bytes would not be sent until next message is
queued in `mTxBuffer`.
This commit increases the time in waiting for a child to reattach. This
reflects the recent change to add retransmissions to the MLE Child Update
Request message.
This commit fixes a bug when a child coming out of reset attempts to
re-establish the link to its parent. Upon coming out of reset, a child
will restore state from non-volatile memory, including its IEEE 802.15.4
Short Address. If the child fails to receive an MLE Child Update Response,
it begins the normal MLE Attach process in search for a new parent. However,
prior to this commit, the device would not reset its state back to the
detached state. As a result, a child may be stuck sending IEEE 802.15.4
Data Request messages using its old (probably invalid) Short Address.
This commit also enables retransmission of MLE Child Update Request
messages immediately after a reset. This increases the child's likelihood
of maintaining its existing parent, which is a desirable property in Thread.
This commit fixes a bug in SecureCoap encountered when testing commissioning.
A little bit of background - after GetOwner method in CoAP was introduced, a problem with a static handler of mRetransmissionTimer showed up. In single instance mode, whenever retransmission timer striked, static GetOwner method from Coap class was called, regardless if the timer was a member of a Coap or SecureCoap class.
As there are separate instances for Coap and SecureCoap: mCoap and mCoapSecure, the former one was always returned. In result, there was no chance to handle messages queued for retransmission in an instance of SecureCoap. This resulted in commissionig failure in case a retransmission of JoinerFinalize message was needed.
The same pattern would apply for any class that uses inheritance and uses GetOwner in static handlers.
This fix extends the Coap constructor with an optional parameter -aRetransmissionHandler. This way, SecureCoap instances can register their own static timer handler and thereby use correct GetOwner funcion.
Certain multicast addresses like "ff02::01" (Link-Local All-Nodes)
are fixed and will not change. The commit defines them as constant
entries which are then appended into the `mMulticastAddresses`
linked-list.
This commit changes the external route lookup logic to ensure that if
an external route prefix is registered by multiple routers (at same
priority level) within the thread network, during route/destination
lookup on a device which has registered this external route, the
router itself is selected/preferred over other routers. This addresses
an issue where a message destined for the external address can be
passed back and forth between routers.
The Thread Specification requires the router to repeatedly transmit
new Thread Network Data to the SED until it receive an explicit
acknolwedgment from the SED. Prior to this commit, when network data
changes, a router attempts to update the SED by sending a single MLE
Data Response message. If the message is lost for any reason (e.g. no
available message buffers, link-layer delivery failure, etc.), the
router will not attempt to send the MLE Data Response again to update
the SED's network data.
This commit makes the following changes:
- The router communicates updated network data in an MLE Child Update
Request message, requiring the SED to send an MLE Child Update
Response message with the Leader Data TLV.
- The router repeatedly attempts to transmit new network data to the
SED until it receives a Leader Data TLV with the updated version.
Child IDs are assigned when receiving a Child ID Request. Prior to this
commit, a new Child ID is assigned whenever the child state is not valid.
A router stores state about its attached children in non-volatile memory.
On a reboot, the router attempts to restore its child links. As a result,
it is possible for the child to be assigned a new Child ID while it is
being restored.
With this commit, a router only assigns a new Child ID if there is no
existing Child ID state for the given child.
This commit changes the error type returned from `VALUE_IS` and
`VALUE_REMOVE` spinel commands. If a `VALUE_REMOVE` is issued where the
item being removed is not in the list, instead of passing up `NOT_FOUND`
error, a `LAST_STATUS` with `STATUS_OK` is used. Similarly the behavior
is changed for the `VALUE_INSERT` operation and error status `ALREADY`.
This change helps ensure driver/user considers the operation as a
success while still being able to distinguish (if required) whether
the value was actually removed by checking if we get a `VALUE_REMOVED`
response versus `LAST_STATUS(OK)` response.
This commit ensues that some properties/methods which are defined
under "raw-link-api" feature only are also `#ifdef`ed in the
lookup entry table definitions.
Another change is related to `HandleRawFrame()` method which is
used/needed for packet capture independent of "raw-link-api"
feature.
The same external route or on-mesh prefix can be registered by
different devices with different flags (e.g., different preference
level). This info is stored in network data as part of the
BorderRouterEntry TLV. This commit changes the methods
`GetNextOnMeshPrefix()` and `GetNextExternalRoute()` to ensure that
different entries corresponding to the same prefix are provided
separately when iterating over all entries (i.e., without giving
a specific RLOC16).
To implement this the `otNetworkDataIterator` is changed to track
both the index into the `mTlvs` buffer and the entry index.
This commit also appends an RLOC16 field to the struct packing
format of `SPINEL_PROP_THREAD_ON_MESH_NETS and `OFF_MESH_ROUTES`
spinel properties and updates the implementation and documentation
accordingly.
Updated cc2650 and cc2652 platforms to place ieee ack frame types in the
RX queue and to propagate those frames to the higher level.
Initialize extra RX buffers.
This commit applies the patch directly to checked-in source files rather
than at build time. This commit helps to simplify the build process.
This commit also introduces a shell script that allows anyone to reproduce
the patched mbedtls source.
This commit:
- Enables Thread-related protocols and sets the device role state to Leader
in fuzz tests.
- Bypasses AES-CCM decryption and authentication in fuzz tests.
This commit makes the following changes:
1. Check return value of SetLength() when forming a RLY_TX.ntf message.
2. When accepting data to transmit from mbedtls, only free the message
buffer if the message buffer is empty. Otherwise, attempt to transmit
the message buffer that was already formed.
3. When freeing the transmit message buffer for mbedtls, set the transmit
message buffer pointer to NULL.
This commit adjusts the order for calling radio layer API to make sure otPlatRadioEnable() is the first called to radio layer. This mainly addresses the issue of otInstance which is not provided when initializing radio layer.
In Mac::RadioReceive, Mac::RadioTransmit and Mac::RadioSleep, the
SuccessOrExit macro was being used in a way which skipped printing
an error message upon failure, and printed it for OT_ERROR_NONE.
This commit contains different changes and enhancement to MAC
layer implementation.
It changes how the MAC layer maintains its operations. It is ensured
that only a single operation is active at a time.
An operation can be:
- active or energy scan,
- beacon or data frame transmission,
- waiting for data (after data poll ack with frame pending), or,
- idle operation (where radio is put in either rx or sleep mode).
Method `StartOperation()` starts an operation and `FinishOperation()`
is used to indicate when is is done. If there is an ongoing operation,
a subsequent call to `StartOperation()` ensures that the next
operation is marked as pending and gets started after the current one
is finished.
This commit also changes the `StartCsmaBackoff()` implementation such
that the radio is put in either receive or sleep mode depending on the
state `mRxOnWhenIdle` before starting the backoff timer. This ensures
that on a sleepy device the radio is put to sleep while backing off for
all transmission attempts including any MAC retries.
Another change added in this commit is to allow a received data frame
to be processed during an ongoing active/energy scan only if the
current scan channel matches the receive channel.
This commit also update `Mac::Frame` class by adding a new helper
method `IsDataRequestCommand()` to indicate if the frame is a MAC Data
Request command (data poll).
This commit removes the deprecated API otPlatRadioTransmitDone() to prevent new platforms using this API.
Some platforms still uses the deprecated API. This commit generates ACK frame according to the Frame Pending flag and the sent frame.
This commit does not define an API for generating ACK frame because the frame should not be generated by sender. Platforms not passing the received ACK frame should remove the code generating ACK frame soon.
This commit also fixes the build failures on the gp712 platform.
This commit changes the `InstanceLocator` class to keep track of a
reference to `otInstance` (instead of a pointer) to make it behave
similar to other `ObjectLocator` classes. The method `GetInstance()`
in all locator objects is updated to provide a reference (instead
of a pointer) to `otInstance`.
The logging macros are updated such that a reference to `otInstance`
is passed as the first argument (with the exception of
`otLog<Level>Plat()` macros which are used by platform code in C
domain). The documentation for log macros are also updated.
This commit fixes an issue related to the OpenThread feature
`OPENTHREAD_CONFIG_STAY_AWAKE_BETWEEN_FRAGMENTS` to ensure that
`mDelaySleep` flag is cleared after timer starts so that sleep is
delayed only once.
* Add support for cc2652
Updated CC26XXware to latest release.
Moved CC26XXware to match the SimpleLink cc26x2 SDK directory structure.
Added CC2652 Platform support
This commit changes how the link-local and the realm-local all-thread
multicast addresses are maintained. A change in mesh-local prefix
triggers a re-calculation of multicast addresses. When such a change
happens the old addresses are first removed/unsubscribed from the
interface and then the new ones are subscribed to. This ensures that
`OT_CHANGED_IP6_MULTICAST_(UN)SUBSRCRIBED` flags are set properly and
host/user is informed of the change of the multicast addresses.
This commit adds a new API `otInstanceIsInitialized()` to check if a
given instance is valid, i.e, it has been initialized and not
finalized. We then use this function to verify that passed-in instance
argument in platform callbacks is valid.
Then sniffer devices could provide precise timestamp for each frame.
* The timestamp information is included in the metadata's PHY-specific data field of PROP_STREAM_RAW;
* nRf52840 supports microsecond accuracy timestamp;
* The other platforms support millisecond accuracy timestamp since they don't support microsecond timer for now.
This commit adds new `InFrame` related methods to `NcpFrameBuffer` to
allow user to get/save current write position in an input frame being
written to the buffer. The saved position can later be used to
overwrite the previously added content (using `InFrameOverwrite()`) or
discard a portion of written data and move the write pointer back to
the saved position (using `InFrameReset()`).
The unit test for NCP buffer is also updated to add new test-cases
specific for the newly added methods.
This commit implements a new model for keeping track of unsolicited
property updates and how asynchronous `VALUE_IS` spinel frames are
emitted from NCP. It also implements a mechanism for host to block
updates from certain filterable properties. The behavior can be
controlled through spinel properties `UNSOL_UPDATE_FILTER` and
`UNSOL_UPDATE_LIST` (tied to capability `CAP_UNSOL_UPDATE_FILTER`).
The new model is then used to track dropped IPv6 messages, end of
scan, change in jamming state, and a newly added STATUS_NOMEM report
in case of no NCP buffer space for log messages.
This commit adds a new spinel property (along with its prop handlers)
`SPINEL_PROP_IPV6_MULTICAST_ADDRESS_TABLE` to provide the list of
multicast IPv6 addresses.
It also adds `OT_CHANGED_IP6_MULTICAST_SUBSRCRIBED` and
`OT_CHANGED_IP6_MULTICAST_UNSUBSRCRIBED` to flags used in
`NetifCallback` to indicate changes in multicast address list.
GitHub Issues are for bugs and feature requests. To make bugs and feature requests more easy to find and organize, we close issues that are deemed out of scope for GitHub Issues.
GitHub Issues are for bugs and feature requests. To make bugs and feature requests more easy to find and organize, we close issues that are deemed out of scope for GitHub Issues.
Usage questions? Post questions to [Stack Overflow](http://stackoverflow.com/) using the [[openthread] tag](http://stackoverflow.com/questions/tagged/openthread). We also use Google Groups for discussion and announcements:
* [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) - subscribe for release notes and new updates on OpenThread
* [openthread-users](https://groups.google.com/forum/#!forum/openthread-users) - the best place for users to discuss OpenThread and interact with the OpenThread team
* [openthread-devel](https://groups.google.com/forum/#!forum/openthread-devel) - team members discuss the on-going development of OpenThread
The openthread-users Google Group is the recommended place for users to discuss OpenThread and interact directly with the OpenThread community. https://groups.google.com/forum/#!forum/openthread-users
[$BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-ncp ]||{
[$BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-app-cli -a $BUILD_TARGET != posix-mtd -a $BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ]||{
pip install --upgrade pip || die
pip install --user -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
[$BUILD_TARGET != posix-ncp ]||{
pip install -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
[$BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ]||{
# Packages used by ncp tools.
pip install --user git+https://github.com/openthread/pyspinel || die
pip install git+https://github.com/openthread/pyspinel || die
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
@@ -70,22 +100,34 @@ cd /tmp || die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != arm-gcc54]||{
[$BUILD_TARGET != arm-gcc-5 ]||{
sudo apt-get install lib32z1 || die
wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != arm-gcc63]||{
[$BUILD_TARGET != arm-gcc-6 ]||{
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH|| die
arm-none-eabi-gcc --version || die
wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2017.03-rc2/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install.tar.gz || die
tar xzf arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install.tar.gz
exportPATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/bin:$PATH|| die
arc-elf32-gcc --version || die
}
[$BUILD_TARGET !=posix-32-bit]||{
[$BUILD_TARGET !=arm-gcc-7]||{
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-mtd ]||{
scan-build --status-bugs -analyze-headers -v make || die
}
[$BUILD_TARGET != arm-gcc49]||{
[$BUILD_TARGET != android-build]||{
(cd .. &&${TRAVIS_BUILD_DIR}/.travis/check-android-build)|| die
}
[$BUILD_TARGET != arm-gcc-4 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH|| die
git checkout -- . || die
@@ -101,11 +111,21 @@ set -x
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-nrf52840 || die
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1LINK_RAW=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
@@ -113,9 +133,30 @@ set -x
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
}
[$BUILD_TARGET != arm-gcc54]||{
[$BUILD_TARGET != arm-gcc-5 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH|| die
git checkout -- . || die
@@ -148,11 +189,21 @@ set -x
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-nrf52840 || die
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
@@ -160,9 +211,106 @@ set -x
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
}
[$BUILD_TARGET != arm-gcc63]||{
[$BUILD_TARGET != arm-gcc-6 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2538 || die
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-kw41z || die
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
exportPATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/bin:$PATH|| die
git checkout -- . || die
@@ -175,16 +323,155 @@ set -x
arc-elf32-size output/emsk/bin/ot-ncp-mtd || die
}
[$BUILD_TARGET != arm-gcc-7 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2538 || die
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-kw41z || die
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1UDP_PROXY=1 make -f examples/Makefile-nrf52840 || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
# git checkout -- . || die
# git clean -xfd || die
# wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
# unzip -qq asf-standalone-archive-3.36.0.58.zip || die
# mv xdk-asf-3.36.0 third_party/microchip/asf || die
# ./bootstrap || die
# COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
# arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
# arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
# arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
# arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
}
[$BUILD_TARGET != posix ]||{
sh -c '$CC --version'|| die
sh -c '$CXX --version'|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-posix || die
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_NONE make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--with-ncp-bus=spi \
--with-examples=posix \
--enable-border-router \
--enable-child-supervision \
--enable-diag \
--enable-jam-detection \
--enable-legacy \
--enable-mac-filter \
--enable-service \
--enable-channel-manager \
--enable-channel-monitor \
--disable-docs \
--disable-tests || die
make -j 8|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-mtd \
--with-ncp-bus=spi \
--with-examples=posix \
--enable-border-router \
--enable-child-supervision \
--enable-legacy \
--enable-mac-filter \
--enable-service \
--disable-docs \
--disable-tests || die
make -j 8|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--enable-radio-only \
--with-ncp-bus=uart \
--with-examples=posix || die
make -j 8|| die
}
[$BUILD_TARGET != posix-distcheck ]||{
exportASAN_SYMBOLIZER_PATH=`which llvm-symbolizer-3.4`|| die
exportASAN_SYMBOLIZER_PATH=`which llvm-symbolizer-5.0`|| die
exportASAN_OPTIONS=symbolize=1|| die
exportDISTCHECK_CONFIGURE_FLAGS=CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1|| die
./bootstrap || die
make -f examples/Makefile-posix distcheck || die
}
@@ -194,12 +481,41 @@ set -x
COVERAGE=1CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
}
[$BUILD_TARGET != posix-app-cli ]||{
./bootstrap || die
# enable code coverage for OpenThread transceiver only
COVERAGE=1VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
COVERAGE=1 make -f src/posix/Makefile-posix || die
COVERAGE=1PYTHONUNBUFFERED=1OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli)"RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-ncp-radio)" make -f src/posix/Makefile-posix check || die
}
[$BUILD_TARGET != posix-app-pty ]||{
.travis/check-posix-app-pty || die
}
[$BUILD_TARGET != posix-mtd ]||{
./bootstrap || die
COVERAGE=1CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
}
[$BUILD_TARGET != posix-ncp-spi ]||{
./bootstrap || die
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp-app=ftd --with-ncp-bus=spi --with-examples=posix --with-platform-info=POSIX"|| die
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp --enable-ftd --with-ncp-bus=spi --with-examples=posix"|| die
}
[$BUILD_TARGET != posix-app-ncp ]||{
./bootstrap || die
COVERAGE=1VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
# enable code coverage for OpenThread posix radio
COVERAGE=1 make -f src/posix/Makefile-posix || die
COVERAGE=1PYTHONUNBUFFERED=1OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)"RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-ncp-radio)"NODE_TYPE=ncp-sim make -f src/posix/Makefile-posix check || die
}
[$BUILD_TARGET != posix-ncp ]||{
./bootstrap || die
COVERAGE=1NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
COVERAGE=1PYTHONUNBUFFERED=1NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
@@ -104,7 +104,7 @@ Now, it may be desirable to squash some of your smaller commits down into a smal
```bash
# Rebase all commits on your development branch
git checkout
git checkout
git rebase -i master
```
@@ -112,15 +112,14 @@ This will open up a text editor where you can specify which commits to squash.
#### Coding Conventions and Style
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party).
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party). Use the `make pretty` and `make pretty-check` targets to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1) for `make pretty` and `make pretty-check`.
As part of the cleanup process, you should also run `make pretty-check` to ensure that your code passes the baseline code style checks.
**...an open-source implementation of the [Thread](http://threadgroup.org/technology/ourtechnology) networking protocol.** Nest has released OpenThread to make the technology used in Nest products more broadly available to developers to accelerate the development of products for the connected home.
**...OS and platform agnostic**, with a narrow platform abstraction layer and a small memory footprint, making it highly portable.
**...OS and platform agnostic**, with a narrow platform abstraction layer and a small memory footprint, making it highly portable. It supports both system-on-chip (SoC) and network co-processor (NCP) designs.
**...a Thread Certified Component**, implementing all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications). This specification defines an IPv6-based reliable, secure and low-power wireless device-to-device communication protocol for home applications.
**...a Thread Certified Component**, implementing all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications), including all Thread networking layers (IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, Mesh Routing) and device roles, as well as [Border Router](https://github.com/openthread/borderrouter) support.
More information about Thread can be found on [threadgroup.org](http://threadgroup.org/).
More information about Thread can be found at [threadgroup.org](http://threadgroup.org/). Thread is a registered trademark of the Thread Group, Inc.
Want to try OpenThread? The quickest way to get started is to run through our [Simulation Codelab](https://codelabs.developers.google.com/codelabs/openthread-simulation/index.html), which covers all the basics, without the need for test hardware. Using VirtualBox and Vagrant on a Mac or Linux machine, you will learn:
* How to set up the OpenThread build toolchain
* How to simulate a Thread network
* How to authenticate Thread nodes with Commissioning
* How to use `wpantund` to manage a simulated Thread network featuring an NCP
### Next Steps
The Codelab shows you how easy it is use to OpenThread to simulate a Thread network. Once complete:
1. Learn more about the [OpenThread architecture and features](#openthread-features)
1. Get familiar with [platforms and devices that support OpenThread](#who-supports-openthread)
1. See what [testing tools](#what-tools-are-available-for-testing) are available
1. Learn [where to get help](#need-help) and [how to contribute](#want-to-contribute) to the ongoing development of OpenThread
# OpenThread Features
OpenThread implements all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications), including all Thread networking layers (IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, Mesh Routing) and device roles, as well as [Border Router](https://github.com/openthread/borderrouter) support.
OpenThread supports both system-on-chip (SoC) and network co-processor (NCP) designs. Other features and enhancements include:
* Thread Border Agent to support an External Commissioner
* NAT64 for connecting to IPv4 networks
* Thread interface driver using `wpantund`
### What's coming?
The development of OpenThread is ongoing to provide additional features not available in the standard. Check back regularly for new updates, or visit the [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) Google Group.
# Who supports OpenThread?
Led by Nest, the following companies are contributing to the ongoing development of OpenThread:
OpenThread has been ported to several devices and platforms by both the OpenThread team and the community. Build examples for all supported platforms are included in the OpenThread project.
# Getting started
### IEEE 802.15.4 Platform Support
All end-user documentation and guides are located at [openthread.io](https://openthread.io). If you're looking to do things like...
*Learn more about OpenThread features and enhancements
*Use OpenThread in your products
*Learn how to build and configure a Thread network
*Port OpenThread to a new platform
*Build an application on top of OpenThread
*Certify a product using OpenThread
See the [Wiki Platform page](https://github.com/openthread/openthread/wiki/Platforms) for more detailed information on supported platforms.
...then [openthread.io](https://openthread.io) is the place for you.
### Desktop Support
If you're interested in contributing to OpenThread, read on.
Desktop platforms can also be used to control and interface with a Thread network using OpenThread:
# Contributing
* **Unix** — [`wpantund`](https://github.com/openthread/wpantund) provides an interface to an NCP
* **Windows 10** — [universal drivers](https://github.com/openthread/openthread/wiki/OpenThread-on%C2%A0Windows) to interface with devices running OpenThread
We would love for you to contribute to OpenThread and help make it even better than it is today! See our [Contributing Guidelines](https://github.com/openthread/openthread/blob/master/CONTRIBUTING.md) for more information.
### Porting
If you are interested in porting OpenThread to a new platform, see the [Porting Guide](https://github.com/openthread/openthread/wiki/Porting-Guide) for hardware requirements and detailed porting instructions.
### Border Router
A Border Router connects a Thread network to networks at different layers, such as WiFi or Ethernet. [OpenThread Border Router](https://github.com/openthread/borderrouter) provides end-to-end IP via routing between Thread devices and other external IP networks, as well as external Thread Commissioning.
# What tools are available for testing?
### Certification Testing
Certification testing is done with the [GRL Thread Test Harness software](http://graniteriverlabs.com/thread/), available for download to Thread member companies.
Additional tools that extend the Test Harness are included in the OpenThread project:
* [Thread Harness Automation](https://github.com/openthread/openthread/tree/master/tools/harness-automation) — automates the Thread Test Harness software
* [Thread Harness THCI for OpenThread](https://github.com/openthread/openthread/tree/master/tools/harness-thci) — allows the Thread Test Harness to control OpenThread-based reference devices directly
* CC2538 example included in the GRL Thread Test Hardness software
* Library version can be modified by developers for use on other platforms
### Sniffer
OpenThread also provides a [sniffer](https://github.com/openthread/openthread/blob/master/tools/spinel-cli/SNIFFER.md) on the NCP build. The sniffer is exposed by the Spinel protocol and features:
* Monitor mode — capture packets during operation
* Promiscuous mode — dedicated sniffer
* Host-side support — `wpantund`
* pcap stream output
# Need help?
### Wiki
Explore the [OpenThread Wiki](https://github.com/openthread/openthread/wiki) for more in-depth documentation on building, testing, automation and tools.
### Interact
There are numerous avenues for OpenThread support:
* Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
* Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
* Google Groups — discussion and announcements
* [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) — release notes and new updates on OpenThread
* [openthread-users](https://groups.google.com/forum/#!forum/openthread-users) — the best place for users to discuss OpenThread and interact with the OpenThread team
### Directory Structure
The OpenThread repository is structured as follows:
`etc` | Configuration files for other build systems (e.g. Visual Studio)
`examples` | Sample applications and platforms demonstrating OpenThread
`include` | Public API header files
`src` | Core implementation of the Thread standard and related add-ons
`tests` | Unit and Thread conformance tests
`third_party` | Third-party code used by OpenThread
`tools` | Helpful utilities related to the OpenThread project
# Want to contribute?
We would love for you to contribute to OpenThread and help make it even better than it is today! See the [`CONTRIBUTING.md`](https://github.com/openthread/openthread/blob/master/CONTRIBUTING.md) file for more information.
Contributors are required to abide by our [Code of Conduct](https://github.com/openthread/openthread/blob/master/CODE_OF_CONDUCT.md) and [Coding Conventions and Style Guide](https://github.com/openthread/openthread/blob/master/STYLE_GUIDE.md).
# Versioning
@@ -180,6 +63,16 @@ OpenThread follows the [Semantic Versioning guidelines](http://semver.org/) for
# License
OpenThread is released under the [BSD 3-Clause license](https://github.com/openthread/openthread/blob/master/LICENSE). See the [`LICENSE`](https://github.com/openthread/openthread/blob/master/LICENSE) file for more information.
OpenThread is released under the [BSD 3-Clause license](https://github.com/openthread/openthread/blob/master/LICENSE). See the [`LICENSE`](https://github.com/openthread/openthread/blob/master/LICENSE) file for more information.
Please only use the OpenThread name and marks when accurately referencing this software distribution. Do not use the marks in a way that suggests you are endorsed by or otherwise affiliated with Nest, Google, or The Thread Group.
# Need help?
There are numerous avenues for OpenThread support:
* Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
* Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
* Google Groups — [discussion and announcements at openthread-users](https://groups.google.com/forum/#!forum/openthread-users)
The openthread-users Google Group is the recommended place for users to discuss OpenThread and interact directly with the OpenThread team.
- Preprocessor `#include` directives shall use brace (“<”) and (“>”) style for all public headers, including C and C++ standard library, or other first- and third-party public library headers.
- Preprocessor `#include` directives should use double quote (‘“‘) and (‘“‘) style for all private or relative headers.
- Preprocessor `#include` directives should be grouped, ordered, or sorted as follows:
-This compilation unit's corresponding header, if any.
-If the unit is a core/private header file, `"openthread-core-config.h"` should be the first header file included.
- If the unit is a core/private `.c` or `.cpp` file:
- If the unit has a corresponding header file, the unit's corresponding header file should be included before any other header file.
- If the unit has no corresponding header file, then it should directly include `"openthread-core-config.h"` before any other header file.
- C++ Standard Library headers
- C Standard Library headers
- Third-party library headers
@@ -111,6 +114,8 @@
- OpenThread uses the `make pretty` build target to reformat code and enforce code format and style. The `make pretty-check` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
- The `make pretty` and `make pretty-check` build targets require [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1).
### File Names
- File names should match the names and types of what is described in the file. If a file contains many declarations and definitions, the author should choose the one that predominantly describes or that makes the most sense.
- File contents and names should be limited in the scope of what they contain. It may also be possible that there is too much stuff in one file and you need to break it up into multiple files.
@@ -171,7 +176,7 @@
## Standards
- OpenThread uses and enfores both Python 2 and Python 3. Support for Python 2 is a result of the fact that some current Linux distributions and Macs are still using 2.x as default.
- OpenThread uses and enforces both Python 2 and Python 3. Support for Python 2 is a result of the fact that some current Linux distributions and Macs are still using 2.x as default.
* 10: `CAP_TRNG`: Support for true random number generation. See (#feature-trng).
* 11: `CAP_CMD_MULTI`: Support for `CMD_PROP_VALUE_MULTI_GET` ((#cmd-prop-value-multi-get)), `CMD_PROP_VALUE_MULTI_SET` ((#cmd-prop-value-multi-set), and `CMD_PROP_VALUES_ARE` ((#cmd-prop-values-are)).
* 12: `CAP_UNSOL_UPDATE_FILTER`: Support for `PROP_UNSOL_UPDATE_FILTER` ((#prop-unsol-update-filter)) and `PROP_UNSOL_UPDATE_LIST` ((#prop-unsol-update-list)).
* 13: `CAP_MCU_POWER_SAVE`: Support for controlling NCP's MCU power state (`PROP_MCU_POWER_STATE`).
* 16: `CAP_802_15_4_2003`
* 17: `CAP_802_15_4_2006`
* 18: `CAP_802_15_4_2011`
@@ -192,7 +193,7 @@ This value is encoded as an unsigned 8-bit integer.
The host **MUST** only use this property from NLI 0. Behavior when used
These components are the building blocks to get OpenThread integrated into the Windows
networking stack and provide an interface for applications to control it.
OpenThread includes Windows 10 drivers necessary for interfacing with UART NCP devices. The design allows for support of both simple radio devices and devices running the complete OpenThread stack.
> **NOTE:** OpenThread's Windows integration has not been actively maintained for some time. While Windows builds are still a part of OpenThread's continuous integration (CI), the Windows CI only tests basic compilation.
This design allows for support of both simple radio devices and devices running the complete
OpenThread stack.
To build locally using the Windows platform, use Visual Studio 2015. To build for the POSIX and TI CC2538 platforms, use Bash on Ubuntu on Windows.
### otApi.dll ###
All the following steps assume you have already cloned and checked out a branch.
This is the dynamic libray for applications to control the OpenThread stack from user mode. It
exposes all the control path APIs from `openthread.h`. It interfaces with the driver by the use
of [IOCTL][ioctl]s. The IOCTLs allow otApi.dll to serialize and send commands, and poll for notifications,
which can then be returned back to the client.
### Visual Studio 2015
### otLwf.sys ###
To build OpenThread on Windows you need to install the following:
This is where most of the real logic lives. `otLwf.sys` is an [NDIS][ndis] Light Weight Filter ([LWF][lwf]) driver.
It plugs into the networking stack, binding to a protocol driver (TCPIP) at the top, and an NDIS [Miniport][miniport]
at the bottom. It's job is to take IPv6 packets from TCPIP and pass the necessary data down to the Miniport
in order to send the packets out over the network.
* Any Visual Studio 2015 edition. The [Community](https://www.microsoft.com/en-us/download/details.aspx?id=48146) edition is free. Generally most of the optional features will be required.
* The [Windows 10 Driver Kit](https://go.microsoft.com/fwlink/p/?LinkId=526733).
`otLwf.sys` supports operating in two modes: Full Stack and Tunnel. Full Stack mode is where OpenThread is
running on the host (in Windows) and a simple radio device is connected externally. Tunnel mode is where
OpenThread is running on the external device and Windows is merely a pass through for commands and packets.
Once all these are installed, open the Solution file `etc/visual-studio/openthread.sln`. Select the Configuration and Platform (i.e. Release/x64) and then Build All (F6).
In both cases, `otLwf.sys` uses the Spinel command interface for interacting with the connected device. When operating
in Full Stack mode, `otLwf.sys` uses only the low level PHY/MAC commands. In Tunnel mode, it uses the higher layer
Spinel commands and lets the device manage the actual Thread stack.
### Bash on Ubuntu on Windows
### ottmp.sys ###
[Bash on Ubuntu on Windows](https://msdn.microsoft.com/en-us/commandline/wsl/about) is a new feature to Windows 10. To set it up, follow the steps [here](https://msdn.microsoft.com/commandline/wsl/install_guide). Other FAQs can be found [here](https://msdn.microsoft.com/en-us/commandline/wsl/faq).
This is the component responsible passing the Spinel commands from `otLwf.sys` down to the device. It is responsible
for abstracting the actual mechanism (USB, Serial, SPI) used for communicating with the device. It handles the device
arrival/removal and the encoding/decoding of data when communicating with it. The current implementation only handles
Serial devices.
Once installed, open the "Bash on Ubuntu on Windows" app. Do the following to install everything necessary to build OpenThread.
### Device ###
Make sure line ending are UNIX style:
Windows supports OpenThread devices that implement the Spinel protocol. It supports devices that support either the raw
link-layer PHY/MAC commands and devices that support the Thread commands (and devices that support both). By default,
Windows will operate in Full Stack mode, only sending raw link-layer commands.
```
git config core.autocrlf false
git rm --cached -r . && git reset --hard
```
Install the compilers:
```
apt install gcc
apt install g++
```
Install Python (with pexpect):
```
apt install python
apt install python-pip
pip install pexpect
```
To build the TI CC2538 platform, you need to install the correct toolchain:
```
add-apt-repository ppa:team-gcc-arm-embedded/ppa
apt-get update
apt-get install gcc-arm-embedded
```
Set up the build environment:
```
./bootstrap
```
### Platforms
Before building, manually configure features as desired. For example:
Microsoft has made available a test VHD specifically modified for virtually testing OpenThread. To get access, please email `nibanks` via his `@microsoft.com` email address.
Once the Windows VHD is loaded and you have gone through OOBE, see `C:\OpenThread\readme.txt` for additional instructions on how to set everything up.
> **Note:** Since none of the binaries mentioned below are production signed; you need to enable test signing on the machine: `bcdedit /set testsigning on`. All these binaries require Windows 10 at a minimum.
Since most of these drivers are still under development, it is recommended to also have a kernel debugger configured for the test machine.
### otlwf.sys & otapi.dll
The filter driver `otlwf.sys` exposes the IOCTL interface that `otapi.dll` uses and houses the bulk of the actual Thread logic. `otapi.dll` exposes the C interface for user mode applications to use to control the Thread interfaces.
1. Download the latest platform binary on AppVeyor:
1. Go to the [latest build](https://ci.appveyor.com/project/jwhui/openthread) page
1. Select the desired platform (x64, x86, arm)
1. On the platform page, select **ARTIFACTS**
1. Download the release.zip file for that platform
1. Extract the files to a temporary location
1. Open an admin command prompt in the temporary location
1. Run the `install_otlwf.cmd` file
1. On **non-IoT platforms**, install the [Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145)
1.**Note:** A reboot is required, but can be done after all installation is complete.
### ottmp.sys (Miniport for Serial Devices)
The miniport driver `ottmp.sys` binds to serial devices on the machine and exposes them to `otlwf.sys`. It is only needed if you are connecting to an actual device (such as the TI CC2538 or Nordic Semiconductor nRF52840 device).
1. Open an admin command prompt (same location as above).
1. Run the install_ottmp.cmd file.
1.**Note:** A reboot is required, but can be done after all installation is complete.
1. Once the test machine boots and the serial device is connected, manually restart the miniport so that it can find the serial device. **This will have to be done for every reboot**:
```
devcon.exe restart *ottmp*
```
### Command Line Tool Usage
The command line tool `otCli.exe` exposes many of the APIs in `otApi.dll` via the command line. It is included with the same release binaries downloaded above. See the [CLI example README](https://github.com/openthread/openthread/blob/master/examples/apps/cli/README.md) for more details.
The main differences between `otCli.exe` on Windows and the `ot-cli` on Linux, are the following:
* On Linux, the CLI runs the actual OpenThread stack in-proc. On Windows, it just provides an interface to control the OpenThread stack running either in the installed driver or on the physical device.
* On Windows, the CLI supports multiple interfaces simultaneously via the `instance` and `instancelist` commands.
The `instance` command allows for getting/setting the current instance that the rest of the commands act on.
The latest builds of the sample universal app can be downloaded from the [latest AppVeyor build](https://ci.appveyor.com/project/jwhui/openthread).
### Running Python Certification Tests
The Python certification tests approximate the testing done for real certification. On Windows they are run using virtual OpenThread devices. To set up the environment:
1. Install Python 3.6 to `C:\Python36` for all users. Make sure to add the install path to `PATH`.
1. Install the Python crypto libraries: `python.exe C:\Python36\Scripts\pip.exe install pycryptodome==3.4.3`
1. Copy Python cert scripts to the machine (to a 'scripts' folder)
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.