2 * Copyright (c) 2008, Technische Universitaet Berlin
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * - Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * - Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * - Neither the name of the Technische Universitaet Berlin nor the names
14 * of its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
23 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
27 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * - Revision -------------------------------------------------------------
32 * @author Jan Hauer <hauer@tkn.tu-berlin.de>
33 * ========================================================================
36 #include "TKN154_PHY.h"
37 #include "TKN154_MAC.h"
39 generic module NoFrameDispatchP(uint8_t superframeDirection)
43 interface Init as Reset;
44 interface FrameTx as FrameTx;
45 interface FrameRx as FrameRx[uint8_t frameType];
46 interface FrameExtracted as FrameExtracted[uint8_t frameType];
47 interface FrameTxNow as BroadcastTx;
48 interface Notify<bool> as WasRxEnabled;
49 interface Notify<bool> as FindBeacon;
53 interface Alarm<TSymbolIEEE802154,uint32_t> as CapEndAlarm;
54 interface Alarm<TSymbolIEEE802154,uint32_t> as BLEAlarm;
55 interface Alarm<TSymbolIEEE802154,uint32_t> as IndirectTxWaitAlarm;
56 interface Alarm<TSymbolIEEE802154,uint32_t> as BroadcastAlarm;
57 interface Resource as Token;
58 interface GetNow<bool> as IsTokenRequested;
59 interface ResourceTransfer as TokenToCfp;
60 interface ResourceTransferred as TokenTransferred;
61 interface GetNow<uint32_t> as CapStart;
62 interface GetNow<ieee154_reftime_t*> as CapStartRefTime;
63 interface GetNow<uint32_t> as CapLen;
64 interface GetNow<bool> as IsBLEActive;
65 interface GetNow<uint16_t> as BLELen;
66 interface GetNow<bool> as IsRxBroadcastPending;
67 interface GetNow<bool> as IsRxEnableActive;
68 interface Get<ieee154_txframe_t*> as GetIndirectTxFrame;
69 interface Notify<bool> as RxEnableStateChange;
70 interface GetNow<bool> as IsTrackingBeacons;
71 interface FrameUtility;
75 interface GetNow<bool> as IsBeaconEnabledPAN;
78 interface Ieee802154Debug as Debug;
81 interface SetNow<ieee154_cap_frame_backup_t*> as FrameBackup;
82 interface GetNow<ieee154_cap_frame_backup_t*> as FrameRestore;
87 command error_t Reset.init()
92 async event void TokenTransferred.transferred()
94 call TokenToCfp.transfer();
97 command ieee154_status_t FrameTx.transmit(ieee154_txframe_t *frame)
99 return IEEE154_TRANSACTION_OVERFLOW;
102 async event void RadioTx.loadDone(){ }
103 async event void RadioOff.offDone(){ }
104 async event void RadioRx.prepareDone(){ }
106 async event void CapEndAlarm.fired(){ }
107 async event void BLEAlarm.fired(){ }
108 event void RxEnableStateChange.notify(bool whatever){ }
109 async event void BroadcastAlarm.fired(){ }
111 async event void IndirectTxWaitAlarm.fired() { }
113 async event void RadioTx.transmitUnslottedCsmaCaDone(ieee154_txframe_t *frame,
114 bool ackPendingFlag, ieee154_csma_t *csmaParams, error_t result)
118 async event void RadioTx.transmitSlottedCsmaCaDone(ieee154_txframe_t *frame, ieee154_reftime_t *txTime,
119 bool ackPendingFlag, uint16_t remainingBackoff, ieee154_csma_t *csmaParams, error_t result)
123 void transmitDone(ieee154_txframe_t *frame, ieee154_reftime_t *txTime,
124 bool ackPendingFlag, ieee154_csma_t *csmaParams, error_t result)
128 event message_t* RadioRx.received(message_t* frame, ieee154_reftime_t *timestamp)
133 async command ieee154_status_t BroadcastTx.transmitNow(ieee154_txframe_t *frame)
135 return IEEE154_TRANSACTION_OVERFLOW;
138 event void Token.granted()
142 async event void RadioTx.transmitDone(ieee154_txframe_t *frame, ieee154_reftime_t *txTime){}
144 default event void FrameTx.transmitDone(ieee154_txframe_t *data, ieee154_status_t status){}
145 default event message_t* FrameRx.received[uint8_t client](message_t* data){return data;}
146 default async command bool IsRxEnableActive.getNow(){return FALSE;}
148 default async command void IndirectTxWaitAlarm.start(uint32_t dt){call Leds.led0On();}
149 default async command void IndirectTxWaitAlarm.stop(){call Leds.led0On();}
150 default async command void IndirectTxWaitAlarm.startAt(uint32_t t0, uint32_t dt){call Leds.led0On();}
152 default async command void BroadcastAlarm.start(uint32_t dt){call Leds.led0On();}
153 default async command void BroadcastAlarm.stop(){call Leds.led0On();}
154 default async command void BroadcastAlarm.startAt(uint32_t t0, uint32_t dt){call Leds.led0On();}
156 default async command bool IsRxBroadcastPending.getNow(){ return FALSE;}
157 default async event void BroadcastTx.transmitNowDone(ieee154_txframe_t *frame, ieee154_status_t status){}
158 default event message_t* FrameExtracted.received[uint8_t client](message_t* msg, ieee154_txframe_t *txFrame){return msg;}
159 default async command error_t FrameBackup.setNow(ieee154_cap_frame_backup_t* val ){return FAIL;}
160 default async command ieee154_cap_frame_backup_t* FrameRestore.getNow(){return NULL;}
162 command error_t WasRxEnabled.enable(){return FAIL;}
163 command error_t WasRxEnabled.disable(){return FAIL;}
164 command error_t FindBeacon.enable(){return FAIL;}
165 command error_t FindBeacon.disable(){return FAIL;}