1、操作遥控器按钮,psdk进程通过socket发送命令给相机进程 来控制高光谱采集系统;

2、通过FFmpeg采集摄像头视频流并编码为h264,利用psdk推流到遥控器;
This commit is contained in:
tangchao0503
2022-06-22 16:48:50 +08:00
commit 109e0a8f2b
89 changed files with 17079 additions and 0 deletions

View File

@ -0,0 +1,484 @@
/**
********************************************************************
* @file sys_monitor.c
* @version V2.0.0
* @date 2019/11/10
* @brief
*
* @copyright (c) 2018-2019 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 DJIs 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.
*
*********************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include "sys_monitor.h"
#include "psdk_logger.h"
#include "utils/util_misc.h"
/* Private constants ---------------------------------------------------------*/
#define MONITOR_VMRSS_LINE 15
#define MONITOR_PROCESS_ITEM 14
#define MONITOR_CMD_BUF_SIZE 512
/* Private types -------------------------------------------------------------*/
/* Private functions declaration ---------------------------------------------*/
static const char *Monitor_GetItems(const char *buffer, int ie);
/* Private variables ---------------------------------------------------------*/
/* Exported functions definition ---------------------------------------------*/
int Monitor_GetPhyMem(pid_t p)
{
int i;
char file[64] = {0};
FILE *fd;
char lineBuf[256] = {0};
char name[32];
int vmrss = 0; //memory peak
char *ret = NULL;
sprintf(file, "/proc/%d/status", (int) p);
fd = fopen(file, "r");
if (fd == NULL) {
PsdkLogger_UserLogError("open file fail.");
return 0;
}
for (i = 0; i < MONITOR_VMRSS_LINE - 1; i++) {
ret = fgets(lineBuf, sizeof(lineBuf), fd);
USER_UTIL_UNUSED(ret);
}
ret = fgets(lineBuf, sizeof(lineBuf), fd);
if (ret == NULL)
goto out;
sscanf(lineBuf, "%31s %d", name, &vmrss);
out:
fclose(fd);
return vmrss;
}
int Monitor_GetTotalMem(void)
{
char *file = "/proc/meminfo";
FILE *fd;
char lineBuf[256] = {0};
char name[32];
int memtotal = 0;
char *ret = NULL;
fd = fopen(file, "r");
if (fd == NULL) {
PsdkLogger_UserLogError("open file fail.");
return 0;
}
ret = fgets(lineBuf, sizeof(lineBuf), fd);
if (ret == NULL)
goto out;
sscanf(lineBuf, "%31s %d", name, &memtotal);
out:
fclose(fd);
return memtotal;
}
float Monitor_GetPmem(pid_t p)
{
int phy = Monitor_GetPhyMem(p);
int total = Monitor_GetTotalMem();
float occupy = (float) ((phy * 1.0) / (total * 1.0));
return occupy;
}
unsigned int Monitor_GetCpuOccupyOfProcess(pid_t pid)
{
char file[64] = {0};
T_MonitorProcessCpuOccupy t = {0};
FILE *fd;
char lineBuf[1024] = {0};
char *q = NULL;
char *ret = NULL;
sprintf(file, "/proc/%d/stat", (int) pid);
fd = fopen(file, "r");
if (fd == NULL) {
PsdkLogger_UserLogError("open file fail.");
return 0;
}
ret = fgets(lineBuf, sizeof(lineBuf), fd);
if (ret == NULL)
goto out;
sscanf(lineBuf, "%u", (unsigned int *) &t.pid);
q = (char *) Monitor_GetItems(lineBuf, MONITOR_PROCESS_ITEM);
if (q == NULL) {
PsdkLogger_UserLogError("get item fail.");
goto out;
}
sscanf(q, "%u %u %u %u", &t.utime, &t.stime, &t.cutime, &t.cstime);
out:
fclose(fd);
return (t.utime + t.stime + t.cutime + t.cstime);
}
unsigned int Monitor_GetCpuOccupyOfThread(pid_t pid, pid_t tid)
{
char file[64] = {0};
T_MonitorProcessCpuOccupy t = {0};
FILE *fd;
char lineBuf[1024] = {0};
char *q = NULL;
char *ret = NULL;
sprintf(file, "/proc/%d/task/%d/stat", (int) pid, (int) tid);
fd = fopen(file, "r");
if (fd == NULL) {
PsdkLogger_UserLogError("open file fail.");
return 0;
}
ret = fgets(lineBuf, sizeof(lineBuf), fd);
if (ret == NULL)
goto out;
sscanf(lineBuf, "%u", (unsigned int *) &t.pid);
q = (char *) Monitor_GetItems(lineBuf, MONITOR_PROCESS_ITEM);
if (q == NULL) {
PsdkLogger_UserLogError("get item fail.");
goto out;
}
sscanf(q, "%u %u %u %u", &t.utime, &t.stime, &t.cutime, &t.cstime);
out:
fclose(fd);
return (t.utime + t.stime + t.cutime + t.cstime);
}
unsigned int Monitor_GetCpuTotalOccupy(void)
{
FILE *fd;
char buff[1024] = {0};
T_MonitorTotalCpuOccupy t = {0};
char name[16];
char *ret = NULL;
fd = fopen("/proc/stat", "r");
if (fd == NULL) {
PsdkLogger_UserLogError("open file fail.");
return 0;
}
ret = fgets(buff, sizeof(buff), fd);
if (ret == NULL)
goto out;
sscanf(buff, "%15s %u %u %u %u", name, &t.user, &t.nice, &t.system, &t.idle);
out:
fclose(fd);
return (t.user + t.nice + t.system + t.idle);
}
float Monitor_GetPcpuOfThread(pid_t pid, pid_t tid)
{
FILE *fp;
char cmdStr[MONITOR_CMD_BUF_SIZE];
char lineBuf[256] = {0};
pid_t tidInCommandLine = 0;
float pcpuInCommandLine = 0.0f;
int ret;
char *q = NULL;
snprintf(cmdStr, MONITOR_CMD_BUF_SIZE, "ps -mp %d -o tid,pcpu", (int) pid);
fp = popen(cmdStr, "r");
if (fp == NULL) {
PsdkLogger_UserLogError("fp is null.");
return 0;
}
while (fgets(lineBuf, sizeof(lineBuf), fp) != NULL) {
q = (char *) Monitor_GetItems(lineBuf, 1);
if (q == NULL) {
PsdkLogger_UserLogError("get item fail.");
goto out;
}
sscanf(q, "%u", (unsigned int *) &tidInCommandLine);
if (tidInCommandLine == tid) {
q = (char *) Monitor_GetItems(lineBuf, 2);
if (q == NULL) {
PsdkLogger_UserLogError("get item fail.");
goto out;
}
ret = sscanf(q, "%f", &pcpuInCommandLine);
if (ret <= 0) {
PsdkLogger_UserLogError("get pcpu error.");
pcpuInCommandLine = 0;
}
goto out;
}
}
PsdkLogger_UserLogDebug("not found thread.");
out:
pclose(fp);
return pcpuInCommandLine;
}
unsigned int Monitor_GetThreadCountOfProcess(pid_t pid)
{
FILE *fp;
char cmdStr[MONITOR_CMD_BUF_SIZE];
unsigned int count;
int ret;
snprintf(cmdStr, MONITOR_CMD_BUF_SIZE, "ps -T -p %d | wc -l", (int) pid);
fp = popen(cmdStr, "r");
if (fp == NULL) {
PsdkLogger_UserLogError("fp is null.");
return 0;
}
ret = fscanf(fp, "%u", &count);
if (ret <= 0) {
PsdkLogger_UserLogError("get count error.");
count = 0;
goto out;
}
count--;
out:
pclose(fp);
return count;
}
void Monitor_GetTidListOfProcess(pid_t pid, pid_t *tidList, unsigned int size)
{
int i = 0;
FILE *fp;
char cmdStr[MONITOR_CMD_BUF_SIZE];
char lineBuf[256] = {0};
int ret = 0;
if (Monitor_GetThreadCountOfProcess(pid) > size) {
PsdkLogger_UserLogError("size is too small.");
return;
}
snprintf(cmdStr, MONITOR_CMD_BUF_SIZE, "ps -mp %d -o tid", (int) pid);
fp = popen(cmdStr, "r");
if (fp == NULL) {
PsdkLogger_UserLogError("fp is null.");
return;
}
while (fgets(lineBuf, sizeof(lineBuf), fp) != NULL && i <= size) {
ret = sscanf(lineBuf, "%u", (unsigned int *) &tidList[i]);
if (ret > 0)
i++;
}
pclose(fp);
}
void Monitor_GetNameOfThread(pid_t pid, pid_t tid, char *name, unsigned int size)
{
char file[64] = {0};
FILE *fd;
char lineBuf[32] = {0};
char *ret = NULL;
memset(name, 0, size);
sprintf(file, "/proc/%d/task/%d/comm", (int) pid, (int) tid);
fd = fopen(file, "r");
if (fd == NULL) {
PsdkLogger_UserLogDebug("open file fail.");
return;
}
ret = fgets(lineBuf, sizeof(lineBuf), fd);
if (ret == NULL)
goto out;
if (lineBuf[strlen(lineBuf) - 1] == '\n')
lineBuf[strlen(lineBuf) - 1] = '\0';
strncpy(name, lineBuf, USER_UTIL_MIN(size - 1, sizeof(lineBuf)));
out:
fclose(fd);
}
/**
* @brief
* @param pid
* @return Unit: B.
*/
unsigned int Monitor_GetHeapUsed(pid_t pid)
{
FILE *fp;
char cmdStr[MONITOR_CMD_BUF_SIZE];
char lineBuf[256] = {0};
int ret = 0;
unsigned int heapUsed = 0;
char *q = NULL;
char *rett = NULL;
snprintf(cmdStr, MONITOR_CMD_BUF_SIZE, "cat /proc/%d/smaps | grep -A 18 heap | grep Private_Dirty", (int) pid);
fp = popen(cmdStr, "r");
if (fp == NULL) {
PsdkLogger_UserLogError("fp is null.");
return 0;
}
rett = fgets(lineBuf, sizeof(lineBuf), fp);
if (rett == NULL) {
goto out;
}
q = (char *) Monitor_GetItems(lineBuf, 2);
if (q == NULL) {
PsdkLogger_UserLogError("get item fail.");
goto out;
}
ret = sscanf(q, "%u", &heapUsed);
if (ret <= 0) {
PsdkLogger_UserLogError("can not find heapUsed.");
heapUsed = 0;
goto out;
}
heapUsed *= 1024;
out:
pclose(fp);
return heapUsed;
}
/**
* @brief
* @param pid
* @return Unit: B.
*/
unsigned int Monitor_GetStackUsed(pid_t pid)
{
FILE *fp;
char cmdStr[MONITOR_CMD_BUF_SIZE];
char lineBuf[256] = {0};
int ret = 0;
unsigned int stackUsed = 0;
char *q = NULL;
char *rett = NULL;
snprintf(cmdStr, MONITOR_CMD_BUF_SIZE, "cat /proc/%d/smaps | grep -A 18 stack | grep Private_Dirty", (int) pid);
fp = popen(cmdStr, "r");
if (fp == NULL) {
PsdkLogger_UserLogError("fp is null.");
return 0;
}
rett = fgets(lineBuf, sizeof(lineBuf), fp);
if (rett == NULL)
goto out;
q = (char *) Monitor_GetItems(lineBuf, 2);
if (q == NULL) {
PsdkLogger_UserLogError("get item fail.");
goto out;
}
ret = sscanf(q, "%u", &stackUsed);
if (ret <= 0) {
PsdkLogger_UserLogError("can not find stackUsed.");
stackUsed = 0;
goto out;
}
stackUsed *= 1024;
out:
pclose(fp);
return stackUsed;
}
/* Private functions definition-----------------------------------------------*/
static const char *Monitor_GetItems(const char *buffer, int ie)
{
int i = 0;
int j = 0;
char *p = (char *) buffer;
int len = (int) strlen(buffer);
int count = 0;
if (1 == ie || ie < 1) {
return p;
}
while (1) {
for (i = j; i < len; i++) {
if (*(buffer + i) != ' ') {
count++;
if (count == ie)
return buffer + i;
break;
}
}
for (j = i; j < len; ++j) {
if (*(buffer + j) == ' ')
break;
}
if (i == len || j == len)
break;
}
return NULL;
}
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/

