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