Go to the documentation of this file.
41 void setStaticIPv4(std::string ip, std::string mask, std::string gateway);
43 void setDynamicIPv4(std::string ip, std::string mask, std::string gateway);
53 void setDnsIPv4(std::string dns, std::string dnsAlt =
"");
80 nlohmann::json
toJson()
const;
132 const Pipeline& pipeline,
const dai::Path& pathToCmd = {},
bool compress =
false, std::string applicationName =
"",
bool checkChecksum =
false);
143 std::string applicationName =
"",
144 bool checkChecksum =
false);
155 const Pipeline& pipeline,
157 bool compress =
false,
158 std::string applicationName =
"",
159 bool checkChecksum =
false);
169 const dai::Path& path,
const Pipeline& pipeline,
bool compress, std::string applicationName =
"",
bool checkChecksum =
false);
194 template <typename T, std::enable_if_t<std::is_same<T, bool>::value,
bool> =
true>
235 std::tuple<bool, std::string>
flash(std::function<
void(
float)> progressCallback,
236 const Pipeline& pipeline,
237 bool compress =
false,
238 std::string applicationName =
"",
240 bool checkChecksum =
false);
248 std::tuple<bool, std::string>
flash(
249 const Pipeline& pipeline,
bool compress =
false, std::string applicationName =
"",
Memory memory =
Memory::AUTO,
bool checkChecksum =
false);
263 std::vector<uint8_t> package,
283 std::tuple<bool, std::string>
flashBootloader(std::function<
void(
float)> progressCallback,
const dai::Path& path = {});
322 std::tuple<bool, std::string>
flashBootHeader(
Memory memory, int32_t frequency = -1, int64_t location = -1, int32_t dummyCycles = -1, int64_t offset = -1);
335 Memory memory, int32_t frequency = -1, int64_t location = -1, int32_t dummyCycles = -1, int64_t offset = -1);
344 std::tuple<bool, std::string>
flashCustom(
Memory memory,
size_t offset,
const std::vector<uint8_t>&
data, std::function<
void(
float)> progressCb =
nullptr);
345 std::tuple<bool, std::string>
flashCustom(
Memory memory,
size_t offset,
const uint8_t*
data,
size_t size, std::function<
void(
float)> progressCb =
nullptr);
346 std::tuple<bool, std::string>
flashCustom(
Memory memory,
size_t offset, std::string filename, std::function<
void(
float)> progressCb =
nullptr);
357 Memory memory,
size_t offset,
size_t size, std::vector<uint8_t>&
data, std::function<
void(
float)> progressCb =
nullptr);
358 std::tuple<bool, std::string>
readCustom(
Memory memory,
size_t offset,
size_t size, uint8_t*
data, std::function<
void(
float)> progressCb =
nullptr);
359 std::tuple<bool, std::string>
readCustom(
Memory memory,
size_t offset,
size_t size, std::string filename, std::function<
void(
float)> progressCb =
nullptr);
360 std::tuple<bool, std::string, std::vector<uint8_t>>
readCustom(
Memory memory,
size_t offset,
size_t size, std::function<
void(
float)> progressCb =
nullptr);
431 void bootMemory(
const std::vector<uint8_t>& fw);
487 template <
typename T>
489 template <
typename T>
492 template <
typename T>
494 template <
typename T>
496 template <
typename T>
500 Memory memory,
size_t offset,
const uint8_t*
data,
size_t size, std::string filename, std::function<
void(
float)> progressCb);
502 Memory memory,
size_t offset,
size_t size, uint8_t*
data, std::string filename, std::function<
void(
float)> progressCb);
545 case dai::DeviceBootloader::Type::USB:
548 case dai::DeviceBootloader::Type::NETWORK:
560 case dai::DeviceBootloader::Memory::FLASH:
563 case dai::DeviceBootloader::Memory::EMMC:
575 case dai::DeviceBootloader::Section::HEADER:
581 case dai::DeviceBootloader::Section::USER_BOOTLOADER:
582 out <<
"USER_BOOTLOADER";
584 case dai::DeviceBootloader::Section::BOOTLOADER_CONFIG:
585 out <<
"BOOTLOADER_CONFIG";
587 case dai::DeviceBootloader::Section::APPLICATION:
588 out <<
"APPLICATION";
std::string firmwareVersion
Config readConfig(Memory memory=Memory::AUTO, Type type=Type::AUTO)
Represents the pipeline, set of nodes and connections between them.
std::string getDnsAltIPv4()
Get alternate IPv4 DNS server.
nlohmann::json toJson() const
To JSON.
void bootUsbRomBootloader()
static Config fromJson(nlohmann::json)
from JSON
std::tuple< bool, std::string > flashGpioModeBootHeader(Memory memory, int gpioMode)
std::chrono::steady_clock::time_point lastWatchdogPingTime
std::tuple< bool, std::string > flashUsbRecoveryBootHeader(Memory memory)
std::tuple< bool, std::string > flashUserBootloader(std::function< void(float)> progressCallback, const dai::Path &path={})
static void saveDepthaiApplicationPackage(const dai::Path &path, const Pipeline &pipeline, const dai::Path &pathToCmd={}, bool compress=false, std::string applicationName="", bool checkChecksum=false)
void setDnsIPv4(std::string dns, std::string dnsAlt="")
Set IPv4 DNS options.
dai::DeviceBootloader::Version Version
std::string getIPv4Gateway()
Get IPv4 gateway.
std::chrono::milliseconds getNetworkTimeout()
Get NETWORK timeout.
std::string getIPv4()
Get IPv4.
std::tuple< bool, std::string > flashConfigData(nlohmann::json configData, Memory memory=Memory::AUTO, Type type=Type::AUTO)
static std::vector< uint8_t > createDepthaiApplicationPackage(const Pipeline &pipeline, const dai::Path &pathToCmd={}, bool compress=false, std::string applicationName="", bool checkChecksum=false)
std::thread watchdogThread
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &os, const copyable_unique_ptr< T > &cu_ptr)
~DeviceBootloader()
Destroy the Device Bootloader object.
void setDynamicIPv4(std::string ip, std::string mask, std::string gateway)
Setting a dynamic IPv4 will set that IP as well as start DHCP client.
std::string applicationName
bool allowFlashingBootloader
constexpr auto data(C &c) -> decltype(c.data())
std::tuple< bool, std::string > flashConfigClear(Memory memory=Memory::AUTO, Type type=Type::AUTO)
void receiveResponseThrow(T &response)
void init(bool embeddedMvcmd, const dai::Path &pathToMvcmd, tl::optional< bootloader::Type > type, bool allowBlFlash)
bool isUserBootloaderSupported()
std::thread monitorThread
void setMacAddress(std::string mac)
Set MAC address if not flashed on controller.
std::tuple< bool, std::string > flashBootHeader(Memory memory, int32_t frequency=-1, int64_t location=-1, int32_t dummyCycles=-1, int64_t offset=-1)
bool receiveResponse(T &response)
std::mutex lastWatchdogPingTimeMtx
std::atomic< bool > watchdogRunning
Version getVersion() const
std::tuple< bool, std::string > flashConfigFile(const dai::Path &configPath, Memory memory=Memory::AUTO, Type type=Type::AUTO)
constexpr auto size(const C &c) -> decltype(c.size())
std::chrono::milliseconds getUsbTimeout()
Get USB timeout.
static constexpr const Type DEFAULT_TYPE
Default Bootloader type.
std::shared_ptr< XLinkConnection > connection
void setStaticIPv4(std::string ip, std::string mask, std::string gateway)
Setting a static IPv4 won't start DHCP client.
UsbSpeed getUsbMaxSpeed()
Get maxUsbSpeed.
bool sendRequest(const T &request)
bool isEmbeddedVersion() const
nlohmann::json readConfigData(Memory memory=Memory::AUTO, Type type=Type::AUTO)
std::tuple< bool, std::string > flashBootloader(std::function< void(float)> progressCallback, const dai::Path &path={})
dai::bootloader::Memory Memory
bool receiveResponseData(std::vector< uint8_t > &data)
MemoryInfo getMemoryInfo(Memory memory)
void setUsbMaxSpeed(UsbSpeed speed)
Set maxUsbSpeed.
void setNetworkTimeout(std::chrono::milliseconds ms)
Set NETWOR timeout.
static Version getEmbeddedBootloaderVersion()
bool isStaticIPV4()
Get if static IPv4 configuration is set.
bool isAllowedFlashingBootloader() const
static std::tuple< bool, DeviceInfo > getFirstAvailableDevice()
std::unique_ptr< XLinkStream > stream
std::string getDnsIPv4()
Get primary IPv4 DNS server.
std::string getMacAddress()
Get MAC address if not flashed on controller.
tl::optional< Version > getFlashedVersion() const
std::tuple< bool, std::string > flashConfig(const Config &config, Memory memory=Memory::AUTO, Type type=Type::AUTO)
std::atomic< bool > closed
static std::vector< DeviceInfo > getAllAvailableDevices()
ApplicationInfo readApplicationInfo(Memory memory)
bool parseResponse(const std::vector< uint8_t > &data, T &response)
std::string toString() const
Convert Version to string.
std::tuple< bool, std::string > readCustom(Memory memory, size_t offset, size_t size, std::vector< uint8_t > &data, std::function< void(float)> progressCb=nullptr)
Represents paths on a filesystem; accepts utf-8, Windows utf-16 wchar_t, or std::filesystem::path.
void sendRequestThrow(const T &request)
std::tuple< bool, std::string > flashClear(Memory memory=Memory::AUTO)
std::tuple< bool, std::string > flashCustom(Memory memory, size_t offset, const std::vector< uint8_t > &data, std::function< void(float)> progressCb=nullptr)
std::tuple< bool, std::string > flashDepthaiApplicationPackage(std::function< void(float)> progressCallback, std::vector< uint8_t > package, Memory memory=Memory::AUTO)
std::string getIPv4Mask()
Get IPv4 mask.
std::tuple< bool, std::string > flash(std::function< void(float)> progressCallback, const Pipeline &pipeline, bool compress=false, std::string applicationName="", Memory memory=Memory::AUTO, bool checkChecksum=false)
tl::optional< Version > flashedVersion
void bootMemory(const std::vector< uint8_t > &fw)
std::tuple< bool, std::string > flashFastBootHeader(Memory memory, int32_t frequency=-1, int64_t location=-1, int32_t dummyCycles=-1, int64_t offset=-1)
DeviceBootloader()=delete
static std::vector< std::uint8_t > getEmbeddedBootloaderBinary(Type type=DEFAULT_TYPE)
dai::bootloader::Type Type
void setUsbTimeout(std::chrono::milliseconds ms)
Set USB timeout.
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19