diff options
Diffstat (limited to 'src/uds')
-rw-r--r-- | src/uds/uds.c | 3 | ||||
-rw-r--r-- | src/uds/uds_types.h | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/uds/uds.c b/src/uds/uds.c index f38c6aac..9fec9a88 100644 --- a/src/uds/uds.c +++ b/src/uds/uds.c @@ -87,6 +87,7 @@ DiagnosticRequestHandle diagnostic_request(DiagnosticShims* shims, handle.isotp_shims = isotp_init_shims(shims->log, shims->send_can_message, shims->set_timer); + handle.isotp_shims.frame_padding = !request->no_frame_padding; handle.isotp_send_handle = isotp_send(&handle.isotp_shims, request->arbitration_id, payload, @@ -121,7 +122,7 @@ DiagnosticRequestHandle diagnostic_request(DiagnosticShims* shims, // that are just called continuously from the main loop. it's a waste of a // few cpu cycles but it may be more natural than callbacks. // - // what woudl a timer callback look like...it would need to pass the handle + // what would a timer callback look like...it would need to pass the handle // and that's all. seems like a context void* would be able to capture all // of the information but arg, memory allocation. look at how it's done in // the other library again diff --git a/src/uds/uds_types.h b/src/uds/uds_types.h index 88c7ce44..10d15d62 100644 --- a/src/uds/uds_types.h +++ b/src/uds/uds_types.h @@ -42,6 +42,10 @@ typedef enum { * payload - (optional) The payload for the request, if the request requires * one. If payload_length is 0 this field is ignored. * payload_length - The length of the payload, or 0 if no payload is used. + * no_frame_padding - false if sent CAN payloads should *not* be padded out to a + * full 8 byte CAN frame. Many ECUs require this, but others require the + * size of the CAN message to only be the actual data. By default padding + * is enabled (so this struct value can default to 0). * type - the type of the request (TODO unused) */ typedef struct { @@ -52,6 +56,7 @@ typedef struct { uint8_t pid_length; uint8_t payload[MAX_UDS_PAYLOAD_LENGTH]; uint8_t payload_length; + bool no_frame_padding; DiagnosticRequestType type; } DiagnosticRequest; |