commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: gnychis
Subject: [Commit-gnuradio] r5901 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Wed, 4 Jul 2007 10:17:48 -0600 (MDT)

Author: gnychis
Date: 2007-07-04 10:17:47 -0600 (Wed, 04 Jul 2007)
New Revision: 5901

Modified:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
Log:
Returning information about I2C writes for the stubs


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-07-03 21:36:41 UTC (rev 5900)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
   2007-07-04 16:17:47 UTC (rev 5901)
@@ -537,10 +537,17 @@
       case OP_I2C_WRITE:
       {
         pmt_t i2c_addr    = pmt_from_long((subpkt >> CS_I2CADDR_SHIFT) & 
CS_I2CADDR_MASK);
+
+        // The length includes an extra 2 bytes for storing the mbz and addr
+        pmt_t i2c_data    = pmt_make_u8vector(len-2, 0);
+
+        // Get a writeable address to copy the data from the packet
+        size_t ignore;
+        uint8_t *w_data = (uint8_t *) 
pmt_u8vector_writeable_elements(i2c_data, ignore);
+        memcpy(w_data, d_payload + payload_offset + 4, len-2);
+
         
-        // FIXME: need code to make u8 vector of size after reading the length
-        // field then memcpy in to a writeable address and return the pmt
-        return PMT_NIL;
+        return pmt_list3(s_op_i2c_write, i2c_addr, i2c_data);
       }
 
       case OP_I2C_READ:





reply via email to

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