diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-02-14 22:15:31 -0500 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-02-14 22:15:31 -0500 |
commit | 2a5be4ab15def6c876c7f70d0fa60cf6079166e7 (patch) | |
tree | 0d46fe3650b6ed360d49588e82687baf432a258a /src/uds/uds.h | |
parent | 2d59b8750a91bed55c8a7ee8caf6eb28c9091c05 (diff) |
Add helper functions to render requests and responses as strings.
Diffstat (limited to 'src/uds/uds.h')
-rw-r--r-- | src/uds/uds.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/uds/uds.h b/src/uds/uds.h index cb132330..3389adff 100644 --- a/src/uds/uds.h +++ b/src/uds/uds.h @@ -91,15 +91,23 @@ int diagnostic_payload_to_integer(const DiagnosticResponse* response); /* Public: Render a DiagnosticResponse as a string into the given buffer. * - * TODO implement this + * response - the response to convert to a string, for debug logging. + * destination - the target string buffer. + * destination_length - the size of the destination buffer, i.e. the max size + * for the rendered string. + */ +void diagnostic_response_to_string(const DiagnosticResponse* response, + char* destination, size_t destination_length); + +/* Public: Render a DiagnosticRequest as a string into the given buffer. * - * message - the response to convert to a string, for debug logging. + * request - the request to convert to a string, for debug logging. * destination - the target string buffer. * destination_length - the size of the destination buffer, i.e. the max size * for the rendered string. */ -// void diagnostic_response_to_string(const DiagnosticResponse* response, - // char* destination, size_t destination_length); +void diagnostic_request_to_string(const DiagnosticRequest* request, + char* destination, size_t destination_length); /* Public: For many OBD-II PIDs with a numerical result, translate a diagnostic * response payload into a meaningful number using the standard formulas. |