flooding.h

来自「SOS操作系统用于无线传感器网络节点的源代码」· C头文件 代码 · 共 26 行

H
26
字号
#ifndef _FLOODING_H_
#define _FLOODING_H_

#include <module.h>
enum
  {
    FLOOD_QUEUE_SIZE   = 5,             //! Queue to store information about the last few packets
    FLOOD_MAX_HOP_COUNT = 5,            //! Control the extent of flooding
    MSG_FLOOD_DATA_PKT = MOD_MSG_START, //! Data packet to send to flooding module
    MOD_FLOODING_GET_HDR_SIZE   = 1,             //! Function ID for the 'get header size' dynamic function
    MOD_SEND_PKT       = 2,             //! Function ID for the 'flood pkt' dynamic function
  };
typedef uint8_t (*flood_get_hdr_size_proto)(func_cb_ptr proto);
typedef int8_t (*flood_pkt_proto)(func_cb_ptr proto, sos_pid_t dest_pid, uint8_t dest_msg_type, uint8_t* pktpayload, uint8_t payloadlen);

// Flood Routing Packet Header
typedef struct{
	uint16_t originaddr;
	int16_t seqno;
	uint8_t originhopcount;  uint8_t maxhopcount;
	sos_pid_t dst_pid;
	uint8_t dest_msg_type;
} flood_hdr_t;

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?