2017-07-17 08:21:39 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/List.h>
|
2018-06-29 06:45:36 +00:00
|
|
|
#include <fnd/ISerialisable.h>
|
|
|
|
#include <nx/npdm.h>
|
2018-06-27 05:03:46 +00:00
|
|
|
#include <nx/AccessControlInfoBinary.h>
|
|
|
|
#include <nx/AccessControlInfoDescBinary.h>
|
2017-07-17 08:21:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace nx
|
|
|
|
{
|
|
|
|
class NpdmBinary :
|
2018-06-29 06:45:36 +00:00
|
|
|
public fnd::ISerialisable
|
2017-07-17 08:21:39 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NpdmBinary();
|
|
|
|
NpdmBinary(const NpdmBinary& other);
|
|
|
|
|
2018-06-24 08:18:54 +00:00
|
|
|
void operator=(const NpdmBinary& other);
|
2017-07-17 08:21:39 +00:00
|
|
|
bool operator==(const NpdmBinary& other) const;
|
|
|
|
bool operator!=(const NpdmBinary& other) const;
|
|
|
|
|
|
|
|
// export/import binary
|
2018-06-24 08:18:54 +00:00
|
|
|
void toBytes();
|
|
|
|
void fromBytes(const byte_t* bytes, size_t len);
|
|
|
|
const fnd::Vec<byte_t>& getBytes() const;
|
2017-07-17 08:21:39 +00:00
|
|
|
|
|
|
|
// variables
|
|
|
|
void clear();
|
|
|
|
|
2018-06-29 06:45:36 +00:00
|
|
|
npdm::InstructionType getInstructionType() const;
|
|
|
|
void setInstructionType(npdm::InstructionType type);
|
|
|
|
|
|
|
|
npdm::ProcAddrSpaceType getProcAddressSpaceType() const;
|
|
|
|
void setProcAddressSpaceType(npdm::ProcAddrSpaceType type);
|
|
|
|
|
|
|
|
byte_t getMainThreadPriority() const;
|
|
|
|
void setMainThreadPriority(byte_t priority);
|
|
|
|
|
|
|
|
byte_t getMainThreadCpuId() const;
|
|
|
|
void setMainThreadCpuId(byte_t cpu_id);
|
|
|
|
|
|
|
|
uint32_t getVersion() const;
|
|
|
|
void setVersion(uint32_t version);
|
|
|
|
|
|
|
|
uint32_t getMainThreadStackSize() const;
|
|
|
|
void setMainThreadStackSize(uint32_t size);
|
|
|
|
|
|
|
|
const std::string& getName() const;
|
|
|
|
void setName(const std::string& name);
|
|
|
|
|
|
|
|
const std::string& getProductCode() const;
|
|
|
|
void setProductCode(const std::string& product_code);
|
|
|
|
|
2018-06-27 05:03:46 +00:00
|
|
|
const AccessControlInfoBinary& getAci() const;
|
|
|
|
void setAci(const AccessControlInfoBinary& aci);
|
2017-07-17 08:21:39 +00:00
|
|
|
|
2018-06-27 05:03:46 +00:00
|
|
|
const AccessControlInfoDescBinary& getAcid() const;
|
|
|
|
void setAcid(const AccessControlInfoDescBinary& acid);
|
2017-07-17 08:21:39 +00:00
|
|
|
private:
|
|
|
|
const std::string kModuleName = "NPDM_BINARY";
|
|
|
|
|
|
|
|
// raw binary
|
2018-06-24 08:18:54 +00:00
|
|
|
fnd::Vec<byte_t> mRawBinary;
|
2017-07-17 08:21:39 +00:00
|
|
|
|
|
|
|
// variables
|
2018-06-29 06:45:36 +00:00
|
|
|
npdm::InstructionType mInstructionType;
|
|
|
|
npdm::ProcAddrSpaceType mProcAddressSpaceType;
|
|
|
|
byte_t mMainThreadPriority;
|
|
|
|
byte_t mMainThreadCpuId;
|
|
|
|
uint32_t mVersion;
|
|
|
|
uint32_t mMainThreadStackSize;
|
|
|
|
std::string mName;
|
|
|
|
std::string mProductCode;
|
2018-06-27 05:03:46 +00:00
|
|
|
AccessControlInfoBinary mAci;
|
|
|
|
AccessControlInfoDescBinary mAcid;
|
2017-07-17 08:21:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|