mickeyl / LTSupportAutomotive

An iOS / watchOS / macOS support library for OBD2, VIN-Decoding, and more.
MIT License
212 stars 59 forks source link

Transmitting DTCs using Swift #37

Open Berkelos opened 3 years ago

Berkelos commented 3 years ago

Hi,

I'm student from Czech Republic working right now on my thesis where I'm trying to use this library. Whole application is written in Swift with SwiftUI. Everything works fine but when I'm attempting to get DTCs whole communication fails. Here is the part of application that is causing the problems:

let dtcPids = [LTOBD2PID_STORED_DTC_03(),LTOBD2PID_PENDING_DTC_07(),LTOBD2PID_PERMANENT_DTC_0A()] self.obd2Adapter?.transmitMultipleCommands(dtcPids, completionHandler: { in self.dtcS = dtcPids[0].troubleCodes self.dtcP = dtcPids[1].troubleCodes self.dtcPer = dtcPids[2].troubleCodes })

I was also watching Demo application but didn't find solution.

jorgeflorescarlos commented 1 year ago

Try this `odb2Adapter?.transmitMultipleCommands([rpm], responseHandler: { commands in

            })`