Skip to content

Commit e14bacc

Browse files
committed
Add invalid session error definition and increase max payload from 513 to 4096
1 parent 2d158a3 commit e14bacc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/uds/uds.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static uint16_t autoset_pid_length(uint8_t mode, uint16_t pid,
7272

7373
static void send_diagnostic_request(DiagnosticShims* shims,
7474
DiagnosticRequestHandle* handle) {
75-
uint8_t payload[512] = {0};
75+
uint8_t payload[4096] = {0};
7676
payload[MODE_BYTE_INDEX] = handle->request.mode;
7777
if(handle->request.has_pid) {
7878
handle->request.pid_length = autoset_pid_length(handle->request.mode,

src/uds/uds_types.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extern "C" {
2424
// multiframe response. May need to dynamically allocate in the future.
2525
#define MAX_UDS_RESPONSE_PAYLOAD_LENGTH 127
2626
#endif
27-
#define MAX_UDS_REQUEST_PAYLOAD_LENGTH 513
27+
#define MAX_UDS_REQUEST_PAYLOAD_LENGTH 4096
2828
#define MAX_RESPONDING_ECU_COUNT 8
2929
#define VIN_LENGTH 17
3030

@@ -96,7 +96,8 @@ typedef enum {
9696
NRC_TIME_DELAY_NOT_EXPIRED = 0x37,
9797
NRC_GENERIC_PROGRAMMING_FAILURE = 0x48,
9898
NRC_TRANSFER_SUSPENDED = 0x71,
99-
NRC_RESPONSE_PENDING = 0x78
99+
NRC_RESPONSE_PENDING = 0x78,
100+
NRC_INVALID_SESSION = 0x7F,
100101
} DiagnosticNegativeResponseCode;
101102

102103
/* Public: A partially or fully completed response to a diagnostic request.

0 commit comments

Comments
 (0)