From 7409b3f93aa5cec1679b5c79b118b52e33bd81cf Mon Sep 17 00:00:00 2001 From: janhauer Date: Thu, 4 Feb 2010 16:31:15 +0000 Subject: [PATCH] - bugfix: empty data frame sent in response to a datarequest (somtimes) had wrong header size - updated signature of dummy component NoPromiscuousModeP --- tos/lib/mac/tkn154/IndirectTxP.nc | 2 +- tos/lib/mac/tkn154/dummies/NoPromiscuousModeP.nc | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tos/lib/mac/tkn154/IndirectTxP.nc b/tos/lib/mac/tkn154/IndirectTxP.nc index 9a712f49..c404bcec 100644 --- a/tos/lib/mac/tkn154/IndirectTxP.nc +++ b/tos/lib/mac/tkn154/IndirectTxP.nc @@ -267,7 +267,7 @@ implementation NULL //security ); MHR(&m_emptyDataFrame)[MHR_INDEX_FC1] |= FC1_FRAMETYPE_DATA; - m_emptyDataFrame.headerLen = 9; + m_emptyDataFrame.headerLen = call IEEE154Frame.getHeaderLength(emptyDataMsg); m_emptyDataFrame.client = 1; // lock if (call CoordCapTx.transmit(&m_emptyDataFrame) != IEEE154_SUCCESS) m_emptyDataFrame.client = 0; // unlock diff --git a/tos/lib/mac/tkn154/dummies/NoPromiscuousModeP.nc b/tos/lib/mac/tkn154/dummies/NoPromiscuousModeP.nc index ae3a2124..57bbee8d 100644 --- a/tos/lib/mac/tkn154/dummies/NoPromiscuousModeP.nc +++ b/tos/lib/mac/tkn154/dummies/NoPromiscuousModeP.nc @@ -46,7 +46,7 @@ module NoPromiscuousModeP 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; @@ -63,11 +63,11 @@ implementation command error_t PromiscuousMode.start() { return FAIL; } - event void Token.granted() { call Token.release(); } + event void RadioToken.granted() { ASSERT(0);} - async event void PromiscuousRx.prepareDone() { } + event message_t* PromiscuousRx.received(message_t *frame, const ieee154_timestamp_t *timestamp) { return frame; } - event message_t* PromiscuousRx.received(message_t *frame, ieee154_timestamp_t *timestamp) { return frame; } + async event void PromiscuousRx.enableRxDone(){} command error_t PromiscuousMode.stop() { return FAIL; } @@ -76,4 +76,5 @@ implementation default event void PromiscuousMode.startDone(error_t error){} default event void PromiscuousMode.stopDone(error_t error){} async command token_requested_t IsRadioTokenRequested.getNow(){ return FALSE;} + async event void RadioToken.transferredFrom(uint8_t clientFrom){ASSERT(0);} } -- 2.39.2