commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4944 - gnuradio/branches/developers/gnychis/inband/us


From: gnychis
Subject: [Commit-gnuradio] r4944 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Tue, 10 Apr 2007 16:58:12 -0600 (MDT)

Author: gnychis
Date: 2007-04-10 16:58:11 -0600 (Tue, 10 Apr 2007)
New Revision: 4944

Removed:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.cc
Modified:
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
Log:
Moving the USB packet class methods back in to the class body definition for 
inline compiler optimization possibility



Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am    
    2007-04-10 21:17:37 UTC (rev 4943)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am    
    2007-04-10 22:58:11 UTC (rev 4944)
@@ -31,7 +31,6 @@
 
 BUILT_SOURCES =                                \
        usrp_server_mbh.cc              
-       usrp_inband_usb_packet.cc
 
 usrp_server_mbh.cc : usrp_server.mbh
        $(COMPILE_MBH) usrp_server.mbh usrp_server_mbh.cc
@@ -39,8 +38,7 @@
 
 libinband_la_SOURCES =                 \
        $(BUILT_SOURCES)                \
-       usrp_server.cc                  \
-       usrp_inband_usb_packet.cc
+       usrp_server.cc                  
 
 libinband_la_LIBADD =                  \
        $(MBLOCK_LA)                    

Deleted: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.cc

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
   2007-04-10 21:17:37 UTC (rev 4943)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
   2007-04-10 22:58:11 UTC (rev 4944)
@@ -19,6 +19,12 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#ifndef INCLUDED_USRP_INBAND_USB_PACKET_H_
+#define INCLUDED_USRP_INBAND_USB_PACKET_H_
+
+#include <usrp_bytesex.h>
+#include <mb_mblock.h>
+
 static const int USB_PKT_SIZE = 512;   // bytes
 
 class usrp_inband_usb_packet {
@@ -61,18 +67,72 @@
 
 public:
   
-  void set_timestamp(uint32_t timestamp);
-  void set_header(int flags, int chan, int tag, int payload_len);
-  uint32_t timestamp() const;
-  int rssi() const;
-  int chan() const;
-  int tag() const;
-  int payload_len() const;
-  int flags() const;
-  int overrun() const;
-  int underrun() const;
-  int start_of_burst() const;
-  int end_of_burst() const;
-  int dropped() const;
-  unsigned char *payload();
+  void set_timestamp(uint32_t timestamp){
+    d_timestamp = host_to_usrp_u32(timestamp);
+  }
+
+  void set_header(int flags, int chan, int tag, int payload_len){
+    uint32_t word0 =  ((flags & FL_ALL_FLAGS)
+                       | ((chan & CHAN_MASK) << CHAN_SHIFT)
+                       | ((tag & TAG_MASK) << TAG_SHIFT)
+                       | ((payload_len & PAYLOAD_LEN_MASK) << 
PAYLOAD_LEN_SHIFT));
+    d_word0 = host_to_usrp_u32(word0);
+  }
+  
+  uint32_t timestamp() const {
+    return usrp_to_host_u32(d_timestamp);
+  }
+
+  int rssi() const {
+    uint32_t word0 = usrp_to_host_u32(d_word0);
+    return (word0 >> RSSI_SHIFT) & RSSI_MASK;
+  }
+
+  int chan() const {
+    uint32_t word0 = usrp_to_host_u32(d_word0);
+    return (word0 >> CHAN_SHIFT) & CHAN_MASK;
+  }
+
+  int tag() const {
+    uint32_t word0 = usrp_to_host_u32(d_word0);
+    return (word0 >> TAG_SHIFT) & TAG_MASK;
+  }
+
+  int payload_len() const {
+    uint32_t word0 = usrp_to_host_u32(d_word0);
+    return (word0 >> PAYLOAD_LEN_SHIFT) & PAYLOAD_LEN_MASK;
+  }
+  
+  int flags() const {
+    return usrp_to_host_u32(d_word0) & FL_ALL_FLAGS;
+  }
+
+  int overrun() const {
+    return (usrp_to_host_u32(d_word0) & FL_OVERRUN) >> FL_OVERRUN_SHIFT;
+  }
+  
+
+  int underrun() const {
+    return (usrp_to_host_u32(d_word0) & FL_UNDERRUN) >> FL_UNDERRUN_SHIFT;
+  }
+
+
+  int start_of_burst() const {
+    return (usrp_to_host_u32(d_word0) & FL_START_OF_BURST) >> 
FL_START_OF_BURST_SHIFT;
+  }
+
+  int end_of_burst() const {
+    return (usrp_to_host_u32(d_word0) & FL_END_OF_BURST) >> 
FL_END_OF_BURST_SHIFT;
+  }
+
+  int dropped() const {
+    return (usrp_to_host_u32(d_word0) & FL_DROPPED) >> FL_DROPPED_SHIFT;
+  }
+
+  unsigned char *payload() { 
+    return d_payload; 
+  }
+
 };
+
+#endif





reply via email to

[Prev in Thread] Current Thread [Next in Thread]