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

Method SendNextData

cpp/src/command_classes/ControllerReplication.cpp:226–300  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Send the next block of replication data -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

224// Send the next block of replication data
225//-----------------------------------------------------------------------------
226void ControllerReplication::SendNextData
227(
228)
229{
230 uint16 i = 255;
231
232 if( !m_busy )
233 {
234 return;
235 }
236
237 while( 1 )
238 {
239 if( m_groupIdx != -1 )
240 {
241 m_groupIdx++;
242 if( m_groupIdx <= m_groupCount )
243 {
244 break;
245 }
246 }
247 i = m_nodeId == -1 ? 0 : m_nodeId+1;
248 LockGuard LG(GetDriver()->m_nodeMutex);
249 while( i < 256 )
250 {
251 if( GetDriver()->m_nodes[i] )
252 {
253 m_groupCount = GetDriver()->m_nodes[i]->GetNumGroups();
254 if( m_groupCount != 0 )
255 {
256 m_groupName = GetDriver()->m_nodes[i]->GetGroupLabel( m_groupIdx );
257 m_groupIdx = m_groupName.length() > 0 ? 0 : 1;
258 break;
259 }
260 }
261 i++;
262 }
263 m_nodeId = i;
264 break;
265 }
266 if( i < 255 )
267 {
268 Msg* msg = new Msg( (m_groupName.length() > 0 ? "ControllerReplicationCmd_TransferGroupName" : "ControllerReplicationCmd_TransferGroup"), m_targetNodeId, REQUEST, FUNC_ID_ZW_REPLICATION_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
269 msg->Append( m_targetNodeId );
270 if( m_groupName.length() > 0 )
271 {
272 msg->Append((uint8) (m_groupName.length() + 4 ));
273 msg->Append( GetCommandClassId() );
274 msg->Append( ControllerReplicationCmd_TransferGroupName );
275 msg->Append( 0 );
276 msg->Append( m_groupIdx );
277 for( uint8 j = 0; j < m_groupName.length(); j++ )
278 {
279 msg->Append( m_groupName[j] );
280 }
281 m_groupName = "";
282 }
283 else

Callers 1

ProcessMsgMethod · 0.80

Calls 7

GetCommandClassIdFunction · 0.85
SendMsgMethod · 0.80
AddNodeStopMethod · 0.80
GetNumGroupsMethod · 0.45
GetGroupLabelMethod · 0.45
lengthMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected