OpenThread  1.05.03.02
spinel.h
Go to the documentation of this file.
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 
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  *
325  * - On start, host implementation queries the RCP API version and accepts
326  * any version number from SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION up to
327  * and including SPINEL_RCP_API_VERSION.
328  *
329  * ---------------------------------------------------------------------------
330  */
331 
332 #ifdef SPINEL_PLATFORM_HEADER
333 #include SPINEL_PLATFORM_HEADER
334 #else // ifdef SPINEL_PLATFORM_HEADER
335 #include <stdarg.h>
336 #include <stdbool.h>
337 #include <stdint.h>
338 #endif // else SPINEL_PLATFORM_HEADER
339 
340 // ----------------------------------------------------------------------------
341 
342 #ifndef DOXYGEN_SHOULD_SKIP_THIS
343 
344 #if defined(__GNUC__)
345 #define SPINEL_API_EXTERN extern __attribute__((visibility("default")))
346 #define SPINEL_API_NONNULL_ALL __attribute__((nonnull))
347 #define SPINEL_API_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
348 #endif // ifdef __GNUC__
349 
350 #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS
351 
352 #ifndef SPINEL_API_EXTERN
353 #define SPINEL_API_EXTERN extern
354 #endif
355 
356 #ifndef SPINEL_API_NONNULL_ALL
357 #define SPINEL_API_NONNULL_ALL
358 #endif
359 
360 #ifndef SPINEL_API_WARN_UNUSED_RESULT
361 #define SPINEL_API_WARN_UNUSED_RESULT
362 #endif
363 
364 // ----------------------------------------------------------------------------
365 
366 #define SPINEL_PROTOCOL_VERSION_THREAD_MAJOR 4
367 #define SPINEL_PROTOCOL_VERSION_THREAD_MINOR 3
368 
380 #define SPINEL_RCP_API_VERSION 6
381 
392 #define SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION 4
393 
400 #define SPINEL_FRAME_MAX_SIZE 1300
401 
408 #define SPINEL_FRAME_MAX_COMMAND_HEADER_SIZE 4
409 
416 #define SPINEL_FRAME_MAX_COMMAND_PAYLOAD_SIZE (SPINEL_FRAME_MAX_SIZE - SPINEL_FRAME_MAX_COMMAND_HEADER_SIZE)
417 
425 #define SPINEL_ENCRYPTER_EXTRA_DATA_SIZE 0
426 
434 #define SPINEL_FRAME_BUFFER_SIZE (SPINEL_FRAME_MAX_SIZE + SPINEL_ENCRYPTER_EXTRA_DATA_SIZE)
435 
437 #define SPINEL_BIT_MASK(bit_index, field_bit_count) ((1 << ((field_bit_count)-1)) >> (bit_index))
438 
439 // ----------------------------------------------------------------------------
440 
441 #if defined(__cplusplus)
442 extern "C" {
443 #endif
444 
445 enum
446 {
472 
474 
476 
485 
487 
495 
497 
502 
504 
508 
510 
514 
516 
520 
522 
534 
537 
540 
543 };
544 
545 typedef uint32_t spinel_status_t;
546 
547 typedef enum
548 {
554 
555 typedef enum
556 {
562 
563 typedef enum
564 {
570 
571 typedef enum
572 {
577 
578 // The `spinel_power_state_t` enumeration and `POWER_STATE`
579 // property are deprecated. Please use `MCU_POWER_STATE`
580 // instead.
581 typedef enum
582 {
589 
590 typedef enum
591 {
598 
599 typedef enum
600 {
608 
609 enum
610 {
617 
620 };
621 
622 enum
623 {
626 };
627 
628 enum
629 {
633 };
634 
635 enum
636 {
638 };
639 
640 enum
641 {
646 };
647 
648 enum
649 {
659 };
660 
661 enum
662 {
666 };
667 
668 enum
669 {
673 };
674 
675 enum
676 {
685 };
686 
687 enum
688 {
713 };
714 
715 enum
716 {
720 };
721 
722 enum
723 {
724  SPINEL_ADDRESS_CACHE_ENTRY_STATE_CACHED = 0, // Entry is cached and in-use.
725  SPINEL_ADDRESS_CACHE_ENTRY_STATE_SNOOPED = 1, // Entry is created by snoop optimization.
726  SPINEL_ADDRESS_CACHE_ENTRY_STATE_QUERY = 2, // Entry represents an ongoing query for the EID.
727  SPINEL_ADDRESS_CACHE_ENTRY_STATE_RETRY_QUERY = 3, // Entry is in retry mode (a prior query did not a response).
728 };
729 
730 enum
731 {
734 };
735 
736 // Statuses that can be received as a result of:
737 // @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY
738 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK
739 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD
740 enum
741 {
748 };
749 
750 // Metric ids used for:
751 // @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY
752 // @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT
753 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK
754 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD
755 // @ref SPINEL_PROP_RCP_ENH_ACK_PROBING
756 enum
757 {
762 };
763 
764 // Frame types used for:
765 // @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD
766 enum
767 {
772 };
773 
774 // Parameter ids used for:
775 // @ref SPINEL_PROP_THREAD_MLR_REQUEST
776 enum
777 {
779 };
780 
781 // Backbone Router states used for:
782 // @ref SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_STATE
783 enum
784 {
788 };
789 
790 typedef enum
791 {
792  SPINEL_SRP_CLIENT_ITEM_STATE_TO_ADD = 0, // Item to be added/registered.
793  SPINEL_SRP_CLIENT_ITEM_STATE_ADDING = 1, // Item is being added/registered.
794  SPINEL_SRP_CLIENT_ITEM_STATE_TO_REFRESH = 2, // Item to be refreshed (re-register to renew lease).
795  SPINEL_SRP_CLIENT_ITEM_STATE_REFRESHING = 3, // Item is being refreshed.
796  SPINEL_SRP_CLIENT_ITEM_STATE_TO_REMOVE = 4, // Item to be removed.
797  SPINEL_SRP_CLIENT_ITEM_STATE_REMOVING = 5, // Item is being removed.
798  SPINEL_SRP_CLIENT_ITEM_STATE_REGISTERED = 6, // Item is registered with server.
799  SPINEL_SRP_CLIENT_ITEM_STATE_REMOVED = 7, // Item is removed.
801 
802 typedef enum
803 {
805  SPINEL_SRP_CLIENT_ERROR_PARSE = 1, // Server unable to interpret due to format error.
806  SPINEL_SRP_CLIENT_ERROR_FAILED = 2, // Server encountered an internal failure.
807  SPINEL_SRP_CLIENT_ERROR_NOT_FOUND = 3, // Name that ought to exist, does not exists.
808  SPINEL_SRP_CLIENT_ERROR_NOT_IMPLEMENTED = 4, // Server does not support the query type.
809  SPINEL_SRP_CLIENT_ERROR_SECURITY = 5, // Service is not authoritative for zone.
810  SPINEL_SRP_CLIENT_ERROR_DUPLICATED = 6, // Some name that ought not to exist, does exist.
811  SPINEL_SRP_CLIENT_ERROR_RESPONSE_TIMEOUT = 7, // Timed out waiting for response from server (client would retry).
812  SPINEL_SRP_CLIENT_ERROR_INVALID_ARGS = 8, // Invalid args (e.g., bad service name or TXT-DATA).
813  SPINEL_SRP_CLIENT_ERROR_NO_BUFS = 9, // No buffer to send the SRP update message.
815 
816 typedef struct
817 {
818  uint8_t bytes[8];
820 
821 typedef struct
822 {
823  uint8_t bytes[8];
825 
826 typedef struct
827 {
828  uint8_t bytes[16];
830 
831 typedef struct
832 {
833  uint8_t bytes[6];
835 
836 typedef struct
837 {
838  uint8_t bytes[16];
840 
841 typedef int spinel_ssize_t;
842 typedef unsigned int spinel_size_t;
843 typedef uint8_t spinel_tid_t;
844 
845 enum
846 {
847  SPINEL_MD_FLAG_TX = 0x0001,
853 };
854 
855 enum
856 {
859 };
860 
861 enum
862 {
876 
896 
914 
938 
971 
1004 
1022 
1051 
1082 
1083  SPINEL_CMD_NET_SAVE = 9, // Deprecated
1084 
1100 
1101  SPINEL_CMD_NET_RECALL = 11, // Deprecated
1102 
1122 
1141 
1157 
1173 
1177 
1180 
1183 
1186 };
1187 
1188 typedef uint32_t spinel_command_t;
1189 
1190 enum
1191 {
1196 
1199 
1201 
1209 
1223 
1229 
1234 
1240 
1244 
1264 
1276 
1282 
1285 
1288 };
1289 
1290 typedef uint32_t spinel_capability_t;
1291 
1321 enum
1322 {
1324 
1338 
1340 
1354 
1356 
1363 
1365 
1379 
1381 
1387 
1389 
1398 
1400 
1408 
1410 
1412 
1418 
1422 
1424 
1480 
1482 
1524 
1526 
1528 
1571 
1573 
1608 
1610 
1622 
1624 
1636 
1639 
1642 
1645 
1647 
1661 
1663 
1676 
1678 
1691 
1693 
1699 
1705 
1707 
1709 
1711 
1717 
1719 
1727 
1729 
1737 
1739 
1746 
1748 
1759 
1761 
1772 
1774 
1786 
1788 
1800 
1802 
1815 
1817 
1828 
1830 
1848 
1850 
1858 
1860 
1897 
1899 
1906 
1908 
1910 
1912 
1936 
1938 
1944 
1946 
1951 
1953 
1980 
1982 
1988 
1990 
1996 
1998 
2004 
2006 
2013 
2015 
2032 
2034 
2044 
2046 
2060 
2062 
2064 
2066 
2079 
2081 
2086 
2088 
2093 
2095 
2105 
2107 
2112 
2114 
2119 
2121 
2130 
2132 
2136 
2138 
2147 
2149 
2157 
2159 
2165 
2167 
2174 
2176 
2178 
2180 
2186 
2188 
2195 
2197 
2204 
2206 
2217 
2219 
2223 
2225 
2229 
2231 
2235 
2237 
2241 
2243 
2250 
2252 
2271 
2273 
2277 
2279 
2283 
2285 
2288 
2290 
2292 
2296 
2298 
2313 
2315 
2331 
2333 
2339 
2341 
2347 
2349 
2355 
2357 
2361 
2363 
2367 
2369 
2373 
2375 
2379 
2381 
2400 
2402 
2423 
2425 
2430 
2432 
2439 
2441 
2452 
2454 
2456 
2458 
2464 
2466 
2470 
2472 
2476 
2478 
2482 
2484 
2488 
2490 
2498 
2500 
2509 
2511 
2519 
2521 
2525 
2527 
2531 
2533 
2543 
2545 
2562 
2564 
2572 
2574 
2578 
2580 
2584 
2586 
2593 
2595 
2603 
2605 
2612 
2614 
2621 
2623 
2631 
2633 
2639 
2641 
2647 
2649 
2665 
2667 
2683 
2685 
2714 
2716 
2730 
2732 
2747 
2749 
2760 
2762 
2775 
2777 
2787 
2789 
2802 
2804 
2823 
2825 
2838 
2840 
2853 
2855 
2877 
2879 
2902 
2904 
2916 
2918 
2936 
2938 
2948 
2950 
2962 
2964 
2990 
2992 
2998 
3000 
3006 
3008 
3016 
3018 
3026 
3028 
3050 
3052 
3073 
3075 
3086 
3088 
3112 
3114 
3134 
3136 
3169 
3171 
3180 
3182 
3207 
3209 
3220 
3222 
3235 
3237 
3248 
3250 
3260 
3262 
3272 
3274 
3282 
3284 
3292 
3294 
3296 
3298 
3302 
3304 
3308 
3310 
3319 
3321 
3334 
3337 
3339 
3347 
3349 
3355 
3357 
3375 
3377 
3380 
3382 
3384 
3399 
3401 
3464 
3466 
3492 
3494 
3520 
3522 
3545 
3547 
3550 
3552 
3553  // Thread Joiner State
3563 
3565 
3602 
3603  // Thread Commissioner State
3612 
3613  // Thread Commissioner Joiners
3635 
3636  // Thread Commissioner Provisioning URL
3643 
3644  // Thread Commissioner Session ID
3651 
3653 
3677 
3679 
3681 
3682  // Thread Commissioner Announce Begin
3697 
3698  // Thread Commissioner Energy Scan Query
3717 
3718  // Thread Commissioner Energy Scan Result
3733 
3734  // Thread Commissioner PAN ID Query
3751 
3752  // Thread Commissioner PAN ID Conflict Result
3767 
3768  // Thread Commissioner Send MGMT_COMMISSIONER_GET
3782 
3783  // Thread Commissioner Send MGMT_COMMISSIONER_SET
3797 
3798  // Thread Commissioner Generate PSKc
3820 
3822 
3824 
3826 
3839 
3841 
3855 
3857 
3865 
3867 
3875 
3877 
3901 
3903 
3914 
3916 
3925 
3927 
3936 
3938 
3946 
3948 
3956 
3958 
3973 
3975 
3991 
3992  // RCP (NCP in radio only mode) version
4002 
4004 
4020 
4022 
4031 
4032  // Supported Radio Links (by device)
4041 
4043 
4059 
4061 
4078 
4080 
4087 
4089 
4096 
4098 
4109 
4111 
4116 
4118 
4123 
4125 
4150 
4152 
4165 
4167 
4175 
4177 
4207 
4209 
4223 
4225 
4227 
4229 
4238 
4239  // Server Services
4256 
4257  // Server Leader Services
4273 
4275 
4277 
4279 
4289 
4291 
4293 
4295 
4317 
4319 
4330 
4332 
4334  // For direct access to the 802.15.4 PID.
4335  // Individual registers are fetched using
4336  // `SPINEL_PROP_15_4_PIB__BEGIN+[PIB_IDENTIFIER]`
4337  // Only supported if SPINEL_CAP_15_4_PIB is set.
4338  //
4339  // For brevity, the entire 802.15.4 PIB space is
4340  // not defined here, but a few choice attributes
4341  // are defined for illustration and convenience.
4346 
4348 
4350 
4356 
4358 
4360 
4362 
4364 
4366 
4368 
4370 
4372 
4374 
4376 
4378 
4380 
4382 
4384 
4386 
4388 
4390 
4392 
4394 
4396 
4398 
4400 
4402 
4404 
4406 
4408 
4410 
4412 
4414 
4416 
4418 
4420 
4422 
4424 
4426 
4428 
4430 
4432 
4434 
4436 
4438 
4440 
4442 
4444 
4446 
4448 
4450 
4452 
4454 
4456 
4458 
4460 
4462 
4464 
4466 
4468 
4470 
4472 
4474 
4476 
4478 
4480 
4482 
4484 
4486 
4488 
4490 
4492 
4494 
4496 
4498 
4500 
4502 
4504 
4506 
4508 
4510 
4512 
4514 
4516 
4518 
4520 
4522 
4524 
4526 
4528 
4530 
4532 
4534 
4536 
4538 
4557 
4559 
4610 
4612 
4628 
4630 
4648 
4650 
4677 
4679 
4681 
4683 
4695 
4697 
4705 
4707 
4715 
4717 
4736 
4738 
4745 
4747 
4754 
4756 
4758 
4760 
4762 
4764 
4766 
4768 
4770 
4773 
4776 
4778 
4780 
4788 
4790 
4792 
4794 
4802 
4804 
4810 
4812 
4822 
4824 
4827 };
4828 
4829 typedef uint32_t spinel_prop_key_t;
4830 
4831 // ----------------------------------------------------------------------------
4832 
4833 #define SPINEL_HEADER_FLAG 0x80
4834 
4835 #define SPINEL_HEADER_TID_SHIFT 0
4836 #define SPINEL_HEADER_TID_MASK (15 << SPINEL_HEADER_TID_SHIFT)
4837 
4838 #define SPINEL_HEADER_IID_SHIFT 4
4839 #define SPINEL_HEADER_IID_MASK (3 << SPINEL_HEADER_IID_SHIFT)
4840 
4841 #define SPINEL_HEADER_IID_0 (0 << SPINEL_HEADER_IID_SHIFT)
4842 #define SPINEL_HEADER_IID_1 (1 << SPINEL_HEADER_IID_SHIFT)
4843 #define SPINEL_HEADER_IID_2 (2 << SPINEL_HEADER_IID_SHIFT)
4844 #define SPINEL_HEADER_IID_3 (3 << SPINEL_HEADER_IID_SHIFT)
4845 
4846 #define SPINEL_HEADER_GET_IID(x) (((x)&SPINEL_HEADER_IID_MASK) >> SPINEL_HEADER_IID_SHIFT)
4847 #define SPINEL_HEADER_GET_TID(x) (spinel_tid_t)(((x)&SPINEL_HEADER_TID_MASK) >> SPINEL_HEADER_TID_SHIFT)
4848 
4849 #define SPINEL_GET_NEXT_TID(x) (spinel_tid_t)((x) >= 0xF ? 1 : (x) + 1)
4850 
4851 #define SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT 4
4852 
4853 #define SPINEL_BEACON_THREAD_FLAG_VERSION_MASK (0xf << SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT)
4854 
4855 #define SPINEL_BEACON_THREAD_FLAG_JOINABLE (1 << 0)
4856 
4857 #define SPINEL_BEACON_THREAD_FLAG_NATIVE (1 << 3)
4858 
4859 // ----------------------------------------------------------------------------
4860 
4861 enum
4862 {
4883 };
4884 
4885 typedef char spinel_datatype_t;
4886 
4887 #define SPINEL_DATATYPE_NULL_S ""
4888 #define SPINEL_DATATYPE_VOID_S "."
4889 #define SPINEL_DATATYPE_BOOL_S "b"
4890 #define SPINEL_DATATYPE_UINT8_S "C"
4891 #define SPINEL_DATATYPE_INT8_S "c"
4892 #define SPINEL_DATATYPE_UINT16_S "S"
4893 #define SPINEL_DATATYPE_INT16_S "s"
4894 #define SPINEL_DATATYPE_UINT32_S "L"
4895 #define SPINEL_DATATYPE_INT32_S "l"
4896 #define SPINEL_DATATYPE_UINT64_S "X"
4897 #define SPINEL_DATATYPE_INT64_S "x"
4898 #define SPINEL_DATATYPE_UINT_PACKED_S "i"
4899 #define SPINEL_DATATYPE_IPv6ADDR_S "6"
4900 #define SPINEL_DATATYPE_EUI64_S "E"
4901 #define SPINEL_DATATYPE_EUI48_S "e"
4902 #define SPINEL_DATATYPE_DATA_WLEN_S "d"
4903 #define SPINEL_DATATYPE_DATA_S "D"
4904 #define SPINEL_DATATYPE_UTF8_S "U"
4905 
4906 #define SPINEL_DATATYPE_ARRAY_S(x) "A(" x ")"
4907 #define SPINEL_DATATYPE_STRUCT_S(x) "t(" x ")"
4908 
4909 #define SPINEL_DATATYPE_ARRAY_STRUCT_S(x) SPINEL_DATATYPE_ARRAY_S(SPINEL_DATATYPE_STRUCT_WLEN_S(x))
4910 
4911 #define SPINEL_DATATYPE_COMMAND_S \
4912  SPINEL_DATATYPE_UINT8_S /* header */ \
4913  SPINEL_DATATYPE_UINT_PACKED_S /* command */
4914 
4915 #define SPINEL_DATATYPE_COMMAND_PROP_S \
4916  SPINEL_DATATYPE_COMMAND_S /* prop command */ \
4917  SPINEL_DATATYPE_UINT_PACKED_S /* property id */
4918 
4919 #define SPINEL_MAX_UINT_PACKED 2097151
4920 
4921 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_pack(uint8_t * data_out,
4922  spinel_size_t data_len_max,
4923  const char * pack_format,
4924  ...);
4925 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vpack(uint8_t * data_out,
4926  spinel_size_t data_len_max,
4927  const char * pack_format,
4928  va_list args);
4929 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack(const uint8_t *data_in,
4930  spinel_size_t data_len,
4931  const char * pack_format,
4932  ...);
4957 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack_in_place(const uint8_t *data_in,
4958  spinel_size_t data_len,
4959  const char * pack_format,
4960  ...);
4961 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack(const uint8_t *data_in,
4962  spinel_size_t data_len,
4963  const char * pack_format,
4964  va_list args);
4987 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack_in_place(const uint8_t *data_in,
4988  spinel_size_t data_len,
4989  const char * pack_format,
4990  va_list args);
4991 
4992 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_decode(const uint8_t *bytes,
4993  spinel_size_t len,
4994  unsigned int * value_ptr);
4995 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_encode(uint8_t *bytes, spinel_size_t len, unsigned int value);
4996 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_size(unsigned int value);
4997 
4998 SPINEL_API_EXTERN const char *spinel_next_packed_datatype(const char *pack_format);
4999 
5000 // ----------------------------------------------------------------------------
5001 
5002 SPINEL_API_EXTERN const char *spinel_command_to_cstr(spinel_command_t command);
5003 
5004 SPINEL_API_EXTERN const char *spinel_prop_key_to_cstr(spinel_prop_key_t prop_key);
5005 
5006 SPINEL_API_EXTERN const char *spinel_net_role_to_cstr(uint8_t net_role);
5007 
5008 SPINEL_API_EXTERN const char *spinel_mcu_power_state_to_cstr(uint8_t mcu_power_state);
5009 
5010 SPINEL_API_EXTERN const char *spinel_status_to_cstr(spinel_status_t status);
5011 
5012 SPINEL_API_EXTERN const char *spinel_capability_to_cstr(spinel_capability_t capability);
5013 
5014 SPINEL_API_EXTERN const char *spinel_radio_link_to_cstr(uint32_t radio);
5015 
5016 SPINEL_API_EXTERN const char *spinel_link_metrics_status_to_cstr(uint8_t status);
5017 
5018 // ----------------------------------------------------------------------------
5019 
5020 #if defined(__cplusplus)
5021 }
5022 #endif
5023 
5024 #endif /* defined(SPINEL_HEADER_INCLUDED) */
Definition: spinel.h:586
SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack(const uint8_t *data_in, spinel_size_t data_len, const char *pack_format, va_list args)
Definition: spinel.c:747
Definition: spinel.h:1120
The total number of received packets.
Definition: spinel.h:4415
Definition: spinel.h:1174
Definition: spinel.h:913
Definition: spinel.h:1679
Definition: spinel.h:565
Definition: spinel.h:1273
Thread Commissioner Enable.
Definition: spinel.h:2602
Send MGMT_SET Thread Active Operational Dataset.
Definition: spinel.h:2746
An internal runtime error has occurred.
Definition: spinel.h:454
GPIO Configuration.
Definition: spinel.h:1570
Region code.
Definition: spinel.h:1704
Definition: spinel.h:1677
Definition: spinel.h:692
MAC Source Match Enabled Flag.
Definition: spinel.h:2104
Definition: spinel.h:836
Definition: spinel.h:4870
Definition: spinel.h:742
Definition: spinel.h:813
SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_encode(uint8_t *bytes, spinel_size_t len, unsigned int value)
Definition: spinel.c:293
Definition: spinel.h:711
Definition: spinel.h:799
Definition: spinel.h:567
The number of dropped (not transmitted) IP messages.
Definition: spinel.h:4491
Definition: spinel.h:1232
Definition: spinel.h:552
#define SPINEL_API_EXTERN
Definition: spinel.h:353
Definition: spinel.h:771
Definition: spinel.h:4333
Definition: spinel.h:4878
Signal Jamming Detection Enable.
Definition: spinel.h:1716
Definition: spinel.h:1050
Definition: spinel.h:2063
Definition: spinel.h:1277
Definition: spinel.h:550
MAC Source Match Extended Address List.
Definition: spinel.h:2118
The total number of insecure transmitted IP messages.
Definition: spinel.h:4487
[b]
Definition: spinel.h:1680
Definition: spinel.h:1238
The total number of secure transmitted IP messages.
Definition: spinel.h:4483
Thread Local Stable Network Data Version.
Definition: spinel.h:2378
spinel_srp_client_item_state_t
Definition: spinel.h:790
Jamming detection RSSI threshold.
Definition: spinel.h:1736
spinel_scan_state_t
Definition: spinel.h:563
Multicast Listeners Register Response.
Definition: spinel.h:3219
Definition: spinel.h:4771
Definition: spinel.h:4769
Definition: spinel.h:1200
The number of received packets whose source address is invalid.
Definition: spinel.h:4455
Definition: spinel.h:684
Definition: spinel.h:1242
Definition: spinel.h:1257
Definition: spinel.h:1221
Channel Manager - Channel Change Delay.
Definition: spinel.h:3854
Definition: spinel.h:3546
Definition: spinel.h:1212
Definition: spinel.h:536
NCP Version.
Definition: spinel.h:1362
Thread time synchronization period.
Definition: spinel.h:3945
Definition: spinel.h:759
Definition: spinel.h:1272
Definition: spinel.h:575
Definition: spinel.h:1233
Definition: spinel.h:4774
Definition: spinel.h:4772
NCP Unsolicited update filter.
Definition: spinel.h:1660
Definition: spinel.h:1210
Definition: spinel.h:1003
Definition: spinel.h:678
MAC Scan Channel Period.
Definition: spinel.h:1950
Channel Manager Favored Channels.
Definition: spinel.h:3874
Definition: spinel.h:4040
Definition: spinel.h:1270
Thread Leader Weight.
Definition: spinel.h:2346
Definition: spinel.h:1909
The message buffer counter info.
Definition: spinel.h:4556
The total number of insecure received IP message.
Definition: spinel.h:4499
Thread Context Reuse Delay.
Definition: spinel.h:2481
Operational Dataset Pending Timestamp.
Definition: spinel.h:2786
Packet seems to be a duplicate.
Definition: spinel.h:849
unsigned int spinel_size_t
Definition: spinel.h:842
Link metrics query.
Definition: spinel.h:3049
int spinel_ssize_t
Definition: spinel.h:841
MAC Data Poll Period.
Definition: spinel.h:2059
Definition: spinel.h:702
Definition: spinel.h:1117
Definition: spinel.h:712
Definition: spinel.h:529
A security/authentication error has occurred.
Definition: spinel.h:455
Thread Network Key.
Definition: spinel.h:2234
spinel_srp_client_error_t
Definition: spinel.h:802
No response received from remote node.
Definition: spinel.h:471
The number of failed Tx IP packets.
Definition: spinel.h:4531
NCP&#39;s MCU Power State.
Definition: spinel.h:1523
Definition: spinel.h:4775
SPINEL_API_EXTERN const char * spinel_link_metrics_status_to_cstr(uint8_t status)
Raw Stream.
Definition: spinel.h:3463
[A(C)]
Definition: spinel.h:1689
Definition: spinel.h:793
Configure Enhanced ACK probing.
Definition: spinel.h:4735
NCP Vendor ID.
Definition: spinel.h:1386
Definition: spinel.h:1222
An argument to the operation is invalid.
Definition: spinel.h:450
Definition: spinel.h:533
Definition: spinel.h:4276
MAC Max indirect retry number.
Definition: spinel.h:2173
Local Thread 1.2 Backbone Router configuration.
Definition: spinel.h:3271
Definition: spinel.h:1236
The number of received spinel frames.
Definition: spinel.h:4511
Definition: spinel.h:708
The number of transmitted data poll.
Definition: spinel.h:4379
All decoded MAC packets are passed up the stack.
Definition: spinel.h:672
Enable EUI64 filtering for discovery scan operation.
Definition: spinel.h:2638
Flags reserved for future use.
Definition: spinel.h:852
MAC Promiscuous Mode.
Definition: spinel.h:2031
The number of broadcast packets received.
Definition: spinel.h:4479
Definition: spinel.h:2175
Forward IPv6 packets that use RLOC16 addresses to HOST.
Definition: spinel.h:2508
Definition: spinel.h:1101
Mesh Local IPv6 Address.
Definition: spinel.h:3307
MAC Allowlist.
Definition: spinel.h:2078
Zero-Terminated UTF8-Encoded String.
Definition: spinel.h:4880
Definition: spinel.h:1525
IPv6 ICMP Ping Offload.
Definition: spinel.h:3346
Definition: spinel.h:970
The number of received duplicated.
Definition: spinel.h:4471
Definition: spinel.h:4871
Definition: spinel.h:1224
spinel_net_role_t
Definition: spinel.h:547
Definition: spinel.h:1279
Definition: spinel.h:4874
MAC Source Match Short Address List.
Definition: spinel.h:2111
Definition: spinel.h:699
Thread Max Child Count.
Definition: spinel.h:2571
32-bit random number from TRNG, ready-to-use.
Definition: spinel.h:1638
Definition: spinel.h:1182
16 random bytes from TRNG, ready-to-use.
Definition: spinel.h:1641
Definition: spinel.h:1246
Definition: spinel.h:524
Definition: spinel.h:4882
Definition: spinel.h:1204
Multicast Listeners Register Request.
Definition: spinel.h:3206
Definition: spinel.h:2286
Definition: spinel.h:1255
(IPv6) Network Stream Insecure
Definition: spinel.h:3519
SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_size(unsigned int value)
Definition: spinel.c:265
Channel Manager Auto Channel Selection Interval.
Definition: spinel.h:3924
Thread Router Downgrade Threshold.
Definition: spinel.h:2524
Neighbor Table Frame and Message Error Rates.
Definition: spinel.h:2876
Definition: spinel.h:1211
Definition: spinel.h:857
Definition: spinel.h:4881
Definition: spinel.h:1241
Definition: spinel.h:3549
Definition: spinel.h:663
Thread Network Name.
Definition: spinel.h:2222
uint32_t spinel_prop_key_t
Definition: spinel.h:4829
Definition: spinel.h:1156
Definition: spinel.h:1261
On-Mesh Prefixes.
Definition: spinel.h:2399
SRP Client Services.
Definition: spinel.h:4149
Channel monitoring RSSI threshold.
Definition: spinel.h:1799
Definition: spinel.h:535
Definition: spinel.h:4864
Interface Identifier specified for Thread Domain Unicast Address.
Definition: spinel.h:3234
Definition: spinel.h:807
spinel_host_power_state_t
Definition: spinel.h:590
Child table addresses.
Definition: spinel.h:2852
The number of transmitted beacon request.
Definition: spinel.h:4387
Definition: spinel.h:1248
Definition: spinel.h:1266
The number of received packets filtered by allowlist.
Definition: spinel.h:4439
Thread New Operational Dataset.
Definition: spinel.h:2989
Packet was acknowledged with frame pending set.
Definition: spinel.h:850
No response in expecting time.
Definition: spinel.h:513
Definition: spinel.h:1280
PowerState [C] (deprecated, use MCU_POWER_STATE instead).
Definition: spinel.h:1409
MAC Allowlist Enabled Flag.
Definition: spinel.h:2085
Definition: spinel.h:3376
SRP Client Event.
Definition: spinel.h:4206
Definition: spinel.h:4331
Definition: spinel.h:1251
Definition: spinel.h:560
Definition: spinel.h:4879
[b]
Definition: spinel.h:1688
Definition: spinel.h:606
Definition: spinel.h:1253
Definition: spinel.h:664
Definition: spinel.h:1256
SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack(const uint8_t *data_in, spinel_size_t data_len, const char *pack_format,...)
Definition: spinel.c:720
Debug Stream.
Definition: spinel.h:3398
Thread Child Table.
Definition: spinel.h:2330
Thread UDP forward stream.
Definition: spinel.h:2915
Thread Pending Operational Dataset.
Definition: spinel.h:2729
Definition: spinel.h:1216
Thread Router Upgrade Threshold.
Definition: spinel.h:2475
Definition: spinel.h:4867
Definition: spinel.h:1230
Max offload mem [S] (not supported)
Definition: spinel.h:1420
SPINEL_API_EXTERN const char * spinel_status_to_cstr(spinel_status_t status)
Definition: spinel.c:1522
Radio Coex Enable.
Definition: spinel.h:1905
Definition: spinel.h:655
Definition: spinel.h:2284
UART Bitrate.
Definition: spinel.h:4316
Thread Local Network Data.
Definition: spinel.h:2360
The number of transmissions without ack request.
Definition: spinel.h:4371
Definition: spinel.h:665
The number of received beacon request.
Definition: spinel.h:4431
Definition: spinel.h:691
The number of received packets that are empty.
Definition: spinel.h:4447
Definition: spinel.h:1203
The number of received packets with a security error.
Definition: spinel.h:4459
Radio caps.
Definition: spinel.h:1857
Definition: spinel.h:706
Definition: spinel.h:4226
Definition: spinel.h:1284
The packet was not acknowledged.
Definition: spinel.h:464
SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack_in_place(const uint8_t *data_in, spinel_size_t data_len, const char *pack_format,...)
Definition: spinel.c:705
Definition: spinel.h:541
Definition: spinel.h:1250
MAC Max direct retry number.
Definition: spinel.h:2164
SRP Client Host Name (label).
Definition: spinel.h:4115
dBm [c]
Definition: spinel.h:1690
Definition: spinel.h:1202
The number of received beacon.
Definition: spinel.h:4427
Definition: spinel.h:1907
MAC Denylist Enabled Flag.
Definition: spinel.h:2135
Definition: spinel.h:4825
Definition: spinel.h:761
Definition: spinel.h:709
Definition: spinel.h:587
Child Supervision Interval.
Definition: spinel.h:3972
Definition: spinel.h:653
Definition: spinel.h:826
Definition: spinel.h:602
A/The packet was dropped.
Definition: spinel.h:461
MAC Scan Channel Mask.
Definition: spinel.h:1943
Definition: spinel.h:528
Channel monitoring sample count.
Definition: spinel.h:1827
SRP Client Key Lease Interval.
Definition: spinel.h:4095
Definition: spinel.h:680
The given command cannot be performed on this property.
Definition: spinel.h:468
Definition: spinel.h:1262
MAC CSL Period.
Definition: spinel.h:2997
Definition: spinel.h:4863
This interface is not supported.
Definition: spinel.h:453
Definition: spinel.h:658
MAC Received Signal Strength Filter.
Definition: spinel.h:2146
Thread Local Leader Weight.
Definition: spinel.h:2354
MAC Denylist.
Definition: spinel.h:2129
Definition: spinel.h:1083
Definition: spinel.h:809
Definition: spinel.h:701
Definition: spinel.h:3680
Definition: spinel.h:2453
Definition: spinel.h:875
Timestamps when Spinel frame is received and transmitted.
Definition: spinel.h:4714
Thread "joiner" flag used during discovery scan operation.
Definition: spinel.h:2630
List of active thread router ids.
Definition: spinel.h:2497
Require Join Existing.
Definition: spinel.h:2270
Thread network time.
Definition: spinel.h:3935
Network Interface Status.
Definition: spinel.h:2194
Send MGMT_GET Thread Active Operational Dataset.
Definition: spinel.h:2935
Definition: spinel.h:1217
(IPv6) Network Stream
Definition: spinel.h:3491
Definition: spinel.h:618
Server Allow Local Network Data Change.
Definition: spinel.h:4237
Definition: spinel.h:1227
Definition: spinel.h:2177
Definition: spinel.h:705
Link metrics management response.
Definition: spinel.h:3179
The number of received spinel frames with error.
Definition: spinel.h:4515
SPINEL_API_EXTERN const char * spinel_capability_to_cstr(spinel_capability_t capability)
Definition: spinel.c:1569
The number of received packets with other errors.
Definition: spinel.h:4467
MAC Key.
Definition: spinel.h:4694
Thread Domain Name.
Definition: spinel.h:3025
Link metrics probe.
Definition: spinel.h:3085
Thread RLOC16.
Definition: spinel.h:2469
Definition: spinel.h:4224
Operational Dataset Active Timestamp.
Definition: spinel.h:2774
Definition: spinel.h:1258
#define SPINEL_BIT_MASK(bit_index, field_bit_count)
Macro for generating bit masks using bit index from the spec.
Definition: spinel.h:437
Definition: spinel.h:585
Definition: spinel.h:4680
Definition: spinel.h:4777
Definition: spinel.h:4255
This operation is in progress.
Definition: spinel.h:457
Definition: spinel.h:4866
The number of transmitted spinel frames.
Definition: spinel.h:4507
The node was unable to find any other peers on the network.
Definition: spinel.h:501
Thread Network PSKc.
Definition: spinel.h:2282
Definition: spinel.h:594
Definition: spinel.h:625
Definition: spinel.h:1708
Definition: spinel.h:4292
Number of out of order received spinel frames (tid increase by more than 1).
Definition: spinel.h:4519
Operational Dataset Additional Raw TLVs.
Definition: spinel.h:2837
Definition: spinel.h:758
Definition: spinel.h:651
spinel_ipv6_icmp_ping_offload_mode_t
Definition: spinel.h:555
Definition: spinel.h:4875
Definition: spinel.h:654
Definition: spinel.h:4001
[A(L)]
Definition: spinel.h:4342
Definition: spinel.h:3821
MAC Scan State.
Definition: spinel.h:1935
Definition: spinel.h:1179
Definition: spinel.h:1259
SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_decode(const uint8_t *bytes, spinel_size_t len, unsigned int *value_ptr)
Definition: spinel.c:235
Definition: spinel.h:526
Definition: spinel.h:592
spinel_mcu_power_state_t
Definition: spinel.h:571
Definition: spinel.h:4877
Definition: spinel.h:624
Thread Joiner Discerner.
Definition: spinel.h:3676
Definition: spinel.h:806
Definition: spinel.h:1119
Definition: spinel.h:1265
Definition: spinel.h:551
Definition: spinel.h:1275
[b]
Definition: spinel.h:4343
SRP Client Host And Services Clear.
Definition: spinel.h:4174
Definition: spinel.h:530
Packet was acknowledged with secure enhance ACK.
Definition: spinel.h:851
Definition: spinel.h:616
SPINEL_API_EXTERN const char * spinel_mcu_power_state_to_cstr(uint8_t mcu_power_state)
Definition: spinel.c:1510
Definition: spinel.h:710
Thread Leader Router Id.
Definition: spinel.h:2338
Link metrics query result.
Definition: spinel.h:3072
TREL Radio Link - test mode enable.
Definition: spinel.h:4821
IPv6 Multicast Address Table.
Definition: spinel.h:3354
Definition: spinel.h:4272
Definition: spinel.h:681
Signal Jamming Detected Indicator.
Definition: spinel.h:1726
SPINEL_API_EXTERN const char * spinel_command_to_cstr(spinel_command_t command)
Definition: spinel.c:1167
SRP Client Host Info.
Definition: spinel.h:4108
Channel monitoring sample window.
Definition: spinel.h:1814
Definition: spinel.h:595
Definition: spinel.h:1118
Definition: spinel.h:732
Definition: spinel.h:697
Definition: spinel.h:1181
Definition: spinel.h:792
Definition: spinel.h:804
Definition: spinel.h:1193
Definition: spinel.h:1207
MAC PAN ID.
Definition: spinel.h:2003
Definition: spinel.h:1206
SPINEL_API_EXTERN const char * spinel_prop_key_to_cstr(spinel_prop_key_t prop_key)
Definition: spinel.c:1200
Definition: spinel.h:583
Send MGMT_GET Thread Pending Operational Dataset.
Definition: spinel.h:2947
Thread Network Key Sequence Counter.
Definition: spinel.h:2240
Thread 1.2 Primary Backbone Router information in the Thread Network.
Definition: spinel.h:3247
Signal the max power for a channel.
Definition: spinel.h:1697
Definition: spinel.h:821
Definition: spinel.h:3551
Definition: spinel.h:1706
The number of broadcast packets transmitted.
Definition: spinel.h:4407
SPINEL_API_EXTERN const char * spinel_net_role_to_cstr(uint8_t net_role)
Definition: spinel.c:1497
Definition: spinel.h:698
The number of received packets with a checksum error.
Definition: spinel.h:4463
Definition: spinel.h:1281
Definition: spinel.h:4274
The number of transmitted beacon.
Definition: spinel.h:4383
Packet was transmitted, not received.
Definition: spinel.h:847
Definition: spinel.h:521
Network Is Saved (Is Commissioned)
Definition: spinel.h:2185
Definition: spinel.h:630
The number of successful Tx IP packets.
Definition: spinel.h:4523
Off-mesh routes.
Definition: spinel.h:2422
Definition: spinel.h:4759
Thread Leader IPv6 Address.
Definition: spinel.h:2295
All MAC packets matching network are passed up the stack.
Definition: spinel.h:671
SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack_in_place(const uint8_t *data_in, spinel_size_t data_len, const char *pack_format, va_list args)
Definition: spinel.c:732
Definition: spinel.h:3381
Definition: spinel.h:1214
IPv6 (Unicast) Address Table.
Definition: spinel.h:3333
The given item could not be found.
Definition: spinel.h:467
Definition: spinel.h:611
Definition: spinel.h:632
Send MGMT_SET Thread Pending Operational Dataset.
Definition: spinel.h:2759
Definition: spinel.h:1228
The number of received data.
Definition: spinel.h:4419
Thread Preferred Router Id.
Definition: spinel.h:2542
Definition: spinel.h:527
Definition: spinel.h:650
The legacy network ULA prefix (8 bytes)
Definition: spinel.h:4763
Definition: spinel.h:593
The number of CCA failure times.
Definition: spinel.h:4399
Testing platform watchdog.
Definition: spinel.h:4801
Definition: spinel.h:700
Definition: spinel.h:1178
Thread Device Role.
Definition: spinel.h:2216
Definition: spinel.h:769
Definition: spinel.h:1172
Definition: spinel.h:613
Definition: spinel.h:584
Definition: spinel.h:525
Max offload block [S] (not supported)
Definition: spinel.h:1421
Thread Router Selection Jitter.
Definition: spinel.h:2530
Thread Time synchronization XTAL accuracy threshold for Router.
Definition: spinel.h:3955
Definition: spinel.h:473
The number of frame transmission failures due to abort error.
Definition: spinel.h:4411
Definition: spinel.h:1116
Channel Manager Auto Channel Selection Enabled.
Definition: spinel.h:3913
Definition: spinel.h:2455
The NCP timestamp base.
Definition: spinel.h:4809
MAC Extended Address.
Definition: spinel.h:2092
Definition: spinel.h:1185
Definition: spinel.h:2289
Last Operation Status.
Definition: spinel.h:1337
Definition: spinel.h:1254
Definition: spinel.h:601
Definition: spinel.h:3678
dBm [c]
Definition: spinel.h:1684
Definition: spinel.h:690
Definition: spinel.h:574
Definition: spinel.h:4872
Definition: spinel.h:816
Definition: spinel.h:858
Thread Child Timeout.
Definition: spinel.h:2463
The number of transmitted data.
Definition: spinel.h:4375
Child Supervision Check Timeout.
Definition: spinel.h:3990
[C]
Definition: spinel.h:3562
MAC Long Address.
Definition: spinel.h:1987
MAC CSL Timeout.
Definition: spinel.h:3005
This operation is invalid for the current device state.
Definition: spinel.h:451
Definition: spinel.h:895
Definition: spinel.h:1239
Definition: spinel.h:539
The device is currently performing a mutually exclusive operation.
Definition: spinel.h:459
Definition: spinel.h:605
The number of successful Rx IP packets.
Definition: spinel.h:4527
Definition: spinel.h:1081
Definition: spinel.h:937
Definition: spinel.h:1268
Definition: spinel.h:683
MAC Energy Scan Result.
Definition: spinel.h:2043
Thread Router Table.
Definition: spinel.h:2682
SRP Client Service Key Inclusion Enabled.
Definition: spinel.h:4222
Definition: spinel.h:642
Definition: spinel.h:3293
Thread Active Operational Dataset.
Definition: spinel.h:2713
The number of unicast packets received.
Definition: spinel.h:4475
NCP Capability List.
Definition: spinel.h:1397
Operation has failed for some undefined reason.
Definition: spinel.h:448
Definition: spinel.h:532
Definition: spinel.h:4865
Definition: spinel.h:3548
Definition: spinel.h:1021
uint8_t spinel_tid_t
Definition: spinel.h:843
Testing platform assert.
Definition: spinel.h:4787
The given property is not recognized.
Definition: spinel.h:460
Thread Stack Operational Status.
Definition: spinel.h:2203
The number of received packets from an unknown neighbor.
Definition: spinel.h:4451
[C]
Definition: spinel.h:1681
MAC Frame Counter.
Definition: spinel.h:4704
List of properties capable of generating unsolicited value update.
Definition: spinel.h:1675
Thread 1.2 Backbone Router local state.
Definition: spinel.h:3259
IPv6 ICMP Ping Offload.
Definition: spinel.h:3374
The number of unicast packets transmitted.
Definition: spinel.h:4403
PropLock [b] (not supported)
Definition: spinel.h:1419
EID (Endpoint Identifier) IPv6 Address Cache Table.
Definition: spinel.h:2901
Definition: spinel.h:3378
Definition: spinel.h:1121
The number of failed Rx IP packets.
Definition: spinel.h:4535
Definition: spinel.h:1176
All MAC related counters.
Definition: spinel.h:4609
Raw samples from TRNG entropy source representing 32 bits of entropy.
Definition: spinel.h:1644
The result of the operation is empty.
Definition: spinel.h:462
The only potential peer nodes found are incompatible.
Definition: spinel.h:507
Protocol Version.
Definition: spinel.h:1353
Thread Network Partition Id.
Definition: spinel.h:2249
Thread Network ID Timeout.
Definition: spinel.h:2487
The number of received packets filtered by destination check.
Definition: spinel.h:4443
Thread Local Stable Network Data.
Definition: spinel.h:2372
Definition: spinel.h:1195
Definition: spinel.h:1225
Generic failure to associate with other peers.
Definition: spinel.h:484
UART Software Flow Control.
Definition: spinel.h:4329
Definition: spinel.h:831
Jamming detection window size.
Definition: spinel.h:1745
Definition: spinel.h:523
Definition: spinel.h:1205
Thread Mode.
Definition: spinel.h:2451
Definition: spinel.h:573
Channel Manager - Channel Change New Channel.
Definition: spinel.h:3838
The total number of transmissions.
Definition: spinel.h:4359
Host Power State.
Definition: spinel.h:1479
Given operation has not been implemented.
Definition: spinel.h:449
Definition: spinel.h:2061
Definition: spinel.h:1247
Definition: spinel.h:568
Definition: spinel.h:2287
Thread Network Key Switch Guard Time.
Definition: spinel.h:2276
MAC Scan Beacon.
Definition: spinel.h:1979
Definition: spinel.h:657
Definition: spinel.h:1226
The NCP log level.
Definition: spinel.h:4791
The total number of secure received IP message.
Definition: spinel.h:4495
Definition: spinel.h:1219
SLAAC enabled.
Definition: spinel.h:4030
Definition: spinel.h:4869
Definition: spinel.h:3379
Definition: spinel.h:619
Thread IPv6 counters.
Definition: spinel.h:4647
Definition: spinel.h:549
Channel Manager Channel Select Trigger.
Definition: spinel.h:3900
Thread TMF proxy stream.
Definition: spinel.h:2620
Definition: spinel.h:637
Definition: spinel.h:4823
Definition: spinel.h:3823
[b]
Definition: spinel.h:4344
Definition: spinel.h:4876
Stable Leader Network Data.
Definition: spinel.h:2583
Definition: spinel.h:1274
dBm [c]
Definition: spinel.h:1686
CSL Accuracy.
Definition: spinel.h:4744
Definition: spinel.h:1220
Definition: spinel.h:612
Definition: spinel.h:596
Definition: spinel.h:1271
Definition: spinel.h:1208
char spinel_datatype_t
Definition: spinel.h:4885
Thread Network Extended PAN ID.
Definition: spinel.h:2228
Thread Assisting Ports.
Definition: spinel.h:2429
Definition: spinel.h:1198
The packet was not sent due to a CCA failure.
Definition: spinel.h:465
Definition: spinel.h:531
Definition: spinel.h:1218
The target is not capable of handling requested operation.
Definition: spinel.h:470
Definition: spinel.h:1231
spinel_meshcop_joiner_state_t
Definition: spinel.h:599
Thread Parent Response info.
Definition: spinel.h:4019
GPIO State Bitmask.
Definition: spinel.h:1607
The number of retransmission times.
Definition: spinel.h:4395
Neighbor Table Multi Radio Link Info.
Definition: spinel.h:4058
Definition: spinel.h:694
Link metrics Forward Tracking Series management.
Definition: spinel.h:3168
spinel_power_state_t
Definition: spinel.h:581
Channel monitoring channel occupancy.
Definition: spinel.h:1847
Definition: spinel.h:1235
MAC Stream Raw Enabled.
Definition: spinel.h:2012
Definition: spinel.h:695
The CCA failure rate.
Definition: spinel.h:2156
kHz [L]
Definition: spinel.h:1683
[A(C)]
Definition: spinel.h:1682
Definition: spinel.h:778
Definition: spinel.h:703
Definition: spinel.h:566
This command is not recognized.
Definition: spinel.h:452
NCP Interface Count.
Definition: spinel.h:1407
Definition: spinel.h:696
Operation prevented due to memory pressure.
Definition: spinel.h:458
SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_pack(uint8_t *data_out, spinel_size_t data_len_max, const char *pack_format,...)
Definition: spinel.c:1119
Operational Dataset (MGMT_GET) Destination IPv6 Address.
Definition: spinel.h:2961
Log Stream.
Definition: spinel.h:3544
Definition: spinel.h:812
Definition: spinel.h:3295
Definition: spinel.h:1215
Definition: spinel.h:1140
Definition: spinel.h:656
MAC retry histogram.
Definition: spinel.h:4676
The node succeeds in commissioning and get the network credentials.
Definition: spinel.h:519
Thread Local Network Data Version.
Definition: spinel.h:2366
GPIO State Set-Only Bitmask.
Definition: spinel.h:1621
Definition: spinel.h:4868
Definition: spinel.h:1194
The node found other peers but was unable to decode their packets.
Definition: spinel.h:494
Definition: spinel.h:805
SRP Client Lease Interval.
Definition: spinel.h:4086
The command was too large to fit in the internal buffer.
Definition: spinel.h:463
Definition: spinel.h:704
SRP Client Host Addresses.
Definition: spinel.h:4122
Definition: spinel.h:1249
Definition: spinel.h:1286
Definition: spinel.h:707
SRP Client Host And Services Remove.
Definition: spinel.h:4164
The operation is already in progress.
Definition: spinel.h:466
Definition: spinel.h:1252
The number of transmissions that were acked.
Definition: spinel.h:4367
Definition: spinel.h:1184
Leader Network Data.
Definition: spinel.h:2577
Link metrics Enhanced-ACK Based Probing IE report.
Definition: spinel.h:3133
Thread MLE counters.
Definition: spinel.h:4627
Link-Local IPv6 Address.
Definition: spinel.h:3301
MAC Short Address.
Definition: spinel.h:1995
Operational Dataset Delay Timer.
Definition: spinel.h:2801
The number of transmissions with ack request.
Definition: spinel.h:4363
PANID used for Discovery scan operation (used for PANID filtering).
Definition: spinel.h:2646
Counter reset.
Definition: spinel.h:4355
Definition: spinel.h:1099
Link metrics Enhanced-ACK Based Probing management.
Definition: spinel.h:3111
Definition: spinel.h:1260
Definition: spinel.h:1287
Channel monitoring sample interval.
Definition: spinel.h:1785
The number of received data poll.
Definition: spinel.h:4423
Definition: spinel.h:4755
SRP Client Start.
Definition: spinel.h:4077
uint32_t spinel_status_t
Definition: spinel.h:545
Thread Neighbor Table.
Definition: spinel.h:2561
IPv6 Route Table - Deprecated.
Definition: spinel.h:3336
Definition: spinel.h:679
All coex metrics related counters.
Definition: spinel.h:1896
Definition: spinel.h:4678
SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vpack(uint8_t *data_out, spinel_size_t data_len_max, const char *pack_format, va_list args)
Definition: spinel.c:1131
Definition: spinel.h:4873
Thread Joiner Commissioning command and the parameters.
Definition: spinel.h:3601
MAC CSL Channel.
Definition: spinel.h:3015
uint32_t spinel_capability_t
Definition: spinel.h:1290
Definition: spinel.h:1278
Definition: spinel.h:542
The number of received other types of frames.
Definition: spinel.h:4435
SPINEL_API_EXTERN const char * spinel_next_packed_datatype(const char *pack_format)
Definition: spinel.c:313
SPINEL_API_EXTERN const char * spinel_radio_link_to_cstr(uint32_t radio)
Thread Parent Info.
Definition: spinel.h:2312
Definition: spinel.h:1213
Definition: spinel.h:1243
Thread 1.2 Backbone Router registration jitter.
Definition: spinel.h:3291
Router Role Enabled.
Definition: spinel.h:2518
uint32_t spinel_command_t
Definition: spinel.h:1188
dBm [c]
Definition: spinel.h:1687
NCP Network Protocol Type.
Definition: spinel.h:1378
Register local Thread 1.2 Backbone Router configuration.
Definition: spinel.h:3281
Thread (out of band) steering data for MLE Discovery Response.
Definition: spinel.h:2664
Definition: spinel.h:1175
Definition: spinel.h:677
Thread Allow Local Network Data Change.
Definition: spinel.h:2438
The number of dropped received IP messages.
Definition: spinel.h:4503
Definition: spinel.h:631
Definition: spinel.h:1237
Definition: spinel.h:643
Normal MAC filtering is in place.
Definition: spinel.h:670
Jamming detection busy period.
Definition: spinel.h:1758
NCP Hardware Address.
Definition: spinel.h:1417
Definition: spinel.h:693
Definition: spinel.h:1267
Operational Dataset Security Policy.
Definition: spinel.h:2822
Definition: spinel.h:4757
Definition: spinel.h:1269
Definition: spinel.h:1192
Definition: spinel.h:4290
Definition: spinel.h:615
The number of transmitted other types of frames.
Definition: spinel.h:4391
A error has occurred while parsing the command.
Definition: spinel.h:456
[c]
Definition: spinel.h:1685
Operation has completed successfully.
Definition: spinel.h:447
Definition: spinel.h:682
Definition: spinel.h:810
Definition: spinel.h:689
Definition: spinel.h:614
Jamming detection history bitmap (for debugging)
Definition: spinel.h:1771
Thread TMF proxy enable.
Definition: spinel.h:2611
Definition: spinel.h:4347
Definition: spinel.h:4826
Packet was received with bad FCS.
Definition: spinel.h:848
Mesh Local Prefix.
Definition: spinel.h:3318
Definition: spinel.h:733
Definition: spinel.h:1245
CSL Uncertainty.
Definition: spinel.h:4753
GPIO State Clear-Only Bitmask.
Definition: spinel.h:1635
Definition: spinel.h:1263
Definition: spinel.h:4345
The neighbor is unknown.
Definition: spinel.h:469
Thread Joiner Data.
Definition: spinel.h:2592
Channel Manager Supported Channels.
Definition: spinel.h:3864
Definition: spinel.h:652
Definition: spinel.h:1283
Definition: spinel.h:1197
Definition: spinel.h:538
Definition: spinel.h:645
The EUI64 of last node joined using legacy protocol (if none, all zero EUI64 is returned).
Definition: spinel.h:4767
RCP API Version number.
Definition: spinel.h:4288
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale