|
楼主 |
发表于 2012-2-2 21:42:39
|
显示全部楼层
回复【1楼】tiancaigao7 天才杨威利
个人理解,邮箱发送的事消息的指针,而消息队列直接发送的是消息本身。
-----------------------------------------------------------------------
谢谢回复,我一开始想想感觉也只能这样想了,但是看了一下接口函数用的是指针,想想传的应该是指针,但你这么一说又回过去看函数,感觉也有可能传的是实际数据,贴一下原例程
46 while (1)
47 {
48 for (i = 0; i < 10; i++)
49 {
50 buf[sizeof(buf) - 2] = '0' + i;
51
52 rt kprintf("thread2: send message - %s\n", buf);
53 /* 发送消息到消息队列中*/
54 result = rt mq send(&mq, &buf[0], sizeof(buf));
55 if ( result == -RT EFULL)
56 {
57 /* 消息队列满, 延迟1s时间*/
58 rt kprintf("message queue full, delay 1s\n");
59 rt thread delay(100);
60 }
61 }
62
63 /* 延时10个OS Tick */
64 rt thread delay(10);
65 }
如果真的传输的是数据,那这个例程等于一次传送了10个消息队列了??忘高手指教一下 |
|