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