Commit Graph

302 Commits

Author SHA1 Message Date
Rongli Sun 77ea86302e [cli] add childip max command (#4759)
Thread 1.2 test harness requires the ability to set the number of IP
address the parent could store per child to test the reaction of the
Child DUT. The value intentionally may not conform to the Conformance
Specification. Since it is only used for reference device, this commit
wraps relevant APIs in the OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
macro.
2020-03-31 07:58:51 -07:00
Piotr Koziar d85c0007a1 [network-diagnostic] replace anonymous structs in netdiag.h (#4760) 2020-03-30 19:01:59 -07:00
kangping e28608cd0b [network-diagnostic] improve usability of Network Diagnostic API (#4619)
This commit improves usability of Network Diagnostic API by:

- Define native structures to represent various Network Diagnostic TLV
  values.

- Add facility function otThreadGetNextDiagnosticTlv to parse plain
  otMessage into structured data.

- Dump parsed DIAG_GET.ans/.rsp message in readable format for
  networkdiagnostic CLI command.
2020-03-26 13:43:40 -07:00
Rongli Sun 315a27bf08 [bbr] add backbone router service (#4430)
- Introduce BACKBONE_ROUTER option for Backbone Router function.
- Implement Backbone Router service registration.
  - Add basic Backbone Router service.
  - Primary Backbone Router restores its Dataset when reattached after
    short reset, increases sequence number and re-register to Leader.
  - Add configurable jitter for Backbone Router service registration.
- Add Backbone Router service test.
2020-03-26 08:54:23 -07:00
Jonathan Hui 8eeb1e83eb [cli] change aArgsLength type from int to uint8_t (#4718) 2020-03-23 00:12:09 -07:00
Jonathan Hui a6a93d688d [cli] change 'argc' -> 'aArgsLength', 'argv' -> 'aArgs' (#4718) 2020-03-23 00:12:09 -07:00
kangping 133ec09b80 [cli] return OT_ERROR_INVALID_ARGS for invalid arguments (#4639)
- Remove argument parsing failure from semantic of OT_ERROR_PARSE.

- Add OT_ERROR_INVALID_COMMAND to indicate invalid CLI command error.

- return OT_ERROR_INVALID_ARGS for invalid CLI arguments.
2020-03-19 10:51:42 -07:00
Rongli Sun 5d12c6247f [cli] add preferrouterid command (#4647) 2020-03-09 18:33:55 -07:00
Yakun Xu aa62fd8f65 [cli] always output command result (#4556)
Always output command result, i.e. "Done" on success, error message
otherwise.

Factory commands also follow the same pattern. Their existing error
messages are not removed for backward compatibility consideration.
2020-02-19 11:44:42 -08:00
Abtin Keshavarzian 253e99ba17 [cli] use ICMPv6 Echo Request ID to match Responses (#4534)
This commit updates/enhances the CLI `ping` command. It adds the
feature to track and match the ICMPv6 echo requests and responses
using an identifier. Each `ping` command will use a new value as the
identifier. A received ICMPv6 echo response not matching the current
identifier is ignored. This commit also makes the following (smaller)
changes:
- renames the ping related member variables as `mPing{Name}`,
- defines  constants for default ping parameters,
- changes `ping` to use public OT APIs/definition (instead of core
  methods).
2020-02-09 15:13:59 -08:00
Jonathan Hui 5b22b4d7c7 [utils] remove wrap_string.h (#4483) 2020-01-22 13:39:25 -08:00
Jonathan Hui 71a7e47c81 [utils] remove strnlen (#4483) 2020-01-22 13:39:25 -08:00
Jonathan Hui 40a84bb18f [cli] add mSntpQueryingInProgress to initializer list (#4464) 2020-01-13 06:44:34 -08:00
Diego Ismirlian e44461151f [build] detect undefined macros to avoid misconfigurations (#4300) 2020-01-08 08:37:46 -08:00
Jonathan Hui dff1694fe1 [dns-client] add const to address pointer (#4399)
- Also change CLI implementation to avoid reference binding to null pointer.
2019-12-13 17:19:34 -08:00
Rongli Sun eb2c2dfb26 [cli] extend ping to allow hoplimit configuration (#4370) 2019-12-10 08:51:26 -08:00
Jonathan Hui e2723f6c05 [mle] add return error to otThreadSetRouterEligible (#4363)
When trying to set router-eligible and the device is not capable of
becoming a router, return OT_ERROR_NOT_CAPABLE.
2019-12-03 09:28:35 +08:00
Jonathan Hui 27f5d9a06e [mle] rename RouterRoleEnabled to RouterEligible (#4363) 2019-12-03 09:28:35 +08:00
Rongli Sun e860009914 [network-data] always support service registration at Leader (#4360)
A Leader should always be able to process service registration.

This commit:

- removes the OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE feature
  flag around code for handling service registrations by the leader.

- support service ALOC forwarding by all router-capable devices.

- adds ability for any device to read service information from the
  network data.
2019-12-03 00:42:46 +08:00
Piotr Koziar 61088c7782 [cli] mac/mle counters reset (#4341)
* Add counters reset cli command
2019-11-19 18:35:06 -08:00
Rafał Kuźnia 5a7e19062c [mac] add option to change direct/indirect TX retry number (#4256)
Add MAC option to change number of direct TX retries:
- add member variable containing maximum number of direct TX retries
- add getter/setter methods

Add public API for direct and indirect TX retries
- otLinkGetMaxFrameRetriesDirect
- otLinkSetMaxFrameRetriesDirect
- otLinkGetMaxFrameRetriesIndirect
- otLinkSetMaxFrameRetriesIndirect

Add NCP support for direct and indirect TX retry configuration.

Rename config definition for direct and direct TX retries.

Add cli command handler for direct and indirect TX retries.
2019-10-29 09:04:26 -07:00
Yakun Xu 9cb3fa50ef [cli] get preferred and supported channel mask (#4253) 2019-10-24 22:30:34 -07:00
Rongli Sun eac27c0f45 [cli] add hex string payload for udp send (#4241) 2019-10-24 10:33:08 -07:00
wgtdkp ff789e4ded [api] add API to get Thread Version (#4225) 2019-10-14 10:24:30 -07:00
Abtin Keshavarzian 4feadec950 [time] adding Time class (#4195)
This commit adds `Time` class which represents an instance of time
(it is a simple wrapper over a `uint32_t` corresponding to a
numerical time value). The `Time` class provides helpful operator
overloads:
- Operators `+` and `-` with a `Time` instance and a `Duration` to
  get a `Time` instance after or before.
- Operator `-` with two `Time` instances to calculate the `Duration`
  duration between two time instances.
- Operators `<`, `<=`, `>`,'>=', '==' and `!=` to compare two `Time`
  instances. They correctly handle the wrapping of numeric time value.

The core modules are updated to use the new `Time` and `Duration`
types which help make the code simpler. This commit also updates the
 unit test `test_timer` to add test cases for newly added types.
2019-10-04 15:35:53 -07:00
Abtin Keshavarzian 1555b21910 [key-manager] add Pskc class (#4174)
This commit adds a `Pskc` as a wrapper over `otPskc` and also
renames all the uses of `PSK` into `Psk` to follow our variable
and type naming convention which treats an acronym as a whole
word.
2019-09-18 19:11:07 -07:00
Zhanglong Xia c0ef327664 [radio] add radio coex control api (#4158) 2019-09-16 23:12:37 -07:00
Yakun Xu 957d79d786 [api] force linker failures when using disabled features (#4127) 2019-09-10 08:42:02 -07:00
Jonathan Hui d796b056c5 [child-table] add support for more than 64 children (#4118) 2019-08-23 09:15:37 -07:00
Yakun Xu 79c61a5700 [diag] clean up unnecessary variables and code (#4102) 2019-08-22 08:38:56 -07:00
Zhanglong Xia 27cac08e8a [radio] add coex metrics (#4108)
- Add platform get coex metrics API
- Add spinel property for coex metrics
2019-08-21 12:25:27 -07:00
Jonathan Hui 711598eb17 [cli] fix inconsistent printf format specifier (#4101) 2019-08-19 07:43:18 -07:00
Abtin Keshavarzian 31ce3d45c8 [style] harmonize boolean checks (#4048)
This commit simplifies boolean checks containing `== false` to use the
`!` operator instead, and removes redundant `== true` checks. This
commit aims to harmonize the boolean checks across core modules.
2019-08-01 10:30:08 -07:00
Jonathan Hui 02da206f39 [config] remaining configure options (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 149640da49 [config] tmf (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 926b9e8661 [config] time sync (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 8d61b4b99e [config] sntp client (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 0baaf1afba [config] mac (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 31ffd1645e [config] joiner (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 297ab4742f [config] dns client (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui a608896cd3 [config] diag (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui f72f792874 [config] commissioner (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 6c8a9a8661 [config] coap (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 01ebc18f97 [config] channel monitor (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui 1021946d6d [config] channel manager (#4020) 2019-07-31 14:16:30 -07:00
Jonathan Hui f18497395a [config] border router (#4020) 2019-07-31 14:16:30 -07:00
Mirek ec6057c524 [cli] make output of panid consistent with input (#4028) 2019-07-26 09:00:24 -07:00
Jonathan Hui e87bc42184 [diag] move factory diags into core (#4010)
- Simplifies make files by not having to deal with separate library.
- Combine factory diags source into single source file.
2019-07-23 08:47:16 -07:00
Abtin Keshavarzian d92733661c [posix-app] simplify makefiles (#3975)
* [cli] ensure legacy callback APIs are defined as `OT_TOOL_WEAK`

* [posix-app] simplify the makefile (link in ncp lib).

This commit simplifies the posix-app makefiles by removing the
`inc_<module>` source files (which included certain modules from
the `ncp` folder). Instead the library `libopenthread-ncp-ftd.a`
is included when linking thethe final posix-app executables
`ot-ncp`,  `ot-cli` and/or, `o-daemon`.

* [posix-app] ensure header files from ncp folder have "ncp/" prefix

This commit changes the posix-app platform makefile such that
the header files from `src/ncp` folder require "ncp/" prefix.
2019-07-09 13:24:41 -07:00
Yakun Xu d0285164a0 [cli] remove otPtr introduced by windows platform (#3973) 2019-07-09 04:36:08 -07:00