Changes between Version 5 and Version 6 of OFDM/MIMO/Docs/AutoResponse


Ignore:
Timestamp:
Aug 28, 2009, 4:15:54 PM (15 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OFDM/MIMO/Docs/AutoResponse

    v5 v6  
    1414The 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.
    1515
    16 == Sample Code ==
     16== Configuring the Auto Response System ==
    1717C macros are provided in [src:/PlatformSupport/warpmac/warpphy.h warphphy.h] to help configure the match units, actors and header translator.
     18
     19Match 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''
    1821
    1922Actor condition requirements:
     
    3942 * PHY_AUTORESPONSE_TXACTION_CONFIG(''pktBuf'', ''translateHdr'', ''delay'', ''conditions''): Configure the actor to automatically transmit
    4043   * ''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)
    4245   * ''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
    4346   * ''conditions'': bitwise OR'd combination of actor condition flags; every condition must be met by a given reception to trigger the actor.
    4447 * PHY_AUTORESPONSE_ACTION_SETFLAGA_CONFIG(''conditions''): Configure the actor to set Flag A; ''conditions'' is a bitwise OR'd combination of actor condition requirements
    4548 * 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
     57mimo_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
     61mimo_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
     64PHY_HEADERTRANSLATE_SET(pktBuf_tx_ACK, (PKTHEADER_INDX_DSTADDR+0), pktBuf_rx, (PKTHEADER_INDX_SRCADDR+0));
     65PHY_HEADERTRANSLATE_SET(pktBuf_tx_ACK, (PKTHEADER_INDX_DSTADDR+1), pktBuf_rx, (PKTHEADER_INDX_SRCADDR+1));
     66
     67//Create a template ACK packet
     68templatePkt.header.fullRate = pktFullRate;
     69templatePkt.header.codeRate = pktCodeRate;
     70templatePkt.header.length = 0;
     71templatePkt.header.srcAddr = (unsigned short)(NODEID_TO_ADDR(myID));
     72templatePkt.header.pktType = ACKPACKET;
     73
     74//Copy the template ACK to the PHY packet buffer
     75warpmac_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
     78mimo_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
     83mimo_ofdmTxRx_setAction1(0);
     84mimo_ofdmTxRx_setAction2(0);
     85mimo_ofdmTxRx_setAction3(0);
     86mimo_ofdmTxRx_setAction4(0);
     87mimo_ofdmTxRx_setAction5(0);
     88
     89
     90
     91}}}