Commit 80f80918 authored by Martin Cífka's avatar Martin Cífka
Browse files

Replaced hello world with hard-coded program for taking single picture, added...

Replaced hello world with hard-coded program for taking single picture, added ArduinoJson, sources moved to sdk/src
parent 1e48eb52
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ Copy autorun.ash to the micro SD card root. Then connect over telnet (user: root

	cd sdk

By running script run.sh, build a Docker container with the development environment and compile a "hello world" executable (-b option), then copy and run it directly on the camera (-r option):
By running script run.sh, build a Docker container with the development environment and compile an executable from C++ files inside sdk/src/ directory (-b option), then copy and run it directly on the camera (-r option):

	./run.sh -br

sdk/hello.cpp

deleted100644 → 0
+0 −6
Original line number Diff line number Diff line
#include <iostream>

int main() {
	std::cout << "Hello from C++" << std::endl;
	return 0;
}
+3 −2
Original line number Diff line number Diff line
@@ -29,13 +29,14 @@ done


if [ "$build" = true ] ; then
	sources=$(ls *.cpp 2>/dev/null | tr '\r\n' ' ') || (echo "No .cpp files found" && exit 1)
	sources=$(ls src/*.cpp 2>/dev/null | tr '\r\n' ' ') || (echo "No .cpp files found" && exit 1)

    sudo docker build -t mi_camera_sdk .
    sudo docker run -it --rm -v "$PWD":/workdir mi_camera_sdk bash -c "arm-linux-gnueabihf-c++ -std=c++11 -o /workdir/$outfile $sources"
    sudo docker run -it --rm -v "$PWD":/workdir mi_camera_sdk bash -c "arm-linux-gnueabihf-c++ -std=c++11 -I src/ArduinoJson -o /workdir/$outfile $sources"
    echo -e "\n"
fi


if [ "$run" = true ] ; then
    sleep 1 && nc 192.168.42.1 1234 -w2 <"$outfile" &
    ./telnet.exp /tmp/"$outfile"
+17 −0
Original line number Diff line number Diff line
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// MIT License

#pragma once

#ifdef __cplusplus

#include "ArduinoJson.hpp"

using namespace ArduinoJson;

#else

#error ArduinoJson requires a C++ compiler, please change file extension to .cc or .cpp

#endif
+73 −0
Original line number Diff line number Diff line
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// MIT License

#pragma once

#include "ArduinoJson/Configuration.hpp"

#if !ARDUINOJSON_DEBUG
#ifdef __clang__
#pragma clang system_header
#elif defined __GNUC__
#pragma GCC system_header
#endif
#endif

#include "ArduinoJson/Array/ArrayRef.hpp"
#include "ArduinoJson/Object/ObjectRef.hpp"
#include "ArduinoJson/Variant/VariantRef.hpp"

#include "ArduinoJson/Document/DynamicJsonDocument.hpp"
#include "ArduinoJson/Document/StaticJsonDocument.hpp"

#include "ArduinoJson/Array/ArrayImpl.hpp"
#include "ArduinoJson/Array/ElementProxy.hpp"
#include "ArduinoJson/Array/Utilities.hpp"
#include "ArduinoJson/Collection/CollectionImpl.hpp"
#include "ArduinoJson/Object/MemberProxy.hpp"
#include "ArduinoJson/Object/ObjectImpl.hpp"
#include "ArduinoJson/Variant/VariantAsImpl.hpp"
#include "ArduinoJson/Variant/VariantCompare.hpp"
#include "ArduinoJson/Variant/VariantImpl.hpp"

#include "ArduinoJson/Json/JsonDeserializer.hpp"
#include "ArduinoJson/Json/JsonSerializer.hpp"
#include "ArduinoJson/Json/PrettyJsonSerializer.hpp"
#include "ArduinoJson/MsgPack/MsgPackDeserializer.hpp"
#include "ArduinoJson/MsgPack/MsgPackSerializer.hpp"

#include "ArduinoJson/compatibility.hpp"

namespace ArduinoJson {
typedef ARDUINOJSON_NAMESPACE::ArrayConstRef JsonArrayConst;
typedef ARDUINOJSON_NAMESPACE::ArrayRef JsonArray;
typedef ARDUINOJSON_NAMESPACE::Float JsonFloat;
typedef ARDUINOJSON_NAMESPACE::Integer JsonInteger;
typedef ARDUINOJSON_NAMESPACE::ObjectConstRef JsonObjectConst;
typedef ARDUINOJSON_NAMESPACE::ObjectRef JsonObject;
typedef ARDUINOJSON_NAMESPACE::Pair JsonPair;
typedef ARDUINOJSON_NAMESPACE::PairConst JsonPairConst;
typedef ARDUINOJSON_NAMESPACE::String JsonString;
typedef ARDUINOJSON_NAMESPACE::UInt JsonUInt;
typedef ARDUINOJSON_NAMESPACE::VariantConstRef JsonVariantConst;
typedef ARDUINOJSON_NAMESPACE::VariantRef JsonVariant;
using ARDUINOJSON_NAMESPACE::BasicJsonDocument;
using ARDUINOJSON_NAMESPACE::copyArray;
using ARDUINOJSON_NAMESPACE::DeserializationError;
using ARDUINOJSON_NAMESPACE::deserializeJson;
using ARDUINOJSON_NAMESPACE::deserializeMsgPack;
using ARDUINOJSON_NAMESPACE::DynamicJsonDocument;
using ARDUINOJSON_NAMESPACE::JsonDocument;
using ARDUINOJSON_NAMESPACE::measureJson;
using ARDUINOJSON_NAMESPACE::serialized;
using ARDUINOJSON_NAMESPACE::serializeJson;
using ARDUINOJSON_NAMESPACE::serializeJsonPretty;
using ARDUINOJSON_NAMESPACE::serializeMsgPack;
using ARDUINOJSON_NAMESPACE::StaticJsonDocument;

namespace DeserializationOption {
using ARDUINOJSON_NAMESPACE::Filter;
using ARDUINOJSON_NAMESPACE::NestingLimit;
}  // namespace DeserializationOption
}  // namespace ArduinoJson
Loading