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: `L`
3059      * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER`
3060      *
3061      * The CSL period in microseconds. Value of 0 indicates that CSL should be disabled.
3062      *
3063      * The CSL period MUST be a multiple of 160 (which is 802.15 "ten symbols time").
3064      *
3065      */
3066     SPINEL_PROP_THREAD_CSL_PERIOD = SPINEL_PROP_THREAD_EXT__BEGIN + 41,
3067 
3068     /// MAC CSL Timeout
3069     /** Format: `L`
3070      * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER`
3071      *
3072      * The CSL timeout in seconds.
3073      */
3074     SPINEL_PROP_THREAD_CSL_TIMEOUT = SPINEL_PROP_THREAD_EXT__BEGIN + 42,
3075 
3076     /// MAC CSL Channel
3077     /** Format: `C`
3078      * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER`
3079      *
3080      * The CSL channel as described in chapter 4.6.5.1.2 of the Thread v1.2.0 Specification.
3081      * Value of 0 means that CSL reception (if enabled) occurs on the Thread Network channel.
3082      * Value from range [11,26] is an alternative channel on which a CSL reception occurs.
3083      */
3084     SPINEL_PROP_THREAD_CSL_CHANNEL = SPINEL_PROP_THREAD_EXT__BEGIN + 43,
3085 
3086     /// Thread Domain Name
3087     /** Format `U` - Read-write
3088      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3089      *
3090      * This property is available since Thread 1.2.0.
3091      * Write to this property succeeds only when Thread protocols are disabled.
3092      *
3093      */
3094     SPINEL_PROP_THREAD_DOMAIN_NAME = SPINEL_PROP_THREAD_EXT__BEGIN + 44,
3095 
3096     /// Link metrics query
3097     /** Format: `6CC` - Write-Only
3098      *
3099      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3100      *
3101      * `6` : IPv6 destination address
3102      * `C` : Series id (0 for Single Probe)
3103      * `C` : List of requested metric ids encoded as bit fields in single byte
3104      *
3105      *   +---------------+----+
3106      *   |    Metric     | Id |
3107      *   +---------------+----+
3108      *   | Received PDUs |  0 |
3109      *   | LQI           |  1 |
3110      *   | Link margin   |  2 |
3111      *   | RSSI          |  3 |
3112      *   +---------------+----+
3113      *
3114      * If the query succeeds, the NCP will send a result to the Host using
3115      * @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT.
3116      *
3117      */
3118     SPINEL_PROP_THREAD_LINK_METRICS_QUERY = SPINEL_PROP_THREAD_EXT__BEGIN + 45,
3119 
3120     /// Link metrics query result
3121     /** Format: `6Ct(A(t(CD)))` - Unsolicited notifications only
3122      *
3123      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3124      *
3125      * `6` : IPv6 destination address
3126      * `C` : Status
3127      * `t(A(t(CD)))` : Array of structs encoded as following:
3128      *   `C` : Metric id
3129      *   `D` : Metric value
3130      *
3131      *   +---------------+----+----------------+
3132      *   |    Metric     | Id |  Value format  |
3133      *   +---------------+----+----------------+
3134      *   | Received PDUs |  0 | `L` (uint32_t) |
3135      *   | LQI           |  1 | `C` (uint8_t)  |
3136      *   | Link margin   |  2 | `C` (uint8_t)  |
3137      *   | RSSI          |  3 | `c` (int8_t)   |
3138      *   +---------------+----+----------------+
3139      *
3140      */
3141     SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT = SPINEL_PROP_THREAD_EXT__BEGIN + 46,
3142 
3143     /// Link metrics probe
3144     /** Format `6CC` - Write only
3145      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3146      *
3147      * Send a MLE Link Probe message to the peer.
3148      *
3149      * `6` : IPv6 destination address
3150      * `C` : The Series ID for which this Probe message targets at
3151      * `C` : The length of the Probe message, valid range: [0, 64]
3152      *
3153      */
3154     SPINEL_PROP_THREAD_LINK_METRICS_PROBE = SPINEL_PROP_THREAD_EXT__BEGIN + 47,
3155 
3156     /// Link metrics Enhanced-ACK Based Probing management
3157     /** Format: 6Cd - Write only
3158      *
3159      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3160      *
3161      * `6` : IPv6 destination address
3162      * `C` : Indicate whether to register or clear the probing. `0` - clear, `1` - register
3163      * `C` : List of requested metric ids encoded as bit fields in single byte
3164      *
3165      *   +---------------+----+
3166      *   |    Metric     | Id |
3167      *   +---------------+----+
3168      *   | LQI           |  1 |
3169      *   | Link margin   |  2 |
3170      *   | RSSI          |  3 |
3171      *   +---------------+----+
3172      *
3173      * Result of configuration is reported asynchronously to the Host using the
3174      * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE.
3175      *
3176      * Whenever Enh-ACK IE report is received it is passed to the Host using the
3177      * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK_IE property.
3178      *
3179      */
3180     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK = SPINEL_PROP_THREAD_EXT__BEGIN + 48,
3181 
3182     /// Link metrics Enhanced-ACK Based Probing IE report
3183     /** Format: SEA(t(CD)) - Unsolicited notifications only
3184      *
3185      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3186      *
3187      * `S` : Short address of the Probing Subject
3188      * `E` : Extended address of the Probing Subject
3189      * `t(A(t(CD)))` : Struct that contains array of structs encoded as following:
3190      *   `C` : Metric id
3191      *   `D` : Metric value
3192      *
3193      *   +---------------+----+----------------+
3194      *   |    Metric     | Id |  Value format  |
3195      *   +---------------+----+----------------+
3196      *   | LQI           |  1 | `C` (uint8_t)  |
3197      *   | Link margin   |  2 | `C` (uint8_t)  |
3198      *   | RSSI          |  3 | `c` (int8_t)   |
3199      *   +---------------+----+----------------+
3200      *
3201      */
3202     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK_IE = SPINEL_PROP_THREAD_EXT__BEGIN + 49,
3203 
3204     /// Link metrics Forward Tracking Series management
3205     /** Format: 6CCC - Write only
3206      *
3207      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3208      *
3209      * `6` : IPv6 destination address
3210      * `C` : Series id
3211      * `C` : Tracked frame types encoded as bit fields in single byte, if equal to zero,
3212      *       accounting is stopped and a series is removed
3213      * `C` : Requested metric ids encoded as bit fields in single byte
3214      *
3215      *   +------------------+----+
3216      *   |    Frame type    | Id |
3217      *   +------------------+----+
3218      *   | MLE Link Probe   |  0 |
3219      *   | MAC Data         |  1 |
3220      *   | MAC Data Request |  2 |
3221      *   | MAC ACK          |  3 |
3222      *   +------------------+----+
3223      *
3224      *   +---------------+----+
3225      *   |    Metric     | Id |
3226      *   +---------------+----+
3227      *   | Received PDUs |  0 |
3228      *   | LQI           |  1 |
3229      *   | Link margin   |  2 |
3230      *   | RSSI          |  3 |
3231      *   +---------------+----+
3232      *
3233      * Result of configuration is reported asynchronously to the Host using the
3234      * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE.
3235      *
3236      */
3237     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD = SPINEL_PROP_THREAD_EXT__BEGIN + 50,
3238 
3239     /// Link metrics management response
3240     /** Format: 6C - Unsolicited notifications only
3241      *
3242      * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`
3243      *
3244      * `6` : IPv6 source address
3245      * `C` : Received status
3246      *
3247      */
3248     SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE = SPINEL_PROP_THREAD_EXT__BEGIN + 51,
3249 
3250     /// Multicast Listeners Register Request
3251     /** Format `t(A(6))A(t(CD))` - Write-only
3252      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3253      *
3254      * `t(A(6))`: Array of IPv6 multicast addresses
3255      * `A(t(CD))`: Array of structs holding optional parameters as follows
3256      *   `C`: Parameter id
3257      *   `D`: Parameter value
3258      *
3259      *   +----------------------------------------------------------------+
3260      *   | Id:   SPINEL_THREAD_MLR_PARAMID_TIMEOUT                        |
3261      *   | Type: `L`                                                      |
3262      *   | Description: Timeout in seconds. If this optional parameter is |
3263      *   |   omitted, the default value of the BBR will be used.          |
3264      *   | Special values:                                                |
3265      *   |   0 causes given addresses to be removed                       |
3266      *   |   0xFFFFFFFF is permanent and persistent registration          |
3267      *   +----------------------------------------------------------------+
3268      *
3269      * Write to this property initiates update of Multicast Listeners Table on the primary BBR.
3270      * If the write succeeded, the result of network operation will be notified later by the
3271      * SPINEL_PROP_THREAD_MLR_RESPONSE property. If the write fails, no MLR.req is issued and
3272      * notification through the SPINEL_PROP_THREAD_MLR_RESPONSE property will not occur.
3273      *
3274      */
3275     SPINEL_PROP_THREAD_MLR_REQUEST = SPINEL_PROP_THREAD_EXT__BEGIN + 52,
3276 
3277     /// Multicast Listeners Register Response
3278     /** Format `CCt(A(6))` - Unsolicited notifications only
3279      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3280      *
3281      * `C`: Status
3282      * `C`: MlrStatus (The Multicast Listener Registration Status)
3283      * `A(6)`: Array of IPv6 addresses that failed to be updated on the primary BBR
3284      *
3285      * This property is notified asynchronously when the NCP receives MLR.rsp following
3286      * previous write to the SPINEL_PROP_THREAD_MLR_REQUEST property.
3287      */
3288     SPINEL_PROP_THREAD_MLR_RESPONSE = SPINEL_PROP_THREAD_EXT__BEGIN + 53,
3289 
3290     /// Interface Identifier specified for Thread Domain Unicast Address.
3291     /** Format: `A(C)` - Read-write
3292      *
3293      *   `A(C)`: Interface Identifier (8 bytes).
3294      *
3295      * Required capability: SPINEL_CAP_DUA
3296      *
3297      * If write to this property is performed without specified parameter
3298      * the Interface Identifier of the Thread Domain Unicast Address will be cleared.
3299      * If the DUA Interface Identifier is cleared on the NCP device,
3300      * the get spinel property command will be returned successfully without specified parameter.
3301      *
3302      */
3303     SPINEL_PROP_THREAD_DUA_ID = SPINEL_PROP_THREAD_EXT__BEGIN + 54,
3304 
3305     /// Thread 1.2 Primary Backbone Router information in the Thread Network.
3306     /** Format: `SSLC` - Read-Only
3307      *
3308      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
3309      *
3310      * `S`: Server.
3311      * `S`: Reregistration Delay (in seconds).
3312      * `L`: Multicast Listener Registration Timeout (in seconds).
3313      * `C`: Sequence Number.
3314      *
3315      */
3316     SPINEL_PROP_THREAD_BACKBONE_ROUTER_PRIMARY = SPINEL_PROP_THREAD_EXT__BEGIN + 55,
3317 
3318     /// Thread 1.2 Backbone Router local state.
3319     /** Format: `C` - Read-Write
3320      *
3321      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3322      *
3323      * The valid values are specified by SPINEL_THREAD_BACKBONE_ROUTER_STATE_<state> enumeration.
3324      * Backbone functionality will be disabled if SPINEL_THREAD_BACKBONE_ROUTER_STATE_DISABLED
3325      * is written to this property, enabled otherwise.
3326      *
3327      */
3328     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_STATE = SPINEL_PROP_THREAD_EXT__BEGIN + 56,
3329 
3330     /// Local Thread 1.2 Backbone Router configuration.
3331     /** Format: SLC - Read-Write
3332      *
3333      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3334      *
3335      * `S`: Reregistration Delay (in seconds).
3336      * `L`: Multicast Listener Registration Timeout (in seconds).
3337      * `C`: Sequence Number.
3338      *
3339      */
3340     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_CONFIG = SPINEL_PROP_THREAD_EXT__BEGIN + 57,
3341 
3342     /// Register local Thread 1.2 Backbone Router configuration.
3343     /** Format: Empty (Write only).
3344      *
3345      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3346      *
3347      * Writing to this property (with any value) will register local Backbone Router configuration.
3348      *
3349      */
3350     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTER = SPINEL_PROP_THREAD_EXT__BEGIN + 58,
3351 
3352     /// Thread 1.2 Backbone Router registration jitter.
3353     /** Format: `C` - Read-Write
3354      *
3355      * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER`
3356      *
3357      * `C`: Backbone Router registration jitter.
3358      *
3359      */
3360     SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTRATION_JITTER = SPINEL_PROP_THREAD_EXT__BEGIN + 59,
3361 
3362     SPINEL_PROP_THREAD_EXT__END = 0x1600,
3363 
3364     SPINEL_PROP_IPV6__BEGIN = 0x60,
3365 
3366     /// Link-Local IPv6 Address
3367     /** Format: `6` - Read only
3368      *
3369      */
3370     SPINEL_PROP_IPV6_LL_ADDR = SPINEL_PROP_IPV6__BEGIN + 0, ///< [6]
3371 
3372     /// Mesh Local IPv6 Address
3373     /** Format: `6` - Read only
3374      *
3375      */
3376     SPINEL_PROP_IPV6_ML_ADDR = SPINEL_PROP_IPV6__BEGIN + 1,
3377 
3378     /// Mesh Local Prefix
3379     /** Format: `6C` - Read-write
3380      *
3381      * Provides Mesh Local Prefix
3382      *
3383      *   `6`: Mesh local prefix
3384      *   `C` : Prefix length (64 bit for Thread).
3385      *
3386      */
3387     SPINEL_PROP_IPV6_ML_PREFIX = SPINEL_PROP_IPV6__BEGIN + 2,
3388 
3389     /// IPv6 (Unicast) Address Table
3390     /** Format: `A(t(6CLLC))`
3391      *
3392      * This property provides all unicast addresses.
3393      *
3394      * Array of structures containing:
3395      *
3396      *  `6`: IPv6 Address
3397      *  `C`: Network Prefix Length (in bits)
3398      *  `L`: Valid Lifetime
3399      *  `L`: Preferred Lifetime
3400      *
3401      */
3402     SPINEL_PROP_IPV6_ADDRESS_TABLE = SPINEL_PROP_IPV6__BEGIN + 3,
3403 
3404     /// IPv6 Route Table - Deprecated
3405     SPINEL_PROP_IPV6_ROUTE_TABLE = SPINEL_PROP_IPV6__BEGIN + 4,
3406 
3407     /// IPv6 ICMP Ping Offload
3408     /** Format: `b`
3409      *
3410      * Allow the NCP to directly respond to ICMP ping requests. If this is
3411      * turned on, ping request ICMP packets will not be passed to the host.
3412      *
3413      * Default value is `false`.
3414      */
3415     SPINEL_PROP_IPV6_ICMP_PING_OFFLOAD = SPINEL_PROP_IPV6__BEGIN + 5,
3416 
3417     /// IPv6 Multicast Address Table
3418     /** Format: `A(t(6))`
3419      *
3420      * This property provides all multicast addresses.
3421      *
3422      */
3423     SPINEL_PROP_IPV6_MULTICAST_ADDRESS_TABLE = SPINEL_PROP_IPV6__BEGIN + 6,
3424 
3425     /// IPv6 ICMP Ping Offload
3426     /** Format: `C`
3427      *
3428      * Allow the NCP to directly respond to ICMP ping requests. If this is
3429      * turned on, ping request ICMP packets will not be passed to the host.
3430      *
3431      * This property allows enabling responses sent to unicast only, multicast
3432      * only, or both. The valid value are defined by enumeration
3433      * `spinel_ipv6_icmp_ping_offload_mode_t`.
3434      *
3435      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_DISABLED       = 0
3436      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_UNICAST_ONLY   = 1
3437      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_MULTICAST_ONLY = 2
3438      *   SPINEL_IPV6_ICMP_PING_OFFLOAD_ALL            = 3
3439      *
3440      * Default value is `NET_IPV6_ICMP_PING_OFFLOAD_DISABLED`.
3441      *
3442      */
3443     SPINEL_PROP_IPV6_ICMP_PING_OFFLOAD_MODE = SPINEL_PROP_IPV6__BEGIN + 7, ///< [b]
3444 
3445     SPINEL_PROP_IPV6__END = 0x70,
3446 
3447     SPINEL_PROP_IPV6_EXT__BEGIN = 0x1600,
3448     SPINEL_PROP_IPV6_EXT__END   = 0x1700,
3449 
3450     SPINEL_PROP_STREAM__BEGIN = 0x70,
3451 
3452     /// Debug Stream
3453     /** Format: `U` (stream, read only)
3454      *
3455      * This property is a streaming property, meaning that you cannot explicitly
3456      * fetch the value of this property. The stream provides human-readable debugging
3457      * output which may be displayed in the host logs.
3458      *
3459      * The location of newline characters is not assumed by the host: it is
3460      * the NCP's responsibility to insert newline characters where needed,
3461      * just like with any other text stream.
3462      *
3463      * To receive the debugging stream, you wait for `CMD_PROP_VALUE_IS`
3464      * commands for this property from the NCP.
3465      *
3466      */
3467     SPINEL_PROP_STREAM_DEBUG = SPINEL_PROP_STREAM__BEGIN + 0,
3468 
3469     /// Raw Stream
3470     /** Format: `dD` (stream, read only)
3471      *  Required Capability: SPINEL_CAP_MAC_RAW or SPINEL_CAP_CONFIG_RADIO
3472      *
3473      * This stream provides the capability of sending and receiving raw 15.4 frames
3474      * to and from the radio. The exact format of the frame metadata and data is
3475      * dependent on the MAC and PHY being used.
3476      *
3477      * This property is a streaming property, meaning that you cannot explicitly
3478      * fetch the value of this property. To receive traffic, you wait for
3479      * `CMD_PROP_VALUE_IS` commands with this property id from the NCP.
3480      *
3481      * The general format of this property is:
3482      *
3483      *    `d` : frame data
3484      *    `D` : frame meta data
3485      *
3486      * The frame meta data is optional. Frame metadata MAY be empty or partially
3487      * specified. Partially specified metadata MUST be accepted. Default values
3488      * are used for all unspecified fields.
3489      *
3490      * The frame metadata field consists of the following fields:
3491      *
3492      *   `c` : Received Signal Strength (RSSI) in dBm - default is -128
3493      *   `c` : Noise floor in dBm - default is -128
3494      *   `S` : Flags (see below).
3495      *   `d` : PHY-specific data/struct
3496      *   `d` : Vendor-specific data/struct
3497      *
3498      * Flags fields are defined by the following enumeration bitfields:
3499      *
3500      *   SPINEL_MD_FLAG_TX       = 0x0001 :  Packet was transmitted, not received.
3501      *   SPINEL_MD_FLAG_BAD_FCS  = 0x0004 :  Packet was received with bad FCS
3502      *   SPINEL_MD_FLAG_DUPE     = 0x0008 :  Packet seems to be a duplicate
3503      *   SPINEL_MD_FLAG_RESERVED = 0xFFF2 :  Flags reserved for future use.
3504      *
3505      * The format of PHY-specific data for a Thread device contains the following
3506      * optional fields:
3507 
3508      *   `C` : 802.15.4 channel (Receive channel)
3509      *   `C` : IEEE 802.15.4 LQI
3510      *   `L` : The timestamp milliseconds
3511      *   `S` : The timestamp microseconds, offset to mMsec
3512      *
3513      * Frames written to this stream with `CMD_PROP_VALUE_SET` will be sent out
3514      * over the radio. This allows the caller to use the radio directly.
3515      *
3516      * The frame meta data for the `CMD_PROP_VALUE_SET` contains the following
3517      * fields.  Default values are used for all unspecified fields.
3518      *
3519      *  `C` : Channel (for frame tx) - MUST be included.
3520      *  `C` : Maximum number of backoffs attempts before declaring CCA failure
3521      *        (use Thread stack default if not specified)
3522      *  `C` : Maximum number of retries allowed after a transmission failure
3523      *        (use Thread stack default if not specified)
3524      *  `b` : Set to true to enable CSMA-CA for this packet, false otherwise.
3525      *        (default true).
3526      *  `b` : Set to true to indicate if header is updated - related to
3527      *        `mIsHeaderUpdated` in `otRadioFrame` (default false).
3528      *  `b` : Set to true to indicate it is a retransmission - related to
3529      *        `mIsARetx` in `otRadioFrame` (default false).
3530      *  `b` : Set to true to indicate security was processed on tx frame
3531      *        `mIsSecurityProcessed` in `otRadioFrame` (default false).
3532      *  `L` : TX delay interval used for CSL - related to `mTxDelay` in
3533      *        `otRadioFrame` (default zero).
3534      *  `L` : TX delay based time used for CSL - related to `mTxDelayBaseTime`
3535      *        in `otRadioFrame` (default zero).
3536      *  `C` : RX channel after TX done (default assumed to be same as
3537      *        channel in metadata)
3538      *
3539      */
3540     SPINEL_PROP_STREAM_RAW = SPINEL_PROP_STREAM__BEGIN + 1,
3541 
3542     /// (IPv6) Network Stream
3543     /** Format: `dD` (stream, read only)
3544      *
3545      * This stream provides the capability of sending and receiving (IPv6)
3546      * data packets to and from the currently attached network. The packets
3547      * are sent or received securely (encryption and authentication).
3548      *
3549      * This property is a streaming property, meaning that you cannot explicitly
3550      * fetch the value of this property. To receive traffic, you wait for
3551      * `CMD_PROP_VALUE_IS` commands with this property id from the NCP.
3552      *
3553      * To send network packets, you call `CMD_PROP_VALUE_SET` on this property with
3554      * the value of the packet.
3555      *
3556      * The general format of this property is:
3557      *
3558      *    `d` : packet data
3559      *    `D` : packet meta data
3560      *
3561      * The packet metadata is optional. Packet meta data MAY be empty or partially
3562      * specified. Partially specified metadata MUST be accepted. Default values
3563      * are used for all unspecified fields.
3564      *
3565      * For OpenThread the meta data is currently empty.
3566      *
3567      */
3568     SPINEL_PROP_STREAM_NET = SPINEL_PROP_STREAM__BEGIN + 2,
3569 
3570     /// (IPv6) Network Stream Insecure
3571     /** Format: `dD` (stream, read only)
3572      *
3573      * This stream provides the capability of sending and receiving unencrypted
3574      * and unauthenticated data packets to and from nearby devices for the
3575      * purposes of device commissioning.
3576      *
3577      * This property is a streaming property, meaning that you cannot explicitly
3578      * fetch the value of this property. To receive traffic, you wait for
3579      * `CMD_PROP_VALUE_IS` commands with this property id from the NCP.
3580      *
3581      * To send network packets, you call `CMD_PROP_VALUE_SET` on this property with
3582      * the value of the packet.
3583      *
3584      * The general format of this property is:
3585      *
3586      *    `d` : packet data
3587      *    `D` : packet meta data
3588      *
3589      * The packet metadata is optional. Packet meta data MAY be empty or partially
3590      * specified. Partially specified metadata MUST be accepted. Default values
3591      * are used for all unspecified fields.
3592      *
3593      * For OpenThread the meta data is currently empty.
3594      *
3595      */
3596     SPINEL_PROP_STREAM_NET_INSECURE = SPINEL_PROP_STREAM__BEGIN + 3,
3597 
3598     /// Log Stream
3599     /** Format: `UD` (stream, read only)
3600      *
3601      * This property is a read-only streaming property which provides
3602      * formatted log string from NCP. This property provides asynchronous
3603      * `CMD_PROP_VALUE_IS` updates with a new log string and includes
3604      * optional meta data.
3605      *
3606      *   `U`: The log string
3607      *   `D`: Log metadata (optional).
3608      *
3609      * Any data after the log string is considered metadata and is OPTIONAL.
3610      * Presence of `SPINEL_CAP_OPENTHREAD_LOG_METADATA` capability
3611      * indicates that OpenThread log metadata format is used as defined
3612      * below:
3613      *
3614      *    `C`: Log level (as per definition in enumeration
3615      *         `SPINEL_NCP_LOG_LEVEL_<level>`)
3616      *    `i`: OpenThread Log region (as per definition in enumeration
3617      *         `SPINEL_NCP_LOG_REGION_<region>).
3618      *    `X`: Log timestamp = <timestamp_base> + <current_time_ms>
3619      *
3620      */
3621     SPINEL_PROP_STREAM_LOG = SPINEL_PROP_STREAM__BEGIN + 4,
3622 
3623     SPINEL_PROP_STREAM__END = 0x80,
3624 
3625     SPINEL_PROP_STREAM_EXT__BEGIN = 0x1700,
3626     SPINEL_PROP_STREAM_EXT__END   = 0x1800,
3627 
3628     SPINEL_PROP_MESHCOP__BEGIN = 0x80,
3629 
3630     // Thread Joiner State
3631     /** Format `C` - Read Only
3632      *
3633      * Required capability: SPINEL_CAP_THREAD_JOINER
3634      *
3635      * The valid values are specified by `spinel_meshcop_joiner_state_t` (`SPINEL_MESHCOP_JOINER_STATE_<state>`)
3636      * enumeration.
3637      *
3638      */
3639     SPINEL_PROP_MESHCOP_JOINER_STATE = SPINEL_PROP_MESHCOP__BEGIN + 0, ///<[C]
3640 
3641     /// Thread Joiner Commissioning command and the parameters
3642     /** Format `b` or `bU(UUUUU)` (fields in parenthesis are optional) - Write Only
3643      *
3644      * This property starts or stops Joiner's commissioning process
3645      *
3646      * Required capability: SPINEL_CAP_THREAD_JOINER
3647      *
3648      * Writing to this property starts/stops the Joiner commissioning process.
3649      * The immediate `VALUE_IS` response indicates success/failure of the starting/stopping
3650      * the Joiner commissioning process.
3651      *
3652      * After a successful start operation, the join process outcome is reported through an
3653      * asynchronous `VALUE_IS(LAST_STATUS)` update with one of the following error status values:
3654      *
3655      *     - SPINEL_STATUS_JOIN_SUCCESS     the join process succeeded.
3656      *     - SPINEL_STATUS_JOIN_SECURITY    the join process failed due to security credentials.
3657      *     - SPINEL_STATUS_JOIN_NO_PEERS    no joinable network was discovered.
3658      *     - SPINEL_STATUS_JOIN_RSP_TIMEOUT if a response timed out.
3659      *     - SPINEL_STATUS_JOIN_FAILURE     join failure.
3660      *
3661      * Frame format:
3662      *
3663      *  `b` : Start or stop commissioning process (true to start).
3664      *
3665      * Only if the start commissioning.
3666      *
3667      *  `U` : Joiner's PSKd.
3668      *
3669      * The next fields are all optional. If not provided, OpenThread default values would be used.
3670      *
3671      *  `U` : Provisioning URL (use empty string if not required).
3672      *  `U` : Vendor Name. If not specified or empty string, use OpenThread default (PACKAGE_NAME).
3673      *  `U` : Vendor Model. If not specified or empty string, use OpenThread default (OPENTHREAD_CONFIG_PLATFORM_INFO).
3674      *  `U` : Vendor Sw Version. If not specified or empty string, use OpenThread default (PACKAGE_VERSION).
3675      *  `U` : Vendor Data String. Will not be appended if not specified.
3676      *
3677      */
3678     SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING = SPINEL_PROP_MESHCOP__BEGIN + 1,
3679 
3680     // Thread Commissioner State
3681     /** Format `C`
3682      *
3683      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3684      *
3685      * The valid values are specified by SPINEL_MESHCOP_COMMISSIONER_STATE_<state> enumeration.
3686      *
3687      */
3688     SPINEL_PROP_MESHCOP_COMMISSIONER_STATE = SPINEL_PROP_MESHCOP__BEGIN + 2,
3689 
3690     // Thread Commissioner Joiners
3691     /** Format `A(t(t(E|CX)UL))` - get, insert or remove.
3692      *
3693      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3694      *
3695      * Data per array entry is:
3696      *
3697      *  `t()` | `t(E)` | `t(CX)` : Joiner info struct (formatting varies).
3698      *
3699      *   -  `t()` or empty struct indicates any joiner.
3700      *   -  `t(E)` specifies the Joiner EUI-64.
3701      *   -  `t(CX) specifies Joiner Discerner, `C` is Discerner length (in bits), and `X` is Discerner value.
3702      *
3703      * The struct is followed by:
3704      *
3705      *  `L` : Timeout after which to remove Joiner (when written should be in seconds, when read is in milliseconds)
3706      *  `U` : PSKd
3707      *
3708      * For CMD_PROP_VALUE_REMOVE the timeout and PSKd are optional.
3709      *
3710      */
3711     SPINEL_PROP_MESHCOP_COMMISSIONER_JOINERS = SPINEL_PROP_MESHCOP__BEGIN + 3,
3712 
3713     // Thread Commissioner Provisioning URL
3714     /** Format `U`
3715      *
3716      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3717      *
3718      */
3719     SPINEL_PROP_MESHCOP_COMMISSIONER_PROVISIONING_URL = SPINEL_PROP_MESHCOP__BEGIN + 4,
3720 
3721     // Thread Commissioner Session ID
3722     /** Format `S` - Read only
3723      *
3724      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3725      *
3726      */
3727     SPINEL_PROP_MESHCOP_COMMISSIONER_SESSION_ID = SPINEL_PROP_MESHCOP__BEGIN + 5,
3728 
3729     /// Thread Joiner Discerner
3730     /** Format `CX`  - Read-write
3731      *
3732      * Required capability: SPINEL_CAP_THREAD_JOINER
3733      *
3734      * This property represents a Joiner Discerner.
3735      *
3736      * The Joiner Discerner is used to calculate the Joiner ID used during commissioning/joining process.
3737      *
3738      * By default (when a discerner is not provided or cleared), Joiner ID is derived as first 64 bits of the result
3739      * of computing SHA-256 over factory-assigned IEEE EUI-64. Note that this is the main behavior expected by Thread
3740      * specification.
3741      *
3742      * Format:
3743      *
3744      *   'C' : The Joiner Discerner bit length (number of bits).
3745      *   `X` : The Joiner Discerner value (64-bit unsigned)  - Only present/applicable when length is non-zero.
3746      *
3747      * When writing to this property, the length can be set to zero to clear any previously set Joiner Discerner value.
3748      *
3749      * When reading this property if there is no currently set Joiner Discerner, zero is returned as the length (with
3750      * no value field).
3751      *
3752      */
3753     SPINEL_PROP_MESHCOP_JOINER_DISCERNER = SPINEL_PROP_MESHCOP__BEGIN + 6,
3754 
3755     SPINEL_PROP_MESHCOP__END = 0x90,
3756 
3757     SPINEL_PROP_MESHCOP_EXT__BEGIN = 0x1800,
3758 
3759     // Thread Commissioner Announce Begin
3760     /** Format `LCS6` - Write only
3761      *
3762      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3763      *
3764      * Writing to this property sends an Announce Begin message with the specified parameters. Response is a
3765      * `LAST_STATUS` update with status of operation.
3766      *
3767      *   `L` : Channel mask
3768      *   `C` : Number of messages per channel
3769      *   `S` : The time between two successive MLE Announce transmissions (milliseconds)
3770      *   `6` : IPv6 destination
3771      *
3772      */
3773     SPINEL_PROP_MESHCOP_COMMISSIONER_ANNOUNCE_BEGIN = SPINEL_PROP_MESHCOP_EXT__BEGIN + 0,
3774 
3775     // Thread Commissioner Energy Scan Query
3776     /** Format `LCSS6` - Write only
3777      *
3778      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3779      *
3780      * Writing to this property sends an Energy Scan Query message with the specified parameters. Response is a
3781      * `LAST_STATUS` with status of operation. The energy scan results are emitted asynchronously through
3782      * `SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN_RESULT` updates.
3783      *
3784      * Format is:
3785      *
3786      *   `L` : Channel mask
3787      *   `C` : The number of energy measurements per channel
3788      *   `S` : The time between energy measurements (milliseconds)
3789      *   `S` : The scan duration for each energy measurement (milliseconds)
3790      *   `6` : IPv6 destination.
3791      *
3792      */
3793     SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN = SPINEL_PROP_MESHCOP_EXT__BEGIN + 1,
3794 
3795     // Thread Commissioner Energy Scan Result
3796     /** Format `Ld` - Asynchronous event only
3797      *
3798      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3799      *
3800      * This property provides asynchronous `CMD_PROP_VALUE_INSERTED` updates to report energy scan results for a
3801      * previously sent Energy Scan Query message (please see `SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN`).
3802      *
3803      * Format is:
3804      *
3805      *   `L` : Channel mask
3806      *   `d` : Energy measurement data (note that `d` encoding includes the length)
3807      *
3808      */
3809     SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN_RESULT = SPINEL_PROP_MESHCOP_EXT__BEGIN + 2,
3810 
3811     // Thread Commissioner PAN ID Query
3812     /** Format `SL6` - Write only
3813      *
3814      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3815      *
3816      * Writing to this property sends a PAN ID Query message with the specified parameters. Response is a
3817      * `LAST_STATUS` with status of operation. The PAN ID Conflict results are emitted asynchronously through
3818      * `SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_CONFLICT_RESULT` updates.
3819      *
3820      * Format is:
3821      *
3822      *   `S` : PAN ID to query
3823      *   `L` : Channel mask
3824      *   `6` : IPv6 destination
3825      *
3826      */
3827     SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_QUERY = SPINEL_PROP_MESHCOP_EXT__BEGIN + 3,
3828 
3829     // Thread Commissioner PAN ID Conflict Result
3830     /** Format `SL` - Asynchronous event only
3831      *
3832      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3833      *
3834      * This property provides asynchronous `CMD_PROP_VALUE_INSERTED` updates to report PAN ID conflict results for a
3835      * previously sent PAN ID Query message (please see `SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_QUERY`).
3836      *
3837      * Format is:
3838      *
3839      *   `S` : The PAN ID
3840      *   `L` : Channel mask
3841      *
3842      */
3843     SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_CONFLICT_RESULT = SPINEL_PROP_MESHCOP_EXT__BEGIN + 4,
3844 
3845     // Thread Commissioner Send MGMT_COMMISSIONER_GET
3846     /** Format `d` - Write only
3847      *
3848      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3849      *
3850      * Writing to this property sends a MGMT_COMMISSIONER_GET message with the specified parameters. Response is a
3851      * `LAST_STATUS` with status of operation.
3852      *
3853      * Format is:
3854      *
3855      *   `d` : List of TLV types to get
3856      *
3857      */
3858     SPINEL_PROP_MESHCOP_COMMISSIONER_MGMT_GET = SPINEL_PROP_MESHCOP_EXT__BEGIN + 5,
3859 
3860     // Thread Commissioner Send MGMT_COMMISSIONER_SET
3861     /** Format `d` - Write only
3862      *
3863      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3864      *
3865      * Writing to this property sends a MGMT_COMMISSIONER_SET message with the specified parameters. Response is a
3866      * `LAST_STATUS` with status of operation.
3867      *
3868      * Format is:
3869      *
3870      *   `d` : TLV encoded data
3871      *
3872      */
3873     SPINEL_PROP_MESHCOP_COMMISSIONER_MGMT_SET = SPINEL_PROP_MESHCOP_EXT__BEGIN + 6,
3874 
3875     // Thread Commissioner Generate PSKc
3876     /** Format: `UUd` - Write only
3877      *
3878      * Required capability: SPINEL_CAP_THREAD_COMMISSIONER
3879      *
3880      * Writing to this property allows user to generate PSKc from a given commissioning pass-phrase, network name,
3881      * extended PAN Id.
3882      *
3883      * Written value format is:
3884      *
3885      *   `U` : The commissioning pass-phrase.
3886      *   `U` : Network Name.
3887      *   `d` : Extended PAN ID.
3888      *
3889      * The response on success would be a `VALUE_IS` command with the PSKc with format below:
3890      *
3891      *   `D` : The PSKc
3892      *
3893      * On a failure a `LAST_STATUS` is emitted with the error status.
3894      *
3895      */
3896     SPINEL_PROP_MESHCOP_COMMISSIONER_GENERATE_PSKC = SPINEL_PROP_MESHCOP_EXT__BEGIN + 7,
3897 
3898     SPINEL_PROP_MESHCOP_EXT__END = 0x1900,
3899 
3900     SPINEL_PROP_OPENTHREAD__BEGIN = 0x1900,
3901 
3902     /// Channel Manager - Channel Change New Channel
3903     /** Format: `C` (read-write)
3904      *
3905      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3906      *
3907      * Setting this property triggers the Channel Manager to start
3908      * a channel change process. The network switches to the given
3909      * channel after the specified delay (see `CHANNEL_MANAGER_DELAY`).
3910      *
3911      * A subsequent write to this property will cancel an ongoing
3912      * (previously requested) channel change.
3913      *
3914      */
3915     SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL = SPINEL_PROP_OPENTHREAD__BEGIN + 0,
3916 
3917     /// Channel Manager - Channel Change Delay
3918     /** Format 'S'
3919      *  Units: seconds
3920      *
3921      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3922      *
3923      * This property specifies the delay (in seconds) to be used for
3924      * a channel change request.
3925      *
3926      * The delay should preferably be longer than maximum data poll
3927      * interval used by all sleepy-end-devices within the Thread
3928      * network.
3929      *
3930      */
3931     SPINEL_PROP_CHANNEL_MANAGER_DELAY = SPINEL_PROP_OPENTHREAD__BEGIN + 1,
3932 
3933     /// Channel Manager Supported Channels
3934     /** Format 'A(C)'
3935      *
3936      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3937      *
3938      * This property specifies the list of supported channels.
3939      *
3940      */
3941     SPINEL_PROP_CHANNEL_MANAGER_SUPPORTED_CHANNELS = SPINEL_PROP_OPENTHREAD__BEGIN + 2,
3942 
3943     /// Channel Manager Favored Channels
3944     /** Format 'A(C)'
3945      *
3946      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3947      *
3948      * This property specifies the list of favored channels (when `ChannelManager` is asked to select channel)
3949      *
3950      */
3951     SPINEL_PROP_CHANNEL_MANAGER_FAVORED_CHANNELS = SPINEL_PROP_OPENTHREAD__BEGIN + 3,
3952 
3953     /// Channel Manager Channel Select Trigger
3954     /** Format 'b'
3955      *
3956      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3957      *
3958      * Writing to this property triggers a request on `ChannelManager` to select a new channel.
3959      *
3960      * Once a Channel Select is triggered, the Channel Manager will perform the following 3 steps:
3961      *
3962      * 1) `ChannelManager` decides if the channel change would be helpful. This check can be skipped if in the input
3963      *    boolean to this property is set to `true` (skipping the quality check).
3964      *    This step uses the collected link quality metrics on the device such as CCA failure rate, frame and message
3965      *    error rates per neighbor, etc. to determine if the current channel quality is at the level that justifies
3966      *    a channel change.
3967      *
3968      * 2) If first step passes, then `ChannelManager` selects a potentially better channel. It uses the collected
3969      *    channel quality data by `ChannelMonitor` module. The supported and favored channels are used at this step.
3970      *
3971      * 3) If the newly selected channel is different from the current channel, `ChannelManager` requests/starts the
3972      *    channel change process.
3973      *
3974      * Reading this property always yields `false`.
3975      *
3976      */
3977     SPINEL_PROP_CHANNEL_MANAGER_CHANNEL_SELECT = SPINEL_PROP_OPENTHREAD__BEGIN + 4,
3978 
3979     /// Channel Manager Auto Channel Selection Enabled
3980     /** Format 'b'
3981      *
3982      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3983      *
3984      * This property indicates if auto-channel-selection functionality is enabled/disabled on `ChannelManager`.
3985      *
3986      * When enabled, `ChannelManager` will periodically checks and attempts to select a new channel. The period interval
3987      * is specified by `SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_INTERVAL`.
3988      *
3989      */
3990     SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 5,
3991 
3992     /// Channel Manager Auto Channel Selection Interval
3993     /** Format 'L'
3994      *  units: seconds
3995      *
3996      * Required capability: SPINEL_CAP_CHANNEL_MANAGER
3997      *
3998      * This property specifies the auto-channel-selection check interval (in seconds).
3999      *
4000      */
4001     SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 6,
4002 
4003     /// Thread network time.
4004     /** Format: `Xc` - Read only
4005      *
4006      * Data per item is:
4007      *
4008      *  `X`: The Thread network time, in microseconds.
4009      *  `c`: Time synchronization status.
4010      *
4011      */
4012     SPINEL_PROP_THREAD_NETWORK_TIME = SPINEL_PROP_OPENTHREAD__BEGIN + 7,
4013 
4014     /// Thread time synchronization period
4015     /** Format: `S` - Read-Write
4016      *
4017      * Data per item is:
4018      *
4019      *  `S`: Time synchronization period, in seconds.
4020      *
4021      */
4022     SPINEL_PROP_TIME_SYNC_PERIOD = SPINEL_PROP_OPENTHREAD__BEGIN + 8,
4023 
4024     /// Thread Time synchronization XTAL accuracy threshold for Router
4025     /** Format: `S` - Read-Write
4026      *
4027      * Data per item is:
4028      *
4029      *  `S`: The XTAL accuracy threshold for Router, in PPM.
4030      *
4031      */
4032     SPINEL_PROP_TIME_SYNC_XTAL_THRESHOLD = SPINEL_PROP_OPENTHREAD__BEGIN + 9,
4033 
4034     /// Child Supervision Interval
4035     /** Format: `S` - Read-Write
4036      *  Units: Seconds
4037      *
4038      * Required capability: `SPINEL_CAP_CHILD_SUPERVISION`
4039      *
4040      * The child supervision interval (in seconds). Zero indicates that child supervision is disabled.
4041      *
4042      * When enabled, Child supervision feature ensures that at least one message is sent to every sleepy child within
4043      * the given supervision interval. If there is no other message, a supervision message (a data message with empty
4044      * payload) is enqueued and sent to the child.
4045      *
4046      * This property is available for FTD build only.
4047      *
4048      */
4049     SPINEL_PROP_CHILD_SUPERVISION_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 10,
4050 
4051     /// Child Supervision Check Timeout
4052     /** Format: `S` - Read-Write
4053      *  Units: Seconds
4054      *
4055      * Required capability: `SPINEL_CAP_CHILD_SUPERVISION`
4056      *
4057      * The child supervision check timeout interval (in seconds). Zero indicates supervision check on the child is
4058      * disabled.
4059      *
4060      * Supervision check is only applicable on a sleepy child. When enabled, if the child does not hear from its parent
4061      * within the specified check timeout, it initiates a re-attach process by starting an MLE Child Update
4062      * Request/Response exchange with the parent.
4063      *
4064      * This property is available for FTD and MTD builds.
4065      *
4066      */
4067     SPINEL_PROP_CHILD_SUPERVISION_CHECK_TIMEOUT = SPINEL_PROP_OPENTHREAD__BEGIN + 11,
4068 
4069     // RCP (NCP in radio only mode) version
4070     /** Format `U` - Read only
4071      *
4072      * Required capability: SPINEL_CAP_POSIX
4073      *
4074      * This property gives the version string of RCP (NCP in radio mode) which is being controlled by a POSIX
4075      * application. It is available only in "POSIX" platform (i.e., `OPENTHREAD_PLATFORM_POSIX` is enabled).
4076      *
4077      */
4078     SPINEL_PROP_RCP_VERSION = SPINEL_PROP_OPENTHREAD__BEGIN + 12,
4079 
4080     /// Thread Parent Response info
4081     /** Format: `ESccCCCb` - Asynchronous event only
4082      *
4083      *  `E`: Extended address
4084      *  `S`: RLOC16
4085      *  `c`: Instant RSSI
4086      *  'c': Parent Priority
4087      *  `C`: Link Quality3
4088      *  `C`: Link Quality2
4089      *  `C`: Link Quality1
4090      *  'b': Is the node receiving parent response frame attached
4091      *
4092      * This property sends Parent Response frame information to the Host.
4093      * This property is available for FTD build only.
4094      *
4095      */
4096     SPINEL_PROP_PARENT_RESPONSE_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 13,
4097 
4098     /// SLAAC enabled
4099     /** Format `b` - Read-Write
4100      *  Required capability: `SPINEL_CAP_SLAAC`
4101      *
4102      * This property allows the host to enable/disable SLAAC module on NCP at run-time. When SLAAC module is enabled,
4103      * SLAAC addresses (based on on-mesh prefixes in Network Data) are added to the interface. When SLAAC module is
4104      * disabled any previously added SLAAC address is removed.
4105      *
4106      */
4107     SPINEL_PROP_SLAAC_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 14,
4108 
4109     // Supported Radio Links (by device)
4110     /**
4111      * Format `A(i)` - Read only
4112      *
4113      * This property returns list of supported radio links by the device itself. Enumeration `SPINEL_RADIO_LINK_{TYPE}`
4114      * values indicate different radio link types.
4115      *
4116      */
4117     SPINEL_PROP_SUPPORTED_RADIO_LINKS = SPINEL_PROP_OPENTHREAD__BEGIN + 15,
4118 
4119     /// Neighbor Table Multi Radio Link Info
4120     /** Format: `A(t(ESA(t(iC))))` - Read only
4121      * Required capability: `SPINEL_CAP_MULTI_RADIO`.
4122      *
4123      * Each item represents info about a neighbor:
4124      *
4125      *  `E`: Neighbor's Extended Address
4126      *  `S`: Neighbor's RLOC16
4127      *
4128      *  This is then followed by an array of radio link info structures indicating which radio links are supported by
4129      *  the neighbor:
4130      *
4131      *    `i` : Radio link type (enumeration `SPINEL_RADIO_LINK_{TYPE}`).
4132      *    `C` : Preference value associated with radio link.
4133      *
4134      */
4135     SPINEL_PROP_NEIGHBOR_TABLE_MULTI_RADIO_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 16,
4136 
4137     /// SRP Client Start
4138     /** Format: `b(6Sb)` - Write only
4139      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4140      *
4141      * Writing to this property allows user to start or stop the SRP client operation with a given SRP server.
4142      *
4143      * Written value format is:
4144      *
4145      *   `b` : TRUE to start the client, FALSE to stop the client.
4146      *
4147      * When used to start the SRP client, the following fields should also be included:
4148      *
4149      *   `6` : SRP server IPv6 address.
4150      *   `U` : SRP server port number.
4151      *   `b` : Boolean to indicate whether or not to emit SRP client events (using `SPINEL_PROP_SRP_CLIENT_EVENT`).
4152      *
4153      */
4154     SPINEL_PROP_SRP_CLIENT_START = SPINEL_PROP_OPENTHREAD__BEGIN + 17,
4155 
4156     /// SRP Client Lease Interval
4157     /** Format: `L` - Read/Write
4158      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4159      *
4160      * The lease interval used in SRP update requests (in seconds).
4161      *
4162      */
4163     SPINEL_PROP_SRP_CLIENT_LEASE_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 18,
4164 
4165     /// SRP Client Key Lease Interval
4166     /** Format: `L` - Read/Write
4167      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4168      *
4169      * The key lease interval used in SRP update requests (in seconds).
4170      *
4171      */
4172     SPINEL_PROP_SRP_CLIENT_KEY_LEASE_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 19,
4173 
4174     /// SRP Client Host Info
4175     /** Format: `UCt(A(6))` - Read only
4176      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4177      *
4178      * Format is:
4179      *
4180      *   `U`       : The host name.
4181      *   `C`       : The host state (values from `spinel_srp_client_item_state_t`).
4182      *   `t(A(6))` : Structure containing array of host IPv6 addresses.
4183      *
4184      */
4185     SPINEL_PROP_SRP_CLIENT_HOST_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 20,
4186 
4187     /// SRP Client Host Name (label).
4188     /** Format: `U` - Read/Write
4189      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4190      *
4191      */
4192     SPINEL_PROP_SRP_CLIENT_HOST_NAME = SPINEL_PROP_OPENTHREAD__BEGIN + 21,
4193 
4194     /// SRP Client Host Addresses
4195     /** Format: `A(6)` - Read/Write
4196      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4197      *
4198      */
4199     SPINEL_PROP_SRP_CLIENT_HOST_ADDRESSES = SPINEL_PROP_OPENTHREAD__BEGIN + 22,
4200 
4201     /// SRP Client Services
4202     /** Format: `A(t(UUSSSd))` - Read/Insert/Remove
4203      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4204      *
4205      * This property provides a list/array of services.
4206      *
4207      * Data per item for `SPINEL_CMD_PROP_VALUE_GET` and/or `SPINEL_CMD_PROP_VALUE_INSERT` operation is as follows:
4208      *
4209      *   `U` : The service name labels (e.g., "_chip._udp", not the full domain name.
4210      *   `U` : The service instance name label (not the full name).
4211      *   `S` : The service port number.
4212      *   `S` : The service priority.
4213      *   `S` : The service weight.
4214      *
4215      * For `SPINEL_CMD_PROP_VALUE_REMOVE` command, the following format is used:
4216      *
4217      *   `U` : The service name labels (e.g., "_chip._udp", not the full domain name.
4218      *   `U` : The service instance name label (not the full name).
4219      *   `b` : Indicates whether to clear the service entry (optional).
4220      *
4221      * The last boolean (`b`) field is optional. When included it indicates on `true` to clear the service (clear it
4222      * on client immediately with no interaction to server) and on `false` to remove the service (inform server and
4223      * wait for the service entry to be removed on server). If it is not included, the value is `false`.
4224      *
4225      */
4226     SPINEL_PROP_SRP_CLIENT_SERVICES = SPINEL_PROP_OPENTHREAD__BEGIN + 23,
4227 
4228     /// SRP Client Host And Services Remove
4229     /** Format: `bb` : Write only
4230      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4231      *
4232      * Writing to this property with starts the remove process of the host info and all services.
4233      * Please see `otSrpClientRemoveHostAndServices()` for more details.
4234      *
4235      * Format is:
4236      *
4237      *    `b` : A boolean indicating whether or not the host key lease should also be cleared.
4238      *    `b` : A boolean indicating whether or not to send update to server when host info is not registered.
4239      *
4240      */
4241     SPINEL_PROP_SRP_CLIENT_HOST_SERVICES_REMOVE = SPINEL_PROP_OPENTHREAD__BEGIN + 24,
4242 
4243     /// SRP Client Host And Services Clear
4244     /** Format: Empty : Write only
4245      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4246      *
4247      * Writing to this property clears all host info and all the services.
4248      * Please see `otSrpClientClearHostAndServices()` for more details.
4249      *
4250      */
4251     SPINEL_PROP_SRP_CLIENT_HOST_SERVICES_CLEAR = SPINEL_PROP_OPENTHREAD__BEGIN + 25,
4252 
4253     /// SRP Client Event
4254     /** Format: t() : Asynchronous event only
4255      * Required capability: `SPINEL_CAP_SRP_CLIENT`.
4256      *
4257      * This property is asynchronously emitted when there is an event from SRP client notifying some state changes or
4258      * errors.
4259      *
4260      * The general format of this property is as follows:
4261      *
4262      *    `S` : Error code (see `spinel_srp_client_error_t` enumeration).
4263      *    `d` : Host info data.
4264      *    `d` : Active services.
4265      *    `d` : Removed services.
4266      *
4267      * The host info data contains:
4268      *
4269      *   `U`       : The host name.
4270      *   `C`       : The host state (values from `spinel_srp_client_item_state_t`).
4271      *   `t(A(6))` : Structure containing array of host IPv6 addresses.
4272      *
4273      * The active or removed services data is an array of services `A(t(UUSSSd))` with each service format:
4274      *
4275      *   `U` : The service name labels (e.g., "_chip._udp", not the full domain name.
4276      *   `U` : The service instance name label (not the full name).
4277      *   `S` : The service port number.
4278      *   `S` : The service priority.
4279      *   `S` : The service weight.
4280      *   `d` : The encoded TXT-DATA.
4281      *
4282      */
4283     SPINEL_PROP_SRP_CLIENT_EVENT = SPINEL_PROP_OPENTHREAD__BEGIN + 26,
4284 
4285     /// SRP Client Service Key Inclusion Enabled
4286     /** Format `b` : Read-Write
4287      * Required capability: `SPINEL_CAP_SRP_CLIENT` & `SPINEL_CAP_REFERENCE_DEVICE`.
4288      *
4289      * This boolean property indicates whether the "service key record inclusion" mode is enabled or not.
4290      *
4291      * When enabled, SRP client will include KEY record in Service Description Instructions in the SRP update messages
4292      * that it sends.
4293      *
4294      * KEY record is optional in Service Description Instruction (it is required and always included in the Host
4295      * Description Instruction). The default behavior of SRP client is to not include it. This function is intended to
4296      * override the default behavior for testing only.
4297      *
4298      */
4299     SPINEL_PROP_SRP_CLIENT_SERVICE_KEY_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 27,
4300 
4301     SPINEL_PROP_OPENTHREAD__END = 0x2000,
4302 
4303     SPINEL_PROP_SERVER__BEGIN = 0xA0,
4304 
4305     /// Server Allow Local Network Data Change
4306     /** Format `b` - Read-write
4307      *
4308      * Required capability: SPINEL_CAP_THREAD_SERVICE
4309      *
4310      * Set to true before changing local server net data. Set to false when finished.
4311      * This allows changes to be aggregated into a single event.
4312      *
4313      */
4314     SPINEL_PROP_SERVER_ALLOW_LOCAL_DATA_CHANGE = SPINEL_PROP_SERVER__BEGIN + 0,
4315 
4316     // Server Services
4317     /** Format: `A(t(LdbdS))`
4318      *
4319      * This property provides all services registered on the device
4320      *
4321      * Required capability: SPINEL_CAP_THREAD_SERVICE
4322      *
4323      * Array of structures containing:
4324      *
4325      *  `L`: Enterprise Number
4326      *  `d`: Service Data
4327      *  `b`: Stable
4328      *  `d`: Server Data
4329      *  `S`: RLOC
4330      *
4331      */
4332     SPINEL_PROP_SERVER_SERVICES = SPINEL_PROP_SERVER__BEGIN + 1,
4333 
4334     // Server Leader Services
4335     /** Format: `A(t(CLdbdS))`
4336      *
4337      * This property provides all services registered on the leader
4338      *
4339      * Array of structures containing:
4340      *
4341      *  `C`: Service ID
4342      *  `L`: Enterprise Number
4343      *  `d`: Service Data
4344      *  `b`: Stable
4345      *  `d`: Server Data
4346      *  `S`: RLOC
4347      *
4348      */
4349     SPINEL_PROP_SERVER_LEADER_SERVICES = SPINEL_PROP_SERVER__BEGIN + 2,
4350 
4351     SPINEL_PROP_SERVER__END = 0xB0,
4352 
4353     SPINEL_PROP_RCP__BEGIN = 0xB0,
4354 
4355     /// RCP API Version number
4356     /** Format: `i` (read-only)
4357      *
4358      * Required capability: SPINEL_CAP_RADIO and SPINEL_CAP_RCP_API_VERSION.
4359      *
4360      * This property gives the RCP API Version number.
4361      *
4362      * Please see "Spinel definition compatibility guideline" section.
4363      *
4364      */
4365     SPINEL_PROP_RCP_API_VERSION = SPINEL_PROP_RCP__BEGIN + 0,
4366 
4367     /// Min host RCP API Version number
4368     /** Format: `i` (read-only)
4369      *
4370      * Required capability: SPINEL_CAP_RADIO and SPINEL_CAP_RCP_MIN_HOST_API_VERSION.
4371      *
4372      * This property gives the minimum host RCP API Version number.
4373      *
4374      * Please see "Spinel definition compatibility guideline" section.
4375      *
4376      */
4377     SPINEL_PROP_RCP_MIN_HOST_API_VERSION = SPINEL_PROP_RCP__BEGIN + 1,
4378 
4379     SPINEL_PROP_RCP__END = 0xFF,
4380 
4381     SPINEL_PROP_INTERFACE__BEGIN = 0x100,
4382 
4383     /// UART Bitrate
4384     /** Format: `L`
4385      *
4386      *  If the NCP is using a UART to communicate with the host,
4387      *  this property allows the host to change the bitrate
4388      *  of the serial connection. The value encoding is `L`,
4389      *  which is a little-endian 32-bit unsigned integer.
4390      *  The host should not assume that all possible numeric values
4391      *  are supported.
4392      *
4393      *  If implemented by the NCP, this property should be persistent
4394      *  across software resets and forgotten upon hardware resets.
4395      *
4396      *  This property is only implemented when a UART is being
4397      *  used for Spinel. This property is optional.
4398      *
4399      *  When changing the bitrate, all frames will be received
4400      *  at the previous bitrate until the response frame to this command
4401      *  is received. Once a successful response frame is received by
4402      *  the host, all further frames will be transmitted at the new
4403      *  bitrate.
4404      */
4405     SPINEL_PROP_UART_BITRATE = SPINEL_PROP_INTERFACE__BEGIN + 0,
4406 
4407     /// UART Software Flow Control
4408     /** Format: `b`
4409      *
4410      *  If the NCP is using a UART to communicate with the host,
4411      *  this property allows the host to determine if software flow
4412      *  control (XON/XOFF style) should be used and (optionally) to
4413      *  turn it on or off.
4414      *
4415      *  This property is only implemented when a UART is being
4416      *  used for Spinel. This property is optional.
4417      */
4418     SPINEL_PROP_UART_XON_XOFF = SPINEL_PROP_INTERFACE__BEGIN + 1,
4419 
4420     SPINEL_PROP_INTERFACE__END = 0x200,
4421 
4422     SPINEL_PROP_15_4_PIB__BEGIN = 0x400,
4423     // For direct access to the 802.15.4 PID.
4424     // Individual registers are fetched using
4425     // `SPINEL_PROP_15_4_PIB__BEGIN+[PIB_IDENTIFIER]`
4426     // Only supported if SPINEL_CAP_15_4_PIB is set.
4427     //
4428     // For brevity, the entire 802.15.4 PIB space is
4429     // not defined here, but a few choice attributes
4430     // are defined for illustration and convenience.
4431     SPINEL_PROP_15_4_PIB_PHY_CHANNELS_SUPPORTED = SPINEL_PROP_15_4_PIB__BEGIN + 0x01, ///< [A(L)]
4432     SPINEL_PROP_15_4_PIB_MAC_PROMISCUOUS_MODE   = SPINEL_PROP_15_4_PIB__BEGIN + 0x51, ///< [b]
4433     SPINEL_PROP_15_4_PIB_MAC_SECURITY_ENABLED   = SPINEL_PROP_15_4_PIB__BEGIN + 0x5d, ///< [b]
4434     SPINEL_PROP_15_4_PIB__END                   = 0x500,
4435 
4436     SPINEL_PROP_CNTR__BEGIN = 0x500,
4437 
4438     /// Counter reset
4439     /** Format: Empty (Write only).
4440      *
4441      * Writing to this property (with any value) will reset all MAC, MLE, IP, and NCP counters to zero.
4442      *
4443      */
4444     SPINEL_PROP_CNTR_RESET = SPINEL_PROP_CNTR__BEGIN + 0,
4445 
4446     /// The total number of transmissions.
4447     /** Format: `L` (Read-only) */
4448     SPINEL_PROP_CNTR_TX_PKT_TOTAL = SPINEL_PROP_CNTR__BEGIN + 1,
4449 
4450     /// The number of transmissions with ack request.
4451     /** Format: `L` (Read-only) */
4452     SPINEL_PROP_CNTR_TX_PKT_ACK_REQ = SPINEL_PROP_CNTR__BEGIN + 2,
4453 
4454     /// The number of transmissions that were acked.
4455     /** Format: `L` (Read-only) */
4456     SPINEL_PROP_CNTR_TX_PKT_ACKED = SPINEL_PROP_CNTR__BEGIN + 3,
4457 
4458     /// The number of transmissions without ack request.
4459     /** Format: `L` (Read-only) */
4460     SPINEL_PROP_CNTR_TX_PKT_NO_ACK_REQ = SPINEL_PROP_CNTR__BEGIN + 4,
4461 
4462     /// The number of transmitted data.
4463     /** Format: `L` (Read-only) */
4464     SPINEL_PROP_CNTR_TX_PKT_DATA = SPINEL_PROP_CNTR__BEGIN + 5,
4465 
4466     /// The number of transmitted data poll.
4467     /** Format: `L` (Read-only) */
4468     SPINEL_PROP_CNTR_TX_PKT_DATA_POLL = SPINEL_PROP_CNTR__BEGIN + 6,
4469 
4470     /// The number of transmitted beacon.
4471     /** Format: `L` (Read-only) */
4472     SPINEL_PROP_CNTR_TX_PKT_BEACON = SPINEL_PROP_CNTR__BEGIN + 7,
4473 
4474     /// The number of transmitted beacon request.
4475     /** Format: `L` (Read-only) */
4476     SPINEL_PROP_CNTR_TX_PKT_BEACON_REQ = SPINEL_PROP_CNTR__BEGIN + 8,
4477 
4478     /// The number of transmitted other types of frames.
4479     /** Format: `L` (Read-only) */
4480     SPINEL_PROP_CNTR_TX_PKT_OTHER = SPINEL_PROP_CNTR__BEGIN + 9,
4481 
4482     /// The number of retransmission times.
4483     /** Format: `L` (Read-only) */
4484     SPINEL_PROP_CNTR_TX_PKT_RETRY = SPINEL_PROP_CNTR__BEGIN + 10,
4485 
4486     /// The number of CCA failure times.
4487     /** Format: `L` (Read-only) */
4488     SPINEL_PROP_CNTR_TX_ERR_CCA = SPINEL_PROP_CNTR__BEGIN + 11,
4489 
4490     /// The number of unicast packets transmitted.
4491     /** Format: `L` (Read-only) */
4492     SPINEL_PROP_CNTR_TX_PKT_UNICAST = SPINEL_PROP_CNTR__BEGIN + 12,
4493 
4494     /// The number of broadcast packets transmitted.
4495     /** Format: `L` (Read-only) */
4496     SPINEL_PROP_CNTR_TX_PKT_BROADCAST = SPINEL_PROP_CNTR__BEGIN + 13,
4497 
4498     /// The number of frame transmission failures due to abort error.
4499     /** Format: `L` (Read-only) */
4500     SPINEL_PROP_CNTR_TX_ERR_ABORT = SPINEL_PROP_CNTR__BEGIN + 14,
4501 
4502     /// The total number of received packets.
4503     /** Format: `L` (Read-only) */
4504     SPINEL_PROP_CNTR_RX_PKT_TOTAL = SPINEL_PROP_CNTR__BEGIN + 100,
4505 
4506     /// The number of received data.
4507     /** Format: `L` (Read-only) */
4508     SPINEL_PROP_CNTR_RX_PKT_DATA = SPINEL_PROP_CNTR__BEGIN + 101,
4509 
4510     /// The number of received data poll.
4511     /** Format: `L` (Read-only) */
4512     SPINEL_PROP_CNTR_RX_PKT_DATA_POLL = SPINEL_PROP_CNTR__BEGIN + 102,
4513 
4514     /// The number of received beacon.
4515     /** Format: `L` (Read-only) */
4516     SPINEL_PROP_CNTR_RX_PKT_BEACON = SPINEL_PROP_CNTR__BEGIN + 103,
4517 
4518     /// The number of received beacon request.
4519     /** Format: `L` (Read-only) */
4520     SPINEL_PROP_CNTR_RX_PKT_BEACON_REQ = SPINEL_PROP_CNTR__BEGIN + 104,
4521 
4522     /// The number of received other types of frames.
4523     /** Format: `L` (Read-only) */
4524     SPINEL_PROP_CNTR_RX_PKT_OTHER = SPINEL_PROP_CNTR__BEGIN + 105,
4525 
4526     /// The number of received packets filtered by allowlist.
4527     /** Format: `L` (Read-only) */
4528     SPINEL_PROP_CNTR_RX_PKT_FILT_WL = SPINEL_PROP_CNTR__BEGIN + 106,
4529 
4530     /// The number of received packets filtered by destination check.
4531     /** Format: `L` (Read-only) */
4532     SPINEL_PROP_CNTR_RX_PKT_FILT_DA = SPINEL_PROP_CNTR__BEGIN + 107,
4533 
4534     /// The number of received packets that are empty.
4535     /** Format: `L` (Read-only) */
4536     SPINEL_PROP_CNTR_RX_ERR_EMPTY = SPINEL_PROP_CNTR__BEGIN + 108,
4537 
4538     /// The number of received packets from an unknown neighbor.
4539     /** Format: `L` (Read-only) */
4540     SPINEL_PROP_CNTR_RX_ERR_UKWN_NBR = SPINEL_PROP_CNTR__BEGIN + 109,
4541 
4542     /// The number of received packets whose source address is invalid.
4543     /** Format: `L` (Read-only) */
4544     SPINEL_PROP_CNTR_RX_ERR_NVLD_SADDR = SPINEL_PROP_CNTR__BEGIN + 110,
4545 
4546     /// The number of received packets with a security error.
4547     /** Format: `L` (Read-only) */
4548     SPINEL_PROP_CNTR_RX_ERR_SECURITY = SPINEL_PROP_CNTR__BEGIN + 111,
4549 
4550     /// The number of received packets with a checksum error.
4551     /** Format: `L` (Read-only) */
4552     SPINEL_PROP_CNTR_RX_ERR_BAD_FCS = SPINEL_PROP_CNTR__BEGIN + 112,
4553 
4554     /// The number of received packets with other errors.
4555     /** Format: `L` (Read-only) */
4556     SPINEL_PROP_CNTR_RX_ERR_OTHER = SPINEL_PROP_CNTR__BEGIN + 113,
4557 
4558     /// The number of received duplicated.
4559     /** Format: `L` (Read-only) */
4560     SPINEL_PROP_CNTR_RX_PKT_DUP = SPINEL_PROP_CNTR__BEGIN + 114,
4561 
4562     /// The number of unicast packets received.
4563     /** Format: `L` (Read-only) */
4564     SPINEL_PROP_CNTR_RX_PKT_UNICAST = SPINEL_PROP_CNTR__BEGIN + 115,
4565 
4566     /// The number of broadcast packets received.
4567     /** Format: `L` (Read-only) */
4568     SPINEL_PROP_CNTR_RX_PKT_BROADCAST = SPINEL_PROP_CNTR__BEGIN + 116,
4569 
4570     /// The total number of secure transmitted IP messages.
4571     /** Format: `L` (Read-only) */
4572     SPINEL_PROP_CNTR_TX_IP_SEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 200,
4573 
4574     /// The total number of insecure transmitted IP messages.
4575     /** Format: `L` (Read-only) */
4576     SPINEL_PROP_CNTR_TX_IP_INSEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 201,
4577 
4578     /// The number of dropped (not transmitted) IP messages.
4579     /** Format: `L` (Read-only) */
4580     SPINEL_PROP_CNTR_TX_IP_DROPPED = SPINEL_PROP_CNTR__BEGIN + 202,
4581 
4582     /// The total number of secure received IP message.
4583     /** Format: `L` (Read-only) */
4584     SPINEL_PROP_CNTR_RX_IP_SEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 203,
4585 
4586     /// The total number of insecure received IP message.
4587     /** Format: `L` (Read-only) */
4588     SPINEL_PROP_CNTR_RX_IP_INSEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 204,
4589 
4590     /// The number of dropped received IP messages.
4591     /** Format: `L` (Read-only) */
4592     SPINEL_PROP_CNTR_RX_IP_DROPPED = SPINEL_PROP_CNTR__BEGIN + 205,
4593 
4594     /// The number of transmitted spinel frames.
4595     /** Format: `L` (Read-only) */
4596     SPINEL_PROP_CNTR_TX_SPINEL_TOTAL = SPINEL_PROP_CNTR__BEGIN + 300,
4597 
4598     /// The number of received spinel frames.
4599     /** Format: `L` (Read-only) */
4600     SPINEL_PROP_CNTR_RX_SPINEL_TOTAL = SPINEL_PROP_CNTR__BEGIN + 301,
4601 
4602     /// The number of received spinel frames with error.
4603     /** Format: `L` (Read-only) */
4604     SPINEL_PROP_CNTR_RX_SPINEL_ERR = SPINEL_PROP_CNTR__BEGIN + 302,
4605 
4606     /// Number of out of order received spinel frames (tid increase by more than 1).
4607     /** Format: `L` (Read-only) */
4608     SPINEL_PROP_CNTR_RX_SPINEL_OUT_OF_ORDER_TID = SPINEL_PROP_CNTR__BEGIN + 303,
4609 
4610     /// The number of successful Tx IP packets
4611     /** Format: `L` (Read-only) */
4612     SPINEL_PROP_CNTR_IP_TX_SUCCESS = SPINEL_PROP_CNTR__BEGIN + 304,
4613 
4614     /// The number of successful Rx IP packets
4615     /** Format: `L` (Read-only) */
4616     SPINEL_PROP_CNTR_IP_RX_SUCCESS = SPINEL_PROP_CNTR__BEGIN + 305,
4617 
4618     /// The number of failed Tx IP packets
4619     /** Format: `L` (Read-only) */
4620     SPINEL_PROP_CNTR_IP_TX_FAILURE = SPINEL_PROP_CNTR__BEGIN + 306,
4621 
4622     /// The number of failed Rx IP packets
4623     /** Format: `L` (Read-only) */
4624     SPINEL_PROP_CNTR_IP_RX_FAILURE = SPINEL_PROP_CNTR__BEGIN + 307,
4625 
4626     /// The message buffer counter info
4627     /** Format: `SSSSSSSSSSSSSSSS` (Read-only)
4628      *      `S`, (TotalBuffers)           The number of buffers in the pool.
4629      *      `S`, (FreeBuffers)            The number of free message buffers.
4630      *      `S`, (6loSendMessages)        The number of messages in the 6lo send queue.
4631      *      `S`, (6loSendBuffers)         The number of buffers in the 6lo send queue.
4632      *      `S`, (6loReassemblyMessages)  The number of messages in the 6LoWPAN reassembly queue.
4633      *      `S`, (6loReassemblyBuffers)   The number of buffers in the 6LoWPAN reassembly queue.
4634      *      `S`, (Ip6Messages)            The number of messages in the IPv6 send queue.
4635      *      `S`, (Ip6Buffers)             The number of buffers in the IPv6 send queue.
4636      *      `S`, (MplMessages)            The number of messages in the MPL send queue.
4637      *      `S`, (MplBuffers)             The number of buffers in the MPL send queue.
4638      *      `S`, (MleMessages)            The number of messages in the MLE send queue.
4639      *      `S`, (MleBuffers)             The number of buffers in the MLE send queue.
4640      *      `S`, (ArpMessages)            The number of messages in the ARP send queue.
4641      *      `S`, (ArpBuffers)             The number of buffers in the ARP send queue.
4642      *      `S`, (CoapMessages)           The number of messages in the CoAP send queue.
4643      *      `S`, (CoapBuffers)            The number of buffers in the CoAP send queue.
4644      */
4645     SPINEL_PROP_MSG_BUFFER_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 400,
4646 
4647     /// All MAC related counters.
4648     /** Format: t(A(L))t(A(L))
4649      *
4650      * The contents include two structs, first one corresponds to
4651      * all transmit related MAC counters, second one provides the
4652      * receive related counters.
4653      *
4654      * The transmit structure includes:
4655      *
4656      *   'L': TxTotal                  (The total number of transmissions).
4657      *   'L': TxUnicast                (The total number of unicast transmissions).
4658      *   'L': TxBroadcast              (The total number of broadcast transmissions).
4659      *   'L': TxAckRequested           (The number of transmissions with ack request).
4660      *   'L': TxAcked                  (The number of transmissions that were acked).
4661      *   'L': TxNoAckRequested         (The number of transmissions without ack request).
4662      *   'L': TxData                   (The number of transmitted data).
4663      *   'L': TxDataPoll               (The number of transmitted data poll).
4664      *   'L': TxBeacon                 (The number of transmitted beacon).
4665      *   'L': TxBeaconRequest          (The number of transmitted beacon request).
4666      *   'L': TxOther                  (The number of transmitted other types of frames).
4667      *   'L': TxRetry                  (The number of retransmission times).
4668      *   'L': TxErrCca                 (The number of CCA failure times).
4669      *   'L': TxErrAbort               (The number of frame transmission failures due to abort error).
4670      *   'L': TxErrBusyChannel         (The number of frames that were dropped due to a busy channel).
4671      *   'L': TxDirectMaxRetryExpiry   (The number of expired retransmission retries for direct message).
4672      *   'L': TxIndirectMaxRetryExpiry (The number of expired retransmission retries for indirect message).
4673      *
4674      * The receive structure includes:
4675      *
4676      *   'L': RxTotal                  (The total number of received packets).
4677      *   'L': RxUnicast                (The total number of unicast packets received).
4678      *   'L': RxBroadcast              (The total number of broadcast packets received).
4679      *   'L': RxData                   (The number of received data).
4680      *   'L': RxDataPoll               (The number of received data poll).
4681      *   'L': RxBeacon                 (The number of received beacon).
4682      *   'L': RxBeaconRequest          (The number of received beacon request).
4683      *   'L': RxOther                  (The number of received other types of frames).
4684      *   'L': RxAddressFiltered        (The number of received packets filtered by address filter
4685      *                                  (allowlist or denylist)).
4686      *   'L': RxDestAddrFiltered       (The number of received packets filtered by destination check).
4687      *   'L': RxDuplicated             (The number of received duplicated packets).
4688      *   'L': RxErrNoFrame             (The number of received packets with no or malformed content).
4689      *   'L': RxErrUnknownNeighbor     (The number of received packets from unknown neighbor).
4690      *   'L': RxErrInvalidSrcAddr      (The number of received packets whose source address is invalid).
4691      *   'L': RxErrSec                 (The number of received packets with security error).
4692      *   'L': RxErrFcs                 (The number of received packets with FCS error).
4693      *   'L': RxErrOther               (The number of received packets with other error).
4694      *
4695      * Writing to this property with any value would reset all MAC counters to zero.
4696      *
4697      */
4698     SPINEL_PROP_CNTR_ALL_MAC_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 401,
4699 
4700     /// Thread MLE counters.
4701     /** Format: `SSSSSSSSS`
4702      *
4703      *   'S': DisabledRole                  (The number of times device entered OT_DEVICE_ROLE_DISABLED role).
4704      *   'S': DetachedRole                  (The number of times device entered OT_DEVICE_ROLE_DETACHED role).
4705      *   'S': ChildRole                     (The number of times device entered OT_DEVICE_ROLE_CHILD role).
4706      *   'S': RouterRole                    (The number of times device entered OT_DEVICE_ROLE_ROUTER role).
4707      *   'S': LeaderRole                    (The number of times device entered OT_DEVICE_ROLE_LEADER role).
4708      *   'S': AttachAttempts                (The number of attach attempts while device was detached).
4709      *   'S': PartitionIdChanges            (The number of changes to partition ID).
4710      *   'S': BetterPartitionAttachAttempts (The number of attempts to attach to a better partition).
4711      *   'S': ParentChanges                 (The number of times device changed its parents).
4712      *
4713      * Writing to this property with any value would reset all MLE counters to zero.
4714      *
4715      */
4716     SPINEL_PROP_CNTR_MLE_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 402,
4717 
4718     /// Thread IPv6 counters.
4719     /** Format: `t(LL)t(LL)`
4720      *
4721      * The contents include two structs, first one corresponds to
4722      * all transmit related MAC counters, second one provides the
4723      * receive related counters.
4724      *
4725      * The transmit structure includes:
4726      *   'L': TxSuccess (The number of IPv6 packets successfully transmitted).
4727      *   'L': TxFailure (The number of IPv6 packets failed to transmit).
4728      *
4729      * The receive structure includes:
4730      *   'L': RxSuccess (The number of IPv6 packets successfully received).
4731      *   'L': RxFailure (The number of IPv6 packets failed to receive).
4732      *
4733      * Writing to this property with any value would reset all IPv6 counters to zero.
4734      *
4735      */
4736     SPINEL_PROP_CNTR_ALL_IP_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 403,
4737 
4738     /// MAC retry histogram.
4739     /** Format: t(A(L))t(A(L))
4740      *
4741      * Required capability: SPINEL_CAP_MAC_RETRY_HISTOGRAM
4742      *
4743      * The contents include two structs, first one is histogram which corresponds to retransmissions number of direct
4744      * messages, second one provides the histogram of retransmissions for indirect messages.
4745      *
4746      * The first structure includes:
4747      *   'L': DirectRetry[0]                   (The number of packets after 0 retry).
4748      *   'L': DirectRetry[1]                   (The number of packets after 1 retry).
4749      *    ...
4750      *   'L': DirectRetry[n]                   (The number of packets after n retry).
4751      *
4752      * The size of the array is OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_DIRECT.
4753      *
4754      * The second structure includes:
4755      *   'L': IndirectRetry[0]                   (The number of packets after 0 retry).
4756      *   'L': IndirectRetry[1]                   (The number of packets after 1 retry).
4757      *    ...
4758      *   'L': IndirectRetry[m]                   (The number of packets after m retry).
4759      *
4760      * The size of the array is OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_INDIRECT.
4761      *
4762      * Writing to this property with any value would reset MAC retry histogram.
4763      *
4764      */
4765     SPINEL_PROP_CNTR_MAC_RETRY_HISTOGRAM = SPINEL_PROP_CNTR__BEGIN + 404,
4766 
4767     SPINEL_PROP_CNTR__END = 0x800,
4768 
4769     SPINEL_PROP_RCP_EXT__BEGIN = 0x800,
4770 
4771     /// MAC Key
4772     /** Format: `CCddd`.
4773      *
4774      *  `C`: MAC key ID mode
4775      *  `C`: MAC key ID
4776      *  `d`: previous MAC key material data
4777      *  `d`: current MAC key material data
4778      *  `d`: next MAC key material data
4779      *
4780      * The Spinel property is used to set/get MAC key materials to and from RCP.
4781      *
4782      */
4783     SPINEL_PROP_RCP_MAC_KEY = SPINEL_PROP_RCP_EXT__BEGIN + 0,
4784 
4785     /// MAC Frame Counter
4786     /** Format: `L` for read and `Lb` or `L` for write
4787      *
4788      *  `L`: MAC frame counter
4789      *  'b': Optional boolean used only during write. If not provided, `false` is assumed.
4790      *       If `true` counter is set only if the new value is larger than current value.
4791      *       If `false` the new value is set as frame counter independent of the current value.
4792      *
4793      * The Spinel property is used to set MAC frame counter to RCP.
4794      *
4795      */
4796     SPINEL_PROP_RCP_MAC_FRAME_COUNTER = SPINEL_PROP_RCP_EXT__BEGIN + 1,
4797 
4798     /// Timestamps when Spinel frame is received and transmitted
4799     /** Format: `X`.
4800      *
4801      *  `X`: Spinel frame transmit timestamp
4802      *
4803      * The Spinel property is used to get timestamp from RCP to calculate host and RCP timer difference.
4804      *
4805      */
4806     SPINEL_PROP_RCP_TIMESTAMP = SPINEL_PROP_RCP_EXT__BEGIN + 2,
4807 
4808     /// Configure Enhanced ACK probing
4809     /** Format: `SEC` (Write-only).
4810      *
4811      * `S`: Short address
4812      * `E`: Extended address
4813      * `C`: List of requested metric ids encoded as bit fields in single byte
4814      *
4815      *   +---------------+----+
4816      *   |    Metric     | Id |
4817      *   +---------------+----+
4818      *   | Received PDUs |  0 |
4819      *   | LQI           |  1 |
4820      *   | Link margin   |  2 |
4821      *   | RSSI          |  3 |
4822      *   +---------------+----+
4823      *
4824      * Enable/disable or update Enhanced-ACK Based Probing in radio for a specific Initiator.
4825      *
4826      */
4827     SPINEL_PROP_RCP_ENH_ACK_PROBING = SPINEL_PROP_RCP_EXT__BEGIN + 3,
4828 
4829     /// CSL Accuracy
4830     /** Format: `C`
4831      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
4832      *
4833      * The current CSL rx/tx scheduling drift, in units of ± ppm.
4834      *
4835      */
4836     SPINEL_PROP_RCP_CSL_ACCURACY = SPINEL_PROP_RCP_EXT__BEGIN + 4,
4837 
4838     /// CSL Uncertainty
4839     /** Format: `C`
4840      * Required capability: `SPINEL_CAP_NET_THREAD_1_2`
4841      *
4842      * The current uncertainty, in units of 10 us, of the clock used for scheduling CSL operations.
4843      *
4844      */
4845     SPINEL_PROP_RCP_CSL_UNCERTAINTY = SPINEL_PROP_RCP_EXT__BEGIN + 5,
4846 
4847     SPINEL_PROP_RCP_EXT__END = 0x900,
4848 
4849     SPINEL_PROP_NEST__BEGIN = 0x3BC0,
4850 
4851     SPINEL_PROP_NEST_STREAM_MFG = SPINEL_PROP_NEST__BEGIN + 0,
4852 
4853     /// The legacy network ULA prefix (8 bytes).
4854     /** Format: 'D'
4855      *
4856      * This property is deprecated.
4857      *
4858      */
4859     SPINEL_PROP_NEST_LEGACY_ULA_PREFIX = SPINEL_PROP_NEST__BEGIN + 1,
4860 
4861     /// The EUI64 of last node joined using legacy protocol (if none, all zero EUI64 is returned).
4862     /** Format: 'E'
4863      *
4864      * This property is deprecated.
4865      *
4866      */
4867     SPINEL_PROP_NEST_LEGACY_LAST_NODE_JOINED = SPINEL_PROP_NEST__BEGIN + 2,
4868 
4869     SPINEL_PROP_NEST__END = 0x3C00,
4870 
4871     SPINEL_PROP_VENDOR__BEGIN = 0x3C00,
4872     SPINEL_PROP_VENDOR__END   = 0x4000,
4873 
4874     SPINEL_PROP_VENDOR_ESP__BEGIN = (SPINEL_PROP_VENDOR__BEGIN + 0),
4875     SPINEL_PROP_VENDOR_ESP__END   = (SPINEL_PROP_VENDOR__BEGIN + 128),
4876 
4877     SPINEL_PROP_DEBUG__BEGIN = 0x4000,
4878 
4879     /// Testing platform assert
4880     /** Format: 'b' (read-only)
4881      *
4882      * Reading this property will cause an assert on the NCP. This is intended for testing the assert functionality of
4883      * underlying platform/NCP. Assert should ideally cause the NCP to reset, but if this is not supported a `false`
4884      * boolean is returned in response.
4885      *
4886      */
4887     SPINEL_PROP_DEBUG_TEST_ASSERT = SPINEL_PROP_DEBUG__BEGIN + 0,
4888 
4889     /// The NCP log level.
4890     /** Format: `C` */
4891     SPINEL_PROP_DEBUG_NCP_LOG_LEVEL = SPINEL_PROP_DEBUG__BEGIN + 1,
4892 
4893     /// Testing platform watchdog
4894     /** Format: Empty  (read-only)
4895      *
4896      * Reading this property will causes NCP to start a `while(true) ;` loop and thus triggering a watchdog.
4897      *
4898      * This is intended for testing the watchdog functionality on the underlying platform/NCP.
4899      *
4900      */
4901     SPINEL_PROP_DEBUG_TEST_WATCHDOG = SPINEL_PROP_DEBUG__BEGIN + 2,
4902 
4903     /// The NCP timestamp base
4904     /** Format: X (write-only)
4905      *
4906      * This property controls the time base value that is used for logs timestamp field calculation.
4907      *
4908      */
4909     SPINEL_PROP_DEBUG_LOG_TIMESTAMP_BASE = SPINEL_PROP_DEBUG__BEGIN + 3,
4910 
4911     /// TREL Radio Link - test mode enable
4912     /** Format `b` (read-write)
4913      *
4914      * This property is intended for testing TREL (Thread Radio Encapsulation Link) radio type only (during simulation).
4915      * It allows the TREL interface to be temporarily disabled and (re)enabled.  While disabled all traffic through
4916      * TREL interface is dropped silently (to emulate a radio/interface down scenario).
4917      *
4918      * This property is only available when the TREL radio link type is supported.
4919      *
4920      */
4921     SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE = SPINEL_PROP_DEBUG__BEGIN + 4,
4922 
4923     SPINEL_PROP_DEBUG__END = 0x4400,
4924 
4925     SPINEL_PROP_EXPERIMENTAL__BEGIN = 2000000,
4926     SPINEL_PROP_EXPERIMENTAL__END   = 2097152,
4927 };
4928 
4929 typedef uint32_t spinel_prop_key_t;
4930 
4931 // ----------------------------------------------------------------------------
4932 
4933 #define SPINEL_HEADER_FLAG 0x80
4934 #define SPINEL_HEADER_FLAGS_SHIFT 6
4935 #define SPINEL_HEADER_FLAGS_MASK (3 << SPINEL_HEADER_FLAGS_SHIFT)
4936 #define SPINEL_HEADER_GET_FLAG(x) (((x)&SPINEL_HEADER_FLAGS_MASK) >> SPINEL_HEADER_FLAGS_SHIFT)
4937 
4938 #define SPINEL_HEADER_TID_SHIFT 0
4939 #define SPINEL_HEADER_TID_MASK (15 << SPINEL_HEADER_TID_SHIFT)
4940 
4941 #define SPINEL_HEADER_IID_SHIFT 4
4942 #define SPINEL_HEADER_IID_MASK (3 << SPINEL_HEADER_IID_SHIFT)
4943 
4944 #define SPINEL_HEADER_IID_0 (0 << SPINEL_HEADER_IID_SHIFT)
4945 #define SPINEL_HEADER_IID_1 (1 << SPINEL_HEADER_IID_SHIFT)
4946 #define SPINEL_HEADER_IID_2 (2 << SPINEL_HEADER_IID_SHIFT)
4947 #define SPINEL_HEADER_IID_3 (3 << SPINEL_HEADER_IID_SHIFT)
4948 
4949 #define SPINEL_HEADER_GET_IID(x) (((x)&SPINEL_HEADER_IID_MASK) >> SPINEL_HEADER_IID_SHIFT)
4950 #define SPINEL_HEADER_GET_TID(x) (spinel_tid_t)(((x)&SPINEL_HEADER_TID_MASK) >> SPINEL_HEADER_TID_SHIFT)
4951 
4952 #define SPINEL_GET_NEXT_TID(x) (spinel_tid_t)((x) >= 0xF ? 1 : (x) + 1)
4953 
4954 #define SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT 4
4955 
4956 #define SPINEL_BEACON_THREAD_FLAG_VERSION_MASK (0xf << SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT)
4957 
4958 #define SPINEL_BEACON_THREAD_FLAG_JOINABLE (1 << 0)
4959 
4960 #define SPINEL_BEACON_THREAD_FLAG_NATIVE (1 << 3)
4961 
4962 // ----------------------------------------------------------------------------
4963 
4964 enum
4965 {
4966     SPINEL_DATATYPE_NULL_C        = 0,
4967     SPINEL_DATATYPE_VOID_C        = '.',
4968     SPINEL_DATATYPE_BOOL_C        = 'b',
4969     SPINEL_DATATYPE_UINT8_C       = 'C',
4970     SPINEL_DATATYPE_INT8_C        = 'c',
4971     SPINEL_DATATYPE_UINT16_C      = 'S',
4972     SPINEL_DATATYPE_INT16_C       = 's',
4973     SPINEL_DATATYPE_UINT32_C      = 'L',
4974     SPINEL_DATATYPE_INT32_C       = 'l',
4975     SPINEL_DATATYPE_UINT64_C      = 'X',
4976     SPINEL_DATATYPE_INT64_C       = 'x',
4977     SPINEL_DATATYPE_UINT_PACKED_C = 'i',
4978     SPINEL_DATATYPE_IPv6ADDR_C    = '6',
4979     SPINEL_DATATYPE_EUI64_C       = 'E',
4980     SPINEL_DATATYPE_EUI48_C       = 'e',
4981     SPINEL_DATATYPE_DATA_WLEN_C   = 'd',
4982     SPINEL_DATATYPE_DATA_C        = 'D',
4983     SPINEL_DATATYPE_UTF8_C        = 'U', //!< Zero-Terminated UTF8-Encoded String
4984     SPINEL_DATATYPE_STRUCT_C      = 't',
4985     SPINEL_DATATYPE_ARRAY_C       = 'A',
4986 };
4987 
4988 typedef char spinel_datatype_t;
4989 
4990 #define SPINEL_DATATYPE_NULL_S ""
4991 #define SPINEL_DATATYPE_VOID_S "."
4992 #define SPINEL_DATATYPE_BOOL_S "b"
4993 #define SPINEL_DATATYPE_UINT8_S "C"
4994 #define SPINEL_DATATYPE_INT8_S "c"
4995 #define SPINEL_DATATYPE_UINT16_S "S"
4996 #define SPINEL_DATATYPE_INT16_S "s"
4997 #define SPINEL_DATATYPE_UINT32_S "L"
4998 #define SPINEL_DATATYPE_INT32_S "l"
4999 #define SPINEL_DATATYPE_UINT64_S "X"
5000 #define SPINEL_DATATYPE_INT64_S "x"
5001 #define SPINEL_DATATYPE_UINT_PACKED_S "i"
5002 #define SPINEL_DATATYPE_IPv6ADDR_S "6"
5003 #define SPINEL_DATATYPE_EUI64_S "E"
5004 #define SPINEL_DATATYPE_EUI48_S "e"
5005 #define SPINEL_DATATYPE_DATA_WLEN_S "d"
5006 #define SPINEL_DATATYPE_DATA_S "D"
5007 #define SPINEL_DATATYPE_UTF8_S "U" //!< Zero-Terminated UTF8-Encoded String
5008 
5009 #define SPINEL_DATATYPE_ARRAY_S(x) "A(" x ")"
5010 #define SPINEL_DATATYPE_STRUCT_S(x) "t(" x ")"
5011 
5012 #define SPINEL_DATATYPE_ARRAY_STRUCT_S(x) SPINEL_DATATYPE_ARRAY_S(SPINEL_DATATYPE_STRUCT_WLEN_S(x))
5013 
5014 #define SPINEL_DATATYPE_COMMAND_S                   \
5015     SPINEL_DATATYPE_UINT8_S           /* header  */ \
5016         SPINEL_DATATYPE_UINT_PACKED_S /* command */
5017 
5018 #define SPINEL_DATATYPE_COMMAND_PROP_S                    \
5019     SPINEL_DATATYPE_COMMAND_S         /* prop command  */ \
5020         SPINEL_DATATYPE_UINT_PACKED_S /* property id */
5021 
5022 #define SPINEL_MAX_UINT_PACKED 2097151
5023 
5024 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_pack(uint8_t      *data_out,
5025                                                       spinel_size_t data_len_max,
5026                                                       const char   *pack_format,
5027                                                       ...);
5028 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vpack(uint8_t      *data_out,
5029                                                        spinel_size_t data_len_max,
5030                                                        const char   *pack_format,
5031                                                        va_list       args);
5032 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack(const uint8_t *data_in,
5033                                                         spinel_size_t  data_len,
5034                                                         const char    *pack_format,
5035                                                         ...);
5036 /**
5037  * Parses spinel data similar to sscanf().
5038  *
5039  * Actually calls spinel_datatype_vunpack_in_place() to parse data.
5040  *
5041  * @param[in]   data_in     A pointer to the data to parse.
5042  * @param[in]   data_len    The length of @p data_in in bytes.
5043  * @param[in]   pack_format C string that contains a format string follows the same specification of spinel.
5044  * @param[in]   ...         Additional arguments depending on the format string @p pack_format.
5045  *
5046  * @returns The parsed length in bytes.
5047  *
5048  * @note This function behaves different from `spinel_datatype_unpack()`:
5049  *       - This function expects composite data arguments of pointer to data type, while `spinel_datatype_unpack()`
5050  *         expects them of pointer to data type pointer. For example, if `SPINEL_DATATYPE_EUI64_C` is present in
5051  *         @p pack_format, this function expects a `spinel_eui64_t *` is included in variable arguments, while
5052  *         `spinel_datatype_unpack()` expects a `spinel_eui64_t **` is included.
5053  *       - For `SPINEL_DATATYPE_UTF8_C`, this function expects two arguments, the first of type `char *` and the
5054  *         second is of type `size_t` to indicate length of the provided buffer in the first argument just like
5055  *         `strncpy()`, while `spinel_datatype_unpack()` only expects a `const char **`.
5056  *
5057  * @sa spinel_datatype_vunpack_in_place()
5058  *
5059  */
5060 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack_in_place(const uint8_t *data_in,
5061                                                                  spinel_size_t  data_len,
5062                                                                  const char    *pack_format,
5063                                                                  ...);
5064 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack(const uint8_t *data_in,
5065                                                          spinel_size_t  data_len,
5066                                                          const char    *pack_format,
5067                                                          va_list        args);
5068 /**
5069  * Parses spinel data similar to vsscanf().
5070  *
5071  * @param[in]   data_in     A pointer to the data to parse.
5072  * @param[in]   data_len    The length of @p data_in in bytes.
5073  * @param[in]   pack_format C string that contains a format string follows the same specification of spinel.
5074  * @param[in]   args        A value identifying a variable arguments list.
5075  *
5076  * @returns The parsed length in bytes.
5077  *
5078  * @note This function behaves different from `spinel_datatype_vunpack()`:
5079  *       - This function expects composite data arguments of pointer to data type, while `spinel_datatype_vunpack()`
5080  *         expects them of pointer to data type pointer. For example, if `SPINEL_DATATYPE_EUI64_C` is present in
5081  *         @p pack_format, this function expects a `spinel_eui64_t *` is included in variable arguments, while
5082  *         `spinel_datatype_vunpack()` expects a `spinel_eui64_t **` is included.
5083  *       - For `SPINEL_DATATYPE_UTF8_C`, this function expects two arguments, the first of type `char *` and the
5084  *         second is of type `size_t` to indicate length of the provided buffer in the first argument just like
5085  *         `strncpy()`, while `spinel_datatype_vunpack()` only expects a `const char **`.
5086  *
5087  * @sa spinel_datatype_unpack_in_place()
5088  *
5089  */
5090 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack_in_place(const uint8_t *data_in,
5091                                                                   spinel_size_t  data_len,
5092                                                                   const char    *pack_format,
5093                                                                   va_list        args);
5094 
5095 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_decode(const uint8_t *bytes,
5096                                                            spinel_size_t  len,
5097                                                            unsigned int  *value_ptr);
5098 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_encode(uint8_t *bytes, spinel_size_t len, unsigned int value);
5099 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_size(unsigned int value);
5100 
5101 SPINEL_API_EXTERN const char *spinel_next_packed_datatype(const char *pack_format);
5102 
5103 // ----------------------------------------------------------------------------
5104 
5105 SPINEL_API_EXTERN const char *spinel_command_to_cstr(spinel_command_t command);
5106 
5107 SPINEL_API_EXTERN const char *spinel_prop_key_to_cstr(spinel_prop_key_t prop_key);
5108 
5109 SPINEL_API_EXTERN const char *spinel_net_role_to_cstr(uint8_t net_role);
5110 
5111 SPINEL_API_EXTERN const char *spinel_mcu_power_state_to_cstr(uint8_t mcu_power_state);
5112 
5113 SPINEL_API_EXTERN const char *spinel_status_to_cstr(spinel_status_t status);
5114 
5115 SPINEL_API_EXTERN const char *spinel_capability_to_cstr(spinel_capability_t capability);
5116 
5117 SPINEL_API_EXTERN const char *spinel_radio_link_to_cstr(uint32_t radio);
5118 
5119 SPINEL_API_EXTERN const char *spinel_link_metrics_status_to_cstr(uint8_t status);
5120 
5121 // ----------------------------------------------------------------------------
5122 
5123 #if defined(__cplusplus)
5124 }
5125 #endif
5126 
5127 #endif /* defined(SPINEL_HEADER_INCLUDED) */
5128