diff --git a/doc/spinel-protocol-src/spinel-prop-net.md b/doc/spinel-protocol-src/spinel-prop-net.md index a815ef598..4232aedd4 100644 --- a/doc/spinel-protocol-src/spinel-prop-net.md +++ b/doc/spinel-protocol-src/spinel-prop-net.md @@ -4,8 +4,7 @@ * Type: Read-Only * Packed-Encoding: `b` -Returns true if there is a network state stored that can be -restored with a call to `CMD_NET_RECALL`. +Returns true if there is a network state stored/saved. ### PROP 65: PROP_NET_IF_UP {#prop-net-if-up} * Type: Read-Write diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 68bcf285d..87f40018c 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -119,6 +119,7 @@ const NcpBase::GetPropertyHandlerEntry NcpBase::mGetPropertyHandlerTable[] = { SPINEL_PROP_MAC_PROMISCUOUS_MODE, &NcpBase::GetPropertyHandler_MAC_PROMISCUOUS_MODE }, { SPINEL_PROP_MAC_EXTENDED_ADDR, &NcpBase::GetPropertyHandler_MAC_EXTENDED_ADDR }, + { SPINEL_PROP_NET_SAVED, &NcpBase::GetPropertyHandler_NET_SAVED }, { SPINEL_PROP_NET_IF_UP, &NcpBase::GetPropertyHandler_NET_IF_UP }, { SPINEL_PROP_NET_STACK_UP, &NcpBase::GetPropertyHandler_NET_STACK_UP }, { SPINEL_PROP_NET_ROLE, &NcpBase::GetPropertyHandler_NET_ROLE }, @@ -1989,6 +1990,17 @@ ThreadError NcpBase::GetPropertyHandler_MAC_RAW_STREAM_ENABLED(uint8_t header, s ); } +ThreadError NcpBase::GetPropertyHandler_NET_SAVED(uint8_t header, spinel_prop_key_t key) +{ + return SendPropertyUpdate( + header, + SPINEL_CMD_PROP_VALUE_IS, + key, + SPINEL_DATATYPE_BOOL_S, + otIsNodeCommissioned(mInstance) + ); +} + ThreadError NcpBase::GetPropertyHandler_NET_IF_UP(uint8_t header, spinel_prop_key_t key) { return SendPropertyUpdate( diff --git a/src/ncp/ncp_base.hpp b/src/ncp/ncp_base.hpp index e0080f8f8..b337a6902 100644 --- a/src/ncp/ncp_base.hpp +++ b/src/ncp/ncp_base.hpp @@ -331,6 +331,7 @@ private: ThreadError GetPropertyHandler_MAC_15_4_SADDR(uint8_t header, spinel_prop_key_t key); ThreadError GetPropertyHandler_MAC_RAW_STREAM_ENABLED(uint8_t header, spinel_prop_key_t key); ThreadError GetPropertyHandler_MAC_EXTENDED_ADDR(uint8_t header, spinel_prop_key_t key); + ThreadError GetPropertyHandler_NET_SAVED(uint8_t header, spinel_prop_key_t key); ThreadError GetPropertyHandler_NET_IF_UP(uint8_t header, spinel_prop_key_t key); ThreadError GetPropertyHandler_NET_STACK_UP(uint8_t header, spinel_prop_key_t key); ThreadError GetPropertyHandler_NET_ROLE(uint8_t header, spinel_prop_key_t key);