mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-11-04 12:59:07 +01:00
Add bootloader extension
This commit is contained in:
committed by
Kyle Schwarz
parent
4db27aa187
commit
6ac041cadc
@@ -0,0 +1,25 @@
|
||||
#include "icsneo/device/extensions/bootloader/parser/fwloader.h"
|
||||
#include "icsneo/device/extensions/bootloader/parser/fwbin.h"
|
||||
#include "icsneo/device/extensions/bootloader/parser/fwbundle.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
namespace Bootloader {
|
||||
|
||||
std::unique_ptr<FWRepo> FWLoader::Load(const std::string& path) {
|
||||
if(FWBundle::IsFWBundle(path)) {
|
||||
auto bundle = std::make_unique<FWBundle>();
|
||||
if(!bundle->load(path))
|
||||
return nullptr;
|
||||
return bundle;
|
||||
}
|
||||
|
||||
auto bin = std::make_unique<FWBin>();
|
||||
if(!bin->load(path))
|
||||
return nullptr;
|
||||
return bin;
|
||||
}
|
||||
|
||||
} // namespace Bootloader
|
||||
|
||||
} // namespace icsneo
|
||||
Reference in New Issue
Block a user