----------------------------------------------------------------------------- Read the node config from the OZW Cache File... -----------------------------------------------------------------------------
| 903 | // Read the node config from the OZW Cache File... |
| 904 | //----------------------------------------------------------------------------- |
| 905 | void 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 ); |
no test coverage detected