View File

@ -0,0 +1,78 @@
/**
********************************************************************
* @file sys_monitor.h
* @version V2.0.0
* @date 2019/11/10
* @brief This is the header file for "sys_monitor.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2018-2019 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 DJIs 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 SYS_MONITOR_H
#define SYS_MONITOR_H
/* Includes ------------------------------------------------------------------*/
#include "psdk_typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef struct {
unsigned int user;
unsigned int nice;
unsigned int system;
unsigned int idle;
} T_MonitorTotalCpuOccupy;
typedef struct {
pid_t pid;
unsigned int utime;
unsigned int stime;
unsigned int cutime;
unsigned int cstime;
} T_MonitorProcessCpuOccupy;
/* Exported functions --------------------------------------------------------*/
int Monitor_GetPhyMem(pid_t p);
int Monitor_GetTotalMem();
unsigned int Monitor_GetCpuTotalOccupy();
unsigned int Monitor_GetCpuOccupyOfProcess(pid_t pid);
unsigned int Monitor_GetCpuOccupyOfThread(pid_t pid, pid_t tid);
float Monitor_GetPcpuOfThread(pid_t pid, pid_t tid);
float Monitor_GetPmem(pid_t p);
unsigned int Monitor_GetThreadCountOfProcess(pid_t pid);
void Monitor_GetTidListOfProcess(pid_t pid, pid_t *tidList, unsigned int size);
void Monitor_GetNameOfThread(pid_t pid, pid_t tid, char *name, unsigned int size);
unsigned int Monitor_GetHeapUsed(pid_t pid);
unsigned int Monitor_GetStackUsed(pid_t pid);
#ifdef __cplusplus
}
#endif
#endif //SYS_MONITOR_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -0,0 +1,294 @@
/**
********************************************************************
* @file psdk_osal.c
* @version V2.0.0
* @date 2019/07/01
* @brief
*
* @copyright (c) 2018-2019 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 DJIs 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.
*
*********************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "osal.h"
#include "utils/util_misc.h"
#include "psdk_logger.h"
/* Private constants ---------------------------------------------------------*/
/* Private types -------------------------------------------------------------*/
/* Private functions declaration ---------------------------------------------*/
/* Exported functions definition ---------------------------------------------*/
/* Private functions definition-----------------------------------------------*/
/* Private functions declaration ---------------------------------------------*/
/* Exported functions definition ---------------------------------------------*/
T_PsdkReturnCode
Osal_TaskCreate(T_PsdkTaskHandle *task, void *(*taskFunc)(void *), const char *name, uint32_t stackSize, void *arg)
{
int result;
char nameDealed[16] = {0};
USER_UTIL_UNUSED(stackSize);
*task = malloc(sizeof(pthread_t));
if (*task == NULL) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED;
}
result = pthread_create(*task, NULL, taskFunc, arg);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
if (name != NULL)
strncpy(nameDealed, name, sizeof(nameDealed) - 1);
result = pthread_setname_np(*(pthread_t * ) * task, nameDealed);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
T_PsdkReturnCode Osal_TaskDestroy(T_PsdkTaskHandle task)
{
pthread_cancel(*(pthread_t *) task);
free(task);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
T_PsdkReturnCode Osal_TaskSleepMs(uint32_t timeMs)
{
usleep(1000 * timeMs);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Declare the mutex container, initialize the mutex, and
* create mutex ID.
* @param mutex: pointer to the created mutex ID.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_MutexCreate(T_PsdkMutexHandle *mutex)
{
int result;
*mutex = malloc(sizeof(pthread_mutex_t));
if (*mutex == NULL) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED;
}
result = pthread_mutex_init(*mutex, NULL);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Delete the created mutex.
* @param mutex: pointer to the created mutex ID.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_MutexDestroy(T_PsdkMutexHandle mutex)
{
int result;
result = pthread_mutex_destroy(mutex);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
free(mutex);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Acquire and lock the mutex when peripheral access is required
* @param mutex: pointer to the created mutex ID.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_MutexLock(T_PsdkMutexHandle mutex)
{
int result = pthread_mutex_lock(mutex);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Unlock and release the mutex, when done with the peripheral access.
* @param mutex: pointer to the created mutex ID.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_MutexUnlock(T_PsdkMutexHandle mutex)
{
int result = pthread_mutex_unlock(mutex);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Declare the semaphore container, initialize the semaphore, and
* create semaphore ID.
* @param semaphore: pointer to the created semaphore ID.
* @param initValue: initial value of semaphore.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_SemaphoreCreate(T_PsdkSemHandle *semaphore, uint32_t initValue)
{
int result;
*semaphore = malloc(sizeof(sem_t));
if (*semaphore == NULL) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED;
}
result = sem_init(*semaphore, 0, (unsigned int) initValue);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Delete the created semaphore.
* @param semaphore: pointer to the created semaphore ID.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_SemaphoreDestroy(T_PsdkSemHandle semaphore)
{
int result;
result = sem_destroy((sem_t *) semaphore);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
free(semaphore);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Wait the semaphore until token becomes available.
* @param semaphore: pointer to the created semaphore ID.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_SemaphoreWait(T_PsdkSemHandle semaphore)
{
int result;
result = sem_wait(semaphore);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Wait the semaphore until token becomes available.
* @param semaphore: pointer to the created semaphore ID.
* @param waitTime: timeout value of waiting semaphore, unit: millisecond.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_SemaphoreTimedWait(T_PsdkSemHandle semaphore, uint32_t waitTime)
{
int result;
struct timespec semaphoreWaitTime;
struct timeval systemTime;
gettimeofday(&systemTime, NULL);
systemTime.tv_usec += waitTime * 1000;
if (systemTime.tv_usec >= 1000000) {
systemTime.tv_sec += systemTime.tv_usec / 1000000;
systemTime.tv_usec %= 1000000;
}
semaphoreWaitTime.tv_sec = systemTime.tv_sec;
semaphoreWaitTime.tv_nsec = systemTime.tv_usec * 1000;
result = sem_timedwait(semaphore, &semaphoreWaitTime);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Release the semaphore token.
* @param semaphore: pointer to the created semaphore ID.
* @return an enum that represents a status of PSDK
*/
T_PsdkReturnCode Osal_SemaphorePost(T_PsdkSemHandle semaphore)
{
int result;
result = sem_post(semaphore);
if (result != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/**
* @brief Get the system time for ms.
* @return an uint32 that the time of system, uint:ms
*/
T_PsdkReturnCode Osal_GetTimeMs(uint32_t *ms)
{
struct timeval time;
gettimeofday(&time, NULL);
*ms = (time.tv_sec * 1000 + time.tv_usec / 1000);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
void *Osal_Malloc(uint32_t size)
{
return malloc(size);
}
void Osal_Free(void *ptr)
{
free(ptr);
}
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/

View File

@ -0,0 +1,77 @@
/**
********************************************************************
* @file osal.h
* @version V2.0.0
* @date 2019/8/28
* @brief This is the header file for "osal.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2018-2019 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 DJIs 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 OSAL_H
#define OSAL_H
/* Includes ------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#include <sys/time.h>
#include <unistd.h>
#include "psdk_typedef.h"
#include "psdk_platform.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
T_PsdkReturnCode
Osal_TaskCreate(T_PsdkTaskHandle *task, void *(*taskFunc)(void *), const char *name, uint32_t stackSize, void *arg);
T_PsdkReturnCode Osal_TaskDestroy(T_PsdkTaskHandle task);
T_PsdkReturnCode Osal_TaskSleepMs(uint32_t timeMs);
T_PsdkReturnCode Osal_MutexCreate(T_PsdkMutexHandle *mutex);
T_PsdkReturnCode Osal_MutexDestroy(T_PsdkMutexHandle mutex);
T_PsdkReturnCode Osal_MutexLock(T_PsdkMutexHandle mutex);
T_PsdkReturnCode Osal_MutexUnlock(T_PsdkMutexHandle mutex);
T_PsdkReturnCode Osal_SemaphoreCreate(T_PsdkSemHandle *semaphore, uint32_t initValue);
T_PsdkReturnCode Osal_SemaphoreDestroy(T_PsdkSemHandle semaphore);
T_PsdkReturnCode Osal_SemaphoreWait(T_PsdkSemHandle semaphore);
T_PsdkReturnCode Osal_SemaphoreTimedWait(T_PsdkSemHandle semaphore, uint32_t waitTime);
T_PsdkReturnCode Osal_SemaphorePost(T_PsdkSemHandle semaphore);
T_PsdkReturnCode Osal_GetTimeMs(uint32_t *ms);
void *Osal_Malloc(uint32_t size);
void Osal_Free(void *ptr);
#ifdef __cplusplus
}
#endif
#endif // OSAL_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -0,0 +1,219 @@
/**
********************************************************************
* @file upgrade_platform_opt_linux.c
* @version V2.0.0
* @date 3/25/20
* @brief
*
* @copyright (c) 2018-2019 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 DJIs 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.
*
*********************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "upgrade_platform_opt_linux.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <psdk_logger.h>
#include <psdk_upgrade.h>
/* Private constants ---------------------------------------------------------*/
#define PSDK_TEST_CMD_CALL_MAX_LEN (PSDK_FILE_PATH_SIZE_MAX + 256)
#define PSDK_REBOOT_STATE_FILE_NAME "reboot_state"
/* Private types -------------------------------------------------------------*/
/* Private values -------------------------------------------------------------*/
static FILE *s_upgradeProgramFile = NULL;
/* Private functions declaration ---------------------------------------------*/
static T_PsdkReturnCode PsdkTest_RunSystemCmd(char *systemCmdStr);
/* Exported functions definition ---------------------------------------------*/
T_PsdkReturnCode PsdkUpgradePlatformLinux_RebootSystem(void)
{
// attention: you need su permission to reboot system
return PsdkTest_RunSystemCmd("reboot -h now");
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_CleanUpgradeProgramFileStoreArea(void)
{
char cmdBuffer[PSDK_TEST_CMD_CALL_MAX_LEN];
snprintf(cmdBuffer, PSDK_TEST_CMD_CALL_MAX_LEN, "rm -rf %s*", PSDK_TEST_UPGRADE_FILE_DIR);
return PsdkTest_RunSystemCmd(cmdBuffer);
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_ReplaceOldProgram(void)
{
char cmdBuffer[PSDK_TEST_CMD_CALL_MAX_LEN];
snprintf(cmdBuffer, PSDK_TEST_CMD_CALL_MAX_LEN, "cp -f %s*_V*.*.*.bin %s", PSDK_TEST_UPGRADE_FILE_DIR,
PSDK_TEST_UPGRADE_OLD_FIRMWARE_PATH);
return PsdkTest_RunSystemCmd(cmdBuffer);
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_SetUpgradeRebootState(const T_PsdkUpgradeEndInfo *upgradeEndInfo)
{
FILE *rebootStateFile;
size_t res;
T_PsdkReturnCode returnCode;
rebootStateFile = fopen(PSDK_REBOOT_STATE_FILE_NAME, "w+");
if (rebootStateFile == NULL) {
PsdkLogger_UserLogError("Create reboot state file error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
res = fwrite((uint8_t *) upgradeEndInfo, 1, sizeof(T_PsdkUpgradeEndInfo), rebootStateFile);
if (res != sizeof(T_PsdkUpgradeEndInfo)) {
PsdkLogger_UserLogError("Write data len is not equal");
returnCode = PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
goto out;
}
returnCode = PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
out:
fclose(rebootStateFile);
return returnCode;
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_GetUpgradeRebootState(bool *isUpgradeReboot,
T_PsdkUpgradeEndInfo *upgradeEndInfo)
{
FILE *rebootStateFile;
size_t res;
rebootStateFile = fopen(PSDK_REBOOT_STATE_FILE_NAME, "r");
if (rebootStateFile == NULL) {
*isUpgradeReboot = false;
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
res = fread(upgradeEndInfo, 1, sizeof(T_PsdkUpgradeEndInfo), rebootStateFile);
if (res != sizeof(T_PsdkUpgradeEndInfo)) {
PsdkLogger_UserLogError("Read data len is not equal");
*isUpgradeReboot = false;
goto out;
}
*isUpgradeReboot = true;
out:
fclose(rebootStateFile);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_CleanUpgradeRebootState(void)
{
return PsdkTest_RunSystemCmd("rm -f "PSDK_REBOOT_STATE_FILE_NAME);
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_CreateUpgradeProgramFile(const T_PsdkUpgradeFileInfo *fileInfo)
{
char filePath[PSDK_FILE_PATH_SIZE_MAX];
s_upgradeProgramFile = NULL;
snprintf(filePath, PSDK_FILE_PATH_SIZE_MAX, "%s%s", PSDK_TEST_UPGRADE_FILE_DIR, fileInfo->fileName);
s_upgradeProgramFile = fopen(filePath, "w+");
if (s_upgradeProgramFile == NULL) {
PsdkLogger_UserLogError("Upgrade program file can't create");
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
T_PsdkReturnCode
PsdkUpgradePlatformLinux_WriteUpgradeProgramFile(uint32_t offset, const uint8_t *data, uint16_t dataLen)
{
size_t writeLen;
if (s_upgradeProgramFile == NULL) {
PsdkLogger_UserLogError("upgrade program file can't be NULL");
return PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
if (fseek(s_upgradeProgramFile, offset, SEEK_SET) != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
writeLen = fwrite(data, 1, dataLen, s_upgradeProgramFile);
if (writeLen != dataLen) {
PsdkLogger_UserLogError("Write upgrade program file error, writeLen = %d, dataLen = %d", writeLen);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_ReadUpgradeProgramFile(uint32_t offset, uint16_t readDataLen, uint8_t *data,
uint16_t *realLen)
{
uint32_t readRtn;
if (s_upgradeProgramFile == NULL) {
PsdkLogger_UserLogError("upgrade program file can't be NULL");
return PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
if (fseek(s_upgradeProgramFile, offset, SEEK_SET) != 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
readRtn = fread(data, 1, readDataLen, s_upgradeProgramFile);
if (readRtn == 0 || readRtn > readDataLen) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
*realLen = readRtn;
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
T_PsdkReturnCode PsdkUpgradePlatformLinux_CloseUpgradeProgramFile(void)
{
if (s_upgradeProgramFile == NULL) {
PsdkLogger_UserLogError("upgrade program file can't be NULL");
return PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
fclose(s_upgradeProgramFile);
s_upgradeProgramFile = NULL;
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/* Private functions definition-----------------------------------------------*/
static T_PsdkReturnCode PsdkTest_RunSystemCmd(char *systemCmdStr)
{
int status;
status = system(systemCmdStr);
if (status == -1 || WIFEXITED(status) == false) {
PsdkLogger_UserLogError("Call %s error, status = %d", systemCmdStr, status);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
if (WEXITSTATUS(status) == 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
} else {
PsdkLogger_UserLogError("Exit status is = %d", WEXITSTATUS(status));
return PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
}
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/

View File

@ -0,0 +1,71 @@
/**
********************************************************************
* @file upgrade_platform_opt_linux.h
* @version V2.0.0
* @date 3/25/20
* @brief This is the header file for "upgrade_platform_opt_linux.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2018-2019 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 DJIs 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 UPGRADE_PLATFORM_OPT_LINUX_H
#define UPGRADE_PLATFORM_OPT_LINUX_H
/* Includes ------------------------------------------------------------------*/
#include <psdk_typedef.h>
#include <psdk_upgrade.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
#define PSDK_TEST_UPGRADE_OLD_FIRMWARE_PATH "/usr/local/bin/psdk_demo"
#define PSDK_TEST_UPGRADE_FILE_DIR "/upgrade/"
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
T_PsdkReturnCode PsdkUpgradePlatformLinux_RebootSystem(void);
T_PsdkReturnCode PsdkUpgradePlatformLinux_CleanUpgradeProgramFileStoreArea(void);
T_PsdkReturnCode PsdkUpgradePlatformLinux_CreateUpgradeProgramFile(const T_PsdkUpgradeFileInfo *fileInfo);
T_PsdkReturnCode PsdkUpgradePlatformLinux_WriteUpgradeProgramFile(uint32_t offset, const uint8_t *data,
uint16_t dataLen);
T_PsdkReturnCode PsdkUpgradePlatformLinux_ReadUpgradeProgramFile(uint32_t offset, uint16_t readDataLen, uint8_t *data,
uint16_t *realLen);
T_PsdkReturnCode PsdkUpgradePlatformLinux_CloseUpgradeProgramFile(void);
T_PsdkReturnCode PsdkUpgradePlatformLinux_ReplaceOldProgram(void);
T_PsdkReturnCode PsdkUpgradePlatformLinux_SetUpgradeRebootState(const T_PsdkUpgradeEndInfo *upgradeEndInfo);
T_PsdkReturnCode PsdkUpgradePlatformLinux_GetUpgradeRebootState(bool *isUpgradeReboot,
T_PsdkUpgradeEndInfo *upgradeEndInfo);
T_PsdkReturnCode PsdkUpgradePlatformLinux_CleanUpgradeRebootState(void);
#ifdef __cplusplus
}
#endif
#endif // UPGRADE_PLATFORM_OPT_LINUX_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -0,0 +1,38 @@
Payload SDK Linux Sample.
Test Environment:
Hardware: Manifold2-C/G
Serial: USB-to-Serial Controller CP210x
C Compiler: GCC version 5.4.0 20160609
CMake Version: Cmake version 3.5.1
IDE: CLion 2020.3.1
Communication Serial Configuration:
Baud Rate: 460800
Network Port Configuration:
IP Address: Auto Config (Need root permission)
Network Port: Auto Config
NetMask: Auto Config
Gateway: Auto Config
====== The steps to run the Payload SDK linux sample ======
Step 1 : modify related device information, such as device name of network or uart, uart baud rate.
Step 2 : fill in your app info to file with path 'sample/platform/linux/manifold2/application/app_info.h'.
This info can be obtained by logging in to the developer website https://developer.dji.com/payload-sdk.
Step 3 : build source file, use following cmd:
cd source_code_dir/project
mkdir build
cd build
cmake ..
make
Step 4 : Manifold should connect to Skyport 2.0/XPort via usb-to-serial controller and network cable, make sure the
serial pins are connected properly.
Step 5 : use the root permission to execute this program, use following cmd:
sudo ./psdk_demo
Step 6: open DJI Pilot APP/MSDK APP to use the payload demo functions.

View File

@ -0,0 +1,57 @@
/**
********************************************************************
* @file app_info.h
* @version V2.0.0
* @date 2019/07/01
* @brief This is the header file for "app_info.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2018-2019 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 DJIs 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 APP_INFO_H
#define APP_INFO_H
/* Includes ------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
// ATTENTION: User must goto developer.dji.com to create your own payload sdk application, get payload sdk application
// information then fill in the application information here.
#define USER_APP_NAME "imager"
#define USER_APP_ID "90210"
#define USER_APP_KEY "2c309ca22fb1e67cc166ccc9dc261f4"
#define USER_DEVELOPER_ACCOUNT "735056338@qq.com"
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
#endif //APP_INFO_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -0,0 +1,563 @@
/**
********************************************************************
* @file main.c
* @version V2.0.0
* @date 2019/07/01
* @brief
*
* @copyright (c) 2018-2019 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 DJIs 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.
*
*********************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include <fcntl.h>
#include <stdio.h>
#include <time.h>
#include "errno.h"
#include <signal.h>
#include "psdk_logger.h"
#include "psdk_core.h"
#include "psdk_platform.h"
#include "osal/osal.h"
#include "utils/util_misc.h"
#include "hal/hal_uart.h"
#include "hal/hal_network.h"
#include "psdk_config.h"
#include "app_info.h"
#include "psdk_aircraft_info.h"
#include "camera_emu/test_payload_cam_emu.h"
#include "data_transmission/test_data_transmission.h"
#include "data_subscription/test_data_subscription.h"
#include "payload_collaboration/test_payload_collaboration.h"
#include "camera_media_emu/test_payload_cam_media.h"
#include "widget/test_widget.h"
#include "gimbal_emu/test_payload_gimbal_emu.h"
#include "psdk_data_channel.h"
#include "data_channel/test_data_channel.h"
#include "power_management/test_power_management.h"
#include "xport/test_xport.h"
#include "monitor/sys_monitor.h"
#include "psdk_product_info.h"
#include "mop_channel/test_mop_channel.h"
#include "upgrade/test_upgrade.h"
#include "upgrade_platform_opt/upgrade_platform_opt_linux.h"
#include <psdk_payload_camera.h>
/* Private constants ---------------------------------------------------------*/
#define PSDK_LOG_PATH "Logs/psdk_local"
#define PSDK_LOG_INDEX_FILE_NAME "Logs/latest"
#define PSDK_LOG_FOLDER_NAME "Logs"
#define PSDK_LOG_PATH_MAX_SIZE (128)
#define PSDK_LOG_FOLDER_NAME_MAX_SIZE (32)
/* Private types -------------------------------------------------------------*/
typedef struct {
pid_t tid;//linux进程号类型定义实际就是int
char name[16];
float pcpu;//
} T_ThreadAttribute;
/* Private functions declaration ---------------------------------------------*/
static T_PsdkReturnCode PsdkUser_FillInUserInfo(T_PsdkUserInfo *userInfo);//填写用户信息
static T_PsdkReturnCode PsdkUser_Console(const uint8_t *data, uint16_t dataLen);//位于结构体中的回调函数:将日志信息打印到控制台
static T_PsdkReturnCode PsdkUser_LocalWrite(const uint8_t *data, uint16_t dataLen);//位于结构体中的回调函数:将日志信息写入文件
static T_PsdkReturnCode PsdkUser_FileSystemInit(const char *path);//会打开日志文件将日志文件指针返回到s_psdkLogFile
static void *PsdkUser_MonitorTask(void *argument);
/* Exported functions definition ---------------------------------------------*/
static FILE *s_psdkLogFile;//函数PsdkUser_FileSystemInit中打开的日志文件指针
static FILE *s_psdkLogFileCnt;//函数PsdkUser_FileSystemInit中打开的一个文件,此文件用于记录日志文件个数
static pthread_t s_monitorThread = 0;//用于生成线程ID
/* Private functions definition-----------------------------------------------*/
static T_PsdkReturnCode PsdkUser_FillInUserInfo(T_PsdkUserInfo *userInfo)
{
//先清空结构体userInfo中的数据
memset(userInfo->appName, 0, sizeof(userInfo->appName));
memset(userInfo->appId, 0, sizeof(userInfo->appId));
memset(userInfo->appKey, 0, sizeof(userInfo->appKey));
memset(userInfo->developerAccount, 0, sizeof(userInfo->developerAccount));
//判断输入的用户信息是否合法
if (strlen(USER_APP_NAME) >= sizeof(userInfo->appName) ||
strlen(USER_APP_ID) > sizeof(userInfo->appId) ||
strlen(USER_APP_KEY) > sizeof(userInfo->appKey) ||
strlen(USER_DEVELOPER_ACCOUNT) >= sizeof(userInfo->developerAccount)) {
PsdkLogger_UserLogError("Length of user information string is beyond limit. Please check.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
if (!strcmp(USER_APP_NAME, "your_app_name") ||
!strcmp(USER_APP_ID, "your_app_id") ||
!strcmp(USER_APP_KEY, "your_app_key") ||
!strcmp(USER_DEVELOPER_ACCOUNT, "your_developer_account")) {
PsdkLogger_UserLogError("Please fill in correct user information to psdk_app_info.h file.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
//如果输入的用户信息合法就写入到结构体userInfo中。但是用两个函数(strncpy/memcpy)的目的是啥?????????????????????????????
strncpy(userInfo->appName, USER_APP_NAME, sizeof(userInfo->appName) - 1);
memcpy(userInfo->appId, USER_APP_ID, USER_UTIL_MIN(sizeof(userInfo->appId), strlen(USER_APP_ID)));
memcpy(userInfo->appKey, USER_APP_KEY, USER_UTIL_MIN(sizeof(userInfo->appKey), strlen(USER_APP_KEY)));
strncpy(userInfo->developerAccount, USER_DEVELOPER_ACCOUNT, sizeof(userInfo->developerAccount) - 1);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
static T_PsdkReturnCode PsdkUser_Console(const uint8_t *data, uint16_t dataLen)
{
USER_UTIL_UNUSED(dataLen);//
/*
* Warning: printf() is a blocking interface. If print speed is too low, PSDK will be blocked and many abnormal
* situations occur, such as initialization failure and payload disconnection. Users can raise corresponding
* console level to INFO or even higher to solve this problem.
*/
printf("%s", data);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
static T_PsdkReturnCode PsdkUser_LocalWrite(const uint8_t *data, uint16_t dataLen)
{
int32_t realLen;
if (s_psdkLogFile == NULL) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
realLen = fwrite(data, 1, dataLen, s_psdkLogFile);
fflush(s_psdkLogFile);//清空缓冲区
if (realLen == dataLen) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
} else {
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
}
static T_PsdkReturnCode PsdkUser_FileSystemInit(const char *path)
{
T_PsdkReturnCode psdkStat = PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
char filePath[PSDK_LOG_PATH_MAX_SIZE];
char folderName[PSDK_LOG_FOLDER_NAME_MAX_SIZE];
time_t currentTime = time(NULL);//time为内联函数
struct tm *localTime = localtime(&currentTime);//localtime为内联函数
uint16_t logFileIndex = 0;//存储日志文件个数
uint16_t currentLogFileIndex = 0;
uint8_t ret = 0;
if (localTime == NULL) {
printf("Get local time error.\r\n");
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
//创建日志文件夹
if (access(PSDK_LOG_FOLDER_NAME, F_OK) != 0) {
printf("Log file is not existed, need create new.\r\n");
sprintf(folderName, "mkdir %s", PSDK_LOG_FOLDER_NAME);
ret = system(folderName);
if (ret != 0) {
printf("Create new log folder error, ret:%d.\r\n", ret);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
}
//查询日志文件个数,并将结果写入到变量currentLogFileIndex中
s_psdkLogFileCnt = fopen(PSDK_LOG_INDEX_FILE_NAME, "rb+");
if (s_psdkLogFileCnt == NULL) {//如果没有就创建日志文件
s_psdkLogFileCnt = fopen(PSDK_LOG_INDEX_FILE_NAME, "wb+");
if (s_psdkLogFileCnt == NULL) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
} else {
ret = fseek(s_psdkLogFileCnt, 0, SEEK_SET);//文件指针归零
if (ret != 0) {
printf("Seek log count file error, ret: %d, errno: %d.\r\n", ret, errno);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
ret = fread((uint16_t *) &logFileIndex, 1, sizeof(uint16_t), s_psdkLogFileCnt);//读取日志文件中的数据
if (ret != sizeof(uint16_t)) {
printf("Read log file index error.\r\n");
}
}
printf("Get current log index: %d\r\n", logFileIndex);
currentLogFileIndex = logFileIndex;
logFileIndex++;
ret = fseek(s_psdkLogFileCnt, 0, SEEK_SET);//文件指针再次归零
if (ret != 0) {
printf("Seek log file error, ret: %d, errno: %d.\r\n", ret, errno);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
ret = fwrite((uint16_t *) &logFileIndex, 1, sizeof(uint16_t), s_psdkLogFileCnt);//更新日志文件个数
if (ret != sizeof(uint16_t)) {
printf("Write log file index error.\r\n");
fclose(s_psdkLogFileCnt);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
fclose(s_psdkLogFileCnt);
//创建日志文件
sprintf(filePath, "%s_%04d_%04d%02d%02d_%02d-%02d-%02d.log", path, currentLogFileIndex,
localTime->tm_year + 1900, localTime->tm_mon + 1, localTime->tm_mday,
localTime->tm_hour, localTime->tm_min, localTime->tm_sec);
s_psdkLogFile = fopen(filePath, "wb+");
if (s_psdkLogFile == NULL) {
PsdkLogger_UserLogWarn("Open filepath time error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return psdkStat;
}
static void PsdkUser_NormalExitHandler(int signalNum)
{
USER_UTIL_UNUSED(signalNum);
exit(0);
}
#pragma GCC diagnostic push//
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#pragma GCC diagnostic ignored "-Wreturn-type"
static void *PsdkUser_MonitorTask(void *argument)
{
unsigned int i = 0;
unsigned int threadCount = 0;//本进程线程个数
pid_t *tidList = NULL;//指线程id
T_ThreadAttribute *threadAttribute = NULL;
USER_UTIL_UNUSED(argument);//
while (1) {
threadCount = Monitor_GetThreadCountOfProcess(getpid());
//为tidList分配内存
tidList = PsdkOsal_Malloc(threadCount * sizeof(pid_t));
if (tidList == NULL) {
PsdkLogger_UserLogError("malloc fail.");
goto delay;
}
Monitor_GetTidListOfProcess(getpid(), tidList, threadCount);
//为threadAttribute分配内存
threadAttribute = PsdkOsal_Malloc(threadCount * sizeof(T_ThreadAttribute));
if (threadAttribute == NULL) {
PsdkLogger_UserLogError("malloc fail.");
goto freeTidList;
}
//向threadAttribute中填写线程id号
for (i = 0; i < threadCount; ++i) {
threadAttribute[i].tid = tidList[i];
}
//向threadAttribute中填写pcpu和线程name
PsdkLogger_UserLogDebug("thread pcpu:");//?????????????????????????????????????????????????????????????????????????????????
PsdkLogger_UserLogDebug("tid\tname\tpcpu");
for (i = 0; i < threadCount; ++i) {
threadAttribute[i].pcpu = Monitor_GetPcpuOfThread(getpid(), tidList[i]);
Monitor_GetNameOfThread(getpid(), tidList[i], threadAttribute[i].name, sizeof(threadAttribute[i].name));
PsdkLogger_UserLogDebug("%d\t%15s\t%f %%.", threadAttribute[i].tid, threadAttribute[i].name,
threadAttribute[i].pcpu);
}
PsdkLogger_UserLogDebug("heap used: %d B.", Monitor_GetHeapUsed(getpid()));
PsdkLogger_UserLogDebug("stack used: %d B.", Monitor_GetStackUsed(getpid()));
PsdkOsal_Free(threadAttribute);
freeTidList:
PsdkOsal_Free(tidList);
delay:
sleep(10);
}
}
#pragma GCC diagnostic pop
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#pragma GCC diagnostic ignored "-Wreturn-type"
int main(void)
{
T_PsdkUserInfo userInfo;
const T_PsdkDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportionOfHighspeedChannel =
{10, 60, 30};//dataStreamvideoStreamdownloadStream
T_PsdkLoggerConsole printConsole = {
.consoleLevel = PSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO,
.func = PsdkUser_Console,
};
T_PsdkLoggerConsole localRecordConsole = {
.consoleLevel = PSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO,
.func = PsdkUser_LocalWrite,
};
T_PsdkHalUartHandler halUartHandler = {
.UartInit = Hal_UartInit,
.UartReadData = Hal_UartReadData,
.UartWriteData = Hal_UartSendData,
};
T_PsdkHalNetWorkHandler halNetWorkHandler = {
.NetWorkConfig = HalNetWork_Config,
};
T_PsdkOsalHandler osalHandler = {
.Malloc = Osal_Malloc,
.Free = Osal_Free,
.TaskCreate = Osal_TaskCreate,
.TaskDestroy = Osal_TaskDestroy,
.TaskSleepMs = Osal_TaskSleepMs,
.MutexCreate = Osal_MutexCreate,
.MutexDestroy = Osal_MutexDestroy,
.MutexLock = Osal_MutexLock,
.MutexUnlock = Osal_MutexUnlock,
.SemaphoreCreate = Osal_SemaphoreCreate,
.SemaphoreDestroy = Osal_SemaphoreDestroy,
.SemaphoreWait = Osal_SemaphoreWait,
.SemaphorePost = Osal_SemaphorePost,
.SemaphoreTimedWait = Osal_SemaphoreTimedWait,
.GetTimeMs = Osal_GetTimeMs,
};
T_PsdkAircraftInfoBaseInfo aircraftBaseInfo = {0};
//https://developer.dji.com/cn/document/5c34a334-bde6-471b-88c6-f9f6f8f287a6
//通过注册Hal 层串口设备的函数,负载设备控制程序能够通过开发平台的串口与无人机通信,实现负载设备控制程序在不同硬件平台上的移植。
if (PsdkPlatform_RegHalUartHandler(&halUartHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk register hal uart handler error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//https://developer.dji.com/cn/document/5c34a334-bde6-471b-88c6-f9f6f8f287a6
//通过注册Hal 层网口函数,负载设备控制程序能够通过网口与无人机通信。
if (PsdkPlatform_RegHalNetworkHandler(&halNetWorkHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk register hal network handler error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//https://developer.dji.com/cn/document/5c34a334-bde6-471b-88c6-f9f6f8f287a6
//通过注册Osal 层的函数,负载设备控制程序能够访问不同操作系统的内核和资源,实现负载设备控制程序在不同操作系统上的移植。
if (PsdkPlatform_RegOsalHandler(&osalHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk register osal handler error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//logger打印到控制台
if (PsdkLogger_AddConsole(&printConsole) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk add console print error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//logger写入到文件1会打开日志文件将日志文件指针返回到s_psdkLogFile
if (PsdkUser_FileSystemInit(PSDK_LOG_PATH) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk file system init error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//logger写入到文件2注册写入函数到psdk中
if (PsdkLogger_AddConsole(&localRecordConsole) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk add console record error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//填写用户信息到变量userInfo中
if (PsdkUser_FillInUserInfo(&userInfo) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk fill in user info error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//初始化psdk,此函数的调用时机有要求
if (PsdkCore_Init(&userInfo) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk instance init error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//设置负载设备的别称
if (PsdkProductInfo_SetAlias("PSDK_APPALIAS") != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("set product alias error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//获取飞机信息
if (PsdkAircraftInfo_GetBaseInfo(&aircraftBaseInfo) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("get aircraft information error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
//通过宏来判断 是否初始化各种设备和功能;开始-----------------------------------------------------------------------------------------------------------------------------------------
PsdkLogger_UserLogInfo("通过宏来判断 是否初始化各种设备和功能;开始--------------------------------------------------------------------------------------------------------------------------");
//如果要申请高功率需要在执行PsdkTest_PowerManagementInit函数前先执行PsdkTest_RegApplyHighPowerHandler函数
#ifdef PSDK_USING_POWER_MANAGEMENT
PsdkLogger_UserLogInfo("使用电源模块--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_PowerManagementInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("power management init error");
}
#endif
//相机相关
#ifdef PSDK_USING_CAMERA_EMU
PsdkLogger_UserLogInfo("使用PSDK_USING_CAMERA_EMU--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_CameraInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk camera init error");
}
#endif
#ifdef PSDK_USING_CAMERA_MEDIA_EMU
#if PSDK_ARCH_SYS_LINUX
PsdkLogger_UserLogInfo("使用PSDK_USING_CAMERA_MEDIA_EMU--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_CameraMediaInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk camera media init error");
}
#endif
#endif
//数据传输Should call this function before sending data to mobile end/onboard computer or receiving data.
#ifdef PSDK_USING_DATA_TRANSMISSION
PsdkLogger_UserLogInfo("使用数据传输模块--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_DataTransmissionInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {//其中的用户自定义任务UserDataTransmission_Task,有点不懂机制????????????????????????????????????????????????
PsdkLogger_UserLogError("psdk data transmission init error");
}
#endif
//数据通道带宽设置3类数据通道dataStreamvideoStreamdownloadStream
#ifdef PSDK_USING_DATA_CHANNEL
PsdkLogger_UserLogInfo("设置数据通道带宽--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_DataChannelSetBandwidthProportionForHighspeedChannel(
bandwidthProportionOfHighspeedChannel) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("set bandwidth distribution for high-speed channel error");
}
#endif
//消息订阅
#ifdef PSDK_USING_DATA_SUBSCRIPTION
PsdkLogger_UserLogInfo("使用消息订阅--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_DataSubscriptionInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk data subscription init error");
}
#endif
//负载协同
#ifdef PSDK_USING_PAYLOAD_COLLABORATION
PsdkLogger_UserLogInfo("使用COLLABORATION--------------------------------------------------------------------------------------------------------------------------");
if (((aircraftBaseInfo.aircraftType == PSDK_AIRCRAFT_INFO_TYPE_M200_V2 ||
aircraftBaseInfo.aircraftType == PSDK_AIRCRAFT_INFO_TYPE_M210_V2 ||
aircraftBaseInfo.aircraftType == PSDK_AIRCRAFT_INFO_TYPE_M210RTK_V2) &&
aircraftBaseInfo.payloadMountPosition == PSDK_AIRCRAFT_INFO_PAYLOAD_MOUNT_POSITION_NO2) ||
aircraftBaseInfo.aircraftType == PSDK_AIRCRAFT_INFO_TYPE_M300_RTK) {
if (PsdkTest_PayloadCollaborationInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk payload collaboration init error");
}
}
#endif
//使用UI
#ifdef PSDK_USING_WIDGET
PsdkLogger_UserLogInfo("使用WIDGET--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_WidgetInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk widget init error");
}
#endif
//云台相关1、判断是否为天空端SKYPORT_V2
#ifdef PSDK_USING_GIMBAL_EMU
PsdkLogger_UserLogInfo("判断是否为天空端SKYPORT_V2--------------------------------------------------------------------------------------------------------------------------");
if (aircraftBaseInfo.psdkAdapterType == PSDK_AIRCRAFT_INFO_PSDK_ADAPTER_TYPE_SKYPORT_V2) {
if (PsdkTest_GimbalInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk gimbal init error");
}
}
#endif
//云台相关2、判断是否为xport
#ifdef PSDK_USING_XPORT
PsdkLogger_UserLogDebug("使用xport--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
if (aircraftBaseInfo.psdkAdapterType == PSDK_AIRCRAFT_INFO_PSDK_ADAPTER_TYPE_XPORT) {
if (PsdkTest_XPortInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk XPort init error");
}
}
#endif
#ifdef PSDK_USING_UPGRADE
PsdkLogger_UserLogInfo("使用PSDK_USING_UPGRADE--------------------------------------------------------------------------------------------------------------------------");
T_PsdkTestUpgradePlatformOpt linuxUpgradePlatformOpt = {
.rebootSystem = PsdkUpgradePlatformLinux_RebootSystem,
.cleanUpgradeProgramFileStoreArea = PsdkUpgradePlatformLinux_CleanUpgradeProgramFileStoreArea,
.createUpgradeProgramFile = PsdkUpgradePlatformLinux_CreateUpgradeProgramFile,
.writeUpgradeProgramFile = PsdkUpgradePlatformLinux_WriteUpgradeProgramFile,
.readUpgradeProgramFile = PsdkUpgradePlatformLinux_ReadUpgradeProgramFile,
.closeUpgradeProgramFile = PsdkUpgradePlatformLinux_CloseUpgradeProgramFile,
.replaceOldProgram = PsdkUpgradePlatformLinux_ReplaceOldProgram,
.setUpgradeRebootState = PsdkUpgradePlatformLinux_SetUpgradeRebootState,
.getUpgradeRebootState = PsdkUpgradePlatformLinux_GetUpgradeRebootState,
.cleanUpgradeRebootState = PsdkUpgradePlatformLinux_CleanUpgradeRebootState,
};
if (PsdkTest_UpgradeInit(&linuxUpgradePlatformOpt) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk upgrade init error");
}
#endif
#ifdef PSDK_USING_MOP_CHANNEL
PsdkLogger_UserLogInfo("使用PSDK_USING_MOP_CHANNEL--------------------------------------------------------------------------------------------------------------------------");
if (PsdkTest_MopChannelInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk mop channel init error");
}
#endif
//通过宏来判断 是否初始化各种设备和功能;结束---------------------------------------------------------------------------------------------
PsdkLogger_UserLogInfo("通过宏来判断 是否初始化各种设备和功能;结束--------------------------------------------------------------------------------------------------------------------------");
//创建并执行一个监控线程
if (pthread_create(&s_monitorThread, NULL, PsdkUser_MonitorTask, NULL) != 0) {
PsdkLogger_UserLogError("create monitor task fail.");
}
if (pthread_setname_np(s_monitorThread, "monitor task") != 0) {
PsdkLogger_UserLogError("set name for monitor task fail.");
}
//启动负载设备控制程序 ,如果没有这些代码 → 移动端的APP 将无法正常控制负载设备;
if (PsdkCore_ApplicationStart() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("psdk application start error");
}
signal(SIGTERM, PsdkUser_NormalExitHandler);
PsdkLogger_UserLogInfo("进入无限循环--------------------------------------------------------------------------------------------------------------------------");
while (1) {
sleep(1);
}
}
#pragma GCC diagnostic pop
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/

View File

@ -0,0 +1,75 @@
/**
********************************************************************
* @file psdk_config.h
* @version V2.0.0
* @date 2019/9/11
* @brief This is the header file for "psdk_config.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2018-2019 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 DJIs 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 PSDK_CONFIG_H
#define PSDK_CONFIG_H
/* Includes ------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
#define PSDK_USING_POWER_MANAGEMENT
#define PSDK_USING_CAMERA_EMU
#define PSDK_USING_CAMERA_MEDIA_EMU//相机类负载设备的下载回放功能
#define PSDK_USING_DATA_TRANSMISSION
#define PSDK_USING_DATA_CHANNEL
#define PSDK_USING_DATA_SUBSCRIPTION
#define PSDK_USING_PAYLOAD_COLLABORATION//负载协同
#define PSDK_USING_WIDGET
#define PSDK_USING_GIMBAL_EMU
#define PSDK_USING_XPORT
#define PSDK_USING_UPGRADE
/*!< Attention: This function needs to be used together with OSDK/MSDK mop sample.
* */
//#define PSDK_USING_MOP_CHANNEL
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
#endif // PSDK_CONFIG_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -0,0 +1,90 @@
/**
********************************************************************
* @file hal_network.c
* @version V2.0.0
* @date 3/27/20
* @brief
*
* @copyright (c) 2018-2019 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 DJIs 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.
*
*********************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "string.h"
#include "stdlib.h"
#include "stdio.h"
#include "hal_network.h"
#include "psdk_logger.h"
/* Private constants ---------------------------------------------------------*/
#define LINUX_NETWORK_DEV "eth0"//enx00e04c360a7d
#define LINUX_CMD_STR_MAX_SIZE (128)
/* Private types -------------------------------------------------------------*/
/* Private values -------------------------------------------------------------*/
/* Private functions declaration ---------------------------------------------*/
/* Exported functions definition ---------------------------------------------*/
T_PsdkReturnCode HalNetWork_Config(const char *ipAddr, const char *netMask)
{
int32_t ret;
char cmdStr[LINUX_CMD_STR_MAX_SIZE];
if (ipAddr == NULL || netMask == NULL) {
PsdkLogger_UserLogError("hal network config param error");
return PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
//Attention: need root permission to config ip addr and netmask.
memset(cmdStr, 0, sizeof(cmdStr));
snprintf(cmdStr, sizeof(cmdStr), "ifconfig | grep %s", LINUX_NETWORK_DEV);
ret = system(cmdStr);
if (ret != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("Can't find the network device. "
"Probably the name of network device is not match or device is not properly initialized. "
"Please check the name or status of network device. ");
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
snprintf(cmdStr, sizeof(cmdStr), "ifconfig %s up", LINUX_NETWORK_DEV);
ret = system(cmdStr);
if (ret != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("Can't open the network. "
"Probably the program not execute with root permission. "
"Please use the root permission to execute the program. ");
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
snprintf(cmdStr, sizeof(cmdStr), "ifconfig %s %s netmask %s", LINUX_NETWORK_DEV, ipAddr, netMask);
ret = system(cmdStr);
if (ret != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("Can't config the ip address of network. "
"Probably the program not execute with root permission. "
"Please use the root permission to execute the program. ");
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/* Private functions definition-----------------------------------------------*/
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/

View File

@ -0,0 +1,52 @@
/**
********************************************************************
* @file hal_network.h
* @version V2.0.0
* @date 3/27/20
* @brief This is the header file for "hal_network.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2018-2019 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 DJIs 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 HAL_NETWORK_H
#define HAL_NETWORK_H
/* Includes ------------------------------------------------------------------*/
#include "psdk_typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
T_PsdkReturnCode HalNetWork_Config(const char *ipAddr, const char *netMask);
#ifdef __cplusplus
}
#endif
#endif // HAL_NETWORK_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -0,0 +1,139 @@
/**
********************************************************************
* @file psdk_hal.c
* @version V2.0.0
* @date 2019/07/01
* @brief
*
* @copyright (c) 2018-2019 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 DJIs 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.
*
*********************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "hal_uart.h"
/* Private constants ---------------------------------------------------------*/
#define LINUX_UART_DEV "/dev/ttyUSB0"///dev/dji_serial_port
/* Private types -------------------------------------------------------------*/
static int s_psdkUartFd = -1;
/* Private functions declaration ---------------------------------------------*/
/* Exported functions definition ---------------------------------------------*/
T_PsdkReturnCode Hal_UartInit(void)
{
struct termios options;
struct flock lock;
T_PsdkReturnCode returnCode = PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
s_psdkUartFd = open(LINUX_UART_DEV, O_RDWR | O_NOCTTY | O_NDELAY);
if (s_psdkUartFd == -1) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
// Forbid multiple psdk programs to access the serial port
lock.l_type = F_WRLCK;
lock.l_pid = getpid();
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
if (fcntl(s_psdkUartFd, F_GETLK, &lock) < 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
if (lock.l_type != F_UNLCK) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
lock.l_type = F_WRLCK;
lock.l_pid = getpid();
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
if (fcntl(s_psdkUartFd, F_SETLKW, &lock) < 0) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
if (tcgetattr(s_psdkUartFd, &options) != 0) {
close(s_psdkUartFd);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
cfsetispeed(&options, B460800);
cfsetospeed(&options, B460800);
options.c_cflag |= CLOCAL;
options.c_cflag |= CREAD;
options.c_cflag &= ~CRTSCTS;
options.c_cflag &= ~CSIZE;
options.c_cflag |= CS8;
options.c_cflag &= ~PARENB;
options.c_iflag &= ~INPCK;
options.c_cflag &= ~CSTOPB;
options.c_oflag &= ~OPOST;
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
options.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
options.c_cc[VTIME] = 0;
options.c_cc[VMIN] = 0;
tcflush(s_psdkUartFd, TCIFLUSH);
if (tcsetattr(s_psdkUartFd, TCSANOW, &options) != 0) {
close(s_psdkUartFd);
return PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return returnCode;
}
T_PsdkReturnCode Hal_UartSendData(const uint8_t *pBuf, uint16_t bufLen)
{
int32_t realLen;
if (s_psdkUartFd == -1) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
realLen = write(s_psdkUartFd, pBuf, bufLen);
if (realLen == bufLen) {
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
} else {
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
}
T_PsdkReturnCode Hal_UartReadData(uint8_t *pBuf, uint16_t bufLen, uint16_t *realBufLen)
{
int result;
T_PsdkReturnCode returnCode;
result = read(s_psdkUartFd, pBuf, bufLen);
if (result >= 0) {
*realBufLen = result;
returnCode = PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
} else {
*realBufLen = 0;
returnCode = PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
return returnCode;
}
/* Private functions definition-----------------------------------------------*/
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/

View File

@ -0,0 +1,62 @@
/**
********************************************************************
* @file hal.h
* @version V2.0.0
* @date 2019/8/28
* @brief This is the header file for "hal.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2018-2019 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 DJIs 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 HAL_H
#define HAL_H
/* Includes ------------------------------------------------------------------*/
#include "stdint.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <string.h>
#include "psdk_platform.h"
#include "psdk_typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
T_PsdkReturnCode Hal_UartInit(void);
T_PsdkReturnCode Hal_UartSendData(const uint8_t *pBuf, uint16_t bufLen);
T_PsdkReturnCode Hal_UartReadData(uint8_t *pBuf, uint16_t bufLen, uint16_t *realBufLen);
#ifdef __cplusplus
}
#endif
#endif // HAL_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 2.8)
project(psdk_demo C)
### Set toolchain flags
set(CMAKE_C_FLAGS "-D_REENTRANT -std=gnu99")
set(CMAKE_EXE_LINKER_FLAGS "-pthread -lpthread")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
set(PSDK_ARCH_SYS linux)
include_directories(..)
include_directories(../../common)
include_directories(../../../../api_sample)
include_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/api_headers)
#include_directories(/home/iris-xport/projects/ellipse_n_sdk/SoftwareDevelopment/sbgECom/common/)
#include_directories(/home/iris-xport/projects/ellipse_n_sdk/SoftwareDevelopment/sbgECom/src)
#include_directories(/home/iris-xport/projects/ximea)
include_directories(/home/rock/ffmpeg_build/include)
#include_directories(/usr/local/include)
#include_directories(/home/rock/ffmpeg_build)
## Srcs
file(GLOB_RECURSE APP_SRC ../../manifold2/application/*.c
../../manifold2/hal/*.c)
file(GLOB_RECURSE COMMON_SRC ../../common/*.c)
file(GLOB_RECURSE SAMPLE_SRC ../../../../api_sample/*.c)
## "uname -m" to auto distinguish Manifold2-G or Manifold2-C
execute_process(COMMAND uname -m
OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
if (NOT PSDK_ARCH_SYS)
message(FATAL_ERROR
"to use psdk inc src cmake ,
you must set <PSDK_ARCH_SYS> value to indicate your system arch!
This value can be linux, baremetal or rtos_xxxx (xxxx is the specific name of rtos."
)
endif ()
string(TOUPPER ${PSDK_ARCH_SYS} PSDK_ARCH_SYS_DEF)
add_definitions(-DPSDK_ARCH_SYS_${PSDK_ARCH_SYS_DEF}=1)
add_definitions(-D_GNU_SOURCE)
## Include directories and library
if (DEVICE_SYSTEM_ID MATCHES x86_64)
link_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/x86_64-linux-gnu-gcc)
link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/x86_64-linux-gnu-gcc/libpayloadsdk.a)
link_libraries(/home/rock/ffmpeg_build/lib)
# link_libraries(/usr/local/lib)
#link_libraries(/home/iris-xport/projects/ellipse_n_sdk/SoftwareDevelopment/sbgECom/bin/libsbgECom.a)
# link_libraries(/home/iris-xport/projects/ximea/libximea.a)
# link_libraries(/home/iris-xport/projects/ximea/libximeaWrapper.a)
elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
link_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/aarch64-linux-gnu-gcc)
link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/aarch64-linux-gnu-gcc/libpayloadsdk.a)
link_directories(/home/rock/ffmpeg_build/lib)
#link_libraries(/home/rock/ffmpeg_build/lib)
endif ()
## Outputs
add_executable(${CMAKE_PROJECT_NAME}
${APP_SRC}
${COMMON_SRC}
${SAMPLE_SRC}
)
#target_link_libraries(${CMAKE_PROJECT_NAME} m)
target_link_libraries(${CMAKE_PROJECT_NAME}
avformat
avfilter
avcodec
swscale
avutil
swresample
avdevice
avutil
postproc
z
m
pthread
)

View File

@ -0,0 +1,37 @@
#test -e build/ || mkdir build
#echo "mkdir build/\n"
echo "\nCompile ximea record program "
cd /home/iris-xport/projects/ximea
g++ -c ximea.cpp -lstdc++ -lm3api
ar -r libximea.a ximea.o
g++ -c ximeaWrapper.cpp -lstdc++
ar -r libximeaWrapper.a ximea.o ximeaWrapper.o
cd /home/iris-xport/projects/Payload_SDK_V2.2.1
echo "\nThe current dirctory is "
pwd
cd sample/platform/linux/manifold2/project
if [ ! -e build ]; then
mkdir build
echo "\ndirctory: build do not exit! making dirctory: build\n"
else
echo "\ndirctory: build exit!\n"
fi
cd build/
echo "\n执行cmake命令-------------------------------------------------------------\n"
cmake ..
echo "\n执行make命令--------------------------------------------------------------\n"
make

View File

@ -0,0 +1,292 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="psdk_demo"/>
<Option makefile_is_custom="1"/>
<Option compiler="gcc"/>
<Option virtualFolders="CMake Files\;"/>
<Build>
<Target title="all">
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 all"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="rebuild_cache">
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 rebuild_cache"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="edit_cache">
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 edit_cache"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="psdk_demo">
<Option output="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/psdk_demo" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add option="-DPSDK_ARCH_SYS_LINUX=1"/>
<Add option="-D_GNU_SOURCE"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/.."/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../common"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../api_sample"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../../psdk_lib/api_headers"/>
<Add directory="/home/rock/ffmpeg_build/include"/>
<Add directory="/usr/lib/gcc/aarch64-linux-gnu/9/include"/>
<Add directory="/usr/local/include"/>
<Add directory="/usr/include/aarch64-linux-gnu"/>
<Add directory="/usr/include"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 psdk_demo"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="psdk_demo/fast">
<Option output="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/psdk_demo" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add option="-DPSDK_ARCH_SYS_LINUX=1"/>
<Add option="-D_GNU_SOURCE"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/.."/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../common"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../api_sample"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../../psdk_lib/api_headers"/>
<Add directory="/home/rock/ffmpeg_build/include"/>
<Add directory="/usr/lib/gcc/aarch64-linux-gnu/9/include"/>
<Add directory="/usr/local/include"/>
<Add directory="/usr/include/aarch64-linux-gnu"/>
<Add directory="/usr/include"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 psdk_demo/fast"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_emu/test_payload_cam_emu.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_emu/test_payload_cam_emu.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/ffmpeg_tc.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/ffmpeg_tc.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_core.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_core.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_jpg.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_jpg.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_mp4.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_mp4.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/test_payload_cam_media.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/test_payload_cam_media.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_channel/test_data_channel.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_channel/test_data_channel.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_subscription/test_data_subscription.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_subscription/test_data_subscription.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_transmission/test_data_transmission.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_transmission/test_data_transmission.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/gimbal_emu/test_payload_gimbal_emu.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/gimbal_emu/test_payload_gimbal_emu.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/mop_channel/test_mop_channel.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/mop_channel/test_mop_channel.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/payload_collaboration/test_payload_collaboration.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/payload_collaboration/test_payload_collaboration.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/positioning/test_positioning.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/positioning/test_positioning.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/power_management/test_power_management.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/power_management/test_power_management.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/time_synchronization/test_time_sync.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/time_synchronization/test_time_sync.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_common_file_transfer.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_common_file_transfer.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_platform_opt.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_platform_opt.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_buffer.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_buffer.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_file.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_file.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_math.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_math.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_md5.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_md5.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_misc.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_misc.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_time.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_time.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/file_binary_array_list_en.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/file_binary_array_list_en.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/test_widget.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/test_widget.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/xport/test_xport.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/xport/test_xport.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/monitor/sys_monitor.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/monitor/sys_monitor.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/osal/osal.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/osal/osal.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/upgrade_platform_opt/upgrade_platform_opt_linux.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/upgrade_platform_opt/upgrade_platform_opt_linux.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/application/main.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_network.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_network.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_uart.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_uart.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View File

@ -0,0 +1,292 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="psdk_demo"/>
<Option makefile_is_custom="1"/>
<Option compiler="gcc"/>
<Option virtualFolders="CMake Files\;"/>
<Build>
<Target title="all">
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 all"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="rebuild_cache">
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 rebuild_cache"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="edit_cache">
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 edit_cache"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="psdk_demo">
<Option output="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/psdk_demo" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add option="-DPSDK_ARCH_SYS_LINUX=1"/>
<Add option="-D_GNU_SOURCE"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/.."/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../common"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../api_sample"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../../psdk_lib/api_headers"/>
<Add directory="/home/rock/ffmpeg_build/include"/>
<Add directory="/usr/lib/gcc/aarch64-linux-gnu/9/include"/>
<Add directory="/usr/local/include"/>
<Add directory="/usr/include/aarch64-linux-gnu"/>
<Add directory="/usr/include"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 psdk_demo"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="psdk_demo/fast">
<Option output="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/psdk_demo" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add option="-DPSDK_ARCH_SYS_LINUX=1"/>
<Add option="-D_GNU_SOURCE"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/.."/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../common"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../api_sample"/>
<Add directory="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/../../../../../psdk_lib/api_headers"/>
<Add directory="/home/rock/ffmpeg_build/include"/>
<Add directory="/usr/lib/gcc/aarch64-linux-gnu/9/include"/>
<Add directory="/usr/local/include"/>
<Add directory="/usr/include/aarch64-linux-gnu"/>
<Add directory="/usr/include"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 psdk_demo/fast"/>
<CompileFile command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j6 -f &quot;/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/hahahah/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_emu/test_payload_cam_emu.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_emu/test_payload_cam_emu.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/ffmpeg_tc.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/ffmpeg_tc.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_core.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_core.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_jpg.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_jpg.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_mp4.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/psdk_media_file_manage/psdk_media_file_mp4.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/test_payload_cam_media.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/camera_media_emu/test_payload_cam_media.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_channel/test_data_channel.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_channel/test_data_channel.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_subscription/test_data_subscription.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_subscription/test_data_subscription.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_transmission/test_data_transmission.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/data_transmission/test_data_transmission.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/gimbal_emu/test_payload_gimbal_emu.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/gimbal_emu/test_payload_gimbal_emu.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/mop_channel/test_mop_channel.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/mop_channel/test_mop_channel.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/payload_collaboration/test_payload_collaboration.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/payload_collaboration/test_payload_collaboration.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/positioning/test_positioning.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/positioning/test_positioning.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/power_management/test_power_management.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/power_management/test_power_management.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/time_synchronization/test_time_sync.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/time_synchronization/test_time_sync.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_common_file_transfer.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_common_file_transfer.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_platform_opt.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/upgrade/test_upgrade_platform_opt.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_buffer.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_buffer.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_file.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_file.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_math.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_math.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_md5.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_md5.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_misc.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_misc.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_time.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/utils/util_time.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/file_binary_array_list_en.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/file_binary_array_list_en.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/test_widget.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/widget/test_widget.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/xport/test_xport.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/api_sample/xport/test_xport.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/monitor/sys_monitor.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/monitor/sys_monitor.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/osal/osal.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/osal/osal.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/upgrade_platform_opt/upgrade_platform_opt_linux.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/common/upgrade_platform_opt/upgrade_platform_opt_linux.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/application/main.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_network.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_network.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_uart.c">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/hal/hal_uart.h">
<Option target="psdk_demo"/>
</Unit>
<Unit filename="/home/rock/tc_projects/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
</Project>
</CodeBlocks_project_file>