usb-can icon indicating copy to clipboard operation
usb-can copied to clipboard

Extended Frames not working

Open Duality4Y opened this issue 1 year ago • 4 comments

Hello, Thank you very much for this useful utility!!

I am using the usb-can dongle to debug connections with an STM32F103 using Standard frames and that works, However I Want to use Extended frames, so I changed the source in such a way hoping to enable Extended frames:

diff --git a/canusb.c b/canusb.c
index d1aaba2..464b2cf 100644
--- a/canusb.c
+++ b/canusb.c
@@ -407,7 +407,7 @@ static int inject_data_frame(int tty_fd, const char *hex_id, const char *hex_dat
         binary_data[i]++;
     }
 
-    error = send_data_frame(tty_fd, CANUSB_FRAME_STANDARD, binary_id_lsb, binary_id_msb, binary_data, data_len);
+    error = send_data_frame(tty_fd, CANUSB_FRAME_EXTENDED, binary_id_lsb, binary_id_msb, binary_data, data_len);
   }
 
   return error;
@@ -606,7 +606,8 @@ int main(int argc, char *argv[])
     return EXIT_FAILURE;
   }
 
-  command_settings(tty_fd, speed, CANUSB_MODE_NORMAL, CANUSB_FRAME_STANDARD);
+  // command_settings(tty_fd, speed, CANUSB_MODE_NORMAL, CANUSB_FRAME_STANDARD);
+  command_settings(tty_fd, speed, CANUSB_MODE_NORMAL, CANUSB_FRAME_EXTENDED);
 
   if (inject_data == NULL) {
     /* Dumping mode (default). */

but it does not work and only produces standard frames

Duality4Y avatar Nov 15 '23 08:11 Duality4Y