X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=usrp2%2Fhost%2Finclude%2Fusrp2%2Fmetadata.h;fp=usrp2%2Fhost%2Finclude%2Fusrp2%2Fmetadata.h;h=8a95c38592e8330a722e066bf5d13fab686fdb57;hb=ea29b08aeb54227e6628f655ccfdb96fe4d8c378;hp=0000000000000000000000000000000000000000;hpb=09a1e803a9e6587c78d20cdf16891e5295874668;p=debian%2Fgnuradio diff --git a/usrp2/host/include/usrp2/metadata.h b/usrp2/host/include/usrp2/metadata.h new file mode 100644 index 00000000..8a95c385 --- /dev/null +++ b/usrp2/host/include/usrp2/metadata.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2008 Free Software Foundation, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef INCLUDED_USRP2_METADATA_H +#define INCLUDED_USRP2_METADATA_H + +#include + +namespace usrp2 { + + //! type of the timestamp returned from the USRP2 FPGA + typedef uint32_t fpga_timestamp; + + /*! + * \brief metadata associated with received frames + * \ingroup usrp2 + */ + struct rx_metadata { + uint32_t word0; //< debugging, extensions + fpga_timestamp timestamp; //< time that first sample of frame was received + unsigned int start_of_burst : 1; //< this frame is the start of a burst + unsigned int end_of_burst : 1; //< this frame is the end of a burst + unsigned int rx_overrun : 1; //< An Rx overrun occurred in the FPGA + // rssi + // agc_mode + + rx_metadata() : + word0(0), timestamp(0), start_of_burst(0), end_of_burst(0), rx_overrun(0) {} + }; + + /*! + * \brief metadata associated with transmitted frames + * \ingroup usrp2 + */ + struct tx_metadata { + fpga_timestamp timestamp; //< time to transmit first sample of frame + unsigned int send_now : 1; //< ignore timestamp, send now + unsigned int start_of_burst : 1; //< this frame is the start of a burst + unsigned int end_of_burst : 1; //< this frame is the end of a burst + // ... + + tx_metadata() : + timestamp(0), send_now(0), start_of_burst(0), end_of_burst(0) {} + }; + +}; // usrp2 + +#endif /* INCLUDED_USRP2_METADATA_H */