DrandMSG.h
上传用户:joranyuan
上传日期:2022-06-23
资源大小:3306k
文件大小:1k
- #ifndef DRAND_MSG_H
- #define DRAND_MSG_H
- #include "SClock.h"
- enum {
- MAX_NBR = 20,
- MAX_ONE_HOP = 15
- };
- enum { // max number of times
- MAX_GRANT = 30,
- MAX_REQUEST = 30,
- MAX_FRAME = 30,
- MAX_REPORT = 30
- };
- enum {
- AM_HELLO = 31,
- AM_REQUEST = 32,
- AM_GRANT = 33,
- AM_RELEASE = 34,
- AM_REJECT = 35,
- AM_TWOHOP = 36,
- AM_REPORT = 37,
- AM_FRAME = 38
- };
- //can set the period of timeSync and hello (everything in ms)
- enum {
- HELLO_PERIOD = 30000L, //*(1/115200)sec
- HELLO_INTERVAL = 500,
- GRANT_INTERVAL = 100,
- REPORT_INTERVAL = 100,
- REPORT_XPERIOD = 1000,
- FRAME_INTERVAL = 100,
- FRAME_XPERIOD = 1000,
- DRAND_PERIOD = 120000L,
- REPORT_PERIOD = 30000L,
- };
- enum { //Each state
- HELLO_STATE,
- REQUEST_STATE,
- GRANT_STATE,
- IDLE_STATE2, // seems BMAC also has IDLE_STATE ;)
- RELEASE_STATE,
- REPORT_STATE,
- FRAME_STATE
- };
- enum{ // nodeInfo bit map masks
- ONE_HOP = 0x1,
- TWO_HOP = 0x2,
- GRANT_SENT = 0x4,
- };
- enum{ // frame message types
- REPORT_REQUEST = 0,
- REPORT_REPLY = 1,
- FRAME_REQUEST = 2,
- FRAME_REPLY = 3
- };
- #endif