diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-04-14 11:30:55 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-04-14 11:30:55 +0200 |
| commit | b93a1fe88141adf095bab09006b473205f597465 (patch) | |
| tree | ff9885578c4d3f5bbef9b0d9c362ec9f04c2c8bd /daemon/bundle.cpp | |
| parent | 78d1697cd63033244304f7794cf9157029e4fdb5 (diff) | |
Do not compute STM32CRC - use one from manifest.json
Fixes #47
Diffstat (limited to 'daemon/bundle.cpp')
| -rw-r--r-- | daemon/bundle.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/daemon/bundle.cpp b/daemon/bundle.cpp index bfd4b83..63400b5 100644 --- a/daemon/bundle.cpp +++ b/daemon/bundle.cpp @@ -127,3 +127,21 @@ bool Bundle::fileExists(enum Bundle::File file) const delete dev; return exists; } + +quint32 Bundle::crcFile(enum Bundle::File file) const +{ + quint32 ret = 0; + + switch (file) { + case Bundle::BINARY: + ret = b->manifest.value(type()).toObject().value("crc").toDouble(); + break; + case Bundle::RESOURCES: + ret = b->manifest.value("resources").toObject().value("crc").toDouble(); + break; + default: + qCWarning(l) << "Unsupported CRC for" << file; + } + + return ret; +} |
