diff --git a/dali/dfu/dfurun.cpp b/dali/dfu/dfurun.cpp index 74a795261e8..1e7d69f5e53 100644 --- a/dali/dfu/dfurun.cpp +++ b/dali/dfu/dfurun.cpp @@ -1427,15 +1427,19 @@ class CDFUengine: public CInterface, implements IDFUengine // keys default wrap for copy if (destination->getWrap()||(iskey&&(cmd==DFUcmd_copy))) { - if (destination->getNumPartsOverride()) - throw makeStringExceptionV(-1, "DestinationNumPartOverride is provided but %s", destination->getWrap()?"getWrap is true":"is copying a key"); - dst->setNumPartsOverride(srcFile->numParts()); + unsigned numOverrideParts = destination->getNumPartsOverride(); + if (numOverrideParts) + { + if (srcFile->numParts() != numOverrideParts) + throw makeStringExceptionV(-1, "Destination NumPartsOverride is provided but %s", (iskey&&(cmd==DFUcmd_copy))?"not supported when copying a key":"getWrap is true"); + } + dst->setNumParts(srcFile->numParts()); } else if (plane) { // use destination defaultSprayParts if requestor doesn't provide num parts if (plane->hasProp("@defaultSprayParts") && destination->getNumPartsOverride()==0) - dst->setNumPartsOverride(plane->getPropInt("@defaultSprayParts")); + dst->setNumParts(plane->getPropInt("@defaultSprayParts")); } } break; diff --git a/dali/dfu/dfuwu.cpp b/dali/dfu/dfuwu.cpp index fcd3403e6a6..f90ebbefea2 100644 --- a/dali/dfu/dfuwu.cpp +++ b/dali/dfu/dfuwu.cpp @@ -1376,7 +1376,7 @@ class CDFUfileSpec: public CLinkedDFUWUchild, implements IDFUfileSpec { queryRoot()->setProp("@partmask",val); } - void setNumParts(unsigned val) + virtual void setNumParts(unsigned val) override { queryRoot()->setPropInt("@numparts",val); diff --git a/dali/dfu/dfuwu.hpp b/dali/dfu/dfuwu.hpp index 59c15a49e9d..7e56085a5f5 100644 --- a/dali/dfu/dfuwu.hpp +++ b/dali/dfu/dfuwu.hpp @@ -279,6 +279,7 @@ interface IDFUfileSpec: extends IConstDFUfileSpec virtual void setFromXML(const char *xml) = 0; virtual void setCompressed(bool set) = 0; virtual void setWrap(bool val) = 0; + virtual void setNumParts(unsigned val) = 0; virtual void setNumPartsOverride(unsigned num) = 0; virtual void setReplicateOffset(int val) = 0; // sets for all clusters virtual void setDiffKey(const char *keyname) = 0;