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