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 implementors 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 SPINEL_PROP_NET__END = 0x50, 2374 2375 SPINEL_PROP_NET_EXT__BEGIN = 0x1400, 2376 SPINEL_PROP_NET_EXT__END = 0x1500, 2377 2378 SPINEL_PROP_THREAD__BEGIN = 0x50, 2379 2380 /// Thread Leader IPv6 Address 2381 /** Format `6` - Read only 2382 * 2383 */ 2384 SPINEL_PROP_THREAD_LEADER_ADDR = SPINEL_PROP_THREAD__BEGIN + 0, 2385 2386 /// Thread Parent Info 2387 /** Format: `ESLccCCCCC` - Read only 2388 * 2389 * `E`: Extended address 2390 * `S`: RLOC16 2391 * `L`: Age (seconds since last heard from) 2392 * `c`: Average RSS (in dBm) 2393 * `c`: Last RSSI (in dBm) 2394 * `C`: Link Quality In 2395 * `C`: Link Quality Out 2396 * `C`: Version 2397 * `C`: CSL clock accuracy 2398 * `C`: CSL uncertainty 2399 * 2400 */ 2401 SPINEL_PROP_THREAD_PARENT = SPINEL_PROP_THREAD__BEGIN + 1, 2402 2403 /// Thread Child Table 2404 /** Format: [A(t(ESLLCCcCc)] - Read only 2405 * 2406 * Data per item is: 2407 * 2408 * `E`: Extended address 2409 * `S`: RLOC16 2410 * `L`: Timeout (in seconds) 2411 * `L`: Age (in seconds) 2412 * `L`: Network Data version 2413 * `C`: Link Quality In 2414 * `c`: Average RSS (in dBm) 2415 * `C`: Mode (bit-flags) 2416 * `c`: Last RSSI (in dBm) 2417 * 2418 */ 2419 SPINEL_PROP_THREAD_CHILD_TABLE = SPINEL_PROP_THREAD__BEGIN + 2, 2420 2421 /// Thread Leader Router Id 2422 /** Format `C` - Read only 2423 * 2424 * The router-id of the current leader. 2425 * 2426 */ 2427 SPINEL_PROP_THREAD_LEADER_RID = SPINEL_PROP_THREAD__BEGIN + 3, 2428 2429 /// Thread Leader Weight 2430 /** Format `C` - Read only 2431 * 2432 * The leader weight of the current leader. 2433 * 2434 */ 2435 SPINEL_PROP_THREAD_LEADER_WEIGHT = SPINEL_PROP_THREAD__BEGIN + 4, 2436 2437 /// Thread Local Leader Weight 2438 /** Format `C` - Read only 2439 * 2440 * The leader weight of this node. 2441 * 2442 */ 2443 SPINEL_PROP_THREAD_LOCAL_LEADER_WEIGHT = SPINEL_PROP_THREAD__BEGIN + 5, 2444 2445 /// Thread Local Network Data 2446 /** Format `D` - Read only 2447 * 2448 */ 2449 SPINEL_PROP_THREAD_NETWORK_DATA = SPINEL_PROP_THREAD__BEGIN + 6, 2450 2451 /// Thread Local Network Data Version 2452 /** Format `C` - Read only 2453 * 2454 */ 2455 SPINEL_PROP_THREAD_NETWORK_DATA_VERSION = SPINEL_PROP_THREAD__BEGIN + 7, 2456 2457 /// Thread Local Stable Network Data 2458 /** Format `D` - Read only 2459 * 2460 */ 2461 SPINEL_PROP_THREAD_STABLE_NETWORK_DATA = SPINEL_PROP_THREAD__BEGIN + 8, 2462 2463 /// Thread Local Stable Network Data Version 2464 /** Format `C` - Read only 2465 * 2466 */ 2467 SPINEL_PROP_THREAD_STABLE_NETWORK_DATA_VERSION = SPINEL_PROP_THREAD__BEGIN + 9, 2468 2469 /// On-Mesh Prefixes 2470 /** Format: `A(t(6CbCbSC))` 2471 * 2472 * Data per item is: 2473 * 2474 * `6`: IPv6 Prefix 2475 * `C`: Prefix length in bits 2476 * `b`: Stable flag 2477 * `C`: TLV flags (SPINEL_NET_FLAG_* definition) 2478 * `b`: "Is defined locally" flag. Set if this network was locally 2479 * defined. Assumed to be true for set, insert and replace. Clear if 2480 * the on mesh network was defined by another node. 2481 * This field is ignored for INSERT and REMOVE commands. 2482 * `S`: The RLOC16 of the device that registered this on-mesh prefix entry. 2483 * This value is not used and ignored when adding an on-mesh prefix. 2484 * This field is ignored for INSERT and REMOVE commands. 2485 * `C`: TLV flags extended (additional field for Thread 1.2 features). 2486 * 2487 */ 2488 SPINEL_PROP_THREAD_ON_MESH_NETS = SPINEL_PROP_THREAD__BEGIN + 10, 2489 2490 /// Off-mesh routes 2491 /** Format: [A(t(6CbCbb))] 2492 * 2493 * Data per item is: 2494 * 2495 * `6`: Route Prefix 2496 * `C`: Prefix length in bits 2497 * `b`: Stable flag 2498 * `C`: Route flags (SPINEL_ROUTE_FLAG_* and SPINEL_ROUTE_PREFERENCE_* definitions) 2499 * `b`: "Is defined locally" flag. Set if this route info was locally 2500 * defined as part of local network data. Assumed to be true for set, 2501 * insert and replace. Clear if the route is part of partition's network 2502 * data. 2503 * `b`: "Next hop is this device" flag. Set if the next hop for the 2504 * route is this device itself (i.e., route was added by this device) 2505 * This value is ignored when adding an external route. For any added 2506 * route the next hop is this device. 2507 * `S`: The RLOC16 of the device that registered this route entry. 2508 * This value is not used and ignored when adding a route. 2509 * 2510 */ 2511 SPINEL_PROP_THREAD_OFF_MESH_ROUTES = SPINEL_PROP_THREAD__BEGIN + 11, 2512 2513 /// Thread Assisting Ports 2514 /** Format `A(S)` 2515 * 2516 * Array of port numbers. 2517 */ 2518 SPINEL_PROP_THREAD_ASSISTING_PORTS = SPINEL_PROP_THREAD__BEGIN + 12, 2519 2520 /// Thread Allow Local Network Data Change 2521 /** Format `b` - Read-write 2522 * 2523 * Set to true before changing local net data. Set to false when finished. 2524 * This allows changes to be aggregated into a single event. 2525 * 2526 */ 2527 SPINEL_PROP_THREAD_ALLOW_LOCAL_NET_DATA_CHANGE = SPINEL_PROP_THREAD__BEGIN + 13, 2528 2529 /// Thread Mode 2530 /** Format: `C` 2531 * 2532 * This property contains the value of the mode 2533 * TLV for this node. The meaning of the bits in this 2534 * bit-field are defined by section 4.5.2 of the Thread 2535 * specification. 2536 * 2537 * The values `SPINEL_THREAD_MODE_*` defines the bit-fields 2538 * 2539 */ 2540 SPINEL_PROP_THREAD_MODE = SPINEL_PROP_THREAD__BEGIN + 14, 2541 2542 SPINEL_PROP_THREAD__END = 0x60, 2543 2544 SPINEL_PROP_THREAD_EXT__BEGIN = 0x1500, 2545 2546 /// Thread Child Timeout 2547 /** Format: `L` 2548 * Unit: Seconds 2549 * 2550 * Used when operating in the Child role. 2551 */ 2552 SPINEL_PROP_THREAD_CHILD_TIMEOUT = SPINEL_PROP_THREAD_EXT__BEGIN + 0, 2553 2554 /// Thread RLOC16 2555 /** Format: `S` 2556 * 2557 */ 2558 SPINEL_PROP_THREAD_RLOC16 = SPINEL_PROP_THREAD_EXT__BEGIN + 1, 2559 2560 /// Thread Router Upgrade Threshold 2561 /** Format: `C` 2562 * 2563 */ 2564 SPINEL_PROP_THREAD_ROUTER_UPGRADE_THRESHOLD = SPINEL_PROP_THREAD_EXT__BEGIN + 2, 2565 2566 /// Thread Context Reuse Delay 2567 /** Format: `L` 2568 * 2569 */ 2570 SPINEL_PROP_THREAD_CONTEXT_REUSE_DELAY = SPINEL_PROP_THREAD_EXT__BEGIN + 3, 2571 2572 /// Thread Network ID Timeout 2573 /** Format: `C` 2574 * 2575 */ 2576 SPINEL_PROP_THREAD_NETWORK_ID_TIMEOUT = SPINEL_PROP_THREAD_EXT__BEGIN + 4, 2577 2578 /// List of active thread router ids 2579 /** Format: `A(C)` 2580 * 2581 * Note that some implementations may not support CMD_GET_VALUE 2582 * router ids, but may support CMD_REMOVE_VALUE when the node is 2583 * a leader. 2584 * 2585 */ 2586 SPINEL_PROP_THREAD_ACTIVE_ROUTER_IDS = SPINEL_PROP_THREAD_EXT__BEGIN + 5, 2587 2588 /// Forward IPv6 packets that use RLOC16 addresses to HOST. 2589 /** Format: `b` 2590 * 2591 * Allow host to directly observe all IPv6 packets received by the NCP, 2592 * including ones sent to the RLOC16 address. 2593 * 2594 * Default is false. 2595 * 2596 */ 2597 SPINEL_PROP_THREAD_RLOC16_DEBUG_PASSTHRU = SPINEL_PROP_THREAD_EXT__BEGIN + 6, 2598 2599 /// Router Role Enabled 2600 /** Format `b` 2601 * 2602 * Allows host to indicate whether or not the router role is enabled. 2603 * If current role is a router, setting this property to `false` starts 2604 * a re-attach process as an end-device. 2605 * 2606 */ 2607 SPINEL_PROP_THREAD_ROUTER_ROLE_ENABLED = SPINEL_PROP_THREAD_EXT__BEGIN + 7, 2608 2609 /// Thread Router Downgrade Threshold 2610 /** Format: `C` 2611 * 2612 */ 2613 SPINEL_PROP_THREAD_ROUTER_DOWNGRADE_THRESHOLD = SPINEL_PROP_THREAD_EXT__BEGIN + 8, 2614 2615 /// Thread Router Selection Jitter 2616 /** Format: `C` 2617 * 2618 */ 2619 SPINEL_PROP_THREAD_ROUTER_SELECTION_JITTER = SPINEL_PROP_THREAD_EXT__BEGIN + 9, 2620 2621 /// Thread Preferred Router Id 2622 /** Format: `C` - Write only 2623 * 2624 * Specifies the preferred Router Id. Upon becoming a router/leader the node 2625 * attempts to use this Router Id. If the preferred Router Id is not set or 2626 * if it can not be used, a randomly generated router id is picked. This 2627 * property can be set only when the device role is either detached or 2628 * disabled. 2629 * 2630 */ 2631 SPINEL_PROP_THREAD_PREFERRED_ROUTER_ID = SPINEL_PROP_THREAD_EXT__BEGIN + 10, 2632 2633 /// Thread Neighbor Table 2634 /** Format: `A(t(ESLCcCbLLc))` - Read only 2635 * 2636 * Data per item is: 2637 * 2638 * `E`: Extended address 2639 * `S`: RLOC16 2640 * `L`: Age (in seconds) 2641 * `C`: Link Quality In 2642 * `c`: Average RSS (in dBm) 2643 * `C`: Mode (bit-flags) 2644 * `b`: `true` if neighbor is a child, `false` otherwise. 2645 * `L`: Link Frame Counter 2646 * `L`: MLE Frame Counter 2647 * `c`: The last RSSI (in dBm) 2648 * 2649 */ 2650 SPINEL_PROP_THREAD_NEIGHBOR_TABLE = SPINEL_PROP_THREAD_EXT__BEGIN + 11, 2651 2652 /// Thread Max Child Count 2653 /** Format: `C` 2654 * 2655 * Specifies the maximum number of children currently allowed. 2656 * This parameter can only be set when Thread protocol operation 2657 * has been stopped. 2658 * 2659 */ 2660 SPINEL_PROP_THREAD_CHILD_COUNT_MAX = SPINEL_PROP_THREAD_EXT__BEGIN + 12, 2661 2662 /// Leader Network Data 2663 /** Format: `D` - Read only 2664 * 2665 */ 2666 SPINEL_PROP_THREAD_LEADER_NETWORK_DATA = SPINEL_PROP_THREAD_EXT__BEGIN + 13, 2667 2668 /// Stable Leader Network Data 2669 /** Format: `D` - Read only 2670 * 2671 */ 2672 SPINEL_PROP_THREAD_STABLE_LEADER_NETWORK_DATA = SPINEL_PROP_THREAD_EXT__BEGIN + 14, 2673 2674 /// Thread Joiner Data 2675 /** Format `A(T(ULE))` 2676 * PSKd, joiner timeout, eui64 (optional) 2677 * 2678 * This property is being deprecated by SPINEL_PROP_MESHCOP_COMMISSIONER_JOINERS. 2679 * 2680 */ 2681 SPINEL_PROP_THREAD_JOINERS = SPINEL_PROP_THREAD_EXT__BEGIN + 15, 2682 2683 /// Thread Commissioner Enable 2684 /** Format `b` 2685 * 2686 * Default value is `false`. 2687 * 2688 * This property is being deprecated by SPINEL_PROP_MESHCOP_COMMISSIONER_STATE. 2689 * 2690 */ 2691 SPINEL_PROP_THREAD_COMMISSIONER_ENABLED = SPINEL_PROP_THREAD_EXT__BEGIN + 16, 2692 2693 /// Thread TMF proxy enable 2694 /** Format `b` 2695 * Required capability: `SPINEL_CAP_THREAD_TMF_PROXY` 2696 * 2697 * This property is deprecated. 2698 * 2699 */ 2700 SPINEL_PROP_THREAD_TMF_PROXY_ENABLED = SPINEL_PROP_THREAD_EXT__BEGIN + 17, 2701 2702 /// Thread TMF proxy stream 2703 /** Format `dSS` 2704 * Required capability: `SPINEL_CAP_THREAD_TMF_PROXY` 2705 * 2706 * This property is deprecated. Please see `SPINEL_PROP_THREAD_UDP_FORWARD_STREAM`. 2707 * 2708 */ 2709 SPINEL_PROP_THREAD_TMF_PROXY_STREAM = SPINEL_PROP_THREAD_EXT__BEGIN + 18, 2710 2711 /// Thread "joiner" flag used during discovery scan operation 2712 /** Format `b` 2713 * 2714 * This property defines the Joiner Flag value in the Discovery Request TLV. 2715 * 2716 * Default value is `false`. 2717 * 2718 */ 2719 SPINEL_PROP_THREAD_DISCOVERY_SCAN_JOINER_FLAG = SPINEL_PROP_THREAD_EXT__BEGIN + 19, 2720 2721 /// Enable EUI64 filtering for discovery scan operation. 2722 /** Format `b` 2723 * 2724 * Default value is `false` 2725 * 2726 */ 2727 SPINEL_PROP_THREAD_DISCOVERY_SCAN_ENABLE_FILTERING = SPINEL_PROP_THREAD_EXT__BEGIN + 20, 2728 2729 /// PANID used for Discovery scan operation (used for PANID filtering). 2730 /** Format: `S` 2731 * 2732 * Default value is 0xffff (Broadcast PAN) to disable PANID filtering 2733 * 2734 */ 2735 SPINEL_PROP_THREAD_DISCOVERY_SCAN_PANID = SPINEL_PROP_THREAD_EXT__BEGIN + 21, 2736 2737 /// Thread (out of band) steering data for MLE Discovery Response. 2738 /** Format `E` - Write only 2739 * 2740 * Required capability: SPINEL_CAP_OOB_STEERING_DATA. 2741 * 2742 * Writing to this property allows to set/update the MLE 2743 * Discovery Response steering data out of band. 2744 * 2745 * - All zeros to clear the steering data (indicating that 2746 * there is no steering data). 2747 * - All 0xFFs to set steering data/bloom filter to 2748 * accept/allow all. 2749 * - A specific EUI64 which is then added to current steering 2750 * data/bloom filter. 2751 * 2752 */ 2753 SPINEL_PROP_THREAD_STEERING_DATA = SPINEL_PROP_THREAD_EXT__BEGIN + 22, 2754 2755 /// Thread Router Table. 2756 /** Format: `A(t(ESCCCCCCb)` - Read only 2757 * 2758 * Data per item is: 2759 * 2760 * `E`: IEEE 802.15.4 Extended Address 2761 * `S`: RLOC16 2762 * `C`: Router ID 2763 * `C`: Next hop to router 2764 * `C`: Path cost to router 2765 * `C`: Link Quality In 2766 * `C`: Link Quality Out 2767 * `C`: Age (seconds since last heard) 2768 * `b`: Link established with Router ID or not. 2769 * 2770 */ 2771 SPINEL_PROP_THREAD_ROUTER_TABLE = SPINEL_PROP_THREAD_EXT__BEGIN + 23, 2772 2773 /// Thread Active Operational Dataset 2774 /** Format: `A(t(iD))` - Read-Write 2775 * 2776 * This property provides access to current Thread Active Operational Dataset. A Thread device maintains the 2777 * Operational Dataset that it has stored locally and the one currently in use by the partition to which it is 2778 * attached. This property corresponds to the locally stored Dataset on the device. 2779 * 2780 * Operational Dataset consists of a set of supported properties (e.g., channel, network key, network name, PAN id, 2781 * etc). Note that not all supported properties may be present (have a value) in a Dataset. 2782 * 2783 * The Dataset value is encoded as an array of structs containing pairs of property key (as `i`) followed by the 2784 * property value (as `D`). The property value must follow the format associated with the corresponding property. 2785 * 2786 * On write, any unknown/unsupported property keys must be ignored. 2787 * 2788 * The following properties can be included in a Dataset list: 2789 * 2790 * SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP 2791 * SPINEL_PROP_PHY_CHAN 2792 * SPINEL_PROP_PHY_CHAN_SUPPORTED (Channel Mask Page 0) 2793 * SPINEL_PROP_NET_NETWORK_KEY 2794 * SPINEL_PROP_NET_NETWORK_NAME 2795 * SPINEL_PROP_NET_XPANID 2796 * SPINEL_PROP_MAC_15_4_PANID 2797 * SPINEL_PROP_IPV6_ML_PREFIX 2798 * SPINEL_PROP_NET_PSKC 2799 * SPINEL_PROP_DATASET_SECURITY_POLICY 2800 * 2801 */ 2802 SPINEL_PROP_THREAD_ACTIVE_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 24, 2803 2804 /// Thread Pending Operational Dataset 2805 /** Format: `A(t(iD))` - Read-Write 2806 * 2807 * This property provide access to current locally stored Pending Operational Dataset. 2808 * 2809 * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_ACTIVE_DATASET. 2810 * 2811 * In addition supported properties in SPINEL_PROP_THREAD_ACTIVE_DATASET, the following properties can also 2812 * be included in the Pending Dataset: 2813 * 2814 * SPINEL_PROP_DATASET_PENDING_TIMESTAMP 2815 * SPINEL_PROP_DATASET_DELAY_TIMER 2816 * 2817 */ 2818 SPINEL_PROP_THREAD_PENDING_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 25, 2819 2820 /// Send MGMT_SET Thread Active Operational Dataset 2821 /** Format: `A(t(iD))` - Write only 2822 * 2823 * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_ACTIVE_DATASET. 2824 * 2825 * This is write-only property. When written, it triggers a MGMT_ACTIVE_SET meshcop command to be sent to leader 2826 * with the given Dataset. The spinel frame response should be a `LAST_STATUS` with the status of the transmission 2827 * of MGMT_ACTIVE_SET command. 2828 * 2829 * In addition to supported properties in SPINEL_PROP_THREAD_ACTIVE_DATASET, the following property can be 2830 * included in the Dataset (to allow for custom raw TLVs): 2831 * 2832 * SPINEL_PROP_DATASET_RAW_TLVS 2833 * 2834 */ 2835 SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 26, 2836 2837 /// Send MGMT_SET Thread Pending Operational Dataset 2838 /** Format: `A(t(iD))` - Write only 2839 * 2840 * This property is similar to SPINEL_PROP_THREAD_PENDING_DATASET and follows the same format and rules. 2841 * 2842 * In addition to supported properties in SPINEL_PROP_THREAD_PENDING_DATASET, the following property can be 2843 * included the Dataset (to allow for custom raw TLVs to be provided). 2844 * 2845 * SPINEL_PROP_DATASET_RAW_TLVS 2846 * 2847 */ 2848 SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 27, 2849 2850 /// Operational Dataset Active Timestamp 2851 /** Format: `X` - No direct read or write 2852 * 2853 * It can only be included in one of the Dataset related properties below: 2854 * 2855 * SPINEL_PROP_THREAD_ACTIVE_DATASET 2856 * SPINEL_PROP_THREAD_PENDING_DATASET 2857 * SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET 2858 * SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET 2859 * SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET 2860 * SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET 2861 * 2862 */ 2863 SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP = SPINEL_PROP_THREAD_EXT__BEGIN + 28, 2864 2865 /// Operational Dataset Pending Timestamp 2866 /** Format: `X` - No direct read or write 2867 * 2868 * It can only be included in one of the Pending Dataset properties: 2869 * 2870 * SPINEL_PROP_THREAD_PENDING_DATASET 2871 * SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET 2872 * SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET 2873 * 2874 */ 2875 SPINEL_PROP_DATASET_PENDING_TIMESTAMP = SPINEL_PROP_THREAD_EXT__BEGIN + 29, 2876 2877 /// Operational Dataset Delay Timer 2878 /** Format: `L` - No direct read or write 2879 * 2880 * Delay timer (in ms) specifies the time renaming until Thread devices overwrite the value in the Active 2881 * Operational Dataset with the corresponding values in the Pending Operational Dataset. 2882 * 2883 * It can only be included in one of the Pending Dataset properties: 2884 * 2885 * SPINEL_PROP_THREAD_PENDING_DATASET 2886 * SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET 2887 * SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET 2888 * 2889 */ 2890 SPINEL_PROP_DATASET_DELAY_TIMER = SPINEL_PROP_THREAD_EXT__BEGIN + 30, 2891 2892 /// Operational Dataset Security Policy 2893 /** Format: `SD` - No direct read or write 2894 * 2895 * It can only be included in one of the Dataset related properties below: 2896 * 2897 * SPINEL_PROP_THREAD_ACTIVE_DATASET 2898 * SPINEL_PROP_THREAD_PENDING_DATASET 2899 * SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET 2900 * SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET 2901 * SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET 2902 * SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET 2903 * 2904 * Content is 2905 * `S` : Key Rotation Time (in units of hour) 2906 * `C` : Security Policy Flags (as specified in Thread 1.1 Section 8.10.1.15) 2907 * `C` : Optional Security Policy Flags extension (as specified in Thread 1.2 Section 8.10.1.15). 2908 * 0xf8 is used if this field is missing. 2909 * 2910 */ 2911 SPINEL_PROP_DATASET_SECURITY_POLICY = SPINEL_PROP_THREAD_EXT__BEGIN + 31, 2912 2913 /// Operational Dataset Additional Raw TLVs 2914 /** Format: `D` - No direct read or write 2915 * 2916 * This property defines extra raw TLVs that can be added to an Operational DataSet. 2917 * 2918 * It can only be included in one of the following Dataset properties: 2919 * 2920 * SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET 2921 * SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET 2922 * SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET 2923 * SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET 2924 * 2925 */ 2926 SPINEL_PROP_DATASET_RAW_TLVS = SPINEL_PROP_THREAD_EXT__BEGIN + 32, 2927 2928 /// Child table addresses 2929 /** Format: `A(t(ESA(6)))` - Read only 2930 * 2931 * This property provides the list of all addresses associated with every child 2932 * including any registered IPv6 addresses. 2933 * 2934 * Data per item is: 2935 * 2936 * `E`: Extended address of the child 2937 * `S`: RLOC16 of the child 2938 * `A(6)`: List of IPv6 addresses registered by the child (if any) 2939 * 2940 */ 2941 SPINEL_PROP_THREAD_CHILD_TABLE_ADDRESSES = SPINEL_PROP_THREAD_EXT__BEGIN + 33, 2942 2943 /// Neighbor Table Frame and Message Error Rates 2944 /** Format: `A(t(ESSScc))` 2945 * Required capability: `CAP_ERROR_RATE_TRACKING` 2946 * 2947 * This property provides link quality related info including 2948 * frame and (IPv6) message error rates for all neighbors. 2949 * 2950 * With regards to message error rate, note that a larger (IPv6) 2951 * message can be fragmented and sent as multiple MAC frames. The 2952 * message transmission is considered a failure, if any of its 2953 * fragments fail after all MAC retry attempts. 2954 * 2955 * Data per item is: 2956 * 2957 * `E`: Extended address of the neighbor 2958 * `S`: RLOC16 of the neighbor 2959 * `S`: Frame error rate (0 -> 0%, 0xffff -> 100%) 2960 * `S`: Message error rate (0 -> 0%, 0xffff -> 100%) 2961 * `c`: Average RSSI (in dBm) 2962 * `c`: Last RSSI (in dBm) 2963 * 2964 */ 2965 SPINEL_PROP_THREAD_NEIGHBOR_TABLE_ERROR_RATES = SPINEL_PROP_THREAD_EXT__BEGIN + 34, 2966 2967 /// EID (Endpoint Identifier) IPv6 Address Cache Table 2968 /** Format `A(t(6SCCt(bL6)t(bSS))) 2969 * 2970 * This property provides Thread EID address cache table. 2971 * 2972 * Data per item is: 2973 * 2974 * `6` : Target IPv6 address 2975 * `S` : RLOC16 of target 2976 * `C` : Age (order of use, 0 indicates most recently used entry) 2977 * `C` : Entry state (values are defined by enumeration `SPINEL_ADDRESS_CACHE_ENTRY_STATE_*`). 2978 * 2979 * `t` : Info when state is `SPINEL_ADDRESS_CACHE_ENTRY_STATE_CACHED` 2980 * `b` : Indicates whether last transaction time and ML-EID are valid. 2981 * `L` : Last transaction time 2982 * `6` : Mesh-local EID 2983 * 2984 * `t` : Info when state is other than `SPINEL_ADDRESS_CACHE_ENTRY_STATE_CACHED` 2985 * `b` : Indicates whether the entry can be evicted. 2986 * `S` : Timeout in seconds 2987 * `S` : Retry delay (applicable if in query-retry state). 2988 * 2989 */ 2990 SPINEL_PROP_THREAD_ADDRESS_CACHE_TABLE = SPINEL_PROP_THREAD_EXT__BEGIN + 35, 2991 2992 /// Thread UDP forward stream 2993 /** Format `dS6S` 2994 * Required capability: `SPINEL_CAP_THREAD_UDP_FORWARD` 2995 * 2996 * This property helps exchange UDP packets with host. 2997 * 2998 * `d`: UDP payload 2999 * `S`: Remote UDP port 3000 * `6`: Remote IPv6 address 3001 * `S`: Local UDP port 3002 * 3003 */ 3004 SPINEL_PROP_THREAD_UDP_FORWARD_STREAM = SPINEL_PROP_THREAD_EXT__BEGIN + 36, 3005 3006 /// Send MGMT_GET Thread Active Operational Dataset 3007 /** Format: `A(t(iD))` - Write only 3008 * 3009 * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET. This 3010 * property further allows the sender to not include a value associated with properties in formatting of `t(iD)`, 3011 * i.e., it should accept either a `t(iD)` or a `t(i)` encoding (in both cases indicating that the associated 3012 * Dataset property should be requested as part of MGMT_GET command). 3013 * 3014 * This is write-only property. When written, it triggers a MGMT_ACTIVE_GET meshcop command to be sent to leader 3015 * requesting the Dataset related properties from the format. The spinel frame response should be a `LAST_STATUS` 3016 * with the status of the transmission of MGMT_ACTIVE_GET command. 3017 * 3018 * In addition to supported properties in SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET, the following property can be 3019 * optionally included in the Dataset: 3020 * 3021 * SPINEL_PROP_DATASET_DEST_ADDRESS 3022 * 3023 */ 3024 SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 37, 3025 3026 /// Send MGMT_GET Thread Pending Operational Dataset 3027 /** Format: `A(t(iD))` - Write only 3028 * 3029 * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET. 3030 * 3031 * This is write-only property. When written, it triggers a MGMT_PENDING_GET meshcop command to be sent to leader 3032 * with the given Dataset. The spinel frame response should be a `LAST_STATUS` with the status of the transmission 3033 * of MGMT_PENDING_GET command. 3034 * 3035 */ 3036 SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 38, 3037 3038 /// Operational Dataset (MGMT_GET) Destination IPv6 Address 3039 /** Format: `6` - No direct read or write 3040 * 3041 * This property specifies the IPv6 destination when sending MGMT_GET command for either Active or Pending Dataset 3042 * if not provided, Leader ALOC address is used as default. 3043 * 3044 * It can only be included in one of the MGMT_GET Dataset properties: 3045 * 3046 * SPINEL_PROP_THREAD_MGMT_GET_ACTIVE_DATASET 3047 * SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET 3048 * 3049 */ 3050 SPINEL_PROP_DATASET_DEST_ADDRESS = SPINEL_PROP_THREAD_EXT__BEGIN + 39, 3051 3052 /// Thread New Operational Dataset 3053 /** Format: `A(t(iD))` - Read only - FTD build only 3054 * 3055 * This property allows host to request NCP to create and return a new Operation Dataset to use when forming a new 3056 * network. 3057 * 3058 * Operational Dataset consists of a set of supported properties (e.g., channel, network key, network name, PAN id, 3059 * etc). Note that not all supported properties may be present (have a value) in a Dataset. 3060 * 3061 * The Dataset value is encoded as an array of structs containing pairs of property key (as `i`) followed by the 3062 * property value (as `D`). The property value must follow the format associated with the corresponding property. 3063 * 3064 * The following properties can be included in a Dataset list: 3065 * 3066 * SPINEL_PROP_DATASET_ACTIVE_TIMESTAMP 3067 * SPINEL_PROP_PHY_CHAN 3068 * SPINEL_PROP_PHY_CHAN_SUPPORTED (Channel Mask Page 0) 3069 * SPINEL_PROP_NET_NETWORK_KEY 3070 * SPINEL_PROP_NET_NETWORK_NAME 3071 * SPINEL_PROP_NET_XPANID 3072 * SPINEL_PROP_MAC_15_4_PANID 3073 * SPINEL_PROP_IPV6_ML_PREFIX 3074 * SPINEL_PROP_NET_PSKC 3075 * SPINEL_PROP_DATASET_SECURITY_POLICY 3076 * 3077 */ 3078 SPINEL_PROP_THREAD_NEW_DATASET = SPINEL_PROP_THREAD_EXT__BEGIN + 40, 3079 3080 /// MAC CSL Period 3081 /** Format: `L` 3082 * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER` 3083 * 3084 * The CSL period in microseconds. Value of 0 indicates that CSL should be disabled. 3085 * 3086 * The CSL period MUST be a multiple of 160 (which is 802.15 "ten symbols time"). 3087 * 3088 */ 3089 SPINEL_PROP_THREAD_CSL_PERIOD = SPINEL_PROP_THREAD_EXT__BEGIN + 41, 3090 3091 /// MAC CSL Timeout 3092 /** Format: `L` 3093 * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER` 3094 * 3095 * The CSL timeout in seconds. 3096 */ 3097 SPINEL_PROP_THREAD_CSL_TIMEOUT = SPINEL_PROP_THREAD_EXT__BEGIN + 42, 3098 3099 /// MAC CSL Channel 3100 /** Format: `C` 3101 * Required capability: `SPINEL_CAP_THREAD_CSL_RECEIVER` 3102 * 3103 * The CSL channel as described in chapter 4.6.5.1.2 of the Thread v1.2.0 Specification. 3104 * Value of 0 means that CSL reception (if enabled) occurs on the Thread Network channel. 3105 * Value from range [11,26] is an alternative channel on which a CSL reception occurs. 3106 */ 3107 SPINEL_PROP_THREAD_CSL_CHANNEL = SPINEL_PROP_THREAD_EXT__BEGIN + 43, 3108 3109 /// Thread Domain Name 3110 /** Format `U` - Read-write 3111 * Required capability: `SPINEL_CAP_NET_THREAD_1_2` 3112 * 3113 * This property is available since Thread 1.2.0. 3114 * Write to this property succeeds only when Thread protocols are disabled. 3115 * 3116 */ 3117 SPINEL_PROP_THREAD_DOMAIN_NAME = SPINEL_PROP_THREAD_EXT__BEGIN + 44, 3118 3119 /// Link metrics query 3120 /** Format: `6CC` - Write-Only 3121 * 3122 * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS` 3123 * 3124 * `6` : IPv6 destination address 3125 * `C` : Series id (0 for Single Probe) 3126 * `C` : List of requested metric ids encoded as bit fields in single byte 3127 * 3128 * +---------------+----+ 3129 * | Metric | Id | 3130 * +---------------+----+ 3131 * | Received PDUs | 0 | 3132 * | LQI | 1 | 3133 * | Link margin | 2 | 3134 * | RSSI | 3 | 3135 * +---------------+----+ 3136 * 3137 * If the query succeeds, the NCP will send a result to the Host using 3138 * @ref SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT. 3139 * 3140 */ 3141 SPINEL_PROP_THREAD_LINK_METRICS_QUERY = SPINEL_PROP_THREAD_EXT__BEGIN + 45, 3142 3143 /// Link metrics query result 3144 /** Format: `6Ct(A(t(CD)))` - Unsolicited notifications only 3145 * 3146 * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS` 3147 * 3148 * `6` : IPv6 destination address 3149 * `C` : Status 3150 * `t(A(t(CD)))` : Array of structs encoded as following: 3151 * `C` : Metric id 3152 * `D` : Metric value 3153 * 3154 * +---------------+----+----------------+ 3155 * | Metric | Id | Value format | 3156 * +---------------+----+----------------+ 3157 * | Received PDUs | 0 | `L` (uint32_t) | 3158 * | LQI | 1 | `C` (uint8_t) | 3159 * | Link margin | 2 | `C` (uint8_t) | 3160 * | RSSI | 3 | `c` (int8_t) | 3161 * +---------------+----+----------------+ 3162 * 3163 */ 3164 SPINEL_PROP_THREAD_LINK_METRICS_QUERY_RESULT = SPINEL_PROP_THREAD_EXT__BEGIN + 46, 3165 3166 /// Link metrics probe 3167 /** Format `6CC` - Write only 3168 * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS` 3169 * 3170 * Send a MLE Link Probe message to the peer. 3171 * 3172 * `6` : IPv6 destination address 3173 * `C` : The Series ID for which this Probe message targets at 3174 * `C` : The length of the Probe message, valid range: [0, 64] 3175 * 3176 */ 3177 SPINEL_PROP_THREAD_LINK_METRICS_PROBE = SPINEL_PROP_THREAD_EXT__BEGIN + 47, 3178 3179 /// Link metrics Enhanced-ACK Based Probing management 3180 /** Format: 6Cd - Write only 3181 * 3182 * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS` 3183 * 3184 * `6` : IPv6 destination address 3185 * `C` : Indicate whether to register or clear the probing. `0` - clear, `1` - register 3186 * `C` : List of requested metric ids encoded as bit fields in single byte 3187 * 3188 * +---------------+----+ 3189 * | Metric | Id | 3190 * +---------------+----+ 3191 * | LQI | 1 | 3192 * | Link margin | 2 | 3193 * | RSSI | 3 | 3194 * +---------------+----+ 3195 * 3196 * Result of configuration is reported asynchronously to the Host using the 3197 * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE. 3198 * 3199 * Whenever Enh-ACK IE report is received it is passed to the Host using the 3200 * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK_IE property. 3201 * 3202 */ 3203 SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK = SPINEL_PROP_THREAD_EXT__BEGIN + 48, 3204 3205 /// Link metrics Enhanced-ACK Based Probing IE report 3206 /** Format: SEA(t(CD)) - Unsolicited notifications only 3207 * 3208 * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS` 3209 * 3210 * `S` : Short address of the Probing Subject 3211 * `E` : Extended address of the Probing Subject 3212 * `t(A(t(CD)))` : Struct that contains array of structs encoded as following: 3213 * `C` : Metric id 3214 * `D` : Metric value 3215 * 3216 * +---------------+----+----------------+ 3217 * | Metric | Id | Value format | 3218 * +---------------+----+----------------+ 3219 * | LQI | 1 | `C` (uint8_t) | 3220 * | Link margin | 2 | `C` (uint8_t) | 3221 * | RSSI | 3 | `c` (int8_t) | 3222 * +---------------+----+----------------+ 3223 * 3224 */ 3225 SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK_IE = SPINEL_PROP_THREAD_EXT__BEGIN + 49, 3226 3227 /// Link metrics Forward Tracking Series management 3228 /** Format: 6CCC - Write only 3229 * 3230 * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS` 3231 * 3232 * `6` : IPv6 destination address 3233 * `C` : Series id 3234 * `C` : Tracked frame types encoded as bit fields in single byte, if equal to zero, 3235 * accounting is stopped and a series is removed 3236 * `C` : Requested metric ids encoded as bit fields in single byte 3237 * 3238 * +------------------+----+ 3239 * | Frame type | Id | 3240 * +------------------+----+ 3241 * | MLE Link Probe | 0 | 3242 * | MAC Data | 1 | 3243 * | MAC Data Request | 2 | 3244 * | MAC ACK | 3 | 3245 * +------------------+----+ 3246 * 3247 * +---------------+----+ 3248 * | Metric | Id | 3249 * +---------------+----+ 3250 * | Received PDUs | 0 | 3251 * | LQI | 1 | 3252 * | Link margin | 2 | 3253 * | RSSI | 3 | 3254 * +---------------+----+ 3255 * 3256 * Result of configuration is reported asynchronously to the Host using the 3257 * @ref SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE. 3258 * 3259 */ 3260 SPINEL_PROP_THREAD_LINK_METRICS_MGMT_FORWARD = SPINEL_PROP_THREAD_EXT__BEGIN + 50, 3261 3262 /// Link metrics management response 3263 /** Format: 6C - Unsolicited notifications only 3264 * 3265 * Required capability: `SPINEL_CAP_THREAD_LINK_METRICS` 3266 * 3267 * `6` : IPv6 source address 3268 * `C` : Received status 3269 * 3270 */ 3271 SPINEL_PROP_THREAD_LINK_METRICS_MGMT_RESPONSE = SPINEL_PROP_THREAD_EXT__BEGIN + 51, 3272 3273 /// Multicast Listeners Register Request 3274 /** Format `t(A(6))A(t(CD))` - Write-only 3275 * Required capability: `SPINEL_CAP_NET_THREAD_1_2` 3276 * 3277 * `t(A(6))`: Array of IPv6 multicast addresses 3278 * `A(t(CD))`: Array of structs holding optional parameters as follows 3279 * `C`: Parameter id 3280 * `D`: Parameter value 3281 * 3282 * +----------------------------------------------------------------+ 3283 * | Id: SPINEL_THREAD_MLR_PARAMID_TIMEOUT | 3284 * | Type: `L` | 3285 * | Description: Timeout in seconds. If this optional parameter is | 3286 * | omitted, the default value of the BBR will be used. | 3287 * | Special values: | 3288 * | 0 causes given addresses to be removed | 3289 * | 0xFFFFFFFF is permanent and persistent registration | 3290 * +----------------------------------------------------------------+ 3291 * 3292 * Write to this property initiates update of Multicast Listeners Table on the primary BBR. 3293 * If the write succeeded, the result of network operation will be notified later by the 3294 * SPINEL_PROP_THREAD_MLR_RESPONSE property. If the write fails, no MLR.req is issued and 3295 * notification through the SPINEL_PROP_THREAD_MLR_RESPONSE property will not occur. 3296 * 3297 */ 3298 SPINEL_PROP_THREAD_MLR_REQUEST = SPINEL_PROP_THREAD_EXT__BEGIN + 52, 3299 3300 /// Multicast Listeners Register Response 3301 /** Format `CCt(A(6))` - Unsolicited notifications only 3302 * Required capability: `SPINEL_CAP_NET_THREAD_1_2` 3303 * 3304 * `C`: Status 3305 * `C`: MlrStatus (The Multicast Listener Registration Status) 3306 * `A(6)`: Array of IPv6 addresses that failed to be updated on the primary BBR 3307 * 3308 * This property is notified asynchronously when the NCP receives MLR.rsp following 3309 * previous write to the SPINEL_PROP_THREAD_MLR_REQUEST property. 3310 */ 3311 SPINEL_PROP_THREAD_MLR_RESPONSE = SPINEL_PROP_THREAD_EXT__BEGIN + 53, 3312 3313 /// Interface Identifier specified for Thread Domain Unicast Address. 3314 /** Format: `A(C)` - Read-write 3315 * 3316 * `A(C)`: Interface Identifier (8 bytes). 3317 * 3318 * Required capability: SPINEL_CAP_DUA 3319 * 3320 * If write to this property is performed without specified parameter 3321 * the Interface Identifier of the Thread Domain Unicast Address will be cleared. 3322 * If the DUA Interface Identifier is cleared on the NCP device, 3323 * the get spinel property command will be returned successfully without specified parameter. 3324 * 3325 */ 3326 SPINEL_PROP_THREAD_DUA_ID = SPINEL_PROP_THREAD_EXT__BEGIN + 54, 3327 3328 /// Thread 1.2 Primary Backbone Router information in the Thread Network. 3329 /** Format: `SSLC` - Read-Only 3330 * 3331 * Required capability: `SPINEL_CAP_NET_THREAD_1_2` 3332 * 3333 * `S`: Server. 3334 * `S`: Reregistration Delay (in seconds). 3335 * `L`: Multicast Listener Registration Timeout (in seconds). 3336 * `C`: Sequence Number. 3337 * 3338 */ 3339 SPINEL_PROP_THREAD_BACKBONE_ROUTER_PRIMARY = SPINEL_PROP_THREAD_EXT__BEGIN + 55, 3340 3341 /// Thread 1.2 Backbone Router local state. 3342 /** Format: `C` - Read-Write 3343 * 3344 * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER` 3345 * 3346 * The valid values are specified by SPINEL_THREAD_BACKBONE_ROUTER_STATE_<state> enumeration. 3347 * Backbone functionality will be disabled if SPINEL_THREAD_BACKBONE_ROUTER_STATE_DISABLED 3348 * is written to this property, enabled otherwise. 3349 * 3350 */ 3351 SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_STATE = SPINEL_PROP_THREAD_EXT__BEGIN + 56, 3352 3353 /// Local Thread 1.2 Backbone Router configuration. 3354 /** Format: SLC - Read-Write 3355 * 3356 * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER` 3357 * 3358 * `S`: Reregistration Delay (in seconds). 3359 * `L`: Multicast Listener Registration Timeout (in seconds). 3360 * `C`: Sequence Number. 3361 * 3362 */ 3363 SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_CONFIG = SPINEL_PROP_THREAD_EXT__BEGIN + 57, 3364 3365 /// Register local Thread 1.2 Backbone Router configuration. 3366 /** Format: Empty (Write only). 3367 * 3368 * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER` 3369 * 3370 * Writing to this property (with any value) will register local Backbone Router configuration. 3371 * 3372 */ 3373 SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTER = SPINEL_PROP_THREAD_EXT__BEGIN + 58, 3374 3375 /// Thread 1.2 Backbone Router registration jitter. 3376 /** Format: `C` - Read-Write 3377 * 3378 * Required capability: `SPINEL_CAP_THREAD_BACKBONE_ROUTER` 3379 * 3380 * `C`: Backbone Router registration jitter. 3381 * 3382 */ 3383 SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTRATION_JITTER = SPINEL_PROP_THREAD_EXT__BEGIN + 59, 3384 3385 SPINEL_PROP_THREAD_EXT__END = 0x1600, 3386 3387 SPINEL_PROP_IPV6__BEGIN = 0x60, 3388 3389 /// Link-Local IPv6 Address 3390 /** Format: `6` - Read only 3391 * 3392 */ 3393 SPINEL_PROP_IPV6_LL_ADDR = SPINEL_PROP_IPV6__BEGIN + 0, ///< [6] 3394 3395 /// Mesh Local IPv6 Address 3396 /** Format: `6` - Read only 3397 * 3398 */ 3399 SPINEL_PROP_IPV6_ML_ADDR = SPINEL_PROP_IPV6__BEGIN + 1, 3400 3401 /// Mesh Local Prefix 3402 /** Format: `6C` - Read-write 3403 * 3404 * Provides Mesh Local Prefix 3405 * 3406 * `6`: Mesh local prefix 3407 * `C` : Prefix length (64 bit for Thread). 3408 * 3409 */ 3410 SPINEL_PROP_IPV6_ML_PREFIX = SPINEL_PROP_IPV6__BEGIN + 2, 3411 3412 /// IPv6 (Unicast) Address Table 3413 /** Format: `A(t(6CLLC))` 3414 * 3415 * This property provides all unicast addresses. 3416 * 3417 * Array of structures containing: 3418 * 3419 * `6`: IPv6 Address 3420 * `C`: Network Prefix Length (in bits) 3421 * `L`: Valid Lifetime 3422 * `L`: Preferred Lifetime 3423 * 3424 */ 3425 SPINEL_PROP_IPV6_ADDRESS_TABLE = SPINEL_PROP_IPV6__BEGIN + 3, 3426 3427 /// IPv6 Route Table - Deprecated 3428 SPINEL_PROP_IPV6_ROUTE_TABLE = SPINEL_PROP_IPV6__BEGIN + 4, 3429 3430 /// IPv6 ICMP Ping Offload 3431 /** Format: `b` 3432 * 3433 * Allow the NCP to directly respond to ICMP ping requests. If this is 3434 * turned on, ping request ICMP packets will not be passed to the host. 3435 * 3436 * Default value is `false`. 3437 */ 3438 SPINEL_PROP_IPV6_ICMP_PING_OFFLOAD = SPINEL_PROP_IPV6__BEGIN + 5, 3439 3440 /// IPv6 Multicast Address Table 3441 /** Format: `A(t(6))` 3442 * 3443 * This property provides all multicast addresses. 3444 * 3445 */ 3446 SPINEL_PROP_IPV6_MULTICAST_ADDRESS_TABLE = SPINEL_PROP_IPV6__BEGIN + 6, 3447 3448 /// IPv6 ICMP Ping Offload 3449 /** Format: `C` 3450 * 3451 * Allow the NCP to directly respond to ICMP ping requests. If this is 3452 * turned on, ping request ICMP packets will not be passed to the host. 3453 * 3454 * This property allows enabling responses sent to unicast only, multicast 3455 * only, or both. The valid value are defined by enumeration 3456 * `spinel_ipv6_icmp_ping_offload_mode_t`. 3457 * 3458 * SPINEL_IPV6_ICMP_PING_OFFLOAD_DISABLED = 0 3459 * SPINEL_IPV6_ICMP_PING_OFFLOAD_UNICAST_ONLY = 1 3460 * SPINEL_IPV6_ICMP_PING_OFFLOAD_MULTICAST_ONLY = 2 3461 * SPINEL_IPV6_ICMP_PING_OFFLOAD_ALL = 3 3462 * SPINEL_IPV6_ICMP_PING_OFFLOAD_RLOC_ALOC_ONLY = 4 3463 * 3464 * Default value is `NET_IPV6_ICMP_PING_OFFLOAD_DISABLED`. 3465 * 3466 */ 3467 SPINEL_PROP_IPV6_ICMP_PING_OFFLOAD_MODE = SPINEL_PROP_IPV6__BEGIN + 7, ///< [b] 3468 3469 SPINEL_PROP_IPV6__END = 0x70, 3470 3471 SPINEL_PROP_IPV6_EXT__BEGIN = 0x1600, 3472 SPINEL_PROP_IPV6_EXT__END = 0x1700, 3473 3474 SPINEL_PROP_STREAM__BEGIN = 0x70, 3475 3476 /// Debug Stream 3477 /** Format: `U` (stream, read only) 3478 * 3479 * This property is a streaming property, meaning that you cannot explicitly 3480 * fetch the value of this property. The stream provides human-readable debugging 3481 * output which may be displayed in the host logs. 3482 * 3483 * The location of newline characters is not assumed by the host: it is 3484 * the NCP's responsibility to insert newline characters where needed, 3485 * just like with any other text stream. 3486 * 3487 * To receive the debugging stream, you wait for `CMD_PROP_VALUE_IS` 3488 * commands for this property from the NCP. 3489 * 3490 */ 3491 SPINEL_PROP_STREAM_DEBUG = SPINEL_PROP_STREAM__BEGIN + 0, 3492 3493 /// Raw Stream 3494 /** Format: `dD` (stream, read only) 3495 * Required Capability: SPINEL_CAP_MAC_RAW or SPINEL_CAP_CONFIG_RADIO 3496 * 3497 * This stream provides the capability of sending and receiving raw 15.4 frames 3498 * to and from the radio. The exact format of the frame metadata and data is 3499 * dependent on the MAC and PHY being used. 3500 * 3501 * This property is a streaming property, meaning that you cannot explicitly 3502 * fetch the value of this property. To receive traffic, you wait for 3503 * `CMD_PROP_VALUE_IS` commands with this property id from the NCP. 3504 * 3505 * The general format of this property is: 3506 * 3507 * `d` : frame data 3508 * `D` : frame meta data 3509 * 3510 * The frame meta data is optional. Frame metadata MAY be empty or partially 3511 * specified. Partially specified metadata MUST be accepted. Default values 3512 * are used for all unspecified fields. 3513 * 3514 * The frame metadata field consists of the following fields: 3515 * 3516 * `c` : Received Signal Strength (RSSI) in dBm - default is -128 3517 * `c` : Noise floor in dBm - default is -128 3518 * `S` : Flags (see below). 3519 * `d` : PHY-specific data/struct 3520 * `d` : Vendor-specific data/struct 3521 * 3522 * Flags fields are defined by the following enumeration bitfields: 3523 * 3524 * SPINEL_MD_FLAG_TX = 0x0001 : Packet was transmitted, not received. 3525 * SPINEL_MD_FLAG_BAD_FCS = 0x0004 : Packet was received with bad FCS 3526 * SPINEL_MD_FLAG_DUPE = 0x0008 : Packet seems to be a duplicate 3527 * SPINEL_MD_FLAG_RESERVED = 0xFFF2 : Flags reserved for future use. 3528 * 3529 * The format of PHY-specific data for a Thread device contains the following 3530 * optional fields: 3531 3532 * `C` : 802.15.4 channel (Receive channel) 3533 * `C` : IEEE 802.15.4 LQI 3534 * `L` : The timestamp milliseconds 3535 * `S` : The timestamp microseconds, offset to mMsec 3536 * 3537 * Frames written to this stream with `CMD_PROP_VALUE_SET` will be sent out 3538 * over the radio. This allows the caller to use the radio directly. 3539 * 3540 * The frame meta data for the `CMD_PROP_VALUE_SET` contains the following 3541 * fields. Default values are used for all unspecified fields. 3542 * 3543 * `C` : Channel (for frame tx) - MUST be included. 3544 * `C` : Maximum number of backoffs attempts before declaring CCA failure 3545 * (use Thread stack default if not specified) 3546 * `C` : Maximum number of retries allowed after a transmission failure 3547 * (use Thread stack default if not specified) 3548 * `b` : Set to true to enable CSMA-CA for this packet, false otherwise. 3549 * (default true). 3550 * `b` : Set to true to indicate if header is updated - related to 3551 * `mIsHeaderUpdated` in `otRadioFrame` (default false). 3552 * `b` : Set to true to indicate it is a retransmission - related to 3553 * `mIsARetx` in `otRadioFrame` (default false). 3554 * `b` : Set to true to indicate security was processed on tx frame 3555 * `mIsSecurityProcessed` in `otRadioFrame` (default false). 3556 * `L` : TX delay interval used for CSL - related to `mTxDelay` in 3557 * `otRadioFrame` (default zero). 3558 * `L` : TX delay based time used for CSL - related to `mTxDelayBaseTime` 3559 * in `otRadioFrame` (default zero). 3560 * `C` : RX channel after TX done (default assumed to be same as 3561 * channel in metadata) 3562 * 3563 */ 3564 SPINEL_PROP_STREAM_RAW = SPINEL_PROP_STREAM__BEGIN + 1, 3565 3566 /// (IPv6) Network Stream 3567 /** Format: `dD` (stream, read only) 3568 * 3569 * This stream provides the capability of sending and receiving (IPv6) 3570 * data packets to and from the currently attached network. The packets 3571 * are sent or received securely (encryption and authentication). 3572 * 3573 * This property is a streaming property, meaning that you cannot explicitly 3574 * fetch the value of this property. To receive traffic, you wait for 3575 * `CMD_PROP_VALUE_IS` commands with this property id from the NCP. 3576 * 3577 * To send network packets, you call `CMD_PROP_VALUE_SET` on this property with 3578 * the value of the packet. 3579 * 3580 * The general format of this property is: 3581 * 3582 * `d` : packet data 3583 * `D` : packet meta data 3584 * 3585 * The packet metadata is optional. Packet meta data MAY be empty or partially 3586 * specified. Partially specified metadata MUST be accepted. Default values 3587 * are used for all unspecified fields. 3588 * 3589 * For OpenThread the meta data is currently empty. 3590 * 3591 */ 3592 SPINEL_PROP_STREAM_NET = SPINEL_PROP_STREAM__BEGIN + 2, 3593 3594 /// (IPv6) Network Stream Insecure 3595 /** Format: `dD` (stream, read only) 3596 * 3597 * This stream provides the capability of sending and receiving unencrypted 3598 * and unauthenticated data packets to and from nearby devices for the 3599 * purposes of device commissioning. 3600 * 3601 * This property is a streaming property, meaning that you cannot explicitly 3602 * fetch the value of this property. To receive traffic, you wait for 3603 * `CMD_PROP_VALUE_IS` commands with this property id from the NCP. 3604 * 3605 * To send network packets, you call `CMD_PROP_VALUE_SET` on this property with 3606 * the value of the packet. 3607 * 3608 * The general format of this property is: 3609 * 3610 * `d` : packet data 3611 * `D` : packet meta data 3612 * 3613 * The packet metadata is optional. Packet meta data MAY be empty or partially 3614 * specified. Partially specified metadata MUST be accepted. Default values 3615 * are used for all unspecified fields. 3616 * 3617 * For OpenThread the meta data is currently empty. 3618 * 3619 */ 3620 SPINEL_PROP_STREAM_NET_INSECURE = SPINEL_PROP_STREAM__BEGIN + 3, 3621 3622 /// Log Stream 3623 /** Format: `UD` (stream, read only) 3624 * 3625 * This property is a read-only streaming property which provides 3626 * formatted log string from NCP. This property provides asynchronous 3627 * `CMD_PROP_VALUE_IS` updates with a new log string and includes 3628 * optional meta data. 3629 * 3630 * `U`: The log string 3631 * `D`: Log metadata (optional). 3632 * 3633 * Any data after the log string is considered metadata and is OPTIONAL. 3634 * Presence of `SPINEL_CAP_OPENTHREAD_LOG_METADATA` capability 3635 * indicates that OpenThread log metadata format is used as defined 3636 * below: 3637 * 3638 * `C`: Log level (as per definition in enumeration 3639 * `SPINEL_NCP_LOG_LEVEL_<level>`) 3640 * `i`: OpenThread Log region (as per definition in enumeration 3641 * `SPINEL_NCP_LOG_REGION_<region>). 3642 * `X`: Log timestamp = <timestamp_base> + <current_time_ms> 3643 * 3644 */ 3645 SPINEL_PROP_STREAM_LOG = SPINEL_PROP_STREAM__BEGIN + 4, 3646 3647 SPINEL_PROP_STREAM__END = 0x80, 3648 3649 SPINEL_PROP_STREAM_EXT__BEGIN = 0x1700, 3650 SPINEL_PROP_STREAM_EXT__END = 0x1800, 3651 3652 SPINEL_PROP_MESHCOP__BEGIN = 0x80, 3653 3654 // Thread Joiner State 3655 /** Format `C` - Read Only 3656 * 3657 * Required capability: SPINEL_CAP_THREAD_JOINER 3658 * 3659 * The valid values are specified by `spinel_meshcop_joiner_state_t` (`SPINEL_MESHCOP_JOINER_STATE_<state>`) 3660 * enumeration. 3661 * 3662 */ 3663 SPINEL_PROP_MESHCOP_JOINER_STATE = SPINEL_PROP_MESHCOP__BEGIN + 0, ///<[C] 3664 3665 /// Thread Joiner Commissioning command and the parameters 3666 /** Format `b` or `bU(UUUUU)` (fields in parenthesis are optional) - Write Only 3667 * 3668 * This property starts or stops Joiner's commissioning process 3669 * 3670 * Required capability: SPINEL_CAP_THREAD_JOINER 3671 * 3672 * Writing to this property starts/stops the Joiner commissioning process. 3673 * The immediate `VALUE_IS` response indicates success/failure of the starting/stopping 3674 * the Joiner commissioning process. 3675 * 3676 * After a successful start operation, the join process outcome is reported through an 3677 * asynchronous `VALUE_IS(LAST_STATUS)` update with one of the following error status values: 3678 * 3679 * - SPINEL_STATUS_JOIN_SUCCESS the join process succeeded. 3680 * - SPINEL_STATUS_JOIN_SECURITY the join process failed due to security credentials. 3681 * - SPINEL_STATUS_JOIN_NO_PEERS no joinable network was discovered. 3682 * - SPINEL_STATUS_JOIN_RSP_TIMEOUT if a response timed out. 3683 * - SPINEL_STATUS_JOIN_FAILURE join failure. 3684 * 3685 * Frame format: 3686 * 3687 * `b` : Start or stop commissioning process (true to start). 3688 * 3689 * Only if the start commissioning. 3690 * 3691 * `U` : Joiner's PSKd. 3692 * 3693 * The next fields are all optional. If not provided, OpenThread default values would be used. 3694 * 3695 * `U` : Provisioning URL (use empty string if not required). 3696 * `U` : Vendor Name. If not specified or empty string, use OpenThread default (PACKAGE_NAME). 3697 * `U` : Vendor Model. If not specified or empty string, use OpenThread default (OPENTHREAD_CONFIG_PLATFORM_INFO). 3698 * `U` : Vendor Sw Version. If not specified or empty string, use OpenThread default (PACKAGE_VERSION). 3699 * `U` : Vendor Data String. Will not be appended if not specified. 3700 * 3701 */ 3702 SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING = SPINEL_PROP_MESHCOP__BEGIN + 1, 3703 3704 // Thread Commissioner State 3705 /** Format `C` 3706 * 3707 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3708 * 3709 * The valid values are specified by SPINEL_MESHCOP_COMMISSIONER_STATE_<state> enumeration. 3710 * 3711 */ 3712 SPINEL_PROP_MESHCOP_COMMISSIONER_STATE = SPINEL_PROP_MESHCOP__BEGIN + 2, 3713 3714 // Thread Commissioner Joiners 3715 /** Format `A(t(t(E|CX)UL))` - get, insert or remove. 3716 * 3717 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3718 * 3719 * Data per array entry is: 3720 * 3721 * `t()` | `t(E)` | `t(CX)` : Joiner info struct (formatting varies). 3722 * 3723 * - `t()` or empty struct indicates any joiner. 3724 * - `t(E)` specifies the Joiner EUI-64. 3725 * - `t(CX) specifies Joiner Discerner, `C` is Discerner length (in bits), and `X` is Discerner value. 3726 * 3727 * The struct is followed by: 3728 * 3729 * `L` : Timeout after which to remove Joiner (when written should be in seconds, when read is in milliseconds) 3730 * `U` : PSKd 3731 * 3732 * For CMD_PROP_VALUE_REMOVE the timeout and PSKd are optional. 3733 * 3734 */ 3735 SPINEL_PROP_MESHCOP_COMMISSIONER_JOINERS = SPINEL_PROP_MESHCOP__BEGIN + 3, 3736 3737 // Thread Commissioner Provisioning URL 3738 /** Format `U` 3739 * 3740 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3741 * 3742 */ 3743 SPINEL_PROP_MESHCOP_COMMISSIONER_PROVISIONING_URL = SPINEL_PROP_MESHCOP__BEGIN + 4, 3744 3745 // Thread Commissioner Session ID 3746 /** Format `S` - Read only 3747 * 3748 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3749 * 3750 */ 3751 SPINEL_PROP_MESHCOP_COMMISSIONER_SESSION_ID = SPINEL_PROP_MESHCOP__BEGIN + 5, 3752 3753 /// Thread Joiner Discerner 3754 /** Format `CX` - Read-write 3755 * 3756 * Required capability: SPINEL_CAP_THREAD_JOINER 3757 * 3758 * This property represents a Joiner Discerner. 3759 * 3760 * The Joiner Discerner is used to calculate the Joiner ID used during commissioning/joining process. 3761 * 3762 * By default (when a discerner is not provided or cleared), Joiner ID is derived as first 64 bits of the result 3763 * of computing SHA-256 over factory-assigned IEEE EUI-64. Note that this is the main behavior expected by Thread 3764 * specification. 3765 * 3766 * Format: 3767 * 3768 * 'C' : The Joiner Discerner bit length (number of bits). 3769 * `X` : The Joiner Discerner value (64-bit unsigned) - Only present/applicable when length is non-zero. 3770 * 3771 * When writing to this property, the length can be set to zero to clear any previously set Joiner Discerner value. 3772 * 3773 * When reading this property if there is no currently set Joiner Discerner, zero is returned as the length (with 3774 * no value field). 3775 * 3776 */ 3777 SPINEL_PROP_MESHCOP_JOINER_DISCERNER = SPINEL_PROP_MESHCOP__BEGIN + 6, 3778 3779 SPINEL_PROP_MESHCOP__END = 0x90, 3780 3781 SPINEL_PROP_MESHCOP_EXT__BEGIN = 0x1800, 3782 3783 // Thread Commissioner Announce Begin 3784 /** Format `LCS6` - Write only 3785 * 3786 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3787 * 3788 * Writing to this property sends an Announce Begin message with the specified parameters. Response is a 3789 * `LAST_STATUS` update with status of operation. 3790 * 3791 * `L` : Channel mask 3792 * `C` : Number of messages per channel 3793 * `S` : The time between two successive MLE Announce transmissions (milliseconds) 3794 * `6` : IPv6 destination 3795 * 3796 */ 3797 SPINEL_PROP_MESHCOP_COMMISSIONER_ANNOUNCE_BEGIN = SPINEL_PROP_MESHCOP_EXT__BEGIN + 0, 3798 3799 // Thread Commissioner Energy Scan Query 3800 /** Format `LCSS6` - Write only 3801 * 3802 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3803 * 3804 * Writing to this property sends an Energy Scan Query message with the specified parameters. Response is a 3805 * `LAST_STATUS` with status of operation. The energy scan results are emitted asynchronously through 3806 * `SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN_RESULT` updates. 3807 * 3808 * Format is: 3809 * 3810 * `L` : Channel mask 3811 * `C` : The number of energy measurements per channel 3812 * `S` : The time between energy measurements (milliseconds) 3813 * `S` : The scan duration for each energy measurement (milliseconds) 3814 * `6` : IPv6 destination. 3815 * 3816 */ 3817 SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN = SPINEL_PROP_MESHCOP_EXT__BEGIN + 1, 3818 3819 // Thread Commissioner Energy Scan Result 3820 /** Format `Ld` - Asynchronous event only 3821 * 3822 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3823 * 3824 * This property provides asynchronous `CMD_PROP_VALUE_INSERTED` updates to report energy scan results for a 3825 * previously sent Energy Scan Query message (please see `SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN`). 3826 * 3827 * Format is: 3828 * 3829 * `L` : Channel mask 3830 * `d` : Energy measurement data (note that `d` encoding includes the length) 3831 * 3832 */ 3833 SPINEL_PROP_MESHCOP_COMMISSIONER_ENERGY_SCAN_RESULT = SPINEL_PROP_MESHCOP_EXT__BEGIN + 2, 3834 3835 // Thread Commissioner PAN ID Query 3836 /** Format `SL6` - Write only 3837 * 3838 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3839 * 3840 * Writing to this property sends a PAN ID Query message with the specified parameters. Response is a 3841 * `LAST_STATUS` with status of operation. The PAN ID Conflict results are emitted asynchronously through 3842 * `SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_CONFLICT_RESULT` updates. 3843 * 3844 * Format is: 3845 * 3846 * `S` : PAN ID to query 3847 * `L` : Channel mask 3848 * `6` : IPv6 destination 3849 * 3850 */ 3851 SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_QUERY = SPINEL_PROP_MESHCOP_EXT__BEGIN + 3, 3852 3853 // Thread Commissioner PAN ID Conflict Result 3854 /** Format `SL` - Asynchronous event only 3855 * 3856 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3857 * 3858 * This property provides asynchronous `CMD_PROP_VALUE_INSERTED` updates to report PAN ID conflict results for a 3859 * previously sent PAN ID Query message (please see `SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_QUERY`). 3860 * 3861 * Format is: 3862 * 3863 * `S` : The PAN ID 3864 * `L` : Channel mask 3865 * 3866 */ 3867 SPINEL_PROP_MESHCOP_COMMISSIONER_PAN_ID_CONFLICT_RESULT = SPINEL_PROP_MESHCOP_EXT__BEGIN + 4, 3868 3869 // Thread Commissioner Send MGMT_COMMISSIONER_GET 3870 /** Format `d` - Write only 3871 * 3872 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3873 * 3874 * Writing to this property sends a MGMT_COMMISSIONER_GET message with the specified parameters. Response is a 3875 * `LAST_STATUS` with status of operation. 3876 * 3877 * Format is: 3878 * 3879 * `d` : List of TLV types to get 3880 * 3881 */ 3882 SPINEL_PROP_MESHCOP_COMMISSIONER_MGMT_GET = SPINEL_PROP_MESHCOP_EXT__BEGIN + 5, 3883 3884 // Thread Commissioner Send MGMT_COMMISSIONER_SET 3885 /** Format `d` - Write only 3886 * 3887 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3888 * 3889 * Writing to this property sends a MGMT_COMMISSIONER_SET message with the specified parameters. Response is a 3890 * `LAST_STATUS` with status of operation. 3891 * 3892 * Format is: 3893 * 3894 * `d` : TLV encoded data 3895 * 3896 */ 3897 SPINEL_PROP_MESHCOP_COMMISSIONER_MGMT_SET = SPINEL_PROP_MESHCOP_EXT__BEGIN + 6, 3898 3899 // Thread Commissioner Generate PSKc 3900 /** Format: `UUd` - Write only 3901 * 3902 * Required capability: SPINEL_CAP_THREAD_COMMISSIONER 3903 * 3904 * Writing to this property allows user to generate PSKc from a given commissioning pass-phrase, network name, 3905 * extended PAN Id. 3906 * 3907 * Written value format is: 3908 * 3909 * `U` : The commissioning pass-phrase. 3910 * `U` : Network Name. 3911 * `d` : Extended PAN ID. 3912 * 3913 * The response on success would be a `VALUE_IS` command with the PSKc with format below: 3914 * 3915 * `D` : The PSKc 3916 * 3917 * On a failure a `LAST_STATUS` is emitted with the error status. 3918 * 3919 */ 3920 SPINEL_PROP_MESHCOP_COMMISSIONER_GENERATE_PSKC = SPINEL_PROP_MESHCOP_EXT__BEGIN + 7, 3921 3922 SPINEL_PROP_MESHCOP_EXT__END = 0x1900, 3923 3924 SPINEL_PROP_OPENTHREAD__BEGIN = 0x1900, 3925 3926 /// Channel Manager - Channel Change New Channel 3927 /** Format: `C` (read-write) 3928 * 3929 * Required capability: SPINEL_CAP_CHANNEL_MANAGER 3930 * 3931 * Setting this property triggers the Channel Manager to start 3932 * a channel change process. The network switches to the given 3933 * channel after the specified delay (see `CHANNEL_MANAGER_DELAY`). 3934 * 3935 * A subsequent write to this property will cancel an ongoing 3936 * (previously requested) channel change. 3937 * 3938 */ 3939 SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL = SPINEL_PROP_OPENTHREAD__BEGIN + 0, 3940 3941 /// Channel Manager - Channel Change Delay 3942 /** Format 'S' 3943 * Units: seconds 3944 * 3945 * Required capability: SPINEL_CAP_CHANNEL_MANAGER 3946 * 3947 * This property specifies the delay (in seconds) to be used for 3948 * a channel change request. 3949 * 3950 * The delay should preferably be longer than maximum data poll 3951 * interval used by all sleepy-end-devices within the Thread 3952 * network. 3953 * 3954 */ 3955 SPINEL_PROP_CHANNEL_MANAGER_DELAY = SPINEL_PROP_OPENTHREAD__BEGIN + 1, 3956 3957 /// Channel Manager Supported Channels 3958 /** Format 'A(C)' 3959 * 3960 * Required capability: SPINEL_CAP_CHANNEL_MANAGER 3961 * 3962 * This property specifies the list of supported channels. 3963 * 3964 */ 3965 SPINEL_PROP_CHANNEL_MANAGER_SUPPORTED_CHANNELS = SPINEL_PROP_OPENTHREAD__BEGIN + 2, 3966 3967 /// Channel Manager Favored Channels 3968 /** Format 'A(C)' 3969 * 3970 * Required capability: SPINEL_CAP_CHANNEL_MANAGER 3971 * 3972 * This property specifies the list of favored channels (when `ChannelManager` is asked to select channel) 3973 * 3974 */ 3975 SPINEL_PROP_CHANNEL_MANAGER_FAVORED_CHANNELS = SPINEL_PROP_OPENTHREAD__BEGIN + 3, 3976 3977 /// Channel Manager Channel Select Trigger 3978 /** Format 'b' 3979 * 3980 * Required capability: SPINEL_CAP_CHANNEL_MANAGER 3981 * 3982 * Writing to this property triggers a request on `ChannelManager` to select a new channel. 3983 * 3984 * Once a Channel Select is triggered, the Channel Manager will perform the following 3 steps: 3985 * 3986 * 1) `ChannelManager` decides if the channel change would be helpful. This check can be skipped if in the input 3987 * boolean to this property is set to `true` (skipping the quality check). 3988 * This step uses the collected link quality metrics on the device such as CCA failure rate, frame and message 3989 * error rates per neighbor, etc. to determine if the current channel quality is at the level that justifies 3990 * a channel change. 3991 * 3992 * 2) If first step passes, then `ChannelManager` selects a potentially better channel. It uses the collected 3993 * channel quality data by `ChannelMonitor` module. The supported and favored channels are used at this step. 3994 * 3995 * 3) If the newly selected channel is different from the current channel, `ChannelManager` requests/starts the 3996 * channel change process. 3997 * 3998 * Reading this property always yields `false`. 3999 * 4000 */ 4001 SPINEL_PROP_CHANNEL_MANAGER_CHANNEL_SELECT = SPINEL_PROP_OPENTHREAD__BEGIN + 4, 4002 4003 /// Channel Manager Auto Channel Selection Enabled 4004 /** Format 'b' 4005 * 4006 * Required capability: SPINEL_CAP_CHANNEL_MANAGER 4007 * 4008 * This property indicates if auto-channel-selection functionality is enabled/disabled on `ChannelManager`. 4009 * 4010 * When enabled, `ChannelManager` will periodically checks and attempts to select a new channel. The period interval 4011 * is specified by `SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_INTERVAL`. 4012 * 4013 */ 4014 SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 5, 4015 4016 /// Channel Manager Auto Channel Selection Interval 4017 /** Format 'L' 4018 * units: seconds 4019 * 4020 * Required capability: SPINEL_CAP_CHANNEL_MANAGER 4021 * 4022 * This property specifies the auto-channel-selection check interval (in seconds). 4023 * 4024 */ 4025 SPINEL_PROP_CHANNEL_MANAGER_AUTO_SELECT_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 6, 4026 4027 /// Thread network time. 4028 /** Format: `Xc` - Read only 4029 * 4030 * Data per item is: 4031 * 4032 * `X`: The Thread network time, in microseconds. 4033 * `c`: Time synchronization status. 4034 * 4035 */ 4036 SPINEL_PROP_THREAD_NETWORK_TIME = SPINEL_PROP_OPENTHREAD__BEGIN + 7, 4037 4038 /// Thread time synchronization period 4039 /** Format: `S` - Read-Write 4040 * 4041 * Data per item is: 4042 * 4043 * `S`: Time synchronization period, in seconds. 4044 * 4045 */ 4046 SPINEL_PROP_TIME_SYNC_PERIOD = SPINEL_PROP_OPENTHREAD__BEGIN + 8, 4047 4048 /// Thread Time synchronization XTAL accuracy threshold for Router 4049 /** Format: `S` - Read-Write 4050 * 4051 * Data per item is: 4052 * 4053 * `S`: The XTAL accuracy threshold for Router, in PPM. 4054 * 4055 */ 4056 SPINEL_PROP_TIME_SYNC_XTAL_THRESHOLD = SPINEL_PROP_OPENTHREAD__BEGIN + 9, 4057 4058 /// Child Supervision Interval 4059 /** Format: `S` - Read-Write 4060 * Units: Seconds 4061 * 4062 * Required capability: `SPINEL_CAP_CHILD_SUPERVISION` 4063 * 4064 * The child supervision interval (in seconds). Zero indicates that child supervision is disabled. 4065 * 4066 * When enabled, Child supervision feature ensures that at least one message is sent to every sleepy child within 4067 * the given supervision interval. If there is no other message, a supervision message (a data message with empty 4068 * payload) is enqueued and sent to the child. 4069 * 4070 * This property is available for FTD build only. 4071 * 4072 */ 4073 SPINEL_PROP_CHILD_SUPERVISION_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 10, 4074 4075 /// Child Supervision Check Timeout 4076 /** Format: `S` - Read-Write 4077 * Units: Seconds 4078 * 4079 * Required capability: `SPINEL_CAP_CHILD_SUPERVISION` 4080 * 4081 * The child supervision check timeout interval (in seconds). Zero indicates supervision check on the child is 4082 * disabled. 4083 * 4084 * Supervision check is only applicable on a sleepy child. When enabled, if the child does not hear from its parent 4085 * within the specified check timeout, it initiates a re-attach process by starting an MLE Child Update 4086 * Request/Response exchange with the parent. 4087 * 4088 * This property is available for FTD and MTD builds. 4089 * 4090 */ 4091 SPINEL_PROP_CHILD_SUPERVISION_CHECK_TIMEOUT = SPINEL_PROP_OPENTHREAD__BEGIN + 11, 4092 4093 // RCP (NCP in radio only mode) version 4094 /** Format `U` - Read only 4095 * 4096 * Required capability: SPINEL_CAP_POSIX 4097 * 4098 * This property gives the version string of RCP (NCP in radio mode) which is being controlled by a POSIX 4099 * application. It is available only in "POSIX" platform (i.e., `OPENTHREAD_PLATFORM_POSIX` is enabled). 4100 * 4101 */ 4102 SPINEL_PROP_RCP_VERSION = SPINEL_PROP_OPENTHREAD__BEGIN + 12, 4103 4104 /// Thread Parent Response info 4105 /** Format: `ESccCCCb` - Asynchronous event only 4106 * 4107 * `E`: Extended address 4108 * `S`: RLOC16 4109 * `c`: Instant RSSI 4110 * 'c': Parent Priority 4111 * `C`: Link Quality3 4112 * `C`: Link Quality2 4113 * `C`: Link Quality1 4114 * 'b': Is the node receiving parent response frame attached 4115 * 4116 * This property sends Parent Response frame information to the Host. 4117 * This property is available for FTD build only. 4118 * 4119 */ 4120 SPINEL_PROP_PARENT_RESPONSE_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 13, 4121 4122 /// SLAAC enabled 4123 /** Format `b` - Read-Write 4124 * Required capability: `SPINEL_CAP_SLAAC` 4125 * 4126 * This property allows the host to enable/disable SLAAC module on NCP at run-time. When SLAAC module is enabled, 4127 * SLAAC addresses (based on on-mesh prefixes in Network Data) are added to the interface. When SLAAC module is 4128 * disabled any previously added SLAAC address is removed. 4129 * 4130 */ 4131 SPINEL_PROP_SLAAC_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 14, 4132 4133 // Supported Radio Links (by device) 4134 /** 4135 * Format `A(i)` - Read only 4136 * 4137 * This property returns list of supported radio links by the device itself. Enumeration `SPINEL_RADIO_LINK_{TYPE}` 4138 * values indicate different radio link types. 4139 * 4140 */ 4141 SPINEL_PROP_SUPPORTED_RADIO_LINKS = SPINEL_PROP_OPENTHREAD__BEGIN + 15, 4142 4143 /// Neighbor Table Multi Radio Link Info 4144 /** Format: `A(t(ESA(t(iC))))` - Read only 4145 * Required capability: `SPINEL_CAP_MULTI_RADIO`. 4146 * 4147 * Each item represents info about a neighbor: 4148 * 4149 * `E`: Neighbor's Extended Address 4150 * `S`: Neighbor's RLOC16 4151 * 4152 * This is then followed by an array of radio link info structures indicating which radio links are supported by 4153 * the neighbor: 4154 * 4155 * `i` : Radio link type (enumeration `SPINEL_RADIO_LINK_{TYPE}`). 4156 * `C` : Preference value associated with radio link. 4157 * 4158 */ 4159 SPINEL_PROP_NEIGHBOR_TABLE_MULTI_RADIO_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 16, 4160 4161 /// SRP Client Start 4162 /** Format: `b(6Sb)` - Write only 4163 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4164 * 4165 * Writing to this property allows user to start or stop the SRP client operation with a given SRP server. 4166 * 4167 * Written value format is: 4168 * 4169 * `b` : TRUE to start the client, FALSE to stop the client. 4170 * 4171 * When used to start the SRP client, the following fields should also be included: 4172 * 4173 * `6` : SRP server IPv6 address. 4174 * `U` : SRP server port number. 4175 * `b` : Boolean to indicate whether or not to emit SRP client events (using `SPINEL_PROP_SRP_CLIENT_EVENT`). 4176 * 4177 */ 4178 SPINEL_PROP_SRP_CLIENT_START = SPINEL_PROP_OPENTHREAD__BEGIN + 17, 4179 4180 /// SRP Client Lease Interval 4181 /** Format: `L` - Read/Write 4182 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4183 * 4184 * The lease interval used in SRP update requests (in seconds). 4185 * 4186 */ 4187 SPINEL_PROP_SRP_CLIENT_LEASE_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 18, 4188 4189 /// SRP Client Key Lease Interval 4190 /** Format: `L` - Read/Write 4191 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4192 * 4193 * The key lease interval used in SRP update requests (in seconds). 4194 * 4195 */ 4196 SPINEL_PROP_SRP_CLIENT_KEY_LEASE_INTERVAL = SPINEL_PROP_OPENTHREAD__BEGIN + 19, 4197 4198 /// SRP Client Host Info 4199 /** Format: `UCt(A(6))` - Read only 4200 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4201 * 4202 * Format is: 4203 * 4204 * `U` : The host name. 4205 * `C` : The host state (values from `spinel_srp_client_item_state_t`). 4206 * `t(A(6))` : Structure containing array of host IPv6 addresses. 4207 * 4208 */ 4209 SPINEL_PROP_SRP_CLIENT_HOST_INFO = SPINEL_PROP_OPENTHREAD__BEGIN + 20, 4210 4211 /// SRP Client Host Name (label). 4212 /** Format: `U` - Read/Write 4213 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4214 * 4215 */ 4216 SPINEL_PROP_SRP_CLIENT_HOST_NAME = SPINEL_PROP_OPENTHREAD__BEGIN + 21, 4217 4218 /// SRP Client Host Addresses 4219 /** Format: `A(6)` - Read/Write 4220 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4221 * 4222 */ 4223 SPINEL_PROP_SRP_CLIENT_HOST_ADDRESSES = SPINEL_PROP_OPENTHREAD__BEGIN + 22, 4224 4225 /// SRP Client Services 4226 /** Format: `A(t(UUSSSd))` - Read/Insert/Remove 4227 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4228 * 4229 * This property provides a list/array of services. 4230 * 4231 * Data per item for `SPINEL_CMD_PROP_VALUE_GET` and/or `SPINEL_CMD_PROP_VALUE_INSERT` operation is as follows: 4232 * 4233 * `U` : The service name labels (e.g., "_chip._udp", not the full domain name. 4234 * `U` : The service instance name label (not the full name). 4235 * `S` : The service port number. 4236 * `S` : The service priority. 4237 * `S` : The service weight. 4238 * 4239 * For `SPINEL_CMD_PROP_VALUE_REMOVE` command, the following format is used: 4240 * 4241 * `U` : The service name labels (e.g., "_chip._udp", not the full domain name. 4242 * `U` : The service instance name label (not the full name). 4243 * `b` : Indicates whether to clear the service entry (optional). 4244 * 4245 * The last boolean (`b`) field is optional. When included it indicates on `true` to clear the service (clear it 4246 * on client immediately with no interaction to server) and on `false` to remove the service (inform server and 4247 * wait for the service entry to be removed on server). If it is not included, the value is `false`. 4248 * 4249 */ 4250 SPINEL_PROP_SRP_CLIENT_SERVICES = SPINEL_PROP_OPENTHREAD__BEGIN + 23, 4251 4252 /// SRP Client Host And Services Remove 4253 /** Format: `bb` : Write only 4254 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4255 * 4256 * Writing to this property with starts the remove process of the host info and all services. 4257 * Please see `otSrpClientRemoveHostAndServices()` for more details. 4258 * 4259 * Format is: 4260 * 4261 * `b` : A boolean indicating whether or not the host key lease should also be cleared. 4262 * `b` : A boolean indicating whether or not to send update to server when host info is not registered. 4263 * 4264 */ 4265 SPINEL_PROP_SRP_CLIENT_HOST_SERVICES_REMOVE = SPINEL_PROP_OPENTHREAD__BEGIN + 24, 4266 4267 /// SRP Client Host And Services Clear 4268 /** Format: Empty : Write only 4269 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4270 * 4271 * Writing to this property clears all host info and all the services. 4272 * Please see `otSrpClientClearHostAndServices()` for more details. 4273 * 4274 */ 4275 SPINEL_PROP_SRP_CLIENT_HOST_SERVICES_CLEAR = SPINEL_PROP_OPENTHREAD__BEGIN + 25, 4276 4277 /// SRP Client Event 4278 /** Format: t() : Asynchronous event only 4279 * Required capability: `SPINEL_CAP_SRP_CLIENT`. 4280 * 4281 * This property is asynchronously emitted when there is an event from SRP client notifying some state changes or 4282 * errors. 4283 * 4284 * The general format of this property is as follows: 4285 * 4286 * `S` : Error code (see `spinel_srp_client_error_t` enumeration). 4287 * `d` : Host info data. 4288 * `d` : Active services. 4289 * `d` : Removed services. 4290 * 4291 * The host info data contains: 4292 * 4293 * `U` : The host name. 4294 * `C` : The host state (values from `spinel_srp_client_item_state_t`). 4295 * `t(A(6))` : Structure containing array of host IPv6 addresses. 4296 * 4297 * The active or removed services data is an array of services `A(t(UUSSSd))` with each service format: 4298 * 4299 * `U` : The service name labels (e.g., "_chip._udp", not the full domain name. 4300 * `U` : The service instance name label (not the full name). 4301 * `S` : The service port number. 4302 * `S` : The service priority. 4303 * `S` : The service weight. 4304 * `d` : The encoded TXT-DATA. 4305 * 4306 */ 4307 SPINEL_PROP_SRP_CLIENT_EVENT = SPINEL_PROP_OPENTHREAD__BEGIN + 26, 4308 4309 /// SRP Client Service Key Inclusion Enabled 4310 /** Format `b` : Read-Write 4311 * Required capability: `SPINEL_CAP_SRP_CLIENT` & `SPINEL_CAP_REFERENCE_DEVICE`. 4312 * 4313 * This boolean property indicates whether the "service key record inclusion" mode is enabled or not. 4314 * 4315 * When enabled, SRP client will include KEY record in Service Description Instructions in the SRP update messages 4316 * that it sends. 4317 * 4318 * KEY record is optional in Service Description Instruction (it is required and always included in the Host 4319 * Description Instruction). The default behavior of SRP client is to not include it. This function is intended to 4320 * override the default behavior for testing only. 4321 * 4322 */ 4323 SPINEL_PROP_SRP_CLIENT_SERVICE_KEY_ENABLED = SPINEL_PROP_OPENTHREAD__BEGIN + 27, 4324 4325 SPINEL_PROP_OPENTHREAD__END = 0x2000, 4326 4327 SPINEL_PROP_SERVER__BEGIN = 0xA0, 4328 4329 /// Server Allow Local Network Data Change 4330 /** Format `b` - Read-write 4331 * 4332 * Required capability: SPINEL_CAP_THREAD_SERVICE 4333 * 4334 * Set to true before changing local server net data. Set to false when finished. 4335 * This allows changes to be aggregated into a single event. 4336 * 4337 */ 4338 SPINEL_PROP_SERVER_ALLOW_LOCAL_DATA_CHANGE = SPINEL_PROP_SERVER__BEGIN + 0, 4339 4340 // Server Services 4341 /** Format: `A(t(LdbdS))` 4342 * 4343 * This property provides all services registered on the device 4344 * 4345 * Required capability: SPINEL_CAP_THREAD_SERVICE 4346 * 4347 * Array of structures containing: 4348 * 4349 * `L`: Enterprise Number 4350 * `d`: Service Data 4351 * `b`: Stable 4352 * `d`: Server Data 4353 * `S`: RLOC 4354 * 4355 */ 4356 SPINEL_PROP_SERVER_SERVICES = SPINEL_PROP_SERVER__BEGIN + 1, 4357 4358 // Server Leader Services 4359 /** Format: `A(t(CLdbdS))` 4360 * 4361 * This property provides all services registered on the leader 4362 * 4363 * Array of structures containing: 4364 * 4365 * `C`: Service ID 4366 * `L`: Enterprise Number 4367 * `d`: Service Data 4368 * `b`: Stable 4369 * `d`: Server Data 4370 * `S`: RLOC 4371 * 4372 */ 4373 SPINEL_PROP_SERVER_LEADER_SERVICES = SPINEL_PROP_SERVER__BEGIN + 2, 4374 4375 SPINEL_PROP_SERVER__END = 0xB0, 4376 4377 SPINEL_PROP_RCP__BEGIN = 0xB0, 4378 4379 /// RCP API Version number 4380 /** Format: `i` (read-only) 4381 * 4382 * Required capability: SPINEL_CAP_RADIO and SPINEL_CAP_RCP_API_VERSION. 4383 * 4384 * This property gives the RCP API Version number. 4385 * 4386 * Please see "Spinel definition compatibility guideline" section. 4387 * 4388 */ 4389 SPINEL_PROP_RCP_API_VERSION = SPINEL_PROP_RCP__BEGIN + 0, 4390 4391 /// Min host RCP API Version number 4392 /** Format: `i` (read-only) 4393 * 4394 * Required capability: SPINEL_CAP_RADIO and SPINEL_CAP_RCP_MIN_HOST_API_VERSION. 4395 * 4396 * This property gives the minimum host RCP API Version number. 4397 * 4398 * Please see "Spinel definition compatibility guideline" section. 4399 * 4400 */ 4401 SPINEL_PROP_RCP_MIN_HOST_API_VERSION = SPINEL_PROP_RCP__BEGIN + 1, 4402 4403 /// Crash Dump 4404 /** Format: Empty : Write only 4405 * 4406 * Required capability: SPINEL_CAP_RADIO and SPINEL_CAP_RCP_LOG_CRASH_DUMP. 4407 * 4408 * Writing to this property instructs the RCP to log a crash dump if available. 4409 * 4410 */ 4411 SPINEL_PROP_RCP_LOG_CRASH_DUMP = SPINEL_PROP_RCP__BEGIN + 2, 4412 4413 SPINEL_PROP_RCP__END = 0xFF, 4414 4415 SPINEL_PROP_INTERFACE__BEGIN = 0x100, 4416 4417 /// UART Bitrate 4418 /** Format: `L` 4419 * 4420 * If the NCP is using a UART to communicate with the host, 4421 * this property allows the host to change the bitrate 4422 * of the serial connection. The value encoding is `L`, 4423 * which is a little-endian 32-bit unsigned integer. 4424 * The host should not assume that all possible numeric values 4425 * are supported. 4426 * 4427 * If implemented by the NCP, this property should be persistent 4428 * across software resets and forgotten upon hardware resets. 4429 * 4430 * This property is only implemented when a UART is being 4431 * used for Spinel. This property is optional. 4432 * 4433 * When changing the bitrate, all frames will be received 4434 * at the previous bitrate until the response frame to this command 4435 * is received. Once a successful response frame is received by 4436 * the host, all further frames will be transmitted at the new 4437 * bitrate. 4438 */ 4439 SPINEL_PROP_UART_BITRATE = SPINEL_PROP_INTERFACE__BEGIN + 0, 4440 4441 /// UART Software Flow Control 4442 /** Format: `b` 4443 * 4444 * If the NCP is using a UART to communicate with the host, 4445 * this property allows the host to determine if software flow 4446 * control (XON/XOFF style) should be used and (optionally) to 4447 * turn it on or off. 4448 * 4449 * This property is only implemented when a UART is being 4450 * used for Spinel. This property is optional. 4451 */ 4452 SPINEL_PROP_UART_XON_XOFF = SPINEL_PROP_INTERFACE__BEGIN + 1, 4453 4454 SPINEL_PROP_INTERFACE__END = 0x200, 4455 4456 SPINEL_PROP_15_4_PIB__BEGIN = 0x400, 4457 // For direct access to the 802.15.4 PID. 4458 // Individual registers are fetched using 4459 // `SPINEL_PROP_15_4_PIB__BEGIN+[PIB_IDENTIFIER]` 4460 // Only supported if SPINEL_CAP_15_4_PIB is set. 4461 // 4462 // For brevity, the entire 802.15.4 PIB space is 4463 // not defined here, but a few choice attributes 4464 // are defined for illustration and convenience. 4465 SPINEL_PROP_15_4_PIB_PHY_CHANNELS_SUPPORTED = SPINEL_PROP_15_4_PIB__BEGIN + 0x01, ///< [A(L)] 4466 SPINEL_PROP_15_4_PIB_MAC_PROMISCUOUS_MODE = SPINEL_PROP_15_4_PIB__BEGIN + 0x51, ///< [b] 4467 SPINEL_PROP_15_4_PIB_MAC_SECURITY_ENABLED = SPINEL_PROP_15_4_PIB__BEGIN + 0x5d, ///< [b] 4468 SPINEL_PROP_15_4_PIB__END = 0x500, 4469 4470 SPINEL_PROP_CNTR__BEGIN = 0x500, 4471 4472 /// Counter reset 4473 /** Format: Empty (Write only). 4474 * 4475 * Writing to this property (with any value) will reset all MAC, MLE, IP, and NCP counters to zero. 4476 * 4477 */ 4478 SPINEL_PROP_CNTR_RESET = SPINEL_PROP_CNTR__BEGIN + 0, 4479 4480 /// The total number of transmissions. 4481 /** Format: `L` (Read-only) */ 4482 SPINEL_PROP_CNTR_TX_PKT_TOTAL = SPINEL_PROP_CNTR__BEGIN + 1, 4483 4484 /// The number of transmissions with ack request. 4485 /** Format: `L` (Read-only) */ 4486 SPINEL_PROP_CNTR_TX_PKT_ACK_REQ = SPINEL_PROP_CNTR__BEGIN + 2, 4487 4488 /// The number of transmissions that were acked. 4489 /** Format: `L` (Read-only) */ 4490 SPINEL_PROP_CNTR_TX_PKT_ACKED = SPINEL_PROP_CNTR__BEGIN + 3, 4491 4492 /// The number of transmissions without ack request. 4493 /** Format: `L` (Read-only) */ 4494 SPINEL_PROP_CNTR_TX_PKT_NO_ACK_REQ = SPINEL_PROP_CNTR__BEGIN + 4, 4495 4496 /// The number of transmitted data. 4497 /** Format: `L` (Read-only) */ 4498 SPINEL_PROP_CNTR_TX_PKT_DATA = SPINEL_PROP_CNTR__BEGIN + 5, 4499 4500 /// The number of transmitted data poll. 4501 /** Format: `L` (Read-only) */ 4502 SPINEL_PROP_CNTR_TX_PKT_DATA_POLL = SPINEL_PROP_CNTR__BEGIN + 6, 4503 4504 /// The number of transmitted beacon. 4505 /** Format: `L` (Read-only) */ 4506 SPINEL_PROP_CNTR_TX_PKT_BEACON = SPINEL_PROP_CNTR__BEGIN + 7, 4507 4508 /// The number of transmitted beacon request. 4509 /** Format: `L` (Read-only) */ 4510 SPINEL_PROP_CNTR_TX_PKT_BEACON_REQ = SPINEL_PROP_CNTR__BEGIN + 8, 4511 4512 /// The number of transmitted other types of frames. 4513 /** Format: `L` (Read-only) */ 4514 SPINEL_PROP_CNTR_TX_PKT_OTHER = SPINEL_PROP_CNTR__BEGIN + 9, 4515 4516 /// The number of retransmission times. 4517 /** Format: `L` (Read-only) */ 4518 SPINEL_PROP_CNTR_TX_PKT_RETRY = SPINEL_PROP_CNTR__BEGIN + 10, 4519 4520 /// The number of CCA failure times. 4521 /** Format: `L` (Read-only) */ 4522 SPINEL_PROP_CNTR_TX_ERR_CCA = SPINEL_PROP_CNTR__BEGIN + 11, 4523 4524 /// The number of unicast packets transmitted. 4525 /** Format: `L` (Read-only) */ 4526 SPINEL_PROP_CNTR_TX_PKT_UNICAST = SPINEL_PROP_CNTR__BEGIN + 12, 4527 4528 /// The number of broadcast packets transmitted. 4529 /** Format: `L` (Read-only) */ 4530 SPINEL_PROP_CNTR_TX_PKT_BROADCAST = SPINEL_PROP_CNTR__BEGIN + 13, 4531 4532 /// The number of frame transmission failures due to abort error. 4533 /** Format: `L` (Read-only) */ 4534 SPINEL_PROP_CNTR_TX_ERR_ABORT = SPINEL_PROP_CNTR__BEGIN + 14, 4535 4536 /// The total number of received packets. 4537 /** Format: `L` (Read-only) */ 4538 SPINEL_PROP_CNTR_RX_PKT_TOTAL = SPINEL_PROP_CNTR__BEGIN + 100, 4539 4540 /// The number of received data. 4541 /** Format: `L` (Read-only) */ 4542 SPINEL_PROP_CNTR_RX_PKT_DATA = SPINEL_PROP_CNTR__BEGIN + 101, 4543 4544 /// The number of received data poll. 4545 /** Format: `L` (Read-only) */ 4546 SPINEL_PROP_CNTR_RX_PKT_DATA_POLL = SPINEL_PROP_CNTR__BEGIN + 102, 4547 4548 /// The number of received beacon. 4549 /** Format: `L` (Read-only) */ 4550 SPINEL_PROP_CNTR_RX_PKT_BEACON = SPINEL_PROP_CNTR__BEGIN + 103, 4551 4552 /// The number of received beacon request. 4553 /** Format: `L` (Read-only) */ 4554 SPINEL_PROP_CNTR_RX_PKT_BEACON_REQ = SPINEL_PROP_CNTR__BEGIN + 104, 4555 4556 /// The number of received other types of frames. 4557 /** Format: `L` (Read-only) */ 4558 SPINEL_PROP_CNTR_RX_PKT_OTHER = SPINEL_PROP_CNTR__BEGIN + 105, 4559 4560 /// The number of received packets filtered by allowlist. 4561 /** Format: `L` (Read-only) */ 4562 SPINEL_PROP_CNTR_RX_PKT_FILT_WL = SPINEL_PROP_CNTR__BEGIN + 106, 4563 4564 /// The number of received packets filtered by destination check. 4565 /** Format: `L` (Read-only) */ 4566 SPINEL_PROP_CNTR_RX_PKT_FILT_DA = SPINEL_PROP_CNTR__BEGIN + 107, 4567 4568 /// The number of received packets that are empty. 4569 /** Format: `L` (Read-only) */ 4570 SPINEL_PROP_CNTR_RX_ERR_EMPTY = SPINEL_PROP_CNTR__BEGIN + 108, 4571 4572 /// The number of received packets from an unknown neighbor. 4573 /** Format: `L` (Read-only) */ 4574 SPINEL_PROP_CNTR_RX_ERR_UKWN_NBR = SPINEL_PROP_CNTR__BEGIN + 109, 4575 4576 /// The number of received packets whose source address is invalid. 4577 /** Format: `L` (Read-only) */ 4578 SPINEL_PROP_CNTR_RX_ERR_NVLD_SADDR = SPINEL_PROP_CNTR__BEGIN + 110, 4579 4580 /// The number of received packets with a security error. 4581 /** Format: `L` (Read-only) */ 4582 SPINEL_PROP_CNTR_RX_ERR_SECURITY = SPINEL_PROP_CNTR__BEGIN + 111, 4583 4584 /// The number of received packets with a checksum error. 4585 /** Format: `L` (Read-only) */ 4586 SPINEL_PROP_CNTR_RX_ERR_BAD_FCS = SPINEL_PROP_CNTR__BEGIN + 112, 4587 4588 /// The number of received packets with other errors. 4589 /** Format: `L` (Read-only) */ 4590 SPINEL_PROP_CNTR_RX_ERR_OTHER = SPINEL_PROP_CNTR__BEGIN + 113, 4591 4592 /// The number of received duplicated. 4593 /** Format: `L` (Read-only) */ 4594 SPINEL_PROP_CNTR_RX_PKT_DUP = SPINEL_PROP_CNTR__BEGIN + 114, 4595 4596 /// The number of unicast packets received. 4597 /** Format: `L` (Read-only) */ 4598 SPINEL_PROP_CNTR_RX_PKT_UNICAST = SPINEL_PROP_CNTR__BEGIN + 115, 4599 4600 /// The number of broadcast packets received. 4601 /** Format: `L` (Read-only) */ 4602 SPINEL_PROP_CNTR_RX_PKT_BROADCAST = SPINEL_PROP_CNTR__BEGIN + 116, 4603 4604 /// The total number of secure transmitted IP messages. 4605 /** Format: `L` (Read-only) */ 4606 SPINEL_PROP_CNTR_TX_IP_SEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 200, 4607 4608 /// The total number of insecure transmitted IP messages. 4609 /** Format: `L` (Read-only) */ 4610 SPINEL_PROP_CNTR_TX_IP_INSEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 201, 4611 4612 /// The number of dropped (not transmitted) IP messages. 4613 /** Format: `L` (Read-only) */ 4614 SPINEL_PROP_CNTR_TX_IP_DROPPED = SPINEL_PROP_CNTR__BEGIN + 202, 4615 4616 /// The total number of secure received IP message. 4617 /** Format: `L` (Read-only) */ 4618 SPINEL_PROP_CNTR_RX_IP_SEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 203, 4619 4620 /// The total number of insecure received IP message. 4621 /** Format: `L` (Read-only) */ 4622 SPINEL_PROP_CNTR_RX_IP_INSEC_TOTAL = SPINEL_PROP_CNTR__BEGIN + 204, 4623 4624 /// The number of dropped received IP messages. 4625 /** Format: `L` (Read-only) */ 4626 SPINEL_PROP_CNTR_RX_IP_DROPPED = SPINEL_PROP_CNTR__BEGIN + 205, 4627 4628 /// The number of transmitted spinel frames. 4629 /** Format: `L` (Read-only) */ 4630 SPINEL_PROP_CNTR_TX_SPINEL_TOTAL = SPINEL_PROP_CNTR__BEGIN + 300, 4631 4632 /// The number of received spinel frames. 4633 /** Format: `L` (Read-only) */ 4634 SPINEL_PROP_CNTR_RX_SPINEL_TOTAL = SPINEL_PROP_CNTR__BEGIN + 301, 4635 4636 /// The number of received spinel frames with error. 4637 /** Format: `L` (Read-only) */ 4638 SPINEL_PROP_CNTR_RX_SPINEL_ERR = SPINEL_PROP_CNTR__BEGIN + 302, 4639 4640 /// Number of out of order received spinel frames (tid increase by more than 1). 4641 /** Format: `L` (Read-only) */ 4642 SPINEL_PROP_CNTR_RX_SPINEL_OUT_OF_ORDER_TID = SPINEL_PROP_CNTR__BEGIN + 303, 4643 4644 /// The number of successful Tx IP packets 4645 /** Format: `L` (Read-only) */ 4646 SPINEL_PROP_CNTR_IP_TX_SUCCESS = SPINEL_PROP_CNTR__BEGIN + 304, 4647 4648 /// The number of successful Rx IP packets 4649 /** Format: `L` (Read-only) */ 4650 SPINEL_PROP_CNTR_IP_RX_SUCCESS = SPINEL_PROP_CNTR__BEGIN + 305, 4651 4652 /// The number of failed Tx IP packets 4653 /** Format: `L` (Read-only) */ 4654 SPINEL_PROP_CNTR_IP_TX_FAILURE = SPINEL_PROP_CNTR__BEGIN + 306, 4655 4656 /// The number of failed Rx IP packets 4657 /** Format: `L` (Read-only) */ 4658 SPINEL_PROP_CNTR_IP_RX_FAILURE = SPINEL_PROP_CNTR__BEGIN + 307, 4659 4660 /// The message buffer counter info 4661 /** Format: `SSSSSSSSSSSSSSSS` (Read-only) 4662 * `S`, (TotalBuffers) The number of buffers in the pool. 4663 * `S`, (FreeBuffers) The number of free message buffers. 4664 * `S`, (6loSendMessages) The number of messages in the 6lo send queue. 4665 * `S`, (6loSendBuffers) The number of buffers in the 6lo send queue. 4666 * `S`, (6loReassemblyMessages) The number of messages in the 6LoWPAN reassembly queue. 4667 * `S`, (6loReassemblyBuffers) The number of buffers in the 6LoWPAN reassembly queue. 4668 * `S`, (Ip6Messages) The number of messages in the IPv6 send queue. 4669 * `S`, (Ip6Buffers) The number of buffers in the IPv6 send queue. 4670 * `S`, (MplMessages) The number of messages in the MPL send queue. 4671 * `S`, (MplBuffers) The number of buffers in the MPL send queue. 4672 * `S`, (MleMessages) The number of messages in the MLE send queue. 4673 * `S`, (MleBuffers) The number of buffers in the MLE send queue. 4674 * `S`, (ArpMessages) The number of messages in the ARP send queue. 4675 * `S`, (ArpBuffers) The number of buffers in the ARP send queue. 4676 * `S`, (CoapMessages) The number of messages in the CoAP send queue. 4677 * `S`, (CoapBuffers) The number of buffers in the CoAP send queue. 4678 */ 4679 SPINEL_PROP_MSG_BUFFER_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 400, 4680 4681 /// All MAC related counters. 4682 /** Format: t(A(L))t(A(L)) 4683 * 4684 * The contents include two structs, first one corresponds to 4685 * all transmit related MAC counters, second one provides the 4686 * receive related counters. 4687 * 4688 * The transmit structure includes: 4689 * 4690 * 'L': TxTotal (The total number of transmissions). 4691 * 'L': TxUnicast (The total number of unicast transmissions). 4692 * 'L': TxBroadcast (The total number of broadcast transmissions). 4693 * 'L': TxAckRequested (The number of transmissions with ack request). 4694 * 'L': TxAcked (The number of transmissions that were acked). 4695 * 'L': TxNoAckRequested (The number of transmissions without ack request). 4696 * 'L': TxData (The number of transmitted data). 4697 * 'L': TxDataPoll (The number of transmitted data poll). 4698 * 'L': TxBeacon (The number of transmitted beacon). 4699 * 'L': TxBeaconRequest (The number of transmitted beacon request). 4700 * 'L': TxOther (The number of transmitted other types of frames). 4701 * 'L': TxRetry (The number of retransmission times). 4702 * 'L': TxErrCca (The number of CCA failure times). 4703 * 'L': TxErrAbort (The number of frame transmission failures due to abort error). 4704 * 'L': TxErrBusyChannel (The number of frames that were dropped due to a busy channel). 4705 * 'L': TxDirectMaxRetryExpiry (The number of expired retransmission retries for direct message). 4706 * 'L': TxIndirectMaxRetryExpiry (The number of expired retransmission retries for indirect message). 4707 * 4708 * The receive structure includes: 4709 * 4710 * 'L': RxTotal (The total number of received packets). 4711 * 'L': RxUnicast (The total number of unicast packets received). 4712 * 'L': RxBroadcast (The total number of broadcast packets received). 4713 * 'L': RxData (The number of received data). 4714 * 'L': RxDataPoll (The number of received data poll). 4715 * 'L': RxBeacon (The number of received beacon). 4716 * 'L': RxBeaconRequest (The number of received beacon request). 4717 * 'L': RxOther (The number of received other types of frames). 4718 * 'L': RxAddressFiltered (The number of received packets filtered by address filter 4719 * (allowlist or denylist)). 4720 * 'L': RxDestAddrFiltered (The number of received packets filtered by destination check). 4721 * 'L': RxDuplicated (The number of received duplicated packets). 4722 * 'L': RxErrNoFrame (The number of received packets with no or malformed content). 4723 * 'L': RxErrUnknownNeighbor (The number of received packets from unknown neighbor). 4724 * 'L': RxErrInvalidSrcAddr (The number of received packets whose source address is invalid). 4725 * 'L': RxErrSec (The number of received packets with security error). 4726 * 'L': RxErrFcs (The number of received packets with FCS error). 4727 * 'L': RxErrOther (The number of received packets with other error). 4728 * 4729 * Writing to this property with any value would reset all MAC counters to zero. 4730 * 4731 */ 4732 SPINEL_PROP_CNTR_ALL_MAC_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 401, 4733 4734 /// Thread MLE counters. 4735 /** Format: `SSSSSSSSS` 4736 * 4737 * 'S': DisabledRole (The number of times device entered OT_DEVICE_ROLE_DISABLED role). 4738 * 'S': DetachedRole (The number of times device entered OT_DEVICE_ROLE_DETACHED role). 4739 * 'S': ChildRole (The number of times device entered OT_DEVICE_ROLE_CHILD role). 4740 * 'S': RouterRole (The number of times device entered OT_DEVICE_ROLE_ROUTER role). 4741 * 'S': LeaderRole (The number of times device entered OT_DEVICE_ROLE_LEADER role). 4742 * 'S': AttachAttempts (The number of attach attempts while device was detached). 4743 * 'S': PartitionIdChanges (The number of changes to partition ID). 4744 * 'S': BetterPartitionAttachAttempts (The number of attempts to attach to a better partition). 4745 * 'S': ParentChanges (The number of times device changed its parents). 4746 * 4747 * Writing to this property with any value would reset all MLE counters to zero. 4748 * 4749 */ 4750 SPINEL_PROP_CNTR_MLE_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 402, 4751 4752 /// Thread IPv6 counters. 4753 /** Format: `t(LL)t(LL)` 4754 * 4755 * The contents include two structs, first one corresponds to 4756 * all transmit related MAC counters, second one provides the 4757 * receive related counters. 4758 * 4759 * The transmit structure includes: 4760 * 'L': TxSuccess (The number of IPv6 packets successfully transmitted). 4761 * 'L': TxFailure (The number of IPv6 packets failed to transmit). 4762 * 4763 * The receive structure includes: 4764 * 'L': RxSuccess (The number of IPv6 packets successfully received). 4765 * 'L': RxFailure (The number of IPv6 packets failed to receive). 4766 * 4767 * Writing to this property with any value would reset all IPv6 counters to zero. 4768 * 4769 */ 4770 SPINEL_PROP_CNTR_ALL_IP_COUNTERS = SPINEL_PROP_CNTR__BEGIN + 403, 4771 4772 /// MAC retry histogram. 4773 /** Format: t(A(L))t(A(L)) 4774 * 4775 * Required capability: SPINEL_CAP_MAC_RETRY_HISTOGRAM 4776 * 4777 * The contents include two structs, first one is histogram which corresponds to retransmissions number of direct 4778 * messages, second one provides the histogram of retransmissions for indirect messages. 4779 * 4780 * The first structure includes: 4781 * 'L': DirectRetry[0] (The number of packets after 0 retry). 4782 * 'L': DirectRetry[1] (The number of packets after 1 retry). 4783 * ... 4784 * 'L': DirectRetry[n] (The number of packets after n retry). 4785 * 4786 * The size of the array is OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_DIRECT. 4787 * 4788 * The second structure includes: 4789 * 'L': IndirectRetry[0] (The number of packets after 0 retry). 4790 * 'L': IndirectRetry[1] (The number of packets after 1 retry). 4791 * ... 4792 * 'L': IndirectRetry[m] (The number of packets after m retry). 4793 * 4794 * The size of the array is OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_INDIRECT. 4795 * 4796 * Writing to this property with any value would reset MAC retry histogram. 4797 * 4798 */ 4799 SPINEL_PROP_CNTR_MAC_RETRY_HISTOGRAM = SPINEL_PROP_CNTR__BEGIN + 404, 4800 4801 SPINEL_PROP_CNTR__END = 0x800, 4802 4803 SPINEL_PROP_RCP_EXT__BEGIN = 0x800, 4804 4805 /// MAC Key 4806 /** Format: `CCddd`. 4807 * 4808 * `C`: MAC key ID mode 4809 * `C`: MAC key ID 4810 * `d`: previous MAC key material data 4811 * `d`: current MAC key material data 4812 * `d`: next MAC key material data 4813 * 4814 * The Spinel property is used to set/get MAC key materials to and from RCP. 4815 * 4816 */ 4817 SPINEL_PROP_RCP_MAC_KEY = SPINEL_PROP_RCP_EXT__BEGIN + 0, 4818 4819 /// MAC Frame Counter 4820 /** Format: `L` for read and `Lb` or `L` for write 4821 * 4822 * `L`: MAC frame counter 4823 * 'b': Optional boolean used only during write. If not provided, `false` is assumed. 4824 * If `true` counter is set only if the new value is larger than current value. 4825 * If `false` the new value is set as frame counter independent of the current value. 4826 * 4827 * The Spinel property is used to set MAC frame counter to RCP. 4828 * 4829 */ 4830 SPINEL_PROP_RCP_MAC_FRAME_COUNTER = SPINEL_PROP_RCP_EXT__BEGIN + 1, 4831 4832 /// Timestamps when Spinel frame is received and transmitted 4833 /** Format: `X`. 4834 * 4835 * `X`: Spinel frame transmit timestamp 4836 * 4837 * The Spinel property is used to get timestamp from RCP to calculate host and RCP timer difference. 4838 * 4839 */ 4840 SPINEL_PROP_RCP_TIMESTAMP = SPINEL_PROP_RCP_EXT__BEGIN + 2, 4841 4842 /// Configure Enhanced ACK probing 4843 /** Format: `SEC` (Write-only). 4844 * 4845 * `S`: Short address 4846 * `E`: Extended address 4847 * `C`: List of requested metric ids encoded as bit fields in single byte 4848 * 4849 * +---------------+----+ 4850 * | Metric | Id | 4851 * +---------------+----+ 4852 * | Received PDUs | 0 | 4853 * | LQI | 1 | 4854 * | Link margin | 2 | 4855 * | RSSI | 3 | 4856 * +---------------+----+ 4857 * 4858 * Enable/disable or update Enhanced-ACK Based Probing in radio for a specific Initiator. 4859 * 4860 */ 4861 SPINEL_PROP_RCP_ENH_ACK_PROBING = SPINEL_PROP_RCP_EXT__BEGIN + 3, 4862 4863 /// CSL Accuracy 4864 /** Format: `C` 4865 * Required capability: `SPINEL_CAP_NET_THREAD_1_2` 4866 * 4867 * The current CSL rx/tx scheduling drift, in units of ± ppm. 4868 * 4869 */ 4870 SPINEL_PROP_RCP_CSL_ACCURACY = SPINEL_PROP_RCP_EXT__BEGIN + 4, 4871 4872 /// CSL Uncertainty 4873 /** Format: `C` 4874 * Required capability: `SPINEL_CAP_NET_THREAD_1_2` 4875 * 4876 * The current uncertainty, in units of 10 us, of the clock used for scheduling CSL operations. 4877 * 4878 */ 4879 SPINEL_PROP_RCP_CSL_UNCERTAINTY = SPINEL_PROP_RCP_EXT__BEGIN + 5, 4880 4881 SPINEL_PROP_RCP_EXT__END = 0x900, 4882 4883 SPINEL_PROP_MULTIPAN__BEGIN = 0x900, 4884 4885 /// Multipan interface selection. 4886 /** Format: `C` 4887 * Type: Read-Write 4888 * 4889 * `C`: b[0-1] - Interface id. 4890 * b[7] - 1: Complete pending radio operation, 0: immediate(force) switch. 4891 * 4892 * This feature gets or sets the radio interface to be used in multipan configuration 4893 * 4894 * Default value: 0 4895 * 4896 */ 4897 SPINEL_PROP_MULTIPAN_ACTIVE_INTERFACE = SPINEL_PROP_MULTIPAN__BEGIN + 0, 4898 4899 SPINEL_PROP_MULTIPAN__END = 0x910, 4900 4901 SPINEL_PROP_NEST__BEGIN = 0x3BC0, 4902 4903 SPINEL_PROP_NEST_STREAM_MFG = SPINEL_PROP_NEST__BEGIN + 0, 4904 4905 /// The legacy network ULA prefix (8 bytes). 4906 /** Format: 'D' 4907 * 4908 * This property is deprecated. 4909 * 4910 */ 4911 SPINEL_PROP_NEST_LEGACY_ULA_PREFIX = SPINEL_PROP_NEST__BEGIN + 1, 4912 4913 /// The EUI64 of last node joined using legacy protocol (if none, all zero EUI64 is returned). 4914 /** Format: 'E' 4915 * 4916 * This property is deprecated. 4917 * 4918 */ 4919 SPINEL_PROP_NEST_LEGACY_LAST_NODE_JOINED = SPINEL_PROP_NEST__BEGIN + 2, 4920 4921 SPINEL_PROP_NEST__END = 0x3C00, 4922 4923 SPINEL_PROP_VENDOR__BEGIN = 0x3C00, 4924 SPINEL_PROP_VENDOR__END = 0x4000, 4925 4926 SPINEL_PROP_VENDOR_ESP__BEGIN = (SPINEL_PROP_VENDOR__BEGIN + 0), 4927 SPINEL_PROP_VENDOR_ESP__END = (SPINEL_PROP_VENDOR__BEGIN + 128), 4928 4929 SPINEL_PROP_DEBUG__BEGIN = 0x4000, 4930 4931 /// Testing platform assert 4932 /** Format: 'b' (read-only) 4933 * 4934 * Reading this property will cause an assert on the NCP. This is intended for testing the assert functionality of 4935 * underlying platform/NCP. Assert should ideally cause the NCP to reset, but if this is not supported a `false` 4936 * boolean is returned in response. 4937 * 4938 */ 4939 SPINEL_PROP_DEBUG_TEST_ASSERT = SPINEL_PROP_DEBUG__BEGIN + 0, 4940 4941 /// The NCP log level. 4942 /** Format: `C` */ 4943 SPINEL_PROP_DEBUG_NCP_LOG_LEVEL = SPINEL_PROP_DEBUG__BEGIN + 1, 4944 4945 /// Testing platform watchdog 4946 /** Format: Empty (read-only) 4947 * 4948 * Reading this property will causes NCP to start a `while(true) ;` loop and thus triggering a watchdog. 4949 * 4950 * This is intended for testing the watchdog functionality on the underlying platform/NCP. 4951 * 4952 */ 4953 SPINEL_PROP_DEBUG_TEST_WATCHDOG = SPINEL_PROP_DEBUG__BEGIN + 2, 4954 4955 /// The NCP timestamp base 4956 /** Format: X (write-only) 4957 * 4958 * This property controls the time base value that is used for logs timestamp field calculation. 4959 * 4960 */ 4961 SPINEL_PROP_DEBUG_LOG_TIMESTAMP_BASE = SPINEL_PROP_DEBUG__BEGIN + 3, 4962 4963 /// TREL Radio Link - test mode enable 4964 /** Format `b` (read-write) 4965 * 4966 * This property is intended for testing TREL (Thread Radio Encapsulation Link) radio type only (during simulation). 4967 * It allows the TREL interface to be temporarily disabled and (re)enabled. While disabled all traffic through 4968 * TREL interface is dropped silently (to emulate a radio/interface down scenario). 4969 * 4970 * This property is only available when the TREL radio link type is supported. 4971 * 4972 */ 4973 SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE = SPINEL_PROP_DEBUG__BEGIN + 4, 4974 4975 SPINEL_PROP_DEBUG__END = 0x4400, 4976 4977 SPINEL_PROP_EXPERIMENTAL__BEGIN = 2000000, 4978 SPINEL_PROP_EXPERIMENTAL__END = 2097152, 4979 }; 4980 4981 typedef uint32_t spinel_prop_key_t; 4982 4983 // ---------------------------------------------------------------------------- 4984 4985 #define SPINEL_HEADER_FLAG 0x80 4986 #define SPINEL_HEADER_FLAGS_SHIFT 6 4987 #define SPINEL_HEADER_FLAGS_MASK (3 << SPINEL_HEADER_FLAGS_SHIFT) 4988 #define SPINEL_HEADER_GET_FLAG(x) (((x)&SPINEL_HEADER_FLAGS_MASK) >> SPINEL_HEADER_FLAGS_SHIFT) 4989 4990 #define SPINEL_HEADER_TID_SHIFT 0 4991 #define SPINEL_HEADER_TID_MASK (15 << SPINEL_HEADER_TID_SHIFT) 4992 4993 #define SPINEL_HEADER_IID_SHIFT 4 4994 #define SPINEL_HEADER_IID_MASK (3 << SPINEL_HEADER_IID_SHIFT) 4995 #define SPINEL_HEADER_IID(iid) (static_cast<uint8_t>((iid) << SPINEL_HEADER_IID_SHIFT)) 4996 #define SPINEL_HEADER_IID_MAX 3 4997 4998 #define SPINEL_HEADER_IID_0 SPINEL_HEADER_IID(0) 4999 #define SPINEL_HEADER_IID_1 SPINEL_HEADER_IID(1) 5000 #define SPINEL_HEADER_IID_2 SPINEL_HEADER_IID(2) 5001 #define SPINEL_HEADER_IID_3 SPINEL_HEADER_IID(3) 5002 5003 #define SPINEL_HEADER_INVALID_IID 0xFF 5004 5005 #define SPINEL_HEADER_GET_IID(x) (((x)&SPINEL_HEADER_IID_MASK) >> SPINEL_HEADER_IID_SHIFT) 5006 #define SPINEL_HEADER_GET_TID(x) (spinel_tid_t)(((x)&SPINEL_HEADER_TID_MASK) >> SPINEL_HEADER_TID_SHIFT) 5007 5008 #define SPINEL_GET_NEXT_TID(x) (spinel_tid_t)((x) >= 0xF ? 1 : (x) + 1) 5009 5010 #define SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT 4 5011 5012 #define SPINEL_BEACON_THREAD_FLAG_VERSION_MASK (0xf << SPINEL_BEACON_THREAD_FLAG_VERSION_SHIFT) 5013 5014 #define SPINEL_BEACON_THREAD_FLAG_JOINABLE (1 << 0) 5015 5016 #define SPINEL_BEACON_THREAD_FLAG_NATIVE (1 << 3) 5017 5018 #define SPINEL_MULTIPAN_INTERFACE_SOFT_SWITCH_SHIFT 7 5019 #define SPINEL_MULTIPAN_INTERFACE_SOFT_SWITCH_MASK (1 << SPINEL_MULTIPAN_INTERFACE_SOFT_SWITCH_SHIFT) 5020 #define SPINEL_MULTIPAN_INTERFACE_ID_MASK 0x03 5021 5022 // ---------------------------------------------------------------------------- 5023 5024 enum 5025 { 5026 SPINEL_DATATYPE_NULL_C = 0, 5027 SPINEL_DATATYPE_VOID_C = '.', 5028 SPINEL_DATATYPE_BOOL_C = 'b', 5029 SPINEL_DATATYPE_UINT8_C = 'C', 5030 SPINEL_DATATYPE_INT8_C = 'c', 5031 SPINEL_DATATYPE_UINT16_C = 'S', 5032 SPINEL_DATATYPE_INT16_C = 's', 5033 SPINEL_DATATYPE_UINT32_C = 'L', 5034 SPINEL_DATATYPE_INT32_C = 'l', 5035 SPINEL_DATATYPE_UINT64_C = 'X', 5036 SPINEL_DATATYPE_INT64_C = 'x', 5037 SPINEL_DATATYPE_UINT_PACKED_C = 'i', 5038 SPINEL_DATATYPE_IPv6ADDR_C = '6', 5039 SPINEL_DATATYPE_EUI64_C = 'E', 5040 SPINEL_DATATYPE_EUI48_C = 'e', 5041 SPINEL_DATATYPE_DATA_WLEN_C = 'd', 5042 SPINEL_DATATYPE_DATA_C = 'D', 5043 SPINEL_DATATYPE_UTF8_C = 'U', //!< Zero-Terminated UTF8-Encoded String 5044 SPINEL_DATATYPE_STRUCT_C = 't', 5045 SPINEL_DATATYPE_ARRAY_C = 'A', 5046 }; 5047 5048 typedef char spinel_datatype_t; 5049 5050 #define SPINEL_DATATYPE_NULL_S "" 5051 #define SPINEL_DATATYPE_VOID_S "." 5052 #define SPINEL_DATATYPE_BOOL_S "b" 5053 #define SPINEL_DATATYPE_UINT8_S "C" 5054 #define SPINEL_DATATYPE_INT8_S "c" 5055 #define SPINEL_DATATYPE_UINT16_S "S" 5056 #define SPINEL_DATATYPE_INT16_S "s" 5057 #define SPINEL_DATATYPE_UINT32_S "L" 5058 #define SPINEL_DATATYPE_INT32_S "l" 5059 #define SPINEL_DATATYPE_UINT64_S "X" 5060 #define SPINEL_DATATYPE_INT64_S "x" 5061 #define SPINEL_DATATYPE_UINT_PACKED_S "i" 5062 #define SPINEL_DATATYPE_IPv6ADDR_S "6" 5063 #define SPINEL_DATATYPE_EUI64_S "E" 5064 #define SPINEL_DATATYPE_EUI48_S "e" 5065 #define SPINEL_DATATYPE_DATA_WLEN_S "d" 5066 #define SPINEL_DATATYPE_DATA_S "D" 5067 #define SPINEL_DATATYPE_UTF8_S "U" //!< Zero-Terminated UTF8-Encoded String 5068 5069 #define SPINEL_DATATYPE_ARRAY_S(x) "A(" x ")" 5070 #define SPINEL_DATATYPE_STRUCT_S(x) "t(" x ")" 5071 5072 #define SPINEL_DATATYPE_ARRAY_STRUCT_S(x) SPINEL_DATATYPE_ARRAY_S(SPINEL_DATATYPE_STRUCT_WLEN_S(x)) 5073 5074 #define SPINEL_DATATYPE_COMMAND_S \ 5075 SPINEL_DATATYPE_UINT8_S /* header */ \ 5076 SPINEL_DATATYPE_UINT_PACKED_S /* command */ 5077 5078 #define SPINEL_DATATYPE_COMMAND_PROP_S \ 5079 SPINEL_DATATYPE_COMMAND_S /* prop command */ \ 5080 SPINEL_DATATYPE_UINT_PACKED_S /* property id */ 5081 5082 #define SPINEL_MAX_UINT_PACKED 2097151 5083 5084 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_pack(uint8_t *data_out, 5085 spinel_size_t data_len_max, 5086 const char *pack_format, 5087 ...); 5088 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vpack(uint8_t *data_out, 5089 spinel_size_t data_len_max, 5090 const char *pack_format, 5091 va_list args); 5092 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack(const uint8_t *data_in, 5093 spinel_size_t data_len, 5094 const char *pack_format, 5095 ...); 5096 /** 5097 * Parses spinel data similar to sscanf(). 5098 * 5099 * Actually calls spinel_datatype_vunpack_in_place() to parse data. 5100 * 5101 * @param[in] data_in A pointer to the data to parse. 5102 * @param[in] data_len The length of @p data_in in bytes. 5103 * @param[in] pack_format C string that contains a format string follows the same specification of spinel. 5104 * @param[in] ... Additional arguments depending on the format string @p pack_format. 5105 * 5106 * @returns The parsed length in bytes. 5107 * 5108 * @note This function behaves different from `spinel_datatype_unpack()`: 5109 * - This function expects composite data arguments of pointer to data type, while `spinel_datatype_unpack()` 5110 * expects them of pointer to data type pointer. For example, if `SPINEL_DATATYPE_EUI64_C` is present in 5111 * @p pack_format, this function expects a `spinel_eui64_t *` is included in variable arguments, while 5112 * `spinel_datatype_unpack()` expects a `spinel_eui64_t **` is included. 5113 * - For `SPINEL_DATATYPE_UTF8_C`, this function expects two arguments, the first of type `char *` and the 5114 * second is of type `size_t` to indicate length of the provided buffer in the first argument just like 5115 * `strncpy()`, while `spinel_datatype_unpack()` only expects a `const char **`. 5116 * 5117 * @sa spinel_datatype_vunpack_in_place() 5118 * 5119 */ 5120 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_unpack_in_place(const uint8_t *data_in, 5121 spinel_size_t data_len, 5122 const char *pack_format, 5123 ...); 5124 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack(const uint8_t *data_in, 5125 spinel_size_t data_len, 5126 const char *pack_format, 5127 va_list args); 5128 /** 5129 * Parses spinel data similar to vsscanf(). 5130 * 5131 * @param[in] data_in A pointer to the data to parse. 5132 * @param[in] data_len The length of @p data_in in bytes. 5133 * @param[in] pack_format C string that contains a format string follows the same specification of spinel. 5134 * @param[in] args A value identifying a variable arguments list. 5135 * 5136 * @returns The parsed length in bytes. 5137 * 5138 * @note This function behaves different from `spinel_datatype_vunpack()`: 5139 * - This function expects composite data arguments of pointer to data type, while `spinel_datatype_vunpack()` 5140 * expects them of pointer to data type pointer. For example, if `SPINEL_DATATYPE_EUI64_C` is present in 5141 * @p pack_format, this function expects a `spinel_eui64_t *` is included in variable arguments, while 5142 * `spinel_datatype_vunpack()` expects a `spinel_eui64_t **` is included. 5143 * - For `SPINEL_DATATYPE_UTF8_C`, this function expects two arguments, the first of type `char *` and the 5144 * second is of type `size_t` to indicate length of the provided buffer in the first argument just like 5145 * `strncpy()`, while `spinel_datatype_vunpack()` only expects a `const char **`. 5146 * 5147 * @sa spinel_datatype_unpack_in_place() 5148 * 5149 */ 5150 SPINEL_API_EXTERN spinel_ssize_t spinel_datatype_vunpack_in_place(const uint8_t *data_in, 5151 spinel_size_t data_len, 5152 const char *pack_format, 5153 va_list args); 5154 5155 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_decode(const uint8_t *bytes, 5156 spinel_size_t len, 5157 unsigned int *value_ptr); 5158 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_encode(uint8_t *bytes, spinel_size_t len, unsigned int value); 5159 SPINEL_API_EXTERN spinel_ssize_t spinel_packed_uint_size(unsigned int value); 5160 5161 SPINEL_API_EXTERN const char *spinel_next_packed_datatype(const char *pack_format); 5162 5163 // ---------------------------------------------------------------------------- 5164 5165 SPINEL_API_EXTERN const char *spinel_command_to_cstr(spinel_command_t command); 5166 5167 SPINEL_API_EXTERN const char *spinel_prop_key_to_cstr(spinel_prop_key_t prop_key); 5168 5169 SPINEL_API_EXTERN const char *spinel_net_role_to_cstr(uint8_t net_role); 5170 5171 SPINEL_API_EXTERN const char *spinel_mcu_power_state_to_cstr(uint8_t mcu_power_state); 5172 5173 SPINEL_API_EXTERN const char *spinel_status_to_cstr(spinel_status_t status); 5174 5175 SPINEL_API_EXTERN const char *spinel_capability_to_cstr(spinel_capability_t capability); 5176 5177 SPINEL_API_EXTERN const char *spinel_radio_link_to_cstr(uint32_t radio); 5178 5179 SPINEL_API_EXTERN const char *spinel_link_metrics_status_to_cstr(uint8_t status); 5180 5181 // ---------------------------------------------------------------------------- 5182 5183 #if defined(__cplusplus) 5184 } 5185 #endif 5186 5187 #endif /* defined(SPINEL_HEADER_INCLUDED) */ 5188