X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Frf230%2FRF230PacketP.nc;h=646cf122c779dc6c293800d38dd62473a3319a8d;hb=1c0837d14187f6ed7f1866b304fa5df3b05d16a6;hp=d2f2c150af9d5580b2e3f9e4ad975bd22c91f388;hpb=3c736796f8f069dd3fe807a3addb59822dc24548;p=tinyos-2.x.git diff --git a/tos/chips/rf230/RF230PacketP.nc b/tos/chips/rf230/RF230PacketP.nc index d2f2c150..646cf122 100644 --- a/tos/chips/rf230/RF230PacketP.nc +++ b/tos/chips/rf230/RF230PacketP.nc @@ -265,37 +265,33 @@ implementation getMeta(msg)->flags |= RF230PACKET_TIMESYNC; } -/*----------------- Global fields -----------------*/ - - norace uint8_t flags; - enum - { - FLAG_SLEEPINT = 0x01, - }; - - // TODO: Move sleepInterval into the metadata - norace uint16_t sleepInterval; - /*----------------- PacketSleepInterval -----------------*/ async command bool PacketSleepInterval.isSet(message_t* msg) { - return flags & FLAG_SLEEPINT; + return getMeta(msg)->flags & RF230PACKET_LPL_SLEEPINT; } async command uint16_t PacketSleepInterval.get(message_t* msg) { - return sleepInterval; +#ifdef LOW_POWER_LISTENING + return getMeta(msg)->lpl_sleepint; +#else + return 0; +#endif } async command void PacketSleepInterval.clear(message_t* msg) { - flags &= ~FLAG_SLEEPINT; + getMeta(msg)->flags &= ~RF230PACKET_LPL_SLEEPINT; } async command void PacketSleepInterval.set(message_t* msg, uint16_t value) { - flags |= FLAG_SLEEPINT; - sleepInterval = value; + getMeta(msg)->flags |= RF230PACKET_LPL_SLEEPINT; + +#ifdef LOW_POWER_LISTENING + getMeta(msg)->lpl_sleepint = value; +#endif } }