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