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