Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom comand. How to get string data from Descriptor or Response? #13

Open
Igorsnaki opened this issue Nov 22, 2017 · 3 comments
Open

Comments

@Igorsnaki
Copy link

Hi all!

Thanks for a great OBD lib.
I just start investigate it and I have a question:

For example I want to get car temperature, using custom comand:

 obd.request(command: Command.Custom.digit(mode: 01, pid: 05)) { (descr) in
           if let response = descr?.response {
               print(response)
           } 
       }

In logs I recieve such data:

Write to OBD Optional("01 05\r")
Wrote 6 bytes
Read 10 bytes
Read 10 bytes
Read 2 bytes
Read complete
41 05 80
41 05 81

Using lib I receive descriptor:
from descriptor I can get Response.
What next steps???
How can I get such command : 41 05 80 ??

screen shot 2017-11-21 at 6 59 37 pm copy

desc?.gerResponse = nil

I can get only : desc.response
But : Response has interface:
public var strigDescriptor: String?
public static func ==(lhs: Response, rhs: Response) -> Bool
public var hasData: Bool { get }

@nathjwhite
Copy link

Are you looking for the metric temperature response?
If so, try this:

let resp = descriptor?.valueMetrics

@Cleversou1983
Copy link

Hi there! How about AT commands? valueMetrics doesn't work...

Request operation completed
Write to OBD Optional("AT RV\r")
Wrote 6 bytes
Read 10 bytes
Read complete
12.4V

But I get NIL ....

@Cleversou1983
Copy link

@Igorsnaki Did managed how to get the data from AT commands?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants