X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fuds%2Fuds_types.h;h=66bf743776de822bfb0c51b7f9e710ab768b7f9d;hb=6e6ffb3c8871f25b6df649dc35008ec075da0b2f;hp=68d6b6f562fc1c2a904fe4ff77ee68d0599c5078;hpb=b2033dd734c689701d0e1c8518a04a3304a3c6c3;p=apps%2Flow-level-can-service.git diff --git a/src/uds/uds_types.h b/src/uds/uds_types.h index 68d6b6f..66bf743 100644 --- a/src/uds/uds_types.h +++ b/src/uds/uds_types.h @@ -9,9 +9,10 @@ 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 @@ -54,7 +55,7 @@ typedef struct { 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; @@ -92,6 +93,8 @@ typedef enum { * 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. @@ -106,12 +109,13 @@ typedef enum { 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;