RecvData

函数功能

接收服务端传输的数据。

约束说明

NA

函数原型

int32_t RecvData(VMIMsgType type, uint8_t* data, uint32_t length)

参数说明

参数名称

输入/输出

参数类型

参数描述

type

输入

VMIMsgType

参考指令流数据类型定义。

data

输出

uint8_t*

代表接收type类型数据buffer。

length

输入

uint32_t

代表接收type类型数据buffer的长度。

返回值说明

调用示例

private InstructionEngine engine = new InstructionEngine();
void Test()  
{    
    const int MAX_BUF_LEN =1048576;
    uint8_t *recvBuf = new uint8_t[MAX_BUF_LEN]; 
    while (!stopFlag) { 
        int packetLen = RecvData(VMIMsgType::AUDIO, recvBuf, MAX_BUF_LEN); 
        if (packetLen > 0) { 
            // continue recv data when there is data found 
             …
            continue; 
        } 
     }
}