ZBLOG

printf("Multiple Frame Transmission\n"); str_output[0] = 0x1

请注意,为了使多帧传输工作,请对代码进行以下修改:

printf("Multiple Frame Transmission\n");
str_output[0] = (0x1 << 4) + 0x0;

int num_frames;
if ((lenth - (SIZE - 2)) % (SIZE - 1) == 0)
{
    num_frames = (lenth - (SIZE - 2)) / (SIZE - 1);
}
else
{
    num_frames = (lenth - (SIZE - 2)) / (SIZE - 1) + 1;
}

str_output[1] = num_frames;
output_data(str_output, lenth);

printf("ConsecutiveFrame\n");
for (int i = 1; i <= num_frames; i++)
{
    str_output[0] = ((0x2 << 4) + i) * str_output[1];
    int start_index = (i - 1) * (SIZE - 2);
    for (int j = 1; j < SIZE && start_index + j - 1 < lenth; j++)
    {
        str_output[j] = source_point[start_index + j - 1];
    }
    output_data(str_output, lenth);
}

这样,代码中的多帧传输部分应该能正常工作。注意要根据你的具体需求和数据格式进行适当调整。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://sdn.0voice.com/?id=2382

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?