extern "C" {
#endif
-// TODO This isn't true for multi frame messages - we may need to dynamically
-// allocate this in the future
-#define MAX_UDS_PAYLOAD_LENGTH 7
+// TODO This still doesn't have enough space for the largest possible
+// multiframe response. May need to dynamically allocate in the future.
+#define MAX_UDS_RESPONSE_PAYLOAD_LENGTH 255
+#define MAX_UDS_REQUEST_PAYLOAD_LENGTH 7
#define MAX_RESPONDING_ECU_COUNT 8
#define VIN_LENGTH 17
bool has_pid;
uint16_t pid;
uint8_t pid_length;
- uint8_t payload[MAX_UDS_PAYLOAD_LENGTH];
+ uint8_t payload[MAX_UDS_REQUEST_PAYLOAD_LENGTH];
uint8_t payload_length;
bool no_frame_padding;
DiagnosticRequestType type;
* field isn't valid if 'completed' isn't true. If this is 'false', check
* the negative_response_code field for the reason.
* arbitration_id - The arbitration ID the response was received on.
+ * multi_frame - True if this response (whether completed or not) required
+ * multi-frame CAN support. Can be used for updating time-out functions.
* mode - The OBD-II mode for the original request.
* has_pid - If this is a response to a PID request, this will be true and the
* 'pid' field will be valid.
typedef struct {
bool completed;
bool success;
+ bool multi_frame;
uint32_t arbitration_id;
uint8_t mode;
bool has_pid;
uint16_t pid;
DiagnosticNegativeResponseCode negative_response_code;
- uint8_t payload[MAX_UDS_PAYLOAD_LENGTH];
+ uint8_t payload[MAX_UDS_RESPONSE_PAYLOAD_LENGTH];
uint8_t payload_length;
} DiagnosticResponse;