diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-10 00:37:55 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-10 00:37:55 +0000 |
commit | ded12d29fb6b85e39f14edc37a659e5eb5370e46 (patch) | |
tree | d6a9c907ecebcb65d54cd880136c9ec88a0106ee /host/include | |
parent | 8dd01e451e9102db06daed171c18d9fbb848df97 (diff) | |
parent | bf77d1f6e38e1cb561520408ecff8f633f5cefc7 (diff) | |
download | uhd-ded12d29fb6b85e39f14edc37a659e5eb5370e46.tar.gz uhd-ded12d29fb6b85e39f14edc37a659e5eb5370e46.tar.bz2 uhd-ded12d29fb6b85e39f14edc37a659e5eb5370e46.zip |
Merge branch 'error_handling' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/device.hpp | 2 | ||||
-rw-r--r-- | host/include/uhd/types/metadata.hpp | 29 |
2 files changed, 27 insertions, 4 deletions
diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp index a0c29f2e6..a19d22880 100644 --- a/host/include/uhd/device.hpp +++ b/host/include/uhd/device.hpp @@ -174,7 +174,7 @@ public: * \param metadata data to fill describing the buffer * \param io_type the type of data to fill into the buffer * \param recv_mode tells recv how to load the buffer - * \return the number of samples received + * \return the number of samples received or 0 on error */ virtual size_t recv( const std::vector<void *> &buffs, diff --git a/host/include/uhd/types/metadata.hpp b/host/include/uhd/types/metadata.hpp index 6712e2594..039196250 100644 --- a/host/include/uhd/types/metadata.hpp +++ b/host/include/uhd/types/metadata.hpp @@ -57,10 +57,33 @@ namespace uhd{ bool end_of_burst; /*! - * Error conditions (TODO): - * Previous packets dropped? - * Timed-out on receive? + * Error conditions: + * - none: no error associated with this metadata + * - timeout: no packet received, underlying code timed-out + * - late command: a stream command was issued in the past + * - broken chain: expected another stream command + * - overrun: an internal receive buffer has overrun + * - bad packet: the buffer was unrecognizable as a vrt packet + * + * Note: When an overrun occurs in continuous streaming mode, + * the device will continue to send samples to the host. + * For other streaming modes, streaming will discontinue + * until the user issues a new stream command. + * + * Note: The metadata fields have meaning for the following error codes: + * - none + * - late command + * - broken chain + * - overrun */ + enum error_code_t { + ERROR_CODE_NONE = 0x0, + ERROR_CODE_TIMEOUT = 0x1, + ERROR_CODE_LATE_COMMAND = 0x2, + ERROR_CODE_BROKEN_CHAIN = 0x4, + ERROR_CODE_OVERRUN = 0x8, + ERROR_CODE_BAD_PACKET = 0xf + } error_code; /*! * The default constructor: |