diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..4a4726a5 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use_nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e80f1463 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +result +.DS_Store +/result diff --git a/README.md b/README.md index a31f1126..482c46d2 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,25 @@ section of the developer's website. Please visit the [Latest Version Information](https://developer.dji.com/doc/payload-sdk-tutorial/en/) to get the latest version information. +## Use Docker & Nix to build + + + +```bash +docker pull nixpkgs/nix-flakes:latest +docker run --name payload -it -v {SOMEWHERE}/Payload-SDK:/workspace docker.io/nixpkgs/nix-flakes:latest bash +``` +(inside docker) +```bash +cd /workspace +nix develop +mkdir build && cd build +cmake .. +make +``` + +then output will appears in `build/bin/dji_sdk_demo_linux` and `build/bin/dji_sdk_demo_linux_cxx` + ## Latest Release The latest release version of PSDK is 3.9.0. This version of Payload SDK mainly add some new features support and fixed some diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..2b53c30a --- /dev/null +++ b/default.nix @@ -0,0 +1,30 @@ +{ + pkgs ? import { }, +}: +pkgs.stdenv.mkDerivation rec { + pname = "dji-payload-sdk"; + version = "1.0"; + + src = ./.; + + enableParallelBuilding = true; + # 此选项禁用了对 CMake 软件包的一些自动修正 + # dontFixCmake = true; + + nativeBuildInputs = with pkgs; [ + cmake + libusb1 + libopus + gcc + ffmpeg_4-full + opencv3 + ]; + + # 传给 CMake 的配置参数,控制 liboqs 的功能 + cmakeFlags = [ ]; + + postInstall = '' + mkdir -p $out/bin + install -m755 bin/* $out/bin + ''; +} diff --git a/samples/sample_c++/platform/linux/manifold2/application/dji_sdk_app_info.h.bak b/samples/sample_c++/platform/linux/manifold2/application/dji_sdk_app_info.h.bak new file mode 100644 index 00000000..52677255 --- /dev/null +++ b/samples/sample_c++/platform/linux/manifold2/application/dji_sdk_app_info.h.bak @@ -0,0 +1,55 @@ +/** + ******************************************************************** + * @file dji_sdk_app_info.h + * @brief This is the header file for defining the structure and (exported) function prototypes. + * + * @copyright (c) 2018 DJI. All rights reserved. + * + * All information contained herein is, and remains, the property of DJI. + * The intellectual and technical concepts contained herein are proprietary + * to DJI and may be covered by U.S. and foreign patents, patents in process, + * and protected by trade secret or copyright law. Dissemination of this + * information, including but not limited to data and other proprietary + * material(s) incorporated within the information, in any form, is strictly + * prohibited without the express written consent of DJI. + * + * If you receive this source code without DJI’s authorization, you may not + * further disseminate the information, and you must immediately remove the + * source code and notify DJI of its removal. DJI reserves the right to pursue + * legal actions against you for any loss(es) or damage(s) caused by your + * failure to do so. + * + ********************************************************************* + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef DJI_SDK_APP_INFO_H +#define DJI_SDK_APP_INFO_H + +/* Includes ------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported constants --------------------------------------------------------*/ +// ATTENTION: User must goto https://developer.dji.com/user/apps/#all to create your own dji sdk application, get dji sdk application +// information then fill in the application information here. +#define USER_APP_NAME "Campus security" +#define USER_APP_ID "148693" +#define USER_APP_KEY "63dcfdc7dd50ada8821724aefc4b240" +#define USER_APP_LICENSE "iup9qipeflyvYzTWP6EYghlaODONDAqY4J7NwCSRXCqve3VHZ9HoQh7Ar85GCRaSEpDZ2H1Z9w54m65/K21EzwOsJvKZBmGPtL7xlzeP5iax+3wVqL7RmDYmZrPhLrONcGeHlRpls/HP+KzNMFsFvrIIKmsTFJywxaKloO2gd3K5iv2teltk3XjZJFTNKaLB1TX7aC9qf3/NZFES6z4rYDBsTHHAU+z9dz9beLGvf0YSLSZSIXhq2LPkw1cbC+o3KrbMDPRWzSD+oj8NsLmc9NJxydjhPehabt504I8itEIdFLfU/AYDLPAGLZzTt/mJRoDaDG/HcI0lGWAKPYI7/A==" +#define USER_DEVELOPER_ACCOUNT "axccjqh@qq.com" +#define USER_BAUD_RATE "460800" + +/* Exported types ------------------------------------------------------------*/ + +/* Exported functions --------------------------------------------------------*/ + + +#ifdef __cplusplus +} +#endif + +#endif // DJI_SDK_APP_INFO_H +/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/