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