5.4.1 基本功能介绍
数据传输功能既是OSDK端口功能,又是PSDK端口功能。是用于DJI无人机的机载端SDK、地面端SDK进行数据透传的通道功能。区别于widget功能中的特定数据格式,数据传输功能提供的是数据通道,对传输数据透明,通道包括机载端PSDK与OSDK之间,以及机载端PSDK/OSDK与地面端MSDK的传输通道。根据通道带宽,又将数据通道分为小数据传输通道,以及高速数据传输通道。
此功能在PSDK端口使用与PSDK 2.2.1基本保持一致,其中小数据传输通道是通过串口通信,通常作为指令等数据传输,高速数据传输通过网口链路,可以提供达4Mb的带宽通道。OSDK端口的小数据传输对应于OSDK 4.1版本中的sample:djiosdk-mobile-sample和djiosdk-payload-control-sample,OSDK端口没有对应的高速数据通道。M300机型上提供了MOP(SDK互联互通)通道,提供了更高带宽和更完善的通道类型,将在下一节中详细介绍。
关于数据透传,简单理解就是传输通道(传输链路层)不会修改传输的数据内容,仅负责从发送端传输到接收端。但是传输的过程中,数据在链路上传递是基于链路本身。如果链路数据加密,通过该透传通道注入到链路上的数据也同样会加密传输,到达目的端会随着链路数据一起解析出来。此处的DJI SDK中的数据传输功能,是基于DJI无人机、遥控器、以及负载与无人机连接的硬件链路。SDK将收发数据抽象成API,透传将发送端API数据,完整的传给对端接收API。
5.4.2 主要代码文件
tree data_transmission/
data_transmission/
├── test_data_transmission.c
└── test_data_transmission.h
PSDK lib头文件:
dji_low_speed_data_channel.h
dji_high_speed_data_channel.h
5.4.3 sample代码实现
data_transmission功能入口
与前面介绍的功能入口有所区别,因为OSDK端口和PSDK端口都支持该功能,main.c文件中在识别PSDK挂载端口后分别启动了DjiTest_DataTransmissionStartService。OSDK与PSDK的功能不完全兼容,所以在此函数的实现中要结合端口连接进行处理,具体看代码实现。
T_DjiReturnCode DjiTest_DataTransmissionStartService(void)
{
T_DjiReturnCode djiStat;
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
E_DjiChannelAddress channelAddress;
const T_DjiDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportionOfHighspeedChannel =
{10, 60, 30};
char ipAddr[DJI_IP_ADDR_STR_SIZE_MAX];
uint16_t port;
djiStat = DjiLowSpeedDataChannel_Init();
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("init data transmission module error.");
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
djiStat = DjiAircraftInfo_GetBaseInfo(&s_aircraftInfoBaseInfo);
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("get aircraft base info error");
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}
channelAddress = DJI_CHANNEL_ADDRESS_MASTER_RC_APP;
USER_LOG_INFO("register receive data from mobile...");
djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromMobile);
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("register receive data from mobile error.");
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1 ||
s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2 ||
s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3) {
channelAddress = DJI_CHANNEL_ADDRESS_EXTENSION_PORT;
djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromOnboardComputer);
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("register receive data from onboard coputer error.");
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
djiStat = DjiHighSpeedDataChannel_SetBandwidthProportion(bandwidthProportionOfHighspeedChannel);
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("Set data channel bandwidth width proportion error.");
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
djiStat = DjiHighSpeedDataChannel_GetDataStreamRemoteAddress(ipAddr, &port);
if (djiStat == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_DEBUG("Get data stream remote address: %s, port: %d", ipAddr, port);
} else {
USER_LOG_ERROR("get data stream remote address error.");
}
} else if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_EXTENSION_PORT) {
channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1;
djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromPayload);
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("register receive data from payload NO1 error.");
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
} else {
return DJI_ERROR_SYSTEM_MODULE_CODE_NONSUPPORT;
}
if (osalHandler->TaskCreate("user_transmission_task", UserDataTransmission_Task,
DATA_TRANSMISSION_TASK_STACK_SIZE, NULL, &s_userDataTransmissionThread) !=
DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("user data transmission task create error.");
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
初始化
/* Exported functions --------------------------------------------------------*/
/**
* @brief Initialize the low speed data channel module.
* @note The interface initialization needs to be after DjiCore_Init.
* @return Execution result.
*/
T_DjiReturnCode DjiLowSpeedDataChannel_Init(void);
API简介:
-
数据通道初始化。该API在SDK core:DjiCore_Init之后,数据收发API之前调用。
这里将获取飞机信息也放在API中,实际已经在main中已经读取过了。后面会用到挂载端口,这里其实也可以修改sample的实现,仅获取一次保存下来使用就可以。因为负载设备启动后,飞机状态和挂载位置基本上是不会变更的。
/**
* @brief Get base information of aircraft system, including aircraft type and DJI adapter type.
* @param baseInfo: pointer to memory space used to store base information of the aircraft system.
* @return Execution result.
*/
T_DjiReturnCode DjiAircraftInfo_GetBaseInfo(T_DjiAircraftInfoBaseInfo *baseInfo);
注册数据接收回调
/**
* @brief Register callback function used to receive data from selected channel address. After registering this callback
* function, callback function will be called automatically when system receive data from selected channel address.
* @param channelAddress: the channel address of the low speed channel
* @param callback: pointer to callback function.
* @return Execution result.
*/
T_DjiReturnCode DjiLowSpeedDataChannel_RegRecvDataCallback(E_DjiChannelAddress channelAddress,
DjiLowSpeedDataChannelRecvDataCallback callback);
API简介:
-
从选择的数据通道中接收数据。当PSDK lib中收到对应通道过来的数据后,通过回调自动触发上抛。
参数:
-
channelAddress,指定的接收数据的通道,指定的数据通道是发送端。通道定义:
typedef enum {
DJI_CHANNEL_ADDRESS_UNKNOWN = 0,
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1, //主云台PSDK
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO2, //副云台PSDK
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO3, //上云台PSDK
DJI_CHANNEL_ADDRESS_EXTENSION_PORT, //OSDK端口
DJI_CHANNEL_ADDRESS_MASTER_RC_APP, //主遥控MSDK
DJI_CHANNEL_ADDRESS_SLAVE_RC_APP, //副遥控MSDK,暂不支持副遥控MSDK与其他端口收发数据
} E_DjiChannelAddress;
-
DjiLowSpeedDataChannelRecvDataCallback,注册到lib中的回调函数,lib定义,应用端实现。
回调定义
/**
* @brief Prototype of callback function used to receive data that come from selected channel address.
* @warning User can not execute blocking style operations or functions in callback function, because that will block
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
* @param data: pointer to data.
* @param len: length of data.
* @return Execution result.
*/
typedef T_DjiReturnCode (*DjiLowSpeedDataChannelRecvDataCallback)(const uint8_t *data, uint16_t len);
参数简介:
-
data,接收到的数据指针
-
len,接收到的数据长度
sample中根据通信通道分别注册了三个回调。
-
与主控RC MSDK通信, ReceiveDataFromMobile
-
当此应用运行在PSDK端口时,与OSDK端口通信,ReceiveDataFromOnboardComputer
-
当此应用运行在OSDK端口时,与PSDK端口通信,sample实现的是与挂载在主云台位置的通信,ReceiveDataFromPayload
其中2,3通过挂载端口(s_aircraftInfoBaseInfo.mountPosition)判断此应用是运行在PSDK端口还是OSDK端口,当运行在PSDK端口时,还支持高速率通道。使用到了另外两个API
/**
* @brief Set bandwidth proportion for the data stream, video stream and download stream of high-speed channel.
* @details Self-defined bandwidth distribution mechanism allows that user can control bandwidth limitation
* freely. System multiplies total bandwidth limitation of the high-speed channel by a proportion of the corresponding stream to
* get realtime bandwidth limitation of the specified stream. Realtime bandwidth limitation of data and video stream can be
* gotten by PsdkDataTransmission_GetDataStreamState() and PsdkPayloadCamera_GetVideoStreamState() interfaces. Total
* bandwidth of the high-speed channel is determined by the environment in which the system located and loading of system. If
* user does not set bandwidth proportion for each stream, the default proportion is 33% (data stream), 33% (video
* stream) and 34% (download stream).
* @note The bandwidth proportion will be effective after a while, the max value is 1s. If you want use this interface, should calling
* PsdkPlatform_RegHalNetworkHandler interface firstly, otherwise this interface will not work.
* @param bandwidthProportion: bandwidth proportion of each stream of high-speed channel. The Sum of bandwidth proportion
* must equal 100.
* @return Execution result.
*/
T_DjiReturnCode DjiHighSpeedDataChannel_SetBandwidthProportion(
T_DjiDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportion);
API简介:
-
设置高速数据通道各数据流的带宽分配比。在不同的负载应用场景中,开发者通过此API自定义个数据流的带宽分配,可以保证数据通道的高效利用。
参数:
-
T_DjiDataChannelBandwidthProportionOfHighspeedChannel,高速通道的带宽比例,定义
typedef struct {
uint8_t dataStream; /*!< Bandwidth proportion of data stream, range from 0 to 100. */
uint8_t videoStream; /*!< Bandwidth proportion of video stream, range from 0 to 100. */
uint8_t downloadStream; /*!< Bandwidth proportion of download stream, range from 0 to 100. */
} T_DjiDataChannelBandwidthProportionOfHighspeedChannel;
分为三部分,数据流、视频流和下载数据流。
-
数据流,对应调用API:DjiHighSpeedDataChannel_SendDataStreamData发送的数据
-
视频流,对应调用API:PsdkPayloadCamera_SendVideoStream发送的视频流数据
-
下载流,对应PSDK的下载回调:PsdkPayloadCamera_RegMediaDownloadPlaybackHandler
高速数据流中的视频流、下载流与相机组件中的视频流推送和媒体下载是耦合的。详细请参考5.2 camera_emu部分。显然串口通道满足不了高速数据传输,PSDK是通过UDP实现高速通道。在发送数据时也可以通过API读取对端(飞机端)IP和PORT,使用API发送数据时无需使用该IP和PORT。与相机视频流类似,之前PSDK提供的一个STM32开发PSDK的场景,可以在STM32上读取飞机端IP和PORT,然后发送给视频流的推送平台,就可以实现联动推送视频流。不过不使用视频流的STM32平台发送数据,建议使用低速通道发送就好。
/**
* @brief Get the network remote address for sending data stream.
* @note The interface is used to get the network remote address for sending data stream. You can get this info for another
* heterogeneous system to do somethings. This interface should be used after calling PsdkCore_Init function.
* @param ipAddr: the remote ip address for sending data stream.
* @param port: the remote port for sending data stream.
* @return Execution result.
*/
T_DjiReturnCode DjiHighSpeedDataChannel_GetDataStreamRemoteAddress(char *ipAddr, uint16_t *port);
API简述:
-
获取对端的网络IP和端口PORT
参数:
-
ipAddr,对端网络IP地址
-
port,对端网口端口
开启发送数据任务
以上代码是从对端接收数据,sample中开启了一个线程用于发送数据。线程的创建是通过开始注册到osalHandler中的回调函数,与平台相关的函数接口封装,也可以直接使用系统接口,该线程(task)中用了一个死循环并以一定的频率发送数据。也就是当启动PSDK sample后,就可以在MSDK、OSDK/PSDK端口接收测试数据。
while (1) {
osalHandler->TaskSleepMs(1000 / DATA_TRANSMISSION_TASK_FREQ);
channelAddress = DJI_CHANNEL_ADDRESS_MASTER_RC_APP;
djiStat = DjiLowSpeedDataChannel_SendData(channelAddress, dataToBeSent, sizeof(dataToBeSent));
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
USER_LOG_ERROR("send data to mobile error.");
djiStat = DjiLowSpeedDataChannel_GetSendDataState(channelAddress, &state);
if (djiStat == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_DEBUG(
"send to mobile state: realtimeBandwidthBeforeFlowController: %d, realtimeBandwidthAfterFlowController: %d, busyState: %d.",
state.realtimeBandwidthBeforeFlowController, state.realtimeBandwidthAfterFlowController,
state.busyState);
} else {
USER_LOG_ERROR("get send to mobile channel state error.");
}
if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1 ||
s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2 ||
s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3) {
channelAddress = DJI_CHANNEL_ADDRESS_EXTENSION_PORT;
djiStat = DjiLowSpeedDataChannel_SendData(channelAddress, dataToBeSent, sizeof(dataToBeSent));
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
USER_LOG_ERROR("send data to onboard computer error.");
djiStat = DjiLowSpeedDataChannel_GetSendDataState(channelAddress, &state);
if (djiStat == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_DEBUG(
"send to onboard computer state: realtimeBandwidthBeforeFlowController: %d, realtimeBandwidthAfterFlowController: %d, busyState: %d.",
state.realtimeBandwidthBeforeFlowController, state.realtimeBandwidthAfterFlowController,
state.busyState);
} else {
USER_LOG_ERROR("get send to onboard computer channel state error.");
}
djiStat = DjiHighSpeedDataChannel_SendDataStreamData(dataToBeSent, sizeof(dataToBeSent));
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
USER_LOG_ERROR("send data to data stream error.");
djiStat = DjiHighSpeedDataChannel_GetDataStreamState(&state);
if (djiStat == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_DEBUG(
"data stream state: realtimeBandwidthLimit: %d, realtimeBandwidthBeforeFlowController: %d, busyState: %d.",
state.realtimeBandwidthLimit, state.realtimeBandwidthBeforeFlowController, state.busyState);
} else {
USER_LOG_ERROR("get data stream state error.");
}
} else if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_EXTENSION_PORT) {
channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1;
djiStat = DjiLowSpeedDataChannel_SendData(channelAddress, dataToBeSent, sizeof(dataToBeSent));
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
USER_LOG_ERROR("send data to onboard computer error.");
//USER_LOG_INFO("kyle test: DjiLowSpeedDataChannel_SendData lenth[%d]", sizeof(dataToBeSent));
djiStat = DjiLowSpeedDataChannel_GetSendDataState(channelAddress, &state);
if (djiStat == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_DEBUG(
"send to onboard computer state: realtimeBandwidthBeforeFlowController: %d, realtimeBandwidthAfterFlowController: %d, busyState: %d.",
state.realtimeBandwidthBeforeFlowController, state.realtimeBandwidthAfterFlowController,
state.busyState);
} else {
USER_LOG_ERROR("get send to onboard computer channel state error.");
}
}
}
osalHandler->TaskSleepMs(1000 / DATA_TRANSMISSION_TASK_FREQ);也是用注册到osalHandler中回调,Linux中实际就是sleep(具体看看代码的实现部分)。通过sleep方式控制发送频率为DATA_TRANSMISSION_TASK_FREQ(1HZ)。
往遥控器APP端发送数据
/**
* @brief Send data to selected channel address end via command channel.
* @warning If actual bandwidth is below limitation, data can be sent to the endpoint directly. If exceeds the limitation,
* firstly data will be stored to buffer of the flow controller and be sent to endpoint after a period (an integer multiple of
* 1s, the exact time depends on bandwidth limitation and buffer size). If the buffer is full, data be will discarded. The
* capacity of flow controller buffer is 512 bytes.
* @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please
* refer to developer documentation or state of channel/stream for details related to bandwidth limitation. User can
* get state of "sendDataChannel" command channel via DjiLowSpeedDataChannel_GetSendDataState() function. If actual
* bandwidth exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data
* to be sent.
* @note Max size of data package sent to selected channel address end on a physical link of command channel is 128.
* If the length of data to be sent is greater than 128, data to be sent will be divided into multiple packages to send,
* and the user will also receive multiple data packages on the selected channel address end.
* @param channelAddress: the channel address of the low speed channel
* @param data: pointer to data to be sent.
* @param len: length of data to be sent, unit: byte.
* @return Execution result.
*/
T_DjiReturnCode DjiLowSpeedDataChannel_SendData(E_DjiChannelAddress channelAddress, const uint8_t *data,
uint8_t len);
API简介:
-
给选择的通道中发送数据。当实际发送数据量小于可用带宽限制是,数据直接向对端发送,当实际数据量超过带宽限制,将会进行缓存然后依次发送。缓存buf 512Bytes,若数据超过此缓存大小,可能会导致数据丢失。避免数据丢失,可以用DjiLowSpeedDataChannel_GetSendDataState查看发送数据状态。
-
此通道最大的数据包为128Bytes,当API注入的数据超过此128会被分包发送,对端也会收到多个包。
参数:
-
channelAddress,指定的数据通道,对端为接收端。
-
data,实际发送的数据。
-
len,实际发送数据的长度。
发送数据受带宽影响,可能存在数据丢失的情况,低速通道状态可以通过API实时监控,并调整发送策略。
/**
* @brief Get data transmission state of "sendToOsdk" command channel. User can use the state as base for controlling data
* transmission between selected channel address and onboard computer.
* @param channelAddress: the channel address of the low speed channel
* @param state: pointer to low speed channel state.
* @return Execution result.
*/
T_DjiReturnCode DjiLowSpeedDataChannel_GetSendDataState(E_DjiChannelAddress channelAddress,
T_DjiDataChannelState *state);
API简介:
-
用于获取往对端发送数据通道的状态,基于此接口可以用于调整应用端往API发送的数据量。
参数:
-
channelAddress,指定数据传输通道,对端为接收端。(说明,此API可以监控所有的低速通道,非仅与OSDK端通信)
-
state,读取到的数据通道状态。定义
/**
* @brief Data channel state.
*/
typedef struct {
/*! Realtime bandwidth limitation, varying with link status of aircraft system for some channels, such as data
* stream, video stream and download stream. Must ensure actual bandwidth of data transmission is less than
* realtime bandwidth limitation, unit: byte/s. */
int32_t realtimeBandwidthLimit;
/*! Realtime actual transmission bandwidth of data transmission channel calculated before flow controller, unit: byte/s. */
int32_t realtimeBandwidthBeforeFlowController;
/*! Realtime actual transmission bandwidth of data transmission channel calculated after flow controller, unit:
* byte/s. If specified channel without flow controller. the value is equal to
* ::realtimeBandwidthBeforeFlowController. */
int32_t realtimeBandwidthAfterFlowController;
/*! State specified whether the channel is busy or not. When data can not be sent to the endpoint directly, instead be
* sent to buffer of flow controller or discarded, the busy state will be set. At this time, the user should stop
* transmitting data or decrease the amount of data to be transmitted via this channel. When data bandwidth restore to
* normal, this state will be clear again. */
bool busyState;
} T_DjiDataChannelState;
往OSDK/PSDK端口发送数据
与接收数据一样,PSDK可用于OSDK端口也可用于PSDK端口,所以先判断是挂在在PSDK端口还是OSDK端口,发送低速数据API:DjiLowSpeedDataChannel_SendData是同一个,指定接收通道会存在差异。
同样运行在PSDK端口时可以支持高速通道,高速通道数据发送和通道状态获取是另外的API,
/**
* @brief Send data to mobile end via data stream of the data channel.
* @note This function can be used only in Linux operating system.
* @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please
* refer to developer documentation and state of channel/stream for details related to bandwidth limitation. User can
* get state of "dataStream" channel via PsdkDataTransmission_GetDataStreamState() function. If actual bandwidth
* exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data to be
* sent. Otherwise, data may be discarded.
* @param data: pointer to data to be sent.
* @param len: length of data to be sent via data stream, and it must be less than or equal to 65000, unit: byte.
* @return Execution result.
*/
T_DjiReturnCode DjiHighSpeedDataChannel_SendDataStreamData(const uint8_t *data, uint16_t len);
API简介:
-
给RC Mobile 端APP发送数据流,仅支持Linux系统,通过网络IP发送数据流。通道带宽设置要满足实际发送数据流的带宽可以通过DjiHighSpeedDataChannel_GetDataStreamState来获取高速通道的状态。
参数:
-
-
len,实际发送数据流的大小,不可以超过65000 byte
/**
* @brief Get data transmission state of "dataStream" channel. User can use the state as base for controlling data
* transmission of data stream. This function exists and can be used only in Linux operation system.
* @param state: pointer to "dataStream" channel state.
* @return Execution result.
*/
T_DjiReturnCode DjiHighSpeedDataChannel_GetDataStreamState(T_DjiDataChannelState *state);
API简介:
-
获取数据流传输通道的状态,可以基于此状态来实时调整数据发送。仅支持Linux系统。
参数:
-
state,读取到的通道状态,定义与低速通道状态一致。
注:
-
高速通道API的参数没有指定通道,而且注释说明了是给Mobile发送数据,是单向的。仅支持Linux系统。
5.4.4 开发注意事项
-
数据的传输是指MSDK,OSDK,PSDK之间的数据透传,所以指定的通道,都是相对于PSDK运行端的对端来设定。例如接收API指定的通道,指的是对端作为发送端。
-
低速通道是基于串口通信的链路,高速通道网络UDP包发送。
-
- M300上发送高速数据需要将通道类型设置为custom。
returnCode = PsdkPayloadCamera_SetVideoStreamType(PSDK_CAMERA_VIDEO_STREAM_TYPE_H264_CUSTOM_FORMAT);
评论
1 条评论
大佬!啥时候出下MOP(SDK互联互通)通道的讲解。
请登录写评论。