+ void transmitEmptyDataFrame(message_t* dataRequestFrame)
+ {
+ // the cast in the next line is dangerous -> this is only a temporary workaround!
+ // (until the new T2 message buffer abstraction is available)
+ message_t *emptyDataMsg = (message_t *) m_emptyDataFrame.header;
+ ieee154_address_t dstAddr;
+ uint16_t dstPanID;
+
+ if (m_emptyDataFrame.client != 0)
+ return; // locked (already transmitting an empty data frame)
+ if (call IEEE154Frame.getSrcAddr(dataRequestFrame, &dstAddr) != IEEE154_SUCCESS ||
+ call IEEE154Frame.getSrcPANId(dataRequestFrame, &dstPanID) != IEEE154_SUCCESS)
+ return;
+ call IEEE154Frame.setAddressingFields(emptyDataMsg,
+ call IEEE154Frame.getDstAddrMode(dataRequestFrame), // will become srcAddrMode
+ call IEEE154Frame.getSrcAddrMode(dataRequestFrame), // will become dstAddrMode
+ dstPanID,
+ &dstAddr,
+ NULL //security
+ );
+ MHR(&m_emptyDataFrame)[MHR_INDEX_FC1] |= FC1_FRAMETYPE_DATA;
+ m_emptyDataFrame.headerLen = 9;
+ m_emptyDataFrame.client = 1; // lock
+ if (call CoordCapTx.transmit(&m_emptyDataFrame) != IEEE154_SUCCESS)
+ m_emptyDataFrame.client = 0; // unlock
+ }
+