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

Method downloadConfigRevision

cpp/src/Driver.cpp:7504–7527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7502}
7503
7504bool Driver::downloadConfigRevision
7505(
7506 Node *node
7507)
7508{
7509 /* only download if the revision is 1 or higher. Revision 0's are for local testing only */
7510 if (node->getFileConfigRevision() <= 0) {
7511 Log::Write(LogLevel_Warning, node->GetNodeId(), "Config File Revision is 0. Not Updating");
7512 Notification* notification = new Notification( Notification::Type_UserAlerts );
7513 notification->SetUserAlertNofification(Notification::Alert_ConfigFileDownloadFailed);
7514 QueueNotification( notification );
7515 return false;
7516 }
7517 if (node->getFileConfigRevision() >= node->getLatestConfigRevision()) {
7518 Log::Write(LogLevel_Warning, node->GetNodeId(), "Config File Revision %d is equal to or greater than current revision %d", node->getFileConfigRevision(), node->getLatestConfigRevision());
7519 Notification* notification = new Notification( Notification::Type_UserAlerts );
7520 notification->SetUserAlertNofification(Notification::Alert_ConfigFileDownloadFailed);
7521 QueueNotification( notification );
7522 return false;
7523 } else {
7524 m_mfs->updateConfigFile(this, node);
7525 return true;
7526 }
7527}
7528bool Driver::downloadMFSRevision
7529(
7530)

Callers 1

Calls 5

WriteFunction · 0.85
getFileConfigRevisionMethod · 0.80
GetNodeIdMethod · 0.80
updateConfigFileMethod · 0.80

Tested by

no test coverage detected