Spinel is largely a property-based protocol, with a property defined for every attribute that needs to be set, changed, or known by the host. The inspiration of this approach was memory-mapped hardware registers for peripherals. The goal is to avoid, as much as possible, the use of large complicated structures and/or method argument lists. The reason for avoiding these is because they have a tendency to change, especially early in development. Adding or removing a property from a structure can render the entire protocol incompatible. By using properties, you simply change an additional property.
-
Almost all features and capabilities are implemented using properties. Most new features that are initially proposed as commands can be adapted to be property-based instead. Notable exceptions include "Host Buffer Offload" (Appendix C) and "Network Save" (Appendix B).
+
Almost all features and capabilities are implemented using properties. Most new features that are initially proposed as commands can be adapted to be property-based instead. Notable exceptions include "Host Buffer Offload" (Section 9) and "Network Save" (Section 8).
In Spinel, properties are keyed by an unsigned integer between 0 and 2,097,151 (See Section 3.2).
Properties may support one or more of the following methods:
@@ -1455,7 +1469,7 @@
This command allows the NCP to fetch values from the RAM of the NCP for debugging purposes. Upon success, CMD_PEEK_RET is sent from the NCP to the host. Upon failure, PROP_LAST_STATUS is emitted with the appropriate error indication.
Due to the low-level nature of this command, certain error conditions may induce the NCP to reset.
The NCP MAY prevent certain regions of memory from being accessed.
-
The implementation of this command has security implications. See Section 7 for more information.
+
The implementation of this command has security implications. See Section 12 for more information.
This command requires the capability CAP_PEEK_POKE to be present.
While the majority of the properties that allow the configuration of network connectivity are network protocol specific, there are several properties that are required in all implementations.
This stream provides the capability of sending and receiving raw packets to and from the radio. The exact format of the frame metadata and data is dependent on the MAC and PHY being used.
This property is a streaming property, meaning that you cannot explicitly fetch the value of this property. To receive traffic, you wait for CMD_PROP_VALUE_IS commands with this property id from the NCP.
-
Implementations may OPTIONALLY support the ability to transmit arbitrary raw packets. If this capability is supported, you may call CMD_PROP_VALUE_SET on this property with the value of the raw packet.
+
Implementations may OPTIONALLY support the ability to transmit arbitrary raw packets. Support for this feature is indicated by the presence of the CAP_WRITABLE_RAW_STREAM capability.
+
If the capability CAP_WRITABLE_RAW_STREAM is set, then packets written to this stream with CMD_PROP_VALUE_SET will be sent out over the radio. This allows the caller to use the radio directly, with the stack being implemented on the host instead of the NCP.
Any data past the end of FRAME_DATA_LEN is considered metadata and is OPTIONAL. Frame metadata MAY be empty or partially specified. Partially specified metadata MUST be accepted. Default values are used for all unspecified fields.
The same general format is used for PROP_STREAM_RAW, PROP_STREAM_NET, and PROP_STREAM_NET_INSECURE. It can be used for frames sent from the NCP to the host as well as frames sent from the host to the NCP.
Spinel MAY be used as an API boundary for allowing processes to configure the NCP. However, such a system MUST NOT give unprivileged processess the ability to send or receive arbitrary command frames to the NCP. Only the specific commands and properties that are required should be allowed to be passed, and then only after being checked for proper format.
Special thanks to Abtin Keshavarzian, Martin Turon, Arjuna Sivasithambaresan and Jonathan Hui for their substantial contributions and feedback related to this document.
b: "Is defined locally" flag. Set if this network was locally defined. Assumed to be true for set, insert and replace. Clear if the on mesh network was defined by another node.
This property contains the value of the mode TLV for this node. The meaning of the bits in this bitfield are defined by section 4.5.2 of the Thread specification.
Allow the HOST to indicate whether or not the router role is enabled. If current role is a router, setting this property to false starts a re-attach process as an end-device.
Specifies the preferred Router Id. Upon becoming a router/leader the node attempts to use this Router Id. If the preferred Router Id is not set or if it can not be used, a randomly generated router id is picked. This property can be set only when the device role is either detached or disabled.
The network save feature is an optional NCP capability that, when present, allows the host to save and recall network credentials and state to and from nonvolatile storage.
+
The presence of this feature can be detected by checking for the presence of the CAP_NET_SAVE capability in PROP_CAPS.
Clear saved network state command. Clears any previously saved network credentials and state previously stored by CMD_NET_SAVE from non-volatile memory.
+
This operation affects non-volatile memory only. The current network information stored in volatile memory is unaffected.
+
The response to this command is always a CMD_PROP_VALUE_IS for PROP_LAST_STATUS, indicating the result of the operation.
+
This command is only available if the CAP_NET_SAVE capability is set.
Recall saved network state command. Recalls any previously saved network credentials and state previously stored by CMD_NET_SAVE from non-volatile memory.
+
This command will typically generated several unsolicited property updates as the network state is loaded. At the conclusion of loading, the authoritative response to this command is always a CMD_PROP_VALUE_IS for PROP_LAST_STATUS, indicating the result of the operation.
+
This command is only available if the CAP_NET_SAVE capability is set.
The memory on an NCP may be much more limited than the memory on the host processor. In such situations, it is sometimes useful for the NCP to offload buffers to the host processor temporarily so that it can perform other operations.
+
Host buffer offload is an optional NCP capability that, when present, allows the NCP to store data buffers on the host processor that can be recalled at a later time.
+
The presence of this feature can be detected by the host by checking for the presence of the CAP_HBO capability in PROP_CAPS.
Describes the number of bytes that may be offloaded from the NCP to the host. Default value is zero, so this property must be set by the host to a non-zero value before the NCP will begin offloading blocks.
+
This value is encoded as an unsigned 32-bit integer.
+
This property is only available if the CAP_HBO capability is present in PROP_CAPS.
Describes the number of blocks that may be offloaded from the NCP to the host. Default value is 32. Setting this value to zero will cause host block offload to be effectively disabled.
+
This value is encoded as an unsigned 16-bit integer.
+
This property is only available if the CAP_HBO capability is present in PROP_CAPS.
Jamming detection is a feature that allows the NCP to report when it detects high levels of interference that are characteristic of intentional signal jamming.
+
The presence of this feature can be detected by checking for the presence of the CAP_JAM_DETECT (value 6) capability in PROP_CAPS.
This parameter describes the number of aggregate seconds within the detection window where the RSSI must be above PROP_JAM_DETECT_RSSI_THRESHOLD to trigger detection.
+
The behavior of the jamming detection feature when PROP_JAM_DETECT_BUSY is larger than PROP_JAM_DETECT_WINDOW is undefined.
The length of the data associated with these properties depends on the number of GPIOs. If you have 10 GPIOs, you'd have two bytes. You determine the number of GPIOs available by examining PROP_GPIO_AVAILABLE, described below. This API isn't intended to support every possible GPIO state, it is intended for basic reading and writing.
Contains a bit field identifying the state of the GPIOs. For GPIOs configured as inputs, this is the read logic level. For GPIOs configured as outputs, this is the logic level of the output.
Allows for the state of various output GPIOs to be set without affecting other GPIO states. Contains a bit field identifying the output GPIOs that should have their state set to 1.
Allows for the state of various output GPIOs to be cleared without affecting other GPIO states. Contains a bit field identifying the output GPIOs that should have their state cleared to 0.
Spinel MAY be used as an API boundary for allowing processes to configure the NCP. However, such a system MUST NOT give unprivileged processess the ability to send or receive arbitrary command frames to the NCP. Only the specific commands and properties that are required should be allowed to be passed, and then only after being checked for proper format.
Since this NCP protocol is defined independently of the physical transport or framing, any number of transports and framing protocols could be used successfully. However, in the interests of compatibility, this document provides some recommendations.
The network save feature is an optional NCP capability that, when present, allows the host to save and recall network credentials and state to and from nonvolatile storage.
-
The presence of this feature can be detected by checking for the presence of the CAP_NET_SAVE capability in PROP_CAPS.
Clear saved network state command. Clears any previously saved network credentials and state previously stored by CMD_NET_SAVE from non-volatile memory.
-
This operation affects non-volatile memory only. The current network information stored in volatile memory is unaffected.
-
The response to this command is always a CMD_PROP_VALUE_IS for PROP_LAST_STATUS, indicating the result of the operation.
-
This command is only available if the CAP_NET_SAVE capability is set.
Recall saved network state command. Recalls any previously saved network credentials and state previously stored by CMD_NET_SAVE from non-volatile memory.
-
This command will typically generated several unsolicited property updates as the network state is loaded. At the conclusion of loading, the authoritative response to this command is always a CMD_PROP_VALUE_IS for PROP_LAST_STATUS, indicating the result of the operation.
-
This command is only available if the CAP_NET_SAVE capability is set.
The memory on an NCP may be much more limited than the memory on the host processor. In such situations, it is sometimes useful for the NCP to offload buffers to the host processor temporarily so that it can perform other operations.
-
Host buffer offload is an optional NCP capability that, when present, allows the NCP to store data buffers on the host processor that can be recalled at a later time.
-
The presence of this feature can be detected by the host by checking for the presence of the CAP_HBO capability in PROP_CAPS.
Describes the number of bytes that may be offloaded from the NCP to the host. Default value is zero, so this property must be set by the host to a non-zero value before the NCP will begin offloading blocks.
-
This value is encoded as an unsigned 32-bit integer.
-
This property is only available if the CAP_HBO capability is present in PROP_CAPS.
Describes the number of blocks that may be offloaded from the NCP to the host. Default value is 32. Setting this value to zero will cause host block offload to be effectively disabled.
-
This value is encoded as an unsigned 16-bit integer.
-
This property is only available if the CAP_HBO capability is present in PROP_CAPS.
Jamming detection is a feature that allows the NCP to report when it detects high levels of interference that are characteristic of intentional signal jamming.
-
The presence of this feature can be detected by checking for the presence of the CAP_JAM_DETECT (value 6) capability in PROP_CAPS.
This parameter describes the number of aggregate seconds within the detection window where the RSSI must be above PROP_JAM_DETECT_RSSI_THRESHOLD to trigger detection.
-
The behavior of the jamming detection feature when PROP_JAM_DETECT_BUSY is larger than PROP_JAM_DETECT_WINDOW is undefined.
b: "Is defined locally" flag. Set if this network was locally defined. Assumed to be true for set, insert and replace. Clear if the on mesh network was defined by another node.
This property contains the value of the mode TLV for this node. The meaning of the bits in this bitfield are defined by section 4.5.2 of the Thread specification.
Allow the HOST to indicate whether or not the router role is enabled. If current role is a router, setting this property to false starts a re-attach process as an end-device.
Specifies the preferred Router Id. Upon becoming a router/leader the node attempts to use this Router Id. If the preferred Router Id is not set or if it can not be used, a randomly generated router id is picked. This property can be set only when the device role is either detached or disabled.
Now we will get raw 802.15.4 packets asynchronously on PROP_STREAM_RAW:
+
Now we will get raw 802.15.4 packets asynchronously on PROP_STREAM_RAW:
@@ -4044,8 +4102,14 @@ FE
-
This mode may be entered even when associated with a network. In that case, you should set PROP_MAC_PROMISCUOUS_MODE to MAC_PROMISCUOUS_MODE_PROMISCUOUS or MAC_PROMISCUOUS_MODE_NORMAL, so that you can avoid receiving packets from other networks or that are destined for other nodes.
This mode may be entered even when associated with a network. In that case, you should set PROP_MAC_PROMISCUOUS_MODE to MAC_PROMISCUOUS_MODE_PROMISCUOUS or MAC_PROMISCUOUS_MODE_NORMAL, so that you can avoid receiving packets from other networks or that are destined for other nodes.
Special thanks to Abtin Keshavarzian, Martin Turon, Arjuna Sivasithambaresan and Jonathan Hui for their substantial contributions and feedback related to this document.
diff --git a/doc/draft-spinel-protocol.txt b/doc/draft-spinel-protocol.txt
index 07fbf59d6..19599767f 100644
--- a/doc/draft-spinel-protocol.txt
+++ b/doc/draft-spinel-protocol.txt
@@ -4,11 +4,11 @@
R. Quattlebaum
Nest Labs
- November 4, 2016
+ November 28, 2016
Spinel Host-Controller Protocol
- draft-spinel-protocol-f9bf43254
+ draft-spinel-protocol-05367497d
Abstract
@@ -53,9 +53,9 @@ Copyright Notice
-Quattlebaum Expires May 8, 2017 [Page 1]
+Quattlebaum Expires June 1, 2017 [Page 1]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
@@ -73,7 +73,7 @@ Table of Contents
1.1.2. Spinel as Application API . . . . . . . . . . . . . . 7
1.1.3. Privileged Commands and Properties . . . . . . . . . 8
1.2. Property Overview . . . . . . . . . . . . . . . . . . . . 8
- 1.2.1. Property Methods . . . . . . . . . . . . . . . . . . 8
+ 1.2.1. Property Methods . . . . . . . . . . . . . . . . . . 9
1.2.2. Property Types . . . . . . . . . . . . . . . . . . . 9
2. Frame Format . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1. Header Format . . . . . . . . . . . . . . . . . . . . . . 11
@@ -109,9 +109,9 @@ Table of Contents
-Quattlebaum Expires May 8, 2017 [Page 2]
+Quattlebaum Expires June 1, 2017 [Page 2]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
5.2.3. PROP 2: PROP_NCP_VERSION . . . . . . . . . . . . . . 23
@@ -165,123 +165,129 @@ Quattlebaum Expires May 8, 2017 [Page 2]
-Quattlebaum Expires May 8, 2017 [Page 3]
+Quattlebaum Expires June 1, 2017 [Page 3]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
5.7.4. PROP 99: PROP_IPV6_ADDRESS_TABLE . . . . . . . . . . 37
5.7.5. PROP 101: PROP_IPv6_ICMP_PING_OFFLOAD . . . . . . . . 38
6. Status Codes . . . . . . . . . . . . . . . . . . . . . . . . 38
- 7. Security Considerations . . . . . . . . . . . . . . . . . . . 39
- 7.1. Raw Application Access . . . . . . . . . . . . . . . . . 39
- 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 40
- 9.1. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 40
- Appendix A. Framing Protocol . . . . . . . . . . . . . . . . . . 40
- A.1. UART Recommendations . . . . . . . . . . . . . . . . . . 40
- A.1.1. UART Bit Rate Detection . . . . . . . . . . . . . . . 41
- A.1.2. HDLC-Lite . . . . . . . . . . . . . . . . . . . . . . 41
- A.2. SPI Recommendations . . . . . . . . . . . . . . . . . . . 42
- A.2.1. SPI Framing Protocol . . . . . . . . . . . . . . . . 43
- A.3. I^2C Recommendations . . . . . . . . . . . . . . . . . . 45
- A.4. Native USB Recommendations . . . . . . . . . . . . . . . 45
- Appendix B. Feature: Network Save . . . . . . . . . . . . . . . 45
- B.1. Commands . . . . . . . . . . . . . . . . . . . . . . . . 45
- B.1.1. CMD 9: (Host->NCP) CMD_NET_SAVE . . . . . . . . . . . 45
- B.1.2. CMD 10: (Host->NCP) CMD_NET_CLEAR . . . . . . . . . . 46
- B.1.3. CMD 11: (Host->NCP) CMD_NET_RECALL . . . . . . . . . 46
- Appendix C. Feature: Host Buffer Offload . . . . . . . . . . . . 46
- C.1. Commands . . . . . . . . . . . . . . . . . . . . . . . . 47
- C.1.1. CMD 12: (NCP->Host) CMD_HBO_OFFLOAD . . . . . . . . . 47
- C.1.2. CMD 13: (NCP->Host) CMD_HBO_RECLAIM . . . . . . . . . 47
- C.1.3. CMD 14: (NCP->Host) CMD_HBO_DROP . . . . . . . . . . 47
- C.1.4. CMD 15: (Host->NCP) CMD_HBO_OFFLOADED . . . . . . . . 47
- C.1.5. CMD 16: (Host->NCP) CMD_HBO_RECLAIMED . . . . . . . . 47
- C.1.6. CMD 17: (Host->NCP) CMD_HBO_DROPPED . . . . . . . . . 48
- C.2. Properties . . . . . . . . . . . . . . . . . . . . . . . 48
- C.2.1. PROP 10: PROP_HBO_MEM_MAX . . . . . . . . . . . . . . 48
- C.2.2. PROP 11: PROP_HBO_BLOCK_MAX . . . . . . . . . . . . . 48
- Appendix D. Feature: Jam Detection . . . . . . . . . . . . . . . 49
- D.1. Properties . . . . . . . . . . . . . . . . . . . . . . . 49
- D.1.1. PROP 4608: PROP_JAM_DETECT_ENABLE . . . . . . . . . . 49
- D.1.2. PROP 4609: PROP_JAM_DETECTED . . . . . . . . . . . . 49
- D.1.3. PROP 4610: PROP_JAM_DETECT_RSSI_THRESHOLD . . . . . . 50
- D.1.4. PROP 4611: PROP_JAM_DETECT_WINDOW . . . . . . . . . . 50
- D.1.5. PROP 4612: PROP_JAM_DETECT_BUSY . . . . . . . . . . . 50
- Appendix E. Technology: Thread . . . . . . . . . . . . . . . . . 50
- E.1. Thread Capabilities . . . . . . . . . . . . . . . . . . . 51
- E.2. Thread Properties . . . . . . . . . . . . . . . . . . . . 51
- E.2.1. PROP 80: PROP_THREAD_LEADER_ADDR . . . . . . . . . . 51
- E.2.2. PROP 81: PROP_THREAD_PARENT . . . . . . . . . . . . . 51
- E.2.3. PROP 82: PROP_THREAD_CHILD_TABLE . . . . . . . . . . 51
- E.2.4. PROP 83: PROP_THREAD_LEADER_RID . . . . . . . . . . . 52
- E.2.5. PROP 84: PROP_THREAD_LEADER_WEIGHT . . . . . . . . . 52
- E.2.6. PROP 85: PROP_THREAD_LOCAL_LEADER_WEIGHT . . . . . . 52
- E.2.7. PROP 86: PROP_THREAD_NETWORK_DATA . . . . . . . . . . 52
+ 7. Technology: Thread . . . . . . . . . . . . . . . . . . . . . 39
+ 7.1. Thread Capabilities . . . . . . . . . . . . . . . . . . . 40
+ 7.2. Thread Properties . . . . . . . . . . . . . . . . . . . . 40
+ 7.2.1. PROP 80: PROP_THREAD_LEADER_ADDR . . . . . . . . . . 40
+ 7.2.2. PROP 81: PROP_THREAD_PARENT . . . . . . . . . . . . . 40
+ 7.2.3. PROP 82: PROP_THREAD_CHILD_TABLE . . . . . . . . . . 40
+ 7.2.4. PROP 83: PROP_THREAD_LEADER_RID . . . . . . . . . . . 40
+ 7.2.5. PROP 84: PROP_THREAD_LEADER_WEIGHT . . . . . . . . . 41
+ 7.2.6. PROP 85: PROP_THREAD_LOCAL_LEADER_WEIGHT . . . . . . 41
+ 7.2.7. PROP 86: PROP_THREAD_NETWORK_DATA . . . . . . . . . . 41
+ 7.2.8. PROP 87: PROP_THREAD_NETWORK_DATA_VERSION . . . . . . 41
+ 7.2.9. PROP 88: PROP_THREAD_STABLE_NETWORK_DATA . . . . . . 41
+ 7.2.10. PROP 89: PROP_THREAD_STABLE_NETWORK_DATA_VERSION . . 41
+ 7.2.11. PROP 90: PROP_THREAD_ON_MESH_NETS . . . . . . . . . . 41
+ 7.2.12. PROP 91: PROP_THREAD_LOCAL_ROUTES . . . . . . . . . . 42
+ 7.2.13. PROP 92: PROP_THREAD_ASSISTING_PORTS . . . . . . . . 42
+ 7.2.14. PROP 93: PROP_THREAD_ALLOW_LOCAL_NET_DATA_CHANGE . . 42
+ 7.2.15. PROP 94: PROP_THREAD_MODE . . . . . . . . . . . . . . 42
+ 7.2.16. PROP 5376: PROP_THREAD_CHILD_TIMEOUT . . . . . . . . 42
+ 7.2.17. PROP 5377: PROP_THREAD_RLOC16 . . . . . . . . . . . . 42
+ 7.2.18. PROP 5378: PROP_THREAD_ROUTER_UPGRADE_THRESHOLD . . . 43
+ 7.2.19. PROP 5379: PROP_THREAD_CONTEXT_REUSE_DELAY . . . . . 43
+ 7.2.20. PROP 5380: PROP_THREAD_NETWORK_ID_TIMEOUT . . . . . . 43
+ 7.2.21. PROP 5381: PROP_THREAD_ACTIVE_ROUTER_IDS . . . . . . 43
+ 7.2.22. PROP 5382: PROP_THREAD_RLOC16_DEBUG_PASSTHRU . . . . 43
+ 7.2.23. PROP 5383: SPINEL_PROP_THREAD_ROUTER_ROLE_ENABLED . . 43
+ 7.2.24. PROP 5384: PROP_THREAD_ROUTER_DOWNGRADE_THRESHOLD . . 44
+ 7.2.25. PROP 5385: PROP_THREAD_ROUTER_SELECTION_JITTER . . . 44
+ 7.2.26. PROP 5386: PROP_THREAD_PREFERRED_ROUTER_ID . . . . . 44
+ 7.2.27. PROP 5387: SPINEL_PROP_THREAD_NEIGHBOR_TABLE . . . . 44
+ 8. Feature: Network Save . . . . . . . . . . . . . . . . . . . . 44
+ 8.1. Commands . . . . . . . . . . . . . . . . . . . . . . . . 45
+ 8.1.1. CMD 9: (Host->NCP) CMD_NET_SAVE . . . . . . . . . . . 45
+ 8.1.2. CMD 10: (Host->NCP) CMD_NET_CLEAR . . . . . . . . . . 45
+ 8.1.3. CMD 11: (Host->NCP) CMD_NET_RECALL . . . . . . . . . 46
+ 9. Feature: Host Buffer Offload . . . . . . . . . . . . . . . . 46
+ 9.1. Commands . . . . . . . . . . . . . . . . . . . . . . . . 46
+ 9.1.1. CMD 12: (NCP->Host) CMD_HBO_OFFLOAD . . . . . . . . . 46
+ 9.1.2. CMD 13: (NCP->Host) CMD_HBO_RECLAIM . . . . . . . . . 47
+ 9.1.3. CMD 14: (NCP->Host) CMD_HBO_DROP . . . . . . . . . . 47
+ 9.1.4. CMD 15: (Host->NCP) CMD_HBO_OFFLOADED . . . . . . . . 47
+ 9.1.5. CMD 16: (Host->NCP) CMD_HBO_RECLAIMED . . . . . . . . 47
+ 9.1.6. CMD 17: (Host->NCP) CMD_HBO_DROPPED . . . . . . . . . 47
+ 9.2. Properties . . . . . . . . . . . . . . . . . . . . . . . 47
+ 9.2.1. PROP 10: PROP_HBO_MEM_MAX . . . . . . . . . . . . . . 47
-Quattlebaum Expires May 8, 2017 [Page 4]
+Quattlebaum Expires June 1, 2017 [Page 4]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
- E.2.8. PROP 87: PROP_THREAD_NETWORK_DATA_VERSION . . . . . . 52
- E.2.9. PROP 88: PROP_THREAD_STABLE_NETWORK_DATA . . . . . . 52
- E.2.10. PROP 89: PROP_THREAD_STABLE_NETWORK_DATA_VERSION . . 52
- E.2.11. PROP 90: PROP_THREAD_ON_MESH_NETS . . . . . . . . . . 52
- E.2.12. PROP 91: PROP_THREAD_LOCAL_ROUTES . . . . . . . . . . 53
- E.2.13. PROP 92: PROP_THREAD_ASSISTING_PORTS . . . . . . . . 53
- E.2.14. PROP 93: PROP_THREAD_ALLOW_LOCAL_NET_DATA_CHANGE . . 53
- E.2.15. PROP 94: PROP_THREAD_MODE . . . . . . . . . . . . . . 53
- E.2.16. PROP 5376: PROP_THREAD_CHILD_TIMEOUT . . . . . . . . 53
- E.2.17. PROP 5377: PROP_THREAD_RLOC16 . . . . . . . . . . . . 54
- E.2.18. PROP 5378: PROP_THREAD_ROUTER_UPGRADE_THRESHOLD . . . 54
- E.2.19. PROP 5379: PROP_THREAD_CONTEXT_REUSE_DELAY . . . . . 54
- E.2.20. PROP 5380: PROP_THREAD_NETWORK_ID_TIMEOUT . . . . . . 54
- E.2.21. PROP 5381: PROP_THREAD_ACTIVE_ROUTER_IDS . . . . . . 54
- E.2.22. PROP 5382: PROP_THREAD_RLOC16_DEBUG_PASSTHRU . . . . 54
- E.2.23. PROP 5383: SPINEL_PROP_THREAD_ROUTER_ROLE_ENABLED . . 54
- E.2.24. PROP 5384: PROP_THREAD_ROUTER_DOWNGRADE_THRESHOLD . . 55
- E.2.25. PROP 5385: PROP_THREAD_ROUTER_SELECTION_JITTER . . . 55
- E.2.26. PROP 5386: PROP_THREAD_PREFERRED_ROUTER_ID . . . . . 55
- E.2.27. PROP 5387: SPINEL_PROP_THREAD_NEIGHBOR_TABLE . . . . 55
- Appendix F. Test Vectors . . . . . . . . . . . . . . . . . . . . 56
- F.1. Test Vector: Packed Unsigned Integer . . . . . . . . . . 56
- F.2. Test Vector: Reset Command . . . . . . . . . . . . . . . 56
- F.3. Test Vector: Reset Notification . . . . . . . . . . . . . 56
- F.4. Test Vector: Scan Beacon . . . . . . . . . . . . . . . . 56
- F.5. Test Vector: Inbound IPv6 Packet . . . . . . . . . . . . 57
- F.6. Test Vector: Outbound IPv6 Packet . . . . . . . . . . . . 57
- F.7. Test Vector: Fetch list of on-mesh networks . . . . . . . 57
- F.8. Test Vector: Returned list of on-mesh networks . . . . . 58
- F.9. Test Vector: Adding an on-mesh network . . . . . . . . . 58
- F.10. Test Vector: Insertion notification of an on-mesh network 58
- F.11. Test Vector: Removing a local on-mesh network . . . . . . 59
- F.12. Test Vector: Removal notification of an on-mesh network . 59
- Appendix G. Example Sessions . . . . . . . . . . . . . . . . . . 59
- G.1. NCP Initialization . . . . . . . . . . . . . . . . . . . 59
- G.2. Attaching to a network . . . . . . . . . . . . . . . . . 60
- G.3. Successfully joining a pre-existing network . . . . . . . 61
- G.4. Unsuccessfully joining a pre-existing network . . . . . . 62
- G.5. Detaching from a network . . . . . . . . . . . . . . . . 62
- G.6. Attaching to a saved network . . . . . . . . . . . . . . 62
- G.7. NCP Software Reset . . . . . . . . . . . . . . . . . . . 63
- G.8. Adding an on-mesh prefix . . . . . . . . . . . . . . . . 63
- G.9. Entering low-power modes . . . . . . . . . . . . . . . . 63
- G.10. Sniffing raw packets . . . . . . . . . . . . . . . . . . 63
- Appendix H. Glossary . . . . . . . . . . . . . . . . . . . . . . 64
- Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 65
+ 9.2.2. PROP 11: PROP_HBO_BLOCK_MAX . . . . . . . . . . . . . 48
+ 10. Feature: Jam Detection . . . . . . . . . . . . . . . . . . . 48
+ 10.1. Properties . . . . . . . . . . . . . . . . . . . . . . . 48
+ 10.1.1. PROP 4608: PROP_JAM_DETECT_ENABLE . . . . . . . . . 48
+ 10.1.2. PROP 4609: PROP_JAM_DETECTED . . . . . . . . . . . . 49
+ 10.1.3. PROP 4610: PROP_JAM_DETECT_RSSI_THRESHOLD . . . . . 49
+ 10.1.4. PROP 4611: PROP_JAM_DETECT_WINDOW . . . . . . . . . 49
+ 10.1.5. PROP 4612: PROP_JAM_DETECT_BUSY . . . . . . . . . . 50
+ 11. Feature: Basic GPIO Access . . . . . . . . . . . . . . . . . 50
+ 11.1. Properties . . . . . . . . . . . . . . . . . . . . . . . 50
+ 11.1.1. PROP 4096: PROP_GPIO_AVAILABLE . . . . . . . . . . . 50
+ 11.1.2. PROP 4097: PROP_GPIO_DIRECTION . . . . . . . . . . . 50
+ 11.1.3. PROP 4098: PROP_GPIO_STATE . . . . . . . . . . . . . 51
+ 11.1.4. PROP 4099: PROP_GPIO_STATE_SET . . . . . . . . . . . 51
+ 11.1.5. PROP 4100: PROP_GPIO_STATE_CLEAR . . . . . . . . . . 51
+ 12. Security Considerations . . . . . . . . . . . . . . . . . . . 51
+ 12.1. Raw Application Access . . . . . . . . . . . . . . . . . 51
+ 13.1. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 51
+ Appendix A. Framing Protocol . . . . . . . . . . . . . . . . . . 52
+ A.1. UART Recommendations . . . . . . . . . . . . . . . . . . 52
+ A.1.1. UART Bit Rate Detection . . . . . . . . . . . . . . . 52
+ A.1.2. HDLC-Lite . . . . . . . . . . . . . . . . . . . . . . 53
+ A.2. SPI Recommendations . . . . . . . . . . . . . . . . . . . 54
+ A.2.1. SPI Framing Protocol . . . . . . . . . . . . . . . . 54
+ A.3. I^2C Recommendations . . . . . . . . . . . . . . . . . . 56
+ A.4. Native USB Recommendations . . . . . . . . . . . . . . . 56
+ Appendix B. Test Vectors . . . . . . . . . . . . . . . . . . . . 56
+ B.1. Test Vector: Packed Unsigned Integer . . . . . . . . . . 56
+ B.2. Test Vector: Reset Command . . . . . . . . . . . . . . . 57
+ B.3. Test Vector: Reset Notification . . . . . . . . . . . . . 57
+ B.4. Test Vector: Scan Beacon . . . . . . . . . . . . . . . . 57
+ B.5. Test Vector: Inbound IPv6 Packet . . . . . . . . . . . . 58
+ B.6. Test Vector: Outbound IPv6 Packet . . . . . . . . . . . . 58
+ B.7. Test Vector: Fetch list of on-mesh networks . . . . . . . 58
+ B.8. Test Vector: Returned list of on-mesh networks . . . . . 59
+ B.9. Test Vector: Adding an on-mesh network . . . . . . . . . 59
+ B.10. Test Vector: Insertion notification of an on-mesh network 59
+ B.11. Test Vector: Removing a local on-mesh network . . . . . . 60
+ B.12. Test Vector: Removal notification of an on-mesh network . 60
+ Appendix C. Example Sessions . . . . . . . . . . . . . . . . . . 60
+ C.1. NCP Initialization . . . . . . . . . . . . . . . . . . . 60
+ C.2. Attaching to a network . . . . . . . . . . . . . . . . . 61
+ C.3. Successfully joining a pre-existing network . . . . . . . 62
+ C.4. Unsuccessfully joining a pre-existing network . . . . . . 63
+ C.5. Detaching from a network . . . . . . . . . . . . . . . . 63
+ C.6. Attaching to a saved network . . . . . . . . . . . . . . 63
+ C.7. NCP Software Reset . . . . . . . . . . . . . . . . . . . 64
+ C.8. Adding an on-mesh prefix . . . . . . . . . . . . . . . . 64
-
-
-Quattlebaum Expires May 8, 2017 [Page 5]
+Quattlebaum Expires June 1, 2017 [Page 5]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
+ C.9. Entering low-power modes . . . . . . . . . . . . . . . . 64
+ C.10. Sniffing raw packets . . . . . . . . . . . . . . . . . . 64
+ Appendix D. Acknowledgments . . . . . . . . . . . . . . . . . . 65
+ Appendix E. Glossary . . . . . . . . . . . . . . . . . . . . . . 65
+ Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 66
+
1. Introduction
This Network Control Processor (NCP) protocol was designed to enable
@@ -323,6 +329,15 @@ Quattlebaum Expires May 8, 2017 [Page 5]
the host and the NCP, the following commands and properties are
already considered to be "baked" and will not change:
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 6]
+
+ Spinel Protocol (05367497d) November 2016
+
+
o Command IDs zero through eight. (Reset, No-op, and Property-Value
Commands)
o Property IDs zero through two. (Last status, Protocol Version,
@@ -330,14 +345,6 @@ Quattlebaum Expires May 8, 2017 [Page 5]
Renumbering would be undertaken in order to better organize the
allocation of property IDs and capability IDs. One of the initial
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 6]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
goals of this protocol was for it to be possible for a host or NCP to
only implement properties with values less than 127 and for the NCP
to still be usable---relegating all larger property values for extra
@@ -378,6 +385,15 @@ Quattlebaum Expires May 8, 2017 [Page 6]
Since there can be more than one application that is using the API at
a time, the "PROP_LOCK" property (Section 5.2.10) would be used to
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 7]
+
+ Spinel Protocol (05367497d) November 2016
+
+
ensure exclusive access to the NCP by an application. Only one
process would be allowed to enable the lock at a time.
@@ -387,13 +403,6 @@ Quattlebaum Expires May 8, 2017 [Page 6]
extended to support them. It is also simple and has no external
dependencies other than unix domain sockets.
-
-
-Quattlebaum Expires May 8, 2017 [Page 7]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
Security is obviously paramount in a system like this, so a great
deal of care should be taken to make sure that certain commands and
properties cannot be executed or changed without the appropriate
@@ -431,8 +440,15 @@ Quattlebaum Expires May 8, 2017 [Page 7]
Almost all features and capabilities are implemented using
properties. Most new features that are initially proposed as
commands can be adapted to be property-based instead. Notable
- exceptions include "Host Buffer Offload" (Appendix C) and "Network
- Save" (Appendix B).
+ exceptions include "Host Buffer Offload" (Section 9) and "Network
+ Save" (Section 8).
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 8]
+
+ Spinel Protocol (05367497d) November 2016
+
In Spinel, properties are keyed by an unsigned integer between 0 and
2,097,151 (See Section 3.2).
@@ -442,14 +458,6 @@ Quattlebaum Expires May 8, 2017 [Page 7]
Properties may support one or more of the following methods:
o "VALUE_GET"
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 8]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
o "VALUE_SET"
o "VALUE_INSERT"
o "VALUE_REMOVE"
@@ -491,6 +499,13 @@ Quattlebaum Expires May 8, 2017 [Page 8]
o List of IPv6 addresses assigned to the interface.
o List of capabilities supported by the NCP.
+
+
+Quattlebaum Expires June 1, 2017 [Page 9]
+
+ Spinel Protocol (05367497d) November 2016
+
+
The valid operations on these sorts of properties are "VALUE_GET",
"VALUE_SET", "VALUE_INSERT", and "VALUE_REMOVE".
@@ -498,14 +513,6 @@ Quattlebaum Expires May 8, 2017 [Page 8]
the concatenation of all of the individual values in the list. If
the length of the value for an individual item in the list is not
defined by the type then each item returned in the list is prepended
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 9]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
with a length (See Section 3.5). The order of the returned items,
unless explicitly defined for that specific property, is undefined.
@@ -547,21 +554,20 @@ Quattlebaum Expires May 8, 2017 [Page 9]
o A command (up to three bytes, see Section 3.2 for format)
o An optional command payload
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 10]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+---------+--------+-----+-------------+
| Octets: | 1 | 1-3 | n |
+---------+--------+-----+-------------+
| Fields: | HEADER | CMD | CMD_PAYLOAD |
+---------+--------+-----+-------------+
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 10]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
2.1. Header Format
The header byte is broken down as follows:
@@ -603,21 +609,19 @@ Quattlebaum Expires May 8, 2017 [Page 10]
receives a frame that matches the TID of the command it sent, it can
easily recognize that frame as the actual response to that command.
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 11]
+
+ Spinel Protocol (05367497d) November 2016
+
+
The TID value of zero (0) is used for commands to which a correlated
response is not expected or needed, such as for unsolicited update
commands sent to the host from the NCP.
-
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 11]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
2.1.4. Command Identifier (CMD)
The command identifier is a 21-bit unsigned integer encoded in up to
@@ -661,19 +665,19 @@ Quattlebaum Expires May 8, 2017 [Page 11]
example:
o "C": A single unsigned byte.
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 12]
+
+ Spinel Protocol (05367497d) November 2016
+
+
o "C6U": A single unsigned byte, followed by a 128-bit IPv6 address,
followed by a zero-terminated UTF8 string.
o "A(6)": An array of IPv6 addresses
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 12]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
In each case, the data is represented exactly as described. For
example, an array of 10 IPv6 address is stored as 160 bytes.
@@ -717,19 +721,19 @@ Quattlebaum Expires May 8, 2017 [Page 12]
need to add an extra byte. Doing this would add an extra byte to the
vast majority of instances, which can add up in terms of bandwidth.
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 13]
+
+ Spinel Protocol (05367497d) November 2016
+
+
The packed unsigned integer format is based on the unsigned integer
format in EXI [3], except that we limit the maximum value to the
largest value that can be encoded into three bytes(2,097,151).
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 13]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
For all values less than 127, the packed form of the number is simply
a single byte which directly represents the number. For values
larger than 127, the following process is used to encode the value:
@@ -773,19 +777,19 @@ Quattlebaum Expires May 8, 2017 [Page 13]
the buffer minus 9. (9 is the number of bytes taken up by a byte and
two longs)
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 14]
+
+ Spinel Protocol (05367497d) November 2016
+
+
However, things are a little different with "CLDL". Since our data
blob is no longer the last item in the signature, the length must be
prepended.
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 14]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
If you are a little confused, keep reading. This theme comes up in a
a few different ways in the following sections.
@@ -833,13 +837,9 @@ Quattlebaum Expires May 8, 2017 [Page 14]
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 15]
+Quattlebaum Expires June 1, 2017 [Page 15]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
3.5. Arrays
@@ -893,9 +893,9 @@ Quattlebaum Expires May 8, 2017 [Page 15]
-Quattlebaum Expires May 8, 2017 [Page 16]
+Quattlebaum Expires June 1, 2017 [Page 16]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
If an error occurs, the value of "PROP_LAST_STATUS" will be emitted
@@ -949,9 +949,9 @@ Quattlebaum Expires May 8, 2017 [Page 16]
-Quattlebaum Expires May 8, 2017 [Page 17]
+Quattlebaum Expires June 1, 2017 [Page 17]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
Insert value into property command. Instructs the NCP to insert the
@@ -1005,9 +1005,9 @@ Quattlebaum Expires May 8, 2017 [Page 17]
-Quattlebaum Expires May 8, 2017 [Page 18]
+Quattlebaum Expires June 1, 2017 [Page 18]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
The payload for this command is the property identifier encoded in
@@ -1061,9 +1061,9 @@ Quattlebaum Expires May 8, 2017 [Page 18]
-Quattlebaum Expires May 8, 2017 [Page 19]
+Quattlebaum Expires June 1, 2017 [Page 19]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
4.10. CMD 18: (Host->NCP) CMD_PEEK
@@ -1085,7 +1085,7 @@ Quattlebaum Expires May 8, 2017 [Page 19]
The NCP MAY prevent certain regions of memory from being accessed.
The implementation of this command has security implications. See
- Section 7 for more information.
+ Section 12 for more information.
This command requires the capability "CAP_PEEK_POKE" to be present.
@@ -1117,16 +1117,16 @@ Quattlebaum Expires May 8, 2017 [Page 19]
-Quattlebaum Expires May 8, 2017 [Page 20]
+Quattlebaum Expires June 1, 2017 [Page 20]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
Due to the low-level nature of this command, certain error conditions
may induce the NCP to reset.
The implementation of this command has security implications. See
- Section 7 for more information.
+ Section 12 for more information.
This command requires the capability "CAP_PEEK_POKE" to be present.
@@ -1173,9 +1173,9 @@ Quattlebaum Expires May 8, 2017 [Page 20]
-Quattlebaum Expires May 8, 2017 [Page 21]
+Quattlebaum Expires June 1, 2017 [Page 21]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
Note that each property section has two reserved ranges: a primary
@@ -1229,9 +1229,9 @@ Quattlebaum Expires May 8, 2017 [Page 21]
-Quattlebaum Expires May 8, 2017 [Page 22]
+Quattlebaum Expires June 1, 2017 [Page 22]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
5.2.2.1. Major Version Number
@@ -1285,9 +1285,9 @@ Quattlebaum Expires May 8, 2017 [Page 22]
-Quattlebaum Expires May 8, 2017 [Page 23]
+Quattlebaum Expires June 1, 2017 [Page 23]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
+---------+----------------+
@@ -1341,18 +1341,19 @@ Quattlebaum Expires May 8, 2017 [Page 23]
-Quattlebaum Expires May 8, 2017 [Page 24]
+Quattlebaum Expires June 1, 2017 [Page 24]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
o 1: "CAP_LOCK"
o 2: "CAP_NET_SAVE"
- o 3: "CAP_HBO": Host Buffer Offload. See Appendix C.
+ o 3: "CAP_HBO": Host Buffer Offload. See Section 9.
o 4: "CAP_POWER_SAVE"
o 5: "CAP_COUNTERS"
- o 6: "CAP_JAM_DETECT": Jamming detection. See Appendix D
+ o 6: "CAP_JAM_DETECT": Jamming detection. See Section 10
o 7: "CAP_PEEK_POKE": PEEK/POKE debugging commands.
+ o 8: "CAP_WRITABLE_RAW_STREAM": "PROP_STREAM_RAW" is writable.
o 16: "CAP_802_15_4_2003"
o 17: "CAP_802_15_4_2006"
o 18: "CAP_802_15_4_2011"
@@ -1396,10 +1397,9 @@ Quattlebaum Expires May 8, 2017 [Page 24]
-
-Quattlebaum Expires May 8, 2017 [Page 25]
+Quattlebaum Expires June 1, 2017 [Page 25]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
Describes the number of concurrent interfaces supported by this NCP.
@@ -1453,9 +1453,9 @@ Quattlebaum Expires May 8, 2017 [Page 25]
-Quattlebaum Expires May 8, 2017 [Page 26]
+Quattlebaum Expires June 1, 2017 [Page 26]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
The static EUI64 address of the device, used as a serial number.
@@ -1509,9 +1509,9 @@ Quattlebaum Expires May 8, 2017 [Page 26]
-Quattlebaum Expires May 8, 2017 [Page 27]
+Quattlebaum Expires June 1, 2017 [Page 27]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
To receive the debugging stream, you wait for "CMD_PROP_VALUE_IS"
@@ -1538,9 +1538,13 @@ Quattlebaum Expires May 8, 2017 [Page 27]
NCP.
Implementations may OPTIONALLY support the ability to transmit
- arbitrary raw packets. If this capability is supported, you may call
- "CMD_PROP_VALUE_SET" on this property with the value of the raw
- packet.
+ arbitrary raw packets. Support for this feature is indicated by the
+ presence of the "CAP_WRITABLE_RAW_STREAM" capability.
+
+ If the capability "CAP_WRITABLE_RAW_STREAM" is set, then packets
+ written to this stream with "CMD_PROP_VALUE_SET" will be sent out
+ over the radio. This allows the caller to use the radio directly,
+ with the stack being implemented on the host instead of the NCP.
5.3.2.1. Frame Metadata Format
@@ -1561,13 +1565,9 @@ Quattlebaum Expires May 8, 2017 [Page 27]
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 28]
+Quattlebaum Expires June 1, 2017 [Page 28]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
+----------+-----------------------+------------+-----+---------+
@@ -1621,9 +1621,9 @@ Quattlebaum Expires May 8, 2017 [Page 28]
-Quattlebaum Expires May 8, 2017 [Page 29]
+Quattlebaum Expires June 1, 2017 [Page 29]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
+---------+----------------+------------+----------------+
@@ -1677,9 +1677,9 @@ Quattlebaum Expires May 8, 2017 [Page 29]
-Quattlebaum Expires May 8, 2017 [Page 30]
+Quattlebaum Expires June 1, 2017 [Page 30]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
Any data past the end of "FRAME_DATA_LEN" is considered metadata, the
@@ -1733,9 +1733,9 @@ Quattlebaum Expires May 8, 2017 [Page 30]
-Quattlebaum Expires May 8, 2017 [Page 31]
+Quattlebaum Expires June 1, 2017 [Page 31]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
When setting, the value will be rounded down to a value that is
@@ -1789,9 +1789,9 @@ Quattlebaum Expires May 8, 2017 [Page 31]
-Quattlebaum Expires May 8, 2017 [Page 32]
+Quattlebaum Expires June 1, 2017 [Page 32]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
5.5.2. PROP 49: PROP_MAC_SCAN_MASK
@@ -1845,9 +1845,9 @@ Quattlebaum Expires May 8, 2017 [Page 32]
-Quattlebaum Expires May 8, 2017 [Page 33]
+Quattlebaum Expires June 1, 2017 [Page 33]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
5.5.5. PROP 52: PROP_MAC_15_4_LADDR
@@ -1901,9 +1901,9 @@ Quattlebaum Expires May 8, 2017 [Page 33]
-Quattlebaum Expires May 8, 2017 [Page 34]
+Quattlebaum Expires June 1, 2017 [Page 34]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
+----+--------------------------------+-----------------------------+
@@ -1957,9 +1957,9 @@ Quattlebaum Expires May 8, 2017 [Page 34]
-Quattlebaum Expires May 8, 2017 [Page 35]
+Quattlebaum Expires June 1, 2017 [Page 35]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
Network interface up/down status. Non-zero (set to 1) indicates up,
@@ -2013,9 +2013,9 @@ Quattlebaum Expires May 8, 2017 [Page 35]
-Quattlebaum Expires May 8, 2017 [Page 36]
+Quattlebaum Expires June 1, 2017 [Page 36]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
5.6.9. PROP 72: PROP_NET_PARTITION_ID
@@ -2069,9 +2069,9 @@ Quattlebaum Expires May 8, 2017 [Page 36]
-Quattlebaum Expires May 8, 2017 [Page 37]
+Quattlebaum Expires June 1, 2017 [Page 37]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
5.7.5. PROP 101: PROP_IPv6_ICMP_PING_OFFLOAD
@@ -2125,9 +2125,9 @@ Quattlebaum Expires May 8, 2017 [Page 37]
-Quattlebaum Expires May 8, 2017 [Page 38]
+Quattlebaum Expires June 1, 2017 [Page 38]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
o 11: "STATUS_NOMEM": The operation has been prevented due to memory
@@ -2165,9 +2165,670 @@ Quattlebaum Expires May 8, 2017 [Page 38]
o 2,000,000 - 2,097,151: Experimental Use Only (MUST NEVER be used
in production!)
-7. Security Considerations
+7. Technology: Thread
-7.1. Raw Application Access
+ This section describes all of the properties and semantics required
+ for managing a Thread NCP.
+
+ Thread NCPs have the following requirements:
+
+ o The property "PROP_INTERFACE_TYPE" must be 3.
+ o The non-optional properties in the following sections MUST be
+ implemented: CORE, PHY, MAC, NET, and IPV6.
+
+ All serious implementations of an NCP SHOULD also support the network
+ save feature (See Section 8).
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 39]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+7.1. Thread Capabilities
+
+ The Thread technology defines the following capabilities:
+
+ o "CAP_NET_THREAD_1_0" - Indicates that the NCP implements v1.0 of
+ the Thread standard.
+ o "CAP_NET_THREAD_1_1" - Indicates that the NCP implements v1.1 of
+ the Thread standard.
+
+7.2. Thread Properties
+
+ Properties for Thread are allocated out of the "Tech" property
+ section (see Section 5.1).
+
+7.2.1. PROP 80: PROP_THREAD_LEADER_ADDR
+
+ o Type: Read-Only
+ o Packed-Encoding: "6"
+
+ The IPv6 address of the leader. (Note: May change to long and short
+ address of leader)
+
+7.2.2. PROP 81: PROP_THREAD_PARENT
+
+ o Type: Read-Only
+ o Packed-Encoding: "ES"
+ o LADDR, SADDR
+
+ The long address and short address of the parent of this node.
+
+7.2.3. PROP 82: PROP_THREAD_CHILD_TABLE
+
+ o Type: Read-Only
+ o Packed-Encoding: "A(T(ES))"
+
+ Table containing the long and short addresses of all the children of
+ this node.
+
+7.2.4. PROP 83: PROP_THREAD_LEADER_RID
+
+ o Type: Read-Only
+ o Packed-Encoding: "C"
+
+ The router-id of the current leader.
+
+
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 40]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+7.2.5. PROP 84: PROP_THREAD_LEADER_WEIGHT
+
+ o Type: Read-Only
+ o Packed-Encoding: "C"
+
+ The leader weight of the current leader.
+
+7.2.6. PROP 85: PROP_THREAD_LOCAL_LEADER_WEIGHT
+
+ o Type: Read-Write
+ o Packed-Encoding: "C"
+
+ The leader weight for this node.
+
+7.2.7. PROP 86: PROP_THREAD_NETWORK_DATA
+
+ o Type: Read-Only
+ o Packed-Encoding: "D"
+
+7.2.8. PROP 87: PROP_THREAD_NETWORK_DATA_VERSION
+
+ o Type: Read-Only
+ o Packed-Encoding: "S"
+
+7.2.9. PROP 88: PROP_THREAD_STABLE_NETWORK_DATA
+
+ o Type: Read-Only
+ o Packed-Encoding: "D"
+
+7.2.10. PROP 89: PROP_THREAD_STABLE_NETWORK_DATA_VERSION
+
+ o Type: Read-Only
+ o Packed-Encoding: "S"
+
+7.2.11. PROP 90: PROP_THREAD_ON_MESH_NETS
+
+ o Type: Read-Write
+ o Packed-Encoding: "A(T(6CbCb))"
+
+ Data per item is:
+
+ o "6": IPv6 Prefix
+ o "C": Prefix length, in bits
+ o "b": Stable flag
+ o "C": Thread flags
+ o "b": "Is defined locally" flag. Set if this network was locally
+ defined. Assumed to be true for set, insert and replace. Clear
+ if the on mesh network was defined by another node.
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 41]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+7.2.12. PROP 91: PROP_THREAD_LOCAL_ROUTES
+
+ o Type: Read-Write
+ o Packed-Encoding: "A(T(6CbC))"
+
+ Data per item is:
+
+ o "6": IPv6 Prefix
+ o "C": Prefix length, in bits
+ o "b": Stable flag
+ o "C": Other flags
+
+7.2.13. PROP 92: PROP_THREAD_ASSISTING_PORTS
+
+ o Type: Read-Write
+ o Packed-Encoding: "A(S)"
+
+7.2.14. PROP 93: PROP_THREAD_ALLOW_LOCAL_NET_DATA_CHANGE
+
+ o Type: Read-Write
+ o Packed-Encoding: "b"
+
+ Set to true before changing local net data. Set to false when
+ finished. This allows changes to be aggregated into single events.
+
+7.2.15. PROP 94: PROP_THREAD_MODE
+
+ o Type: Read-Write
+ o Packed-Encoding: "C"
+
+ This property contains the value of the mode TLV for this node. The
+ meaning of the bits in this bitfield are defined by section 4.5.2 of
+ the Thread specification.
+
+7.2.16. PROP 5376: PROP_THREAD_CHILD_TIMEOUT
+
+ o Type: Read-Write
+ o Packed-Encoding: "L"
+
+ Used when operating in the Child role.
+
+7.2.17. PROP 5377: PROP_THREAD_RLOC16
+
+ o Type: Read-Write
+ o Packed-Encoding: "S"
+
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 42]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+7.2.18. PROP 5378: PROP_THREAD_ROUTER_UPGRADE_THRESHOLD
+
+ o Type: Read-Write
+ o Packed-Encoding: "C"
+
+7.2.19. PROP 5379: PROP_THREAD_CONTEXT_REUSE_DELAY
+
+ o Type: Read-Write
+ o Packed-Encoding: "L"
+
+7.2.20. PROP 5380: PROP_THREAD_NETWORK_ID_TIMEOUT
+
+ o Type: Read-Write
+ o Packed-Encoding: "C"
+
+ Allows you to get or set the Thread "NETWORK_ID_TIMEOUT" constant, as
+ defined by the Thread specification.
+
+7.2.21. PROP 5381: PROP_THREAD_ACTIVE_ROUTER_IDS
+
+ o Type: Read-Write/Write-Only
+ o Packed-Encoding: "A(C)" (List of active thread router ids)
+
+ Note that some implementations may not support "CMD_GET_VALUE" router
+ ids, but may support "CMD_REMOVE_VALUE" when the node is a leader.
+
+7.2.22. PROP 5382: PROP_THREAD_RLOC16_DEBUG_PASSTHRU
+
+ o Type: Read-Write
+ o Packed-Encoding: "b"
+
+ Allow the HOST to directly observe all IPv6 packets received by the
+ NCP, including ones sent to the RLOC16 address.
+
+ Default value is "false".
+
+7.2.23. PROP 5383: SPINEL_PROP_THREAD_ROUTER_ROLE_ENABLED
+
+ o Type: Read-Write
+ o Packed-Encoding: "b"
+
+ Allow the HOST to indicate whether or not the router role is enabled.
+ If current role is a router, setting this property to "false" starts
+ a re-attach process as an end-device.
+
+
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 43]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+7.2.24. PROP 5384: PROP_THREAD_ROUTER_DOWNGRADE_THRESHOLD
+
+ o Type: Read-Write
+ o Packed-Encoding: "C"
+
+7.2.25. PROP 5385: PROP_THREAD_ROUTER_SELECTION_JITTER
+
+ o Type: Read-Write
+ o Packed-Encoding: "C"
+
+ Specifies the self imposed random delay in seconds a REED waits
+ before registering to become an Active Router.
+
+7.2.26. PROP 5386: PROP_THREAD_PREFERRED_ROUTER_ID
+
+ o Type: Write-Only
+ o Packed-Encoding: "C"
+
+ Specifies the preferred Router Id. Upon becoming a router/leader the
+ node attempts to use this Router Id. If the preferred Router Id is
+ not set or if it can not be used, a randomly generated router id is
+ picked. This property can be set only when the device role is either
+ detached or disabled.
+
+7.2.27. PROP 5387: SPINEL_PROP_THREAD_NEIGHBOR_TABLE
+
+ o Type: Read-Only
+ o Packed-Encoding: "A(T(ESLCcCbLL))"
+
+ Data per item is:
+
+ o "E": Extended/long address
+ o "S": RLOC16
+ o "L": Age
+ o "C": Link Quality In
+ o "c": Average RSS
+ o "C": Mode (bit-flags)
+ o "b": "true" if neighbor is a child, "false" otherwise.
+ o "L": Link Frame Counter
+ o "L": MLE Frame Counter
+
+8. Feature: Network Save
+
+ The network save feature is an optional NCP capability that, when
+ present, allows the host to save and recall network credentials and
+ state to and from nonvolatile storage.
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 44]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+ The presence of this feature can be detected by checking for the
+ presence of the "CAP_NET_SAVE" capability in "PROP_CAPS".
+
+8.1. Commands
+
+8.1.1. CMD 9: (Host->NCP) CMD_NET_SAVE
+
+ +---------+--------+--------------+
+ | Octets: | 1 | 1 |
+ +---------+--------+--------------+
+ | Fields: | HEADER | CMD_NET_SAVE |
+ +---------+--------+--------------+
+
+ Save network state command. Saves any current network credentials
+ and state necessary to reconnect to the current network to non-
+ volatile memory.
+
+ This operation affects non-volatile memory only. The current network
+ information stored in volatile memory is unaffected.
+
+ The response to this command is always a "CMD_PROP_VALUE_IS" for
+ "PROP_LAST_STATUS", indicating the result of the operation.
+
+ This command is only available if the "CAP_NET_SAVE" capability is
+ set.
+
+8.1.2. CMD 10: (Host->NCP) CMD_NET_CLEAR
+
+ +---------+--------+---------------+
+ | Octets: | 1 | 1 |
+ +---------+--------+---------------+
+ | Fields: | HEADER | CMD_NET_CLEAR |
+ +---------+--------+---------------+
+
+ Clear saved network state command. Clears any previously saved
+ network credentials and state previously stored by "CMD_NET_SAVE"
+ from non-volatile memory.
+
+ This operation affects non-volatile memory only. The current network
+ information stored in volatile memory is unaffected.
+
+ The response to this command is always a "CMD_PROP_VALUE_IS" for
+ "PROP_LAST_STATUS", indicating the result of the operation.
+
+ This command is only available if the "CAP_NET_SAVE" capability is
+ set.
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 45]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+8.1.3. CMD 11: (Host->NCP) CMD_NET_RECALL
+
+ +---------+--------+----------------+
+ | Octets: | 1 | 1 |
+ +---------+--------+----------------+
+ | Fields: | HEADER | CMD_NET_RECALL |
+ +---------+--------+----------------+
+
+ Recall saved network state command. Recalls any previously saved
+ network credentials and state previously stored by "CMD_NET_SAVE"
+ from non-volatile memory.
+
+ This command will typically generated several unsolicited property
+ updates as the network state is loaded. At the conclusion of
+ loading, the authoritative response to this command is always a
+ "CMD_PROP_VALUE_IS" for "PROP_LAST_STATUS", indicating the result of
+ the operation.
+
+ This command is only available if the "CAP_NET_SAVE" capability is
+ set.
+
+9. Feature: Host Buffer Offload
+
+ The memory on an NCP may be much more limited than the memory on the
+ host processor. In such situations, it is sometimes useful for the
+ NCP to offload buffers to the host processor temporarily so that it
+ can perform other operations.
+
+ Host buffer offload is an optional NCP capability that, when present,
+ allows the NCP to store data buffers on the host processor that can
+ be recalled at a later time.
+
+ The presence of this feature can be detected by the host by checking
+ for the presence of the "CAP_HBO" capability in "PROP_CAPS".
+
+9.1. Commands
+
+9.1.1. CMD 12: (NCP->Host) CMD_HBO_OFFLOAD
+
+ o Argument-Encoding: "LscD"
+
+ * "OffloadId": 32-bit unique block identifier
+ * "Expiration": In seconds-from-now
+ * "Priority": Critical, High, Medium, Low
+ * "Data": Data to offload
+
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 46]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+9.1.2. CMD 13: (NCP->Host) CMD_HBO_RECLAIM
+
+ o Argument-Encoding: "Lb"
+
+ * "OffloadId": 32-bit unique block identifier
+ * "KeepAfterReclaim": If not set to true, the block will be
+ dropped by the host after it is sent to the NCP.
+
+9.1.3. CMD 14: (NCP->Host) CMD_HBO_DROP
+
+ o Argument-Encoding: "L"
+
+ * "OffloadId": 32-bit unique block identifier
+
+9.1.4. CMD 15: (Host->NCP) CMD_HBO_OFFLOADED
+
+ o Argument-Encoding: "Li"
+
+ * "OffloadId": 32-bit unique block identifier
+ * "Status": Status code for the result of the operation.
+
+9.1.5. CMD 16: (Host->NCP) CMD_HBO_RECLAIMED
+
+ o Argument-Encoding: "LiD"
+
+ * "OffloadId": 32-bit unique block identifier
+ * "Status": Status code for the result of the operation.
+ * "Data": Data that was previously offloaded (if any)
+
+9.1.6. CMD 17: (Host->NCP) CMD_HBO_DROPPED
+
+ o Argument-Encoding: "Li"
+
+ * "OffloadId": 32-bit unique block identifier
+ * "Status": Status code for the result of the operation.
+
+9.2. Properties
+
+9.2.1. PROP 10: PROP_HBO_MEM_MAX
+
+ o Type: Read-Write
+ o Packed-Encoding: "L"
+
+ +---------+--------------------+
+ | Octets: | 4 |
+ +---------+--------------------+
+ | Fields: | "PROP_HBO_MEM_MAX" |
+ +---------+--------------------+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 47]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+ Describes the number of bytes that may be offloaded from the NCP to
+ the host. Default value is zero, so this property must be set by the
+ host to a non-zero value before the NCP will begin offloading blocks.
+
+ This value is encoded as an unsigned 32-bit integer.
+
+ This property is only available if the "CAP_HBO" capability is
+ present in "PROP_CAPS".
+
+9.2.2. PROP 11: PROP_HBO_BLOCK_MAX
+
+ o Type: Read-Write
+ o Packed-Encoding: "S"
+
+ +---------+----------------------+
+ | Octets: | 2 |
+ +---------+----------------------+
+ | Fields: | "PROP_HBO_BLOCK_MAX" |
+ +---------+----------------------+
+
+ Describes the number of blocks that may be offloaded from the NCP to
+ the host. Default value is 32. Setting this value to zero will
+ cause host block offload to be effectively disabled.
+
+ This value is encoded as an unsigned 16-bit integer.
+
+ This property is only available if the "CAP_HBO" capability is
+ present in "PROP_CAPS".
+
+10. Feature: Jam Detection
+
+ Jamming detection is a feature that allows the NCP to report when it
+ detects high levels of interference that are characteristic of
+ intentional signal jamming.
+
+ The presence of this feature can be detected by checking for the
+ presence of the "CAP_JAM_DETECT" (value 6) capability in "PROP_CAPS".
+
+10.1. Properties
+
+10.1.1. PROP 4608: PROP_JAM_DETECT_ENABLE
+
+ o Type: Read-Write
+ o Packed-Encoding: "b"
+ o Default Value: false
+ o REQUIRED for "CAP_JAM_DETECT"
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 48]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+ +---------+--------------------------+
+ | Octets: | 1 |
+ +---------+--------------------------+
+ | Fields: | "PROP_JAM_DETECT_ENABLE" |
+ +---------+--------------------------+
+
+ Indicates if jamming detection is enabled or disabled. Set to true
+ to enable jamming detection.
+
+ This property is only available if the "CAP_JAM_DETECT" capability is
+ present in "PROP_CAPS".
+
+10.1.2. PROP 4609: PROP_JAM_DETECTED
+
+ o Type: Read-Only
+ o Packed-Encoding: "b"
+ o REQUIRED for "CAP_JAM_DETECT"
+
+ +---------+---------------------+
+ | Octets: | 1 |
+ +---------+---------------------+
+ | Fields: | "PROP_JAM_DETECTED" |
+ +---------+---------------------+
+
+ Set to true if radio jamming is detected. Set to false otherwise.
+
+ When jamming detection is enabled, changes to the value of this
+ property are emitted asynchronously via "CMD_PROP_VALUE_IS".
+
+ This property is only available if the "CAP_JAM_DETECT" capability is
+ present in "PROP_CAPS".
+
+10.1.3. PROP 4610: PROP_JAM_DETECT_RSSI_THRESHOLD
+
+ o Type: Read-Write
+ o Packed-Encoding: "c"
+ o Units: dBm
+ o Default Value: Implementation-specific
+ o RECOMMENDED for "CAP_JAM_DETECT"
+
+ This parameter describes the threshold RSSI level (measured in dBm)
+ above which the jamming detection will consider the channel blocked.
+
+10.1.4. PROP 4611: PROP_JAM_DETECT_WINDOW
+
+ o Type: Read-Write
+ o Packed-Encoding: "c"
+ o Units: Seconds (1-64)
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 49]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+ o Default Value: Implementation-specific
+ o RECOMMENDED for "CAP_JAM_DETECT"
+
+ This parameter describes the window period for signal jamming
+ detection.
+
+10.1.5. PROP 4612: PROP_JAM_DETECT_BUSY
+
+ o Type: Read-Write
+ o Packed-Encoding: "i"
+ o Units: Seconds (1-64)
+ o Default Value: Implementation-specific
+ o RECOMMENDED for "CAP_JAM_DETECT"
+
+ This parameter describes the number of aggregate seconds within the
+ detection window where the RSSI must be above
+ "PROP_JAM_DETECT_RSSI_THRESHOLD" to trigger detection.
+
+ The behavior of the jamming detection feature when
+ "PROP_JAM_DETECT_BUSY" is larger than "PROP_JAM_DETECT_WINDOW" is
+ undefined.
+
+11. Feature: Basic GPIO Access
+
+ The length of the data associated with these properties depends on
+ the number of GPIOs. If you have 10 GPIOs, you'd have two bytes.
+ You determine the number of GPIOs available by examining
+ PROP_GPIO_AVAILABLE, described below. This API isn't intended to
+ support every possible GPIO state, it is intended for basic reading
+ and writing.
+
+11.1. Properties
+
+11.1.1. PROP 4096: PROP_GPIO_AVAILABLE
+
+ o Type: Read-only
+
+ Contains a bit field identifying which GPIOs are supported. Cleared
+ bits are not supported. Set bits are supported.
+
+11.1.2. PROP 4097: PROP_GPIO_DIRECTION
+
+ o Type: Read-only (Optionally read/write)
+
+ Contains a bit field identifying which GPIOs are configured as
+ outputs. Cleared bits are inputs. Set bits are outputs.
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 50]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+11.1.3. PROP 4098: PROP_GPIO_STATE
+
+ o Type: Read-Write
+
+ Contains a bit field identifying the state of the GPIOs. For GPIOs
+ configured as inputs, this is the read logic level. For GPIOs
+ configured as outputs, this is the logic level of the output.
+
+11.1.4. PROP 4099: PROP_GPIO_STATE_SET
+
+ o Type: Write-only
+
+ Allows for the state of various output GPIOs to be set without
+ affecting other GPIO states. Contains a bit field identifying the
+ output GPIOs that should have their state set to 1.
+
+11.1.5. PROP 4100: PROP_GPIO_STATE_CLEAR
+
+ o Type: Write-only
+
+ Allows for the state of various output GPIOs to be cleared without
+ affecting other GPIO states. Contains a bit field identifying the
+ output GPIOs that should have their state cleared to 0.
+
+12. Security Considerations
+
+12.1. Raw Application Access
Spinel MAY be used as an API boundary for allowing processes to
configure the NCP. However, such a system MUST NOT give unprivileged
@@ -2176,30 +2837,9 @@ Quattlebaum Expires May 8, 2017 [Page 38]
should be allowed to be passed, and then only after being checked for
proper format.
+13. References
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 39]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
-8. Acknowledgments
-
- Special thanks to Abtin Keshavarzian, Martin Turon, Arjuna
- Sivasithambaresan and Jonathan Hui for their substantial
- contributions and feedback related to this document.
-
- [CREF2]
-
- This document was prepared using mmark [4] by (Miek Gieben) and
- xml2rfc (version 2) [5].
-
-9. References
-
-9.1. URIs
+13.1. URIs
[1] http://wpantund.org/
@@ -2207,11 +2847,18 @@ Quattlebaum Expires May 8, 2017 [Page 39]
[3] https://www.w3.org/TR/exi/#encodingUnsignedInteger
- [4] https://github.com/miekg/mmark
+ [4] http://reveng.sourceforge.net/crc-catalogue/16.htm#crc.cat.kermit
- [5] http://xml2rfc.ietf.org/
+ [5] https://github.com/miekg/mmark
- [6] http://reveng.sourceforge.net/crc-catalogue/16.htm#crc.cat.kermit
+
+
+Quattlebaum Expires June 1, 2017 [Page 51]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+ [6] http://xml2rfc.ietf.org/
Appendix A. Framing Protocol
@@ -2234,14 +2881,6 @@ A.1. UART Recommendations
These values may be adjusted depending on the individual needs of the
application or product, but some sort of flow control MUST be used.
Hardware flow control is preferred over software flow control. In
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 40]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
the absence of hardware flow control, software flow control (XON/
XOFF) MUST be used instead.
@@ -2266,6 +2905,15 @@ A.1.1. UART Bit Rate Detection
bitrate detection scheme that can be employed by the host to detect
when the attached NCP is initially running at a higher bitrate.
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 52]
+
+ Spinel Protocol (05367497d) November 2016
+
+
The algorithm is to send successive NOOP commands to the NCP at
increasing bitrates. When a valid "CMD_LAST_STATUS" response has
been received, we have identified the correct bitrate.
@@ -2288,19 +2936,9 @@ A.1.2. HDLC-Lite
of HDLC are omitted. This protocol was chosen because it works well
with software flow control and is widely implemented.
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 41]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
To transmit a frame with HDLC-lite, the 16-bit CRC must first be
appended to the frame. The CRC function is defined to be CRC-16/
- CCITT, otherwise known as the KERMIT CRC [6].
+ CCITT, otherwise known as the KERMIT CRC [4].
Individual frames are terminated with a frame delimiter octet called
the 'flag' octet ("0x7E").
@@ -2324,6 +2962,14 @@ Quattlebaum Expires May 8, 2017 [Page 41]
When receiving a frame, the CRC must be verified after the frame is
unescaped. If the CRC value does not match what is calculated for
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 53]
+
+ Spinel Protocol (05367497d) November 2016
+
+
the frame data, the frame MUST be discarded. The implementation MAY
indicate the failure to higher levels to handle as they see fit, but
MUST NOT attempt to process the deceived frame.
@@ -2347,13 +2993,6 @@ A.2. SPI Recommendations
o "I̅N̅T̅": (NCP-to-Host) Host Interrupt
o "R̅E̅S̅": (Host-to-NCP) NCP Hardware Reset
-
-
-Quattlebaum Expires May 8, 2017 [Page 42]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
The "I̅N̅T̅" signal is used by the NCP to indicate to
the host that the NCP has frames pending to send to it. When
asserted, the host SHOULD initiate a SPI transaction in a timely
@@ -2375,6 +3014,18 @@ A.2.1. SPI Framing Protocol
Each SPI frame starts with a 5-byte frame header:
+
+
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 54]
+
+ Spinel Protocol (05367497d) November 2016
+
+
+---------+-----+----------+----------+
| Octets: | 1 | 2 | 2 |
+---------+-----+----------+----------+
@@ -2400,16 +3051,6 @@ A.2.1. SPI Framing Protocol
o "RST": This bit is set when that device has been reset since the
last time "C̅S̅" was asserted.
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 43]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
o "CRC": This bit is set when that device supports writing a 16-bit
CRC at the end of the data. The CRC length is NOT included in
DATA_LEN.
@@ -2433,6 +3074,14 @@ Quattlebaum Expires May 8, 2017 [Page 43]
Alternatively, if the master has a frame to send it can just go ahead
and send a frame of that length and determine if the frame was
accepted by checking that the "RECV_LEN" from the slave frame is
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 55]
+
+ Spinel Protocol (05367497d) November 2016
+
+
larger than the frame the master just tried to send. If the
"RECV_LEN" is smaller then the frame wasn't accepted and will need to
be transmitted again.
@@ -2458,14 +3107,6 @@ Quattlebaum Expires May 8, 2017 [Page 43]
the frame. If not enough bytes were clocked out for the CRC to be
read, then the frame must be ignored. If enough bytes were clocked
out to perform a CRC check, but the CRC check fails, then the frame
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 44]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
must be rejected and the "CRC_FAIL" bit on the next frame (and ONLY
the next frame) MUST be set.
@@ -2473,619 +3114,30 @@ A.3. I^2C Recommendations
TBD
- [CREF3]
+ [CREF2]
A.4. Native USB Recommendations
TBD
- [CREF4]
+ [CREF3]
-Appendix B. Feature: Network Save
+Appendix B. Test Vectors
- The network save feature is an optional NCP capability that, when
- present, allows the host to save and recall network credentials and
- state to and from nonvolatile storage.
-
- The presence of this feature can be detected by checking for the
- presence of the "CAP_NET_SAVE" capability in "PROP_CAPS".
-
-B.1. Commands
-
-B.1.1. CMD 9: (Host->NCP) CMD_NET_SAVE
-
- +---------+--------+--------------+
- | Octets: | 1 | 1 |
- +---------+--------+--------------+
- | Fields: | HEADER | CMD_NET_SAVE |
- +---------+--------+--------------+
-
- Save network state command. Saves any current network credentials
- and state necessary to reconnect to the current network to non-
- volatile memory.
-
- This operation affects non-volatile memory only. The current network
- information stored in volatile memory is unaffected.
-
- The response to this command is always a "CMD_PROP_VALUE_IS" for
- "PROP_LAST_STATUS", indicating the result of the operation.
-
- This command is only available if the "CAP_NET_SAVE" capability is
- set.
+B.1. Test Vector: Packed Unsigned Integer
-Quattlebaum Expires May 8, 2017 [Page 45]
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 56]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
-B.1.2. CMD 10: (Host->NCP) CMD_NET_CLEAR
-
- +---------+--------+---------------+
- | Octets: | 1 | 1 |
- +---------+--------+---------------+
- | Fields: | HEADER | CMD_NET_CLEAR |
- +---------+--------+---------------+
-
- Clear saved network state command. Clears any previously saved
- network credentials and state previously stored by "CMD_NET_SAVE"
- from non-volatile memory.
-
- This operation affects non-volatile memory only. The current network
- information stored in volatile memory is unaffected.
-
- The response to this command is always a "CMD_PROP_VALUE_IS" for
- "PROP_LAST_STATUS", indicating the result of the operation.
-
- This command is only available if the "CAP_NET_SAVE" capability is
- set.
-
-B.1.3. CMD 11: (Host->NCP) CMD_NET_RECALL
-
- +---------+--------+----------------+
- | Octets: | 1 | 1 |
- +---------+--------+----------------+
- | Fields: | HEADER | CMD_NET_RECALL |
- +---------+--------+----------------+
-
- Recall saved network state command. Recalls any previously saved
- network credentials and state previously stored by "CMD_NET_SAVE"
- from non-volatile memory.
-
- This command will typically generated several unsolicited property
- updates as the network state is loaded. At the conclusion of
- loading, the authoritative response to this command is always a
- "CMD_PROP_VALUE_IS" for "PROP_LAST_STATUS", indicating the result of
- the operation.
-
- This command is only available if the "CAP_NET_SAVE" capability is
- set.
-
-Appendix C. Feature: Host Buffer Offload
-
- The memory on an NCP may be much more limited than the memory on the
- host processor. In such situations, it is sometimes useful for the
- NCP to offload buffers to the host processor temporarily so that it
- can perform other operations.
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 46]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
- Host buffer offload is an optional NCP capability that, when present,
- allows the NCP to store data buffers on the host processor that can
- be recalled at a later time.
-
- The presence of this feature can be detected by the host by checking
- for the presence of the "CAP_HBO" capability in "PROP_CAPS".
-
-C.1. Commands
-
-C.1.1. CMD 12: (NCP->Host) CMD_HBO_OFFLOAD
-
- o Argument-Encoding: "LscD"
-
- * "OffloadId": 32-bit unique block identifier
- * "Expiration": In seconds-from-now
- * "Priority": Critical, High, Medium, Low
- * "Data": Data to offload
-
-C.1.2. CMD 13: (NCP->Host) CMD_HBO_RECLAIM
-
- o Argument-Encoding: "Lb"
-
- * "OffloadId": 32-bit unique block identifier
- * "KeepAfterReclaim": If not set to true, the block will be
- dropped by the host after it is sent to the NCP.
-
-C.1.3. CMD 14: (NCP->Host) CMD_HBO_DROP
-
- o Argument-Encoding: "L"
-
- * "OffloadId": 32-bit unique block identifier
-
-C.1.4. CMD 15: (Host->NCP) CMD_HBO_OFFLOADED
-
- o Argument-Encoding: "Li"
-
- * "OffloadId": 32-bit unique block identifier
- * "Status": Status code for the result of the operation.
-
-C.1.5. CMD 16: (Host->NCP) CMD_HBO_RECLAIMED
-
- o Argument-Encoding: "LiD"
-
- * "OffloadId": 32-bit unique block identifier
- * "Status": Status code for the result of the operation.
- * "Data": Data that was previously offloaded (if any)
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 47]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
-C.1.6. CMD 17: (Host->NCP) CMD_HBO_DROPPED
-
- o Argument-Encoding: "Li"
-
- * "OffloadId": 32-bit unique block identifier
- * "Status": Status code for the result of the operation.
-
-C.2. Properties
-
-C.2.1. PROP 10: PROP_HBO_MEM_MAX
-
- o Type: Read-Write
- o Packed-Encoding: "L"
-
- +---------+--------------------+
- | Octets: | 4 |
- +---------+--------------------+
- | Fields: | "PROP_HBO_MEM_MAX" |
- +---------+--------------------+
-
- Describes the number of bytes that may be offloaded from the NCP to
- the host. Default value is zero, so this property must be set by the
- host to a non-zero value before the NCP will begin offloading blocks.
-
- This value is encoded as an unsigned 32-bit integer.
-
- This property is only available if the "CAP_HBO" capability is
- present in "PROP_CAPS".
-
-C.2.2. PROP 11: PROP_HBO_BLOCK_MAX
-
- o Type: Read-Write
- o Packed-Encoding: "S"
-
- +---------+----------------------+
- | Octets: | 2 |
- +---------+----------------------+
- | Fields: | "PROP_HBO_BLOCK_MAX" |
- +---------+----------------------+
-
- Describes the number of blocks that may be offloaded from the NCP to
- the host. Default value is 32. Setting this value to zero will
- cause host block offload to be effectively disabled.
-
- This value is encoded as an unsigned 16-bit integer.
-
- This property is only available if the "CAP_HBO" capability is
- present in "PROP_CAPS".
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 48]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
-Appendix D. Feature: Jam Detection
-
- Jamming detection is a feature that allows the NCP to report when it
- detects high levels of interference that are characteristic of
- intentional signal jamming.
-
- The presence of this feature can be detected by checking for the
- presence of the "CAP_JAM_DETECT" (value 6) capability in "PROP_CAPS".
-
-D.1. Properties
-
-D.1.1. PROP 4608: PROP_JAM_DETECT_ENABLE
-
- o Type: Read-Write
- o Packed-Encoding: "b"
- o Default Value: false
- o REQUIRED for "CAP_JAM_DETECT"
-
- +---------+--------------------------+
- | Octets: | 1 |
- +---------+--------------------------+
- | Fields: | "PROP_JAM_DETECT_ENABLE" |
- +---------+--------------------------+
-
- Indicates if jamming detection is enabled or disabled. Set to true
- to enable jamming detection.
-
- This property is only available if the "CAP_JAM_DETECT" capability is
- present in "PROP_CAPS".
-
-D.1.2. PROP 4609: PROP_JAM_DETECTED
-
- o Type: Read-Only
- o Packed-Encoding: "b"
- o REQUIRED for "CAP_JAM_DETECT"
-
- +---------+---------------------+
- | Octets: | 1 |
- +---------+---------------------+
- | Fields: | "PROP_JAM_DETECTED" |
- +---------+---------------------+
-
- Set to true if radio jamming is detected. Set to false otherwise.
-
- When jamming detection is enabled, changes to the value of this
- property are emitted asynchronously via "CMD_PROP_VALUE_IS".
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 49]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
- This property is only available if the "CAP_JAM_DETECT" capability is
- present in "PROP_CAPS".
-
-D.1.3. PROP 4610: PROP_JAM_DETECT_RSSI_THRESHOLD
-
- o Type: Read-Write
- o Packed-Encoding: "c"
- o Units: dBm
- o Default Value: Implementation-specific
- o RECOMMENDED for "CAP_JAM_DETECT"
-
- This parameter describes the threshold RSSI level (measured in dBm)
- above which the jamming detection will consider the channel blocked.
-
-D.1.4. PROP 4611: PROP_JAM_DETECT_WINDOW
-
- o Type: Read-Write
- o Packed-Encoding: "c"
- o Units: Seconds (1-64)
- o Default Value: Implementation-specific
- o RECOMMENDED for "CAP_JAM_DETECT"
-
- This parameter describes the window period for signal jamming
- detection.
-
-D.1.5. PROP 4612: PROP_JAM_DETECT_BUSY
-
- o Type: Read-Write
- o Packed-Encoding: "i"
- o Units: Seconds (1-64)
- o Default Value: Implementation-specific
- o RECOMMENDED for "CAP_JAM_DETECT"
-
- This parameter describes the number of aggregate seconds within the
- detection window where the RSSI must be above
- "PROP_JAM_DETECT_RSSI_THRESHOLD" to trigger detection.
-
- The behavior of the jamming detection feature when
- "PROP_JAM_DETECT_BUSY" is larger than "PROP_JAM_DETECT_WINDOW" is
- undefined.
-
-Appendix E. Technology: Thread
-
- This section describes all of the properties and semantics required
- for managing a Thread NCP.
-
- Thread NCPs have the following requirements:
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 50]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
- o The property "PROP_INTERFACE_TYPE" must be 3.
- o The non-optional properties in the following sections MUST be
- implemented: CORE, PHY, MAC, NET, and IPV6.
-
- All serious implementations of an NCP SHOULD also support the network
- save feature (See Appendix B).
-
-E.1. Thread Capabilities
-
- The Thread technology defines the following capabilities:
-
- o "CAP_NET_THREAD_1_0" - Indicates that the NCP implements v1.0 of
- the Thread standard.
- o "CAP_NET_THREAD_1_1" - Indicates that the NCP implements v1.1 of
- the Thread standard.
-
-E.2. Thread Properties
-
- Properties for Thread are allocated out of the "Tech" property
- section (see Section 5.1).
-
-E.2.1. PROP 80: PROP_THREAD_LEADER_ADDR
-
- o Type: Read-Only
- o Packed-Encoding: "6"
-
- The IPv6 address of the leader. (Note: May change to long and short
- address of leader)
-
-E.2.2. PROP 81: PROP_THREAD_PARENT
-
- o Type: Read-Only
- o Packed-Encoding: "ES"
- o LADDR, SADDR
-
- The long address and short address of the parent of this node.
-
-E.2.3. PROP 82: PROP_THREAD_CHILD_TABLE
-
- o Type: Read-Only
- o Packed-Encoding: "A(T(ES))"
-
- Table containing the long and short addresses of all the children of
- this node.
-
-
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 51]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
-E.2.4. PROP 83: PROP_THREAD_LEADER_RID
-
- o Type: Read-Only
- o Packed-Encoding: "C"
-
- The router-id of the current leader.
-
-E.2.5. PROP 84: PROP_THREAD_LEADER_WEIGHT
-
- o Type: Read-Only
- o Packed-Encoding: "C"
-
- The leader weight of the current leader.
-
-E.2.6. PROP 85: PROP_THREAD_LOCAL_LEADER_WEIGHT
-
- o Type: Read-Write
- o Packed-Encoding: "C"
-
- The leader weight for this node.
-
-E.2.7. PROP 86: PROP_THREAD_NETWORK_DATA
-
- o Type: Read-Only
- o Packed-Encoding: "D"
-
-E.2.8. PROP 87: PROP_THREAD_NETWORK_DATA_VERSION
-
- o Type: Read-Only
- o Packed-Encoding: "S"
-
-E.2.9. PROP 88: PROP_THREAD_STABLE_NETWORK_DATA
-
- o Type: Read-Only
- o Packed-Encoding: "D"
-
-E.2.10. PROP 89: PROP_THREAD_STABLE_NETWORK_DATA_VERSION
-
- o Type: Read-Only
- o Packed-Encoding: "S"
-
-E.2.11. PROP 90: PROP_THREAD_ON_MESH_NETS
-
- o Type: Read-Write
- o Packed-Encoding: "A(T(6CbCb))"
-
- Data per item is:
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 52]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
- o "6": IPv6 Prefix
- o "C": Prefix length, in bits
- o "b": Stable flag
- o "C": Thread flags
- o "b": "Is defined locally" flag. Set if this network was locally
- defined. Assumed to be true for set, insert and replace. Clear
- if the on mesh network was defined by another node.
-
-E.2.12. PROP 91: PROP_THREAD_LOCAL_ROUTES
-
- o Type: Read-Write
- o Packed-Encoding: "A(T(6CbC))"
-
- Data per item is:
-
- o "6": IPv6 Prefix
- o "C": Prefix length, in bits
- o "b": Stable flag
- o "C": Other flags
-
-E.2.13. PROP 92: PROP_THREAD_ASSISTING_PORTS
-
- o Type: Read-Write
- o Packed-Encoding: "A(S)"
-
-E.2.14. PROP 93: PROP_THREAD_ALLOW_LOCAL_NET_DATA_CHANGE
-
- o Type: Read-Write
- o Packed-Encoding: "b"
-
- Set to true before changing local net data. Set to false when
- finished. This allows changes to be aggregated into single events.
-
-E.2.15. PROP 94: PROP_THREAD_MODE
-
- o Type: Read-Write
- o Packed-Encoding: "C"
-
- This property contains the value of the mode TLV for this node. The
- meaning of the bits in this bitfield are defined by section 4.5.2 of
- the Thread specification.
-
-E.2.16. PROP 5376: PROP_THREAD_CHILD_TIMEOUT
-
- o Type: Read-Write
- o Packed-Encoding: "L"
-
- Used when operating in the Child role.
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 53]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
-E.2.17. PROP 5377: PROP_THREAD_RLOC16
-
- o Type: Read-Write
- o Packed-Encoding: "S"
-
-E.2.18. PROP 5378: PROP_THREAD_ROUTER_UPGRADE_THRESHOLD
-
- o Type: Read-Write
- o Packed-Encoding: "C"
-
-E.2.19. PROP 5379: PROP_THREAD_CONTEXT_REUSE_DELAY
-
- o Type: Read-Write
- o Packed-Encoding: "L"
-
-E.2.20. PROP 5380: PROP_THREAD_NETWORK_ID_TIMEOUT
-
- o Type: Read-Write
- o Packed-Encoding: "C"
-
- Allows you to get or set the Thread "NETWORK_ID_TIMEOUT" constant, as
- defined by the Thread specification.
-
-E.2.21. PROP 5381: PROP_THREAD_ACTIVE_ROUTER_IDS
-
- o Type: Read-Write/Write-Only
- o Packed-Encoding: "A(C)" (List of active thread router ids)
-
- Note that some implementations may not support "CMD_GET_VALUE" router
- ids, but may support "CMD_REMOVE_VALUE" when the node is a leader.
-
-E.2.22. PROP 5382: PROP_THREAD_RLOC16_DEBUG_PASSTHRU
-
- o Type: Read-Write
- o Packed-Encoding: "b"
-
- Allow the HOST to directly observe all IPv6 packets received by the
- NCP, including ones sent to the RLOC16 address.
-
- Default value is "false".
-
-E.2.23. PROP 5383: SPINEL_PROP_THREAD_ROUTER_ROLE_ENABLED
-
- o Type: Read-Write
- o Packed-Encoding: "b"
-
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 54]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
- Allow the HOST to indicate whether or not the router role is enabled.
- If current role is a router, setting this property to "false" starts
- a re-attach process as an end-device.
-
-E.2.24. PROP 5384: PROP_THREAD_ROUTER_DOWNGRADE_THRESHOLD
-
- o Type: Read-Write
- o Packed-Encoding: "C"
-
-E.2.25. PROP 5385: PROP_THREAD_ROUTER_SELECTION_JITTER
-
- o Type: Read-Write
- o Packed-Encoding: "C"
-
- Specifies the self imposed random delay in seconds a REED waits
- before registering to become an Active Router.
-
-E.2.26. PROP 5386: PROP_THREAD_PREFERRED_ROUTER_ID
-
- o Type: Write-Only
- o Packed-Encoding: "C"
-
- Specifies the preferred Router Id. Upon becoming a router/leader the
- node attempts to use this Router Id. If the preferred Router Id is
- not set or if it can not be used, a randomly generated router id is
- picked. This property can be set only when the device role is either
- detached or disabled.
-
-E.2.27. PROP 5387: SPINEL_PROP_THREAD_NEIGHBOR_TABLE
-
- o Type: Read-Only
- o Packed-Encoding: "A(T(ESLCcCbLL))"
-
- Data per item is:
-
- o "E": Extended/long address
- o "S": RLOC16
- o "L": Age
- o "C": Link Quality In
- o "c": Average RSS
- o "C": Mode (bit-flags)
- o "b": "true" if neighbor is a child, "false" otherwise.
- o "L": Link Frame Counter
- o "L": MLE Frame Counter
-
-
-
-
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 55]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
-Appendix F. Test Vectors
-
-F.1. Test Vector: Packed Unsigned Integer
-
+---------------+-----------------------+
| Decimal Value | Packet Octet Encoding |
+---------------+-----------------------+
@@ -3101,9 +3153,9 @@ F.1. Test Vector: Packed Unsigned Integer
| 2,097,151 | "FF FF 7F" |
+---------------+-----------------------+
- [CREF5]
+ [CREF4]
-F.2. Test Vector: Reset Command
+B.2. Test Vector: Reset Command
o IID: 0
o TID: 0
@@ -3113,7 +3165,7 @@ F.2. Test Vector: Reset Command
80 01
-F.3. Test Vector: Reset Notification
+B.3. Test Vector: Reset Notification
o IID: 0
o TID: 0
@@ -3125,23 +3177,23 @@ F.3. Test Vector: Reset Notification
80 06 00 72
-F.4. Test Vector: Scan Beacon
+B.4. Test Vector: Scan Beacon
o IID: 0
o TID: 0
o CMD: 7 ("CMD_VALUE_INSERTED")
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 56]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
o PROP: 51 ("PROP_MAC_SCAN_BEACON")
o VALUE: Structure, encoded as "CcT(ESSc.)T(iCUD.)."
* CHAN: 15
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 57]
+
+ Spinel Protocol (05367497d) November 2016
+
+
* RSSI: -60dBm
* MAC_DATA: (0D 00 B6 40 D4 8C E9 38 F9 52 FF FF D2 04 00)
@@ -3163,19 +3215,19 @@ Quattlebaum Expires May 8, 2017 [Page 56]
13 00 03 20 73 70 69 6E 65 6C 00 08 00 DE AD 00 BE EF 00 CA
FE
-F.5. Test Vector: Inbound IPv6 Packet
+B.5. Test Vector: Inbound IPv6 Packet
CMD_VALUE_IS(PROP_STREAM_NET)
- [CREF6]
+ [CREF5]
-F.6. Test Vector: Outbound IPv6 Packet
+B.6. Test Vector: Outbound IPv6 Packet
CMD_VALUE_SET(PROP_STREAM_NET)
- [CREF7]
+ [CREF6]
-F.7. Test Vector: Fetch list of on-mesh networks
+B.7. Test Vector: Fetch list of on-mesh networks
o IID: 0
o TID: 4
@@ -3189,12 +3241,16 @@ F.7. Test Vector: Fetch list of on-mesh networks
-Quattlebaum Expires May 8, 2017 [Page 57]
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 58]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
-F.8. Test Vector: Returned list of on-mesh networks
+B.8. Test Vector: Returned list of on-mesh networks
o IID: 0
o TID: 4
@@ -3215,7 +3271,7 @@ F.8. Test Vector: Returned list of on-mesh networks
00 40 01 ?? 13 00 20 01 0D B8 00 02 00 00 00 00 00 00 00 00
00 00 40 00 ??
-F.9. Test Vector: Adding an on-mesh network
+B.9. Test Vector: Adding an on-mesh network
o IID: 0
o TID: 5
@@ -3234,9 +3290,9 @@ F.9. Test Vector: Adding an on-mesh network
85 03 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00 40
01 ?? 01
- [CREF8]
+ [CREF7]
-F.10. Test Vector: Insertion notification of an on-mesh network
+B.10. Test Vector: Insertion notification of an on-mesh network
o IID: 0
o TID: 5
@@ -3245,9 +3301,9 @@ F.10. Test Vector: Insertion notification of an on-mesh network
-Quattlebaum Expires May 8, 2017 [Page 58]
+Quattlebaum Expires June 1, 2017 [Page 59]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
o VALUE: Structure, encoded as "6CbCb"
@@ -3263,9 +3319,9 @@ Quattlebaum Expires May 8, 2017 [Page 58]
85 07 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00 40
01 ?? 01
- [CREF9]
+ [CREF8]
-F.11. Test Vector: Removing a local on-mesh network
+B.11. Test Vector: Removing a local on-mesh network
o IID: 0
o TID: 6
@@ -3277,7 +3333,7 @@ F.11. Test Vector: Removing a local on-mesh network
86 05 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00
-F.12. Test Vector: Removal notification of an on-mesh network
+B.12. Test Vector: Removal notification of an on-mesh network
o IID: 0
o TID: 6
@@ -3289,11 +3345,11 @@ F.12. Test Vector: Removal notification of an on-mesh network
86 08 5A 20 01 0D B8 00 03 00 00 00 00 00 00 00 00 00 00
-Appendix G. Example Sessions
+Appendix C. Example Sessions
-G.1. NCP Initialization
+C.1. NCP Initialization
- [CREF10]
+ [CREF9]
Check the protocol version to see if it is supported:
@@ -3301,9 +3357,9 @@ G.1. NCP Initialization
-Quattlebaum Expires May 8, 2017 [Page 59]
+Quattlebaum Expires June 1, 2017 [Page 60]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
o CMD_VALUE_IS:PROP_PROTOCOL_VERSION
@@ -3335,9 +3391,9 @@ Quattlebaum Expires May 8, 2017 [Page 59]
o CMD_NET_RECALL
-G.2. Attaching to a network
+C.2. Attaching to a network
- [CREF11]
+ [CREF10]
We make the assumption that the NCP is not currently associated with
a network.
@@ -3357,9 +3413,9 @@ G.2. Attaching to a network
-Quattlebaum Expires May 8, 2017 [Page 60]
+Quattlebaum Expires June 1, 2017 [Page 61]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
o CMD_VALUE_SET:PROP_NET_KEY_SEQUENCE_COUNTER
@@ -3383,9 +3439,9 @@ Quattlebaum Expires May 8, 2017 [Page 60]
o CMD_VALUE_IS:PROP_NET_PARTITION_ID
o CMD_VALUE_IS:PROP_THREAD_ON_MESH_NETS
-G.3. Successfully joining a pre-existing network
+C.3. Successfully joining a pre-existing network
- [CREF12]
+ [CREF11]
This example session is identical to the above session up to the
point where we set PROP_NET_IF_UP to true. From there, the behavior
@@ -3413,12 +3469,12 @@ G.3. Successfully joining a pre-existing network
-Quattlebaum Expires May 8, 2017 [Page 61]
+Quattlebaum Expires June 1, 2017 [Page 62]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
-G.4. Unsuccessfully joining a pre-existing network
+C.4. Unsuccessfully joining a pre-existing network
This example session is identical to the above session up to the
point where we set PROP_NET_IF_UP to true. From there, the behavior
@@ -3437,13 +3493,13 @@ G.4. Unsuccessfully joining a pre-existing network
o CMD_VALUE_IS:PROP_LAST_STATUS:STATUS_JOIN_NO_PEERS
o CMD_VALUE_IS:PROP_NET_STACK_UP:FALSE
-G.5. Detaching from a network
+C.5. Detaching from a network
TBD
-G.6. Attaching to a saved network
+C.6. Attaching to a saved network
- [CREF13]
+ [CREF12]
Recall the saved network if you haven't already done so:
@@ -3469,31 +3525,31 @@ G.6. Attaching to a saved network
-Quattlebaum Expires May 8, 2017 [Page 62]
+Quattlebaum Expires June 1, 2017 [Page 63]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
-G.7. NCP Software Reset
+C.7. NCP Software Reset
- [CREF14]
+ [CREF13]
o CMD_RESET
o CMD_VALUE_IS:PROP_LAST_STATUS:STATUS_RESET_SOFTWARE
- Then jump to Appendix G.1.
+ Then jump to Appendix C.1.
-G.8. Adding an on-mesh prefix
+C.8. Adding an on-mesh prefix
TBD
-G.9. Entering low-power modes
+C.9. Entering low-power modes
TBD
-G.10. Sniffing raw packets
+C.10. Sniffing raw packets
- [CREF15]
+ [CREF14]
This assumes that the NCP has been initialized.
@@ -3525,9 +3581,9 @@ G.10. Sniffing raw packets
-Quattlebaum Expires May 8, 2017 [Page 63]
+Quattlebaum Expires June 1, 2017 [Page 64]
- Spinel Protocol (f9bf43254) November 2016
+ Spinel Protocol (05367497d) November 2016
o CMD_VALUE_IS:PROP_STREAM_RAW:...
@@ -3540,7 +3596,18 @@ Quattlebaum Expires May 8, 2017 [Page 63]
so that you can avoid receiving packets from other networks or that
are destined for other nodes.
-Appendix H. Glossary
+Appendix D. Acknowledgments
+
+ Special thanks to Abtin Keshavarzian, Martin Turon, Arjuna
+ Sivasithambaresan and Jonathan Hui for their substantial
+ contributions and feedback related to this document.
+
+ [CREF15]
+
+ This document was prepared using mmark [5] by (Miek Gieben) and
+ xml2rfc (version 2) [6].
+
+Appendix E. Glossary
[CREF16]
@@ -3566,6 +3633,15 @@ Appendix H. Glossary
to the physical implementation and operation of a networking
medium.
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 65]
+
+ Spinel Protocol (05367497d) November 2016
+
+
Editorial Comments
[CREF1] RQ: We may want to consider a license more appropriate for
@@ -3576,23 +3652,15 @@ Editorial Comments
0 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | |---|---|---|---|---|---|---|---| | FLG || IID || TID ||||
-[CREF2] RQ: If I have missed anyone who has contributed to this
- document, please let me know ASAP.
-
-
-
-Quattlebaum Expires May 8, 2017 [Page 64]
-
- Spinel Protocol (f9bf43254) November 2016
-
-
-[CREF3] RQ: It may make sense to have a look at what Bluetooth HCI is
+[CREF2] RQ: It may make sense to have a look at what Bluetooth HCI is
doing for native I^2C framing and go with that.
-[CREF4] RQ: It may make sense to have a look at what Bluetooth HCI is
+[CREF3] RQ: It may make sense to have a look at what Bluetooth HCI is
doing for native USB framing and go with that.
-[CREF5] RQ: The PUI test-vector encodings need to be verified.
+[CREF4] RQ: The PUI test-vector encodings need to be verified.
+
+[CREF5] RQ: FIXME: This test vector is incomplete.
[CREF6] RQ: FIXME: This test vector is incomplete.
@@ -3600,7 +3668,7 @@ Quattlebaum Expires May 8, 2017 [Page 64]
[CREF8] RQ: FIXME: This test vector is incomplete.
-[CREF9] RQ: FIXME: This test vector is incomplete.
+[CREF9] RQ: FIXME: This example session is incomplete.
[CREF10] RQ: FIXME: This example session is incomplete.
@@ -3612,12 +3680,24 @@ Quattlebaum Expires May 8, 2017 [Page 64]
[CREF14] RQ: FIXME: This example session is incomplete.
-[CREF15] RQ: FIXME: This example session is incomplete.
+[CREF15] RQ: If I have missed anyone who has contributed to this
+ document, please let me know ASAP.
[CREF16] RQ: Alphabetize before finalization.
Author's Address
+
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 66]
+
+ Spinel Protocol (05367497d) November 2016
+
+
Robert S. Quattlebaum
Nest Labs
3400 Hillview Ave.
@@ -3637,4 +3717,36 @@ Author's Address
-Quattlebaum Expires May 8, 2017 [Page 65]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Quattlebaum Expires June 1, 2017 [Page 67]
diff --git a/doc/spinel-protocol-src/draft-spinel-protocol.md.in b/doc/spinel-protocol-src/draft-spinel-protocol.md.in
index 77a2e5126..228e5d46b 100644
--- a/doc/spinel-protocol-src/draft-spinel-protocol.md.in
+++ b/doc/spinel-protocol-src/draft-spinel-protocol.md.in
@@ -312,8 +312,26 @@ is meaningless.
{{spinel-status-codes.md}}
+{{spinel-tech-thread.md}}
+
+{{spinel-feature-network-save.md}}
+
+{{spinel-feature-host-buffer-offload.md}}
+
+{{spinel-feature-jam-detect.md}}
+
+{{spinel-feature-gpio.md}}
+
{{spinel-security-considerations.md}}
+{backmatter}
+
+{{spinel-framing.md}}
+
+{{spinel-test-vectors.md}}
+
+{{spinel-example-sessions.md}}
+
# Acknowledgments #
Special thanks to Abtin Keshavarzian, Martin Turon, Arjuna Sivasithambaresan
@@ -328,22 +346,6 @@ to this document.
This document was prepared using [mmark](https://github.com/miekg/mmark)
by (Miek Gieben) and [xml2rfc (version 2)](http://xml2rfc.ietf.org/).
-{backmatter}
-
-{{spinel-framing.md}}
-
-{{spinel-feature-network-save.md}}
-
-{{spinel-feature-host-buffer-offload.md}}
-
-{{spinel-feature-jam-detect.md}}
-
-{{spinel-tech-thread.md}}
-
-{{spinel-test-vectors.md}}
-
-{{spinel-example-sessions.md}}
-
# Glossary #
diff --git a/doc/spinel-protocol-src/spinel-feature-gpio.md b/doc/spinel-protocol-src/spinel-feature-gpio.md
new file mode 100644
index 000000000..fc39d49a0
--- /dev/null
+++ b/doc/spinel-protocol-src/spinel-feature-gpio.md
@@ -0,0 +1,47 @@
+# Feature: Basic GPIO Access
+
+The length of the data associated with these properties depends on the
+number of GPIOs. If you have 10 GPIOs, you'd have two bytes. You determine
+the number of GPIOs available by examining PROP_GPIO_AVAILABLE, described
+below. This API isn't intended to support every possible GPIO state, it is
+intended for basic reading and writing.
+
+## Properties
+
+### PROP 4096: PROP_GPIO_AVAILABLE
+
+* Type: Read-only
+
+Contains a bit field identifying which GPIOs are supported. Cleared bits
+are not supported. Set bits are supported.
+
+### PROP 4097: PROP_GPIO_DIRECTION
+
+* Type: Read-only (Optionally read/write)
+
+Contains a bit field identifying which GPIOs are configured as outputs.
+Cleared bits are inputs. Set bits are outputs.
+
+### PROP 4098: PROP_GPIO_STATE
+
+* Type: Read-Write
+
+Contains a bit field identifying the state of the GPIOs. For GPIOs
+configured as inputs, this is the read logic level. For GPIOs configured
+as outputs, this is the logic level of the output.
+
+### PROP 4099: PROP_GPIO_STATE_SET
+
+* Type: Write-only
+
+Allows for the state of various output GPIOs to be set without affecting
+other GPIO states. Contains a bit field identifying the output GPIOs that
+should have their state set to 1.
+
+### PROP 4100: PROP_GPIO_STATE_CLEAR
+
+* Type: Write-only
+
+Allows for the state of various output GPIOs to be cleared without affecting
+other GPIO states. Contains a bit field identifying the output GPIOs that
+should have their state cleared to 0.
diff --git a/doc/spinel-protocol-src/spinel-prop-core.md b/doc/spinel-protocol-src/spinel-prop-core.md
index 47d6537aa..6533e9548 100644
--- a/doc/spinel-protocol-src/spinel-prop-core.md
+++ b/doc/spinel-protocol-src/spinel-prop-core.md
@@ -130,6 +130,7 @@ Currently defined values are:
* 5: `CAP_COUNTERS`
* 6: `CAP_JAM_DETECT`: Jamming detection. See (#feature-jam-detect)
* 7: `CAP_PEEK_POKE`: PEEK/POKE debugging commands.
+ * 8: `CAP_WRITABLE_RAW_STREAM`: `PROP_STREAM_RAW` is writable.
* 16: `CAP_802_15_4_2003`
* 17: `CAP_802_15_4_2006`
* 18: `CAP_802_15_4_2011`
@@ -273,8 +274,13 @@ fetch the value of this property. To receive traffic, you wait for
`CMD_PROP_VALUE_IS` commands with this property id from the NCP.
Implementations may OPTIONALLY support the ability to transmit arbitrary
-raw packets. If this capability is supported, you may call `CMD_PROP_VALUE_SET`
-on this property with the value of the raw packet.
+raw packets. Support for this feature is indicated by the presence of the
+`CAP_WRITABLE_RAW_STREAM` capability.
+
+If the capability `CAP_WRITABLE_RAW_STREAM` is set, then packets written
+to this stream with `CMD_PROP_VALUE_SET` will be sent out over the radio.
+This allows the caller to use the radio directly, with the stack being
+implemented on the host instead of the NCP.
#### Frame Metadata Format {#frame-metadata-format}
diff --git a/src/ncp/spinel.h b/src/ncp/spinel.h
index b3eb1cb9b..c1d37a948 100644
--- a/src/ncp/spinel.h
+++ b/src/ncp/spinel.h
@@ -291,6 +291,8 @@ enum
SPINEL_CAP_PEEK_POKE = 7,
+ SPINEL_CAP_WRITABLE_RAW_STREAM = 8,
+
SPINEL_CAP_802_15_4__BEGIN = 16,
SPINEL_CAP_802_15_4_2003 = (SPINEL_CAP_802_15_4__BEGIN + 0),
SPINEL_CAP_802_15_4_2006 = (SPINEL_CAP_802_15_4__BEGIN + 1),
@@ -346,6 +348,58 @@ typedef enum
SPINEL_PROP_HBO_MEM_MAX = 10, ///< Max offload mem [S]
SPINEL_PROP_HBO_BLOCK_MAX = 11, ///< Max offload block [S]
+ SPINEL_PROP_BASE_EXT__BEGIN = 0x1000,
+
+ /// Available GPIO Bitmask
+ /** Format: `D`
+ * Type: Read-Only
+ *
+ * Contains a bit field identifying which GPIOs are supported. Cleared bits
+ * are not supported. Set bits are supported.
+ */
+ SPINEL_PROP_GPIO_AVAILABLE = SPINEL_PROP_BASE_EXT__BEGIN + 0,
+
+ /// GPIO Direction Bitmask
+ /** Format: `D`
+ * Type: Read-only (Optionally read/write)
+ *
+ * Contains a bit field identifying which GPIOs are configured as outputs.
+ * Cleared bits are inputs. Set bits are outputs.
+ */
+ SPINEL_PROP_GPIO_DIRECTION = SPINEL_PROP_BASE_EXT__BEGIN + 1,
+
+ /// GPIO State Bitmask
+ /** Format: `D`
+ * Type: Read-Write
+ *
+ * Contains a bit field identifying the state of the GPIOs. For GPIOs
+ * configured as inputs, this is the read logic level. For GPIOs configured
+ * as outputs, this is the logic level of the output.
+ */
+ SPINEL_PROP_GPIO_STATE = SPINEL_PROP_BASE_EXT__BEGIN + 2,
+
+ /// GPIO State Set-Only Bitmask
+ /** Format: `D`
+ * Type: Write-Only
+ *
+ * Allows for the state of various output GPIOs to be set without affecting
+ * other GPIO states. Contains a bit field identifying the output GPIOs that
+ * should have their state set to 1.
+ */
+ SPINEL_PROP_GPIO_STATE_SET = SPINEL_PROP_BASE_EXT__BEGIN + 3,
+
+ /// GPIO State Clear-Only Bitmask
+ /** Format: `D`
+ * Type: Write-Only
+ *
+ * Allows for the state of various output GPIOs to be cleared without affecting
+ * other GPIO states. Contains a bit field identifying the output GPIOs that
+ * should have their state cleared to 0.
+ */
+ SPINEL_PROP_GPIO_STATE_CLEAR = SPINEL_PROP_BASE_EXT__BEGIN + 4,
+
+ SPINEL_PROP_BASE_EXT__END = 0x1100,
+
SPINEL_PROP_PHY__BEGIN = 0x20,
SPINEL_PROP_PHY_ENABLED = SPINEL_PROP_PHY__BEGIN + 0, ///< [b]
SPINEL_PROP_PHY_CHAN = SPINEL_PROP_PHY__BEGIN + 1, ///< [C]