📄 mac-sensor-timers.h
字号:
/****************************************************************** * This code was developed as part of the MIT uAMPS project. * ******************************************************************/#ifdef MIT_uAMPS#ifndef __mac_sensor_timers_h__#define __mac_sensor_timers_h__/* ====================================================================== Timers ====================================================================== */class MacSensor;class MacSensorTimer : public Handler {public: MacSensorTimer(MacSensor* m, double s = 0) : mac(m) { busy_ = paused_ = 0; stime = rtime = 0.0; slottime_ = s; } virtual void handle(Event *e) = 0; virtual void start(Packet *p, double time); virtual void stop(Packet *p); virtual void pause(void) { assert(0); } virtual void resume(void) { assert(0); } inline int busy(void) { return busy_; } inline int paused(void) { return paused_; } inline double slottime(void) { return slottime_; } inline double expire(void) { return ((stime + rtime) - Scheduler::instance().clock()); }protected: MacSensor *mac; int busy_; int paused_; Event intr; double stime; // start time double rtime; // remaining time double slottime_;};class DeferSensorTimer : public MacSensorTimer {public: DeferSensorTimer(MacSensor *m, double s) : MacSensorTimer(m,s) {} void handle(Event *e);};class RxSensorTimer : public MacSensorTimer {public: RxSensorTimer(MacSensor *m) : MacSensorTimer(m) {} void handle(Event *e);};class TxSensorTimer : public MacSensorTimer {public: TxSensorTimer(MacSensor *m) : MacSensorTimer(m) {} void handle(Event *e);};#endif /* __mac_sensor_timers_h__ */#endif /* MIT_uAMPS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -