+ // Send frame and make sure all bytes are transmitted\r
+ size_t tx_size = offsetof(UsbResponse, d) + datalen;\r
+ if (usb_write((uint8_t*)&txcmd, tx_size) != 0) return false;\r
+\r
+ return true;\r
+}\r
+\r
+\r
+// For compatibility only: legacy function to send a response with fixed size to the client via USB\r
+bool cmd_send_old(uint16_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, uint16_t datalen) {\r
+\r
+ UsbCommand txcmd;\r
+\r
+ // Compose the outgoing response frame\r