Draft work using more generic bitfield functions.
authorChristopher Peplin <chris.peplin@rhubarbtech.com>
Sat, 28 Dec 2013 20:42:29 +0000 (15:42 -0500)
committerChristopher Peplin <chris.peplin@rhubarbtech.com>
Sat, 28 Dec 2013 20:42:29 +0000 (15:42 -0500)
deps/canutil
src/isotp/receive.c

index 04a4db7..0b00bb6 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 04a4db7d336ae2cae94ac3234086b22fbf1339f0
+Subproject commit 0b00bb6c3c5df70317775efd12b6fff418ff4540
index b497809..51562fc 100644 (file)
@@ -17,10 +17,12 @@ void isotp_receive_can_frame(IsoTpHandler* handler,
 
     // TODO use CanMessage struct from canutil library - allocate payload buffer
     // on stack, 8 bytes
-    // TODO  this function should receive uint64_t...
     IsoTpProtocolControlInformation pci = (IsoTpProtocolControlInformation)
             getBitField(data, 0, 4, false);
 
+    IsoTpProtocolControlInformation pci = (IsoTpProtocolControlInformation)
+            getNibble(0, data, 64, LITTE_ENDIAN);
+
     // TODO this is messed up! need a better API for grabbing bytes
     uint8_t payload_length = getBitField(data, 4, 4, false);
     uint8_t payload[payload_length];