MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / ReadXML

Method ReadXML

cpp/src/Node.cpp:905–1168  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Read the node config from the OZW Cache File... -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

903// Read the node config from the OZW Cache File...
904//-----------------------------------------------------------------------------
905void Node::ReadXML
906(
907 TiXmlElement const* _node
908)
909{
910 char const* str;
911 int intVal;
912
913 str = _node->Attribute( "query_stage" );
914 if( str )
915 {
916 // After restoring state from a file, we need to at least refresh the association, session and dynamic values.
917 QueryStage queryStage = QueryStage_Associations;
918 for( uint32 i=0; i<(uint32)QueryStage_Associations; ++i )
919 {
920 if( !strcmp( str, c_queryStageNames[i] ) )
921 {
922 queryStage = (QueryStage)i;
923 break;
924 }
925 }
926
927 /* we cant use the SetQueryStage method here, as it only allows us to
928 * go to a lower QueryStage, and not a higher QueryStage. As QueryStage_Complete is higher than
929 * QueryStage_None (the default) we manually set it here. Note - in Driver::HandleSerialAPIGetInitDataResponse the
930 * QueryStage is set to CacheLoad (which is less than QueryStage_Associations) if this is a existing node read in via the zw state file.
931 *
932 */
933 m_queryStage = queryStage;
934 m_queryPending = false;
935
936 if( QueryStage_Configuration == queryStage )
937 {
938 m_queryConfiguration = true;
939 }
940 }
941
942 if( m_queryStage != QueryStage_None )
943 {
944 if( m_queryStage > QueryStage_ProtocolInfo )
945 {
946 // Notify the watchers of the protocol info.
947 // We do the notification here so that it gets into the queue ahead of
948 // any other notifications generated by adding command classes etc.
949 m_protocolInfoReceived = true;
950 Notification* notification = new Notification( Notification::Type_NodeProtocolInfo );
951 notification->SetHomeAndNodeIds( m_homeId, m_nodeId );
952 GetDriver()->QueueNotification( notification );
953 }
954
955 if( m_queryStage > QueryStage_NodeInfo )
956 {
957 m_nodeInfoReceived = true;
958 }
959
960 if( m_queryStage > QueryStage_Instances )
961 {
962 Notification* notification = new Notification( Notification::Type_EssentialNodeQueriesComplete );

Callers 4

ReadCacheMethod · 0.45
ReadCommandClassesXMLMethod · 0.45
CreateValueFromXMLMethod · 0.45
ReadValueFromXMLMethod · 0.45

Calls 11

WriteFunction · 0.85
AttributeMethod · 0.80
QueueNotificationMethod · 0.80
QueryIntAttributeMethod · 0.80
GetNodeIdFunction · 0.70
FirstChildElementMethod · 0.45
ValueMethod · 0.45
SetProductDetailsMethod · 0.45
NextSiblingElementMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected