DrandC.nc.~1.5.~
上传用户: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. #ifdef LDEBUG
  18.   DrandM.Leds -> LedsC;
  19. #endif
  20.   DrandM.SendHelloMsg -> Comm.SendMsg[AM_HELLO];
  21.   DrandM.ReceiveHelloMsg -> Comm.ReceiveMsg[AM_HELLO];
  22.   DrandM.SendRequestMsg -> Comm.SendMsg[AM_REQUEST];
  23.   DrandM.ReceiveRequestMsg -> Comm.ReceiveMsg[AM_REQUEST];
  24.   DrandM.SendRejectMsg -> Comm.SendMsg[AM_REJECT];
  25.   DrandM.ReceiveRejectMsg -> Comm.ReceiveMsg[AM_REJECT];
  26.   DrandM.SendReleaseMsg -> Comm.SendMsg[AM_RELEASE];
  27.   DrandM.ReceiveReleaseMsg -> Comm.ReceiveMsg[AM_RELEASE];
  28.   DrandM.SendTwoHopMsg -> Comm.SendMsg[AM_TWOHOP];
  29.   DrandM.ReceiveTwoHopMsg -> Comm.ReceiveMsg[AM_TWOHOP];
  30.   DrandM.SendGrantMsg -> Comm.SendMsg[AM_GRANT];
  31.   DrandM.ReceiveGrantMsg -> Comm.ReceiveMsg[AM_GRANT];
  32.   DrandM.SendReportMsg -> Comm.SendMsg[AM_REPORT];
  33.   DrandM.ReceiveReportMsg -> Comm.ReceiveMsg[AM_REPORT];
  34.   
  35.   DrandM.SendFrameMsg -> Comm.SendMsg[AM_FRAME];
  36.   DrandM.ReceiveFrameMsg -> Comm.ReceiveMsg[AM_FRAME];
  37.   DrandM.SClock -> SClockC;
  38. }