TinyOS 高级编程:布线、组件库与设计模式解析
1. 高级布线相关内容
在编程过程中,高级布线起着关键作用。例如 AMQueueImplP 的相关布线如下:
AMQueueImplP . AMSend
->
ActiveMessageC ;
AMQueueImplP . AMPacket
->
ActiveMessageC ;
AMQueueImplP . Packet
->
ActiveMessageC ;
在 AMSendQueueImplP 中,发送数据包的逻辑如下:
nextPacket ();
if ( current == QUEUE_EMPTY )
{
return ;
}
else
{
message_t * msg;
am_id_t id;
am_addr_t addr ;
uint8_t len ;
msg = queue [ current ];
id = call AMPacket . getType ( msg );
addr = call AMPacket . getDestination ( msg );
len = call Packet . getLength ( msg );
if ( call AMSend . send [id ]( addr , msg , len) == SUCCESS )
{
..
超级会员免费看
订阅专栏 解锁全文
8

被折叠的 条评论
为什么被折叠?



