NEW: release DJI Payload-SDK version 3.8.1
This commit is contained in:
@ -45,6 +45,7 @@
|
||||
#define TEST_CAMERA_MOP_CHANNEL_WAIT_TIME_MS (3 * 1000)
|
||||
#define TEST_CAMERA_MOP_CHANNEL_MAX_RECV_COUNT 30
|
||||
#define TEST_CAMEAR_POINT_CLOUD_FILE_PATH_STR_MAX_SIZE 256
|
||||
#define TEST_CAMEAR_MEDIA_SUB_FILE_NOT_FOUND -1
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
@ -625,80 +626,6 @@ T_DjiReturnCode DjiTest_CameraManagerStartShootBurstPhoto(E_DjiMountPosition pos
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
/*! @brief Sample to shoot AEB photo, using async api
|
||||
*
|
||||
* @note In this interface, camera will be set to be the SHOOT_PHOTO mode
|
||||
* then start to shoot a AEB photo.
|
||||
* @param index payload node index, input limit see enum
|
||||
* DJI::OSDK::PayloadIndexType
|
||||
* @param photoNum The number of pictures in each AEB shooting
|
||||
* @return T_DjiReturnCode error code
|
||||
*/
|
||||
T_DjiReturnCode DjiTest_CameraManagerStartShootAEBPhoto(E_DjiMountPosition position,
|
||||
E_DjiCameraManagerPhotoAEBCount aebCount)
|
||||
{
|
||||
T_DjiReturnCode returnCode;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
E_DjiCameraManagerWorkMode workMode;
|
||||
|
||||
/*!< set camera work mode as shoot photo */
|
||||
USER_LOG_INFO("set mounted position %d camera's work mode as shoot photo mode.", position);
|
||||
returnCode = DjiCameraManager_SetMode(position, DJI_CAMERA_MANAGER_WORK_MODE_SHOOT_PHOTO);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS &&
|
||||
returnCode != DJI_ERROR_CAMERA_MANAGER_MODULE_CODE_UNSUPPORTED_COMMAND) {
|
||||
USER_LOG_ERROR("set mounted position %d camera's work mode as shoot photo mode failed,"
|
||||
" error code :0x%08X.", position, returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
osalHandler->TaskSleepMs(1000);
|
||||
|
||||
returnCode = DjiCameraManager_GetMode(position, &workMode);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS &&
|
||||
returnCode != DJI_ERROR_CAMERA_MANAGER_MODULE_CODE_UNSUPPORTED_COMMAND) {
|
||||
USER_LOG_ERROR("get mounted position %d camera's work mode failed,"
|
||||
" error code :0x%08X", position, returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
USER_LOG_INFO("Camera current workmode is %d", workMode);
|
||||
|
||||
/*!< set shoot-photo mode */
|
||||
USER_LOG_INFO("Set mounted position %d camera's shoot photo mode as AEB-photo mode", position);
|
||||
returnCode = DjiCameraManager_SetShootPhotoMode(position, DJI_CAMERA_MANAGER_SHOOT_PHOTO_MODE_AEB);
|
||||
if (returnCode == DJI_ERROR_CAMERA_MANAGER_MODULE_CODE_UNSUPPORTED_COMMAND) {
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("set mounted position %d camera's shoot photo mode as AEB-photo mode failed,"
|
||||
" error code :0x%08X.", position, returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
/*! wait the APP change the shoot-photo mode display */
|
||||
USER_LOG_INFO("Sleep 0.5s...");
|
||||
osalHandler->TaskSleepMs(500);
|
||||
|
||||
/*!< set shoot-photo mode parameter */
|
||||
USER_LOG_INFO("Set mounted position %d camera's AEB count to %d", position, aebCount);
|
||||
returnCode = DjiCameraManager_SetPhotoAEBCount(position, aebCount);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS &&
|
||||
returnCode != DJI_ERROR_CAMERA_MANAGER_MODULE_CODE_UNSUPPORTED_COMMAND) {
|
||||
USER_LOG_ERROR("set mounted position %d camera's AEB count(%d) failed,"
|
||||
" error code :0x%08X.", position, aebCount, returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
/*!< start to shoot single photo */
|
||||
USER_LOG_INFO("Mounted position %d camera start to shoot photo.", position);
|
||||
returnCode = DjiCameraManager_StartShootPhoto(position, DJI_CAMERA_MANAGER_SHOOT_PHOTO_MODE_AEB);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Mounted position %d camera shoot photo failed, "
|
||||
"error code :0x%08X.", position, returnCode);
|
||||
}
|
||||
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
/*! @brief Sample to start shooting interval photo, using async api
|
||||
*
|
||||
* @note In this interface, camera will be set to be the SHOOT_PHOTO mode
|
||||
@ -1135,17 +1062,6 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOOT_AEB_PHOTO: {
|
||||
USER_LOG_INFO("--> Function i: Shoot AEB photo with 3 pictures in one time");
|
||||
DjiTest_WidgetLogAppend("--> Function i: Shoot AEB photo with 3 pictures in one time");
|
||||
returnCode = DjiTest_CameraManagerStartShootAEBPhoto(mountPosition, DJI_CAMERA_MANAGER_PHOTO_AEB_COUNT_3);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Mounted position %d camera shoot AEB photo failed,"
|
||||
"error code: 0x%08X\r\n", mountPosition, returnCode);
|
||||
goto exitCameraModule;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOOT_BURST_PHOTO: {
|
||||
USER_LOG_INFO("--> Function j: Shoot Burst photo with 5 pictures in one time");
|
||||
DjiTest_WidgetLogAppend("--> Function j: Shoot Burst photo with 5pictures in one time");
|
||||
@ -1487,12 +1403,6 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
case E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOW_STORAGE_INFO: {
|
||||
T_DjiCameraManagerStorageInfo storageInfo;
|
||||
|
||||
if (cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_P1 ||
|
||||
cameraType == DJI_CAMERA_TYPE_M3D || cameraType == DJI_CAMERA_TYPE_M3TD) {
|
||||
USER_LOG_INFO("Position %d, camera type %d, doesn't support get storage info. Sample exits.");
|
||||
goto exitCameraModule;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < 30; i++) {
|
||||
returnCode = DjiCameraManager_GetStorageInfo(mountPosition, &storageInfo);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -1775,7 +1685,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
returnCode = DjiCameraManager_GetPhotoFormatStorageRange(mountPosition, &photoFormatRange);
|
||||
returnCode = DjiCameraManager_GetPhotoStorageFormatRange(mountPosition, &photoFormatRange);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Get range failed!");
|
||||
goto exitCameraModule;
|
||||
@ -2102,8 +2012,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
uint16_t recordingTime;
|
||||
uint8_t remainingTime;
|
||||
|
||||
if (cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_P1 ||
|
||||
cameraType == DJI_CAMERA_TYPE_M3D || cameraType == DJI_CAMERA_TYPE_M3TD) {
|
||||
if (cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_P1) {
|
||||
USER_LOG_INFO("Camera type %d does not support to get camera stauts such as "
|
||||
"capturing state, recording state.", cameraType);
|
||||
goto exitCameraModule;
|
||||
@ -2192,6 +2101,8 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadAndDeleteMediaFile(E_Dj
|
||||
T_DjiReturnCode returnCode;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
uint16_t downloadCount = 0;
|
||||
uint16_t subFileDownloadCount = 0;
|
||||
int i = 0, j= 0;
|
||||
|
||||
s_nextDownloadFileIndex = 0;
|
||||
returnCode = DjiCameraManager_RegDownloadFileDataCallback(position, DjiTest_CameraManagerDownloadFileDataCallback);
|
||||
@ -2213,11 +2124,13 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadAndDeleteMediaFile(E_Dj
|
||||
|
||||
if (s_meidaFileList.totalCount > 0) {
|
||||
downloadCount = s_meidaFileList.totalCount;
|
||||
subFileDownloadCount = s_meidaFileList.fileListInfo->subFileListTotalNum;
|
||||
printf(
|
||||
"\033[1;33;40m -> Download file list finished, total file count is %d, the following %d is list details: \033[0m\r\n",
|
||||
"\033[1;33;40m -> Download file list finished, total media file count is %d "
|
||||
"the following %d is list details: \033[0m\r\n",
|
||||
s_meidaFileList.totalCount, downloadCount);
|
||||
for (int i = 0; i < downloadCount; ++i) {
|
||||
if (s_meidaFileList.fileListInfo[i].fileSize < 1 * 1024 * 1024) {
|
||||
|
||||
for (i = 0; i < downloadCount; ++i) {
|
||||
printf(
|
||||
"\033[1;32;40m ### Media file_%03d name: %s, index: %d, time:%04d-%02d-%02d_%02d:%02d:%02d, size: %.2f KB, type: %d \033[0m\r\n",
|
||||
i, s_meidaFileList.fileListInfo[i].fileName,
|
||||
@ -2228,21 +2141,23 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadAndDeleteMediaFile(E_Dj
|
||||
s_meidaFileList.fileListInfo[i].createTime.hour,
|
||||
s_meidaFileList.fileListInfo[i].createTime.minute,
|
||||
s_meidaFileList.fileListInfo[i].createTime.second,
|
||||
(dji_f32_t) s_meidaFileList.fileListInfo[i].fileSize / 1024,
|
||||
s_meidaFileList.fileListInfo[i].type);
|
||||
} else {
|
||||
printf(
|
||||
"\033[1;32;40m ### Media file_%03d name: %s, index: %d, time:%04d-%02d-%02d_%02d:%02d:%02d, size: %.2f MB, type: %d \033[0m\r\n",
|
||||
i, s_meidaFileList.fileListInfo[i].fileName,
|
||||
s_meidaFileList.fileListInfo[i].fileIndex,
|
||||
s_meidaFileList.fileListInfo[i].createTime.year,
|
||||
s_meidaFileList.fileListInfo[i].createTime.month,
|
||||
s_meidaFileList.fileListInfo[i].createTime.day,
|
||||
s_meidaFileList.fileListInfo[i].createTime.hour,
|
||||
s_meidaFileList.fileListInfo[i].createTime.minute,
|
||||
s_meidaFileList.fileListInfo[i].createTime.second,
|
||||
(dji_f32_t) s_meidaFileList.fileListInfo[i].fileSize / (1024 * 1024),
|
||||
(dji_f32_t) s_meidaFileList.fileListInfo[i].fileSize / (1024),
|
||||
s_meidaFileList.fileListInfo[i].type);
|
||||
if (s_meidaFileList.fileListInfo[i].type == DJI_CAMERA_FILE_TYPE_LDRT) {
|
||||
for (j = 0; j < s_meidaFileList.fileListInfo[i].subFileListTotalNum; j++) {
|
||||
printf(
|
||||
"\033[1;32;40m ### Media file_%03d, sub_file_%03d, name: %s, index: %d, time:%04d-%02d-%02d_%02d:%02d:%02d, size: %.2f KB, sub type: %d\033[0m\r\n",
|
||||
i, j, s_meidaFileList.fileListInfo[i].subFileListInfo[j].fileName,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].fileIndex,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].createTime.year,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].createTime.month,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].createTime.day,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].createTime.hour,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].createTime.minute,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].createTime.second,
|
||||
(dji_f32_t) s_meidaFileList.fileListInfo[i].subFileListInfo[j].fileSize / (1024),
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].type);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("\r\n");
|
||||
@ -2251,24 +2166,38 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadAndDeleteMediaFile(E_Dj
|
||||
|
||||
downloadCount = s_meidaFileList.totalCount;
|
||||
|
||||
for (int i = 0; i < downloadCount; ++i) {
|
||||
redownload:
|
||||
for (i = 0; i < downloadCount; ++i) {
|
||||
redownload:
|
||||
if (i != s_nextDownloadFileIndex) {
|
||||
i = s_nextDownloadFileIndex;
|
||||
}
|
||||
|
||||
returnCode = DjiCameraManager_DownloadFileByIndex(position, s_meidaFileList.fileListInfo[i].fileIndex);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Download media file by index failed, error code: 0x%08X.", returnCode);
|
||||
s_nextDownloadFileIndex--;
|
||||
goto redownload;
|
||||
}
|
||||
if (s_meidaFileList.fileListInfo[i].type == DJI_CAMERA_FILE_TYPE_LDRT) {
|
||||
for (j = 0; j < s_meidaFileList.fileListInfo[i].subFileListTotalNum; j++) {
|
||||
subFileRedownload:
|
||||
returnCode = DjiCameraManager_DownloadSubFileByIndexAndSubType(position,
|
||||
s_meidaFileList.fileListInfo[i].fileIndex,
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].type);
|
||||
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Download sub media file by index and type failed, error code: 0x%08X.", returnCode);
|
||||
goto subFileRedownload;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
returnCode = DjiCameraManager_DeleteFileByIndex(position, s_meidaFileList.fileListInfo[0].fileIndex);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Delete media file by index failed, error code: 0x%08X.", returnCode);
|
||||
return returnCode;
|
||||
if (s_meidaFileList.fileListInfo[0].type == DJI_CAMERA_FILE_TYPE_JPEG) {
|
||||
returnCode = DjiCameraManager_DeleteFileByIndex(position, s_meidaFileList.fileListInfo[0].fileIndex);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Delete media file by index failed, error code: 0x%08X.", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
}
|
||||
|
||||
osalHandler->TaskSleepMs(1000);
|
||||
@ -2368,23 +2297,45 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadFileListBySlices(E_DjiM
|
||||
static T_DjiReturnCode DjiTest_CameraManagerDownloadFileDataCallback(T_DjiDownloadFilePacketInfo packetInfo,
|
||||
const uint8_t *data, uint16_t len)
|
||||
{
|
||||
int32_t i;
|
||||
int32_t i =0, j = 0;
|
||||
float downloadSpeed = 0.0f;
|
||||
uint32_t mediaFileIndex = 0, mediaSubFileIndex = -1;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
|
||||
if (packetInfo.downloadFileEvent == DJI_DOWNLOAD_FILE_EVENT_START) {
|
||||
for (i = 0; i < s_meidaFileList.totalCount; ++i) {
|
||||
if (s_meidaFileList.fileListInfo[i].fileIndex == packetInfo.fileIndex) {
|
||||
s_nextDownloadFileIndex = i + 1;
|
||||
break;
|
||||
memset(downloadFileName, 0, sizeof(downloadFileName));
|
||||
if (packetInfo.fileType == DJI_DOWNLOAD_FILE_ORG) {
|
||||
for (i = 0; i < s_meidaFileList.totalCount; ++i) {
|
||||
if (s_meidaFileList.fileListInfo[i].fileIndex == packetInfo.fileIndex) {
|
||||
snprintf(downloadFileName, sizeof(downloadFileName), "%s", s_meidaFileList.fileListInfo[i].fileName);
|
||||
mediaFileIndex = i;
|
||||
s_nextDownloadFileIndex = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < s_meidaFileList.totalCount; ++i) {
|
||||
for (j = 0; j < s_meidaFileList.fileListInfo[i].subFileListTotalNum; ++j) {
|
||||
if (s_meidaFileList.fileListInfo[i].subFileListInfo[j].fileIndex == packetInfo.fileIndex &&
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].type == packetInfo.fileType) {
|
||||
snprintf(downloadFileName, sizeof(downloadFileName), "%s",
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].fileName);
|
||||
mediaFileIndex = i;
|
||||
mediaSubFileIndex = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
osalHandler->GetTimeMs(&downloadStartMs);
|
||||
|
||||
memset(downloadFileName, 0, sizeof(downloadFileName));
|
||||
snprintf(downloadFileName, sizeof(downloadFileName), "%s", s_meidaFileList.fileListInfo[i].fileName);
|
||||
USER_LOG_INFO("Start download media file, index : %d, next download media file, index: %d", i,
|
||||
s_nextDownloadFileIndex);
|
||||
if (mediaSubFileIndex != TEST_CAMEAR_MEDIA_SUB_FILE_NOT_FOUND) {
|
||||
USER_LOG_INFO("Start download media sub file, index : %d, media file, index: %d", mediaSubFileIndex, mediaFileIndex);
|
||||
} else {
|
||||
USER_LOG_INFO("Start download media file, index : %d", mediaFileIndex);
|
||||
}
|
||||
|
||||
s_downloadMediaFile = fopen(downloadFileName, "wb+");
|
||||
if (s_downloadMediaFile == NULL) {
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||
@ -2415,6 +2366,57 @@ static T_DjiReturnCode DjiTest_CameraManagerDownloadFileDataCallback(T_DjiDownlo
|
||||
USER_LOG_INFO("End download media file, Download Speed %.2f KB/S\r\n\r\n", downloadSpeed);
|
||||
fclose(s_downloadMediaFile);
|
||||
s_downloadMediaFile = NULL;
|
||||
} else if (packetInfo.downloadFileEvent == DJI_DOWNLOAD_FILE_EVENT_START_TRANSFER_END) {
|
||||
|
||||
memset(downloadFileName, 0, sizeof(downloadFileName));
|
||||
if (packetInfo.fileType == DJI_DOWNLOAD_FILE_ORG) {
|
||||
for (i = 0; i < s_meidaFileList.totalCount; ++i) {
|
||||
if (s_meidaFileList.fileListInfo[i].fileIndex == packetInfo.fileIndex) {
|
||||
snprintf(downloadFileName, sizeof(downloadFileName), "%s", s_meidaFileList.fileListInfo[i].fileName);
|
||||
mediaFileIndex = i;
|
||||
s_nextDownloadFileIndex = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < s_meidaFileList.totalCount; ++i) {
|
||||
for (j = 0; j < s_meidaFileList.fileListInfo[i].subFileListTotalNum; ++j) {
|
||||
if (s_meidaFileList.fileListInfo[i].subFileListInfo[j].fileIndex == packetInfo.fileIndex &&
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].type == packetInfo.fileType) {
|
||||
snprintf(downloadFileName, sizeof(downloadFileName), "%s",
|
||||
s_meidaFileList.fileListInfo[i].subFileListInfo[j].fileName);
|
||||
mediaFileIndex = i;
|
||||
mediaSubFileIndex = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mediaSubFileIndex != TEST_CAMEAR_MEDIA_SUB_FILE_NOT_FOUND) {
|
||||
USER_LOG_INFO("Start download media sub file, index : %d, media file, index: %d", mediaSubFileIndex, mediaFileIndex);
|
||||
} else {
|
||||
USER_LOG_INFO("Start download media file, index : %d", mediaFileIndex);
|
||||
}
|
||||
|
||||
s_downloadMediaFile = fopen(downloadFileName, "wb+");
|
||||
if (s_downloadMediaFile == NULL) {
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||
}
|
||||
fwrite(data, 1, len, s_downloadMediaFile);
|
||||
|
||||
printf("\033[1;32;40m ### [Complete rate : %0.1f%%] (%s), size: %u, mediaFileIndex: %d\033[0m\r\n",
|
||||
packetInfo.progressInPercent, downloadFileName, packetInfo.fileSize, packetInfo.fileIndex);
|
||||
printf("\033[1A");
|
||||
|
||||
downloadSpeed = (float) packetInfo.fileSize / 1.0;
|
||||
printf("\033[1;32;40m ### [Complete rate : %0.1f%%] (%s), size: %u, mediaFileIndex: %d\033[0m\r\n",
|
||||
packetInfo.progressInPercent, downloadFileName, packetInfo.fileSize, packetInfo.fileIndex);
|
||||
printf("\033[1A");
|
||||
printf("\r\n");
|
||||
USER_LOG_INFO("End download media file, Download Speed %.2f KB/S\r\n\r\n", downloadSpeed);
|
||||
fclose(s_downloadMediaFile);
|
||||
s_downloadMediaFile = NULL;
|
||||
}
|
||||
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||
@ -2550,6 +2552,7 @@ T_DjiReturnCode DjiTest_CameraManagerSubscribePointCloud(E_DjiMountPosition posi
|
||||
T_DjiCameraManagerColorPointCloud *colorPointCloud;
|
||||
uint32_t colorPointCloudDataByte = 0;
|
||||
uint32_t colorPointsNum = 0;
|
||||
static bool isMopInit = false;
|
||||
|
||||
returnCode = DjiCameraManager_StartRecordPointCloud(position);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -2568,11 +2571,15 @@ T_DjiReturnCode DjiTest_CameraManagerSubscribePointCloud(E_DjiMountPosition posi
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
||||
}
|
||||
|
||||
returnCode = DjiMopChannel_Init();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
fclose(fp);
|
||||
USER_LOG_ERROR("Mop channel init error, stat:0x%08llX.", returnCode);
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
||||
if (isMopInit == false) {
|
||||
returnCode = DjiMopChannel_Init();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
fclose(fp);
|
||||
USER_LOG_ERROR("Mop channel init error, stat:0x%08llX.", returnCode);
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
||||
} else {
|
||||
isMopInit = true;
|
||||
}
|
||||
}
|
||||
|
||||
returnCode = DjiMopChannel_Create(&s_mopChannelHandle, DJI_MOP_CHANNEL_TRANS_UNRELIABLE);
|
||||
|
||||
@ -47,7 +47,6 @@ typedef enum {
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SET_CAMERA_TAP_ZOOM_POINT,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SET_CAMERA_ZOOM_PARAM,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOOT_SINGLE_PHOTO,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOOT_AEB_PHOTO,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOOT_BURST_PHOTO,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOOT_INTERVAL_PHOTO,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_RECORD_VIDEO,
|
||||
@ -223,18 +222,6 @@ T_DjiReturnCode DjiTest_CameraManagerStartShootSinglePhoto(E_DjiMountPosition po
|
||||
T_DjiReturnCode DjiTest_CameraManagerStartShootBurstPhoto(E_DjiMountPosition position,
|
||||
E_DjiCameraBurstCount burstCount);
|
||||
|
||||
/*! @brief Sample to shoot AEB photo, using async api
|
||||
*
|
||||
* @note In this interface, camera will be set to be the SHOOT_PHOTO mode
|
||||
* then start to shoot a AEB photo.
|
||||
* @param index payload node index, input limit see enum
|
||||
* DJI::OSDK::PayloadIndexType
|
||||
* @param photoNum The number of pictures in each AEB shooting
|
||||
* @return T_DjiReturnCode error code
|
||||
*/
|
||||
T_DjiReturnCode DjiTest_CameraManagerStartShootAEBPhoto(E_DjiMountPosition position,
|
||||
E_DjiCameraManagerPhotoAEBCount aebCount);
|
||||
|
||||
/*! @brief Sample to start shooting interval photo, using async api
|
||||
*
|
||||
* @note In this interface, camera will be set to be the SHOOT_PHOTO mode
|
||||
|
||||
Reference in New Issue
Block a user