📄 dataqueue.h
字号:
/*
****************************************************************************
* 宁波中科集成电路设计中心 版权所有 Copyright 2005
* http:\\www.nbicc.com
*文件名: dataqueue.h
*程序员: 蒋文丰
*主要内容:常用函数
*
*如有问题或BUG,请登录www.wsn.net.cn 提问或用邮件和作者联系
****************************************************************************
*/
#ifndef _DATAQUEUE_H
#define _DATAQUEUE_H
#include "type.h"
#include "message.h"
#define MESSAGE_QUEUE_SIZE 6 //队列长度
struct Queue{
uint8_t length;
uint8_t type;
OSMACMsg Msg;
} Queuemsgqueue[MESSAGE_QUEUE_SIZE],QueueBroadcast,QueueLocalMsg;
void QueueInit(void);
void MACTask(void);//定时调用发送任务
result_t InQueue(uint8_t type, uint8_t length, OSMACMsgPtr msg);
result_t InBroadQueue(uint8_t type, uint8_t length, OSMACMsgPtr msg);
result_t InLocalMsgQueue(uint8_t type, uint8_t length, OSMACMsgPtr msg);
result_t TransmitDone(OSMACMsgPtr msg);//发送结束函数
/*数据包入队列,type由message.h中的enum定义,BROADCAST代表广播方式,SENSOR 代表单播方式
enum PACKETTYPE {
BROADCAST = 4,
SENSOR = 3
};*/
result_t GetFreeQueueLength(void);
void SendFail(OSMACMsgPtr receivemsg); //用于路由的处理
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -