Changes between Version 5 and Version 6 of OFDM/MIMO/Docs/AutoResponse
- Timestamp:
- Aug 28, 2009, 4:15:54 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OFDM/MIMO/Docs/AutoResponse
v5 v6 14 14 The header translator is used to construct the header of an automatically transmitted packet using data from the header of the received packet which triggered the transmission. 15 15 16 == Sample Code==16 == Configuring the Auto Response System == 17 17 C macros are provided in [src:/PlatformSupport/warpmac/warpphy.h warphphy.h] to help configure the match units, actors and header translator. 18 19 Match unit configuration: 20 * PHY_AUTORESPONSE_MATCH_CONFIG(''addr'', ''len'', ''val''): Configure the match unit to check whether ''len'' header bytes starting at ''addr'' match value ''val'' 18 21 19 22 Actor condition requirements: … … 39 42 * PHY_AUTORESPONSE_TXACTION_CONFIG(''pktBuf'', ''translateHdr'', ''delay'', ''conditions''): Configure the actor to automatically transmit 40 43 * ''pktBuf'': index (in ![1,31]) of the packet buffer from which to automatically transmit the packet 41 * ''translateHdr'': enable the header translator when this actor triggers a transmission (''' 1''': use the translator; '''0''': disable the translator)44 * ''translateHdr'': enable the header translator when this actor triggers a transmission ('''PHY_AUTORESPONSE_ACT_TRANS_HDR''': use the translator; '''0''': disable the translator) 42 45 * ''delay'': number of 0.25µs increments to delay the automatic transmission. The time starts when the final byte of the incoming packet is decoded, even if the actor doesn't depend on the payload error status 43 46 * ''conditions'': bitwise OR'd combination of actor condition flags; every condition must be met by a given reception to trigger the actor. 44 47 * PHY_AUTORESPONSE_ACTION_SETFLAGA_CONFIG(''conditions''): Configure the actor to set Flag A; ''conditions'' is a bitwise OR'd combination of actor condition requirements 45 48 * PHY_AUTORESPONSE_ACTION_SETFLAGB_CONFIG(''conditions''): Configure the actor to set Flag B; ''conditions'' is a bitwise OR'd combination of actor condition requirements 49 50 == Sample Code == 51 52 {{{ 53 #!C 54 55 //Configure match unit 0 to search for packets addressed to me 56 // Looks for 2 bytes starting at index PKTHEADER_INDX_DSTADDR with value MY_ADDR 57 mimo_ofdmTxRx_setMatch0( PHY_AUTORESPONSE_MATCH_CONFIG(PKTHEADER_INDX_DSTADDR, 2, MY_ADDR) ); 58 59 //Configure match unit 1 to search for DATA packets 60 // Looks for 1 byte starting at index PKTHEADER_INDX_TYPE with value DATAPACKET 61 mimo_ofdmTxRx_setMatch1( PHY_AUTORESPONSE_MATCH_CONFIG(PKTHEADER_INDX_TYPE, 1, DATAPACKET) ); 62 63 //Configure the header translator to replace the outgoing destination address with the received source address 64 PHY_HEADERTRANSLATE_SET(pktBuf_tx_ACK, (PKTHEADER_INDX_DSTADDR+0), pktBuf_rx, (PKTHEADER_INDX_SRCADDR+0)); 65 PHY_HEADERTRANSLATE_SET(pktBuf_tx_ACK, (PKTHEADER_INDX_DSTADDR+1), pktBuf_rx, (PKTHEADER_INDX_SRCADDR+1)); 66 67 //Create a template ACK packet 68 templatePkt.header.fullRate = pktFullRate; 69 templatePkt.header.codeRate = pktCodeRate; 70 templatePkt.header.length = 0; 71 templatePkt.header.srcAddr = (unsigned short)(NODEID_TO_ADDR(myID)); 72 templatePkt.header.pktType = ACKPACKET; 73 74 //Copy the template ACK to the PHY packet buffer 75 warpmac_prepPhyForXmit(&templatePkt, pktBuf_tx_ACK); 76 77 //Configure actor 0 to send ACKs using the header translator after 5µs when the PHY receives a good data packet destined to this node 78 mimo_ofdmTxRx_setAction0( 79 PHY_AUTORESPONSE_TXACTION_CONFIG(pktBuf_tx_ACK, PHY_AUTORESPONSE_ACT_TRANS_HDR, 20, 80 (PHY_AUTORESPONSE_REQ_MATCH0 | PHY_AUTORESPONSE_REQ_MATCH1 | PHY_AUTORESPONSE_REQ_GOODHDR | PHY_AUTORESPONSE_REQ_GOODPKT))); 81 82 //Disable the unused actors 83 mimo_ofdmTxRx_setAction1(0); 84 mimo_ofdmTxRx_setAction2(0); 85 mimo_ofdmTxRx_setAction3(0); 86 mimo_ofdmTxRx_setAction4(0); 87 mimo_ofdmTxRx_setAction5(0); 88 89 90 91 }}}