/**
* @file CFM_Raw.h
* @brief Communication Function Module: 网络透传通信
* @details
* 内网透传通信的实现
* @author GT-BU
* @date 2021.03.01
* @version V1.0
* @copyright TCT
* @par 修改日志
* <table>
* <tr><th>Date        <th>Version  <th>Author     <th>Description
* <tr><td>2021.03.01  <td>V1.0     <td>GT-BU      <td>创建初始版本
* </table>
*/
#ifndef CFM_RAW_H
#define CFM_RAW_H
#include "CM_Types.h"
#include "PFM_Cfg.h"
#include "PFM_InputOutput.h"
#ifdef __cplusplus
extern "C"
{
#endif

    /* 内网透传数据接收 */
    CM_UINT32 CFM_RxInnetRaw(IN CM_INT32 ch, OUT CM_UINT8 *buf, IN CM_UINT32 bufSize);

    /* 内网透传数据发送 */
    CM_UINT8 CFM_TxInnetRaw(IN CM_INT32 ch, IN const CM_UINT8 *Buf, IN CM_UINT32 Len);


    CM_UINT32 CFM_RxInnetRaw_COM(IN CM_INT32 ch, OUT CM_UINT8* buf, IN CM_UINT32 bufSize,
    							OUT CM_UINT8* maininfobuf,OUT CM_UINT32* maininfolen,
    							OUT CM_UINT8* peerinfobuf,OUT CM_UINT32* peerinfolen,IN CM_UINT32 infobufSize);
    CM_UINT32 CFM_InnetRaw_Rx(IN CM_INT32 ch, OUT CM_UINT8 buf[], IN CM_UINT32 buf_size);
    /**
    * @brief 相机数据的2oo2比较接收
    * @details
    */
    CM_UINT32 CFM_InnetRaw_Rx_Camera(IN CM_INT32 ch, OUT CM_UINT8 buf[], IN CM_UINT32 buf_size,
    								OUT CM_UINT8 maininfobuf[],OUT CM_UINT32* maininfolen,
    								OUT CM_UINT8 peerinfobuf[],OUT CM_UINT32* peerinfolen,IN CM_UINT32 infobufSize);
    /**
    * @brief 外网透传接收
    * @param buf 接收数组
    * @param bufSize 接收数组大小
    * @return 接收数据长度
    */
    CM_UINT32 CFM_RxOutnetRaw(OUT CM_UINT8 buf[], IN CM_UINT32 bufSize);
    CM_UINT8 CFM_TxOutnetRaw(IN CM_UINT8 Buf[], IN CM_UINT32 Len);

    CM_UINT8 CFM_TxOutnetHeart(IN const CM_UINT8 Buf[], IN CM_UINT32 Len);
    CM_UINT32 CFM_RxOutnetHeart(OUT CM_UINT8 buf[], IN CM_UINT32 bufSize);
#ifdef __cplusplus
}
#endif
#endif
