DrandC.nc
上传用户:joranyuan
上传日期:2022-06-23
资源大小:3306k
文件大小:1k
源码类别:

网络

开发平台:

Others

  1. includes DrandMSG;
  2. configuration DrandC {
  3.   provides{
  4.     interface Drand;
  5.     interface StdControl;
  6.   }
  7. }
  8. implementation {
  9.   components DrandM, GenericComm as Comm, SClockC, TimerC;
  10. #ifdef LDEBUG
  11.   components LedsC;
  12. #endif
  13.   Drand = DrandM;
  14.   StdControl = DrandM;
  15.   DrandM.roundTimer -> TimerC.Timer[unique("Timer")];
  16.   DrandM.reXTimer -> TimerC.Timer[unique("Timer")];
  17.   DrandM.drandRoundTimer -> TimerC.Timer[unique("Timer")];
  18. #ifdef LDEBUG
  19.   DrandM.Leds -> LedsC;
  20. #endif
  21.   DrandM.SendHelloMsg -> Comm.SendMsg[AM_HELLO];
  22.   DrandM.ReceiveHelloMsg -> Comm.ReceiveMsg[AM_HELLO];
  23.   DrandM.SendRequestMsg -> Comm.SendMsg[AM_REQUEST];
  24.   DrandM.ReceiveRequestMsg -> Comm.ReceiveMsg[AM_REQUEST];
  25.   DrandM.SendRejectMsg -> Comm.SendMsg[AM_REJECT];
  26.   DrandM.ReceiveRejectMsg -> Comm.ReceiveMsg[AM_REJECT];
  27.   DrandM.SendReleaseMsg -> Comm.SendMsg[AM_RELEASE];
  28.   DrandM.ReceiveReleaseMsg -> Comm.ReceiveMsg[AM_RELEASE];
  29.   DrandM.SendTwoHopMsg -> Comm.SendMsg[AM_TWOHOP];
  30.   DrandM.ReceiveTwoHopMsg -> Comm.ReceiveMsg[AM_TWOHOP];
  31.   DrandM.SendGrantMsg -> Comm.SendMsg[AM_GRANT];
  32.   DrandM.ReceiveGrantMsg -> Comm.ReceiveMsg[AM_GRANT];
  33.   DrandM.SendReportMsg -> Comm.SendMsg[AM_REPORT];
  34.   DrandM.ReceiveReportMsg -> Comm.ReceiveMsg[AM_REPORT];
  35.   
  36.   DrandM.SendFrameMsg -> Comm.SendMsg[AM_FRAME];
  37.   DrandM.ReceiveFrameMsg -> Comm.ReceiveMsg[AM_FRAME];
  38.   DrandM.SClock -> SClockC;
  39. }