class WeaveInspector
Defined at line 68 of file ../../src/connectivity/weave/adaptation/weave_inspector.h
This class defines the structure of the Inspect hierarchy for Weave. Components
of WeaveStack can invoke the WeaveInspector to log events pertaining to status
and tunnel state changes. For example:
auto inspector = nl::Weave::WeaveInspector::GetWeaveInspector();
inspector.NotifyPairingStateChange(
nl::Weave::WeaveInspector::WeaveStatusNode::kPairingState_FabricCreatedOrJoined);
The WeaveInspector holds types of WeaveStatusNode and TunnelStatusNode as sub-nodes
of the Inspect hierarchy. WeaveStatusNode will contain multiple WeaveStatusEntry
sub-nodes. These sub-nodes are added whenever a Weave status change is notified by
WeaveStack and will contain complete information of current weave status. To obtain
history of Weave status changes WeaveStatusNode will hold last |kMaxWeaveStatusEntries|.
TunnelStatusNode will contain information on tunnel status changes. TunnelStatusNode will
be updated whenever Tunnel status change is notified by WeaveStack.
Sample Inspect hierarchy:
"root": {
"weave_status": {
"0x13": {
"setup_state": "CASESessionEstablished",
"pairing_state": "RegisterServiceCompleted",
"@time": 479097104375,
"tunnel_state": {
"state": "PrimaryTunMode",
"type": "Primary",
"is_restricted": false
},
"failsafe_state": {
"state": "Disarmed",
"reason": "Nominal"
}
},
"0x12": {
..
..
},
..
..
},
"tunnel_status": {
"last_time_tunnel_down": 0,
"last_time_tunnel_established": 478702584208
}
}
}
Public Members
static basic_string kFailSafeReason_Init
static basic_string kFailSafeReason_Nominal
static basic_string kFailSafeReason_FailsafeArmFailed
static basic_string kFailSafeReason_FailsafeDisarmFailed
static basic_string kFailSafeState_Armed
static basic_string kFailSafeState_Disarmed
static basic_string kPairingState_Initialized
static basic_string kPairingState_FabricCreatedOrJoined
static basic_string kPairingState_ThreadNetworkCreatedOrJoined
static basic_string kPairingState_RegisterServicePending
static basic_string kPairingState_RegisterServiceCompleted
static basic_string kPairingState_ServiceConfigUpdated
static basic_string kPairingState_LeftFabric
static basic_string kSetupState_Initialized
static basic_string kSetupState_BLEConnected
static basic_string kSetupState_PASESessionEstablished
static basic_string kSetupState_CASESessionEstablished
static basic_string kTunnelState_NoTunnel
static basic_string kTunnelState_PrimaryTunMode
static basic_string kTunnelState_BkupOnlyTunMode
static basic_string kTunnelState_PrimaryAndBkupTunMode
static basic_string kTunnelType_None
static basic_string kTunnelType_Primary
static basic_string kTunnelType_Backup
static basic_string kTunnelType_Shortcut
Public Methods
WeaveInspector & GetWeaveInspector ()
Creates/Returns the pointer to WeaveInspector singleton object.
Defined at line 82 of file ../../src/connectivity/weave/adaptation/weave_inspector.cpp
void NotifyInit ()
Function to be called on WeaveStack Init.
This will record initialization status to inspect data.
Defined at line 93 of file ../../src/connectivity/weave/adaptation/weave_inspector.cpp
void NotifyPairingStateChange (const WeaveStatus_PairingState & new_state)
Function to be called when pairing state change.
This will add a new entry with all current status to weave_status node.
Defined at line 99 of file ../../src/connectivity/weave/adaptation/weave_inspector.cpp
void NotifyFailSafeStateChange (const WeaveStatus_FailSafeState & new_state, const WeaveStatus_FailSafeReason & reason)
Function to be called when failsafe state change.
This will add a new entry with all current status to weave_status node.
Defined at line 103 of file ../../src/connectivity/weave/adaptation/weave_inspector.cpp
void NotifySetupStateChange (const WeaveStatus_SetupState & new_state)
Function to be called when setup state change.
This will add a new entry with all current status to weave_status node.
Defined at line 108 of file ../../src/connectivity/weave/adaptation/weave_inspector.cpp
void NotifyTunnelStateChange (const WeaveStatus_TunnelState & new_state, const WeaveStatus_TunnelType & tunnel_type, bool is_restricted)
Function to be called when tunnel state change.
This will add a new entry with all current status to weave_status node.
Defined at line 112 of file ../../src/connectivity/weave/adaptation/weave_inspector.cpp
void WeaveInspector (const WeaveInspector & )
Defined at line 114 of file ../../src/connectivity/weave/adaptation/weave_inspector.h
void operator= (const WeaveInspector & )
Defined at line 115 of file ../../src/connectivity/weave/adaptation/weave_inspector.h
Friends
class WeaveInspectorTest