X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fmac%2Ftkn154%2FPromiscuousModeP.nc;h=2997f899524c307107f3d86820a184c338873eb9;hb=7c8134e8789a99210cc147b3a3379dffeb0f3bae;hp=76a7f743cb73f3526176f6df770aeb030be07ef5;hpb=dd2eec28b5c692a5319c6e7feb14a67e716f2406;p=tinyos-2.x.git diff --git a/tos/lib/mac/tkn154/PromiscuousModeP.nc b/tos/lib/mac/tkn154/PromiscuousModeP.nc index 76a7f743..2997f899 100644 --- a/tos/lib/mac/tkn154/PromiscuousModeP.nc +++ b/tos/lib/mac/tkn154/PromiscuousModeP.nc @@ -42,8 +42,9 @@ module PromiscuousModeP interface SplitControl as PromiscuousMode; interface Get as PromiscuousModeGet; interface FrameRx; + interface GetNow as IsRadioTokenRequested; } uses { - interface Resource as Token; + interface TransferableResource as RadioToken; interface RadioRx as PromiscuousRx; interface RadioOff; interface Set as RadioPromiscuousMode; @@ -76,14 +77,14 @@ implementation error_t result = FAIL; if (m_state == S_STOPPED) { m_state = S_STARTING; - call Token.request(); + call RadioToken.request(); result = SUCCESS; } dbg_serial("PromiscuousModeP", "PromiscuousMode.start -> result: %lu\n", (uint32_t) result); return result; } - event void Token.granted() + event void RadioToken.granted() { call RadioPromiscuousMode.set(TRUE); if (call RadioOff.isOff()) @@ -129,7 +130,7 @@ implementation { call RadioPromiscuousMode.set(FALSE); m_state = S_STOPPED; - call Token.release(); + call RadioToken.release(); dbg_serial("PromiscuousModeP", "Promiscuous mode disabled.\n"); signal PromiscuousMode.stopDone(SUCCESS); } @@ -142,6 +143,8 @@ implementation post continueStopTask(); } + async command token_requested_t IsRadioTokenRequested.getNow(){ return m_state == S_STARTING; } default event void PromiscuousMode.startDone(error_t error) {} default event void PromiscuousMode.stopDone(error_t error) {} + async event void RadioToken.transferredFrom(uint8_t clientFrom){ASSERT(0);} }