X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fuds%2Fuds.h;h=0d40561a2951940f58fce96e864ebe2627e5eea0;hb=57e39cc9e9840f4d17323ce8cfe1a7c20cf2d3a5;hp=cb1323303d8d2f80e0a92ab0e74c8182dd0a1b5b;hpb=2ec5044b09a9c5ff9ffa1531371cc5095e278d3d;p=apps%2Flow-level-can-service.git diff --git a/src/uds/uds.h b/src/uds/uds.h index cb13233..0d40561 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. @@ -109,8 +117,7 @@ int diagnostic_payload_to_integer(const DiagnosticResponse* response); * Returns the translated value or 0 if the PID is not in the OBD-II standard or * does not use a numerical value (e.g. VIN). */ -float diagnostic_decode_obd2_pid(const DiagnosticResponse* response, - int parsed_payload); +float diagnostic_decode_obd2_pid(const DiagnosticResponse* response); #ifdef __cplusplus }