Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
b
c
d
e
h
i
l
m
n
p
r
s
u
x
Typedefs
b
c
d
e
f
g
i
m
p
r
u
v
Enumerations
Enumerator
a
b
f
g
i
m
n
r
s
u
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
m
n
p
q
r
s
t
u
v
x
Enumerations
a
c
d
e
f
k
l
m
p
r
s
t
v
w
Enumerator
a
b
d
f
g
h
i
l
m
n
o
p
r
s
u
v
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
b
c
d
e
f
g
m
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
i
k
l
m
n
o
p
r
s
t
w
Typedefs
Enumerations
Enumerator
Macros
_
d
f
i
m
n
p
s
t
u
examples
bootloader
write_flash_memory.cpp
Go to the documentation of this file.
1
#include <cstdio>
2
#include <fstream>
3
#include <string>
4
5
#include "
depthai/depthai.hpp
"
6
7
int
main
(
int
argc,
char
** argv) {
8
if
(argc < 2) {
9
std::cout <<
"Usage: "
<< argv[0] <<
" offset filename"
<< std::endl;
10
return
0;
11
}
12
size_t
offset = std::stoi(argv[1]);
13
std::string filename{argv[2]};
14
15
// Find device and read memory
16
bool
res =
false
;
17
dai::DeviceInfo
info
;
18
std::tie(res,
info
) =
dai::DeviceBootloader::getFirstAvailableDevice
();
19
20
if
(res) {
21
std::cout <<
"Found device with name: "
<<
info
.name << std::endl;
22
dai::DeviceBootloader
bl(
info
);
23
24
auto
progress = [](
float
p) { std::cout <<
"Flashing progress..."
<< p * 100 <<
"%"
<< std::endl; };
25
bl.
flashCustom
(dai::DeviceBootloader::Memory::FLASH, offset, filename, progress);
26
27
}
else
{
28
std::cout <<
"No devices found"
<< std::endl;
29
}
30
31
return
0;
32
}
main
int main(int argc, char **argv)
Definition:
write_flash_memory.cpp:7
dai::DeviceBootloader
Definition:
DeviceBootloader.hpp:29
dai::DeviceInfo
Definition:
XLinkConnection.hpp:27
dai::logger::info
void info(const FormatString &fmt, Args &&...args)
Definition:
Logging.hpp:78
depthai.hpp
dai::DeviceBootloader::getFirstAvailableDevice
static std::tuple< bool, DeviceInfo > getFirstAvailableDevice()
Definition:
DeviceBootloader.cpp:48
dai::DeviceBootloader::flashCustom
std::tuple< bool, std::string > flashCustom(Memory memory, size_t offset, const std::vector< uint8_t > &data, std::function< void(float)> progressCb=nullptr)
Definition:
DeviceBootloader.cpp:1112
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19