9b4ea92d788e1e07cf8dd7d6e5fe562d8178631e
[apps/low-level-can-service.git] / src / obd2 / obd2.c
1 #include <obd2/obd2.h>
2
3 DiagnosticShims diagnostic_init_shims(LogShim log,
4         SendCanMessageShim send_can_message,
5         SetTimerShim set_timer) {
6 }
7
8 DiagnosticRequestHandle diagnostic_request(DiagnosticShims* shims,
9         DiagnosticRequest* request, DiagnosticResponseReceived callback) {
10 }
11
12 // decide mode 0x1 / 0x22 based on pid type
13 DiagnosticRequestHandle diagnostic_request_pid(DiagnosticShims* shims,
14         DiagnosticPidRequestType pid_request_type, uint16_t pid,
15         DiagnosticResponseReceived callback) {
16 }
17
18 // TODO request malfunction indicator light (MIL) status - request mode 1 pid 1,
19 //      parse first bit
20 DiagnosticRequestHandle diagnostic_request_malfunction_indicator_status(
21         DiagnosticShims* shims,
22         DiagnosticMilStatusReceived callback) {
23 }
24
25 DiagnosticRequestHandle diagnostic_request_vin(DiagnosticShims* shims,
26         DiagnosticVinReceived callback) {
27 }
28
29 DiagnosticRequestHandle diagnostic_request_dtc(DiagnosticShims* shims,
30         DiagnosticTroubleCodeType dtc_type,
31         DiagnosticTroubleCodesReceived callback) {
32 }
33
34 bool diagnostic_clear_dtc(DiagnosticShims* shims) {
35 }
36
37 // before calling the callback, split up the received bytes into 1 or 2 byte
38 // chunks depending on the mode so the final pid list is actual 1 or 2 byte PIDs
39 // TODO request supported PIDs  - request PID 0 and parse 4 bytes in response
40 DiagnosticRequestHandle diagnostic_enumerate_pids(DiagnosticShims* shims,
41         DiagnosticRequest* request, DiagnosticPidEnumerationReceived callback) {
42 }
43
44 void diagnostic_receive_can_frame(DiagnosticRequestHandle* handler,
45         const uint16_t arbitration_id, const uint8_t data[],
46         const uint8_t size) {
47 }