Go to the documentation of this file.
9 #include "nlohmann/json.hpp"
20 xin->out.link(script->inputs[
"in"]);
24 # Receive bytes from the host
25 data = node.io['in'].get().getData()
26 jsonStr = str(data, 'utf-8')
27 dict = json.loads(jsonStr)
29 # Change initial dictionary a bit
34 b.setData(json.dumps(dict).encode('utf-8'))
35 node.io['out'].send(b)
40 script->outputs[
"out"].link(xout->input);
47 nlohmann::json dict{{
"one", 1}, {
"foo",
"bar"}};
48 cout <<
"dict: " << dict <<
"\n";
50 auto data = dict.dump();
56 auto changedDict = nlohmann::json::parse(jsonData->getData());
57 cout <<
"changedDict: " << changedDict <<
"\n";
58 const nlohmann::json expectedDict{{
"one", 2}, {
"foo",
"baz"}};
59 if(expectedDict != changedDict)
return 1;
XLinkOut node. Sends messages over XLink.
Represents the pipeline, set of nodes and connections between them.
constexpr auto data(C &c) -> decltype(c.data())
std::vector< std::uint8_t > buffer
std::shared_ptr< DataOutputQueue > getOutputQueue(const std::string &name)
void setScript(const std::string &script, const std::string &name="")
std::shared_ptr< N > create()
void setStreamName(const std::string &name)
Base message - buffer of binary data.
XLinkIn node. Receives messages over XLink.
std::shared_ptr< DataInputQueue > getInputQueue(const std::string &name)
void setStreamName(const std::string &name)
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19