mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 18:59:51 +00:00
NcpBase: Add get handler for NET_SAVED spinel property (#1297)
This commit is contained in:
committed by
Jonathan Hui
parent
4d293aa67f
commit
44c54b3a3e
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user