Changes between Version 9 and Version 10 of OFDM/MIMO/Docs/AutoResponse


Ignore:
Timestamp:
Aug 29, 2009, 3:20:43 PM (15 years ago)
Author:
murphpo
Comment:

--

Legend:

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

    v9 v10  
    5656The examples below illustrate how to use the OFDM PHY's auto response subsystem. These examples include only the auto responder configuration code. Please refer to the latest [wiki:OFDMReferenceDesign OFDM Reference Design] for a full hardware-ready MAC/PHY example which uses this code.
    5757
    58 The examples below assume each packet has a 24-byte header, using the format of {{phyHeader}} from [source:/PlatformSupport/WARPMAC/warpphy.h warpphy.h]. Specifically, the examples assume the header has fields:
     58The examples below assume each packet has a 24-byte header, using the format of {{{phyHeader}}} from [source:/PlatformSupport/WARPMAC/warpphy.h warpphy.h]. Specifically, the examples assume the header has fields:
    5959{{{
    6060#!C
     
    6464unsigned char pktType;          //Packet type
    6565}}}
     66
     67The examples assume some values are defined elsewhere in user code. These variables are used for convenience, and are borrowed from our full MAC implementations in the [wiki:OFDMReferenceDesign OFDM Reference Design].
     68 * {{{PKTHEADER_INDX_TYPE}}}: is the byte index of the pktType field in the header
     69 * {{{PKTHEADER_INDX_RELADDR}}}: is the byte index of the relAddr field in the header
     70 * {{{PKTHEADER_INDX_SRCADDR}}}: is the byte index of the srcAddr field in the header
     71 * {{{PKTHEADER_INDX_DSTADDR}}}: is the byte index of the dstAddr field in the header
     72 * {{{ACKPACKET}}}: and DATAPACKET are (unsigned char) values specifying packet types
     73 * {{{MY_ADDR}}}: is the (unsigned short int) value of the local node's MAC address
     74 * {{{pktBuf_tx_ACK}}}: is the index (in [1,30]) of a PHY packet buffer used for transmitting ACKs
     75 * {{{pktBuf_rx}}}: is the index (in [1,30]) of the PHY packet buffer where received packets are written
    6676
    6777=== Automatic ACKs ===
     
    108118
    109119}}}
     120
     121=== Simple Multi-hop ===
     122This example configures the PHY to automatically re-transmit received DATA packets, overwriting the source MAC address with the node's own address.
     123
     124{{{
     125#!C
     126//Configure match unit 0 to search for packets whose relay address matches this node's address
     127// Looks for 2 bytes starting at index PKTHEADER_INDX_RELAYADDR with value MY_ADDR
     128mimo_ofdmTxRx_setMatch0( PHY_AUTORESPONSE_MATCH_CONFIG(PKTHEADER_INDX_RELADDR, 2, MY_ADDR) );
     129
     130//Configure match unit 1 to search for DATA packets
     131// Looks for 1 byte starting at index PKTHEADER_INDX_TYPE with value DATAPACKET
     132mimo_ofdmTxRx_setMatch1( PHY_AUTORESPONSE_MATCH_CONFIG(PKTHEADER_INDX_TYPE, 1, DATAPACKET) );
     133
     134//Configure the header translator to replace the outgoing source address with the received relay address
     135PHY_HEADERTRANSLATE_SET(pktBuf_rx, (PKTHEADER_INDX_SRCADDR+0), pktBuf_rx, (PKTHEADER_INDX_RELADDR+0));
     136PHY_HEADERTRANSLATE_SET(pktBuf_rx, (PKTHEADER_INDX_SRCADDR+1), pktBuf_rx, (PKTHEADER_INDX_RELADDR+1));
     137
     138//Configure actor 0 to transit the received packet using the header translator
     139// after 5µs when the PHY receives a good data packet using this node as a relay
     140mimo_ofdmTxRx_setAction0(
     141        PHY_AUTORESPONSE_TXACTION_CONFIG(pktBuf_rx, PHY_AUTORESPONSE_ACT_TRANS_HDR, 20,
     142                (PHY_AUTORESPONSE_REQ_MATCH0 | PHY_AUTORESPONSE_REQ_MATCH1 | PHY_AUTORESPONSE_REQ_GOODHDR | PHY_AUTORESPONSE_REQ_GOODPKT)));
     143
     144//Disable the unused actors
     145mimo_ofdmTxRx_setAction1(0);
     146mimo_ofdmTxRx_setAction2(0);
     147mimo_ofdmTxRx_setAction3(0);
     148mimo_ofdmTxRx_setAction4(0);
     149mimo_ofdmTxRx_setAction5(0);
     150}}}