configuration DebugC {
}
implementation {
- components DebugP, LedsC;
+ components DebugP, LedsC, MainC;
+ DebugP.Boot -> MainC;
DebugP.Leds -> LedsC;
+
+#if defined(PLATFORM_TELOSB)
+ components UserButtonC;
+ DebugP.ButtonPressed -> UserButtonC;
+#endif
}
#else
#include <varargs.h>
#endif
+#if defined(PLATFORM_TELOSB)
+#include <UserButton.h>
+#endif
module DebugP {
- uses interface Leds;
+ uses {
+ interface Boot;
+ interface Leds;
+#if defined(PLATFORM_TELOSB)
+ interface Notify<button_state_t> as ButtonPressed;
+#endif
+ }
}
implementation {
norace char m_assertFilename[MAX_LEN_FILENAME];
norace char m_assertFunction[MAX_LEN_FUNNAME];
+ event void Boot.booted() {
+#if defined(PLATFORM_TELOSB)
+ call ButtonPressed.enable();
+#endif
+ }
+
+#if defined(PLATFORM_TELOSB)
+ event void ButtonPressed.notify( button_state_t val )
+ {
+ dbg_serial_flush();
+ }
+#endif
+
task void assertFailTask()
{
if (m_assertCounter == 0) {
post signalStartConfirmTask();
status = IEEE154_SUCCESS;
}
+ dbg_serial("DispatchUnslottedCsmaP", "MLME_START.request -> result: %lu\n", (uint32_t) status);
return status;
}
return IEEE154_TRANSACTION_OVERFLOW;
} else {
setCurrentFrame(frame);
- call RadioToken.request();
+ if (call RadioToken.isOwner())
+ updateState();
+ else
+ call RadioToken.request();
return IEEE154_SUCCESS;
}
}
{
uint8_t i;
// TODO: if CSMA-CA algorithm failed, then frame shall still remain in transaction queue
+ dbg_serial("IndirectTxP", "transmitDone(), status: %lu\n", (uint32_t) status);
for (i=0; i<NUM_MAX_PENDING; i++)
if (m_txFrameTable[i] == txFrame) {
m_txFrameTable[i] = NULL; // slot is now empty
m_numExtPending--;
signal FrameTx.transmitDone[txFrame->client](txFrame, status);
post tryCoordCapTxTask();
- dbg_serial("IndirectTxP", "transmitDone()\n");
}
command ieee154_txframe_t* GetIndirectTxFrame.get() { return m_pendingTxFrame;}