1 /*
2  *    Copyright (c) 2016, The OpenThread Authors.
3  *    All rights reserved.
4  *
5  *    Redistribution and use in source and binary forms, with or without
6  *    modification, are permitted provided that the following conditions are met:
7  *    1. Redistributions of source code must retain the above copyright
8  *       notice, this list of conditions and the following disclaimer.
9  *    2. Redistributions in binary form must reproduce the above copyright
10  *       notice, this list of conditions and the following disclaimer in the
11  *       documentation and/or other materials provided with the distribution.
12  *    3. Neither the name of the copyright holder nor the
13  *       names of its contributors may be used to endorse or promote products
14  *       derived from this software without specific prior written permission.
15  *
16  *    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  *    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  *    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  *    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20  *    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  *    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  *    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  *    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  *    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  *    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 /**
29  * @file
30  *   This file contains definitions of spinel.
31  */
32 
33 #ifndef SPINEL_HEADER_INCLUDED
34 #define SPINEL_HEADER_INCLUDED 1
35 
36 /*
37  *   Spinel is a host-controller protocol designed to enable
38  *   inter-operation over simple serial connections between general purpose
39  *   device operating systems (OS) host and network co-processors (NCP) for
40  *   the purpose of controlling and managing the NCP.
41  *
42  * ---------------------------------------------------------------------------
43  *
44  *   Frame Format
45  *
46  *   A frame is defined simply as the concatenation of
47  *
48  *   -  A header byte
49  *   -  A command (up to three bytes)
50  *   -  An optional command payload
51  *
52  *              +---------+--------+-----+-------------+
53  *              | Octets: |   1    | 1-3 |      n      |
54  *              +---------+--------+-----+-------------+
55  *              | Fields: | HEADER | CMD | CMD_PAYLOAD |
56  *              +---------+--------+-----+-------------+
57  *
58  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
59  *
60  *   Header Format
61  *
62  *   The header byte is broken down as follows:
63  *
64  *                    0   1   2   3   4   5   6   7
65  *                  +---+---+---+---+---+---+---+---+
66  *                  |  FLG  |  IID  |      TID      |
67  *                  +---+---+---+---+---+---+---+---+
68  *
69  *
70  *   The flag field of the header byte ("FLG") is always set to the value
71  *   two (or "10" in binary).  Any frame received with these bits set to
72  *   any other value else MUST NOT be considered a Spinel frame.
73  *
74  *   This convention allows Spinel to be line compatible with BTLE HCI.
75  *   By defining the first two bit in this way we can disambiguate between
76  *   Spinel frames and HCI frames (which always start with either "0x01"
77  *   or "0x04") without any additional framing overhead.
78  *
79  *   The Interface Identifier (IID) is a number between 0 and 3, which
80  *   is associated by the OS with a specific NCP. This allows the protocol
81  *   to support up to 4 NCPs under same connection.
82  *
83  *   The least significant bits of the header represent the Transaction
84  *   Identifier (TID). The TID is used for correlating responses to the
85  *   commands which generated them.
86  *
87  *   When a command is sent from the host, any reply to that command sent
88  *   by the NCP will use the same value for the TID.  When the host
89  *   receives a frame that matches the TID of the command it sent, it can
90  *   easily recognize that frame as the actual response to that command.
91  *
92  *   The TID value of zero (0) is used for commands to which a correlated
93  *   response is not expected or needed, such as for unsolicited update
94  *   commands sent to the host from the NCP.
95  *
96  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
97  *
98  *   The command identifier is a 21-bit unsigned integer encoded in up to
99  *   three bytes using the packed unsigned integer format described below.
100  *   Depending on the semantics of the command in question, a payload MAY
101  *   be included in the frame.  The exact composition and length of the
102  *   payload is defined by the command identifier.
103  *
104  * ---------------------------------------------------------------------------
105  *
106  *   Data Packing
107  *
108  *   Data serialization for properties is performed using a light-weight
109  *   data packing format which was loosely inspired by D-Bus.  The format
110  *   of a serialization is defined by a specially formatted string.
111  *
112  *   This packing format is used for notational convenience.  While this
113  *   string-based data-type format has been designed so that the strings
114  *   may be directly used by a structured data parser, such a thing is not
115  *   required to implement Spinel.
116  *
117  *   Goals:
118  *
119  *   -  Be lightweight and favor direct representation of values.
120  *   -  Use an easily readable and memorable format string.
121  *   -  Support lists and structures.
122  *   -  Allow properties to be appended to structures while maintaining
123  *      backward compatibility.
124  *
125  *   Each primitive data-type has an ASCII character associated with it.
126  *   Structures can be represented as strings of these characters.  For
127  *   example:
128  *
129  *   -  "C": A single unsigned byte.
130  *   -  "C6U": A single unsigned byte, followed by a 128-bit IPv6 address,
131  *      followed by a zero-terminated UTF8 string.
132  *   -  "A(6)": An array of concatenated IPv6 addresses
133  *
134  *   In each case, the data is represented exactly as described.  For
135  *   example, an array of 10 IPv6 address is stored as 160 bytes.
136  *
137  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
138  *
139  *   Primitive Types
140  *
141  *   +----------+----------------------+---------------------------------+
142  *   |   Char   | Name                 | Description                     |
143  *   +----------+----------------------+---------------------------------+
144  *   |   "."    | DATATYPE_VOID        | Empty data type. Used           |
145  *   |          |                      | internally.                     |
146  *   |   "b"    | DATATYPE_BOOL        | Boolean value. Encoded in       |
147  *   |          |                      | 8-bits as either 0x00 or 0x01.  |
148  *   |          |                      | All other values are illegal.   |
149  *   |   "C"    | DATATYPE_UINT8       | Unsigned 8-bit integer.         |
150  *   |   "c"    | DATATYPE_INT8        | Signed 8-bit integer.           |
151  *   |   "S"    | DATATYPE_UINT16      | Unsigned 16-bit integer.        |
152  *   |   "s"    | DATATYPE_INT16       | Signed 16-bit integer.          |
153  *   |   "L"    | DATATYPE_UINT32      | Unsigned 32-bit integer.        |
154  *   |   "l"    | DATATYPE_INT32       | Signed 32-bit integer.          |
155  *   |   "i"    | DATATYPE_UINT_PACKED | Packed Unsigned Integer. See    |
156  *   |          |                      | description below               |
157  *   |   "6"    | DATATYPE_IPv6ADDR    | IPv6 Address. (Big-endian)      |
158  *   |   "E"    | DATATYPE_EUI64       | EUI-64 Address. (Big-endian)    |
159  *   |   "e"    | DATATYPE_EUI48       | EUI-48 Address. (Big-endian)    |
160  *   |   "D"    | DATATYPE_DATA        | Arbitrary data. See related     |
161  *   |          |                      | section below for details.      |
162  *   |   "d"    | DATATYPE_DATA_WLEN   | Arbitrary data with prepended   |
163  *   |          |                      | length. See below for details   |
164  *   |   "U"    | DATATYPE_UTF8        | Zero-terminated UTF8-encoded    |
165  *   |          |                      | string.                         |
166  *   | "t(...)" | DATATYPE_STRUCT      | Structured datatype with        |
167  *   |          |                      | prepended length.               |
168  *   | "A(...)" | DATATYPE_ARRAY       | Array of datatypes. Compound    |
169  *   |          |                      | type.                           |
170  *   +----------+----------------------+---------------------------------+
171  *
172  *   All multi-byte values are little-endian unless explicitly stated
173  *   otherwise.
174  *
175  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
176  *
177  *   Packed Unsigned Integer
178  *
179  *   For certain types of integers, such command or property identifiers,
180  *   usually have a value on the wire that is less than 127.  However, in
181  *   order to not preclude the use of values larger than 255, we would
182  *   need to add an extra byte.  Doing this would add an extra byte to the
183  *   majority of instances, which can add up in terms of bandwidth.
184  *
185  *   The packed unsigned integer format is based on the unsigned integer
186  *   format in EXI, except that we limit the maximum value to the
187  *   largest value that can be encoded into three bytes (2,097,151).
188  *
189  *   For all values less than 127, the packed form of the number is simply
190  *   a single byte which directly represents the number.  For values
191  *   larger than 127, the following process is used to encode the value:
192  *
193  *   1.  The unsigned integer is broken up into _n_ 7-bit chunks and
194  *       placed into _n_ octets, leaving the most significant bit of each
195  *       octet unused.
196  *   2.  Order the octets from least-significant to most-significant.
197  *       (Little-endian)
198  *   3.  Clear the most significant bit of the most significant octet.
199  *       Set the least significant bit on all other octets.
200  *
201  *   Where `n` is the smallest number of 7-bit chunks you can use to
202  *   represent the given value.
203  *
204  *   Take the value 1337, for example:
205  *
206  *                              1337 => 0x0539
207  *                                   => [39 0A]
208  *                                   => [B9 0A]
209  *
210  *   To decode the value, you collect the 7-bit chunks until you find an
211  *   octet with the most significant bit clear.
212  *
213  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
214  *
215  *   Data Blobs
216  *
217  *   There are two types for data blobs: "d" and "D".
218  *
219  *   -  "d" has the length of the data (in bytes) prepended to the data
220  *      (with the length encoded as type "S").  The size of the length
221  *      field is not included in the length.
222  *   -  "D" does not have a prepended length: the length of the data is
223  *      implied by the bytes remaining to be parsed.  It is an error for
224  *      "D" to not be the last type in a type in a type signature.
225  *
226  *   This dichotomy allows for more efficient encoding by eliminating
227  *   redundancy.  If the rest of the buffer is a data blob, encoding the
228  *   length would be redundant because we already know how many bytes are
229  *   in the rest of the buffer.
230  *
231  *   In some cases we use "d" even if it is the last field in a type
232  *   signature.  We do this to allow for us to be able to append
233  *   additional fields to the type signature if necessary in the future.
234  *   This is usually the case with embedded structs, like in the scan
235  *   results.
236  *
237  *   For example, let's say we have a buffer that is encoded with the
238  *   datatype signature of "CLLD".  In this case, it is pretty easy to
239  *   tell where the start and end of the data blob is: the start is 9
240  *   bytes from the start of the buffer, and its length is the length of
241  *   the buffer minus 9. (9 is the number of bytes taken up by a byte and
242  *   two longs)
243  *
244  *   The datatype signature "CLLDU" is illegal because we can't determine
245  *   where the last field (a zero-terminated UTF8 string) starts.  But the
246  *   datatype "CLLdU" is legal, because the parser can determine the
247  *   exact length of the data blob-- allowing it to know where the start
248  *   of the next field would be.
249  *
250  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
251  *
252  *   Structured Data
253  *
254  *   The structure data type ("t(...)") is a way of bundling together
255  *   several fields into a single structure.  It can be thought of as a
256  *   "d" type except that instead of being opaque, the fields in the
257  *   content are known.  This is useful for things like scan results where
258  *   you have substructures which are defined by different layers.
259  *
260  *   For example, consider the type signature "Lt(ES)t(6C)".  In this
261  *   hypothetical case, the first struct is defined by the MAC layer, and
262  *   the second struct is defined by the PHY layer.  Because of the use of
263  *   structures, we know exactly what part comes from that layer.
264  *   Additionally, we can add fields to each structure without introducing
265  *   backward compatibility problems: Data encoded as "Lt(ESU)t(6C)"
266  *   (Notice the extra "U") will decode just fine as "Lt(ES)t(6C)".
267  *   Additionally, if we don't care about the MAC layer and only care
268  *   about the network layer, we could parse as "Lt()t(6C)".
269  *
270  *   Note that data encoded as "Lt(ES)t(6C)" will also parse as "Ldd",
271  *   with the structures from both layers now being opaque data blobs.
272  *
273  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
274  *
275  *   Arrays
276  *
277  *   An array is simply a concatenated set of _n_ data encodings.  For
278  *   example, the type "A(6)" is simply a list of IPv6 addresses---one
279  *   after the other.  The type "A(6E)" likewise a concatenation of IPv6-
280  *   address/EUI-64 pairs.
281  *
282  *   If an array contains many fields, the fields will often be surrounded
283  *   by a structure ("t(...)").  This effectively prepends each item in
284  *   the array with its length.  This is useful for improving parsing
285  *   performance or to allow additional fields to be added in the future
286  *   in a backward compatible way.  If there is a high certainty that
287  *   additional fields will never be added, the struct may be omitted
288  *   (saving two bytes per item).
289  *
290  *   This specification does not define a way to embed an array as a field
291  *   alongside other fields.
292  *
293  * ---------------------------------------------------------------------------
294  *
295  *   Spinel definition compatibility guideline:
296  *
297  *   The compatibility policy for NCP versus RCP and host side are handled
298  *   differently in spinel.
299  *
300  *   New NCP firmware should work with an older host driver, i.e., NCP
301  *   implementation should remain backward compatible.
302  *
303  *    - Existing fields in the format of an already implemented spinel
304  *      property or command cannot change.
305  *
306  *    - New fields may be appended at the end of the format (or the end of
307  *      a struct) as long as the NCP implementation treats the new fields as
308  *      optional (i.e., a driver not aware of and therefore not using the
309  *      new fields should continue to function as before).
310  *
311  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
312  *
313  *   For RCP and host, the "RCP API Version" numbers are used to check the
314  *   compatibility between host implementation and RCP firmware. Generally,
315  *   a newer host side implementation would work with a range of previous
316  *   or older RCP firmware versions.
317  *
318  *   - SPINEL_RCP_API_VERSION specifies the current spinel RCP API version.
319  *     This number MUST be incremented anytime there is a change in any of RCP
320  *     specific spinel definitions.
321  *
322  *   - SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION specifies the minimum spinel
323  *     RCP API Version which is supported by the host-side implementation.
324  *     To reduce the backward compatibility issues, this number should be kept
325  *     as constant as possible.
326  *
327  *   - On start, host implementation queries the RCP API version and accepts
328  *     any version starting from SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION.
329  *
330  *   - Host implementation also queries the RCP about the minimum host RCP
331  *     API version it can work with, and then checks that its own version is
332  *     within the range.
333  *
334  *   Host and RCP compatibility guideline:
335  *
336  *   - New host spinel layer should work with an older RCP firmware, i.e., host
337  *     implementation should remain backward compatible.
338  *
339  *   - Existing fields in the format of an already implemented spinel
340  *     property or command must not change.
341  *
342  *   - New fields must be appended to the end of the existing spinel format.
343  *     *  New fields for new features:
344  *          Adding a new capability flag to the otRadioCaps to indicate the new
345  *          fields. The host parses the spinel format based on the pre-fetched
346  *          otRadioCaps. The host should be able to enable/disable the feature
347  *          in runtime based on the otRadioCaps. Refer to PR4919 and PR5139.
348  *     *  New fields for changing existing implementations:
349  *          This case should be avoided as much as possible. It will cause the
350  *          compatibility issue.
351  *
352  *   - Deprecated fields must not be removed from the spinel format and they
353  *     must be set to a suitable default value.
354  *
355  *   - Adding new spinel properties.
356  *     * If the old version RCP doesn't support the new spinel property, it
357  *       must return the spinel error SPINEL_STATUS_PROP_NOT_FOUND.
358  *
359  *     * If the host can handle the new spinel property by processing the error
360  *       SPINEL_STATUS_PROP_NOT_FOUND, the API of the new spinel property must
361  *       return OT_ERROR_NOT_IMPLEMENTED or default value.
362  *
363  *     * If the host can't handle the new spinel property by processing the
364  *       error SPINEL_STATUS_PROP_NOT_FOUND, a new capability flag must be
365  *       added to the otRadioCaps to indicate whether RCP supports the new
366  *       spinel property. The host must handle the new spinel property by
367  *       processing the new capability flag.
368  *
369  *   - If none of the above methods make the new functions work, increasing the
370  *     SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION. This case should be avoided
371  *     as much as possible.
372  * ---------------------------------------------------------------------------
373  */
374 
375 #ifdef SPINEL_PLATFORM_HEADER
376 #include SPINEL_PLATFORM_HEADER
377 #else // ifdef SPINEL_PLATFORM_HEADER
378 #include <stdarg.h>
379 #include <stdbool.h>
380 #include <stdint.h>
381 #endif // else SPINEL_PLATFORM_HEADER
382 
383 // ----------------------------------------------------------------------------
384 
385 #ifndef DOXYGEN_SHOULD_SKIP_THIS
386 
387 #if defined(__GNUC__)
388 #define SPINEL_API_EXTERN extern __attribute__((visibility("default")))
389 #define SPINEL_API_NONNULL_ALL __attribute__((nonnull))
390 #define SPINEL_API_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
391 #endif // ifdef __GNUC__
392 
393 #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS
394 
395 #ifndef SPINEL_API_EXTERN
396 #define SPINEL_API_EXTERN extern
397 #endif
398 
399 #ifndef SPINEL_API_NONNULL_ALL
400 #define SPINEL_API_NONNULL_ALL
401 #endif
402 
403 #ifndef SPINEL_API_WARN_UNUSED_RESULT
404 #define SPINEL_API_WARN_UNUSED_RESULT
405 #endif
406 
407 // ----------------------------------------------------------------------------
408 
409 #define SPINEL_PROTOCOL_VERSION_THREAD_MAJOR 4
410 #define SPINEL_PROTOCOL_VERSION_THREAD_MINOR 3
411 
412 /**
413  * @def SPINEL_RCP_API_VERSION
414  *
415  * The RCP API version number.
416  *
417  * This number MUST increase by one each time any of the spinel definitions used by RCP change (independent of whether
418  * the change is backward-compatible or not).
419  *
420  * Please see section "Spinel definition compatibility guideline" for more details.
421  *
422  */
423 #define SPINEL_RCP_API_VERSION 9
424 
425 /**
426  * @def SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION
427  *
428  * The minimum RCP API version supported by the host implementation.
429  *
430  * This number MUST increase when there is a non-compatible RCP spinel related change on host implementation.
431  *
432  * Please see section "Spinel definition compatibility guideline" for more details.
433  *
434  */
435 #define SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION 4
436 
437 /**
438  * @def SPINEL_FRAME_MAX_SIZE
439  *
440  *  The maximum size of SPINEL frame.
441  *
442  */
443 #define SPINEL_FRAME_MAX_SIZE 1300
444 
445 /**
446  * @def SPINEL_FRAME_MAX_COMMAND_HEADER_SIZE
447  *
448  *  The maximum size of SPINEL command header.
449  *
450  */
451 #define SPINEL_FRAME_MAX_COMMAND_HEADER_SIZE 4
452 
453 /**
454  * @def SPINEL_FRAME_MAX_PAYLOAD_SIZE
455  *
456  *  The maximum size of SPINEL command payload.
457  *
458  */
459 #define SPINEL_FRAME_MAX_COMMAND_PAYLOAD_SIZE (SPINEL_FRAME_MAX_SIZE - SPINEL_FRAME_MAX_COMMAND_HEADER_SIZE)
460 
461 /**
462  * @def SPINEL_ENCRYPTER_EXTRA_DATA_SIZE
463  *
464  *  The size of extra data to be allocated for spinel frame buffer,
465  *  needed by Spinel Encrypter.
466  *
467  */
468 #define SPINEL_ENCRYPTER_EXTRA_DATA_SIZE 0
469 
470 /**
471  * @def SPINEL_FRAME_BUFFER_SIZE
472  *
473  *  The size of buffer large enough to fit one whole spinel frame with extra data
474  *  needed by Spinel Encrypter.
475  *
476  */
477 #define SPINEL_FRAME_BUFFER_SIZE (SPINEL_FRAME_MAX_SIZE + SPINEL_ENCRYPTER_EXTRA_DATA_SIZE)
478 
479 /// Macro for generating bit masks using bit index from the spec
480 #define SPINEL_BIT_MASK(bit_index, field_bit_count) ((1 << ((field_bit_count)-1)) >> (bit_index))
481 
482 // ----------------------------------------------------------------------------
483 
484 #if defined(__cplusplus)
485 extern "C" {
486 #endif
487 
488 enum
489 {
490     SPINEL_STATUS_OK                       = 0,  ///< Operation has completed successfully.
491     SPINEL_STATUS_FAILURE                  = 1,  ///< Operation has failed for some undefined reason.
492     SPINEL_STATUS_UNIMPLEMENTED            = 2,  ///< Given operation has not been implemented.
493     SPINEL_STATUS_INVALID_ARGUMENT         = 3,  ///< An argument to the operation is invalid.
494     SPINEL_STATUS_INVALID_STATE            = 4,  ///< This operation is invalid for the current device state.
495     SPINEL_STATUS_INVALID_COMMAND          = 5,  ///< This command is not recognized.
496     SPINEL_STATUS_INVALID_INTERFACE        = 6,  ///< This interface is not supported.
497     SPINEL_STATUS_INTERNAL_ERROR           = 7,  ///< An internal runtime error has occurred.
498     SPINEL_STATUS_SECURITY_ERROR           = 8,  ///< A security/authentication error has occurred.
499     SPINEL_STATUS_PARSE_ERROR              = 9,  ///< A error has occurred while parsing the command.
500     SPINEL_STATUS_IN_PROGRESS              = 10, ///< This operation is in progress.
501     SPINEL_STATUS_NOMEM                    = 11, ///< Operation prevented due to memory pressure.
502     SPINEL_STATUS_BUSY                     = 12, ///< The device is currently performing a mutually exclusive operation
503     SPINEL_STATUS_PROP_NOT_FOUND           = 13, ///< The given property is not recognized.
504     SPINEL_STATUS_DROPPED                  = 14, ///< A/The packet was dropped.
505     SPINEL_STATUS_EMPTY                    = 15, ///< The result of the operation is empty.
506     SPINEL_STATUS_CMD_TOO_BIG              = 16, ///< The command was too large to fit in the internal buffer.
507     SPINEL_STATUS_NO_ACK                   = 17, ///< The packet was not acknowledged.
508     SPINEL_STATUS_CCA_FAILURE              = 18, ///< The packet was not sent due to a CCA failure.
509     SPINEL_STATUS_ALREADY                  = 19, ///< The operation is already in progress.
510     SPINEL_STATUS_ITEM_NOT_FOUND           = 20, ///< The given item could not be found.
511     SPINEL_STATUS_INVALID_COMMAND_FOR_PROP = 21, ///< The given command cannot be performed on this property.
512     SPINEL_STATUS_UNKNOWN_NEIGHBOR         = 22, ///< The neighbor is unknown.
513     SPINEL_STATUS_NOT_CAPABLE              = 23, ///< The target is not capable of handling requested operation.
514     SPINEL_STATUS_RESPONSE_TIMEOUT         = 24, ///< No response received from remote node
515 
516     SPINEL_STATUS_JOIN__BEGIN = 104,
517 
518     /// Generic failure to associate with other peers.
519     /**
520      *  This status error should not be used by implementors if
521      *  enough information is available to determine that one of the
522      *  later join failure status codes would be more accurate.
523      *
524      *  \sa SPINEL_PROP_NET_REQUIRE_JOIN_EXISTING
525      *  \sa SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING
526      */
527     SPINEL_STATUS_JOIN_FAILURE = SPINEL_STATUS_JOIN__BEGIN + 0,
528 
529     /// The node found other peers but was unable to decode their packets.
530     /**
531      *  Typically this error code indicates that the network
532      *  key has been set incorrectly.
533      *
534      *  \sa SPINEL_PROP_NET_REQUIRE_JOIN_EXISTING
535      *  \sa SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING
536      */
537     SPINEL_STATUS_JOIN_SECURITY = SPINEL_STATUS_JOIN__BEGIN + 1,
538 
539     /// The node was unable to find any other peers on the network.
540     /**
541      *  \sa SPINEL_PROP_NET_REQUIRE_JOIN_EXISTING
542      *  \sa SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING
543      */
544     SPINEL_STATUS_JOIN_NO_PEERS = SPINEL_STATUS_JOIN__BEGIN + 2,
545 
546     /// The only potential peer nodes found are incompatible.
547     /**
548      *  \sa SPINEL_PROP_NET_REQUIRE_JOIN_EXISTING
549      */
550     SPINEL_STATUS_JOIN_INCOMPATIBLE = SPINEL_STATUS_JOIN__BEGIN + 3,
551 
552     /// No response in expecting time.
553     /**
554      *  \sa SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING
555      */
556     SPINEL_STATUS_JOIN_RSP_TIMEOUT = SPINEL_STATUS_JOIN__BEGIN + 4,
557 
558     /// The node succeeds in commissioning and get the network credentials.
559     /**
560      *  \sa SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING
561      */
562     SPINEL_STATUS_JOIN_SUCCESS = SPINEL_STATUS_JOIN__BEGIN + 5,
563 
564     SPINEL_STATUS_JOIN__END = 112,
565 
566     SPINEL_STATUS_RESET__BEGIN   = 112,
567     SPINEL_STATUS_RESET_POWER_ON = SPINEL_STATUS_RESET__BEGIN + 0,
568     SPINEL_STATUS_RESET_EXTERNAL = SPINEL_STATUS_RESET__BEGIN + 1,
569     SPINEL_STATUS_RESET_SOFTWARE = SPINEL_STATUS_RESET__BEGIN + 2,
570     SPINEL_STATUS_RESET_FAULT    = SPINEL_STATUS_RESET__BEGIN + 3,
571     SPINEL_STATUS_RESET_CRASH    = SPINEL_STATUS_RESET__BEGIN + 4,
572     SPINEL_STATUS_RESET_ASSERT   = SPINEL_STATUS_RESET__BEGIN + 5,
573     SPINEL_STATUS_RESET_OTHER    = SPINEL_STATUS_RESET__BEGIN + 6,
574     SPINEL_STATUS_RESET_UNKNOWN  = SPINEL_STATUS_RESET__BEGIN + 7,
575     SPINEL_STATUS_RESET_WATCHDOG = SPINEL_STATUS_RESET__BEGIN + 8,
576     SPINEL_STATUS_RESET__END     = 128,
577 
578     SPINEL_STATUS_VENDOR__BEGIN = 15360,
579     SPINEL_STATUS_VENDOR__END   = 16384,
580 
581     SPINEL_STATUS_STACK_NATIVE__BEGIN = 16384,
582     SPINEL_STATUS_STACK_NATIVE__END   = 81920,
583 
584     SPINEL_STATUS_EXPERIMENTAL__BEGIN = 2000000,
585     SPINEL_STATUS_EXPERIMENTAL__END   = 2097152,
586 };
587 
588 typedef uint32_t spinel_status_t;
589 
590 typedef enum
591 {
592     SPINEL_NET_ROLE_DETACHED = 0,
593     SPINEL_NET_ROLE_CHILD    = 1,
594     SPINEL_NET_ROLE_ROUTER   = 2,
595     SPINEL_NET_ROLE_LEADER   = 3,
596 } spinel_net_role_t;
597 
598 typedef enum
599 {
600     SPINEL_IPV6_ICMP_PING_OFFLOAD_DISABLED       = 0,
601     SPINEL_IPV6_ICMP_PING_OFFLOAD_UNICAST_ONLY   = 1,
602     SPINEL_IPV6_ICMP_PING_OFFLOAD_MULTICAST_ONLY = 2,
603     SPINEL_IPV6_ICMP_PING_OFFLOAD_ALL            = 3,
604 } spinel_ipv6_icmp_ping_offload_mode_t;
605 
606 typedef enum
607 {
608     SPINEL_SCAN_STATE_IDLE     = 0,
609     SPINEL_SCAN_STATE_BEACON   = 1,
610     SPINEL_SCAN_STATE_ENERGY   = 2,
611     SPINEL_SCAN_STATE_DISCOVER = 3,
612 } spinel_scan_state_t;
613 
614 typedef enum
615 {
616     SPINEL_MCU_POWER_STATE_ON        = 0,
617     SPINEL_MCU_POWER_STATE_LOW_POWER = 1,
618     SPINEL_MCU_POWER_STATE_OFF       = 2,
619 } spinel_mcu_power_state_t;
620 
621 // The `spinel_power_state_t` enumeration and `POWER_STATE`
622 // property are deprecated. Please use `MCU_POWER_STATE`
623 // instead.
624 typedef enum
625 {
626     SPINEL_POWER_STATE_OFFLINE    = 0,
627     SPINEL_POWER_STATE_DEEP_SLEEP = 1,
628     SPINEL_POWER_STATE_STANDBY    = 2,
629     SPINEL_POWER_STATE_LOW_POWER  = 3,
630     SPINEL_POWER_STATE_ONLINE     = 4,
631 } spinel_power_state_t;
632 
633 typedef enum
634 {
635     SPINEL_HOST_POWER_STATE_OFFLINE    = 0,
636     SPINEL_HOST_POWER_STATE_DEEP_SLEEP = 1,
637     SPINEL_HOST_POWER_STATE_RESERVED   = 2,
638     SPINEL_HOST_POWER_STATE_LOW_POWER  = 3,
639     SPINEL_HOST_POWER_STATE_ONLINE     = 4,
640 } spinel_host_power_state_t;
641 
642 typedef enum
643 {
644     SPINEL_MESHCOP_JOINER_STATE_IDLE       = 0,
645     SPINEL_MESHCOP_JOINER_STATE_DISCOVER   = 1,
646     SPINEL_MESHCOP_JOINER_STATE_CONNECTING = 2,
647     SPINEL_MESHCOP_JOINER_STATE_CONNECTED  = 3,
648     SPINEL_MESHCOP_JOINER_STATE_ENTRUST    = 4,
649     SPINEL_MESHCOP_JOINER_STATE_JOINED     = 5,
650 } spinel_meshcop_joiner_state_t;
651 
652 enum
653 {
654     SPINEL_NET_FLAG_ON_MESH       = (1 << 0),
655     SPINEL_NET_FLAG_DEFAULT_ROUTE = (1 << 1),
656     SPINEL_NET_FLAG_CONFIGURE     = (1 << 2),
657     SPINEL_NET_FLAG_DHCP          = (1 << 3),
658     SPINEL_NET_FLAG_SLAAC         = (1 << 4),
659     SPINEL_NET_FLAG_PREFERRED     = (1 << 5),
660 
661     SPINEL_NET_FLAG_PREFERENCE_OFFSET = 6,
662     SPINEL_NET_FLAG_PREFERENCE_MASK   = (3 << SPINEL_NET_FLAG_PREFERENCE_OFFSET),
663 };
664 
665 enum
666 {
667     SPINEL_NET_FLAG_EXT_DP  = (1 << 6),
668     SPINEL_NET_FLAG_EXT_DNS = (1 << 7),
669 };
670 
671 enum
672 {
673     SPINEL_ROUTE_PREFERENCE_HIGH   = (1 << SPINEL_NET_FLAG_PREFERENCE_OFFSET),
674     SPINEL_ROUTE_PREFERENCE_MEDIUM = (0 << SPINEL_NET_FLAG_PREFERENCE_OFFSET),
675     SPINEL_ROUTE_PREFERENCE_LOW    = (3 << SPINEL_NET_FLAG_PREFERENCE_OFFSET),
676 };
677 
678 enum
679 {
680     SPINEL_ROUTE_FLAG_NAT64 = (1 << 5),
681 };
682 
683 enum
684 {
685     SPINEL_THREAD_MODE_FULL_NETWORK_DATA   = (1 << 0),
686     SPINEL_THREAD_MODE_FULL_THREAD_DEV     = (1 << 1),
687     SPINEL_THREAD_MODE_SECURE_DATA_REQUEST = (1 << 2),
688     SPINEL_THREAD_MODE_RX_ON_WHEN_IDLE     = (1 << 3),
689 };
690 
691 enum
692 {
693     SPINEL_GPIO_FLAG_DIR_INPUT       = 0,
694     SPINEL_GPIO_FLAG_DIR_OUTPUT      = SPINEL_BIT_MASK(0, 8),
695     SPINEL_GPIO_FLAG_PULL_UP         = SPINEL_BIT_MASK(1, 8),
696     SPINEL_GPIO_FLAG_PULL_DOWN       = SPINEL_BIT_MASK(2, 8),
697     SPINEL_GPIO_FLAG_OPEN_DRAIN      = SPINEL_BIT_MASK(2, 8),
698     SPINEL_GPIO_FLAG_TRIGGER_NONE    = 0,
699     SPINEL_GPIO_FLAG_TRIGGER_RISING  = SPINEL_BIT_MASK(3, 8),
700     SPINEL_GPIO_FLAG_TRIGGER_FALLING = SPINEL_BIT_MASK(4, 8),
701     SPINEL_GPIO_FLAG_TRIGGER_ANY     = SPINEL_GPIO_FLAG_TRIGGER_RISING | SPINEL_GPIO_FLAG_TRIGGER_FALLING,
702 };
703 
704 enum
705 {
706     SPINEL_PROTOCOL_TYPE_BOOTLOADER = 0,
707     SPINEL_PROTOCOL_TYPE_ZIGBEE_IP  = 2,
708     SPINEL_PROTOCOL_TYPE_THREAD     = 3,
709 };
710 
711 enum
712 {
713     SPINEL_MAC_PROMISCUOUS_MODE_OFF     = 0, ///< Normal MAC filtering is in place.
714     SPINEL_MAC_PROMISCUOUS_MODE_NETWORK = 1, ///< All MAC packets matching network are passed up the stack.
715     SPINEL_MAC_PROMISCUOUS_MODE_FULL    = 2, ///< All decoded MAC packets are passed up the stack.
716 };
717 
718 enum
719 {
720     SPINEL_NCP_LOG_LEVEL_EMERG  = 0,
721     SPINEL_NCP_LOG_LEVEL_ALERT  = 1,
722     SPINEL_NCP_LOG_LEVEL_CRIT   = 2,
723     SPINEL_NCP_LOG_LEVEL_ERR    = 3,
724     SPINEL_NCP_LOG_LEVEL_WARN   = 4,
725     SPINEL_NCP_LOG_LEVEL_NOTICE = 5,
726     SPINEL_NCP_LOG_LEVEL_INFO   = 6,
727     SPINEL_NCP_LOG_LEVEL_DEBUG  = 7,
728 };
729 
730 enum
731 {
732     SPINEL_NCP_LOG_REGION_NONE        = 0,
733     SPINEL_NCP_LOG_REGION_OT_API      = 1,
734     SPINEL_NCP_LOG_REGION_OT_MLE      = 2,
735     SPINEL_NCP_LOG_REGION_OT_ARP      = 3,
736     SPINEL_NCP_LOG_REGION_OT_NET_DATA = 4,
737     SPINEL_NCP_LOG_REGION_OT_ICMP     = 5,
738     SPINEL_NCP_LOG_REGION_OT_IP6      = 6,
739     SPINEL_NCP_LOG_REGION_OT_TCP      = 7,
740     SPINEL_NCP_LOG_REGION_OT_MAC      = 8,
741     SPINEL_NCP_LOG_REGION_OT_MEM      = 9,
742     SPINEL_NCP_LOG_REGION_OT_NCP      = 10,
743     SPINEL_NCP_LOG_REGION_OT_MESH_COP = 11,
744     SPINEL_NCP_LOG_REGION_OT_NET_DIAG = 12,
745     SPINEL_NCP_LOG_REGION_OT_PLATFORM = 13,
746     SPINEL_NCP_LOG_REGION_OT_COAP     = 14,
747     SPINEL_NCP_LOG_REGION_OT_CLI      = 15,
748     SPINEL_NCP_LOG_REGION_OT_CORE     = 16,
749     SPINEL_NCP_LOG_REGION_OT_UTIL     = 17,
750     SPINEL_NCP_LOG_REGION_OT_BBR      = 18,
751     SPINEL_NCP_LOG_REGION_OT_MLR      = 19,
752     SPINEL_NCP_LOG_REGION_OT_DUA      = 20,
753     SPINEL_NCP_LOG_REGION_OT_BR       = 21,
754     SPINEL_NCP_LOG_REGION_OT_SRP      = 22,
755     SPINEL_NCP_LOG_REGION_OT_DNS      = 23,
756 };
757 
758 enum
759 {
760     SPINEL_MESHCOP_COMMISSIONER_STATE_DISABLED = 0,
761     SPINEL_MESHCOP_COMMISSIONER_STATE_PETITION = 1,
762     SPINEL_MESHCOP_COMMISSIONER_STATE_ACTIVE   = 2,
763 };
764 
765 enum
766 {
767     SPINEL_ADDRESS_CACHE_ENTRY_STATE_CACHED      = 0, // Entry is cached and in-use.
768     SPINEL_ADDRESS_CACHE_ENTRY_STATE_SNOOPED     = 1, // Entry is created by snoop optimization.
769     SPINEL_ADDRESS_CACHE_ENTRY_STATE_QUERY       = 2, // Entry represents an ongoing query for the EID.
770     SPINEL_ADDRESS_CACHE_ENTRY_STATE_RETRY_QUERY = 3, // Entry is in retry mode (a prior query did not  a response).
771 };
772 
773 enum
774 {
775     SPINEL_RADIO_LINK_IEEE_802_15_4 = 0,
776     SPINEL_RADIO_LINK_TREL_UDP6     = 1,
777 };
778 
779 // Statuses that can be received as a result of:
780 // @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY
781 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK
782 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD
783 enum
784 {
785     SPINEL_LINK_METRICS_STATUS_SUCCESS                     = 0,
786     SPINEL_LINK_METRICS_STATUS_CANNOT_SUPPORT_NEW_SERIES   = 1,
787     SPINEL_LINK_METRICS_STATUS_SERIESID_ALREADY_REGISTERED = 2,
788     SPINEL_LINK_METRICS_STATUS_SERIESID_NOT_RECOGNIZED     = 3,
789     SPINEL_LINK_METRICS_STATUS_NO_MATCHING_FRAMES_RECEIVED = 4,
790     SPINEL_LINK_METRICS_STATUS_OTHER_ERROR                 = 254
791 };
792 
793 // Metric ids used for:
794 // @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY
795 // @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT
796 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK
797 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD
798 // @ref SPINEL_PROP_RCP_ENH_ACK_PROBING
799 enum
800 {
801     SPINEL_THREAD_LINK_METRIC_PDU_COUNT   = (1 << 0),
802     SPINEL_THREAD_LINK_METRIC_LQI         = (1 << 1),
803     SPINEL_THREAD_LINK_METRIC_LINK_MARGIN = (1 << 2),
804     SPINEL_THREAD_LINK_METRIC_RSSI        = (1 << 3),
805 };
806 
807 // Frame types used for:
808 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD
809 enum
810 {
811     SPINEL_THREAD_FRAME_TYPE_MLE_LINK_PROBE   = (1 << 0),
812     SPINEL_THREAD_FRAME_TYPE_MAC_DATA         = (1 << 1),
813     SPINEL_THREAD_FRAME_TYPE_MAC_DATA_REQUEST = (1 << 2),
814     SPINEL_THREAD_FRAME_TYPE_MAC_ACK          = (1 << 3),
815 };
816 
817 // Parameter ids used for:
818 // @ref SPINEL_PROP_THREAD_MLR_REQUEST
819 enum
820 {
821     SPINEL_THREAD_MLR_PARAMID_TIMEOUT = 0
822 };
823 
824 // Backbone Router states used for:
825 // @ref SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_STATE
826 enum
827 {
828     SPINEL_THREAD_BACKBONE_ROUTER_STATE_DISABLED  = 0,
829     SPINEL_THREAD_BACKBONE_ROUTER_STATE_SECONDARY = 1,
830     SPINEL_THREAD_BACKBONE_ROUTER_STATE_PRIMARY   = 2,
831 };
832 
833 typedef enum
834 {
835     SPINEL_SRP_CLIENT_ITEM_STATE_TO_ADD     = 0, // Item to be added/registered.
836     SPINEL_SRP_CLIENT_ITEM_STATE_ADDING     = 1, // Item is being added/registered.
837     SPINEL_SRP_CLIENT_ITEM_STATE_TO_REFRESH = 2, // Item to be refreshed (re-register to renew lease).
838     SPINEL_SRP_CLIENT_ITEM_STATE_REFRESHING = 3, // Item is being refreshed.
839     SPINEL_SRP_CLIENT_ITEM_STATE_TO_REMOVE  = 4, // Item to be removed.
840     SPINEL_SRP_CLIENT_ITEM_STATE_REMOVING   = 5, // Item is being removed.
841     SPINEL_SRP_CLIENT_ITEM_STATE_REGISTERED = 6, // Item is registered with server.
842     SPINEL_SRP_CLIENT_ITEM_STATE_REMOVED    = 7, // Item is removed.
843 } spinel_srp_client_item_state_t;
844 
845 typedef enum
846 {
847     SPINEL_SRP_CLIENT_ERROR_NONE             = 0, // No error.
848     SPINEL_SRP_CLIENT_ERROR_PARSE            = 1, // Server unable to interpret due to format error.
849     SPINEL_SRP_CLIENT_ERROR_FAILED           = 2, // Server encountered an internal failure.
850     SPINEL_SRP_CLIENT_ERROR_NOT_FOUND        = 3, // Name that ought to exist, does not exists.
851     SPINEL_SRP_CLIENT_ERROR_NOT_IMPLEMENTED  = 4, // Server does not support the query type.
852     SPINEL_SRP_CLIENT_ERROR_SECURITY         = 5, // Service is not authoritative for zone.
853     SPINEL_SRP_CLIENT_ERROR_DUPLICATED       = 6, // Some name that ought not to exist, does exist.
854     SPINEL_SRP_CLIENT_ERROR_RESPONSE_TIMEOUT = 7, // Timed out waiting for response from server (client would retry).
855     SPINEL_SRP_CLIENT_ERROR_INVALID_ARGS     = 8, // Invalid args (e.g., bad service name or TXT-DATA).
856     SPINEL_SRP_CLIENT_ERROR_NO_BUFS          = 9, // No buffer to send the SRP update message.
857 } spinel_srp_client_error_t;
858 
859 typedef struct
860 {
861     uint8_t bytes[8];
862 } spinel_eui64_t;
863 
864 typedef struct
865 {
866     uint8_t bytes[8];
867 } spinel_net_xpanid_t;
868 
869 typedef struct
870 {
871     uint8_t bytes[16];
872 } spinel_net_pskc_t;
873 
874 typedef struct
875 {
876     uint8_t bytes[6];
877 } spinel_eui48_t;
878 
879 typedef struct
880 {
881     uint8_t bytes[16];
882 } spinel_ipv6addr_t;
883 
884 typedef int          spinel_ssize_t;
885 typedef unsigned int spinel_size_t;
886 typedef uint8_t      spinel_tid_t;
887 
888 enum
889 {
890     SPINEL_MD_FLAG_TX        = 0x0001, //!< Packet was transmitted, not received.
891     SPINEL_MD_FLAG_BAD_FCS   = 0x0004, //!< Packet was received with bad FCS
892     SPINEL_MD_FLAG_DUPE      = 0x0008, //!< Packet seems to be a duplicate
893     SPINEL_MD_FLAG_ACKED_FP  = 0x0010, //!< Packet was acknowledged with frame pending set
894     SPINEL_MD_FLAG_ACKED_SEC = 0x0020, //!< Packet was acknowledged with secure enhance ACK
895     SPINEL_MD_FLAG_RESERVED  = 0xFFC2, //!< Flags reserved for future use.
896 };
897 
898 enum
899 {
900     SPINEL_RESET_PLATFORM = 1,
901     SPINEL_RESET_STACK    = 2,
902 };
903 
904 enum
905 {
906     /**
907      * No-Operation command (Host -> NCP)
908      *
909      * Encoding: Empty
910      *
911      * Induces the NCP to send a success status back to the host. This is
912      * primarily used for liveliness checks. The command payload for this
913      * command SHOULD be empty.
914      *
915      * There is no error condition for this command.
916      *
917      */
918     SPINEL_CMD_NOOP = 0,
919 
920     /**
921      * Reset NCP command (Host -> NCP)
922      *
923      * Encoding: Empty or `C`
924      *
925      * Causes the NCP to perform a software reset. Due to the nature of
926      * this command, the TID is ignored. The host should instead wait
927      * for a `CMD_PROP_VALUE_IS` command from the NCP indicating
928      * `PROP_LAST_STATUS` has been set to `STATUS_RESET_SOFTWARE`.
929      *
930      * The optional command payload specifies the reset type, can be
931      * `SPINEL_RESET_PLATFORM` or `SPINEL_RESET_STACK`. Defaults to stack
932      * reset if unspecified.
933      *
934      * If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
935      * instead with the value set to the generated status code for the error.
936      *
937      */
938     SPINEL_CMD_RESET = 1,
939 
940     /**
941      * Get property value command (Host -> NCP)
942      *
943      * Encoding: `i`
944      *   `i` : Property Id
945      *
946      * Causes the NCP to emit a `CMD_PROP_VALUE_IS` command for the
947      * given property identifier.
948      *
949      * The payload for this command is the property identifier encoded
950      * in the packed unsigned integer format `i`.
951      *
952      * If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
953      * instead with the value set to the generated status code for the error.
954      *
955      */
956     SPINEL_CMD_PROP_VALUE_GET = 2,
957 
958     /**
959      * Set property value command (Host -> NCP)
960      *
961      * Encoding: `iD`
962      *   `i` : Property Id
963      *   `D` : Value (encoding depends on the property)
964      *
965      * Instructs the NCP to set the given property to the specific given
966      * value, replacing any previous value.
967      *
968      * The payload for this command is the property identifier encoded in the
969      * packed unsigned integer format, followed by the property value. The
970      * exact format of the property value is defined by the property.
971      *
972      * On success a `CMD_PROP_VALUE_IS` command is emitted either for the
973      * given property identifier with the set value, or for `PROP_LAST_STATUS`
974      * with value `LAST_STATUS_OK`.
975      *
976      * If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
977      * with the value set to the generated status code for the error.
978      *
979      */
980     SPINEL_CMD_PROP_VALUE_SET = 3,
981 
982     /**
983      * Insert value into property command (Host -> NCP)
984      *
985      * Encoding: `iD`
986      *   `i` : Property Id
987      *   `D` : Value (encoding depends on the property)
988      *
989      * Instructs the NCP to insert the given value into a list-oriented
990      * property without removing other items in the list. The resulting order
991      * of items in the list is defined by the individual property being
992      * operated on.
993      *
994      * The payload for this command is the property identifier encoded in the
995      * packed unsigned integer format, followed by the value to be inserted.
996      * The exact format of the value is defined by the property.
997      *
998      * If the type signature of the property consists of a single structure
999      * enclosed by an array `A(t(...))`, then the contents of value MUST
1000      * contain the contents of the structure (`...`) rather than the
1001      * serialization of the whole item (`t(...)`).  Specifically, the length
1002      * of the structure MUST NOT be prepended to value. This helps to
1003      * eliminate redundant data.
1004      *
1005      * On success, either a `CMD_PROP_VALUE_INSERTED` command is emitted for
1006      * the given property, or a `CMD_PROP_VALUE_IS` command is emitted of
1007      * property `PROP_LAST_STATUS` with value `LAST_STATUS_OK`.
1008      *
1009      * If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
1010      * with the value set to the generated status code for the error.
1011      *
1012      */
1013     SPINEL_CMD_PROP_VALUE_INSERT = 4,
1014 
1015     /**
1016      * Remove value from property command (Host -> NCP)
1017      *
1018      * Encoding: `iD`
1019      *   `i` : Property Id
1020      *   `D` : Value (encoding depends on the property)
1021 
1022      * Instructs the NCP to remove the given value from a list-oriented property,
1023      * without affecting other items in the list. The resulting order of items
1024      * in the list is defined by the individual property being operated on.
1025      *
1026      * Note that this command operates by value, not by index!
1027      *
1028      * The payload for this command is the property identifier encoded in the
1029      * packed unsigned integer format, followed by the value to be removed. The
1030      * exact format of the value is defined by the property.
1031      *
1032      * If the type signature of the property consists of a single structure
1033      * enclosed by an array `A(t(...))`, then the contents of value MUST contain
1034      * the contents of the structure (`...`) rather than the serialization of the
1035      * whole item (`t(...)`).  Specifically, the length of the structure MUST NOT
1036      * be prepended to `VALUE`. This helps to eliminate redundant data.
1037      *
1038      * On success, either a `CMD_PROP_VALUE_REMOVED` command is emitted for the
1039      * given property, or a `CMD_PROP_VALUE_IS` command is emitted of property
1040      * `PROP_LAST_STATUS` with value `LAST_STATUS_OK`.
1041      *
1042      * If an error occurs, the value of `PROP_LAST_STATUS` will be emitted
1043      * with the value set to the generated status code for the error.
1044      *
1045      */
1046     SPINEL_CMD_PROP_VALUE_REMOVE = 5,
1047 
1048     /**
1049      * Property value notification command (NCP -> Host)
1050      *
1051      * Encoding: `iD`
1052      *   `i` : Property Id
1053      *   `D` : Value (encoding depends on the property)
1054      *
1055      * This command can be sent by the NCP in response to a previous command
1056      * from the host, or it can be sent by the NCP in an unsolicited fashion
1057      * to notify the host of various state changes asynchronously.
1058      *
1059      * The payload for this command is the property identifier encoded in the
1060      * packed unsigned integer format, followed by the current value of the
1061      * given property.
1062      *
1063      */
1064     SPINEL_CMD_PROP_VALUE_IS = 6,
1065 
1066     /**
1067      * Property value insertion notification command (NCP -> Host)
1068      *
1069      * Encoding:`iD`
1070      *   `i` : Property Id
1071      *   `D` : Value (encoding depends on the property)
1072      *
1073      * This command can be sent by the NCP in response to the
1074      * `CMD_PROP_VALUE_INSERT` command, or it can be sent by the NCP in an
1075      * unsolicited fashion to notify the host of various state changes
1076      * asynchronously.
1077      *
1078      * The payload for this command is the property identifier encoded in the
1079      * packed unsigned integer format, followed by the value that was inserted
1080      * into the given property.
1081      *
1082      * If the type signature of the property specified by property id consists
1083      * of a single structure enclosed by an array (`A(t(...))`), then the
1084      * contents of value MUST contain the contents of the structure (`...`)
1085      * rather than the serialization of the whole item (`t(...)`). Specifically,
1086      * the length of the structure MUST NOT be prepended to `VALUE`. This
1087      * helps to eliminate redundant data.
1088      *
1089      * The resulting order of items in the list is defined by the given
1090      * property.
1091      *
1092      */
1093     SPINEL_CMD_PROP_VALUE_INSERTED = 7,
1094 
1095     /**
1096      * Property value removal notification command (NCP -> Host)
1097      *
1098      * Encoding: `iD`
1099      *   `i` : Property Id
1100      *   `D` : Value (encoding depends on the property)
1101      *
1102      * This command can be sent by the NCP in response to the
1103      * `CMD_PROP_VALUE_REMOVE` command, or it can be sent by the NCP in an
1104      * unsolicited fashion to notify the host of various state changes
1105      * asynchronously.
1106      *
1107      * Note that this command operates by value, not by index!
1108      *
1109      * The payload for this command is the property identifier encoded in the
1110      * packed unsigned integer format described in followed by the value that
1111      * was removed from the given property.
1112      *
1113      * If the type signature of the property specified by property id consists
1114      * of a single structure enclosed by an array (`A(t(...))`), then the
1115      * contents of value MUST contain the contents of the structure (`...`)
1116      * rather than the serialization of the whole item (`t(...)`).  Specifically,
1117      * the length of the structure MUST NOT be prepended to `VALUE`. This
1118      * helps to eliminate redundant data.
1119      *
1120      * The resulting order of items in the list is defined by the given
1121      * property.
1122      *
1123      */
1124     SPINEL_CMD_PROP_VALUE_REMOVED = 8,
1125 
1126     SPINEL_CMD_NET_SAVE = 9, // Deprecated
1127 
1128     /**
1129      * Clear saved network settings command (Host -> NCP)
1130      *
1131      * Encoding: Empty
1132      *
1133      * Erases all network credentials and state from non-volatile memory.
1134      *
1135      * This operation affects non-volatile memory only. The current network
1136      * information stored in volatile memory is unaffected.
1137      *
1138      * The response to this command is always a `CMD_PROP_VALUE_IS` for
1139      * `PROP_LAST_STATUS`, indicating the result of the operation.
1140      *
1141      */
1142     SPINEL_CMD_NET_CLEAR = 10,
1143 
1144     SPINEL_CMD_NET_RECALL = 11, // Deprecated
1145 
1146     /**
1147      * Host buffer offload is an optional NCP capability that, when
1148      * present, allows the NCP to store data buffers on the host processor
1149      * that can be recalled at a later time.
1150      *
1151      * The presence of this feature can be detected by the host by
1152      * checking for the presence of the `CAP_HBO`
1153      * capability in `PROP_CAPS`.
1154      *
1155      * This feature is not currently supported on OpenThread.
1156      *
1157      */
1158 
1159     SPINEL_CMD_HBO_OFFLOAD   = 12,
1160     SPINEL_CMD_HBO_RECLAIM   = 13,
1161     SPINEL_CMD_HBO_DROP      = 14,
1162     SPINEL_CMD_HBO_OFFLOADED = 15,
1163     SPINEL_CMD_HBO_RECLAIMED = 16,
1164     SPINEL_CMD_HBO_DROPPED   = 17,
1165 
1166     /**
1167      * Peek command (Host -> NCP)
1168      *
1169      * Encoding: `LU`
1170      *   `L` : The address to peek
1171      *   `U` : Number of bytes to read
1172      *
1173      * This command allows the NCP to fetch values from the RAM of the NCP
1174      * for debugging purposes. Upon success, `CMD_PEEK_RET` is sent from the
1175      * NCP to the host. Upon failure, `PROP_LAST_STATUS` is emitted with
1176      * the appropriate error indication.
1177      *
1178      * The NCP MAY prevent certain regions of memory from being accessed.
1179      *
1180      * This command requires the capability `CAP_PEEK_POKE` to be present.
1181      *
1182      */
1183     SPINEL_CMD_PEEK = 18,
1184 
1185     /**
1186      * Peek return command (NCP -> Host)
1187      *
1188      * Encoding: `LUD`
1189      *   `L` : The address peeked
1190      *   `U` : Number of bytes read
1191      *   `D` : Memory content
1192      *
1193      * This command contains the contents of memory that was requested by
1194      * a previous call to `CMD_PEEK`.
1195      *
1196      * This command requires the capability `CAP_PEEK_POKE` to be present.
1197      *
1198      */
1199     SPINEL_CMD_PEEK_RET = 19,
1200 
1201     /**
1202      * Poke command (Host -> NCP)
1203      *
1204      * Encoding: `LUD`
1205      *   `L` : The address to be poked
1206      *   `U` : Number of bytes to write
1207      *   `D` : Content to write
1208      *
1209      * This command writes the bytes to the specified memory address
1210      * for debugging purposes.
1211      *
1212      * This command requires the capability `CAP_PEEK_POKE` to be present.
1213      *
1214      */
1215     SPINEL_CMD_POKE = 20,
1216 
1217     SPINEL_CMD_PROP_VALUE_MULTI_GET = 21,
1218     SPINEL_CMD_PROP_VALUE_MULTI_SET = 22,
1219     SPINEL_CMD_PROP_VALUES_ARE      = 23,
1220 
1221     SPINEL_CMD_NEST__BEGIN = 15296,
1222     SPINEL_CMD_NEST__END   = 15360,
1223 
1224     SPINEL_CMD_VENDOR__BEGIN = 15360,
1225     SPINEL_CMD_VENDOR__END   = 16384,
1226 
1227     SPINEL_CMD_EXPERIMENTAL__BEGIN = 2000000,
1228     SPINEL_CMD_EXPERIMENTAL__END   = 2097152,
1229 };
1230 
1231 typedef uint32_t spinel_command_t;
1232 
1233 enum
1234 {
1235     SPINEL_CAP_LOCK       = 1,
1236     SPINEL_CAP_NET_SAVE   = 2,
1237     SPINEL_CAP_HBO        = 3,
1238     SPINEL_CAP_POWER_SAVE = 4,
1239 
1240     SPINEL_CAP_COUNTERS   = 5,
1241     SPINEL_CAP_JAM_DETECT = 6,
1242 
1243     SPINEL_CAP_PEEK_POKE = 7,
1244 
1245     SPINEL_CAP_WRITABLE_RAW_STREAM = 8,
1246     SPINEL_CAP_GPIO                = 9,
1247     SPINEL_CAP_TRNG                = 10,
1248     SPINEL_CAP_CMD_MULTI           = 11,
1249     SPINEL_CAP_UNSOL_UPDATE_FILTER = 12,
1250     SPINEL_CAP_MCU_POWER_STATE     = 13,
1251     SPINEL_CAP_PCAP                = 14,
1252 
1253     SPINEL_CAP_802_15_4__BEGIN        = 16,
1254     SPINEL_CAP_802_15_4_2003          = (SPINEL_CAP_802_15_4__BEGIN + 0),
1255     SPINEL_CAP_802_15_4_2006          = (SPINEL_CAP_802_15_4__BEGIN + 1),
1256     SPINEL_CAP_802_15_4_2011          = (SPINEL_CAP_802_15_4__BEGIN + 2),
1257     SPINEL_CAP_802_15_4_PIB           = (SPINEL_CAP_802_15_4__BEGIN + 5),
1258     SPINEL_CAP_802_15_4_2450MHZ_OQPSK = (SPINEL_CAP_802_15_4__BEGIN + 8),
1259     SPINEL_CAP_802_15_4_915MHZ_OQPSK  = (SPINEL_CAP_802_15_4__BEGIN + 9),
1260     SPINEL_CAP_802_15_4_868MHZ_OQPSK  = (SPINEL_CAP_802_15_4__BEGIN + 10),
1261     SPINEL_CAP_802_15_4_915MHZ_BPSK   = (SPINEL_CAP_802_15_4__BEGIN + 11),
1262     SPINEL_CAP_802_15_4_868MHZ_BPSK   = (SPINEL_CAP_802_15_4__BEGIN + 12),
1263     SPINEL_CAP_802_15_4_915MHZ_ASK    = (SPINEL_CAP_802_15_4__BEGIN + 13),
1264     SPINEL_CAP_802_15_4_868MHZ_ASK    = (SPINEL_CAP_802_15_4__BEGIN + 14),
1265     SPINEL_CAP_802_15_4__END          = 32,
1266 
1267     SPINEL_CAP_CONFIG__BEGIN = 32,
1268     SPINEL_CAP_CONFIG_FTD    = (SPINEL_CAP_CONFIG__BEGIN + 0),
1269     SPINEL_CAP_CONFIG_MTD    = (SPINEL_CAP_CONFIG__BEGIN + 1),
1270     SPINEL_CAP_CONFIG_RADIO  = (SPINEL_CAP_CONFIG__BEGIN + 2),
1271     SPINEL_CAP_CONFIG__END   = 40,
1272 
1273     SPINEL_CAP_ROLE__BEGIN = 48,
1274     SPINEL_CAP_ROLE_ROUTER = (SPINEL_CAP_ROLE__BEGIN + 0),
1275     SPINEL_CAP_ROLE_SLEEPY = (SPINEL_CAP_ROLE__BEGIN + 1),
1276     SPINEL_CAP_ROLE__END   = 52,
1277 
1278     SPINEL_CAP_NET__BEGIN     = 52,
1279     SPINEL_CAP_NET_THREAD_1_0 = (SPINEL_CAP_NET__BEGIN + 0),
1280     SPINEL_CAP_NET_THREAD_1_1 = (SPINEL_CAP_NET__BEGIN + 1),
1281     SPINEL_CAP_NET_THREAD_1_2 = (SPINEL_CAP_NET__BEGIN + 2),
1282     SPINEL_CAP_NET__END       = 64,
1283 
1284     SPINEL_CAP_RCP__BEGIN               = 64,
1285     SPINEL_CAP_RCP_API_VERSION          = (SPINEL_CAP_RCP__BEGIN + 0),
1286     SPINEL_CAP_RCP_MIN_HOST_API_VERSION = (SPINEL_CAP_RCP__BEGIN + 1),
1287     SPINEL_CAP_RCP__END                 = 80,
1288 
1289     SPINEL_CAP_OPENTHREAD__BEGIN       = 512,
1290     SPINEL_CAP_MAC_ALLOWLIST           = (SPINEL_CAP_OPENTHREAD__BEGIN + 0),
1291     SPINEL_CAP_MAC_RAW                 = (SPINEL_CAP_OPENTHREAD__BEGIN + 1),
1292     SPINEL_CAP_OOB_STEERING_DATA       = (SPINEL_CAP_OPENTHREAD__BEGIN + 2),
1293     SPINEL_CAP_CHANNEL_MONITOR         = (SPINEL_CAP_OPENTHREAD__BEGIN + 3),
1294     SPINEL_CAP_ERROR_RATE_TRACKING     = (SPINEL_CAP_OPENTHREAD__BEGIN + 4),
1295     SPINEL_CAP_CHANNEL_MANAGER         = (SPINEL_CAP_OPENTHREAD__BEGIN + 5),
1296     SPINEL_CAP_OPENTHREAD_LOG_METADATA = (SPINEL_CAP_OPENTHREAD__BEGIN + 6),
1297     SPINEL_CAP_TIME_SYNC               = (SPINEL_CAP_OPENTHREAD__BEGIN + 7),
1298     SPINEL_CAP_CHILD_SUPERVISION       = (SPINEL_CAP_OPENTHREAD__BEGIN + 8),
1299     SPINEL_CAP_POSIX                   = (SPINEL_CAP_OPENTHREAD__BEGIN + 9),
1300     SPINEL_CAP_SLAAC                   = (SPINEL_CAP_OPENTHREAD__BEGIN + 10),
1301     SPINEL_CAP_RADIO_COEX              = (SPINEL_CAP_OPENTHREAD__BEGIN + 11),
1302     SPINEL_CAP_MAC_RETRY_HISTOGRAM     = (SPINEL_CAP_OPENTHREAD__BEGIN + 12),
1303     SPINEL_CAP_MULTI_RADIO             = (SPINEL_CAP_OPENTHREAD__BEGIN + 13),
1304     SPINEL_CAP_SRP_CLIENT              = (SPINEL_CAP_OPENTHREAD__BEGIN + 14),
1305     SPINEL_CAP_DUA                     = (SPINEL_CAP_OPENTHREAD__BEGIN + 15),
1306     SPINEL_CAP_REFERENCE_DEVICE        = (SPINEL_CAP_OPENTHREAD__BEGIN + 16),
1307     SPINEL_CAP_OPENTHREAD__END         = 640,
1308 
1309     SPINEL_CAP_THREAD__BEGIN          = 1024,
1310     SPINEL_CAP_THREAD_COMMISSIONER    = (SPINEL_CAP_THREAD__BEGIN + 0),
1311     SPINEL_CAP_THREAD_TMF_PROXY       = (SPINEL_CAP_THREAD__BEGIN + 1),
1312     SPINEL_CAP_THREAD_UDP_FORWARD     = (SPINEL_CAP_THREAD__BEGIN + 2),
1313     SPINEL_CAP_THREAD_JOINER          = (SPINEL_CAP_THREAD__BEGIN + 3),
1314     SPINEL_CAP_THREAD_BORDER_ROUTER   = (SPINEL_CAP_THREAD__BEGIN + 4),
1315     SPINEL_CAP_THREAD_SERVICE         = (SPINEL_CAP_THREAD__BEGIN + 5),
1316     SPINEL_CAP_THREAD_CSL_RECEIVER    = (SPINEL_CAP_THREAD__BEGIN + 6),
1317     SPINEL_CAP_THREAD_LINK_METRICS    = (SPINEL_CAP_THREAD__BEGIN + 7),
1318     SPINEL_CAP_THREAD_BACKBONE_ROUTER = (SPINEL_CAP_THREAD__BEGIN + 8),
1319     SPINEL_CAP_THREAD__END            = 1152,
1320 
1321     SPINEL_CAP_NEST__BEGIN           = 15296,
1322     SPINEL_CAP_NEST_LEGACY_INTERFACE = (SPINEL_CAP_NEST__BEGIN + 0), ///< deprecated
1323     SPINEL_CAP_NEST_LEGACY_NET_WAKE  = (SPINEL_CAP_NEST__BEGIN + 1), ///< deprecated
1324     SPINEL_CAP_NEST_TRANSMIT_HOOK    = (SPINEL_CAP_NEST__BEGIN + 2),
1325     SPINEL_CAP_NEST__END             = 15360,
1326 
1327     SPINEL_CAP_VENDOR__BEGIN = 15360,
1328     SPINEL_CAP_VENDOR__END   = 16384,
1329 
1330     SPINEL_CAP_EXPERIMENTAL__BEGIN = 2000000,
1331     SPINEL_CAP_EXPERIMENTAL__END   = 2097152,
1332 };
1333 
1334 typedef uint32_t spinel_capability_t;
1335 
1336 /**
1337  * Property Keys
1338  *
1339  * The properties are broken up into several sections, each with a
1340  * reserved ranges of property identifiers:
1341  *
1342  *    Name         | Range (Inclusive)              | Description
1343  *    -------------|--------------------------------|------------------------
1344  *    Core         | 0x000 - 0x01F, 0x1000 - 0x11FF | Spinel core
1345  *    PHY          | 0x020 - 0x02F, 0x1200 - 0x12FF | Radio PHY layer
1346  *    MAC          | 0x030 - 0x03F, 0x1300 - 0x13FF | MAC layer
1347  *    NET          | 0x040 - 0x04F, 0x1400 - 0x14FF | Network
1348  *    Thread       | 0x050 - 0x05F, 0x1500 - 0x15FF | Thread
1349  *    IPv6         | 0x060 - 0x06F, 0x1600 - 0x16FF | IPv6
1350  *    Stream       | 0x070 - 0x07F, 0x1700 - 0x17FF | Stream
1351  *    MeshCop      | 0x080 - 0x08F, 0x1800 - 0x18FF | Thread Mesh Commissioning
1352  *    OpenThread   |                0x1900 - 0x19FF | OpenThread specific
1353  *    Server       | 0x0A0 - 0x0AF                  | ALOC Service Server
1354  *    RCP          | 0x0B0 - 0x0FF                  | RCP specific
1355  *    Interface    | 0x100 - 0x1FF                  | Interface (e.g., UART)
1356  *    PIB          | 0x400 - 0x4FF                  | 802.15.4 PIB
1357  *    Counter      | 0x500 - 0x7FF                  | Counters (MAC, IP, etc).
1358  *    RCP          | 0x800 - 0x8FF                  | RCP specific property (extended)
1359  *    Nest         |                0x3BC0 - 0x3BFF | Nest (legacy)
1360  *    Vendor       |                0x3C00 - 0x3FFF | Vendor specific
1361  *    Debug        |                0x4000 - 0x43FF | Debug related
1362  *    Experimental |          2,000,000 - 2,097,151 | Experimental use only
1363  *
1364  */
1365 enum
1366 {
1367     /// Last Operation Status
1368     /** Format: `i` - Read-only
1369      *
1370      * Describes the status of the last operation. Encoded as a packed
1371      * unsigned integer (see `SPINEL_STATUS_*` for list of values).
1372      *
1373      * This property is emitted often to indicate the result status of
1374      * pretty much any Host-to-NCP operation.
1375      *
1376      * It is emitted automatically at NCP startup with a value indicating
1377      * the reset reason. It is also emitted asynchronously on an error (
1378      * e.g., NCP running out of buffer).
1379      *
1380      */
1381     SPINEL_PROP_LAST_STATUS = 0,
1382 
1383     /// Protocol Version
1384     /** Format: `ii` - Read-only
1385      *
1386      * Describes the protocol version information. This property contains
1387      * two fields, each encoded as a packed unsigned integer:
1388      *   `i`: Major Version Number
1389      *   `i`: Minor Version Number
1390      *
1391      * The version number is defined by `SPINEL_PROTOCOL_VERSION_THREAD_MAJOR`
1392      * and `SPINEL_PROTOCOL_VERSION_THREAD_MINOR`.
1393      *
1394      * This specification describes major version 4, minor version 3.
1395      *
1396      */
1397     SPINEL_PROP_PROTOCOL_VERSION = 1,
1398 
1399     /// NCP Version
1400     /** Format: `U` - Read-only
1401      *
1402      * Contains a string which describes the firmware currently running on
1403      * the NCP. Encoded as a zero-terminated UTF-8 string.
1404      *
1405      */
1406     SPINEL_PROP_NCP_VERSION = 2,
1407 
1408     /// NCP Network Protocol Type
1409     /** Format: 'i' - Read-only
1410      *
1411      * This value identifies what the network protocol for this NCP.
1412      * The valid protocol type values are defined by enumeration
1413      * `SPINEL_PROTOCOL_TYPE_*`:
1414      *
1415      *   `SPINEL_PROTOCOL_TYPE_BOOTLOADER` = 0
1416      *   `SPINEL_PROTOCOL_TYPE_ZIGBEE_IP`  = 2,
1417      *   `SPINEL_PROTOCOL_TYPE_THREAD`     = 3,
1418      *
1419      * OpenThread NCP supports only `SPINEL_PROTOCOL_TYPE_THREAD`
1420      *
1421      */
1422     SPINEL_PROP_INTERFACE_TYPE = 3,
1423 
1424     /// NCP Vendor ID
1425     /** Format: 'i` - Read-only
1426      *
1427      * Vendor ID. Zero for unknown.
1428      *
1429      */
1430     SPINEL_PROP_VENDOR_ID = 4,
1431 
1432     /// NCP Capability List
1433     /** Format: 'A(i)` - Read-only
1434      *
1435      * Describes the supported capabilities of this NCP. Encoded as a list of
1436      * packed unsigned integers.
1437      *
1438      * The capability values are specified by SPINEL_CAP_* enumeration.
1439      *
1440      */
1441     SPINEL_PROP_CAPS = 5,
1442 
1443     /// NCP Interface Count
1444     /** Format: 'C` - Read-only
1445      *
1446      * Provides number of interfaces.
1447      *
1448      * Currently always reads as 1.
1449      *
1450      */
1451     SPINEL_PROP_INTERFACE_COUNT = 6,
1452 
1453     SPINEL_PROP_POWER_STATE = 7, ///< PowerState [C] (deprecated, use `MCU_POWER_STATE` instead).
1454 
1455     /// NCP Hardware Address
1456     /** Format: 'E` - Read-only
1457      *
1458      * The static EUI64 address of the device, used as a serial number.
1459      *
1460      */
1461     SPINEL_PROP_HWADDR = 8,
1462 
1463     SPINEL_PROP_LOCK          = 9,  ///< PropLock [b] (not supported)
1464     SPINEL_PROP_HBO_MEM_MAX   = 10, ///< Max offload mem [S] (not supported)
1465     SPINEL_PROP_HBO_BLOCK_MAX = 11, ///< Max offload block [S] (not supported)
1466 
1467     /// Host Power State
1468     /** Format: 'C`
1469      *
1470      * Describes the current power state of the host. This property is used
1471      * by the host to inform the NCP when it has changed power states. The
1472      * NCP can then use this state to determine which properties need
1473      * asynchronous updates. Enumeration `spinel_host_power_state_t` defines
1474      * the valid values (`SPINEL_HOST_POWER_STATE_*`):
1475      *
1476      *   `HOST_POWER_STATE_OFFLINE`: Host is physically powered off and
1477      *   cannot be woken by the NCP. All asynchronous commands are
1478      *   squelched.
1479      *
1480      *   `HOST_POWER_STATE_DEEP_SLEEP`: The host is in a low power state
1481      *   where it can be woken by the NCP but will potentially require more
1482      *   than two seconds to become fully responsive. The NCP MUST
1483      *   avoid sending unnecessary property updates, such as child table
1484      *   updates or non-critical messages on the debug stream. If the NCP
1485      *   needs to wake the host for traffic, the NCP MUST first take
1486      *   action to wake the host. Once the NCP signals to the host that it
1487      *   should wake up, the NCP MUST wait for some activity from the
1488      *   host (indicating that it is fully awake) before sending frames.
1489      *
1490      *   `HOST_POWER_STATE_RESERVED`:  This value MUST NOT be set by the host. If
1491      *   received by the NCP, the NCP SHOULD consider this as a synonym
1492      *   of `HOST_POWER_STATE_DEEP_SLEEP`.
1493      *
1494      *   `HOST_POWER_STATE_LOW_POWER`: The host is in a low power state
1495      *   where it can be immediately woken by the NCP. The NCP SHOULD
1496      *   avoid sending unnecessary property updates, such as child table
1497      *   updates or non-critical messages on the debug stream.
1498      *
1499      *   `HOST_POWER_STATE_ONLINE`: The host is awake and responsive. No
1500      *   special filtering is performed by the NCP on asynchronous updates.
1501      *
1502      *   All other values are RESERVED. They MUST NOT be set by the
1503      *   host. If received by the NCP, the NCP SHOULD consider the value as
1504      *   a synonym of `HOST_POWER_STATE_LOW_POWER`.
1505      *
1506      * After setting this power state, any further commands from the host to
1507      * the NCP will cause `HOST_POWER_STATE` to automatically revert to
1508      * `HOST_POWER_STATE_ONLINE`.
1509      *
1510      * When the host is entering a low-power state, it should wait for the
1511      * response from the NCP acknowledging the command (with `CMD_VALUE_IS`).
1512      * Once that acknowledgment is received the host may enter the low-power
1513      * state.
1514      *
1515      * If the NCP has the `CAP_UNSOL_UPDATE_FILTER` capability, any unsolicited
1516      * property updates masked by `PROP_UNSOL_UPDATE_FILTER` should be honored
1517      * while the host indicates it is in a low-power state. After resuming to the
1518      * `HOST_POWER_STATE_ONLINE` state, the value of `PROP_UNSOL_UPDATE_FILTER`
1519      * MUST be unchanged from the value assigned prior to the host indicating
1520      * it was entering a low-power state.
1521      *
1522      */
1523     SPINEL_PROP_HOST_POWER_STATE = 12,
1524 
1525     /// NCP's MCU Power State
1526     /** Format: 'C`
1527      *  Required capability: CAP_MCU_POWER_SAVE
1528      *
1529      * This property specifies the desired power state of NCP's micro-controller
1530      * (MCU) when the underlying platform's operating system enters idle mode (i.e.,
1531      * all active tasks/events are processed and the MCU can potentially enter a
1532      * energy-saving power state).
1533      *
1534      * The power state primarily determines how the host should interact with the NCP
1535      * and whether the host needs an external trigger (a "poke") to NCP before it can
1536      * communicate with the NCP or not. After a reset, the MCU power state MUST be
1537      * SPINEL_MCU_POWER_STATE_ON.
1538      *
1539      * Enumeration `spinel_mcu_power_state_t` defines the valid values
1540      * (`SPINEL_MCU_POWER_STATE_*` constants):
1541      *
1542      *   `SPINEL_MCU_POWER_STATE_ON`: NCP's MCU stays on and active all the time.
1543      *   When the NCP's desired power state is set to this value, host can send
1544      *   messages to NCP without requiring any "poke" or external triggers. MCU is
1545      *   expected to stay on and active. Note that the `ON` power state only
1546      *   determines the MCU's power mode and is not related to radio's state.
1547      *
1548      *   `SPINEL_MCU_POWER_STATE_LOW_POWER`: NCP's MCU can enter low-power
1549      *   (energy-saving) state. When the NCP's desired power state is set to
1550      *   `LOW_POWER`, host is expected to "poke" the NCP (e.g., an external trigger
1551      *   like an interrupt) before it can communicate with the NCP (send a message
1552      *   to the NCP). The "poke" mechanism is determined by the platform code (based
1553      *   on NCP's interface to the host).
1554      *   While power state is set to `LOW_POWER`, NCP can still (at any time) send
1555      *   messages to host. Note that receiving a message from the NCP does NOT
1556      *   indicate that the NCP's power state has changed, i.e., host is expected to
1557      *   continue to "poke" NCP when it wants to talk to the NCP until the power
1558      *   state is explicitly changed (by setting this property to `ON`).
1559      *   Note that the `LOW_POWER` power state only determines the MCU's power mode
1560      *   and is not related to radio's state.
1561      *
1562      *   `SPINEL_MCU_POWER_STATE_OFF`: NCP is fully powered off.
1563      *   An NCP hardware reset (via a RESET pin) is required to bring the NCP back
1564      *   to `SPINEL_MCU_POWER_STATE_ON`. RAM is not retained after reset.
1565      *
1566      */
1567     SPINEL_PROP_MCU_POWER_STATE = 13,
1568 
1569     SPINEL_PROP_BASE_EXT__BEGIN = 0x1000,
1570 
1571     /// GPIO Configuration
1572     /** Format: `A(CCU)`
1573      *  Type: Read-Only (Optionally Read-write using `CMD_PROP_VALUE_INSERT`)
1574      *
1575      * An array of structures which contain the following fields:
1576      *
1577      * *   `C`: GPIO Number
1578      * *   `C`: GPIO Configuration Flags
1579      * *   `U`: Human-readable GPIO name
1580      *
1581      * GPIOs which do not have a corresponding entry are not supported.
1582      *
1583      * The configuration parameter contains the configuration flags for the
1584      * GPIO:
1585      *
1586      *       0   1   2   3   4   5   6   7
1587      *     +---+---+---+---+---+---+---+---+
1588      *     |DIR|PUP|PDN|TRIGGER|  RESERVED |
1589      *     +---+---+---+---+---+---+---+---+
1590      *             |O/D|
1591      *             +---+
1592      *
1593      * *   `DIR`: Pin direction. Clear (0) for input, set (1) for output.
1594      * *   `PUP`: Pull-up enabled flag.
1595      * *   `PDN`/`O/D`: Flag meaning depends on pin direction:
1596      *     *   Input: Pull-down enabled.
1597      *     *   Output: Output is an open-drain.
1598      * *   `TRIGGER`: Enumeration describing how pin changes generate
1599      *     asynchronous notification commands (TBD) from the NCP to the host.
1600      *     *   0: Feature disabled for this pin
1601      *     *   1: Trigger on falling edge
1602      *     *   2: Trigger on rising edge
1603      *     *   3: Trigger on level change
1604      * *   `RESERVED`: Bits reserved for future use. Always cleared to zero
1605      *     and ignored when read.
1606      *
1607      * As an optional feature, the configuration of individual pins may be
1608      * modified using the `CMD_PROP_VALUE_INSERT` command. Only the GPIO
1609      * number and flags fields MUST be present, the GPIO name (if present)
1610      * would be ignored. This command can only be used to modify the
1611      * configuration of GPIOs which are already exposed---it cannot be used
1612      * by the host to add additional GPIOs.
1613      */
1614     SPINEL_PROP_GPIO_CONFIG = SPINEL_PROP_BASE_EXT__BEGIN + 0,
1615 
1616     /// GPIO State Bitmask
1617     /** Format: `D`
1618      *  Type: Read-Write
1619      *
1620      * Contains a bit field identifying the state of the GPIOs. The length of
1621      * the data associated with these properties depends on the number of
1622      * GPIOs. If you have 10 GPIOs, you'd have two bytes. GPIOs are numbered
1623      * from most significant bit to least significant bit, so 0x80 is GPIO 0,
1624      * 0x40 is GPIO 1, etc.
1625      *
1626      * For GPIOs configured as inputs:
1627      *
1628      * *   `CMD_PROP_VALUE_GET`: The value of the associated bit describes the
1629      *     logic level read from the pin.
1630      * *   `CMD_PROP_VALUE_SET`: The value of the associated bit is ignored
1631      *     for these pins.
1632      *
1633      * For GPIOs configured as outputs:
1634      *
1635      * *   `CMD_PROP_VALUE_GET`: The value of the associated bit is
1636      *     implementation specific.
1637      * *   `CMD_PROP_VALUE_SET`: The value of the associated bit determines
1638      *     the new logic level of the output. If this pin is configured as an
1639      *     open-drain, setting the associated bit to 1 will cause the pin to
1640      *     enter a Hi-Z state.
1641      *
1642      * For GPIOs which are not specified in `PROP_GPIO_CONFIG`:
1643      *
1644      * *   `CMD_PROP_VALUE_GET`: The value of the associated bit is
1645      *     implementation specific.
1646      * *   `CMD_PROP_VALUE_SET`: The value of the associated bit MUST be
1647      *     ignored by the NCP.
1648      *
1649      * When writing, unspecified bits are assumed to be zero.
1650      */
1651     SPINEL_PROP_GPIO_STATE = SPINEL_PROP_BASE_EXT__BEGIN + 2,
1652 
1653     /// GPIO State Set-Only Bitmask
1654     /** Format: `D`
1655      *  Type: Write-Only
1656      *
1657      * Allows for the state of various output GPIOs to be set without affecting
1658      * other GPIO states. Contains a bit field identifying the output GPIOs that
1659      * should have their state set to 1.
1660      *
1661      * When writing, unspecified bits are assumed to be zero. The value of
1662      * any bits for GPIOs which are not specified in `PROP_GPIO_CONFIG` MUST
1663      * be ignored.
1664      */
1665     SPINEL_PROP_GPIO_STATE_SET = SPINEL_PROP_BASE_EXT__BEGIN + 3,
1666 
1667     /// GPIO State Clear-Only Bitmask
1668     /** Format: `D`
1669      *  Type: Write-Only
1670      *
1671      * Allows for the state of various output GPIOs to be cleared without affecting
1672      * other GPIO states. Contains a bit field identifying the output GPIOs that
1673      * should have their state cleared to 0.
1674      *
1675      * When writing, unspecified bits are assumed to be zero. The value of
1676      * any bits for GPIOs which are not specified in `PROP_GPIO_CONFIG` MUST
1677      * be ignored.
1678      */
1679     SPINEL_PROP_GPIO_STATE_CLEAR = SPINEL_PROP_BASE_EXT__BEGIN + 4,
1680 
1681     /// 32-bit random number from TRNG, ready-to-use.
1682     SPINEL_PROP_TRNG_32 = SPINEL_PROP_BASE_EXT__BEGIN + 5,
1683 
1684     /// 16 random bytes from TRNG, ready-to-use.
1685     SPINEL_PROP_TRNG_128 = SPINEL_PROP_BASE_EXT__BEGIN + 6,
1686 
1687     /// Raw samples from TRNG entropy source representing 32 bits of entropy.
1688     SPINEL_PROP_TRNG_RAW_32 = SPINEL_PROP_BASE_EXT__BEGIN + 7,
1689 
1690     /// NCP Unsolicited update filter
1691     /** Format: `A(I)`
1692      *  Type: Read-Write (optional Insert-Remove)
1693      *  Required capability: `CAP_UNSOL_UPDATE_FILTER`
1694      *
1695      * Contains a list of properties which are excluded from generating
1696      * unsolicited value updates. This property is empty after reset.
1697      * In other words, the host may opt-out of unsolicited property updates
1698      * for a specific property by adding that property id to this list.
1699      * Hosts SHOULD NOT add properties to this list which are not
1700      * present in `PROP_UNSOL_UPDATE_LIST`. If such properties are added,
1701      * the NCP ignores the unsupported properties.
1702      *
1703      */
1704     SPINEL_PROP_UNSOL_UPDATE_FILTER = SPINEL_PROP_BASE_EXT__BEGIN + 8,
1705 
1706     /// List of properties capable of generating unsolicited value update.
1707     /** Format: `A(I)`
1708      *  Type: Read-Only
1709      *  Required capability: `CAP_UNSOL_UPDATE_FILTER`
1710      *
1711      * Contains a list of properties which are capable of generating
1712      * unsolicited value updates. This list can be used when populating
1713      * `PROP_UNSOL_UPDATE_FILTER` to disable all unsolicited property
1714      * updates.
1715      *
1716      * This property is intended to effectively behave as a constant
1717      * for a given NCP firmware.
1718      */
1719     SPINEL_PROP_UNSOL_UPDATE_LIST = SPINEL_PROP_BASE_EXT__BEGIN + 9,
1720 
1721     SPINEL_PROP_BASE_EXT__END = 0x1100,
1722 
1723     SPINEL_PROP_PHY__BEGIN         = 0x20,
1724     SPINEL_PROP_PHY_ENABLED        = SPINEL_PROP_PHY__BEGIN + 0,  ///< [b]
1725     SPINEL_PROP_PHY_CHAN           = SPINEL_PROP_PHY__BEGIN + 1,  ///< [C]
1726     SPINEL_PROP_PHY_CHAN_SUPPORTED = SPINEL_PROP_PHY__BEGIN + 2,  ///< [A(C)]
1727     SPINEL_PROP_PHY_FREQ           = SPINEL_PROP_PHY__BEGIN + 3,  ///< kHz [L]
1728     SPINEL_PROP_PHY_CCA_THRESHOLD  = SPINEL_PROP_PHY__BEGIN + 4,  ///< dBm [c]
1729     SPINEL_PROP_PHY_TX_POWER       = SPINEL_PROP_PHY__BEGIN + 5,  ///< [c]
1730     SPINEL_PROP_PHY_RSSI           = SPINEL_PROP_PHY__BEGIN + 6,  ///< dBm [c]
1731     SPINEL_PROP_PHY_RX_SENSITIVITY = SPINEL_PROP_PHY__BEGIN + 7,  ///< dBm [c]
1732     SPINEL_PROP_PHY_PCAP_ENABLED   = SPINEL_PROP_PHY__BEGIN + 8,  ///< [b]
1733     SPINEL_PROP_PHY_CHAN_PREFERRED = SPINEL_PROP_PHY__BEGIN + 9,  ///< [A(C)]
1734     SPINEL_PROP_PHY_FEM_LNA_GAIN   = SPINEL_PROP_PHY__BEGIN + 10, ///< dBm [c]
1735 
1736     /// Signal the max power for a channel
1737     /** Format: `Cc`
1738      *
1739      * First byte is the channel then the max transmit power, write-only.
1740      */
1741     SPINEL_PROP_PHY_CHAN_MAX_POWER = SPINEL_PROP_PHY__BEGIN + 11,
1742     /// Region code
1743     /** Format: `S`
1744      *
1745      * The ascii representation of the ISO 3166 alpha-2 code.
1746      *
1747      */
1748     SPINEL_PROP_PHY_REGION_CODE = SPINEL_PROP_PHY__BEGIN + 12,
1749 
1750     /// Calibrated Power Table
1751     /** Format: `A(Csd)` - Insert/Set
1752      *
1753      *  The `Insert` command on the property inserts a calibration power entry to the calibrated power table.
1754      *  The `Set` command on the property with empty payload clears the calibrated power table.
1755      *
1756      * Structure Parameters:
1757      *  `C`: Channel.
1758      *  `s`: Actual power in 0.01 dBm.
1759      *  `d`: Raw power setting.
1760      */
1761     SPINEL_PROP_PHY_CALIBRATED_POWER = SPINEL_PROP_PHY__BEGIN + 13,
1762 
1763     /// Target power for a channel
1764     /** Format: `t(Cs)` - Write only
1765      *
1766      * Structure Parameters:
1767      *  `C`: Channel.
1768      *  `s`: Target power in 0.01 dBm.
1769      */
1770     SPINEL_PROP_PHY_CHAN_TARGET_POWER = SPINEL_PROP_PHY__BEGIN + 14,
1771 
1772     SPINEL_PROP_PHY__END = 0x30,
1773 
1774     SPINEL_PROP_PHY_EXT__BEGIN = 0x1200,
1775 
1776     /// Signal Jamming Detection Enable
1777     /** Format: `b`
1778      *
1779      * Indicates if jamming detection is enabled or disabled. Set to true
1780      * to enable jamming detection.
1781      */
1782     SPINEL_PROP_JAM_DETECT_ENABLE = SPINEL_PROP_PHY_EXT__BEGIN + 0,
1783 
1784     /// Signal Jamming Detected Indicator
1785     /** Format: `b` (Read-Only)
1786      *
1787      * Set to true if radio jamming is detected. Set to false otherwise.
1788      *
1789      * When jamming detection is enabled, changes to the value of this
1790      * property are emitted asynchronously via `CMD_PROP_VALUE_IS`.
1791      */
1792     SPINEL_PROP_JAM_DETECTED = SPINEL_PROP_PHY_EXT__BEGIN + 1,
1793 
1794     /// Jamming detection RSSI threshold
1795     /** Format: `c`
1796      *  Units: dBm
1797      *
1798      * This parameter describes the threshold RSSI level (measured in
1799      * dBm) above which the jamming detection will consider the
1800      * channel blocked.
1801      */
1802     SPINEL_PROP_JAM_DETECT_RSSI_THRESHOLD = SPINEL_PROP_PHY_EXT__BEGIN + 2,
1803 
1804     /// Jamming detection window size
1805     /** Format: `C`
1806      *  Units: Seconds (1-63)
1807      *
1808      * This parameter describes the window period for signal jamming
1809      * detection.
1810      */
1811     SPINEL_PROP_JAM_DETECT_WINDOW = SPINEL_PROP_PHY_EXT__BEGIN + 3,
1812 
1813     /// Jamming detection busy period
1814     /** Format: `C`
1815      *  Units: Seconds (1-63)
1816      *
1817      * This parameter describes the number of aggregate seconds within
1818      * the detection window where the RSSI must be above
1819      * `PROP_JAM_DETECT_RSSI_THRESHOLD` to trigger detection.
1820      *
1821      * The behavior of the jamming detection feature when `PROP_JAM_DETECT_BUSY`
1822      * is larger than `PROP_JAM_DETECT_WINDOW` is undefined.
1823      */
1824     SPINEL_PROP_JAM_DETECT_BUSY = SPINEL_PROP_PHY_EXT__BEGIN + 4,
1825 
1826     /// Jamming detection history bitmap (for debugging)
1827     /** Format: `X` (read-only)
1828      *
1829      * This value provides information about current state of jamming detection
1830      * module for monitoring/debugging purpose. It returns a 64-bit value where
1831      * each bit corresponds to one second interval starting with bit 0 for the
1832      * most recent interval and bit 63 for the oldest intervals (63 sec earlier).
1833      * The bit is set to 1 if the jamming detection module observed/detected
1834      * high signal level during the corresponding one second interval.
1835      *
1836      */
1837     SPINEL_PROP_JAM_DETECT_HISTORY_BITMAP = SPINEL_PROP_PHY_EXT__BEGIN + 5,
1838 
1839     /// Channel monitoring sample interval
1840     /** Format: `L` (read-only)
1841      *  Units: Milliseconds
1842      *
1843      * Required capability: SPINEL_CAP_CHANNEL_MONITOR
1844      *
1845      * If channel monitoring is enabled and active, every sample interval, a
1846      * zero-duration Energy Scan is performed, collecting a single RSSI sample
1847      * per channel. The RSSI samples are compared with a pre-specified RSSI
1848      * threshold.
1849      *
1850      */
1851     SPINEL_PROP_CHANNEL_MONITOR_SAMPLE_INTERVAL = SPINEL_PROP_PHY_EXT__BEGIN + 6,
1852 
1853     /// Channel monitoring RSSI threshold
1854     /** Format: `c` (read-only)
1855      *  Units: dBm
1856      *
1857      * Required capability: SPINEL_CAP_CHANNEL_MONITOR
1858      *
1859      * This value specifies the threshold used by channel monitoring module.
1860      * Channel monitoring maintains the average rate of RSSI samples that
1861      * are above the threshold within (approximately) a pre-specified number
1862      * of samples (sample window).
1863      *
1864      */
1865     SPINEL_PROP_CHANNEL_MONITOR_RSSI_THRESHOLD = SPINEL_PROP_PHY_EXT__BEGIN + 7,
1866 
1867     /// Channel monitoring sample window
1868     /** Format: `L` (read-only)
1869      *  Units: Number of samples
1870      *
1871      * Required capability: SPINEL_CAP_CHANNEL_MONITOR
1872      *
1873      * The averaging sample window length (in units of number of channel
1874      * samples) used by channel monitoring module. Channel monitoring will
1875      * sample all channels every sample interval. It maintains the average rate
1876      * of RSSI samples that are above the RSSI threshold within (approximately)
1877      * the sample window.
1878      *
1879      */
1880     SPINEL_PROP_CHANNEL_MONITOR_SAMPLE_WINDOW = SPINEL_PROP_PHY_EXT__BEGIN + 8,
1881 
1882     /// Channel monitoring sample count
1883     /** Format: `L` (read-only)
1884      *  Units: Number of samples
1885      *
1886      * Required capability: SPINEL_CAP_CHANNEL_MONITOR
1887      *
1888      * Total number of RSSI samples (per channel) taken by the channel
1889      * monitoring module since its start (since Thread network interface
1890      * was enabled).
1891      *
1892      */
1893     SPINEL_PROP_CHANNEL_MONITOR_SAMPLE_COUNT = SPINEL_PROP_PHY_EXT__BEGIN + 9,
1894 
1895     /// Channel monitoring channel occupancy
1896     /** Format: `A(t(CU))` (read-only)
1897      *
1898      * Required capability: SPINEL_CAP_CHANNEL_MONITOR
1899      *
1900      * Data per item is:
1901      *
1902      *  `C`: Channel
1903      *  `U`: Channel occupancy indicator
1904      *
1905      * The channel occupancy value represents the average rate/percentage of
1906      * RSSI samples that were above RSSI threshold ("bad" RSSI samples) within
1907      * (approximately) sample window latest RSSI samples.
1908      *
1909      * Max value of `0xffff` indicates all RSSI samples were above RSSI
1910      * threshold (i.e. 100% of samples were "bad").
1911      *
1912      */
1913     SPINEL_PROP_CHANNEL_MONITOR_CHANNEL_OCCUPANCY = SPINEL_PROP_PHY_EXT__BEGIN + 10,
1914 
1915     /// Radio caps
1916     /** Format: `i` (read-only)
1917      *
1918      * Data per item is:
1919      *
1920      *  `i`: Radio Capabilities.
1921      *
1922      */
1923     SPINEL_PROP_RADIO_CAPS = SPINEL_PROP_PHY_EXT__BEGIN + 11,
1924 
1925     /// All coex metrics related counters.
1926     /** Format: t(LLLLLLLL)t(LLLLLLLLL)bL  (Read-only)
1927      *
1928      * Required capability: SPINEL_CAP_RADIO_COEX
1929      *
1930      * The contents include two structures and two common variables, first structure corresponds to
1931      * all transmit related coex counters, second structure provides the receive related counters.
1932      *
1933      * The transmit structure includes:
1934      *   'L': NumTxRequest                       (The number of tx requests).
1935      *   'L': NumTxGrantImmediate                (The number of tx requests while grant was active).
1936      *   'L': NumTxGrantWait                     (The number of tx requests while grant was inactive).
1937      *   'L': NumTxGrantWaitActivated            (The number of tx requests while grant was inactive that were
1938      *                                            ultimately granted).
1939      *   'L': NumTxGrantWaitTimeout              (The number of tx requests while grant was inactive that timed out).
1940      *   'L': NumTxGrantDeactivatedDuringRequest (The number of tx requests that were in progress when grant was
1941      *                                            deactivated).
1942      *   'L': NumTxDelayedGrant                  (The number of tx requests that were not granted within 50us).
1943      *   'L': AvgTxRequestToGrantTime            (The average time in usec from tx request to grant).
1944      *
1945      * The receive structure includes:
1946      *   'L': NumRxRequest                       (The number of rx requests).
1947      *   'L': NumRxGrantImmediate                (The number of rx requests while grant was active).
1948      *   'L': NumRxGrantWait                     (The number of rx requests while grant was inactive).
1949      *   'L': NumRxGrantWaitActivated            (The number of rx requests while grant was inactive that were
1950      *                                            ultimately granted).
1951      *   'L': NumRxGrantWaitTimeout              (The number of rx requests while grant was inactive that timed out).
1952      *   'L': NumRxGrantDeactivatedDuringRequest (The number of rx requests that were in progress when grant was
1953      *                                            deactivated).
1954      *   'L': NumRxDelayedGrant                  (The number of rx requests that were not granted within 50us).
1955      *   'L': AvgRxRequestToGrantTime            (The average time in usec from rx request to grant).
1956      *   'L': NumRxGrantNone                     (The number of rx requests that completed without receiving grant).
1957      *
1958      * Two common variables:
1959      *   'b': Stopped        (Stats collection stopped due to saturation).
1960      *   'L': NumGrantGlitch (The number of of grant glitches).
1961      */
1962     SPINEL_PROP_RADIO_COEX_METRICS = SPINEL_PROP_PHY_EXT__BEGIN + 12,
1963 
1964     /// Radio Coex Enable
1965     /** Format: `b`
1966      *
1967      * Required capability: SPINEL_CAP_RADIO_COEX
1968      *
1969      * Indicates if radio coex is enabled or disabled. Set to true to enable radio coex.
1970      */
1971     SPINEL_PROP_RADIO_COEX_ENABLE = SPINEL_PROP_PHY_EXT__BEGIN + 13,
1972 
1973     SPINEL_PROP_PHY_EXT__END = 0x1300,
1974 
1975     SPINEL_PROP_MAC__BEGIN = 0x30,
1976 
1977     /// MAC Scan State
1978     /** Format: `C`
1979      *
1980      * Possible values are from enumeration `spinel_scan_state_t`.
1981      *
1982      *   SCAN_STATE_IDLE
1983      *   SCAN_STATE_BEACON
1984      *   SCAN_STATE_ENERGY
1985      *   SCAN_STATE_DISCOVER
1986      *
1987      * Set to `SCAN_STATE_BEACON` to start an active scan.
1988      * Beacons will be emitted from `PROP_MAC_SCAN_BEACON`.
1989      *
1990      * Set to `SCAN_STATE_ENERGY` to start an energy scan.
1991      * Channel energy result will be reported by emissions
1992      * of `PROP_MAC_ENERGY_SCAN_RESULT` (per channel).
1993      *
1994      * Set to `SCAN_STATE_DISCOVER` to start a Thread MLE discovery
1995      * scan operation. Discovery scan result will be emitted from
1996      * `PROP_MAC_SCAN_BEACON`.
1997      *
1998      * Value switches to `SCAN_STATE_IDLE` when scan is complete.
1999      *
2000      */
2001     SPINEL_PROP_MAC_SCAN_STATE = SPINEL_PROP_MAC__BEGIN + 0,
2002 
2003     /// MAC Scan Channel Mask
2004     /** Format: `A(C)`
2005      *
2006      * List of channels to scan.
2007      *
2008      */
2009     SPINEL_PROP_MAC_SCAN_MASK = SPINEL_PROP_MAC__BEGIN + 1,
2010 
2011     /// MAC Scan Channel Period
2012     /** Format: `S`
2013      *  Unit: milliseconds per channel
2014      *
2015      */
2016     SPINEL_PROP_MAC_SCAN_PERIOD = SPINEL_PROP_MAC__BEGIN + 2,
2017 
2018     /// MAC Scan Beacon
2019     /** Format `Cct(ESSc)t(iCUdd)` - Asynchronous event only
2020      *
2021      * Scan beacons have two embedded structures which contain
2022      * information about the MAC layer and the NET layer. Their
2023      * format depends on the MAC and NET layer currently in use.
2024      * The format below is for an 802.15.4 MAC with Thread:
2025      *
2026      *  `C`: Channel
2027      *  `c`: RSSI of the beacon
2028      *  `t`: MAC layer properties (802.15.4 layer)
2029      *    `E`: Long address
2030      *    `S`: Short address
2031      *    `S`: PAN-ID
2032      *    `c`: LQI
2033      *  NET layer properties
2034      *    `i`: Protocol Number (SPINEL_PROTOCOL_TYPE_* values)
2035      *    `C`: Flags (SPINEL_BEACON_THREAD_FLAG_* values)
2036      *    `U`: Network Name
2037      *    `d`: XPANID
2038      *    `d`: Steering data
2039      *
2040      * Extra parameters may be added to each of the structures
2041      * in the future, so care should be taken to read the length
2042      * that prepends each structure.
2043      *
2044      */
2045     SPINEL_PROP_MAC_SCAN_BEACON = SPINEL_PROP_MAC__BEGIN + 3,
2046 
2047     /// MAC Long Address
2048     /** Format: `E`
2049      *
2050      * The 802.15.4 long address of this node.
2051      *
2052      */
2053     SPINEL_PROP_MAC_15_4_LADDR = SPINEL_PROP_MAC__BEGIN + 4,
2054 
2055     /// MAC Short Address
2056     /** Format: `S`
2057      *
2058      * The 802.15.4 short address of this node.
2059      *
2060      */
2061     SPINEL_PROP_MAC_15_4_SADDR = SPINEL_PROP_MAC__BEGIN + 5,
2062 
2063     /// MAC PAN ID
2064     /** Format: `S`
2065      *
2066      * The 802.15.4 PANID this node is associated with.
2067      *
2068      */
2069     SPINEL_PROP_MAC_15_4_PANID = SPINEL_PROP_MAC__BEGIN + 6,
2070 
2071     /// MAC Stream Raw Enabled
2072     /** Format: `b`
2073      *
2074      * Set to true to enable raw MAC frames to be emitted from
2075      * `PROP_STREAM_RAW`.
2076      *
2077      */
2078     SPINEL_PROP_MAC_RAW_STREAM_ENABLED = SPINEL_PROP_MAC__BEGIN + 7,
2079 
2080     /// MAC Promiscuous Mode
2081     /** Format: `C`
2082      *
2083      * Possible values are from enumeration
2084      * `SPINEL_MAC_PROMISCUOUS_MODE_*`:
2085      *
2086      *   `SPINEL_MAC_PROMISCUOUS_MODE_OFF`
2087      *        Normal MAC filtering is in place.
2088      *
2089      *   `SPINEL_MAC_PROMISCUOUS_MODE_NETWORK`
2090      *        All MAC packets matching network are passed up
2091      *        the stack.
2092      *
2093      *   `SPINEL_MAC_PROMISCUOUS_MODE_FULL`
2094      *        All decoded MAC packets are passed up the stack.
2095      *
2096      */
2097     SPINEL_PROP_MAC_PROMISCUOUS_MODE = SPINEL_PROP_MAC__BEGIN + 8,
2098 
2099     /// MAC Energy Scan Result
2100     /** Format: `Cc` - Asynchronous event only
2101      *
2102      * This property is emitted during energy scan operation
2103      * per scanned channel with following format:
2104      *
2105      *   `C`: Channel
2106      *   `c`: RSSI (in dBm)
2107      *
2108      */
2109     SPINEL_PROP_MAC_ENERGY_SCAN_RESULT = SPINEL_PROP_MAC__BEGIN + 9,
2110 
2111     /// MAC Data Poll Period
2112     /** Format: `L`
2113      *  Unit: millisecond
2114      * The (user-specified) data poll (802.15.4 MAC Data Request) period
2115      * in milliseconds. Value zero means there is no user-specified
2116      * poll period, and the network stack determines the maximum period
2117      * based on the MLE Child Timeout.
2118      *
2119      * If the value is non-zero, it specifies the maximum period between
2120      * data poll transmissions. Note that the network stack may send data
2121      * request transmissions more frequently when expecting a control-message
2122      * (e.g., when waiting for an MLE Child ID Response).
2123      *
2124      */
2125     SPINEL_PROP_MAC_DATA_POLL_PERIOD = SPINEL_PROP_MAC__BEGIN + 10,
2126 
2127     SPINEL_PROP_MAC__END = 0x40,
2128 
2129     SPINEL_PROP_MAC_EXT__BEGIN = 0x1300,
2130 
2131     /// MAC Allowlist
2132     /** Format: `A(t(Ec))`
2133      * Required capability: `CAP_MAC_ALLOWLIST`
2134      *
2135      * Structure Parameters:
2136      *
2137      *  `E`: EUI64 address of node
2138      *  `c`: Optional RSSI-override value. The value 127 indicates
2139      *       that the RSSI-override feature is not enabled for this
2140      *       address. If this value is omitted when setting or
2141      *       inserting, it is assumed to be 127. This parameter is
2142      *       ignored when removing.
2143      */
2144     SPINEL_PROP_MAC_ALLOWLIST = SPINEL_PROP_MAC_EXT__BEGIN + 0,
2145 
2146     /// MAC Allowlist Enabled Flag
2147     /** Format: `b`
2148      * Required capability: `CAP_MAC_ALLOWLIST`
2149      *
2150      */
2151     SPINEL_PROP_MAC_ALLOWLIST_ENABLED = SPINEL_PROP_MAC_EXT__BEGIN + 1,
2152 
2153     /// MAC Extended Address
2154     /** Format: `E`
2155      *
2156      *  Specified by Thread. Randomly-chosen, but non-volatile EUI-64.
2157      */
2158     SPINEL_PROP_MAC_EXTENDED_ADDR = SPINEL_PROP_MAC_EXT__BEGIN + 2,
2159 
2160     /// MAC Source Match Enabled Flag
2161     /** Format: `b`
2162      * Required Capability: SPINEL_CAP_MAC_RAW or SPINEL_CAP_CONFIG_RADIO
2163      *
2164      * Set to true to enable radio source matching or false to disable it.
2165      * The source match functionality is used by radios when generating
2166      * ACKs. The short and extended address lists are used for setting
2167      * the Frame Pending bit in the ACKs.
2168      *
2169      */
2170     SPINEL_PROP_MAC_SRC_MATCH_ENABLED = SPINEL_PROP_MAC_EXT__BEGIN + 3,
2171 
2172     /// MAC Source Match Short Address List
2173     /** Format: `A(S)`
2174      * Required Capability: SPINEL_CAP_MAC_RAW or SPINEL_CAP_CONFIG_RADIO
2175      *
2176      */
2177     SPINEL_PROP_MAC_SRC_MATCH_SHORT_ADDRESSES = SPINEL_PROP_MAC_EXT__BEGIN + 4,
2178 
2179     /// MAC Source Match Extended Address List
2180     /** Format: `A(E)`
2181      *  Required Capability: SPINEL_CAP_MAC_RAW or SPINEL_CAP_CONFIG_RADIO
2182      *
2183      */
2184     SPINEL_PROP_MAC_SRC_MATCH_EXTENDED_ADDRESSES = SPINEL_PROP_MAC_EXT__BEGIN + 5,
2185 
2186     /// MAC Denylist
2187     /** Format: `A(t(E))`
2188      * Required capability: `CAP_MAC_ALLOWLIST`
2189      *
2190      * Structure Parameters:
2191      *
2192      *  `E`: EUI64 address of node
2193      *
2194      */
2195     SPINEL_PROP_MAC_DENYLIST = SPINEL_PROP_MAC_EXT__BEGIN + 6,
2196 
2197     /// MAC Denylist Enabled Flag
2198     /** Format: `b`
2199      *  Required capability: `CAP_MAC_ALLOWLIST`
2200      */
2201     SPINEL_PROP_MAC_DENYLIST_ENABLED = SPINEL_PROP_MAC_EXT__BEGIN + 7,
2202 
2203     /// MAC Received Signal Strength Filter
2204     /** Format: `A(t(Ec))`
2205      * Required capability: `CAP_MAC_ALLOWLIST`
2206      *
2207      * Structure Parameters:
2208      *
2209      * * `E`: Optional EUI64 address of node. Set default RSS if not included.
2210      * * `c`: Fixed RSS. 127 means not set.
2211      */
2212     SPINEL_PROP_MAC_FIXED_RSS = SPINEL_PROP_MAC_EXT__BEGIN + 8,
2213 
2214     /// The CCA failure rate
2215     /** Format: `S`
2216      *
2217      * This property provides the current CCA (Clear Channel Assessment) failure rate.
2218      *
2219      * Maximum value `0xffff` corresponding to 100% failure rate.
2220      *
2221      */
2222     SPINEL_PROP_MAC_CCA_FAILURE_RATE = SPINEL_PROP_MAC_EXT__BEGIN + 9,
2223 
2224     /// MAC Max direct retry number
2225     /** Format: `C`
2226      *
2227      * The maximum (user-specified) number of direct frame transmission retries.
2228      *
2229      */
2230     SPINEL_PROP_MAC_MAX_RETRY_NUMBER_DIRECT = SPINEL_PROP_MAC_EXT__BEGIN + 10,
2231 
2232     /// MAC Max indirect retry number
2233     /** Format: `C`
2234      * Required capability: `SPINEL_CAP_CONFIG_FTD`
2235      *
2236      * The maximum (user-specified) number of indirect frame transmission retries.
2237      *
2238      */
2239     SPINEL_PROP_MAC_MAX_RETRY_NUMBER_INDIRECT = SPINEL_PROP_MAC_EXT__BEGIN + 11,
2240 
2241     SPINEL_PROP_MAC_EXT__END = 0x1400,
2242 
2243     SPINEL_PROP_NET__BEGIN = 0x40,
2244 
2245     /// Network Is Saved (Is Commissioned)
2246     /** Format: `b` - Read only
2247      *
2248      * Returns true if there is a network state stored/saved.
2249      *
2250      */
2251     SPINEL_PROP_NET_SAVED = SPINEL_PROP_NET__BEGIN + 0,
2252 
2253     /// Network Interface Status
2254     /** Format `b` - Read-write
2255      *
2256      * Network interface up/down status. Write true to bring
2257      * interface up and false to bring interface down.
2258      *
2259      */
2260     SPINEL_PROP_NET_IF_UP = SPINEL_PROP_NET__BEGIN + 1,
2261 
2262     /// Thread Stack Operational Status
2263     /** Format `b` - Read-write
2264      *
2265      * Thread stack operational status. Write true to start
2266      * Thread stack and false to stop it.
2267      *
2268      */
2269     SPINEL_PROP_NET_STACK_UP = SPINEL_PROP_NET__BEGIN + 2,
2270 
2271     /// Thread Device Role
2272     /** Format `C` - Read-write
2273      *
2274      * Possible values are from enumeration `spinel_net_role_t`
2275      *
2276      *  SPINEL_NET_ROLE_DETACHED = 0,
2277      *  SPINEL_NET_ROLE_CHILD    = 1,
2278      *  SPINEL_NET_ROLE_ROUTER   = 2,
2279      *  SPINEL_NET_ROLE_LEADER   = 3,
2280      *
2281      */
2282     SPINEL_PROP_NET_ROLE = SPINEL_PROP_NET__BEGIN + 3,
2283 
2284     /// Thread Network Name
2285     /** Format `U` - Read-write
2286      *
2287      */
2288     SPINEL_PROP_NET_NETWORK_NAME = SPINEL_PROP_NET__BEGIN + 4,
2289 
2290     /// Thread Network Extended PAN ID
2291     /** Format `D` - Read-write
2292      *
2293      */
2294     SPINEL_PROP_NET_XPANID = SPINEL_PROP_NET__BEGIN + 5,
2295 
2296     /// Thread Network Key
2297     /** Format `D` - Read-write
2298      *
2299      */
2300     SPINEL_PROP_NET_NETWORK_KEY = SPINEL_PROP_NET__BEGIN + 6,
2301 
2302     /// Thread Network Key Sequence Counter
2303     /** Format `L` - Read-write
2304      *
2305      */
2306     SPINEL_PROP_NET_KEY_SEQUENCE_COUNTER = SPINEL_PROP_NET__BEGIN + 7,
2307 
2308     /// Thread Network Partition Id
2309     /** Format `L` - Read-write
2310      *
2311      * The partition ID of the partition that this node is a
2312      * member of.
2313      *
2314      */
2315     SPINEL_PROP_NET_PARTITION_ID = SPINEL_PROP_NET__BEGIN + 8,
2316 
2317     /// Require Join Existing
2318     /** Format: `b`
2319      *  Default Value: `false`
2320      *
2321      * This flag is typically used for nodes that are associating with an
2322      * existing network for the first time. If this is set to `true` before
2323      * `PROP_NET_STACK_UP` is set to `true`, the
2324      * creation of a new partition at association is prevented. If the node
2325      * cannot associate with an existing partition, `PROP_LAST_STATUS` will
2326      * emit a status that indicates why the association failed and
2327      * `PROP_NET_STACK_UP` will automatically revert to `false`.
2328      *
2329      * Once associated with an existing partition, this flag automatically
2330      * reverts to `false`.
2331      *
2332      * The behavior of this property being set to `true` when
2333      * `PROP_NET_STACK_UP` is already set to `true` is undefined.
2334      *
2335      */
2336     SPINEL_PROP_NET_REQUIRE_JOIN_EXISTING = SPINEL_PROP_NET__BEGIN + 9,
2337 
2338     /// Thread Network Key Switch Guard Time
2339     /** Format `L` - Read-write
2340      *
2341      */
2342     SPINEL_PROP_NET_KEY_SWITCH_GUARDTIME = SPINEL_PROP_NET__BEGIN + 10,
2343 
2344     /// Thread Network PSKc
2345     /** Format `D` - Read-write
2346      *
2347      */
2348     SPINEL_PROP_NET_PSKC = SPINEL_PROP_NET__BEGIN + 11,
2349 
2350     SPINEL_PROP_NET__END = 0x50,
2351 
2352     SPINEL_PROP_NET_EXT__BEGIN = 0x1400,
2353     SPINEL_PROP_NET_EXT__END   = 0x1500,
2354 
2355     SPINEL_PROP_THREAD__BEGIN = 0x50,
2356 
2357     /// Thread Leader IPv6 Address
2358     /** Format `6` - Read only
2359      *
2360      */
2361     SPINEL_PROP_THREAD_LEADER_ADDR = SPINEL_PROP_THREAD__BEGIN + 0,
2362 
2363     /// Thread Parent Info
2364     /** Format: `ESLccCCCCC` - Read only
2365      *
2366      *  `E`: Extended address
2367      *  `S`: RLOC16
2368      *  `L`: Age (seconds since last heard from)
2369      *  `c`: Average RSS (in dBm)
2370      *  `c`: Last RSSI (in dBm)
2371      *  `C`: Link Quality In
2372      *  `C`: Link Quality Out
2373      *  `C`: Version
2374      *  `C`: CSL clock accuracy
2375      *  `C`: CSL uncertainty
2376      *
2377      */
2378     SPINEL_PROP_THREAD_PARENT = SPINEL_PROP_THREAD__BEGIN + 1,
2379 
2380     /// Thread Child Table
2381     /** Format: [A(t(ESLLCCcCc)] - Read only
2382      *
2383      * Data per item is:
2384      *
2385      *  `E`: Extended address
2386      *  `S`: RLOC16
2387      *  `L`: Timeout (in seconds)
2388      *  `L`: Age (in seconds)
2389      *  `L`: Network Data version
2390      *  `C`: Link Quality In
2391      *  `c`: Average RSS (in dBm)
2392      *  `C`: Mode (bit-flags)
2393      *  `c`: Last RSSI (in dBm)
2394      *
2395      */
2396     SPINEL_PROP_THREAD_CHILD_TABLE = SPINEL_PROP_THREAD__BEGIN + 2,
2397 
2398     /// Thread Leader Router Id
2399     /** Format `C` - Read only
2400      *
2401      * The router-id of the current leader.
2402      *
2403      */
2404     SPINEL_PROP_THREAD_LEADER_RID = SPINEL_PROP_THREAD__BEGIN + 3,
2405 
2406     /// Thread Leader Weight
2407     /** Format `C` - Read only
2408      *
2409      * The leader weight of the current leader.
2410      *
2411      */
2412     SPINEL_PROP_THREAD_LEADER_WEIGHT = SPINEL_PROP_THREAD__BEGIN + 4,
2413 
2414     /// Thread Local Leader Weight
2415     /** Format `C` - Read only
2416      *
2417      * The leader weight of this node.
2418      *
2419      */
2420     SPINEL_PROP_THREAD_LOCAL_LEADER_WEIGHT = SPINEL_PROP_THREAD__BEGIN + 5,
2421 
2422     /// Thread Local Network Data
2423     /** Format `D` - Read only
2424      *
2425      */
2426     SPINEL_PROP_THREAD_NETWORK_DATA = SPINEL_PROP_THREAD__BEGIN + 6,
2427 
2428     /// Thread Local Network Data Version
2429     /** Format `C` - Read only
2430      *
2431      */
2432     SPINEL_PROP_THREAD_NETWORK_DATA_VERSION = SPINEL_PROP_THREAD__BEGIN + 7,
2433 
2434     /// Thread Local Stable Network Data
2435     /** Format `D` - Read only
2436      *
2437      */
2438     SPINEL_PROP_THREAD_STABLE_NETWORK_DATA = SPINEL_PROP_THREAD__BEGIN + 8,
2439 
2440     /// Thread Local Stable Network Data Version
2441     /** Format `C` - Read only
2442      *
2443      */
2444     SPINEL_PROP_THREAD_STABLE_NETWORK_DATA_VERSION = SPINEL_PROP_THREAD__BEGIN + 9,
2445 
2446     /// On-Mesh Prefixes
2447     /** Format: `A(t(6CbCbSC))`
2448      *
2449      * Data per item is:
2450      *
2451      *  `6`: IPv6 Prefix
2452      *  `C`: Prefix length in bits
2453      *  `b`: Stable flag
2454      *  `C`: TLV flags (SPINEL_NET_FLAG_* definition)
2455      *  `b`: "Is defined locally" flag. Set if this network was locally
2456      *       defined. Assumed to be true for set, insert and replace. Clear if
2457      *       the on mesh network was defined by another node.
2458      *       This field is ignored for INSERT and REMOVE commands.
2459      *  `S`: The RLOC16 of the device that registered this on-mesh prefix entry.
2460      *       This value is not used and ignored when adding an on-mesh prefix.
2461      *       This field is ignored for INSERT and REMOVE commands.
2462      *  `C`: TLV flags extended (additional field for Thread 1.2 features).
2463      *
2464      */
2465     SPINEL_PROP_THREAD_ON_MESH_NETS = SPINEL_PROP_THREAD__BEGIN + 10,
2466 
2467     /// Off-mesh routes
2468     /** Format: [A(t(6CbCbb))]
2469      *
2470      * Data per item is:
2471      *
2472      *  `6`: Route Prefix
2473      *  `C`: Prefix length in bits
2474      *  `b`: Stable flag
2475      *  `C`: Route flags (SPINEL_ROUTE_FLAG_* and SPINEL_ROUTE_PREFERENCE_* definitions)
2476      *  `b`: "Is defined locally" flag. Set if this route info was locally
2477      *       defined as part of local network data. Assumed to be true for set,
2478      *       insert and replace. Clear if the route is part of partition's network
2479      *       data.
2480      *  `b`: "Next hop is this device" flag. Set if the next hop for the
2481      *       route is this device itself (i.e., route was added by this device)
2482      *       This value is ignored when adding an external route. For any added
2483      *       route the next hop is this device.
2484      *  `S`: The RLOC16 of the device that registered this route entry.
2485      *       This value is not used and ignored when adding a route.
2486      *
2487      */
2488     SPINEL_PROP_THREAD_OFF_MESH_ROUTES = SPINEL_PROP_THREAD__BEGIN + 11,
2489 
2490     /// Thread Assisting Ports
2491     /** Format `A(S)`
2492      *
2493      * Array of port numbers.
2494      */
2495     SPINEL_PROP_THREAD_ASSISTING_PORTS = SPINEL_PROP_THREAD__BEGIN + 12,
2496 
2497     /// Thread Allow Local Network Data Change
2498     /** Format `b` - Read-write
2499      *
2500      * Set to true before changing local net data. Set to false when finished.
2501      * This allows changes to be aggregated into a single event.
2502      *
2503      */
2504     SPINEL_PROP_THREAD_ALLOW_LOCAL_NET_DATA_CHANGE = SPINEL_PROP_THREAD__BEGIN + 13,
2505 
2506     /// Thread Mode
2507     /** Format: `C`
2508      *
2509      *  This property contains the value of the mode
2510      *  TLV for this node. The meaning of the bits in this
2511      *  bit-field are defined by section 4.5.2 of the Thread
2512      *  specification.
2513      *
2514      * The values `SPINEL_THREAD_MODE_*` defines the bit-fields
2515      *
2516      */
2517     SPINEL_PROP_THREAD_MODE = SPINEL_PROP_THREAD__BEGIN + 14,
2518 
2519     SPINEL_PROP_THREAD__END = 0x60,
2520 
2521     SPINEL_PROP_THREAD_EXT__BEGIN = 0x1500,
2522 
2523     /// Thread Child Timeout
2524     /** Format: `L`
2525      *  Unit: Seconds
2526      *
2527      *  Used when operating in the Child role.
2528      */
2529     SPINEL_PROP_THREAD_CHILD_TIMEOUT = SPINEL_PROP_THREAD_EXT__BEGIN + 0,
2530 
2531     /// Thread RLOC16
2532     /** Format: `S`
2533      *
2534      */
2535     SPINEL_PROP_THREAD_RLOC16 = SPINEL_PROP_THREAD_EXT__BEGIN + 1,
2536 
2537     /// Thread Router Upgrade Threshold
2538     /** Format: `C`
2539      *
2540      */
2541     SPINEL_PROP_THREAD_ROUTER_UPGRADE_THRESHOLD = SPINEL_PROP_THREAD_EXT__BEGIN + 2,
2542 
2543     /// Thread Context Reuse Delay
2544     /** Format: `L`
2545      *
2546      */
2547     SPINEL_PROP_THREAD_CONTEXT_REUSE_DELAY = SPINEL_PROP_THREAD_EXT__BEGIN + 3,
2548 
2549     /// Thread Network ID Timeout
2550     /** Format: `C`
2551      *
2552      */
2553     SPINEL_PROP_THREAD_NETWORK_ID_TIMEOUT = SPINEL_PROP_THREAD_EXT__BEGIN + 4,
2554 
2555     /// List of active thread router ids
2556     /** Format: `A(C)`
2557      *
2558      * Note that some implementations may not support CMD_GET_VALUE
2559      * router ids, but may support CMD_REMOVE_VALUE when the node is
2560      * a leader.
2561      *
2562      */
2563     SPINEL_PROP_THREAD_ACTIVE_ROUTER_IDS = SPINEL_PROP_THREAD_EXT__BEGIN + 5,
2564 
2565     /// Forward IPv6 packets that use RLOC16 addresses to HOST.
2566     /** Format: `b`
2567      *
2568      * Allow host to directly observe all IPv6 packets received by the NCP,
2569      * including ones sent to the RLOC16 address.
2570      *
2571      * Default is false.
2572      *
2573      */
2574     SPINEL_PROP_THREAD_RLOC16_DEBUG_PASSTHRU = SPINEL_PROP_THREAD_EXT__BEGIN + 6,
2575 
2576     /// Router Role Enabled
2577     /** Format `b`
2578      *
2579      * Allows host to indicate whether or not the router role is enabled.
2580      * If current role is a router, setting this property to `false` starts
2581      * a re-attach process as an end-device.
2582      *
2583      */
2584     SPINEL_PROP_THREAD_ROUTER_ROLE_ENABLED = SPINEL_PROP_THREAD_EXT__BEGIN + 7,
2585 
2586     /// Thread Router Downgrade Threshold
2587     /** Format: `C`
2588      *
2589      */
2590     SPINEL_PROP_THREAD_ROUTER_DOWNGRADE_THRESHOLD = SPINEL_PROP_THREAD_EXT__BEGIN + 8,
2591 
2592     /// Thread Router Selection Jitter
2593     /** Format: `C`
2594      *
2595      */
2596     SPINEL_PROP_THREAD_ROUTER_SELECTION_JITTER = SPINEL_PROP_THREAD_EXT__BEGIN + 9,
2597 
2598     /// Thread Preferred Router Id
2599     /** Format: `C` - Write only
2600      *
2601      * Specifies the preferred Router Id. Upon becoming a router/leader the node
2602      * attempts to use this Router Id. If the preferred Router Id is not set or
2603      * if it can not be used, a randomly generated router id is picked. This
2604      * property can be set only when the device role is either detached or
2605      * disabled.
2606      *
2607      */
2608     SPINEL_PROP_THREAD_PREFERRED_ROUTER_ID = SPINEL_PROP_THREAD_EXT__BEGIN + 10,
2609 
2610     /// Thread Neighbor Table
2611     /** Format: `A(t(ESLCcCbLLc))` - Read only
2612      *
2613      * Data per item is:
2614      *
2615      *  `E`: Extended address
2616      *  `S`: RLOC16
2617      *  `L`: Age (in seconds)
2618      *  `C`: Link Quality In
2619      *  `c`: Average RSS (in dBm)
2620      *  `C`: Mode (bit-flags)
2621      *  `b`: `true` if neighbor is a child, `false` otherwise.
2622      *  `L`: Link Frame Counter
2623      *  `L`: MLE Frame Counter
2624      *  `c`: The last RSSI (in dBm)
2625      *
2626      */
2627     SPINEL_PROP_THREAD_NEIGHBOR_TABLE = SPINEL_PROP_THREAD_EXT__BEGIN + 11,
2628 
2629     /// Thread Max Child Count
2630     /** Format: `C`
2631      *
2632      * Specifies the maximum number of children currently allowed.
2633      * This parameter can only be set when Thread protocol operation
2634      * has been stopped.
2635      *
2636      */
2637     SPINEL_PROP_THREAD_CHILD_COUNT_MAX = SPINEL_PROP_THREAD_EXT__BEGIN + 12,
2638 
2639     /// Leader Network Data
2640     /** Format: `D` - Read only
2641      *
2642      */
2643     SPINEL_PROP_THREAD_LEADER_NETWORK_DATA = SPINEL_PROP_THREAD_EXT__BEGIN + 13,
2644 
2645     /// Stable Leader Network Data
2646     /** Format: `D` - Read only
2647      *
2648      */
2649     SPINEL_PROP_THREAD_STABLE_LEADER_NETWORK_DATA = SPINEL_PROP_THREAD_EXT__BEGIN + 14,
2650 
2651     /// Thread Joiner Data
2652     /** Format `A(T(ULE))`
2653      *  PSKd, joiner timeout, eui64 (optional)
2654      *
2655      * This property is being deprecated by SPINEL_PROP_MESHCOP_COMMISSIONER_JOINERS.
2656      *
2657      */
2658     SPINEL_PROP_THREAD_JOINERS = SPINEL_PROP_THREAD_EXT__BEGIN + 15,
2659 
2660     /// Thread Commissioner Enable
2661     /** Format `b`
2662      *
2663      * Default value is `false`.
2664      *
2665      * This property is being deprecated by SPINEL_PROP_MESHCOP_COMMISSIONER_STATE.
2666      *
2667      */
2668     SPINEL_PROP_THREAD_COMMISSIONER_ENABLED = SPINEL_PROP_THREAD_EXT__BEGIN + 16,
2669 
2670     /// Thread TMF proxy enable
2671     /** Format `b`
2672      * Required capability: `SPINEL_CAP_THREAD_TMF_PROXY`
2673      *
2674      * This property is deprecated.
2675      *
2676      */
2677     SPINEL_PROP_THREAD_TMF_PROXY_ENABLED = SPINEL_PROP_THREAD_EXT__BEGIN + 17,
2678 
2679     /// Thread TMF proxy stream
2680     /** Format `dSS`
2681      * Required capability: `SPINEL_CAP_THREAD_TMF_PROXY`
2682      *
2683      * This property is deprecated. Please see `SPINEL_PROP_THREAD_UDP_FORWARD_STREAM`.
2684      *
2685      */
2686     SPINEL_PROP_THREAD_TMF_PROXY_STREAM = SPINEL_PROP_THREAD_EXT__BEGIN + 18,
2687 
2688     /// Thread "joiner" flag used during discovery scan operation
2689     /** Format `b`
2690      *
2691      * This property defines the Joiner Flag value in the Discovery Request TLV.
2692      *
2693      * Default value is `false`.
2694      *
2695      */
2696     SPINEL_PROP_THREAD_DISCOVERY_SCAN_JOINER_FLAG = SPINEL_PROP_THREAD_EXT__BEGIN + 19,
2697 
2698     /// Enable EUI64 filtering for discovery scan operation.
2699     /** Format `b`
2700      *
2701      * Default value is `false`
2702      *
2703      */
2704     SPINEL_PROP_THREAD_DISCOVERY_SCAN_ENABLE_FILTERING = SPINEL_PROP_THREAD_EXT__BEGIN + 20,
2705 
2706     /// PANID used for Discovery scan operation (used for PANID filtering).
2707     /** Format: `S`
2708      *
2709      * Default value is 0xffff (Broadcast PAN) to disable PANID filtering
2710      *
2711      */
2712     SPINEL_PROP_THREAD_DISCOVERY_SCAN_PANID = SPINEL_PROP_THREAD_EXT__BEGIN + 21,
2713 
2714     /// Thread (out of band) steering data for MLE Discovery Response.
2715     /** Format `E` - Write only
2716      *
2717      * Required capability: SPINEL_CAP_OOB_STEERING_DATA.
2718      *
2719      * Writing to this property allows to set/update the MLE
2720      * Discovery Response steering data out of band.
2721      *
2722      *  - All zeros to clear the steering data (indicating that
2723      *    there is no steering data).
2724      *  - All 0xFFs to set steering data/bloom filter to
2725      *    accept/allow all.
2726      *  - A specific EUI64 which is then added to current steering
2727      *    data/bloom filter.
2728      *
2729      */
2730     SPINEL_PROP_THREAD_STEERING_DATA = SPINEL_PROP_THREAD_EXT__BEGIN + 22,
2731 
2732     /// Thread Router Table.
2733     /** Format: `A(t(ESCCCCCCb)` - Read only
2734      *
2735      * Data per item is:
2736      *
2737      *  `E`: IEEE 802.15.4 Extended Address
2738      *  `S`: RLOC16
2739      *  `C`: Router ID
2740      *  `C`: Next hop to router
2741      *  `C`: Path cost to router
2742      *  `C`: Link Quality In
2743      *  `C`: Link Quality Out
2744      *  `C`: Age (seconds since last heard)
2745      *  `b`: Link established with Router ID or not.
2746      *
2747      */
2748     SPINEL_PROP_THREAD_ROUTER_TABLE = SPINEL_PROP_THREAD_EXT__BEGIN + 23,
2749 
2750     /// Thread Active Operational Dataset
2751     /** Format: `A(t(iD))` - Read-Write
2752      *
2753      * This property provides access to current Thread Active Operational Dataset. A Thread device maintains the
2754      * Operational Dataset that it has stored locally and the one currently in use by the partition to which it is
2755      * attached. This property corresponds to the locally stored Dataset on the device.
2756      *
2757      * Operational Dataset consists of a set of supported properties (e.g., channel, network key, network name, PAN id,
2758      * etc). Note that not all supported properties may be present (have a value) in a Dataset.
2759      *
2760      * The Dataset value is encoded as an array of structs containing pairs of property key (as `i`) followed by the
2761      * property value (as `D`). The property value must follow the format associated with the corresponding property.
2762      *
2763      * On write, any unknown/unsupported property keys must be ignored.
2764      *
2765      * The following properties can be included in a Dataset list:
2766      *
2767      *   SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP
2768      *   SPINEL_PROP_PHY_CHAN
2769      *   SPINEL_PROP_PHY_CHAN_SUPPORTED (Channel Mask Page 0)
2770      *   SPINEL_PROP_NET_NETWORK_KEY
2771      *   SPINEL_PROP_NET_NETWORK_NAME
2772      *   SPINEL_PROP_NET_XPANID
2773      *   SPINEL_PROP_MAC_15_4_PANID
2774      *   SPINEL_PROP_IPV6_ML_PREFIX
2775      *   SPINEL_PROP_NET_PSKC
2776      *   SPINEL_PROP_DATASET_SECURITY_POLICY
2777      *
2778      */
2779     SPINEL_PROP_THREAD_ACTIVE_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 24,
2780 
2781     /// Thread Pending Operational Dataset
2782     /** Format: `A(t(iD))` - Read-Write
2783      *
2784      * This property provide access to current locally stored Pending Operational Dataset.
2785      *
2786      * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_ACTIVE_DATASET.
2787      *
2788      * In addition supported properties in SPINEL_PROP_THREAD_ACTIVE_DATASET, the following properties can also
2789      * be included in the Pending Dataset:
2790      *
2791      *   SPINEL_PROP_DATASET_PENDING_TIMESTAMP
2792      *   SPINEL_PROP_DATASET_DELAY_TIMER
2793      *
2794      */
2795     SPINEL_PROP_THREAD_PENDING_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 25,
2796 
2797     /// Send MGMT_SET Thread Active Operational Dataset
2798     /** Format: `A(t(iD))` - Write only
2799      *
2800      * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_ACTIVE_DATASET.
2801      *
2802      * This is write-only property. When written, it triggers a MGMT_ACTIVE_SET meshcop command to be sent to leader
2803      * with the given Dataset. The spinel frame response should be a `LAST_STATUS` with the status of the transmission
2804      * of MGMT_ACTIVE_SET command.
2805      *
2806      * In addition to supported properties in SPINEL_PROP_THREAD_ACTIVE_DATASET, the following property can be
2807      * included in the Dataset (to allow for custom raw TLVs):
2808      *
2809      *    SPINEL_PROP_DATASET_RAW_TLVS
2810      *
2811      */
2812     SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 26,
2813 
2814     /// Send MGMT_SET Thread Pending Operational Dataset
2815     /** Format: `A(t(iD))` - Write only
2816      *
2817      * This property is similar to SPINEL_PROP_THREAD_PENDING_DATASET and follows the same format and rules.
2818      *
2819      * In addition to supported properties in SPINEL_PROP_THREAD_PENDING_DATASET, the following property can be
2820      * included the Dataset (to allow for custom raw TLVs to be provided).
2821      *
2822      *    SPINEL_PROP_DATASET_RAW_TLVS
2823      *
2824      */
2825     SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 27,
2826 
2827     /// Operational Dataset Active Timestamp
2828     /** Format: `X` - No direct read or write
2829      *
2830      * It can only be included in one of the Dataset related properties below:
2831      *
2832      *   SPINEL_PROP_THREAD_ACTIVE_DATASET
2833      *   SPINEL_PROP_THREAD_PENDING_DATASET
2834      *   SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET
2835      *   SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
2836      *   SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET
2837      *   SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
2838      *
2839      */
2840     SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP = SPINEL_PROP_THREAD_EXT__BEGIN + 28,
2841 
2842     /// Operational Dataset Pending Timestamp
2843     /** Format: `X` - No direct read or write
2844      *
2845      * It can only be included in one of the Pending Dataset properties:
2846      *
2847      *   SPINEL_PROP_THREAD_PENDING_DATASET
2848      *   SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
2849      *   SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
2850      *
2851      */
2852     SPINEL_PROP_DATASET_PENDING_TIMESTAMP = SPINEL_PROP_THREAD_EXT__BEGIN + 29,
2853 
2854     /// Operational Dataset Delay Timer
2855     /** Format: `L` - No direct read or write
2856      *
2857      * Delay timer (in ms) specifies the time renaming until Thread devices overwrite the value in the Active
2858      * Operational Dataset with the corresponding values in the Pending Operational Dataset.
2859      *
2860      * It can only be included in one of the Pending Dataset properties:
2861      *
2862      *   SPINEL_PROP_THREAD_PENDING_DATASET
2863      *   SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
2864      *   SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
2865      *
2866      */
2867     SPINEL_PROP_DATASET_DELAY_TIMER = SPINEL_PROP_THREAD_EXT__BEGIN + 30,
2868 
2869     /// Operational Dataset Security Policy
2870     /** Format: `SD` - No direct read or write
2871      *
2872      * It can only be included in one of the Dataset related properties below:
2873      *
2874      *   SPINEL_PROP_THREAD_ACTIVE_DATASET
2875      *   SPINEL_PROP_THREAD_PENDING_DATASET
2876      *   SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET
2877      *   SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
2878      *   SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET
2879      *   SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
2880      *
2881      * Content is
2882      *   `S` : Key Rotation Time (in units of hour)
2883      *   `C` : Security Policy Flags (as specified in Thread 1.1 Section 8.10.1.15)
2884      *   `C` : Optional Security Policy Flags extension (as specified in Thread 1.2 Section 8.10.1.15).
2885      *         0xf8 is used if this field is missing.
2886      *
2887      */
2888     SPINEL_PROP_DATASET_SECURITY_POLICY = SPINEL_PROP_THREAD_EXT__BEGIN + 31,
2889 
2890     /// Operational Dataset Additional Raw TLVs
2891     /** Format: `D` - No direct read or write
2892      *
2893      * This property defines extra raw TLVs that can be added to an Operational DataSet.
2894      *
2895      * It can only be included in one of the following Dataset properties:
2896      *
2897      *   SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET
2898      *   SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET
2899      *   SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET
2900      *   SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
2901      *
2902      */
2903     SPINEL_PROP_DATASET_RAW_TLVS = SPINEL_PROP_THREAD_EXT__BEGIN + 32,
2904 
2905     /// Child table addresses
2906     /** Format: `A(t(ESA(6)))` - Read only
2907      *
2908      * This property provides the list of all addresses associated with every child
2909      * including any registered IPv6 addresses.
2910      *
2911      * Data per item is:
2912      *
2913      *  `E`: Extended address of the child
2914      *  `S`: RLOC16 of the child
2915      *  `A(6)`: List of IPv6 addresses registered by the child (if any)
2916      *
2917      */
2918     SPINEL_PROP_THREAD_CHILD_TABLE_ADDRESSES = SPINEL_PROP_THREAD_EXT__BEGIN + 33,
2919 
2920     /// Neighbor Table Frame and Message Error Rates
2921     /** Format: `A(t(ESSScc))`
2922      *  Required capability: `CAP_ERROR_RATE_TRACKING`
2923      *
2924      * This property provides link quality related info including
2925      * frame and (IPv6) message error rates for all neighbors.
2926      *
2927      * With regards to message error rate, note that a larger (IPv6)
2928      * message can be fragmented and sent as multiple MAC frames. The
2929      * message transmission is considered a failure, if any of its
2930      * fragments fail after all MAC retry attempts.
2931      *
2932      * Data per item is:
2933      *
2934      *  `E`: Extended address of the neighbor
2935      *  `S`: RLOC16 of the neighbor
2936      *  `S`: Frame error rate (0 -> 0%, 0xffff -> 100%)
2937      *  `S`: Message error rate (0 -> 0%, 0xffff -> 100%)
2938      *  `c`: Average RSSI (in dBm)
2939      *  `c`: Last RSSI (in dBm)
2940      *
2941      */
2942     SPINEL_PROP_THREAD_NEIGHBOR_TABLE_ERROR_RATES = SPINEL_PROP_THREAD_EXT__BEGIN + 34,
2943 
2944     /// EID (Endpoint Identifier) IPv6 Address Cache Table
2945     /** Format `A(t(6SCCt(bL6)t(bSS)))
2946      *
2947      * This property provides Thread EID address cache table.
2948      *
2949      * Data per item is:
2950      *
2951      *  `6` : Target IPv6 address
2952      *  `S` : RLOC16 of target
2953      *  `C` : Age (order of use, 0 indicates most recently used entry)
2954      *  `C` : Entry state (values are defined by enumeration `SPINEL_ADDRESS_CACHE_ENTRY_STATE_*`).
2955      *
2956      *  `t` : Info when state is `SPINEL_ADDRESS_CACHE_ENTRY_STATE_CACHED`
2957      *    `b` : Indicates whether last transaction time and ML-EID are valid.
2958      *    `L` : Last transaction time
2959      *    `6` : Mesh-local EID
2960      *
2961      *  `t` : Info when state is other than `SPINEL_ADDRESS_CACHE_ENTRY_STATE_CACHED`
2962      *    `b` : Indicates whether the entry can be evicted.
2963      *    `S` : Timeout in seconds
2964      *    `S` : Retry delay (applicable if in query-retry state).
2965      *
2966      */
2967     SPINEL_PROP_THREAD_ADDRESS_CACHE_TABLE = SPINEL_PROP_THREAD_EXT__BEGIN + 35,
2968 
2969     /// Thread UDP forward stream
2970     /** Format `dS6S`
2971      * Required capability: `SPINEL_CAP_THREAD_UDP_FORWARD`
2972      *
2973      * This property helps exchange UDP packets with host.
2974      *
2975      *  `d`: UDP payload
2976      *  `S`: Remote UDP port
2977      *  `6`: Remote IPv6 address
2978      *  `S`: Local UDP port
2979      *
2980      */
2981     SPINEL_PROP_THREAD_UDP_FORWARD_STREAM = SPINEL_PROP_THREAD_EXT__BEGIN + 36,
2982 
2983     /// Send MGMT_GET Thread Active Operational Dataset
2984     /** Format: `A(t(iD))` - Write only
2985      *
2986      * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET. This
2987      * property further allows the sender to not include a value associated with properties in formatting of `t(iD)`,
2988      * i.e., it should accept either a `t(iD)` or a `t(i)` encoding (in both cases indicating that the associated
2989      * Dataset property should be requested as part of MGMT_GET command).
2990      *
2991      * This is write-only property. When written, it triggers a MGMT_ACTIVE_GET meshcop command to be sent to leader
2992      * requesting the Dataset related properties from the format. The spinel frame response should be a `LAST_STATUS`
2993      * with the status of the transmission of MGMT_ACTIVE_GET command.
2994      *
2995      * In addition to supported properties in SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET, the following property can be
2996      * optionally included in the Dataset:
2997      *
2998      *    SPINEL_PROP_DATASET_DEST_ADDRESS
2999      *
3000      */
3001     SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 37,
3002 
3003     /// Send MGMT_GET Thread Pending Operational Dataset
3004     /** Format: `A(t(iD))` - Write only
3005      *
3006      * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET.
3007      *
3008      * This is write-only property. When written, it triggers a MGMT_PENDING_GET meshcop command to be sent to leader
3009      * with the given Dataset. The spinel frame response should be a `LAST_STATUS` with the status of the transmission
3010      * of MGMT_PENDING_GET command.
3011      *
3012      */
3013     SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 38,
3014 
3015     /// Operational Dataset (MGMT_GET) Destination IPv6 Address
3016     /** Format: `6` - No direct read or write
3017      *
3018      * This property specifies the IPv6 destination when sending MGMT_GET command for either Active or Pending Dataset
3019      * if not provided, Leader ALOC address is used as default.
3020      *
3021      * It can only be included in one of the MGMT_GET Dataset properties:
3022      *
3023      *   SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET
3024      *   SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET
3025      *
3026      */
3027     SPINEL_PROP_DATASET_DEST_ADDRESS = SPINEL_PROP_THREAD_EXT__BEGIN + 39,
3028 
3029     /// Thread New Operational Dataset
3030     /** Format: `A(t(iD))` - Read only - FTD build only
3031      *
3032      * This property allows host to request NCP to create and return a new Operation Dataset to use when forming a new
3033      * network.
3034      *
3035      * Operational Dataset consists of a set of supported properties (e.g., channel, network key, network name, PAN id,
3036      * etc). Note that not all supported properties may be present (have a value) in a Dataset.
3037      *
3038      * The Dataset value is encoded as an array of structs containing pairs of property key (as `i`) followed by the
3039      * property value (as `D`). The property value must follow the format associated with the corresponding property.
3040      *
3041      * The following properties can be included in a Dataset list:
3042      *
3043      *   SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP
3044      *   SPINEL_PROP_PHY_CHAN
3045      *   SPINEL_PROP_PHY_CHAN_SUPPORTED (Channel Mask Page 0)
3046      *   SPINEL_PROP_NET_NETWORK_KEY
3047      *   SPINEL_PROP_NET_NETWORK_NAME
3048      *   SPINEL_PROP_NET_XPANID
3049      *   SPINEL_PROP_MAC_15_4_PANID
3050      *   SPINEL_PROP_IPV6_ML_PREFIX
3051      *   SPINEL_PROP_NET_PSKC
3052      *   SPINEL_PROP_DATASET_SECURITY_POLICY
3053      *
3054      */
3055     SPINEL_PROP_THREAD_NEW_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 40,
3056 
3057     /// MAC CSL Period
3058     /** Format: `S`
3059      * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER`
3060      *
3061      * The CSL period in units of 10 symbols. Value of 0 indicates that CSL should be disabled.
3062      */
3063     SPINEL_PROP_THREAD_CSL_PERIOD = SPINEL_PROP_THREAD_EXT__BEGIN + 41,
3064 
3065     /// MAC CSL Timeout
3066     /** Format: `L`
3067      * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER`
3068      *
3069      * The CSL timeout in seconds.
3070      */
3071     SPINEL_PROP_THREAD_CSL_TIMEOUT = SPINEL_PROP_THREAD_EXT__BEGIN + 42,
3072 
3073     /// MAC CSL Channel
3074     /** Format: `C`
3075      * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER`
3076      *
3077      * The CSL channel as described in chapter 4.6.5.1.2 of the Thread v1.2.0 Specification.
3078      * Value of 0 means that CSL reception (if enabled) occurs on the Thread Network channel.
3079      * Value from range [11,26] is an alternative channel on which a CSL reception occurs.
3080      */
3081     SPINEL_PROP_THREAD_CSL_CHANNEL = SPINEL_PROP_THREAD_EXT__BEGIN + 43,
3082 
3083     /// Thread Domain Name
3084     /** Format `U` - Read-write
3085      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3086      *
3087      * This property is available since Thread 1.2.0.
3088      * Write to this property succeeds only when Thread protocols are disabled.
3089      *
3090      */
3091     SPINEL_PROP_THREAD_DOMAIN_NAME = SPINEL_PROP_THREAD_EXT__BEGIN + 44,
3092 
3093     /// Link metrics query
3094     /** Format: `6CC` - Write-Only
3095      *
3096      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3097      *
3098      * `6` : IPv6 destination address
3099      * `C` : Series id (0 for Single Probe)
3100      * `C` : List of requested metric ids encoded as bit fields in single byte
3101      *
3102      *   +---------------+----+
3103      *   |    Metric     | Id |
3104      *   +---------------+----+
3105      *   | Received PDUs |  0 |
3106      *   | LQI           |  1 |
3107      *   | Link margin   |  2 |
3108      *   | RSSI          |  3 |
3109      *   +---------------+----+
3110      *
3111      * If the query succeeds, the NCP will send a result to the Host using
3112      * @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT.
3113      *
3114      */
3115     SPINEL_PROP_THREAD_LINK_METRICS_QUERY = SPINEL_PROP_THREAD_EXT__BEGIN + 45,
3116 
3117     /// Link metrics query result
3118     /** Format: `6Ct(A(t(CD)))` - Unsolicited notifications only
3119      *
3120      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3121      *
3122      * `6` : IPv6 destination address
3123      * `C` : Status
3124      * `t(A(t(CD)))` : Array of structs encoded as following:
3125      *   `C` : Metric id
3126      *   `D` : Metric value
3127      *
3128      *   +---------------+----+----------------+
3129      *   |    Metric     | Id |  Value format  |
3130      *   +---------------+----+----------------+
3131      *   | Received PDUs |  0 | `L` (uint32_t) |
3132      *   | LQI           |  1 | `C` (uint8_t)  |
3133      *   | Link margin   |  2 | `C` (uint8_t)  |
3134      *   | RSSI          |  3 | `c` (int8_t)   |
3135      *   +---------------+----+----------------+
3136      *
3137      */
3138     SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT = SPINEL_PROP_THREAD_EXT__BEGIN + 46,
3139 
3140     /// Link metrics probe
3141     /** Format `6CC` - Write only
3142      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3143      *
3144      * Send a MLE Link Probe message to the peer.
3145      *
3146      * `6` : IPv6 destination address
3147      * `C` : The Series ID for which this Probe message targets at
3148      * `C` : The length of the Probe message, valid range: [0, 64]
3149      *
3150      */
3151     SPINEL_PROP_THREAD_LINK_METRICS_PROBE = SPINEL_PROP_THREAD_EXT__BEGIN + 47,
3152 
3153     /// Link metrics Enhanced-ACK Based Probing management
3154     /** Format: 6Cd - Write only
3155      *
3156      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3157      *
3158      * `6` : IPv6 destination address
3159      * `C` : Indicate whether to register or clear the probing. `0` - clear, `1` - register
3160      * `C` : List of requested metric ids encoded as bit fields in single byte
3161      *
3162      *   +---------------+----+
3163      *   |    Metric     | Id |
3164      *   +---------------+----+
3165      *   | LQI           |  1 |
3166      *   | Link margin   |  2 |
3167      *   | RSSI          |  3 |
3168      *   +---------------+----+
3169      *
3170      * Result of configuration is reported asynchronously to the Host using the
3171      * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE.
3172      *
3173      * Whenever Enh-ACK IE report is received it is passed to the Host using the
3174      * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK_IE property.
3175      *
3176      */
3177     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK = SPINEL_PROP_THREAD_EXT__BEGIN + 48,
3178 
3179     /// Link metrics Enhanced-ACK Based Probing IE report
3180     /** Format: SEA(t(CD)) - Unsolicited notifications only
3181      *
3182      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3183      *
3184      * `S` : Short address of the Probing Subject
3185      * `E` : Extended address of the Probing Subject
3186      * `t(A(t(CD)))` : Struct that contains array of structs encoded as following:
3187      *   `C` : Metric id
3188      *   `D` : Metric value
3189      *
3190      *   +---------------+----+----------------+
3191      *   |    Metric     | Id |  Value format  |
3192      *   +---------------+----+----------------+
3193      *   | LQI           |  1 | `C` (uint8_t)  |
3194      *   | Link margin   |  2 | `C` (uint8_t)  |
3195      *   | RSSI          |  3 | `c` (int8_t)   |
3196      *   +---------------+----+----------------+
3197      *
3198      */
3199     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK_IE = SPINEL_PROP_THREAD_EXT__BEGIN + 49,
3200 
3201     /// Link metrics Forward Tracking Series management
3202     /** Format: 6CCC - Write only
3203      *
3204      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3205      *
3206      * `6` : IPv6 destination address
3207      * `C` : Series id
3208      * `C` : Tracked frame types encoded as bit fields in single byte, if equal to zero,
3209      *       accounting is stopped and a series is removed
3210      * `C` : Requested metric ids encoded as bit fields in single byte
3211      *
3212      *   +------------------+----+
3213      *   |    Frame type    | Id |
3214      *   +------------------+----+
3215      *   | MLE Link Probe   |  0 |
3216      *   | MAC Data         |  1 |
3217      *   | MAC Data Request |  2 |
3218      *   | MAC ACK          |  3 |
3219      *   +------------------+----+
3220      *
3221      *   +---------------+----+
3222      *   |    Metric     | Id |
3223      *   +---------------+----+
3224      *   | Received PDUs |  0 |
3225      *   | LQI           |  1 |
3226      *   | Link margin   |  2 |
3227      *   | RSSI          |  3 |
3228      *   +---------------+----+
3229      *
3230      * Result of configuration is reported asynchronously to the Host using the
3231      * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE.
3232      *
3233      */
3234     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD = SPINEL_PROP_THREAD_EXT__BEGIN + 50,
3235 
3236     /// Link metrics management response
3237     /** Format: 6C - Unsolicited notifications only
3238      *
3239      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3240      *
3241      * `6` : IPv6 source address
3242      * `C` : Received status
3243      *
3244      */
3245     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE = SPINEL_PROP_THREAD_EXT__BEGIN + 51,
3246 
3247     /// Multicast Listeners Register Request
3248     /** Format `t(A(6))A(t(CD))` - Write-only
3249      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3250      *
3251      * `t(A(6))`: Array of IPv6 multicast addresses
3252      * `A(t(CD))`: Array of structs holding optional parameters as follows
3253      *   `C`: Parameter id
3254      *   `D`: Parameter value
3255      *
3256      *   +----------------------------------------------------------------+
3257      *   | Id:   SPINEL_THREAD_MLR_PARAMID_TIMEOUT                        |
3258      *   | Type: `L`                                                      |
3259      *   | Description: Timeout in seconds. If this optional parameter is |
3260      *   |   omitted, the default value of the BBR will be used.          |
3261      *   | Special values:                                                |
3262      *   |   0 causes given addresses to be removed                       |
3263      *   |   0xFFFFFFFF is permanent and persistent registration          |
3264      *   +----------------------------------------------------------------+
3265      *
3266      * Write to this property initiates update of Multicast Listeners Table on the primary BBR.
3267      * If the write succeeded, the result of network operation will be notified later by the
3268      * SPINEL_PROP_THREAD_MLR_RESPONSE property. If the write fails, no MLR.req is issued and
3269      * notification through the SPINEL_PROP_THREAD_MLR_RESPONSE property will not occur.
3270      *
3271      */
3272     SPINEL_PROP_THREAD_MLR_REQUEST = SPINEL_PROP_THREAD_EXT__BEGIN + 52,
3273 
3274     /// Multicast Listeners Register Response
3275     /** Format `CCt(A(6))` - Unsolicited notifications only
3276      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3277      *
3278      * `C`: Status
3279      * `C`: MlrStatus (The Multicast Listener Registration Status)
3280      * `A(6)`: Array of IPv6 addresses that failed to be updated on the primary BBR
3281      *
3282      * This property is notified asynchronously when the NCP receives MLR.rsp following
3283      * previous write to the SPINEL_PROP_THREAD_MLR_REQUEST property.
3284      */
3285     SPINEL_PROP_THREAD_MLR_RESPONSE = SPINEL_PROP_THREAD_EXT__BEGIN + 53,
3286 
3287     /// Interface Identifier specified for Thread Domain Unicast Address.
3288     /** Format: `A(C)` - Read-write
3289      *
3290      *   `A(C)`: Interface Identifier (8 bytes).
3291      *
3292      * Required capability: SPINEL_CAP_DUA
3293      *
3294      * If write to this property is performed without specified parameter
3295      * the Interface Identifier of the Thread Domain Unicast Address will be cleared.
3296      * If the DUA Interface Identifier is cleared on the NCP device,
3297      * the get spinel property command will be returned successfully without specified parameter.
3298      *
3299      */
3300     SPINEL_PROP_THREAD_DUA_ID = SPINEL_PROP_THREAD_EXT__BEGIN + 54,
3301 
3302     /// Thread 1.2 Primary Backbone Router information in the Thread Network.
3303     /** Format: `SSLC` - Read-Only
3304      *
3305      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3306      *
3307      * `S`: Server.
3308      * `S`: Reregistration Delay (in seconds).
3309      * `L`: Multicast Listener Registration Timeout (in seconds).
3310      * `C`: Sequence Number.
3311      *
3312      */
3313     SPINEL_PROP_THREAD_BACKBONE_ROUTER_PRIMARY = SPINEL_PROP_THREAD_EXT__BEGIN + 55,
3314 
3315     /// Thread 1.2 Backbone Router local state.
3316     /** Format: `C` - Read-Write
3317      *
3318      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3319      *
3320      * The valid values are specified by SPINEL_THREAD_BACKBONE_ROUTER_STATE_<state> enumeration.
3321      * Backbone functionality will be disabled if SPINEL_THREAD_BACKBONE_ROUTER_STATE_DISABLED
3322      * is written to this property, enabled otherwise.
3323      *
3324      */
3325     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_STATE = SPINEL_PROP_THREAD_EXT__BEGIN + 56,
3326 
3327     /// Local Thread 1.2 Backbone Router configuration.
3328     /** Format: SLC - Read-Write
3329      *
3330      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3331      *
3332      * `S`: Reregistration Delay (in seconds).
3333      * `L`: Multicast Listener Registration Timeout (in seconds).
3334      * `C`: Sequence Number.
3335      *
3336      */
3337     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_CONFIG = SPINEL_PROP_THREAD_EXT__BEGIN + 57,
3338 
3339     /// Register local Thread 1.2 Backbone Router configuration.
3340     /** Format: Empty (Write only).
3341      *
3342      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3343      *
3344      * Writing to this property (with any value) will register local Backbone Router configuration.
3345      *
3346      */
3347     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTER = SPINEL_PROP_THREAD_EXT__BEGIN + 58,
3348 
3349     /// Thread 1.2 Backbone Router registration jitter.
3350     /** Format: `C` - Read-Write
3351      *
3352      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3353      *
3354      * `C`: Backbone Router registration jitter.
3355      *
3356      */
3357     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTRATION_JITTER = SPINEL_PROP_THREAD_EXT__BEGIN + 59,
3358 
3359     SPINEL_PROP_THREAD_EXT__END = 0x1600,
3360 
3361     SPINEL_PROP_IPV6__BEGIN = 0x60,
3362 
3363     /// Link-Local IPv6 Address
3364     /** Format: `6` - Read only
3365      *
3366      */
3367     SPINEL_PROP_IPV6_LL_ADDR = SPINEL_PROP_IPV6__BEGIN + 0, ///< [6]
3368 
3369     /// Mesh Local IPv6 Address
3370     /** Format: `6` - Read only
3371      *
3372      */
3373     SPINEL_PROP_IPV6_ML_ADDR = SPINEL_PROP_IPV6__BEGIN + 1,
3374 
3375     /// Mesh Local Prefix
3376     /** Format: `6C` - Read-write
3377      *
3378      * Provides Mesh Local Prefix
3379      *
3380      *   `6`: Mesh local prefix
3381      *   `C` : Prefix length (64 bit for Thread).
3382      *
3383      */
3384     SPINEL_PROP_IPV6_ML_PREFIX = SPINEL_PROP_IPV6__BEGIN + 2,
3385 
3386     /// IPv6 (Unicast) Address Table
3387     /** Format: `A(t(6CLLC))`
3388      *
3389      * This property provides all unicast addresses.
3390      *
3391      * Array of structures containing:
3392      *
3393      *  `6`: IPv6 Address
3394      *  `C`: Network Prefix Length (in bits)
3395      *  `L`: Valid Lifetime
3396      *  `L`: Preferred Lifetime
3397      *
3398      */
3399     SPINEL_PROP_IPV6_ADDRESS_TABLE = SPINEL_PROP_IPV6__BEGIN + 3,
3400 
3401     /// IPv6 Route Table - Deprecated
3402     SPINEL_PROP_IPV6_ROUTE_TABLE = SPINEL_PROP_IPV6__BEGIN + 4,
3403 
3404     /// IPv6 ICMP Ping Offload
3405     /** Format: `b`
3406      *
3407      * Allow the NCP to directly respond to ICMP ping requests. If this is
3408      * turned on, ping request ICMP packets will not be passed to the host.
3409      *
3410      * Default value is `false`.
3411      */
3412     SPINEL_PROP_IPV6_ICMP_PING_OFFLOAD = SPINEL_PROP_IPV6__BEGIN + 5,
3413 
3414     /// IPv6 Multicast Address Table
3415     /** Format: `A(t(6))`
3416      *
3417      * This property provides all multicast addresses.
3418      *
3419      */
3420     SPINEL_PROP_IPV6_MULTICAST_ADDRESS_TABLE = SPINEL_PROP_IPV6__BEGIN + 6,
3421 
3422     /// IPv6 ICMP Ping Offload
3423     /** Format: `C`
3424      *
3425      * Allow the NCP to directly respond to ICMP ping requests. If this is
3426      * turned on, ping request ICMP packets will not be passed to the host.
3427      *
3428      * This property allows enabling responses sent to unicast only, multicast
3429      * only, or both. The valid value are defined by enumeration
3430      * `spinel_ipv6_icmp_ping_offload_mode_t`.
3431      *
3432      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_DISABLED       = 0
3433      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_UNICAST_ONLY   = 1
3434      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_MULTICAST_ONLY = 2
3435      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_ALL            = 3
3436      *
3437      * Default value is `NET_IPV6_ICMP_PING_OFFLOAD_DISABLED`.
3438      *
3439      */
3440     SPINEL_PROP_IPV6_ICMP_PING_OFFLOAD_MODE = SPINEL_PROP_IPV6__BEGIN + 7, ///< [b]
3441 
3442     SPINEL_PROP_IPV6__END = 0x70,
3443 
3444     SPINEL_PROP_IPV6_EXT__BEGIN = 0x1600,
3445     SPINEL_PROP_IPV6_EXT__END   = 0x1700,
3446 
3447     SPINEL_PROP_STREAM__BEGIN = 0x70,
3448 
3449     /// Debug Stream
3450     /** Format: `U` (stream, read only)
3451      *
3452      * This property is a streaming property, meaning that you cannot explicitly
3453      * fetch the value of this property. The stream provides human-readable debugging
3454      * output which may be displayed in the host logs.
3455      *
3456      * The location of newline characters is not assumed by the host: it is
3457      * the NCP's responsibility to insert newline characters where needed,
3458      * just like with any other text stream.
3459      *
3460      * To receive the debugging stream, you wait for `CMD_PROP_VALUE_IS`
3461      * commands for this property from the NCP.
3462      *
3463      */
3464     SPINEL_PROP_STREAM_DEBUG = SPINEL_PROP_STREAM__BEGIN + 0,
3465 
3466     /// Raw Stream
3467     /** Format: `dD` (stream, read only)
3468      *  Required Capability: SPINEL_CAP_MAC_RAW or SPINEL_CAP_CONFIG_RADIO
3469      *
3470      * This stream provides the capability of sending and receiving raw 15.4 frames
3471      * to and from the radio. The exact format of the frame metadata and data is
3472      * dependent on the MAC and PHY being used.
3473      *
3474      * This property is a streaming property, meaning that you cannot explicitly
3475      * fetch the value of this property. To receive traffic, you wait for
3476      * `CMD_PROP_VALUE_IS` commands with this property id from the NCP.
3477      *
3478      * The general format of this property is:
3479      *
3480      *    `d` : frame data
3481      *    `D` : frame meta data
3482      *
3483      * The frame meta data is optional. Frame metadata MAY be empty or partially
3484      * specified. Partially specified metadata MUST be accepted. Default values
3485      * are used for all unspecified fields.
3486      *
3487      * The frame metadata field consists of the following fields:
3488      *
3489      *   `c` : Received Signal Strength (RSSI) in dBm - default is -128
3490      *   `c` : Noise floor in dBm - default is -128
3491      *   `S` : Flags (see below).
3492      *   `d` : PHY-specific data/struct
3493      *   `d` : Vendor-specific data/struct
3494      *
3495      * Flags fields are defined by the following enumeration bitfields:
3496      *
3497      *   SPINEL_MD_FLAG_TX       = 0x0001 :  Packet was transmitted, not received.
3498      *   SPINEL_MD_FLAG_BAD_FCS  = 0x0004 :  Packet was received with bad FCS
3499      *   SPINEL_MD_FLAG_DUPE     = 0x0008 :  Packet seems to be a duplicate
3500      *   SPINEL_MD_FLAG_RESERVED = 0xFFF2 :  Flags reserved for future use.
3501      *
3502      * The format of PHY-specific data for a Thread device contains the following
3503      * optional fields:
3504 
3505      *   `C` : 802.15.4 channel (Receive channel)
3506      *   `C` : IEEE 802.15.4 LQI
3507      *   `L` : The timestamp milliseconds
3508      *   `S` : The timestamp microseconds, offset to mMsec
3509      *
3510      * Frames written to this stream with `CMD_PROP_VALUE_SET` will be sent out
3511      * over the radio. This allows the caller to use the radio directly.
3512      *
3513      * The frame meta data for the `CMD_PROP_VALUE_SET` contains the following
3514      * fields.  Default values are used for all unspecified fields.
3515      *
3516      *  `C` : Channel (for frame tx) - MUST be included.
3517      *  `C` : Maximum number of backoffs attempts before declaring CCA failure
3518      *        (use Thread stack default if not specified)
3519      *  `C` : Maximum number of retries allowed after a transmission failure
3520      *        (use Thread stack default if not specified)
3521      *  `b` : Set to true to enable CSMA-CA for this packet, false otherwise.
3522      *        (default true).
3523      *  `b` : Set to true to indicate if header is updated - related to
3524      *        `mIsHeaderUpdated` in `otRadioFrame` (default false).
3525      *  `b` : Set to true to indicate it is a retransmission - related to
3526      *        `mIsARetx` in `otRadioFrame` (default false).
3527      *  `b` : Set to true to indicate security was processed on tx frame
3528      *        `mIsSecurityProcessed` in `otRadioFrame` (default false).
3529      *  `L` : TX delay interval used for CSL - related to `mTxDelay` in
3530      *        `otRadioFrame` (default zero).
3531      *  `L` : TX delay based time used for CSL - related to `mTxDelayBaseTime`
3532      *        in `otRadioFrame` (default zero).
3533      *  `C` : RX channel after TX done (default assumed to be same as
3534      *        channel in metadata)
3535      *
3536      */
3537     SPINEL_PROP_STREAM_RAW = SPINEL_PROP_STREAM__BEGIN + 1,
3538 
3539     /// (IPv6) Network Stream
3540     /** Format: `dD` (stream, read only)
3541      *
3542      * This stream provides the capability of sending and receiving (IPv6)
3543      * data packets to and from the currently attached network. The packets
3544      * are sent or received securely (encryption and authentication).
3545      *
3546      * This property is a streaming property, meaning that you cannot explicitly
3547      * fetch the value of this property. To receive traffic, you wait for
3548      * `CMD_PROP_VALUE_IS` commands with this property id from the NCP.
3549      *
3550      * To send network packets, you call `CMD_PROP_VALUE_SET` on this property with
3551      * the value of the packet.
3552      *
3553      * The general format of this property is:
3554      *
3555      *    `d` : packet data
3556      *    `D` : packet meta data
3557      *
3558      * The packet metadata is optional. Packet meta data MAY be empty or partially
3559      * specified. Partially specified metadata MUST be accepted. Default values
3560      * are used for all unspecified fields.
3561      *
3562      * For OpenThread the meta data is currently empty.
3563      *
3564      */
3565     SPINEL_PROP_STREAM_NET = SPINEL_PROP_STREAM__BEGIN + 2,
3566 
3567     /// (IPv6) Network Stream Insecure
3568     /** Format: `dD` (stream, read only)
3569      *
3570      * This stream provides the capability of sending and receiving unencrypted
3571      * and unauthenticated data packets to and from nearby devices for the
3572      * purposes of device commissioning.
3573      *
3574      * This property is a streaming property, meaning that you cannot explicitly
3575      * fetch the value of this property. To receive traffic, you wait for
3576      * `CMD_PROP_VALUE_IS` commands with this property id from the NCP.
3577      *
3578      * To send network packets, you call `CMD_PROP_VALUE_SET` on this property with
3579      * the value of the packet.
3580      *
3581      * The general format of this property is:
3582      *
3583      *    `d` : packet data
3584      *    `D` : packet meta data
3585      *
3586      * The packet metadata is optional. Packet meta data MAY be empty or partially
3587      * specified. Partially specified metadata MUST be accepted. Default values
3588      * are used for all unspecified fields.
3589      *
3590      * For OpenThread the meta data is currently empty.
3591      *
3592      */
3593     SPINEL_PROP_STREAM_NET_INSECURE = SPINEL_PROP_STREAM__BEGIN + 3,
3594 
3595     /// Log Stream
3596     /** Format: `UD` (stream, read only)
3597      *
3598      * This property is a read-only streaming property which provides
3599      * formatted log string from NCP. This property provides asynchronous
3600      * `CMD_PROP_VALUE_IS` updates with a new log string and includes
3601      * optional meta data.
3602      *
3603      *   `U`: The log string
3604      *   `D`: Log metadata (optional).
3605      *
3606      * Any data after the log string is considered metadata and is OPTIONAL.
3607      * Presence of `SPINEL_CAP_OPENTHREAD_LOG_METADATA` capability
3608      * indicates that OpenThread log metadata format is used as defined
3609      * below:
3610      *
3611      *    `C`: Log level (as per definition in enumeration
3612      *         `SPINEL_NCP_LOG_LEVEL_<level>`)
3613      *    `i`: OpenThread Log region (as per definition in enumeration
3614      *         `SPINEL_NCP_LOG_REGION_<region>).
3615      *    `X`: Log timestamp = <timestamp_base> + <current_time_ms>
3616      *
3617      */
3618     SPINEL_PROP_STREAM_LOG = SPINEL_PROP_STREAM__BEGIN + 4,
3619 
3620     SPINEL_PROP_STREAM__END = 0x80,
3621 
3622     SPINEL_PROP_STREAM_EXT__BEGIN = 0x1700,
3623     SPINEL_PROP_STREAM_EXT__END   = 0x1800,
3624 
3625     SPINEL_PROP_MESHCOP__BEGIN = 0x80,
3626 
3627     // Thread Joiner State
3628     /** Format `C` - Read Only
3629      *
3630      * Required capability: SPINEL_CAP_THREAD_JOINER
3631      *
3632      * The valid values are specified by `spinel_meshcop_joiner_state_t` (`SPINEL_MESHCOP_JOINER_STATE_<state>`)
3633      * enumeration.
3634      *
3635      */
3636     SPINEL_PROP_MESHCOP_JOINER_STATE = SPINEL_PROP_MESHCOP__BEGIN + 0, ///<[C]
3637 
3638     /// Thread Joiner Commissioning command and the parameters
3639     /** Format `b` or `bU(UUUUU)` (fields in parenthesis are optional) - Write Only
3640      *
3641      * This property starts or stops Joiner's commissioning process
3642      *
3643      * Required capability: SPINEL_CAP_THREAD_JOINER
3644      *
3645      * Writing to this property starts/stops the Joiner commissioning process.
3646      * The immediate `VALUE_IS` response indicates success/failure of the starting/stopping
3647      * the Joiner commissioning process.
3648      *
3649      * After a successful start operation, the join process outcome is reported through an
3650      * asynchronous `VALUE_IS(LAST_STATUS)` update with one of the following error status values:
3651      *
3652      *     - SPINEL_STATUS_JOIN_SUCCESS     the join process succeeded.
3653      *     - SPINEL_STATUS_JOIN_SECURITY    the join process failed due to security credentials.
3654      *     - SPINEL_STATUS_JOIN_NO_PEERS    no joinable network was discovered.
3655      *     - SPINEL_STATUS_JOIN_RSP_TIMEOUT if a response timed out.
3656      *     - SPINEL_STATUS_JOIN_FAILURE     join failure.
3657      *
3658      * Frame format:
3659      *
3660      *  `b` : Start or stop commissioning process (true to start).
3661      *
3662      * Only if the start commissioning.
3663      *
3664      *  `U` : Joiner's PSKd.
3665      *
3666      * The next fields are all optional. If not provided, OpenThread default values would be used.
3667      *
3668      *  `U` : Provisioning URL (use empty string if not required).
3669      *  `U` : Vendor Name. If not specified or empty string, use OpenThread default (PACKAGE_NAME).
3670      *  `U` : Vendor Model. If not specified or empty string, use OpenThread default (OPENTHREAD_CONFIG_PLATFORM_INFO).
3671      *  `U` : Vendor Sw Version. If not specified or empty string, use OpenThread default (PACKAGE_VERSION).
3672      *  `U` : Vendor Data String. Will not be appended if not specified.
3673      *
3674      */
3675     SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING = SPINEL_PROP_MESHCOP__BEGIN + 1,
3676 
3677     // Thread Commissioner State
3678     /** Format `C`
3679      *
3680      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3681      *
3682      * The valid values are specified by SPINEL_MESHCOP_COMMISSIONER_STATE_<state> enumeration.
3683      *
3684      */
3685     SPINEL_PROP_MESHCOP_COMMISSIONER_STATE = SPINEL_PROP_MESHCOP__BEGIN + 2,
3686 
3687     // Thread Commissioner Joiners
3688     /** Format `A(t(t(E|CX)UL))` - get, insert or remove.
3689      *
3690      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3691      *
3692      * Data per array entry is:
3693      *
3694      *  `t()` | `t(E)` | `t(CX)` : Joiner info struct (formatting varies).
3695      *
3696      *   -  `t()` or empty struct indicates any joiner.
3697      *   -  `t(E)` specifies the Joiner EUI-64.
3698      *   -  `t(CX) specifies Joiner Discerner, `C` is Discerner length (in bits), and `X` is Discerner value.
3699      *
3700      * The struct is followed by:
3701      *
3702      *  `L` : Timeout after which to remove Joiner (when written should be in seconds, when read is in milliseconds)
3703      *  `U` : PSKd
3704      *
3705      * For CMD_PROP_VALUE_REMOVE the timeout and PSKd are optional.
3706      *
3707      */
3708     SPINEL_PROP_MESHCOP_COMMISSIONER_JOINERS = SPINEL_PROP_MESHCOP__BEGIN + 3,
3709 
3710     // Thread Commissioner Provisioning URL
3711     /** Format `U`
3712      *
3713      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3714      *
3715      */
3716     SPINEL_PROP_MESHCOP_COMMISSIONER_PROVISIONING_URL = SPINEL_PROP_MESHCOP__BEGIN + 4,
3717 
3718     // Thread Commissioner Session ID
3719     /** Format `S` - Read only
3720      *
3721      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3722      *
3723      */
3724     SPINEL_PROP_MESHCOP_COMMISSIONER_SESSION_ID = SPINEL_PROP_MESHCOP__BEGIN + 5,
3725 
3726     /// Thread Joiner Discerner
3727     /** Format `CX`  - Read-write
3728      *
3729      * Required capability: SPINEL_CAP_THREAD_JOINER
3730      *
3731      * This property represents a Joiner Discerner.
3732      *
3733      * The Joiner Discerner is used to calculate the Joiner ID used during commissioning/joining process.
3734      *
3735      * By default (when a discerner is not provided or cleared), Joiner ID is derived as first 64 bits of the result
3736      * of computing SHA-256 over factory-assigned IEEE EUI-64. Note that this is the main behavior expected by Thread
3737      * specification.
3738      *
3739      * Format:
3740      *
3741      *   'C' : The Joiner Discerner bit length (number of bits).
3742      *   `X` : The Joiner Discerner value (64-bit unsigned)  - Only present/applicable when length is non-zero.
3743      *
3744      * When writing to this property, the length can be set to zero to clear any previously set Joiner Discerner value.
3745      *
3746      * When reading this property if there is no currently set Joiner Discerner, zero is returned as the length (with
3747      * no value field).
3748      *
3749      */
3750     SPINEL_PROP_MESHCOP_JOINER_DISCERNER = SPINEL_PROP_MESHCOP__BEGIN + 6,
3751 
3752     SPINEL_PROP_MESHCOP__END = 0x90,
3753 
3754     SPINEL_PROP_MESHCOP_EXT__BEGIN = 0x1800,
3755 
3756     // Thread Commissioner Announce Begin
3757     /** Format `LCS6` - Write only
3758      *
3759      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3760      *
3761      * Writing to this property sends an Announce Begin message with the specified parameters. Response is a
3762      * `LAST_STATUS` update with status of operation.
3763      *
3764      *   `L` : Channel mask
3765      *   `C` : Number of messages per channel
3766      *   `S` : The time between two successive MLE Announce transmissions (milliseconds)
3767      *   `6` : IPv6 destination
3768      *
3769      */
3770     SPINEL_PROP_MESHCOP_COMMISSIONER_ANNOUNCE_BEGIN = SPINEL_PROP_MESHCOP_EXT__BEGIN + 0,
3771 
3772     // Thread Commissioner Energy Scan Query
3773     /** Format `LCSS6` - Write only
3774      *
3775      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3776      *
3777      * Writing to this property sends an Energy Scan Query message with the specified parameters. Response is a
3778      * `LAST_STATUS` with status of operation. The energy scan results are emitted asynchronously through
3779      * `SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN_RESULT` updates.
3780      *
3781      * Format is:
3782      *
3783      *   `L` : Channel mask
3784      *   `C` : The number of energy measurements per channel
3785      *   `S` : The time between energy measurements (milliseconds)
3786      *   `S` : The scan duration for each energy measurement (milliseconds)
3787      *   `6` : IPv6 destination.
3788      *
3789      */
3790     SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN = SPINEL_PROP_MESHCOP_EXT__BEGIN + 1,
3791 
3792     // Thread Commissioner Energy Scan Result
3793     /** Format `Ld` - Asynchronous event only
3794      *
3795      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3796      *
3797      * This property provides asynchronous `CMD_PROP_VALUE_INSERTED` updates to report energy scan results for a
3798      * previously sent Energy Scan Query message (please see `SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN`).
3799      *
3800      * Format is:
3801      *
3802      *   `L` : Channel mask
3803      *   `d` : Energy measurement data (note that `d` encoding includes the length)
3804      *
3805      */
3806     SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN_RESULT = SPINEL_PROP_MESHCOP_EXT__BEGIN + 2,
3807 
3808     // Thread Commissioner PAN ID Query
3809     /** Format `SL6` - Write only
3810      *
3811      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3812      *
3813      * Writing to this property sends a PAN ID Query message with the specified parameters. Response is a
3814      * `LAST_STATUS` with status of operation. The PAN ID Conflict results are emitted asynchronously through
3815      * `SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_CONFLICT_RESULT` updates.
3816      *
3817      * Format is:
3818      *
3819      *   `S` : PAN ID to query
3820      *   `L` : Channel mask
3821      *   `6` : IPv6 destination
3822      *
3823      */
3824     SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_QUERY = SPINEL_PROP_MESHCOP_EXT__BEGIN + 3,
3825 
3826     // Thread Commissioner PAN ID Conflict Result
3827     /** Format `SL` - Asynchronous event only
3828      *
3829      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3830      *
3831      * This property provides asynchronous `CMD_PROP_VALUE_INSERTED` updates to report PAN ID conflict results for a
3832      * previously sent PAN ID Query message (please see `SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_QUERY`).
3833      *
3834      * Format is:
3835      *
3836      *   `S` : The PAN ID
3837      *   `L` : Channel mask
3838      *
3839      */
3840     SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_CONFLICT_RESULT = SPINEL_PROP_MESHCOP_EXT__BEGIN + 4,
3841 
3842     // Thread Commissioner Send MGMT_COMMISSIONER_GET
3843     /** Format `d` - Write only
3844      *
3845      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3846      *
3847      * Writing to this property sends a MGMT_COMMISSIONER_GET message with the specified parameters. Response is a
3848      * `LAST_STATUS` with status of operation.
3849      *
3850      * Format is:
3851      *
3852      *   `d` : List of TLV types to get
3853      *
3854      */
3855     SPINEL_PROP_MESHCOP_COMMISSIONER_MGMT_GET = SPINEL_PROP_MESHCOP_EXT__BEGIN + 5,
3856 
3857     // Thread Commissioner Send MGMT_COMMISSIONER_SET
3858     /** Format `d` - Write only
3859      *
3860      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3861      *
3862      * Writing to this property sends a MGMT_COMMISSIONER_SET message with the specified parameters. Response is a
3863      * `LAST_STATUS` with status of operation.
3864      *
3865      * Format is:
3866      *
3867      *   `d` : TLV encoded data
3868      *
3869      */
3870     SPINEL_PROP_MESHCOP_COMMISSIONER_MGMT_SET = SPINEL_PROP_MESHCOP_EXT__BEGIN + 6,
3871 
3872     // Thread Commissioner Generate PSKc
3873     /** Format: `UUd` - Write only
3874      *
3875      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3876      *
3877      * Writing to this property allows user to generate PSKc from a given commissioning pass-phrase, network name,
3878      * extended PAN Id.
3879      *
3880      * Written value format is:
3881      *
3882      *   `U` : The commissioning pass-phrase.
3883      *   `U` : Network Name.
3884      *   `d` : Extended PAN ID.
3885      *
3886      * The response on success would be a `VALUE_IS` command with the PSKc with format below:
3887      *
3888      *   `D` : The PSKc
3889      *
3890      * On a failure a `LAST_STATUS` is emitted with the error status.
3891      *
3892      */
3893     SPINEL_PROP_MESHCOP_COMMISSIONER_GENERATE_PSKC = SPINEL_PROP_MESHCOP_EXT__BEGIN + 7,
3894 
3895     SPINEL_PROP_MESHCOP_EXT__END = 0x1900,
3896 
3897     SPINEL_PROP_OPENTHREAD__BEGIN = 0x1900,
3898 
3899     /// Channel Manager - Channel Change New Channel
3900     /** Format: `C` (read-write)
3901      *
3902      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3903      *
3904      * Setting this property triggers the Channel Manager to start
3905      * a channel change process. The network switches to the given
3906      * channel after the specified delay (see `CHANNEL_MANAGER_DELAY`).
3907      *
3908      * A subsequent write to this property will cancel an ongoing
3909      * (previously requested) channel change.
3910      *
3911      */
3912     SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL = SPINEL_PROP_OPENTHREAD__BEGIN + 0,
3913 
3914     /// Channel Manager - Channel Change Delay
3915     /** Format 'S'
3916      *  Units: seconds
3917      *
3918      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3919      *
3920      * This property specifies the delay (in seconds) to be used for
3921      * a channel change request.
3922      *
3923      * The delay should preferably be longer than maximum data poll
3924      * interval used by all sleepy-end-devices within the Thread
3925      * network.
3926      *
3927      */
3928     SPINEL_PROP_CHANNEL_MANAGER_DELAY = SPINEL_PROP_OPENTHREAD__BEGIN + 1,
3929 
3930     /// Channel Manager Supported Channels
3931     /** Format 'A(C)'
3932      *
3933      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3934      *
3935      * This property specifies the list of supported channels.
3936      *
3937      */
3938     SPINEL_PROP_CHANNEL_MANAGER_SUPPORTED_CHANNELS = SPINEL_PROP_OPENTHREAD__BEGIN + 2,
3939 
3940     /// Channel Manager Favored Channels
3941     /** Format 'A(C)'
3942      *
3943      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3944      *
3945      * This property specifies the list of favored channels (when `ChannelManager` is asked to select channel)
3946      *
3947      */
3948     SPINEL_PROP_CHANNEL_MANAGER_FAVORED_CHANNELS = SPINEL_PROP_OPENTHREAD__BEGIN + 3,
3949 
3950     /// Channel Manager Channel Select Trigger
3951     /** Format 'b'
3952      *
3953      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3954      *
3955      * Writing to this property triggers a request on `ChannelManager` to select a new channel.
3956      *
3957      * Once a Channel Select is triggered, the Channel Manager will perform the following 3 steps:
3958      *
3959      * 1) `ChannelManager` decides if the channel change would be helpful. This check can be skipped if in the input
3960      *    boolean to this property is set to `true` (skipping the quality check).
3961      *    This step uses the collected link quality metrics on the device such as CCA failure rate, frame and message
3962      *    error rates per neighbor, etc. to determine if the current channel quality is at the level that justifies
3963      *    a channel change.
3964      *
3965      * 2) If first step passes, then `ChannelManager` selects a potentially better channel. It uses the collected
3966      *    channel quality data by `ChannelMonitor` module. The supported and favored channels are used at this step.
3967      *
3968      * 3) If the newly selected channel is different from the current channel, `ChannelManager` requests/starts the
3969      *    channel change process.
3970      *
3971      * Reading this property always yields `false`.
3972      *
3973      */
3974     SPINEL_PROP_CHANNEL_MANAGER_CHANNEL_SELECT = SPINEL_PROP_OPENTHREAD__BEGIN + 4,
3975 
3976     /// Channel Manager Auto Channel Selection Enabled
3977     /** Format 'b'
3978      *
3979      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3980      *
3981      * This property indicates if auto-channel-selection functionality is enabled/disabled on `ChannelManager`.
3982      *
3983      * When enabled, `ChannelManager` will periodically checks and attempts to select a new channel. The period interval
3984      * is specified by `SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_INTERVAL`.
3985      *
3986      */
3987     SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 5,
3988 
3989     /// Channel Manager Auto Channel Selection Interval
3990     /** Format 'L'
3991      *  units: seconds
3992      *
3993      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3994      *
3995      * This property specifies the auto-channel-selection check interval (in seconds).
3996      *
3997      */
3998     SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 6,
3999 
4000     /// Thread network time.
4001     /** Format: `Xc` - Read only
4002      *
4003      * Data per item is:
4004      *
4005      *  `X`: The Thread network time, in microseconds.
4006      *  `c`: Time synchronization status.
4007      *
4008      */
4009     SPINEL_PROP_THREAD_NETWORK_TIME = SPINEL_PROP_OPENTHREAD__BEGIN + 7,
4010 
4011     /// Thread time synchronization period
4012     /** Format: `S` - Read-Write
4013      *
4014      * Data per item is:
4015      *
4016      *  `S`: Time synchronization period, in seconds.
4017      *
4018      */
4019     SPINEL_PROP_TIME_SYNC_PERIOD = SPINEL_PROP_OPENTHREAD__BEGIN + 8,
4020 
4021     /// Thread Time synchronization XTAL accuracy threshold for Router
4022     /** Format: `S` - Read-Write
4023      *
4024      * Data per item is:
4025      *
4026      *  `S`: The XTAL accuracy threshold for Router, in PPM.
4027      *
4028      */
4029     SPINEL_PROP_TIME_SYNC_XTAL_THRESHOLD = SPINEL_PROP_OPENTHREAD__BEGIN + 9,
4030 
4031     /// Child Supervision Interval
4032     /** Format: `S` - Read-Write
4033      *  Units: Seconds
4034      *
4035      * Required capability: `SPINEL_CAP_CHILD_SUPERVISION`
4036      *
4037      * The child supervision interval (in seconds). Zero indicates that child supervision is disabled.
4038      *
4039      * When enabled, Child supervision feature ensures that at least one message is sent to every sleepy child within
4040      * the given supervision interval. If there is no other message, a supervision message (a data message with empty
4041      * payload) is enqueued and sent to the child.
4042      *
4043      * This property is available for FTD build only.
4044      *
4045      */
4046     SPINEL_PROP_CHILD_SUPERVISION_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 10,
4047 
4048     /// Child Supervision Check Timeout
4049     /** Format: `S` - Read-Write
4050      *  Units: Seconds
4051      *
4052      * Required capability: `SPINEL_CAP_CHILD_SUPERVISION`
4053      *
4054      * The child supervision check timeout interval (in seconds). Zero indicates supervision check on the child is
4055      * disabled.
4056      *
4057      * Supervision check is only applicable on a sleepy child. When enabled, if the child does not hear from its parent
4058      * within the specified check timeout, it initiates a re-attach process by starting an MLE Child Update
4059      * Request/Response exchange with the parent.
4060      *
4061      * This property is available for FTD and MTD builds.
4062      *
4063      */
4064     SPINEL_PROP_CHILD_SUPERVISION_CHECK_TIMEOUT = SPINEL_PROP_OPENTHREAD__BEGIN + 11,
4065 
4066     // RCP (NCP in radio only mode) version
4067     /** Format `U` - Read only
4068      *
4069      * Required capability: SPINEL_CAP_POSIX
4070      *
4071      * This property gives the version string of RCP (NCP in radio mode) which is being controlled by a POSIX
4072      * application. It is available only in "POSIX" platform (i.e., `OPENTHREAD_PLATFORM_POSIX` is enabled).
4073      *
4074      */
4075     SPINEL_PROP_RCP_VERSION = SPINEL_PROP_OPENTHREAD__BEGIN + 12,
4076 
4077     /// Thread Parent Response info
4078     /** Format: `ESccCCCb` - Asynchronous event only
4079      *
4080      *  `E`: Extended address
4081      *  `S`: RLOC16
4082      *  `c`: Instant RSSI
4083      *  'c': Parent Priority
4084      *  `C`: Link Quality3
4085      *  `C`: Link Quality2
4086      *  `C`: Link Quality1
4087      *  'b': Is the node receiving parent response frame attached
4088      *
4089      * This property sends Parent Response frame information to the Host.
4090      * This property is available for FTD build only.
4091      *
4092      */
4093     SPINEL_PROP_PARENT_RESPONSE_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 13,
4094 
4095     /// SLAAC enabled
4096     /** Format `b` - Read-Write
4097      *  Required capability: `SPINEL_CAP_SLAAC`
4098      *
4099      * This property allows the host to enable/disable SLAAC module on NCP at run-time. When SLAAC module is enabled,
4100      * SLAAC addresses (based on on-mesh prefixes in Network Data) are added to the interface. When SLAAC module is
4101      * disabled any previously added SLAAC address is removed.
4102      *
4103      */
4104     SPINEL_PROP_SLAAC_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 14,
4105 
4106     // Supported Radio Links (by device)
4107     /**
4108      * Format `A(i)` - Read only
4109      *
4110      * This property returns list of supported radio links by the device itself. Enumeration `SPINEL_RADIO_LINK_{TYPE}`
4111      * values indicate different radio link types.
4112      *
4113      */
4114     SPINEL_PROP_SUPPORTED_RADIO_LINKS = SPINEL_PROP_OPENTHREAD__BEGIN + 15,
4115 
4116     /// Neighbor Table Multi Radio Link Info
4117     /** Format: `A(t(ESA(t(iC))))` - Read only
4118      * Required capability: `SPINEL_CAP_MULTI_RADIO`.
4119      *
4120      * Each item represents info about a neighbor:
4121      *
4122      *  `E`: Neighbor's Extended Address
4123      *  `S`: Neighbor's RLOC16
4124      *
4125      *  This is then followed by an array of radio link info structures indicating which radio links are supported by
4126      *  the neighbor:
4127      *
4128      *    `i` : Radio link type (enumeration `SPINEL_RADIO_LINK_{TYPE}`).
4129      *    `C` : Preference value associated with radio link.
4130      *
4131      */
4132     SPINEL_PROP_NEIGHBOR_TABLE_MULTI_RADIO_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 16,
4133 
4134     /// SRP Client Start
4135     /** Format: `b(6Sb)` - Write only
4136      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4137      *
4138      * Writing to this property allows user to start or stop the SRP client operation with a given SRP server.
4139      *
4140      * Written value format is:
4141      *
4142      *   `b` : TRUE to start the client, FALSE to stop the client.
4143      *
4144      * When used to start the SRP client, the following fields should also be included:
4145      *
4146      *   `6` : SRP server IPv6 address.
4147      *   `U` : SRP server port number.
4148      *   `b` : Boolean to indicate whether or not to emit SRP client events (using `SPINEL_PROP_SRP_CLIENT_EVENT`).
4149      *
4150      */
4151     SPINEL_PROP_SRP_CLIENT_START = SPINEL_PROP_OPENTHREAD__BEGIN + 17,
4152 
4153     /// SRP Client Lease Interval
4154     /** Format: `L` - Read/Write
4155      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4156      *
4157      * The lease interval used in SRP update requests (in seconds).
4158      *
4159      */
4160     SPINEL_PROP_SRP_CLIENT_LEASE_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 18,
4161 
4162     /// SRP Client Key Lease Interval
4163     /** Format: `L` - Read/Write
4164      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4165      *
4166      * The key lease interval used in SRP update requests (in seconds).
4167      *
4168      */
4169     SPINEL_PROP_SRP_CLIENT_KEY_LEASE_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 19,
4170 
4171     /// SRP Client Host Info
4172     /** Format: `UCt(A(6))` - Read only
4173      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4174      *
4175      * Format is:
4176      *
4177      *   `U`       : The host name.
4178      *   `C`       : The host state (values from `spinel_srp_client_item_state_t`).
4179      *   `t(A(6))` : Structure containing array of host IPv6 addresses.
4180      *
4181      */
4182     SPINEL_PROP_SRP_CLIENT_HOST_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 20,
4183 
4184     /// SRP Client Host Name (label).
4185     /** Format: `U` - Read/Write
4186      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4187      *
4188      */
4189     SPINEL_PROP_SRP_CLIENT_HOST_NAME = SPINEL_PROP_OPENTHREAD__BEGIN + 21,
4190 
4191     /// SRP Client Host Addresses
4192     /** Format: `A(6)` - Read/Write
4193      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4194      *
4195      */
4196     SPINEL_PROP_SRP_CLIENT_HOST_ADDRESSES = SPINEL_PROP_OPENTHREAD__BEGIN + 22,
4197 
4198     /// SRP Client Services
4199     /** Format: `A(t(UUSSSd))` - Read/Insert/Remove
4200      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4201      *
4202      * This property provides a list/array of services.
4203      *
4204      * Data per item for `SPINEL_CMD_PROP_VALUE_GET` and/or `SPINEL_CMD_PROP_VALUE_INSERT` operation is as follows:
4205      *
4206      *   `U` : The service name labels (e.g., "_chip._udp", not the full domain name.
4207      *   `U` : The service instance name label (not the full name).
4208      *   `S` : The service port number.
4209      *   `S` : The service priority.
4210      *   `S` : The service weight.
4211      *
4212      * For `SPINEL_CMD_PROP_VALUE_REMOVE` command, the following format is used:
4213      *
4214      *   `U` : The service name labels (e.g., "_chip._udp", not the full domain name.
4215      *   `U` : The service instance name label (not the full name).
4216      *   `b` : Indicates whether to clear the service entry (optional).
4217      *
4218      * The last boolean (`b`) field is optional. When included it indicates on `true` to clear the service (clear it
4219      * on client immediately with no interaction to server) and on `false` to remove the service (inform server and
4220      * wait for the service entry to be removed on server). If it is not included, the value is `false`.
4221      *
4222      */
4223     SPINEL_PROP_SRP_CLIENT_SERVICES = SPINEL_PROP_OPENTHREAD__BEGIN + 23,
4224 
4225     /// SRP Client Host And Services Remove
4226     /** Format: `bb` : Write only
4227      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4228      *
4229      * Writing to this property with starts the remove process of the host info and all services.
4230      * Please see `otSrpClientRemoveHostAndServices()` for more details.
4231      *
4232      * Format is:
4233      *
4234      *    `b` : A boolean indicating whether or not the host key lease should also be cleared.
4235      *    `b` : A boolean indicating whether or not to send update to server when host info is not registered.
4236      *
4237      */
4238     SPINEL_PROP_SRP_CLIENT_HOST_SERVICES_REMOVE = SPINEL_PROP_OPENTHREAD__BEGIN + 24,
4239 
4240     /// SRP Client Host And Services Clear
4241     /** Format: Empty : Write only
4242      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4243      *
4244      * Writing to this property clears all host info and all the services.
4245      * Please see `otSrpClientClearHostAndServices()` for more details.
4246      *
4247      */
4248     SPINEL_PROP_SRP_CLIENT_HOST_SERVICES_CLEAR = SPINEL_PROP_OPENTHREAD__BEGIN + 25,
4249 
4250     /// SRP Client Event
4251     /** Format: t() : Asynchronous event only
4252      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4253      *
4254      * This property is asynchronously emitted when there is an event from SRP client notifying some state changes or
4255      * errors.
4256      *
4257      * The general format of this property is as follows:
4258      *
4259      *    `S` : Error code (see `spinel_srp_client_error_t` enumeration).
4260      *    `d` : Host info data.
4261      *    `d` : Active services.
4262      *    `d` : Removed services.
4263      *
4264      * The host info data contains:
4265      *
4266      *   `U`       : The host name.
4267      *   `C`       : The host state (values from `spinel_srp_client_item_state_t`).
4268      *   `t(A(6))` : Structure containing array of host IPv6 addresses.
4269      *
4270      * The active or removed services data is an array of services `A(t(UUSSSd))` with each service format:
4271      *
4272      *   `U` : The service name labels (e.g., "_chip._udp", not the full domain name.
4273      *   `U` : The service instance name label (not the full name).
4274      *   `S` : The service port number.
4275      *   `S` : The service priority.
4276      *   `S` : The service weight.
4277      *   `d` : The encoded TXT-DATA.
4278      *
4279      */
4280     SPINEL_PROP_SRP_CLIENT_EVENT = SPINEL_PROP_OPENTHREAD__BEGIN + 26,
4281 
4282     /// SRP Client Service Key Inclusion Enabled
4283     /** Format `b` : Read-Write
4284      * Required capability: `SPINEL_CAP_SRP_CLIENT` & `SPINEL_CAP_REFERENCE_DEVICE`.
4285      *
4286      * This boolean property indicates whether the "service key record inclusion" mode is enabled or not.
4287      *
4288      * When enabled, SRP client will include KEY record in Service Description Instructions in the SRP update messages
4289      * that it sends.
4290      *
4291      * KEY record is optional in Service Description Instruction (it is required and always included in the Host
4292      * Description Instruction). The default behavior of SRP client is to not include it. This function is intended to
4293      * override the default behavior for testing only.
4294      *
4295      */
4296     SPINEL_PROP_SRP_CLIENT_SERVICE_KEY_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 27,
4297 
4298     SPINEL_PROP_OPENTHREAD__END = 0x2000,
4299 
4300     SPINEL_PROP_SERVER__BEGIN = 0xA0,
4301 
4302     /// Server Allow Local Network Data Change
4303     /** Format `b` - Read-write
4304      *
4305      * Required capability: SPINEL_CAP_THREAD_SERVICE
4306      *
4307      * Set to true before changing local server net data. Set to false when finished.
4308      * This allows changes to be aggregated into a single event.
4309      *
4310      */
4311     SPINEL_PROP_SERVER_ALLOW_LOCAL_DATA_CHANGE = SPINEL_PROP_SERVER__BEGIN + 0,
4312 
4313     // Server Services
4314     /** Format: `A(t(LdbdS))`
4315      *
4316      * This property provides all services registered on the device
4317      *
4318      * Required capability: SPINEL_CAP_THREAD_SERVICE
4319      *
4320      * Array of structures containing:
4321      *
4322      *  `L`: Enterprise Number
4323      *  `d`: Service Data
4324      *  `b`: Stable
4325      *  `d`: Server Data
4326      *  `S`: RLOC
4327      *
4328      */
4329     SPINEL_PROP_SERVER_SERVICES = SPINEL_PROP_SERVER__BEGIN + 1,
4330 
4331     // Server Leader Services
4332     /** Format: `A(t(CLdbdS))`
4333      *
4334      * This property provides all services registered on the leader
4335      *
4336      * Array of structures containing:
4337      *
4338      *  `C`: Service ID
4339      *  `L`: Enterprise Number
4340      *  `d`: Service Data
4341      *  `b`: Stable
4342      *  `d`: Server Data
4343      *  `S`: RLOC
4344      *
4345      */
4346     SPINEL_PROP_SERVER_LEADER_SERVICES = SPINEL_PROP_SERVER__BEGIN + 2,
4347 
4348     SPINEL_PROP_SERVER__END = 0xB0,
4349 
4350     SPINEL_PROP_RCP__BEGIN = 0xB0,
4351 
4352     /// RCP API Version number
4353     /** Format: `i` (read-only)
4354      *
4355      * Required capability: SPINEL_CAP_RADIO and SPINEL_CAP_RCP_API_VERSION.
4356      *
4357      * This property gives the RCP API Version number.
4358      *
4359      * Please see "Spinel definition compatibility guideline" section.
4360      *
4361      */
4362     SPINEL_PROP_RCP_API_VERSION = SPINEL_PROP_RCP__BEGIN + 0,
4363 
4364     /// Min host RCP API Version number
4365     /** Format: `i` (read-only)
4366      *
4367      * Required capability: SPINEL_CAP_RADIO and SPINEL_CAP_RCP_MIN_HOST_API_VERSION.
4368      *
4369      * This property gives the minimum host RCP API Version number.
4370      *
4371      * Please see "Spinel definition compatibility guideline" section.
4372      *
4373      */
4374     SPINEL_PROP_RCP_MIN_HOST_API_VERSION = SPINEL_PROP_RCP__BEGIN + 1,
4375 
4376     SPINEL_PROP_RCP__END = 0xFF,
4377 
4378     SPINEL_PROP_INTERFACE__BEGIN = 0x100,
4379 
4380     /// UART Bitrate
4381     /** Format: `L`
4382      *
4383      *  If the NCP is using a UART to communicate with the host,
4384      *  this property allows the host to change the bitrate
4385      *  of the serial connection. The value encoding is `L`,
4386      *  which is a little-endian 32-bit unsigned integer.
4387      *  The host should not assume that all possible numeric values
4388      *  are supported.
4389      *
4390      *  If implemented by the NCP, this property should be persistent
4391      *  across software resets and forgotten upon hardware resets.
4392      *
4393      *  This property is only implemented when a UART is being
4394      *  used for Spinel. This property is optional.
4395      *
4396      *  When changing the bitrate, all frames will be received
4397      *  at the previous bitrate until the response frame to this command
4398      *  is received. Once a successful response frame is received by
4399      *  the host, all further frames will be transmitted at the new
4400      *  bitrate.
4401      */
4402     SPINEL_PROP_UART_BITRATE = SPINEL_PROP_INTERFACE__BEGIN + 0,
4403 
4404     /// UART Software Flow Control
4405     /** Format: `b`
4406      *
4407      *  If the NCP is using a UART to communicate with the host,
4408      *  this property allows the host to determine if software flow
4409      *  control (XON/XOFF style) should be used and (optionally) to
4410      *  turn it on or off.
4411      *
4412      *  This property is only implemented when a UART is being
4413      *  used for Spinel. This property is optional.
4414      */
4415     SPINEL_PROP_UART_XON_XOFF = SPINEL_PROP_INTERFACE__BEGIN + 1,
4416 
4417     SPINEL_PROP_INTERFACE__END = 0x200,
4418 
4419     SPINEL_PROP_15_4_PIB__BEGIN = 0x400,
4420     // For direct access to the 802.15.4 PID.
4421     // Individual registers are fetched using
4422     // `SPINEL_PROP_15_4_PIB__BEGIN+[PIB_IDENTIFIER]`
4423     // Only supported if SPINEL_CAP_15_4_PIB is set.
4424     //
4425     // For brevity, the entire 802.15.4 PIB space is
4426     // not defined here, but a few choice attributes
4427     // are defined for illustration and convenience.
4428     SPINEL_PROP_15_4_PIB_PHY_CHANNELS_SUPPORTED = SPINEL_PROP_15_4_PIB__BEGIN + 0x01, ///< [A(L)]
4429     SPINEL_PROP_15_4_PIB_MAC_PROMISCUOUS_MODE   = SPINEL_PROP_15_4_PIB__BEGIN + 0x51, ///< [b]
4430     SPINEL_PROP_15_4_PIB_MAC_SECURITY_ENABLED   = SPINEL_PROP_15_4_PIB__BEGIN + 0x5d, ///< [b]
4431     SPINEL_PROP_15_4_PIB__END                   = 0x500,
4432 
4433     SPINEL_PROP_CNTR__BEGIN = 0x500,
4434 
4435     /// Counter reset
4436     /** Format: Empty (Write only).
4437      *
4438      * Writing to this property (with any value) will reset all MAC, MLE, IP, and NCP counters to zero.
4439      *
4440      */
4441     SPINEL_PROP_CNTR_RESET = SPINEL_PROP_CNTR__BEGIN + 0,
4442 
4443     /// The total number of transmissions.
4444     /** Format: `L` (Read-only) */
4445     SPINEL_PROP_CNTR_TX_PKT_TOTAL = SPINEL_PROP_CNTR__BEGIN + 1,
4446 
4447     /// The number of transmissions with ack request.
4448     /** Format: `L` (Read-only) */
4449     SPINEL_PROP_CNTR_TX_PKT_ACK_REQ = SPINEL_PROP_CNTR__BEGIN + 2,
4450 
4451     /// The number of transmissions that were acked.
4452     /** Format: `L` (Read-only) */
4453     SPINEL_PROP_CNTR_TX_PKT_ACKED = SPINEL_PROP_CNTR__BEGIN + 3,
4454 
4455     /// The number of transmissions without ack request.
4456     /** Format: `L` (Read-only) */
4457     SPINEL_PROP_CNTR_TX_PKT_NO_ACK_REQ = SPINEL_PROP_CNTR__BEGIN + 4,
4458 
4459     /// The number of transmitted data.
4460     /** Format: `L` (Read-only) */
4461     SPINEL_PROP_CNTR_TX_PKT_DATA = SPINEL_PROP_CNTR__BEGIN + 5,
4462 
4463     /// The number of transmitted data poll.
4464     /** Format: `L` (Read-only) */
4465     SPINEL_PROP_CNTR_TX_PKT_DATA_POLL = SPINEL_PROP_CNTR__BEGIN + 6,
4466 
4467     /// The number of transmitted beacon.
4468     /** Format: `L` (Read-only) */
4469     SPINEL_PROP_CNTR_TX_PKT_BEACON = SPINEL_PROP_CNTR__BEGIN + 7,
4470 
4471     /// The number of transmitted beacon request.
4472     /** Format: `L` (Read-only) */
4473     SPINEL_PROP_CNTR_TX_PKT_BEACON_REQ = SPINEL_PROP_CNTR__BEGIN + 8,
4474 
4475     /// The number of transmitted other types of frames.
4476     /** Format: `L` (Read-only) */
4477     SPINEL_PROP_CNTR_TX_PKT_OTHER = SPINEL_PROP_CNTR__BEGIN + 9,
4478 
4479     /// The number of retransmission times.
4480     /** Format: `L` (Read-only) */
4481     SPINEL_PROP_CNTR_TX_PKT_RETRY = SPINEL_PROP_CNTR__BEGIN + 10,
4482 
4483     /// The number of CCA failure times.
4484     /** Format: `L` (Read-only) */
4485     SPINEL_PROP_CNTR_TX_ERR_CCA = SPINEL_PROP_CNTR__BEGIN + 11,
4486 
4487     /// The number of unicast packets transmitted.
4488     /** Format: `L` (Read-only) */
4489     SPINEL_PROP_CNTR_TX_PKT_UNICAST = SPINEL_PROP_CNTR__BEGIN + 12,
4490 
4491     /// The number of broadcast packets transmitted.
4492     /** Format: `L` (Read-only) */
4493     SPINEL_PROP_CNTR_TX_PKT_BROADCAST = SPINEL_PROP_CNTR__BEGIN + 13,
4494 
4495     /// The number of frame transmission failures due to abort error.
4496     /** Format: `L` (Read-only) */
4497     SPINEL_PROP_CNTR_TX_ERR_ABORT = SPINEL_PROP_CNTR__BEGIN + 14,
4498 
4499     /// The total number of received packets.
4500     /** Format: `L` (Read-only) */
4501     SPINEL_PROP_CNTR_RX_PKT_TOTAL = SPINEL_PROP_CNTR__BEGIN + 100,
4502 
4503     /// The number of received data.
4504     /** Format: `L` (Read-only) */
4505     SPINEL_PROP_CNTR_RX_PKT_DATA = SPINEL_PROP_CNTR__BEGIN + 101,
4506 
4507     /// The number of received data poll.
4508     /** Format: `L` (Read-only) */
4509     SPINEL_PROP_CNTR_RX_PKT_DATA_POLL = SPINEL_PROP_CNTR__BEGIN + 102,
4510 
4511     /// The number of received beacon.
4512     /** Format: `L` (Read-only) */
4513     SPINEL_PROP_CNTR_RX_PKT_BEACON = SPINEL_PROP_CNTR__BEGIN + 103,
4514 
4515     /// The number of received beacon request.
4516     /** Format: `L` (Read-only) */
4517     SPINEL_PROP_CNTR_RX_PKT_BEACON_REQ = SPINEL_PROP_CNTR__BEGIN + 104,
4518 
4519     /// The number of received other types of frames.
4520     /** Format: `L` (Read-only) */
4521     SPINEL_PROP_CNTR_RX_PKT_OTHER = SPINEL_PROP_CNTR__BEGIN + 105,
4522 
4523     /// The number of received packets filtered by allowlist.
4524     /** Format: `L` (Read-only) */
4525     SPINEL_PROP_CNTR_RX_PKT_FILT_WL = SPINEL_PROP_CNTR__BEGIN + 106,
4526 
4527     /// The number of received packets filtered by destination check.
4528     /** Format: `L` (Read-only) */
4529     SPINEL_PROP_CNTR_RX_PKT_FILT_DA = SPINEL_PROP_CNTR__BEGIN + 107,
4530 
4531     /// The number of received packets that are empty.
4532     /** Format: `L` (Read-only) */
4533     SPINEL_PROP_CNTR_RX_ERR_EMPTY = SPINEL_PROP_CNTR__BEGIN + 108,
4534 
4535     /// The number of received packets from an unknown neighbor.
4536     /** Format: `L` (Read-only) */
4537     SPINEL_PROP_CNTR_RX_ERR_UKWN_NBR = SPINEL_PROP_CNTR__BEGIN + 109,
4538 
4539     /// The number of received packets whose source address is invalid.
4540     /** Format: `L` (Read-only) */
4541     SPINEL_PROP_CNTR_RX_ERR_NVLD_SADDR = SPINEL_PROP_CNTR__BEGIN + 110,
4542 
4543     /// The number of received packets with a security error.
4544     /** Format: `L` (Read-only) */
4545     SPINEL_PROP_CNTR_RX_ERR_SECURITY = SPINEL_PROP_CNTR__BEGIN + 111,
4546 
4547     /// The number of received packets with a checksum error.
4548     /** Format: `L` (Read-only) */
4549     SPINEL_PROP_CNTR_RX_ERR_BAD_FCS = SPINEL_PROP_CNTR__BEGIN + 112,
4550 
4551     /// The number of received packets with other errors.
4552     /** Format: `L` (Read-only) */
4553     SPINEL_PROP_CNTR_RX_ERR_OTHER = SPINEL_PROP_CNTR__BEGIN + 113,
4554 
4555     /// The number of received duplicated.
4556     /** Format: `L` (Read-only) */
4557     SPINEL_PROP_CNTR_RX_PKT_DUP = SPINEL_PROP_CNTR__BEGIN + 114,
4558 
4559     /// The number of unicast packets received.
4560     /** Format: `L` (Read-only) */
4561     SPINEL_PROP_CNTR_RX_PKT_UNICAST = SPINEL_PROP_CNTR__BEGIN + 115,
4562 
4563     /// The number of broadcast packets received.
4564     /** Format: `L` (Read-only) */
4565     SPINEL_PROP_CNTR_RX_PKT_BROADCAST = SPINEL_PROP_CNTR__BEGIN + 116,
4566 
4567     /// The total number of secure transmitted IP messages.
4568     /** Format: `L` (Read-only) */
4569     SPINEL_PROP_CNTR_TX_IP_SEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 200,
4570 
4571     /// The total number of insecure transmitted IP messages.
4572     /** Format: `L` (Read-only) */
4573     SPINEL_PROP_CNTR_TX_IP_INSEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 201,
4574 
4575     /// The number of dropped (not transmitted) IP messages.
4576     /** Format: `L` (Read-only) */
4577     SPINEL_PROP_CNTR_TX_IP_DROPPED = SPINEL_PROP_CNTR__BEGIN + 202,
4578 
4579     /// The total number of secure received IP message.
4580     /** Format: `L` (Read-only) */
4581     SPINEL_PROP_CNTR_RX_IP_SEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 203,
4582 
4583     /// The total number of insecure received IP message.
4584     /** Format: `L` (Read-only) */
4585     SPINEL_PROP_CNTR_RX_IP_INSEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 204,
4586 
4587     /// The number of dropped received IP messages.
4588     /** Format: `L` (Read-only) */
4589     SPINEL_PROP_CNTR_RX_IP_DROPPED = SPINEL_PROP_CNTR__BEGIN + 205,
4590 
4591     /// The number of transmitted spinel frames.
4592     /** Format: `L` (Read-only) */
4593     SPINEL_PROP_CNTR_TX_SPINEL_TOTAL = SPINEL_PROP_CNTR__BEGIN + 300,
4594 
4595     /// The number of received spinel frames.
4596     /** Format: `L` (Read-only) */
4597     SPINEL_PROP_CNTR_RX_SPINEL_TOTAL = SPINEL_PROP_CNTR__BEGIN + 301,
4598 
4599     /// The number of received spinel frames with error.
4600     /** Format: `L` (Read-only) */
4601     SPINEL_PROP_CNTR_RX_SPINEL_ERR = SPINEL_PROP_CNTR__BEGIN + 302,
4602 
4603     /// Number of out of order received spinel frames (tid increase by more than 1).
4604     /** Format: `L` (Read-only) */
4605     SPINEL_PROP_CNTR_RX_SPINEL_OUT_OF_ORDER_TID = SPINEL_PROP_CNTR__BEGIN + 303,
4606 
4607     /// The number of successful Tx IP packets
4608     /** Format: `L` (Read-only) */
4609     SPINEL_PROP_CNTR_IP_TX_SUCCESS = SPINEL_PROP_CNTR__BEGIN + 304,
4610 
4611     /// The number of successful Rx IP packets
4612     /** Format: `L` (Read-only) */
4613     SPINEL_PROP_CNTR_IP_RX_SUCCESS = SPINEL_PROP_CNTR__BEGIN + 305,
4614 
4615     /// The number of failed Tx IP packets
4616     /** Format: `L` (Read-only) */
4617     SPINEL_PROP_CNTR_IP_TX_FAILURE = SPINEL_PROP_CNTR__BEGIN + 306,
4618 
4619     /// The number of failed Rx IP packets
4620     /** Format: `L` (Read-only) */
4621     SPINEL_PROP_CNTR_IP_RX_FAILURE = SPINEL_PROP_CNTR__BEGIN + 307,
4622 
4623     /// The message buffer counter info
4624     /** Format: `SSSSSSSSSSSSSSSS` (Read-only)
4625      *      `S`, (TotalBuffers)           The number of buffers in the pool.
4626      *      `S`, (FreeBuffers)            The number of free message buffers.
4627      *      `S`, (6loSendMessages)        The number of messages in the 6lo send queue.
4628      *      `S`, (6loSendBuffers)         The number of buffers in the 6lo send queue.
4629      *      `S`, (6loReassemblyMessages)  The number of messages in the 6LoWPAN reassembly queue.
4630      *      `S`, (6loReassemblyBuffers)   The number of buffers in the 6LoWPAN reassembly queue.
4631      *      `S`, (Ip6Messages)            The number of messages in the IPv6 send queue.
4632      *      `S`, (Ip6Buffers)             The number of buffers in the IPv6 send queue.
4633      *      `S`, (MplMessages)            The number of messages in the MPL send queue.
4634      *      `S`, (MplBuffers)             The number of buffers in the MPL send queue.
4635      *      `S`, (MleMessages)            The number of messages in the MLE send queue.
4636      *      `S`, (MleBuffers)             The number of buffers in the MLE send queue.
4637      *      `S`, (ArpMessages)            The number of messages in the ARP send queue.
4638      *      `S`, (ArpBuffers)             The number of buffers in the ARP send queue.
4639      *      `S`, (CoapMessages)           The number of messages in the CoAP send queue.
4640      *      `S`, (CoapBuffers)            The number of buffers in the CoAP send queue.
4641      */
4642     SPINEL_PROP_MSG_BUFFER_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 400,
4643 
4644     /// All MAC related counters.
4645     /** Format: t(A(L))t(A(L))
4646      *
4647      * The contents include two structs, first one corresponds to
4648      * all transmit related MAC counters, second one provides the
4649      * receive related counters.
4650      *
4651      * The transmit structure includes:
4652      *
4653      *   'L': TxTotal                  (The total number of transmissions).
4654      *   'L': TxUnicast                (The total number of unicast transmissions).
4655      *   'L': TxBroadcast              (The total number of broadcast transmissions).
4656      *   'L': TxAckRequested           (The number of transmissions with ack request).
4657      *   'L': TxAcked                  (The number of transmissions that were acked).
4658      *   'L': TxNoAckRequested         (The number of transmissions without ack request).
4659      *   'L': TxData                   (The number of transmitted data).
4660      *   'L': TxDataPoll               (The number of transmitted data poll).
4661      *   'L': TxBeacon                 (The number of transmitted beacon).
4662      *   'L': TxBeaconRequest          (The number of transmitted beacon request).
4663      *   'L': TxOther                  (The number of transmitted other types of frames).
4664      *   'L': TxRetry                  (The number of retransmission times).
4665      *   'L': TxErrCca                 (The number of CCA failure times).
4666      *   'L': TxErrAbort               (The number of frame transmission failures due to abort error).
4667      *   'L': TxErrBusyChannel         (The number of frames that were dropped due to a busy channel).
4668      *   'L': TxDirectMaxRetryExpiry   (The number of expired retransmission retries for direct message).
4669      *   'L': TxIndirectMaxRetryExpiry (The number of expired retransmission retries for indirect message).
4670      *
4671      * The receive structure includes:
4672      *
4673      *   'L': RxTotal                  (The total number of received packets).
4674      *   'L': RxUnicast                (The total number of unicast packets received).
4675      *   'L': RxBroadcast              (The total number of broadcast packets received).
4676      *   'L': RxData                   (The number of received data).
4677      *   'L': RxDataPoll               (The number of received data poll).
4678      *   'L': RxBeacon                 (The number of received beacon).
4679      *   'L': RxBeaconRequest          (The number of received beacon request).
4680      *   'L': RxOther                  (The number of received other types of frames).
4681      *   'L': RxAddressFiltered        (The number of received packets filtered by address filter
4682      *                                  (allowlist or denylist)).
4683      *   'L': RxDestAddrFiltered       (The number of received packets filtered by destination check).
4684      *   'L': RxDuplicated             (The number of received duplicated packets).
4685      *   'L': RxErrNoFrame             (The number of received packets with no or malformed content).
4686      *   'L': RxErrUnknownNeighbor     (The number of received packets from unknown neighbor).
4687      *   'L': RxErrInvalidSrcAddr      (The number of received packets whose source address is invalid).
4688      *   'L': RxErrSec                 (The number of received packets with security error).
4689      *   'L': RxErrFcs                 (The number of received packets with FCS error).
4690      *   'L': RxErrOther               (The number of received packets with other error).
4691      *
4692      * Writing to this property with any value would reset all MAC counters to zero.
4693      *
4694      */
4695     SPINEL_PROP_CNTR_ALL_MAC_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 401,
4696 
4697     /// Thread MLE counters.
4698     /** Format: `SSSSSSSSS`
4699      *
4700      *   'S': DisabledRole                  (The number of times device entered OT_DEVICE_ROLE_DISABLED role).
4701      *   'S': DetachedRole                  (The number of times device entered OT_DEVICE_ROLE_DETACHED role).
4702      *   'S': ChildRole                     (The number of times device entered OT_DEVICE_ROLE_CHILD role).
4703      *   'S': RouterRole                    (The number of times device entered OT_DEVICE_ROLE_ROUTER role).
4704      *   'S': LeaderRole                    (The number of times device entered OT_DEVICE_ROLE_LEADER role).
4705      *   'S': AttachAttempts                (The number of attach attempts while device was detached).
4706      *   'S': PartitionIdChanges            (The number of changes to partition ID).
4707      *   'S': BetterPartitionAttachAttempts (The number of attempts to attach to a better partition).
4708      *   'S': ParentChanges                 (The number of times device changed its parents).
4709      *
4710      * Writing to this property with any value would reset all MLE counters to zero.
4711      *
4712      */
4713     SPINEL_PROP_CNTR_MLE_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 402,
4714 
4715     /// Thread IPv6 counters.
4716     /** Format: `t(LL)t(LL)`
4717      *
4718      * The contents include two structs, first one corresponds to
4719      * all transmit related MAC counters, second one provides the
4720      * receive related counters.
4721      *
4722      * The transmit structure includes:
4723      *   'L': TxSuccess (The number of IPv6 packets successfully transmitted).
4724      *   'L': TxFailure (The number of IPv6 packets failed to transmit).
4725      *
4726      * The receive structure includes:
4727      *   'L': RxSuccess (The number of IPv6 packets successfully received).
4728      *   'L': RxFailure (The number of IPv6 packets failed to receive).
4729      *
4730      * Writing to this property with any value would reset all IPv6 counters to zero.
4731      *
4732      */
4733     SPINEL_PROP_CNTR_ALL_IP_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 403,
4734 
4735     /// MAC retry histogram.
4736     /** Format: t(A(L))t(A(L))
4737      *
4738      * Required capability: SPINEL_CAP_MAC_RETRY_HISTOGRAM
4739      *
4740      * The contents include two structs, first one is histogram which corresponds to retransmissions number of direct
4741      * messages, second one provides the histogram of retransmissions for indirect messages.
4742      *
4743      * The first structure includes:
4744      *   'L': DirectRetry[0]                   (The number of packets after 0 retry).
4745      *   'L': DirectRetry[1]                   (The number of packets after 1 retry).
4746      *    ...
4747      *   'L': DirectRetry[n]                   (The number of packets after n retry).
4748      *
4749      * The size of the array is OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_DIRECT.
4750      *
4751      * The second structure includes:
4752      *   'L': IndirectRetry[0]                   (The number of packets after 0 retry).
4753      *   'L': IndirectRetry[1]                   (The number of packets after 1 retry).
4754      *    ...
4755      *   'L': IndirectRetry[m]                   (The number of packets after m retry).
4756      *
4757      * The size of the array is OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_INDIRECT.
4758      *
4759      * Writing to this property with any value would reset MAC retry histogram.
4760      *
4761      */
4762     SPINEL_PROP_CNTR_MAC_RETRY_HISTOGRAM = SPINEL_PROP_CNTR__BEGIN + 404,
4763 
4764     SPINEL_PROP_CNTR__END = 0x800,
4765 
4766     SPINEL_PROP_RCP_EXT__BEGIN = 0x800,
4767 
4768     /// MAC Key
4769     /** Format: `CCddd`.
4770      *
4771      *  `C`: MAC key ID mode
4772      *  `C`: MAC key ID
4773      *  `d`: previous MAC key material data
4774      *  `d`: current MAC key material data
4775      *  `d`: next MAC key material data
4776      *
4777      * The Spinel property is used to set/get MAC key materials to and from RCP.
4778      *
4779      */
4780     SPINEL_PROP_RCP_MAC_KEY = SPINEL_PROP_RCP_EXT__BEGIN + 0,
4781 
4782     /// MAC Frame Counter
4783     /** Format: `L` for read and `Lb` or `L` for write
4784      *
4785      *  `L`: MAC frame counter
4786      *  'b': Optional boolean used only during write. If not provided, `false` is assumed.
4787      *       If `true` counter is set only if the new value is larger than current value.
4788      *       If `false` the new value is set as frame counter independent of the current value.
4789      *
4790      * The Spinel property is used to set MAC frame counter to RCP.
4791      *
4792      */
4793     SPINEL_PROP_RCP_MAC_FRAME_COUNTER = SPINEL_PROP_RCP_EXT__BEGIN + 1,
4794 
4795     /// Timestamps when Spinel frame is received and transmitted
4796     /** Format: `X`.
4797      *
4798      *  `X`: Spinel frame transmit timestamp
4799      *
4800      * The Spinel property is used to get timestamp from RCP to calculate host and RCP timer difference.
4801      *
4802      */
4803     SPINEL_PROP_RCP_TIMESTAMP = SPINEL_PROP_RCP_EXT__BEGIN + 2,
4804 
4805     /// Configure Enhanced ACK probing
4806     /** Format: `SEC` (Write-only).
4807      *
4808      * `S`: Short address
4809      * `E`: Extended address
4810      * `C`: List of requested metric ids encoded as bit fields in single byte
4811      *
4812      *   +---------------+----+
4813      *   |    Metric     | Id |
4814      *   +---------------+----+
4815      *   | Received PDUs |  0 |
4816      *   | LQI           |  1 |
4817      *   | Link margin   |  2 |
4818      *   | RSSI          |  3 |
4819      *   +---------------+----+
4820      *
4821      * Enable/disable or update Enhanced-ACK Based Probing in radio for a specific Initiator.
4822      *
4823      */
4824     SPINEL_PROP_RCP_ENH_ACK_PROBING = SPINEL_PROP_RCP_EXT__BEGIN + 3,
4825 
4826     /// CSL Accuracy
4827     /** Format: `C`
4828      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
4829      *
4830      * The current CSL rx/tx scheduling drift, in units of ± ppm.
4831      *
4832      */
4833     SPINEL_PROP_RCP_CSL_ACCURACY = SPINEL_PROP_RCP_EXT__BEGIN + 4,
4834 
4835     /// CSL Uncertainty
4836     /** Format: `C`
4837      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
4838      *
4839      * The current uncertainty, in units of 10 us, of the clock used for scheduling CSL operations.
4840      *
4841      */
4842     SPINEL_PROP_RCP_CSL_UNCERTAINTY = SPINEL_PROP_RCP_EXT__BEGIN + 5,
4843 
4844     SPINEL_PROP_RCP_EXT__END = 0x900,
4845 
4846     SPINEL_PROP_NEST__BEGIN = 0x3BC0,
4847 
4848     SPINEL_PROP_NEST_STREAM_MFG = SPINEL_PROP_NEST__BEGIN + 0,
4849 
4850     /// The legacy network ULA prefix (8 bytes).
4851     /** Format: 'D'
4852      *
4853      * This property is deprecated.
4854      *
4855      */
4856     SPINEL_PROP_NEST_LEGACY_ULA_PREFIX = SPINEL_PROP_NEST__BEGIN + 1,
4857 
4858     /// The EUI64 of last node joined using legacy protocol (if none, all zero EUI64 is returned).
4859     /** Format: 'E'
4860      *
4861      * This property is deprecated.
4862      *
4863      */
4864     SPINEL_PROP_NEST_LEGACY_LAST_NODE_JOINED = SPINEL_PROP_NEST__BEGIN + 2,
4865 
4866     SPINEL_PROP_NEST__END = 0x3C00,
4867 
4868     SPINEL_PROP_VENDOR__BEGIN = 0x3C00,
4869     SPINEL_PROP_VENDOR__END   = 0x4000,
4870 
4871     SPINEL_PROP_VENDOR_ESP__BEGIN = (SPINEL_PROP_VENDOR__BEGIN + 0),
4872     SPINEL_PROP_VENDOR_ESP__END   = (SPINEL_PROP_VENDOR__BEGIN + 128),
4873 
4874     SPINEL_PROP_DEBUG__BEGIN = 0x4000,
4875 
4876     /// Testing platform assert
4877     /** Format: 'b' (read-only)
4878      *
4879      * Reading this property will cause an assert on the NCP. This is intended for testing the assert functionality of
4880      * underlying platform/NCP. Assert should ideally cause the NCP to reset, but if this is not supported a `false`
4881      * boolean is returned in response.
4882      *
4883      */
4884     SPINEL_PROP_DEBUG_TEST_ASSERT = SPINEL_PROP_DEBUG__BEGIN + 0,
4885 
4886     /// The NCP log level.
4887     /** Format: `C` */
4888     SPINEL_PROP_DEBUG_NCP_LOG_LEVEL = SPINEL_PROP_DEBUG__BEGIN + 1,
4889 
4890     /// Testing platform watchdog
4891     /** Format: Empty  (read-only)
4892      *
4893      * Reading this property will causes NCP to start a `while(true) ;` loop and thus triggering a watchdog.
4894      *
4895      * This is intended for testing the watchdog functionality on the underlying platform/NCP.
4896      *
4897      */
4898     SPINEL_PROP_DEBUG_TEST_WATCHDOG = SPINEL_PROP_DEBUG__BEGIN + 2,
4899 
4900     /// The NCP timestamp base
4901     /** Format: X (write-only)
4902      *
4903      * This property controls the time base value that is used for logs timestamp field calculation.
4904      *
4905      */
4906     SPINEL_PROP_DEBUG_LOG_TIMESTAMP_BASE = SPINEL_PROP_DEBUG__BEGIN + 3,
4907 
4908     /// TREL Radio Link - test mode enable
4909     /** Format `b` (read-write)
4910      *
4911      * This property is intended for testing TREL (Thread Radio Encapsulation Link) radio type only (during simulation).
4912      * It allows the TREL interface to be temporarily disabled and (re)enabled.  While disabled all traffic through
4913      * TREL interface is dropped silently (to emulate a radio/interface down scenario).
4914      *
4915      * This property is only available when the TREL radio link type is supported.
4916      *
4917      */
4918     SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE = SPINEL_PROP_DEBUG__BEGIN + 4,
4919 
4920     SPINEL_PROP_DEBUG__END = 0x4400,
4921 
4922     SPINEL_PROP_EXPERIMENTAL__BEGIN = 2000000,
4923     SPINEL_PROP_EXPERIMENTAL__END   = 2097152,
4924 };
4925 
4926 typedef uint32_t spinel_prop_key_t;
4927 
4928 // ----------------------------------------------------------------------------
4929 
4930 #define SPINEL_HEADER_FLAG 0x80
4931 #define SPINEL_HEADER_FLAGS_SHIFT 6
4932 #define SPINEL_HEADER_FLAGS_MASK (3 << SPINEL_HEADER_FLAGS_SHIFT)
4933 #define SPINEL_HEADER_GET_FLAG(x) (((x)&SPINEL_HEADER_FLAGS_MASK) >> SPINEL_HEADER_FLAGS_SHIFT)
4934 
4935 #define SPINEL_HEADER_TID_SHIFT 0
4936 #define SPINEL_HEADER_TID_MASK (15 << SPINEL_HEADER_TID_SHIFT)
4937 
4938 #define SPINEL_HEADER_IID_SHIFT 4
4939 #define SPINEL_HEADER_IID_MASK (3 << SPINEL_HEADER_IID_SHIFT)
4940 
4941 #define SPINEL_HEADER_IID_0 (0 << SPINEL_HEADER_IID_SHIFT)
4942 #define SPINEL_HEADER_IID_1 (1 << SPINEL_HEADER_IID_SHIFT)
4943 #define SPINEL_HEADER_IID_2 (2 << SPINEL_HEADER_IID_SHIFT)
4944 #define SPINEL_HEADER_IID_3 (3 << SPINEL_HEADER_IID_SHIFT)
4945 
4946 #define SPINEL_HEADER_GET_IID(x) (((x)&SPINEL_HEADER_IID_MASK) >> SPINEL_HEADER_IID_SHIFT)
4947 #define SPINEL_HEADER_GET_TID(x) (spinel_tid_t)(((x)&SPINEL_HEADER_TID_MASK) >> SPINEL_HEADER_TID_SHIFT)
4948 
4949 #define SPINEL_GET_NEXT_TID(x) (spinel_tid_t)((x) >= 0xF ? 1 : (x) + 1)
4950 
4951 #define SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT 4
4952 
4953 #define SPINEL_BEACON_THREAD_FLAG_VERSION_MASK (0xf << SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT)
4954 
4955 #define SPINEL_BEACON_THREAD_FLAG_JOINABLE (1 << 0)
4956 
4957 #define SPINEL_BEACON_THREAD_FLAG_NATIVE (1 << 3)
4958 
4959 // ----------------------------------------------------------------------------
4960 
4961 enum
4962 {
4963     SPINEL_DATATYPE_NULL_C        = 0,
4964     SPINEL_DATATYPE_VOID_C        = '.',
4965     SPINEL_DATATYPE_BOOL_C        = 'b',
4966     SPINEL_DATATYPE_UINT8_C       = 'C',
4967     SPINEL_DATATYPE_INT8_C        = 'c',
4968     SPINEL_DATATYPE_UINT16_C      = 'S',
4969     SPINEL_DATATYPE_INT16_C       = 's',
4970     SPINEL_DATATYPE_UINT32_C      = 'L',
4971     SPINEL_DATATYPE_INT32_C       = 'l',
4972     SPINEL_DATATYPE_UINT64_C      = 'X',
4973     SPINEL_DATATYPE_INT64_C       = 'x',
4974     SPINEL_DATATYPE_UINT_PACKED_C = 'i',
4975     SPINEL_DATATYPE_IPv6ADDR_C    = '6',
4976     SPINEL_DATATYPE_EUI64_C       = 'E',
4977     SPINEL_DATATYPE_EUI48_C       = 'e',
4978     SPINEL_DATATYPE_DATA_WLEN_C   = 'd',
4979     SPINEL_DATATYPE_DATA_C        = 'D',
4980     SPINEL_DATATYPE_UTF8_C        = 'U', //!< Zero-Terminated UTF8-Encoded String
4981     SPINEL_DATATYPE_STRUCT_C      = 't',
4982     SPINEL_DATATYPE_ARRAY_C       = 'A',
4983 };
4984 
4985 typedef char spinel_datatype_t;
4986 
4987 #define SPINEL_DATATYPE_NULL_S ""
4988 #define SPINEL_DATATYPE_VOID_S "."
4989 #define SPINEL_DATATYPE_BOOL_S "b"
4990 #define SPINEL_DATATYPE_UINT8_S "C"
4991 #define SPINEL_DATATYPE_INT8_S "c"
4992 #define SPINEL_DATATYPE_UINT16_S "S"
4993 #define SPINEL_DATATYPE_INT16_S "s"
4994 #define SPINEL_DATATYPE_UINT32_S "L"
4995 #define SPINEL_DATATYPE_INT32_S "l"
4996 #define SPINEL_DATATYPE_UINT64_S "X"
4997 #define SPINEL_DATATYPE_INT64_S "x"
4998 #define SPINEL_DATATYPE_UINT_PACKED_S "i"
4999 #define SPINEL_DATATYPE_IPv6ADDR_S "6"
5000 #define SPINEL_DATATYPE_EUI64_S "E"
5001 #define SPINEL_DATATYPE_EUI48_S "e"
5002 #define SPINEL_DATATYPE_DATA_WLEN_S "d"
5003 #define SPINEL_DATATYPE_DATA_S "D"
5004 #define SPINEL_DATATYPE_UTF8_S "U" //!< Zero-Terminated UTF8-Encoded String
5005 
5006 #define SPINEL_DATATYPE_ARRAY_S(x) "A(" x ")"
5007 #define SPINEL_DATATYPE_STRUCT_S(x) "t(" x ")"
5008 
5009 #define SPINEL_DATATYPE_ARRAY_STRUCT_S(x) SPINEL_DATATYPE_ARRAY_S(SPINEL_DATATYPE_STRUCT_WLEN_S(x))
5010 
5011 #define SPINEL_DATATYPE_COMMAND_S                   \
5012     SPINEL_DATATYPE_UINT8_S           /* header  */ \
5013         SPINEL_DATATYPE_UINT_PACKED_S /* command */
5014 
5015 #define SPINEL_DATATYPE_COMMAND_PROP_S                    \
5016     SPINEL_DATATYPE_COMMAND_S         /* prop command  */ \
5017         SPINEL_DATATYPE_UINT_PACKED_S /* property id */
5018 
5019 #define SPINEL_MAX_UINT_PACKED 2097151
5020 
5021 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_pack(uint8_t      *data_out,
5022                                                       spinel_size_t data_len_max,
5023                                                       const char   *pack_format,
5024                                                       ...);
5025 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vpack(uint8_t      *data_out,
5026                                                        spinel_size_t data_len_max,
5027                                                        const char   *pack_format,
5028                                                        va_list       args);
5029 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack(const uint8_t *data_in,
5030                                                         spinel_size_t  data_len,
5031                                                         const char    *pack_format,
5032                                                         ...);
5033 /**
5034  * This function parses spinel data similar to sscanf().
5035  *
5036  * This function actually calls spinel_datatype_vunpack_in_place() to parse data.
5037  *
5038  * @param[in]   data_in     A pointer to the data to parse.
5039  * @param[in]   data_len    The length of @p data_in in bytes.
5040  * @param[in]   pack_format C string that contains a format string follows the same specification of spinel.
5041  * @param[in]   ...         Additional arguments depending on the format string @p pack_format.
5042  *
5043  * @returns The parsed length in bytes.
5044  *
5045  * @note This function behaves different from `spinel_datatype_unpack()`:
5046  *       - This function expects composite data arguments of pointer to data type, while `spinel_datatype_unpack()`
5047  *         expects them of pointer to data type pointer. For example, if `SPINEL_DATATYPE_EUI64_C` is present in
5048  *         @p pack_format, this function expects a `spinel_eui64_t *` is included in variable arguments, while
5049  *         `spinel_datatype_unpack()` expects a `spinel_eui64_t **` is included.
5050  *       - For `SPINEL_DATATYPE_UTF8_C`, this function expects two arguments, the first of type `char *` and the
5051  *         second is of type `size_t` to indicate length of the provided buffer in the first argument just like
5052  *         `strncpy()`, while `spinel_datatype_unpack()` only expects a `const char **`.
5053  *
5054  * @sa spinel_datatype_vunpack_in_place()
5055  *
5056  */
5057 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack_in_place(const uint8_t *data_in,
5058                                                                  spinel_size_t  data_len,
5059                                                                  const char    *pack_format,
5060                                                                  ...);
5061 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack(const uint8_t *data_in,
5062                                                          spinel_size_t  data_len,
5063                                                          const char    *pack_format,
5064                                                          va_list        args);
5065 /**
5066  * This function parses spinel data similar to vsscanf().
5067  *
5068  * @param[in]   data_in     A pointer to the data to parse.
5069  * @param[in]   data_len    The length of @p data_in in bytes.
5070  * @param[in]   pack_format C string that contains a format string follows the same specification of spinel.
5071  * @param[in]   args        A value identifying a variable arguments list.
5072  *
5073  * @returns The parsed length in bytes.
5074  *
5075  * @note This function behaves different from `spinel_datatype_vunpack()`:
5076  *       - This function expects composite data arguments of pointer to data type, while `spinel_datatype_vunpack()`
5077  *         expects them of pointer to data type pointer. For example, if `SPINEL_DATATYPE_EUI64_C` is present in
5078  *         @p pack_format, this function expects a `spinel_eui64_t *` is included in variable arguments, while
5079  *         `spinel_datatype_vunpack()` expects a `spinel_eui64_t **` is included.
5080  *       - For `SPINEL_DATATYPE_UTF8_C`, this function expects two arguments, the first of type `char *` and the
5081  *         second is of type `size_t` to indicate length of the provided buffer in the first argument just like
5082  *         `strncpy()`, while `spinel_datatype_vunpack()` only expects a `const char **`.
5083  *
5084  * @sa spinel_datatype_unpack_in_place()
5085  *
5086  */
5087 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack_in_place(const uint8_t *data_in,
5088                                                                   spinel_size_t  data_len,
5089                                                                   const char    *pack_format,
5090                                                                   va_list        args);
5091 
5092 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_decode(const uint8_t *bytes,
5093                                                            spinel_size_t  len,
5094                                                            unsigned int  *value_ptr);
5095 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_encode(uint8_t *bytes, spinel_size_t len, unsigned int value);
5096 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_size(unsigned int value);
5097 
5098 SPINEL_API_EXTERN const char *spinel_next_packed_datatype(const char *pack_format);
5099 
5100 // ----------------------------------------------------------------------------
5101 
5102 SPINEL_API_EXTERN const char *spinel_command_to_cstr(spinel_command_t command);
5103 
5104 SPINEL_API_EXTERN const char *spinel_prop_key_to_cstr(spinel_prop_key_t prop_key);
5105 
5106 SPINEL_API_EXTERN const char *spinel_net_role_to_cstr(uint8_t net_role);
5107 
5108 SPINEL_API_EXTERN const char *spinel_mcu_power_state_to_cstr(uint8_t mcu_power_state);
5109 
5110 SPINEL_API_EXTERN const char *spinel_status_to_cstr(spinel_status_t status);
5111 
5112 SPINEL_API_EXTERN const char *spinel_capability_to_cstr(spinel_capability_t capability);
5113 
5114 SPINEL_API_EXTERN const char *spinel_radio_link_to_cstr(uint32_t radio);
5115 
5116 SPINEL_API_EXTERN const char *spinel_link_metrics_status_to_cstr(uint8_t status);
5117 
5118 // ----------------------------------------------------------------------------
5119 
5120 #if defined(__cplusplus)
5121 }
5122 #endif
5123 
5124 #endif /* defined(SPINEL_HEADER_INCLUDED) */
5125